From 9b2bda7f2b714e59c5c53ab6bea7221730da0cea Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 22 May 2022 18:46:39 +0200 Subject: Note down some discoveries about org-refile completion --- itches/emacs/tracker.org | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'itches') diff --git a/itches/emacs/tracker.org b/itches/emacs/tracker.org index b667de5..a9c3507 100644 --- a/itches/emacs/tracker.org +++ b/itches/emacs/tracker.org @@ -504,9 +504,32 @@ allows "ipsum" to be aligned below "lorem". ID, but it returns integers, so maybe the tweak should be made somewhere above in the call stack? **** TODO Make org-refile completion more similar to filename completion -With =C-x p p=, =C-x p f=, and Gnus's =B m=, typing "bar" matches -"foo/bar". Not in org-refile with ~org-refile-use-outline-path~, for -some reason. +I'd like to have org-refile completion work like =C-x p p=, =C-x p f=, and +Gnus's =B m=, where typing "bar" matches "x/bar". + +Current org-refile config: +#+begin_src elisp +(setq org-refile-targets (list (cons nil (cons :maxlevel 10))) + org-refile-use-outline-path t + org-outline-path-complete-in-steps nil) +#+end_src + +IIUC =C-x p= commands use ~project--file-completion-table~, which passes a +lambda to ~completing-read~ which returns ~(category . project-file)~ +metadata, and… + +#+begin_src elisp +(alist-get 'styles (alist-get 'project-file completion-category-defaults)) +#+end_src + +… says =substring=. Likewise, ~gnus-summary-move-article~ uses +~gnus-completing-read~, which by default uses +~gnus-emacs-completing-read~, which sets ~completion-styles~ to +~gnus-completion-styles~, which includes =substring=. + +Ergo: either I add =substring= to my ~completion-styles~, or I teach +~org-refile~ to use =substring=… by default? when ~path-complete-in-steps~ +is nil? depending on a user option? 🤔 *** Programming modes **** ~conf-mode~ ***** TODO Tweak ~javaprop~ comments -- cgit v1.2.3