Skip to content

Commit 1a62cd9

Browse files
committed
org-pcomplete: Fix completion inside bracketed link
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead): Drop closing brackets when completing inside bracketed link [[*head<point>]]. Reported-by: Carlos Pita <carlosjosepita2@gmail.com> Link: https://orgmode.org/list/87r1cfvvd0.fsf@localhost
1 parent fc8e375 commit 1a62cd9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lisp/org-pcomplete.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,11 @@ This needs more work, to handle headings with lots of spaces in them."
364364
(pcomplete-uniquify-list tbl)))
365365
;; When completing a bracketed link, i.e., "[[*", argument
366366
;; starts at the star, so remove this character.
367-
(substring pcomplete-stub 1))))
367+
;; Also, if the completion is done inside [[*head<point>]],
368+
;; drop the closing parentheses.
369+
(replace-regexp-in-string
370+
"\\]+$" ""
371+
(substring pcomplete-stub 1)))))
368372

369373
(defun pcomplete/org-mode/tag ()
370374
"Complete a tag name. Omit tags already set."

0 commit comments

Comments
 (0)