Skip to content

Commit a29b355

Browse files
authored
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
1 parent cc887f9 commit a29b355

File tree

5 files changed

+55
-57
lines changed

5 files changed

+55
-57
lines changed

ChangeLog

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2023-10-21 Bob Weiner <[email protected]>
2+
3+
* hibtypes.el (markdown-follow-inline-link-p): Fix to process anchored
4+
path links rather than dropping through to another ibtype since that
5+
would trigger an error since point would have been moved in order to
6+
leave it on the path and not the name part of a markdown link. Remove
7+
need to move point by calling 'markdown-link-url'.
8+
9+
* hmouse-tag.el (smart-lisp-find-tag): Fix that some tags were not found by
10+
xref because this function turned on xref-etags-mode in Elisp files
11+
rather than using its elisp backend. Remove that code.
12+
(tags-fix): Remove optional load of this very old file.
13+
114
2023-10-09 Mats Lidell <[email protected]>
215

316
* test/kotl-mode-tests.el (kotl-mode-kill-contents)

README

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ distribution site is: https://www.gnu.org/software/hyperbole. If any term in
107107
here is new or unfamiliar to you, you can look it up in the Hyperbole Manual
108108
Glossary.
109109

110+
Unlock the power of GNU Hyperbole to make your information work for you.
111+
One system. One language. One manual. One solution. Learn Hyperbole and
112+
start moving further, faster.
113+
110114
===========================================================================
111115
* Files
112116
===========================================================================

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ In short, Hyperbole lets you:
100100
reference from any other node;
101101

102102
4. Manage all your contacts or record-based, unstructured nodes quickly
103-
with hierarchical categories; each entry can have embedded
104-
hyperbuttons of any type. Or create an archive of documents with
105-
hierarchical entries and use the same search mechanism to quickly find
106-
any matching entry;
103+
with hierarchical categories; each entry can have embedded
104+
hyperbuttons of any type. Or create an archive of documents with
105+
hierarchical entries and use the same search mechanism to quickly find
106+
any matching entry;
107107

108108
5. Use single keys to easily manage your Emacs windows or frames and
109109
quickly retrieve saved window and frame configurations;
110110

111111
6. Search for things in your current buffers, in a directory tree or
112-
across major web search engines with the touch of a few keys.
112+
across major web search engines with the touch of a few keys.
113113

