[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 912f02b 4/8: hpath:find - Add support for pro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 912f02b 4/8: hpath:find - Add support for prog, outline & text mode # anchors |
Date: |
Tue, 18 May 2021 23:57:13 -0400 (EDT) |
branch: externals/hyperbole
commit 912f02b62029849081164b2ddf4452f696583968
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
hpath:find - Add support for prog, outline & text mode # anchors
---
ChangeLog | 3 +++
hpath.el | 32 ++++++++++++++++++++------------
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 75e6e4d..c8eeba4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+* hpath.el (hpath:to-markup-anchor): Add support for path#anchor
+ links in programming, text and outlining major modes.
+
* hactypes.el (link-to-ebut): Fix bug that always triggered an error
if key-file was not given. Also remove interactive conditional
that prevented normalized-file from being set.
diff --git a/hpath.el b/hpath.el
index e5393c0..0cbf125 100644
--- a/hpath.el
+++ b/hpath.el
@@ -1210,24 +1210,32 @@ buffer but don't display it."
(buffer-name)
anchor))))
(t
- (let ((opoint (point))
- ;; Markdown or outline link ids are case
- ;; insensitive and - characters are converted to
- ;; spaces at the point of definition unless
- ;; anchor contains both - and space characters,
- ;; then no conversion occurs.
- (case-fold-search t)
- (anchor-name (if (string-match "-.* \\| .*-" anchor)
- anchor
- (subst-char-in-string ?- ?\ anchor))))
+ (let* ((opoint (point))
+ (prog-mode (derived-mode-p 'prog-mode))
+ ;; Markdown or outline link ids are case
+ ;; insensitive and - characters are converted to
+ ;; spaces at the point of definition unless
+ ;; anchor contains both - and space characters,
+ ;; then no conversion occurs.
+ (case-fold-search (not prog-mode))
+ (anchor-name (if (or prog-mode
+ (string-match "-.* \\| .*-" anchor))
+ anchor
+ (subst-char-in-string ?- ?\ anchor))))
(goto-char (point-min))
(if (re-search-forward (format
- (cond ((or (and buffer-file-name
+ (cond ((derived-mode-p 'outline-mode)
;; Includes Org mode
+ hpath:outline-section-pattern)
+ (prog-mode
+ "%s")
+ ((or (and buffer-file-name
(string-match
hpath:markdown-suffix-regexp buffer-file-name))
(memq major-mode
hpath:shell-modes))
hpath:markdown-section-pattern)
- ((eq major-mode 'texinfo-mode)
+ ((derived-mode-p 'texinfo-mode)
hpath:texinfo-section-pattern)
+ ((derived-mode-p 'text-mode)
+ "%s")
(t
hpath:outline-section-pattern))
(regexp-quote anchor-name)) nil t)
(progn (forward-line 0)
- [elpa] externals/hyperbole updated (e991ad7 -> c05d22c), ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 4a21251 1/8: Use compatibility macro for with-suppressed-warnings (#92), ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 912f02b 4/8: hpath:find - Add support for prog, outline & text mode # anchors,
ELPA Syncer <=
- [elpa] externals/hyperbole 847c5c7 2/8: Add kotl-mode tests (#94), ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole cdbf1b5 3/8: hactypes.el - link-to-ebut - Fix error when key-file is nil, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 3f33725 7/8: Rename hypb-with-suppressed-warnings to hypb:with-suppressed-warnings, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole c05d22c 8/8: For automated testing, let kotl-mode:example use alternative dirs, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole 51171bb 5/8: Remove additional byte-compile warnings, ELPA Syncer, 2021/05/18
- [elpa] externals/hyperbole b40f9e8 6/8: Merge branch 'master' of hyperbole, ELPA Syncer, 2021/05/18