summaryrefslogtreecommitdiff
path: root/lisp/org/org-indent.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2018-03-15 20:23:09 -0400
committerGlenn Morris <rgm@gnu.org>2018-03-15 20:23:09 -0400
commitb1d7e58520dc42a4eda902aa934a250fda6a04ca (patch)
treed7b83885df71806c8c3299ea6968175d63d50cbb /lisp/org/org-indent.el
parent0a9d297198b9f4d6a0d6355bd7692740d6ecb418 (diff)
downloademacs-b1d7e58520dc42a4eda902aa934a250fda6a04ca.tar.gz
Replace some obsolete uses of filter-buffer-substring-functions
* lisp/org/org-agenda.el (org-agenda-mode): * lisp/org/org-indent.el (org-indent-mode): Replace filter-buffer-substring-functions, obsolete since 24.4.
Diffstat (limited to 'lisp/org/org-indent.el')
-rw-r--r--lisp/org/org-indent.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index ef68c3c4fa7..f2cd6a66fb3 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -183,11 +183,15 @@ during idle time."
org-hide-leading-stars)
(setq-local org-hide-leading-stars t))
(org-indent--compute-prefixes)
- (add-hook 'filter-buffer-substring-functions
- (lambda (fun start end delete)
- (org-indent-remove-properties-from-string
- (funcall fun start end delete)))
- nil t)
+ (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-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local)
(add-hook 'before-change-functions
'org-indent-notify-modified-headline nil 'local)
@@ -211,10 +215,13 @@ during idle time."
(when (boundp 'org-hide-leading-stars-before-indent-mode)
(setq-local org-hide-leading-stars
org-hide-leading-stars-before-indent-mode))
- (remove-hook 'filter-buffer-substring-functions
- (lambda (fun start end delete)
- (org-indent-remove-properties-from-string
- (funcall fun start end delete))))
+ (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-hook 'after-change-functions 'org-indent-refresh-maybe 'local)
(remove-hook 'before-change-functions
'org-indent-notify-modified-headline 'local)