114114
The common thread in all these features is making retrieval,
115115
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
138138
Hyperbole is available for [download and installation](#installation)
139139
through the GNU Emacs package manager.
140140

141+
Unlock the power of GNU Hyperbole to make your information work for you.
142+
One system. One language. One manual. One solution. Learn Hyperbole and
143+
start moving further, faster.
144+
141145
## Mailing Lists
142146

143147
- **[email protected]** - User list for GNU Hyperbole

hibtypes.el

+12-24
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 19-Sep-91 at 20:45:31
6-
;; Last-Mod: 3-Oct-23 at 17:21:27 by Mats Lidell
6+
;; Last-Mod: 21-Oct-23 at 19:50:25 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -51,6 +51,7 @@
5151
(declare-function markdown-footnote-marker-positions "ext:markdown")
5252
(declare-function markdown-footnote-return "ext:markdown")
5353
(declare-function markdown-link-p "ext:markdown")
54+
(declare-function markdown-link-url "ext:markdown")
5455
(declare-function markdown-reference-goto-definition "ext:markdown")
5556
(declare-function markdown-reference-goto-link "ext:markdown")
5657
(declare-function markdown-wiki-link-p "ext:markdown")
@@ -414,32 +415,19 @@ Return t if jump and nil otherwise."
414415
"If on an inline link, jump to its referent if it is absolute and return non-nil.
415416
Absolute means not relative within the file. Otherwise, if an
416417
internal link, move back to OPOINT and return nil."
417-
(let (handle-link-flag
418-
result)
419-
(skip-chars-forward "^\]\[()")
420-
(when (looking-at "\][\[()]")
421-
(if (looking-at "\(")
422-
(skip-chars-backward "^\]\[()")
423-
(skip-chars-forward "\]\[\("))
424-
;; Leave point on the link even if not activated
425-
;; here, so that other ibtypes activate it. If point is after
426-
;; the # character of an in-file link, then the following predicate
427-
;; fails and the `pathname' ibtype will handle it. If point is before
428-
;; the # character, the link is handled here.
429-
(setq handle-link-flag (not (or (hpath:www-at-p) (hpath:at-p))))
430-
(when (setq result (and (markdown-link-p) handle-link-flag))
431-
;; In-file referents are handled by the `pathname' implicit
432-
;; button type, not here.
433-
(ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0))
418+
;; Caller already checked not on a URL (handled elsewhere).
419+
(let ((path (markdown-link-url)))
420+
(goto-char opoint)
421+
(when (markdown-link-p)
422+
(ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0))
423+
(if path
424+
(hact 'link-to-file path)
434425
(hpath:display-buffer (current-buffer))
435-
(hact 'markdown-follow-link-at-point)))
436-
(when handle-link-flag
437-
(goto-char opoint))
438-
result))
426+
(hact 'markdown-follow-link-at-point)))))
439427

440428
(defib markdown-internal-link ()
441429
"Display any in-file Markdown link referent at point.
442-
Pathnames and urls are handled elsewhere."
430+
Url links are handled elsewhere."
443431
(when (and (derived-mode-p 'markdown-mode)
444432
(not (hpath:www-at-p)))
445433
(let ((opoint (point))
@@ -456,7 +444,7 @@ Pathnames and urls are handled elsewhere."
456444
;; Follows an absolute file link.
457445
(markdown-follow-inline-link-p opoint))
458446
;; May be on the name of an infile link, so move to the
459-
;; link itself and then let the `pathname' ibtype handle it.
447+
;; link itself and then display it as a pathname.
460448
(error (markdown-follow-inline-link-p opoint))))
461449
((markdown-wiki-link-p)
462450
(ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0))

hmouse-tag.el

+17-28
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 24-Aug-91
6-
;; Last-Mod: 3-Oct-23 at 23:21:15 by Mats Lidell
6+
;; Last-Mod: 21-Oct-23 at 10:45:26 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -21,14 +21,11 @@
2121

2222
(eval-and-compile
2323
(mapc #'require '(find-func hpath hui-select))
24-
(cond ((or (featurep 'etags) (featurep 'tags))
25-
nil)
26-
(t
27-
;; Force use of .elc file here since otherwise the bin/etags
28-
;; executable might be found in a user's load-path by the load
29-
;; command.
30-
(or (load "etags.elc" t nil t)
31-
(load "tags-fix" t)))))
24+
(unless (or (featurep 'etags) (featurep 'tags))
25+
;; Force use of .elc file here since otherwise the bin/etags
26+
;; executable might be found in a user's load-path by the load
27+
;; command.
28+
(load "etags.elc" t nil t)))
3229

3330
;; If etags utilizes the new xref.el library, define some helper
3431
;; functions to simplify programming and fix one existing function.
@@ -691,25 +688,17 @@ Use `hpath:display-buffer' to show definition or documentation."
691688
(widen)
692689
(goto-char (cdr result))
693690
t))))
694-
;; If elisp-flag is true, then make xref use tags tables to
695-
;; find symbols not yet loaded into Emacs; otherwise, use
696-
;; standard xref backends for the current language.
697-
(t (let ((etags-mode (and elisp-flag (boundp 'xref-etags-mode) xref-etags-mode)))
698-
(unwind-protect
699-
(progn
700-
(and (not etags-mode) elisp-flag (fboundp 'xref-etags-mode)
701-
(xref-etags-mode 1))
702-
(condition-case ()
703-
;; Tag of any language
704-
(when (featurep 'etags)
705-
(smart-tags-display tag show-doc))
706-
(error (unless (and elisp-flag (stringp smart-emacs-tags-file)
707-
(ignore-errors
708-
(smart-tags-display
709-
tag show-doc (list smart-emacs-tags-file))))
710-
(error "(smart-lisp): No definition found for `%s'" tag)))))
711-
(and (not etags-mode) elisp-flag (fboundp 'xref-etags-mode)
712-
(xref-etags-mode 0))))))))
691+
;; If elisp-flag is true, then make xref use `smart-emacs-tags-file'.
692+
;; Otherwise, just use standard xref backends for the current language.
693+
(t (condition-case ()
694+
;; Tag of any language
695+
(when (featurep 'etags)
696+
(smart-tags-display tag show-doc))
697+
(error (unless (and elisp-flag (stringp smart-emacs-tags-file)
698+
(ignore-errors
699+
(smart-tags-display
700+
tag show-doc (list smart-emacs-tags-file))))
701+
(error "(smart-lisp): No definition found for `%s'" tag))))))))
713702

714703
(defun smart-lisp-at-definition-p ()
715704
"Return non-nil if point is on the first line of a non-alias Lisp definition.

0 commit comments

Comments
 (0)