branch: externals/hyperbole commit a29b3551680e9b6dccdca5ea0def95c0f9f8c0d1 Author: Robert Weiner <r...@gnu.org> Commit: GitHub <nore...@github.com>
Fix smart-tag not finding some vars and markdown link handling (#396) * Fixes for direct link creation, path handling and org-id buttons * Bug fixes and link directly finalization for next major release * Updates to generated doc files * Remove leading blank lines inserted by viewer function * Temp remove use of org-mode in FAST-DEMO and Hypb file display The above makes all test cases run properly. For windows-grid, make BLANK buffers have an initial space in the name so is hidden in buffer lists. * Fix smart-tag not finding some vars and markdown link handling --- ChangeLog | 13 +++++++++++++ README | 4 ++++ README.md | 14 +++++++++----- hibtypes.el | 36 ++++++++++++------------------------ hmouse-tag.el | 45 +++++++++++++++++---------------------------- 5 files changed, 55 insertions(+), 57 deletions(-) diff --git a/ChangeLog b/ChangeLog index 062e97c95d..b8eccd33e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2023-10-21 Bob Weiner <r...@gnu.org> + +* hibtypes.el (markdown-follow-inline-link-p): Fix to process anchored + path links rather than dropping through to another ibtype since that + would trigger an error since point would have been moved in order to + leave it on the path and not the name part of a markdown link. Remove + need to move point by calling 'markdown-link-url'. + +* hmouse-tag.el (smart-lisp-find-tag): Fix that some tags were not found by + xref because this function turned on xref-etags-mode in Elisp files + rather than using its elisp backend. Remove that code. + (tags-fix): Remove optional load of this very old file. + 2023-10-09 Mats Lidell <ma...@gnu.org> * test/kotl-mode-tests.el (kotl-mode-kill-contents) diff --git a/README b/README index fd66ca1801..10f2eda1f8 100644 --- a/README +++ b/README @@ -107,6 +107,10 @@ distribution site is: https://www.gnu.org/software/hyperbole. If any term in here is new or unfamiliar to you, you can look it up in the Hyperbole Manual Glossary. +Unlock the power of GNU Hyperbole to make your information work for you. +One system. One language. One manual. One solution. Learn Hyperbole and +start moving further, faster. + =========================================================================== * Files =========================================================================== diff --git a/README.md b/README.md index 57fac24ed7..2a3d77946c 100644 --- a/README.md +++ b/README.md @@ -100,16 +100,16 @@ In short, Hyperbole lets you: reference from any other node; 4. Manage all your contacts or record-based, unstructured nodes quickly - with hierarchical categories; each entry can have embedded - hyperbuttons of any type. Or create an archive of documents with - hierarchical entries and use the same search mechanism to quickly find - any matching entry; + with hierarchical categories; each entry can have embedded + hyperbuttons of any type. Or create an archive of documents with + hierarchical entries and use the same search mechanism to quickly find + any matching entry; 5. Use single keys to easily manage your Emacs windows or frames and quickly retrieve saved window and frame configurations; 6. Search for things in your current buffers, in a directory tree or - across major web search engines with the touch of a few keys. + across major web search engines with the touch of a few keys. The common thread in all these features is making retrieval, management and display of information fast and easy. That is @@ -138,6 +138,10 @@ term in here is new or unfamiliar to you, you can look it up in the Hyperbole is available for [download and installation](#installation) through the GNU Emacs package manager. +Unlock the power of GNU Hyperbole to make your information work for you. +One system. One language. One manual. One solution. Learn Hyperbole and +start moving further, faster. + ## Mailing Lists - **hyperbole-us...@gnu.org** - User list for GNU Hyperbole diff --git a/hibtypes.el b/hibtypes.el index 05e8706658..18d0332319 100644 --- a/hibtypes.el +++ b/hibtypes.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 19-Sep-91 at 20:45:31 -;; Last-Mod: 3-Oct-23 at 17:21:27 by Mats Lidell +;; Last-Mod: 21-Oct-23 at 19:50:25 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -51,6 +51,7 @@ (declare-function markdown-footnote-marker-positions "ext:markdown") (declare-function markdown-footnote-return "ext:markdown") (declare-function markdown-link-p "ext:markdown") +(declare-function markdown-link-url "ext:markdown") (declare-function markdown-reference-goto-definition "ext:markdown") (declare-function markdown-reference-goto-link "ext:markdown") (declare-function markdown-wiki-link-p "ext:markdown") @@ -414,32 +415,19 @@ Return t if jump and nil otherwise." "If on an inline link, jump to its referent if it is absolute and return non-nil. Absolute means not relative within the file. Otherwise, if an internal link, move back to OPOINT and return nil." - (let (handle-link-flag - result) - (skip-chars-forward "^\]\[()") - (when (looking-at "\][\[()]") - (if (looking-at "\(") - (skip-chars-backward "^\]\[()") - (skip-chars-forward "\]\[\(")) - ;; Leave point on the link even if not activated - ;; here, so that other ibtypes activate it. If point is after - ;; the # character of an in-file link, then the following predicate - ;; fails and the `pathname' ibtype will handle it. If point is before - ;; the # character, the link is handled here. - (setq handle-link-flag (not (or (hpath:www-at-p) (hpath:at-p)))) - (when (setq result (and (markdown-link-p) handle-link-flag)) - ;; In-file referents are handled by the `pathname' implicit - ;; button type, not here. - (ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0)) + ;; Caller already checked not on a URL (handled elsewhere). + (let ((path (markdown-link-url))) + (goto-char opoint) + (when (markdown-link-p) + (ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0)) + (if path + (hact 'link-to-file path) (hpath:display-buffer (current-buffer)) - (hact 'markdown-follow-link-at-point))) - (when handle-link-flag - (goto-char opoint)) - result)) + (hact 'markdown-follow-link-at-point))))) (defib markdown-internal-link () "Display any in-file Markdown link referent at point. -Pathnames and urls are handled elsewhere." +Url links are handled elsewhere." (when (and (derived-mode-p 'markdown-mode) (not (hpath:www-at-p))) (let ((opoint (point)) @@ -456,7 +444,7 @@ Pathnames and urls are handled elsewhere." ;; Follows an absolute file link. (markdown-follow-inline-link-p opoint)) ;; May be on the name of an infile link, so move to the - ;; link itself and then let the `pathname' ibtype handle it. + ;; link itself and then display it as a pathname. (error (markdown-follow-inline-link-p opoint)))) ((markdown-wiki-link-p) (ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0)) diff --git a/hmouse-tag.el b/hmouse-tag.el index bd8dce6855..8067681cc8 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 24-Aug-91 -;; Last-Mod: 3-Oct-23 at 23:21:15 by Mats Lidell +;; Last-Mod: 21-Oct-23 at 10:45:26 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -21,14 +21,11 @@ (eval-and-compile (mapc #'require '(find-func hpath hui-select)) - (cond ((or (featurep 'etags) (featurep 'tags)) - nil) - (t - ;; Force use of .elc file here since otherwise the bin/etags - ;; executable might be found in a user's load-path by the load - ;; command. - (or (load "etags.elc" t nil t) - (load "tags-fix" t))))) + (unless (or (featurep 'etags) (featurep 'tags)) + ;; Force use of .elc file here since otherwise the bin/etags + ;; executable might be found in a user's load-path by the load + ;; command. + (load "etags.elc" t nil t))) ;; If etags utilizes the new xref.el library, define some helper ;; functions to simplify programming and fix one existing function. @@ -691,25 +688,17 @@ Use `hpath:display-buffer' to show definition or documentation." (widen) (goto-char (cdr result)) t)))) - ;; If elisp-flag is true, then make xref use tags tables to - ;; find symbols not yet loaded into Emacs; otherwise, use - ;; standard xref backends for the current language. - (t (let ((etags-mode (and elisp-flag (boundp 'xref-etags-mode) xref-etags-mode))) - (unwind-protect - (progn - (and (not etags-mode) elisp-flag (fboundp 'xref-etags-mode) - (xref-etags-mode 1)) - (condition-case () - ;; Tag of any language - (when (featurep 'etags) - (smart-tags-display tag show-doc)) - (error (unless (and elisp-flag (stringp smart-emacs-tags-file) - (ignore-errors - (smart-tags-display - tag show-doc (list smart-emacs-tags-file)))) - (error "(smart-lisp): No definition found for `%s'" tag))))) - (and (not etags-mode) elisp-flag (fboundp 'xref-etags-mode) - (xref-etags-mode 0)))))))) + ;; If elisp-flag is true, then make xref use `smart-emacs-tags-file'. + ;; Otherwise, just use standard xref backends for the current language. + (t (condition-case () + ;; Tag of any language + (when (featurep 'etags) + (smart-tags-display tag show-doc)) + (error (unless (and elisp-flag (stringp smart-emacs-tags-file) + (ignore-errors + (smart-tags-display + tag show-doc (list smart-emacs-tags-file)))) + (error "(smart-lisp): No definition found for `%s'" tag)))))))) (defun smart-lisp-at-definition-p () "Return non-nil if point is on the first line of a non-alias Lisp definition.