From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] EUDC email addresses via completion-at-point in message-mode Date: Tue, 26 Apr 2022 21:58:48 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39604"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: emacs-devel@gnu.org To: Alexander Adolf Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 26 21:33:27 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 1njQw9-000A0V-FC for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Apr 2022 21:33:26 +0200 Original-Received: from localhost ([::1]:57878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njQw8-0002wV-IX for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Apr 2022 15:33:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njQOl-0001ep-G9 for emacs-devel@gnu.org; Tue, 26 Apr 2022 14:58:55 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njQOj-0002pl-IL for emacs-devel@gnu.org; Tue, 26 Apr 2022 14:58:54 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A60835C019E; Tue, 26 Apr 2022 14:58:51 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 26 Apr 2022 14:58:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1650999531; x=1651085931; bh=OdewvkbzG3 uqSWZ6KXpZQFqluuqu6+QL32ng934X8h0=; b=UOpc2PFCYEluLFx2aTpKgF4jZd IQExRjLFipzZm6Ciink3lx1PahgGGA5XtKn0U5lKfcuIAUt9uVElbO+dvp6o/y6u UoDu1A60qs3QY31Px4Ad50DMOVvFm3+eqwLWZvD22pVeqa3mI3jM3uItM9+aHNp/ XOOXBP7PgpmA/ekyRGC4ll3hlsVB1F1U9qqj+1Zec4EX07ZIV41mHbR0krTJssVM xN+X1g+ATPgX7LKeSF1YPTObQWC0D3AhCTQGQZBv3I4Nai/Uh+lV1rO5Prd45UIs bBnRlpnmiGolZGj4X8oUXo3DowpuXYL82Xy1aRPUHDoFcCjbTWtHEVQRe7aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650999531; x= 1651085931; bh=OdewvkbzG3uqSWZ6KXpZQFqluuqu6+QL32ng934X8h0=; b=K 63lVikODd0g34tSGiA7u5a2mZNrYMary8vWrbtGYPu7ABKbMY1BKe9tR0Xa5jPXf PEX3PdXUNvbrpf6MPgng3tT1SzJsRV7X0cfCKr3BI4UZ7voZbnHrGDxV/3eF8Y0m Hf+6OsJqWDXW+hFE8DVKWuXIpfgE/i09CO3JO8f65Whj2OsiYSxmZN/1mF/MI7H3 eR1Ph6gRG9Riv1z9XGLAoqGtJ0xWRUIWCjVD7GzhVVPWKyTUlk94/YdKs1vvvxjA sae+kicrZh4brjFhtqdoWjDsLCAuEMRiXYyWb+biK8PG4lhCxHPIYMMbeLnCJKs+ ya7W/tWbls9TAxrKF/4VQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefgdduvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhi phhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtf frrghtthgvrhhnpeffhfejveeiieeiudetgfehffelieevfeeffedtkeelheeludefueeu udehveeiffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Apr 2022 14:58:50 -0400 (EDT) In-Reply-To: (Alexander Adolf's message of "Tue, 26 Apr 2022 16:39:59 +0200") Mail-Followup-To: Alexander Adolf , emacs-devel@gnu.org Received-SPF: pass client-ip=66.111.4.29; envelope-from=fgunbin@fastmail.fm; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:288898 Archived-At: I've only skimmed through previous discussion, but will point out a few things in the patch. Thanks. On 26/04/2022 16:39 +0200, Alexander Adolf wrote: > +;;; Usage: > + > +;; (require 'eudc-capf) > +;; (add-hook 'completion-at-point-functions #'eudc-capf-complete -1 t) As you're showing add-hook with LOCAL t, perhaps you should also show some context, to avoid users pasting this directly into their .emacs. > +(defconst eudc-capf-modes '(message-mode) "List of modes in which email \ > +address completion is to be attempted.") Put docstring on its own line. > + (if (and (seq-some #'derived-mode-p eudc-capf-modes) > + (let ((mail-abbrev-mode-regexp message-email-recipient-header-regexp)) > + (mail-abbrev-in-expansion-header-p))) > + (eudc-capf-message-expand-name) You don't need to specify else-branch for an if. Just omit it. (same below) > +`completion-at-point'." > + (if (or (and (boundp 'eudc-server) eudc-server) > + (and (boundp 'eudc-server-hotlist) eudc-server-hotlist)) You're requiring eudc, why should these be unbound? > + (progn > + (setq-local completion-styles '(substring partial-completion)) > + (let* ((beg (save-excursion > + (if (re-search-backward "\\([:,]\\|^\\)[ \t]*" > + (point-at-bol) 'move) t instead of 'move? I also don't like the side-effect of setting completion-styles for the user, although only locally. Can it be done in some other way?