unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Completion in org mode: why pcomplete?
@ 2021-12-21  4:11 Eric Abrahamsen
  2021-12-21  9:00 ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Abrahamsen @ 2021-12-21  4:11 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-21 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-21  4:11 Completion in org mode: why pcomplete? Eric Abrahamsen
2021-12-21  9:00 ` Eric S Fraga
2021-12-21 17:26   ` Eric Abrahamsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).