diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-18 15:47:56 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-18 17:54:35 +0200 |
commit | c25ac5ecd4fa6235ca1bdf0dfeec76d2d36b4212 (patch) | |
tree | 6aab9c61e75e871f3492250c344207add9af48b5 | |
parent | 961367bf6abb853a86a7490161720027af1791a4 (diff) | |
download | org-mode-c25ac5ecd4fa6235ca1bdf0dfeec76d2d36b4212.tar.gz |
org-pcomplete: Fix search string completion
* lisp/org-pcomplete.el (pcomplete/org-mode/tag): Use
`org-get-heading'.
-rw-r--r-- | lisp/org-pcomplete.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el index 90eb84e..af290d9 100644 --- a/lisp/org-pcomplete.el +++ b/lisp/org-pcomplete.el @@ -323,18 +323,18 @@ When completing for #+STARTUP, for example, this function returns (defun pcomplete/org-mode/searchhead () "Complete against all headings. This needs more work, to handle headings with lots of spaces in them." - (while - (pcomplete-here - (save-excursion - (goto-char (point-min)) - (let (tbl) - (let ((case-fold-search nil)) - (while (re-search-forward org-todo-line-regexp nil t) - (push (org-make-org-heading-search-string - (match-string-no-properties 3)) - tbl))) - (pcomplete-uniquify-list tbl))) - (substring pcomplete-stub 1)))) + (while (pcomplete-here + (save-excursion + (goto-char (point-min)) + (let (tbl) + (while (re-search-forward org-outline-regexp nil t) + (push (org-make-org-heading-search-string + (org-get-heading t t t t)) + tbl)) + (pcomplete-uniquify-list tbl))) + ;; When completing a bracketed link, i.e., "[[*", argument + ;; starts at the star, so remove this character. + (substring pcomplete-stub 1)))) (defun pcomplete/org-mode/tag () "Complete a tag name. Omit tags already set." |