]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't use obsolete filter-buffer-substring-functions in Org
authorStefan Kangas <stefankangas@gmail.com>
Thu, 12 Dec 2024 23:03:13 +0000 (00:03 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 15 Dec 2024 16:36:53 +0000 (17:36 +0100)
This patch was also installed in Org mode, here:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b9637ef142

* lisp/org/org-agenda.el (org-agenda-mode):
* lisp/org/org-indent.el (org-indent-mode): Don't use obsolete
filter-buffer-substring-functions.

(cherry picked from commit d1bde7b5cb727d6b0559d99669719d5eb832c186)

lisp/org/org-agenda.el
lisp/org/org-indent.el

index 66888fc131dea188ed0e6500ff1506290608a0d4..d768c3ef2c561fe3ef9e996928e6a6b0195109dd 100644 (file)
@@ -2375,14 +2375,8 @@ The following commands are available:
   (add-hook 'post-command-hook #'org-agenda-update-agenda-type nil 'local)
   (add-hook 'pre-command-hook #'org-unhighlight nil 'local)
   ;; Make sure properties are removed when copying text
-  (if (boundp 'filter-buffer-substring-functions)
-      (add-hook 'filter-buffer-substring-functions
-               (lambda (fun start end delete)
-                  (substring-no-properties (funcall fun start end delete)))
-               nil t)
-    ;; Emacs >= 24.4.
-    (add-function :filter-return (local 'filter-buffer-substring-function)
-                  #'substring-no-properties))
+  (add-function :filter-return (local 'filter-buffer-substring-function)
+                #'substring-no-properties)
   (unless org-agenda-keep-modes
     (setq org-agenda-follow-mode org-agenda-start-with-follow-mode
          org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
index cabed6acf72148106a5a3a722c12bcfec1a9654b..a0a0740eef9c10d29763b736cd16f4d9eecf685b 100644 (file)
@@ -193,15 +193,8 @@ during idle time."
     (when org-indent-mode-turns-on-hiding-stars
       (setq-local org-hide-leading-stars t))
     (org-indent--compute-prefixes)
-    (if (boundp 'filter-buffer-substring-functions)
-       (add-hook 'filter-buffer-substring-functions
-                 (lambda (fun start end delete)
-                   (org-indent-remove-properties-from-string
-                    (funcall fun start end delete)))
-                 nil t)
-      ;; Emacs >= 24.4.
-      (add-function :filter-return (local 'filter-buffer-substring-function)
-                   #'org-indent-remove-properties-from-string))
+    (add-function :filter-return (local 'filter-buffer-substring-function)
+                  #'org-indent-remove-properties-from-string)
     (add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local)
     (add-hook 'before-change-functions
              'org-indent-notify-modified-headline nil 'local)
@@ -224,13 +217,8 @@ during idle time."
       (set-marker org-indent--initial-marker nil))
     (when (local-variable-p 'org-hide-leading-stars)
       (kill-local-variable 'org-hide-leading-stars))
-    (if (boundp 'filter-buffer-substring-functions)
-       (remove-hook 'filter-buffer-substring-functions
-                    (lambda (fun start end delete)
-                      (org-indent-remove-properties-from-string
-                       (funcall fun start end delete))))
-      (remove-function (local 'filter-buffer-substring-function)
-                      #'org-indent-remove-properties-from-string))
+    (remove-function (local 'filter-buffer-substring-function)
+                     #'org-indent-remove-properties-from-string)
     (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local)
     (remove-hook 'before-change-functions
                 'org-indent-notify-modified-headline 'local)