branch: externals/hyperbole commit f01441a2a6fb3942f47a7ec8d7e3daf3522d4bb2 Author: Bob Weiner <r...@gnu.org> Commit: Bob Weiner <r...@gnu.org>
Where Hyperbole C-c keys interfere with Org or Outline modes, defer to other modes' bindings --- ChangeLog | 17 +++++++++++++++++ hui-select.el | 44 ++++++++++++++++++++++++++++---------------- hycontrol.el | 35 +++++++++++++++++++++++++---------- 3 files changed, 70 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ad577ec97..38105005f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2022-01-31 Bob Weiner <r...@gnu.org> + +* hui-select.el (hui-select-thing): Hyperbole binds this to {C-c RET} which + conflicts with an Org mode binding, so if in Org mode, use its binding + when this command is called interactively from that key. + hycontrol.el (hycontrol-windows-grid): Hyperbole binds this to {C-c @} which + conflicts with bindings in Org mode, Outline mode and Outline minor mode. + Modify this command to use those bindings when called interactively from + that key. + hui-select.el (hui-select-goto-matching-delimiter): Hyperbole binds this to + {C-c .} which conflicts with an Org mode binding, so if in Org mode, use + its binding when this command is called interactively from that key. + 2022-01-30 Bob Weiner <r...@gnu.org> * hpath.el (hpath:at-p): Fix start and end delimiters to hargs:delimited so match @@ -18,6 +31,10 @@ (hpath:substitute-dir): Fix to make 'locate-file' call handle dirs, so final expansion can be a directory, e.g. on Macs App bundles are directories. +* hsmail.el: Switch from use of sendmail.el to message.el. + (message-send-hook): Remove use of advice-add which caused + a recursive loop. Add smail:widen to message-send-hook instead. + * hact.el (actype:act): Allow for builtin subr objects like 'cons'; This fixes Action Buttons that start with <progn ...>, for example. diff --git a/hui-select.el b/hui-select.el index d8a896ce42..e1cf5557df 100644 --- a/hui-select.el +++ b/hui-select.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 19-Oct-96 at 02:25:27 -;; Last-Mod: 24-Jan-22 at 00:18:48 by Bob Weiner +;; Last-Mod: 31-Jan-22 at 00:48:38 by Bob Weiner ;; ;; Copyright (C) 1996-2021 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. @@ -301,6 +301,11 @@ The non-nil value returned is the function to call to select that syntactic unit (interactive) (cond ((memq major-mode hui-select-markup-modes) (hui-select-goto-matching-tag)) + ((and (derived-mode-p 'org-mode) + (called-interactively-p 'interactive) + (equal (this-command-keys) "\C-c.")) + ;; Prevent a conflict with {C-c .} binding in Org mode + (call-interactively (lookup-key org-mode-map "\C-c."))) ((and (preceding-char) (or (= ?\) (char-syntax (preceding-char))) (= ?\" (preceding-char)))) (backward-sexp)) @@ -403,21 +408,28 @@ interactively, the type of selection is displayed in the minibuffer." ;; Reset selection based on the syntax of character at point. (hui-select-reset) nil))) - (let ((region (hui-select-get-region-boundaries))) - (unless region - (when (eq hui-select-previous 'punctuation) - (setq region (hui-select-word (point))))) - (when region - (goto-char (car region)) - (set-mark (cdr region)) - (when (fboundp 'activate-region) (activate-region)) - (when (and (boundp 'transient-mark-mode) - transient-mark-mode) - (setq mark-active t)) - (and (called-interactively-p 'interactive) hui-select-display-type - (message "%s" hui-select-previous)) - (run-hooks 'hui-select-thing-hook) - t))) + (cond ((and (derived-mode-p 'org-mode) + (called-interactively-p 'interactive) + (equal (this-command-keys) "\C-c\C-m")) + ;; Prevent a conflict with {C-c RET} binding in Org mode + (call-interactively (lookup-key org-mode-map "\C-c\C-m"))) + ;; + ;; No key conflicts, perform normal Hyperbole operation + (t (let ((region (hui-select-get-region-boundaries))) + (unless region + (when (eq hui-select-previous 'punctuation) + (setq region (hui-select-word (point))))) + (when region + (goto-char (car region)) + (set-mark (cdr region)) + (when (fboundp 'activate-region) (activate-region)) + (when (and (boundp 'transient-mark-mode) + transient-mark-mode) + (setq mark-active t)) + (and (called-interactively-p 'interactive) hui-select-display-type + (message "%s" hui-select-previous)) + (run-hooks 'hui-select-thing-hook) + t))))) ;;;###autoload (defun hui-select-thing-with-mouse (event) diff --git a/hycontrol.el b/hycontrol.el index f6e058d9c0..8dc6fd5264 100644 --- a/hycontrol.el +++ b/hycontrol.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 1-Jun-16 at 15:35:36 -;; Last-Mod: 29-Jan-22 at 16:03:51 by Bob Weiner +;; Last-Mod: 31-Jan-22 at 00:33:24 by Bob Weiner ;; ;; Copyright (C) 2016-2021 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. @@ -1525,15 +1525,30 @@ When done, this resets the persistent HyControl prefix argument to 1 to prevent following commands from using the often large grid size argument." (interactive "p") - (setq arg (prefix-numeric-value (or arg current-prefix-arg))) - (cond ((> arg 0) - (hycontrol-make-windows-grid arg)) - ((< arg 0) - (setq current-prefix-arg nil) - (call-interactively #'hycontrol-windows-grid-by-file-pattern)) - (t - (setq current-prefix-arg 0) - (call-interactively #'hycontrol-windows-grid-by-major-mode)))) + (let* ((key "\C-c@") + (this-key-flag (and (called-interactively-p 'interactive) + (equal (this-command-keys) key)))) + (cond ((and this-key-flag (derived-mode-p 'org-mode)) + ;; Prevent a conflict with binding in Org mode + (call-interactively (lookup-key org-mode-map key))) + ((and this-key-flag (derived-mode-p 'outline-mode)) + ;; Prevent a conflict with binding in Outline mode + (call-interactively (lookup-key outline-mode-map key))) + ((and this-key-flag (boundp 'outline-minor-mode) + outline-minor-mode) + ;; Prevent a conflict with binding in Outline minor mode + (call-interactively (lookup-key outline-minor-mode-map key))) + ;; + ;; No key conflicts, display window grid + (t (setq arg (prefix-numeric-value (or arg current-prefix-arg))) + (cond ((> arg 0) + (hycontrol-make-windows-grid arg)) + ((< arg 0) + (setq current-prefix-arg nil) + (call-interactively #'hycontrol-windows-grid-by-file-pattern)) + (t + (setq current-prefix-arg 0) + (call-interactively #'hycontrol-windows-grid-by-major-mode))))))) (defun hycontrol-windows-grid-by-buffer-list (buffers) "Display an automatically sized window grid showing list of BUFFERS."