[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/hyperbole-merge-7.0.2b ad584fd 11/23: Use implicit button
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/hyperbole-merge-7.0.2b ad584fd 11/23: Use implicit button org-mode also for org derived modes |
Date: |
Tue, 5 Feb 2019 16:11:19 -0500 (EST) |
branch: scratch/hyperbole-merge-7.0.2b
commit ad584fd453c783957dc08513be91a31c95cfea37
Author: Mats Lidell <address@hidden>
Commit: Mats Lidell <address@hidden>
Use implicit button org-mode also for org derived modes
Plus force cycling through all display views for a heading.
---
hsys-org.el | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/hsys-org.el b/hsys-org.el
index f9604db..05ae899 100644
--- a/hsys-org.el
+++ b/hsys-org.el
@@ -4,16 +4,16 @@
;;
;; Orig-Date: 2-Jul-16 at 14:54:14
;;
-;; Copyright (C) 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2016,2018 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
;;; Commentary:
;;
-;; This defines a context-sensitive implicit button type, org-mode, triggered
-;; when the major mode is org-mode and point is anywhere other than
-;; the end of a line.
+;; This defines a context-sensitive implicit button type, org-mode,
+;; triggered when the major mode is org-mode or is derived from org
+;; mode and point is anywhere other than at the end of a line.
;; When:
;; on an Org mode link - displays the link referent
;; on an Org mode heading - cycles through the available display
@@ -28,6 +28,20 @@
(require 'hbut)
(require 'org)
+(defun hsys-org-cycle ()
+ "Call org-cycle faking this- and last-command in order to cycle
+through all states"
+ (setq last-command 'org-cycle
+ this-command 'org-cycle)
+ (org-cycle))
+
+(defun hsys-org-global-cycle ()
+ "Call org-global-cycle faking this- and last-command in order
+to cycle through all states"
+ (setq last-command 'org-cycle
+ this-command 'org-cycle)
+ (org-global-cycle nil))
+
;;; ************************************************************************
;;; Public Button Types
;;; ************************************************************************
@@ -37,22 +51,22 @@
The variable, `browse-url-browser-function', customizes the url browser that
is used for urls. Valid values of this variable include
`browse-url-default-browser'
and `browse-url-generic'."
- (when (eq major-mode 'org-mode)
+ (when (derived-mode-p 'org-mode)
(cond ((org-link-at-p)
(hact 'org-link nil))
((org-at-heading-p)
- (hact 'org-cycle nil))
+ (hact 'hsys-org-cycle))
(t (hact 'org-meta-return)))))
(defun org-mode:help (&optional _but)
"If on an Org mode heading, cycles through views of the whole buffer outline.
If on an Org mode link, displays standard Hyperbole help."
- (when (eq major-mode 'org-mode)
+ (when (derived-mode-p 'org-mode)
(cond ((org-link-at-p)
(hkey-help current-prefix-arg)
t)
((org-at-heading-p)
- (org-global-cycle nil)
+ (hact 'hsys-org-global-cycle)
t))))
(defact org-link (link)
- [elpa] branch scratch/hyperbole-merge-7.0.2b created (now c75213b), Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b e803881 01/23: Fixed a cyclic Lisp library require; improved multi-frame hkey-throw, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b b7beb76 02/23: Fixed hkey-throw temporary display of a buffer in a new frame, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 7efe2f2 03/23: Removed Koutliner use of filladapt mode; it can cause filling errors, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 30600eb 04/23: Added extensive gitlab-reference ibtype; improved github-reference, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 1568adb 07/23: Merge Mats TEXINFO_SRC Makefile changes, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b ad584fd 11/23: Use implicit button org-mode also for org derived modes,
Stefan Monnier <=
- [elpa] scratch/hyperbole-merge-7.0.2b f446ee0 22/23: Fixed README.md typo that referred to HY-ABOUT instead of HY-NEWS., Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 45a0841 12/23: Add default search term for web searches, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b d4653c5 10/23: Require 2.0 of treemacs and use bury-buffer, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b c0bd503 05/23: Rebuild doc when doc sources have changed, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 5892083 09/23: Use new treemacs 1.18 function treemacs-toggle-node, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 450489e 13/23: Adjust tramp-file-name-regexp to work with looking-at, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 2e878cb 16/23: Initial commit of Windows path handling, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b d729726 21/23: Merge branch 'master' of github.com:rswgnu/hyperbole, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 66106d3 08/23: Fixed issue with inhibit-hyperbole-messaging not be set properly, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b afe3db8 06/23: Added 'k' to klink ids exported to html;, Stefan Monnier, 2019/02/05