[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org c41a89676e: org-next-visible-heading: Fix when movi
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/org c41a89676e: org-next-visible-heading: Fix when moving over non-descriptive link |
|
Date: |
Sat, 13 Jan 2024 10:22:02 -0500 (EST) |
branch: externals/org
commit c41a89676ef7dd61e1180a89d5b794aa37e0757c
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-next-visible-heading: Fix when moving over non-descriptive link
* lisp/org.el (org-next-visible-heading): Really test for visibility;
not folding. Some folds may not be invisible - when
`org-link-descriptive' is nil, links are folded yet visible.
* testing/lisp/test-org.el (test-org/next-visible-heading): Add new
test case.
Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2bk9q7adw.fsf@me.com
---
lisp/org.el | 4 ++--
testing/lisp/test-org.el | 8 +++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index df482d0f37..6c9ff30267 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -21389,13 +21389,13 @@ With ARG, repeats or can move backward if negative."
(end-of-line))
(while (and (< arg 0) (re-search-backward regexp nil :move))
(unless (bobp)
- (when (org-fold-folded-p)
+ (when (org-invisible-p nil t)
(goto-char (org-fold-previous-visibility-change))
(unless (looking-at-p regexp)
(re-search-backward regexp nil :mode))))
(cl-incf arg))
(while (and (> arg 0) (re-search-forward regexp nil :move))
- (when (org-fold-folded-p)
+ (when (org-invisible-p nil t)
(goto-char (org-fold-next-visibility-change))
(skip-chars-forward " \t\n")
(end-of-line))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 2fab3ff886..62d841b373 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -4069,7 +4069,13 @@ text"
(should
(org-test-with-temp-text "* H1\n* H2\n<point>* H3"
(org-next-visible-heading -2)
- (looking-at "\\* H1"))))
+ (looking-at "\\* H1")))
+ ;; Edge case: visible links.
+ (should
+ (let ((org-link-descriptive nil))
+ (org-test-with-temp-text "* <point>H1\n* [[https://orgmode.org][Org
mode]]\n* H3"
+ (org-next-visible-heading 1)
+ (looking-at "\\* \\[\\[https:")))))
(ert-deftest test-org/previous-visible-heading ()
"Test `org-previous-visible-heading' specifications."
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/org c41a89676e: org-next-visible-heading: Fix when moving over non-descriptive link,
ELPA Syncer <=