From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Thoughts on Refactoring In-Buffer Completion In message.el Date: Sat, 25 Jun 2022 04:22:46 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8889"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Alexander Adolf Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 25 10:25:10 2022 Return-path: Envelope-to: ged-emacs-devel@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 1o516K-000211-9w for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jun 2022 10:25:08 +0200 Original-Received: from localhost ([::1]:49612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o516I-0004WY-Ft for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jun 2022 04:25:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o514D-0003oo-2i for emacs-devel@gnu.org; Sat, 25 Jun 2022 04:23:00 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o514A-0004Fy-De for emacs-devel@gnu.org; Sat, 25 Jun 2022 04:22:56 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D7A0E440B36; Sat, 25 Jun 2022 04:22:52 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 871F5440B08; Sat, 25 Jun 2022 04:22:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656145371; bh=B1DMxIjiEatuaHMS4n1A+LaNJL2VdzcyO61huOvHpHI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=UlVblGfqn9yORDCqHVPxYIOQ9WcjZq06fVZYgvCB1uCsP/F/oddshkwmq+mzwRdOw suGx20jfatw5bF4jU5vwaIc6NY+FI37ZIdg2ctIhWM72zXDk6AgpBXwKcKO3JSuB+K 6ok762OxKgcg5rlKNkukLs5hIqZGp2jfDJ+qjTNfhAAyMBKpHpfxAm4DXB2gemAEbR lWX1L5ToKoHbA9uw3p62CZvGLe/cHWw8OyIvUpORROMutImQmQSVJ1hhJMze1ygmkk 5RSpRdA7Tffhmc+yY//FF0gBDAjUdiez6mHDh7MQzHGtVOvLNb1TO7BvFziNjP3YI+ //kwkCRZ/BFXg== Original-Received: from alfajor (smb-adp02.hotspot.hub-one.net [213.174.99.150]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7336212069F; Sat, 25 Jun 2022 04:22:50 -0400 (EDT) In-Reply-To: (Alexander Adolf's message of "Thu, 23 Jun 2022 17:26:49 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291585 Archived-At: > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 (defcustom message-completion-alist > =E2=94=82 `((,message-newgroups-header-regexp > =E2=94=82 . '(:capf-style 'newsgroup > =E2=94=82 :capf-funs '(gnus-capf-complete))) ;; hypotheti= cal > =E2=94=82 (,message-email-recipient-header-regexp > =E2=94=82 . '(:capf-style 'email > =E2=94=82 :capf-funs '(eudc-capf-complete)))) ;; exists > =E2=94=82 "docstring" > =E2=94=82 ) > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 Sounds fine, tho "capf-style" sounds wrong: these are the names of categories, not a styles. Also `capf-funs` sounds wrong: these should be completion tables not CAPFs. The CAPFs are the functions which decide which completion table to use and what's the BEG...END that's being completed, and this should not depend on the backend since they only depend on the format of messages (and hence belong in `message.el`). Currently we have `message-completion-alist` which decides on a line-by-line basis what kind of completion we're doing, and then we have a specialized function that decides what's the BEG..END to use and which backend to use. Maybe `message-completion-alist` should be beefed up so that it cuts this middle man (specialized function): i.e. provide not just a line-based regexp to decide which specialized function to use, but also provide some way to specify the BEG..END and the backend*S*. Maybe have it be a list of (FUNCTION CATEGORY . BACKENDS) ? where FUNCTION should return (BEG . END) if this completion applies? > 2) Refactor ecomplete, mailabbrev, and bbdb stuff out of message.el as > much as possible. AFAIK this is already done for `ecomplete`. Stefan