[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Completion in org mode: why pcomplete?
From: |
Eric Abrahamsen |
Subject: |
Completion in org mode: why pcomplete? |
Date: |
Mon, 20 Dec 2021 20:11:30 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Hi all,
I got caught up for a while in exploring exciting completion frameworks
like ivy and selectrum, but eventually realized that my plain old M-TAB
in-buffer completion is broken, and has been for a long time.
prog-mode is fairly straightforward, but completion in text-mode
buffers -- in my present case, an org-mode buffer -- seems like a
confusing tangle, and I'm trying to unpick it.
Once I figured out how to stop flyspell mode from hijacking C-M-i, it
turned out that org-mode binds that to `complete-symbol' which consults
`completion-at-point-functions' of which
`pcomplete-completions-at-point' is one.
So actually org-mode completion is done with pcomplete, which is a
package I don't really understand, but pcomplete in a sort of "capf
emulation mode".
What I'd like to know is if I can ditch pcomplete altogether, bind C-M-i
to `completion-at-point', and just put my completion functions in
`completion-at-point-functions' directly.
My personal preference would be to have capf set to a list of the
following:
- an org-specific completion function (which might not exist if org only
caters to pcomplete)
- an ispell function that completes based on dictionaries
- a function that does what `dabbrev-expand' does (expands based on
words already in the buffer/other places)
`dabbrev-expand' already has its own keybinding, of course, and it does
more than what plain old `completion-at-point' is capable of, but I'd
*also* like it in capf.
Perhaps none of these three functions (by which I mean
ispell/dabbrev/org functions specifically meant for use within capf)
even exist?
Perhaps the easiest thing would be to try to add the ispell/dabbrev
stuff to pcomplete, so I can have all my completion inside pcomplete
inside completion-at-point-functions inside... complete-symbol?
I'd really rather just call `completion-at-point' directly. Does anyone
have any advice on this?
Thanks,
Eric
- Completion in org mode: why pcomplete?,
Eric Abrahamsen <=