From c5f73635d085d9d9e92d8baf062015cbe00f97da Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 28 Apr 2012 21:36:58 +0200 Subject: [PATCH] Replace obsolete variable `buffer-substring-filters'. * org-agenda.el (org-agenda-mode): Replace obsolete variable `buffer-substring-filters'. * org-indent.el (org-indent-mode): Ditto. --- lisp/org-agenda.el | 9 ++++----- lisp/org-indent.el | 15 +++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 27b740a21..6a3158543 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1953,11 +1953,10 @@ The following commands are available: (org-add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) (org-add-hook 'pre-command-hook 'org-unhighlight nil 'local) ;; Make sure properties are removed when copying text - (when (boundp 'buffer-substring-filters) - (org-set-local 'buffer-substring-filters - (cons (lambda (x) - (set-text-properties 0 (length x) nil x) x) - buffer-substring-filters))) + (make-local-variable 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (substring-no-properties (funcall fun start end delete)))) (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 diff --git a/lisp/org-indent.el b/lisp/org-indent.el index 43de325be..97a1ec3ca 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -183,9 +183,11 @@ during idle time." nil " Ind" nil (org-set-local 'org-hide-leading-stars-before-indent-mode org-hide-leading-stars) (org-set-local 'org-hide-leading-stars t)) - (make-local-variable 'buffer-substring-filters) - (add-to-list 'buffer-substring-filters - 'org-indent-remove-properties-from-string) + (make-local-variable '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)))) (org-add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) (org-add-hook 'before-change-functions 'org-indent-notify-modified-headline nil 'local) @@ -209,9 +211,10 @@ during idle time." nil " Ind" nil (when (boundp 'org-hide-leading-stars-before-indent-mode) (org-set-local 'org-hide-leading-stars org-hide-leading-stars-before-indent-mode)) - (setq buffer-substring-filters - (delq 'org-indent-remove-properties-from-string - buffer-substring-filters)) + (remove-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete)))) (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) (remove-hook 'before-change-functions 'org-indent-notify-modified-headline 'local)