emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 6feef2a279 2/2: Merge branch 'bugfix'


From: ELPA Syncer
Subject: [elpa] externals/org 6feef2a279 2/2: Merge branch 'bugfix'
Date: Tue, 7 Nov 2023 06:58:29 -0500 (EST)

branch: externals/org
commit 6feef2a279f8b13e99790eb3ee054524f590e1b7
Merge: 154a80f864 93ebd64de1
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Merge branch 'bugfix'
---
 lisp/org.el              |  6 ++---
 testing/lisp/test-org.el | 62 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 4eb6ad0ee6..d2cd0b9b77 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20340,7 +20340,7 @@ With argument N not nil or 1, move forward N - 1 lines 
first."
        (if (eq special 'reversed)
            (when (and (= origin bol) (eq last-command this-command))
              (goto-char refpos))
-         (when (or (> origin refpos) (= origin bol))
+         (when (or (> origin refpos) (<= origin bol))
            (goto-char refpos)))))
      ((and (looking-at org-list-full-item-re)
           (org-element-type-p
@@ -20356,7 +20356,7 @@ With argument N not nil or 1, move forward N - 1 lines 
first."
        (if (eq special 'reversed)
            (when (and (= (point) origin) (eq last-command this-command))
              (goto-char after-bullet))
-         (when (or (> origin after-bullet) (= (point) origin))
+         (when (or (> origin after-bullet) (>= (point) origin))
            (goto-char after-bullet)))))
      ;; No special context.  Point is already at beginning of line.
      (t nil))))
@@ -20411,7 +20411,7 @@ With argument N not nil or 1, move forward N - 1 lines 
first."
                   (goto-char tags)
                 (end-of-line)))
              (t
-              (if (or (< origin tags) (= origin (line-end-position)))
+              (if (or (< origin tags) (>= origin (line-end-position)))
                   (goto-char tags)
                 (end-of-line))))))
      ((bound-and-true-p visual-line-mode)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 21b850c034..612bfa1e5f 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -4460,6 +4460,16 @@ asd
      (let ((org-special-ctrl-a/e '(nil . nil)))
        (org-beginning-of-line)
        (looking-at "Headline"))))
+  (should
+   (org-test-with-temp-text "* TODO [#A] Headline\n<point>"
+     (let ((org-special-ctrl-a/e t))
+       (org-beginning-of-line 0)
+       (looking-at-p "Headline"))))
+  (should
+   (org-test-with-temp-text "<point>\n* TODO [#A] Headline"
+     (let ((org-special-ctrl-a/e t))
+       (org-beginning-of-line 2)
+       (looking-at-p "Headline"))))
   ;; At an headline with reversed movement, first move to beginning of
   ;; line, then to the beginning of title.
   (should
@@ -4480,6 +4490,18 @@ asd
           (this-command last-command))
        (and (progn (org-beginning-of-line) (bolp))
            (progn (org-beginning-of-line) (looking-at-p "Headline"))))))
+  (should
+   (org-test-with-temp-text "* TODO Headline\n<point>"
+     (let ((org-special-ctrl-a/e 'reversed)
+          (this-command last-command))
+       (and (progn (org-beginning-of-line 0) (bolp))
+           (progn (org-beginning-of-line) (looking-at-p "Headline"))))))
+  (should
+   (org-test-with-temp-text "<point>\n* TODO Headline"
+     (let ((org-special-ctrl-a/e 'reversed)
+          (this-command last-command))
+       (and (progn (org-beginning-of-line 2) (bolp))
+           (progn (org-beginning-of-line) (looking-at-p "Headline"))))))
   ;; At an item with special movement, first move after to beginning
   ;; of title, then to the beginning of line, rinse, repeat.
   (should
@@ -4488,6 +4510,14 @@ asd
        (and (progn (org-beginning-of-line) (looking-at-p "Item"))
            (progn (org-beginning-of-line) (bolp))
            (progn (org-beginning-of-line) (looking-at-p "Item"))))))
+  (should
+   (org-test-with-temp-text "- [ ] Item\n<point>"
+     (let ((org-special-ctrl-a/e t))
+       (org-beginning-of-line 0) (looking-at-p "Item"))))
+  (should
+   (org-test-with-temp-text "<point>\n- [ ] Item"
+     (let ((org-special-ctrl-a/e t))
+       (org-beginning-of-line 2) (looking-at-p "Item"))))
   ;; At an item with reversed movement, first move to beginning of
   ;; line, then to the beginning of title.
   (should
@@ -4496,6 +4526,18 @@ asd
           (this-command last-command))
        (and (progn (org-beginning-of-line) (bolp))
            (progn (org-beginning-of-line) (looking-at-p "Item"))))))
+  (should
+   (org-test-with-temp-text "- [X] Item\n<point>"
+     (let ((org-special-ctrl-a/e 'reversed)
+          (this-command last-command))
+       (and (progn (org-beginning-of-line 0) (bolp))
+           (progn (org-beginning-of-line) (looking-at-p "Item"))))))
+  (should
+   (org-test-with-temp-text "<point>\n- [X] Item"
+     (let ((org-special-ctrl-a/e 'reversed)
+          (this-command last-command))
+       (and (progn (org-beginning-of-line 2) (bolp))
+           (progn (org-beginning-of-line) (looking-at-p "Item"))))))
   ;; Leave point before invisible characters at column 0.
   (should
    (org-test-with-temp-text "[[https://orgmode.org]]<point>"
@@ -4598,6 +4640,14 @@ asd
        (and (progn (org-end-of-line) (looking-at-p " :tag:"))
            (progn (org-end-of-line) (eolp))
            (progn (org-end-of-line) (looking-at-p " :tag:"))))))
+  (should
+   (org-test-with-temp-text "* Headline1 :tag:\n<point>"
+     (let ((org-special-ctrl-a/e t))
+       (org-end-of-line 0) (looking-at-p " :tag:"))))
+  (should
+   (org-test-with-temp-text "<point>\n* Headline1 :tag:\n"
+     (let ((org-special-ctrl-a/e t))
+       (org-end-of-line 2) (looking-at-p " :tag:"))))
   (should
    (org-test-with-temp-text "* Headline2a :tag:\n** Sub"
      (org-overview)
@@ -4625,6 +4675,18 @@ asd
           (this-command last-command))
        (and (progn (org-end-of-line) (eolp))
            (progn (org-end-of-line) (looking-at-p " :tag:"))))))
+  (should
+   (org-test-with-temp-text "* Headline3 :tag:\n<point>"
+     (let ((org-special-ctrl-a/e 'reversed)
+          (this-command last-command))
+       (and (progn (org-end-of-line 0) (eolp))
+           (progn (org-end-of-line) (looking-at-p " :tag:"))))))
+  (should
+   (org-test-with-temp-text "<point>\n* Headline3 :tag:\n"
+     (let ((org-special-ctrl-a/e 'reversed)
+          (this-command last-command))
+       (and (progn (org-end-of-line 2) (eolp))
+           (progn (org-end-of-line) (looking-at-p " :tag:"))))))
   (should
    (org-test-with-temp-text "* Headline2a :tag:\n** Sub"
      (org-overview)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]