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

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

[elpa] externals/org 67e819d6ee 2/2: test-org-src.el: Work around `curre


From: ELPA Syncer
Subject: [elpa] externals/org 67e819d6ee 2/2: test-org-src.el: Work around `current-column' bug in older emacs
Date: Mon, 10 Jul 2023 06:58:18 -0400 (EDT)

branch: externals/org
commit 67e819d6ee5d4a1c89ae3ef88243d6fd930e5e8b
Author: Sébastien Miquel <sebastien.miquel@posteo.eu>
Commit: Ihor Radchenko <yantar92@posteo.net>

    test-org-src.el: Work around `current-column' bug in older emacs
    
    * testing/lisp/test-org-src.el (test-org-src/indented-blocks): Work
    around `current-column' not working in the presence of display strings
    in older emacs.
---
 testing/lisp/test-org-src.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el
index a634d85e82..ebf8d85695 100644
--- a/testing/lisp/test-org-src.el
+++ b/testing/lisp/test-org-src.el
@@ -416,7 +416,13 @@ This is a tab:\t.
      (let ((org-edit-src-content-indentation 2)
           (org-src-preserve-indentation nil))
        (font-lock-ensure)
-       (current-column)))))
+       ;;  `current-column' will not work with older versions of emacs
+       ;; before commit 4243747b1b8: Fix 'current-column' in the
+       ;; presence of display strings
+       (if (<= emacs-major-version 28)
+           (+ (progn (backward-char) (length (get-text-property (point) 
'display)))
+              (current-column))
+         (current-column))))))
   ;; The initial tab characters respect org's `tab-width'.
   (should
    (equal
@@ -432,7 +438,10 @@ This is a tab:\t.
      (let ((org-edit-src-content-indentation 2)
           (org-src-preserve-indentation nil))
        (font-lock-ensure)
-       (current-column))))))
+       (if (<= emacs-major-version 28)
+           (+ (progn (backward-char) (length (get-text-property (point) 
'display)))
+              (current-column))
+         (current-column)))))))
 
 (ert-deftest test-org-src/indented-latex-fragments ()
   "Test editing multiline indented LaTeX fragment."



reply via email to

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