summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-10-16 00:18:29 -0400
committerKyle Meyer <kyle@kyleam.com>2014-10-16 00:18:29 -0400
commite04264320cad945527db4ea3ec92f45ac6d0a734 (patch)
tree5ca616184f0e0db3f37eac44086a6ea86665bd4e /bog.el
parentb5ad54a21505cbdcbd598eff26242fb8b4934d63 (diff)
downloadbog-e04264320cad945527db4ea3ec92f45ac6d0a734.tar.gz
Use org-with-wide-buffer macro
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el22
1 files changed, 9 insertions, 13 deletions
diff --git a/bog.el b/bog.el
index 0a72f46..587921f 100644
--- a/bog.el
+++ b/bog.el
@@ -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))