diff options
author | Bastien Guerry <bzg@altern.org> | 2012-10-26 14:55:08 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-10-26 14:55:08 +0200 |
commit | 116c09053faaf603cf8541d5776abfb1247d9de3 (patch) | |
tree | c2b2835a88140c5a7872a86586195af363685056 | |
parent | 3cd0c14d34abf2126423f0142d66b19d953eb629 (diff) | |
download | org-mode-116c09053faaf603cf8541d5776abfb1247d9de3.tar.gz |
Run `bookmark-set' within `with-demoted-errors'.
* org.el (org-refile): Run within `with-demoted-errors' so
that a corrupted bookmark file does not stop the refile
process.
* org-capture.el (org-capture-bookmark-last-stored-position):
Ditto for the capture process.
Note: we do not prevent such errors in org-remember.el as this
libary will be obsoleted for the next major release of Org.
-rw-r--r-- | lisp/org-capture.el | 3 | ||||
-rw-r--r-- | lisp/org.el | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index be973b0..1dfffc6 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1250,7 +1250,8 @@ Of course, if exact position has been required, just put it there." (save-restriction (widen) (goto-char pos) - (bookmark-set "org-capture-last-stored") + (with-demoted-errors + (bookmark-set "org-capture-last-stored")) (move-marker org-capture-last-stored-marker (point))))))) (defun org-capture-narrow (beg end) diff --git a/lisp/org.el b/lisp/org.el index bdbba86..45dbe27 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10876,11 +10876,13 @@ prefix argument (`C-u C-u C-u C-c C-w')." (and org-auto-align-tags (let ((org-loop-over-headlines-in-active-region nil)) (org-set-tags nil t))) - (bookmark-set "org-refile-last-stored") + (with-demoted-errors + (bookmark-set "org-refile-last-stored")) ;; If we are refiling for capture, make sure that the ;; last-capture pointers point here (when (org-bound-and-true-p org-refile-for-capture) - (bookmark-set "org-capture-last-stored-marker") + (with-demoted-errors + (bookmark-set "org-capture-last-stored-marker")) (move-marker org-capture-last-stored-marker (point))) (if (fboundp 'deactivate-mark) (deactivate-mark)) (run-hooks 'org-after-refile-insert-hook)))) |