diff options
| -rw-r--r-- | lisp/org/org-agenda.el | 12 | ||||
| -rw-r--r-- | lisp/org/org-indent.el | 25 |
2 files changed, 24 insertions, 13 deletions
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 9aaec330708..3d4379b022e 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el | |||
| @@ -2201,10 +2201,14 @@ The following commands are available: | |||
| 2201 | (add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) | 2201 | (add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) |
| 2202 | (add-hook 'pre-command-hook 'org-unhighlight nil 'local) | 2202 | (add-hook 'pre-command-hook 'org-unhighlight nil 'local) |
| 2203 | ;; Make sure properties are removed when copying text | 2203 | ;; Make sure properties are removed when copying text |
| 2204 | (add-hook 'filter-buffer-substring-functions | 2204 | (if (boundp 'filter-buffer-substring-functions) |
| 2205 | (lambda (fun start end delete) | 2205 | (add-hook 'filter-buffer-substring-functions |
| 2206 | (substring-no-properties (funcall fun start end delete))) | 2206 | (lambda (fun start end delete) |
| 2207 | nil t) | 2207 | (substring-no-properties (funcall fun start end delete))) |
| 2208 | nil t) | ||
| 2209 | ;; Emacs >= 24.4. | ||
| 2210 | (add-function :filter-return (local 'filter-buffer-substring-function) | ||
| 2211 | #'substring-no-properties)) | ||
| 2208 | (unless org-agenda-keep-modes | 2212 | (unless org-agenda-keep-modes |
| 2209 | (setq org-agenda-follow-mode org-agenda-start-with-follow-mode | 2213 | (setq org-agenda-follow-mode org-agenda-start-with-follow-mode |
| 2210 | org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode)) | 2214 | org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode)) |
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." | |||
| 183 | org-hide-leading-stars) | 183 | org-hide-leading-stars) |
| 184 | (setq-local org-hide-leading-stars t)) | 184 | (setq-local org-hide-leading-stars t)) |
| 185 | (org-indent--compute-prefixes) | 185 | (org-indent--compute-prefixes) |
| 186 | (add-hook 'filter-buffer-substring-functions | 186 | (if (boundp 'filter-buffer-substring-functions) |
| 187 | (lambda (fun start end delete) | 187 | (add-hook 'filter-buffer-substring-functions |
| 188 | (org-indent-remove-properties-from-string | 188 | (lambda (fun start end delete) |
| 189 | (funcall fun start end delete))) | 189 | (org-indent-remove-properties-from-string |
| 190 | nil t) | 190 | (funcall fun start end delete))) |
| 191 | nil t) | ||
| 192 | ;; Emacs >= 24.4. | ||
| 193 | (add-function :filter-return (local 'filter-buffer-substring-function) | ||
| 194 | #'org-indent-remove-properties-from-string)) | ||
| 191 | (add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) | 195 | (add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) |
| 192 | (add-hook 'before-change-functions | 196 | (add-hook 'before-change-functions |
| 193 | 'org-indent-notify-modified-headline nil 'local) | 197 | 'org-indent-notify-modified-headline nil 'local) |
| @@ -211,10 +215,13 @@ during idle time." | |||
| 211 | (when (boundp 'org-hide-leading-stars-before-indent-mode) | 215 | (when (boundp 'org-hide-leading-stars-before-indent-mode) |
| 212 | (setq-local org-hide-leading-stars | 216 | (setq-local org-hide-leading-stars |
| 213 | org-hide-leading-stars-before-indent-mode)) | 217 | org-hide-leading-stars-before-indent-mode)) |
| 214 | (remove-hook 'filter-buffer-substring-functions | 218 | (if (boundp 'filter-buffer-substring-functions) |
| 215 | (lambda (fun start end delete) | 219 | (remove-hook 'filter-buffer-substring-functions |
| 216 | (org-indent-remove-properties-from-string | 220 | (lambda (fun start end delete) |
| 217 | (funcall fun start end delete)))) | 221 | (org-indent-remove-properties-from-string |
| 222 | (funcall fun start end delete)))) | ||
| 223 | (remove-function (local 'filter-buffer-substring-function) | ||
| 224 | #'org-indent-remove-properties-from-string)) | ||
| 218 | (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) | 225 | (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) |
| 219 | (remove-hook 'before-change-functions | 226 | (remove-hook 'before-change-functions |
| 220 | 'org-indent-notify-modified-headline 'local) | 227 | 'org-indent-notify-modified-headline 'local) |