branch: externals/hyperbole commit 577c3c1b13f4f25408efe68ec241040ad4c017f7 Author: bw <r...@gnu.org> Commit: bw <r...@gnu.org>
Fix Action Key not highlighting matching HTML tag pairs Fix hyperbole.texi pylib defact doc in manual. --- ChangeLog | 10 ++++++++++ hui-select.el | 53 ++++++++++++++++++++++++++++------------------------- man/hyperbole.texi | 6 +++--- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a4c5c60c8..02dbbe1f9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-09-02 Bob Weiner <r...@gnu.org> + +* man/hyperbole.texi (Action Button Link Types): Change PYTHONLIBPATH to + PYTHONPATH to match the example definition of 'pylib' in the 'defal' + macro documentation. + +* hui-select.el (hui-select-delimited-thing-call): FIX: Add setting of + missing 'hui-select-syntax-table' that was preventing the Action + Key from selecting markup pairs in HTML/Web modes. + 2024-09-01 Bob Weiner <r...@gnu.org> * man/dir (File): Narrow width to better fit with out Info entries. diff --git a/hui-select.el b/hui-select.el index 1ea2017594..988d880de2 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: 18-Aug-24 at 09:44:46 by Mats Lidell +;; Last-Mod: 2-Sep-24 at 19:32:34 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -789,14 +789,13 @@ The character at POS is selected if no other thing is matched." (- (cdr region) (car region))) (< region-size min-region)) (setq min-region region-size - result - (list - ;; The actual selection type is - ;; sometimes different than the one we - ;; originally tried, so recompute it here. - (car (assq hui-select-previous - hui-select-bigger-alist)) - (car region) (cdr region))))) + result (list + ;; The actual selection type is + ;; sometimes different than the one we + ;; originally tried, so recompute it here. + (car (assq hui-select-previous + hui-select-bigger-alist)) + (car region) (cdr region))))) hui-select-bigger-alist) (if result ;; Returns hui-select-region @@ -841,7 +840,7 @@ Typically: If `hui-select-char-p' is set non-nil, then as a fallback, the character at POS will be selected. -If an error occurs during syntax scanning, it returns nil." +If an error occurs during syntax scanning, return nil." (interactive "d") (setq hui-select-previous 'char) (if (save-excursion (goto-char pos) (eolp)) @@ -858,11 +857,11 @@ If an error occurs during syntax scanning, it returns nil." (defun hui-select-at-delimited-thing-p () "Return non-nil if point is at a delimited thing, else nil. -A delimited tings is a markup pair, list, array/vector, set, +A delimited thing is a markup pair, list, array/vector, set, comment or string. The non-nil value returned is the function to call to select that syntactic unit. -Ignores any match if on an Emacs button and instead returns nil." +Ignore any match if on an Emacs button and instead return nil." (unless (button-at (point)) (setq hkey-value (hui-select-delimited-thing-call #'hui-select-at-p)) (cond ((eq hkey-value 'hui-select-punctuation) @@ -975,19 +974,23 @@ call to select that syntactic unit." (unless (and (memq major-mode hui-select-ignore-quoted-sexp-modes) ;; Ignore quoted identifier sexpressions, like #'function (char-after) (memq (char-after) '(?# ?\'))) - (let ((hui-select-char-p) - (hui-select-whitespace) - (hui-select-syntax-alist '((?\" . hui-select-string) - (?\( . hui-select-sexp-start) - (?\$ . hui-select-sexp-start) - (?\' . hui-select-sexp-start) - (?\) . hui-select-sexp-end) - (?\< . hui-select-comment) - ;; Punctuation needed to match - ;; multi-char comment delimiters - (?\. . hui-select-punctuation)))) - (hui-select-reset) - (funcall func)))) + (with-syntax-table + (if (memq major-mode hui-select-ignore-quoted-sexp-modes) + (syntax-table) + hui-select-syntax-table) + (let ((hui-select-char-p) + (hui-select-whitespace) + (hui-select-syntax-alist '((?\" . hui-select-string) + (?\( . hui-select-sexp-start) + (?\$ . hui-select-sexp-start) + (?\' . hui-select-sexp-start) + (?\) . hui-select-sexp-end) + (?\< . hui-select-comment) + ;; Punctuation needed to match + ;; multi-char comment delimiters + (?\. . hui-select-punctuation)))) + (hui-select-reset) + (funcall func))))) (defun hui-select-region-bigger-p (old-region new-region) "Non-nil means the new region is bigger than the old region. diff --git a/man/hyperbole.texi b/man/hyperbole.texi index 2813ce4e22..e40ee134a5 100644 --- a/man/hyperbole.texi +++ b/man/hyperbole.texi @@ -7,7 +7,7 @@ @c Author: Bob Weiner @c @c Orig-Date: 6-Nov-91 at 11:18:03 -@c Last-Mod: 1-Sep-24 at 20:28:29 by Bob Weiner +@c Last-Mod: 2-Sep-24 at 19:50:16 by Bob Weiner @c %**start of header (This is for running Texinfo on a region.) @setfilename hyperbole.info @@ -7468,11 +7468,11 @@ button is activated and does one of four things with LINK-EXPR: @item invokes a function or action type of one argument, the button text sans the function name, to display it. @end enumerate -For example, if you use Python and have a @samp{PYTHONLIBPATH} environment +For example, if you use Python and have a @samp{PYTHONPATH} environment variable, then pressing @bkbd{C-x C-e} @code{eval-last-sexp} after this expression: -@code{(defal pylib "$@{PYTHONLIBPATH@}/%s")} +@code{(defal pylib "$@{PYTHONPATH@}/%s")} @noindent defines a new action button link type called ’pylib’ whose buttons