forked from mirrors/org-mode
Backport commit b1d7e5852 from Emacs
* lisp/org-agenda.el (org-agenda-mode): * lisp/org-indent.el (org-indent-mode): Replace filter-buffer-substring-functions, obsolete since 24.4. Replace some obsolete uses of filter-buffer-substring-functions b1d7e58520dc42a4eda902aa934a250fda6a04ca Glenn Morris Thu Mar 15 20:23:09 2018 -0400
This commit is contained in:
parent
16c8187db1
commit
6a5082fccf
|
@ -2229,10 +2229,14 @@ The following commands are available:
|
||||||
(add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local)
|
(add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local)
|
||||||
(add-hook 'pre-command-hook 'org-unhighlight nil 'local)
|
(add-hook 'pre-command-hook 'org-unhighlight nil 'local)
|
||||||
;; Make sure properties are removed when copying text
|
;; Make sure properties are removed when copying text
|
||||||
(add-hook 'filter-buffer-substring-functions
|
(if (boundp 'filter-buffer-substring-functions)
|
||||||
(lambda (fun start end delete)
|
(add-hook 'filter-buffer-substring-functions
|
||||||
(substring-no-properties (funcall fun start end delete)))
|
(lambda (fun start end delete)
|
||||||
nil t)
|
(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))
|
||||||
(unless org-agenda-keep-modes
|
(unless org-agenda-keep-modes
|
||||||
(setq org-agenda-follow-mode org-agenda-start-with-follow-mode
|
(setq org-agenda-follow-mode org-agenda-start-with-follow-mode
|
||||||
org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
|
org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
|
||||||
|
|
|
@ -184,11 +184,15 @@ during idle time."
|
||||||
org-hide-leading-stars)
|
org-hide-leading-stars)
|
||||||
(setq-local org-hide-leading-stars t))
|
(setq-local org-hide-leading-stars t))
|
||||||
(org-indent--compute-prefixes)
|
(org-indent--compute-prefixes)
|
||||||
(add-hook 'filter-buffer-substring-functions
|
(if (boundp 'filter-buffer-substring-functions)
|
||||||
(lambda (fun start end delete)
|
(add-hook 'filter-buffer-substring-functions
|
||||||
(org-indent-remove-properties-from-string
|
(lambda (fun start end delete)
|
||||||
(funcall fun start end delete)))
|
(org-indent-remove-properties-from-string
|
||||||
nil t)
|
(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 'after-change-functions 'org-indent-refresh-maybe nil 'local)
|
||||||
(add-hook 'before-change-functions
|
(add-hook 'before-change-functions
|
||||||
'org-indent-notify-modified-headline nil 'local)
|
'org-indent-notify-modified-headline nil 'local)
|
||||||
|
@ -212,10 +216,13 @@ during idle time."
|
||||||
(when (boundp 'org-hide-leading-stars-before-indent-mode)
|
(when (boundp 'org-hide-leading-stars-before-indent-mode)
|
||||||
(setq-local org-hide-leading-stars
|
(setq-local org-hide-leading-stars
|
||||||
org-hide-leading-stars-before-indent-mode))
|
org-hide-leading-stars-before-indent-mode))
|
||||||
(remove-hook 'filter-buffer-substring-functions
|
(if (boundp 'filter-buffer-substring-functions)
|
||||||
(lambda (fun start end delete)
|
(remove-hook 'filter-buffer-substring-functions
|
||||||
(org-indent-remove-properties-from-string
|
(lambda (fun start end delete)
|
||||||
(funcall 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 'after-change-functions 'org-indent-refresh-maybe 'local)
|
||||||
(remove-hook 'before-change-functions
|
(remove-hook 'before-change-functions
|
||||||
'org-indent-notify-modified-headline 'local)
|
'org-indent-notify-modified-headline 'local)
|
||||||
|
|
Loading…
Reference in a new issue