From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Completion in org mode: why pcomplete? Date: Mon, 20 Dec 2021 20:11:30 -0800 Message-ID: <878rwe7g25.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4099"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:wue72Xz4Ogxd47Sar94CYfO184E= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 21 05:12:26 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzWVm-0000wo-Q9 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 21 Dec 2021 05:12:26 +0100 Original-Received: from localhost ([::1]:58670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzWVl-0002LD-TE for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 20 Dec 2021 23:12:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzWV6-0002IP-Jg for help-gnu-emacs@gnu.org; Mon, 20 Dec 2021 23:11:44 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:35852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzWV4-0000V4-A9 for help-gnu-emacs@gnu.org; Mon, 20 Dec 2021 23:11:44 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mzWV0-000Aam-9p for help-gnu-emacs@gnu.org; Tue, 21 Dec 2021 05:11:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134993 Archived-At: 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