From aab516cd0cae65796cce89b29691e95d18bec3ef Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Thu, 26 Aug 2021 12:00:21 +0200 Subject: [PATCH] worf.el (worf--rfloc): Re-use zo-goto-heading --- worf.el | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/worf.el b/worf.el index ebc3bf2..1aa7507 100755 --- a/worf.el +++ b/worf.el @@ -1221,20 +1221,10 @@ This is accomplished by putting it at the start of `org-refile-history'." (with-selected-window target-window (save-buffer)))) -(defun worf--goto-heading (heading) - "Goto a top-level HEADING and set the match data. -Insert HEADING if it doesn't exist." - (let ((regex (concat "^\\* " heading))) - (goto-char (point-min)) - (unless (re-search-forward regex nil t) - (goto-char (point-max)) - (insert "* " heading) - (looking-back regex (line-beginning-position))))) - (defun worf--rfloc (fname heading) (with-current-buffer (find-file-noselect fname) (save-excursion - (worf--goto-heading heading) + (zo-goto-heading heading) (list (save-match-data (org-get-heading)) (buffer-file-name) org-heading-regexp