From 81b33f16ad2e2b2cff20110ff1dafefbc348f9dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Fri, 7 Jul 2023 13:58:17 +0200 Subject: [PATCH] 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el index a634d85e8..5a3af8bb3 100644 --- a/testing/lisp/test-org-src.el +++ b/testing/lisp/test-org-src.el @@ -416,7 +416,11 @@ This is a tab:\t. (let ((org-edit-src-content-indentation 2) (org-src-preserve-indentation nil)) (font-lock-ensure) - (current-column))))) + ;; Replacement for `current-column', since it doesn't work with + ;; older versions of emacs before commit 4243747b1b8: Fix + ;; 'current-column' in the presence of display strings + (+ (progn (backward-char) (length (get-text-property (point) 'display))) + (current-column)))))) ;; The initial tab characters respect org's `tab-width'. (should (equal @@ -432,7 +436,8 @@ This is a tab:\t. (let ((org-edit-src-content-indentation 2) (org-src-preserve-indentation nil)) (font-lock-ensure) - (current-column)))))) + (+ (progn (backward-char) (length (get-text-property (point) 'display))) + (current-column))))))) (ert-deftest test-org-src/indented-latex-fragments () "Test editing multiline indented LaTeX fragment." -- 2.41.0