diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-10-16 00:18:29 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-10-16 00:18:29 -0400 |
commit | e04264320cad945527db4ea3ec92f45ac6d0a734 (patch) | |
tree | 5ca616184f0e0db3f37eac44086a6ea86665bd4e | |
parent | b5ad54a21505cbdcbd598eff26242fb8b4934d63 (diff) | |
download | bog-e04264320cad945527db4ea3ec92f45ac6d0a734.tar.gz |
Use org-with-wide-buffer macro
-rw-r--r-- | bog.el | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -253,13 +253,11 @@ year, and the first meaningful word in the title)." (defun bog-citekey-from-tree () "Retrieve citekey from first parent heading associated with citekey." - (save-excursion - (save-restriction - (widen) - (let (maybe-citekey) - (while (and (not (setq maybe-citekey (bog-citekey-from-heading))) - (org-up-heading-safe))) - maybe-citekey)))) + (org-with-wide-buffer + (let (maybe-citekey) + (while (and (not (setq maybe-citekey (bog-citekey-from-heading))) + (org-up-heading-safe))) + maybe-citekey))) (defun bog-citekey-from-heading () "Retrieve citekey from current heading title." @@ -303,12 +301,10 @@ year, and the first meaningful word in the title)." (buffer (find-file-noselect file)) refs) (with-current-buffer buffer - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (re-search-forward bog-citekey-format nil t) - (add-to-list 'refs (match-string-no-properties 0)))))) + (org-with-wide-buffer + (goto-char (point-min)) + (while (re-search-forward bog-citekey-format nil t) + (add-to-list 'refs (match-string-no-properties 0))))) (unless was-open (kill-buffer buffer)) refs)) |