From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id LO3BBl+GBGLaowAAgWs5BA (envelope-from ) for ; Thu, 10 Feb 2022 04:28:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YA5sAl+GBGLEwQAAauVa8A (envelope-from ) for ; Thu, 10 Feb 2022 04:28:31 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7055640964 for ; Thu, 10 Feb 2022 04:28:30 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A8A235F713; Thu, 10 Feb 2022 03:28:27 +0000 (UTC) Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by mail.notmuchmail.org (Postfix) with ESMTPS id 755F15F70C for ; Thu, 10 Feb 2022 03:28:25 +0000 (UTC) Received: by mail-pl1-x62b.google.com with SMTP id 10so699457plj.1 for ; Wed, 09 Feb 2022 19:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:references:date:message-id:mime-version; bh=crt2lMUwY/eiqMY0qKiEjlrWab7M4oY0yCN631bfpwI=; b=iVgUh8899HeEbN3nalWfKYPynNpbDKbYyZ6EPYAWAk79eGv+aIoE2PJ6Pi488wpTVV 9GbUn0dsI6Zumd3jjVJB8iCmyrv35eDton+xBqo1puArO9Yrvcprg7R6m7xcQ/EJCPaa JiI0DcZE9Fmhi/I1irP+2wEsUYsB0sNfNRmyD4GvOkstGXshtkpCB099n7WHU+Z6B5Bz YVgevkbgVhxzPepjJZRZ2GZ4mVfFesayDvH4yFeQE3qa4XUXo/E+DnJ71v+yFccH99n4 RMW+Sd3f6nALq7O4YuuCwjSDCXSre6BI3hbScUdn4RQs845jkSksD5HFfx2olM4ksGX1 lpgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:references:date:message-id :mime-version; bh=crt2lMUwY/eiqMY0qKiEjlrWab7M4oY0yCN631bfpwI=; b=WSsgrDSIGEMTnzeXPjGEA9lEK7fCeVYdNVeReTpvkOY4D+aXmPHcimWPuhCN6jqSl2 Ny3M22BW6bO6nUjmXfdMTkyTcBtw1BJrV9xY9lD9VjLuw54TQnGpzGQBhcVHQofxvyPy SMEsMGHUjF5wvYcr0yKStsZssbMDmPl1hvzGj89B38O/o319n3WB8TrEgTJxVGqXn0Fb ZCs/8GtpXrJ1Wa+UuNGOWxx6HDfS82TyBgrhwvekM9a2wRhG1MzNfGP0BLLZqWywNyT6 M4DlDeybAllVehH0ZG97pMnnEYBGWyDMzVYTOgA9rxjgOwJjB4mbAThQHbYRoc/63ge8 IICg== X-Gm-Message-State: AOAM5339NLIKdXvjeAv47UdJU+j2bwBuvD6ZiPGw9THvVBR5Gk1hVh4P /vE42HLcFbeRmDIPOyNbePe/G3OHCW4= X-Google-Smtp-Source: ABdhPJyzTuNyUJp8q4qgkdgF+9kPmB2Psv4bC+OOfNWoAMbCyMI0WsDnlHq1c8qX0qAV/KOKnrGlIA== X-Received: by 2002:a17:90a:1988:: with SMTP id 8mr609785pji.33.1644463703296; Wed, 09 Feb 2022 19:28:23 -0800 (PST) Received: from localhost ([103.77.1.158]) by smtp.gmail.com with ESMTPSA id f18sm21281440pfc.203.2022.02.09.19.28.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 19:28:23 -0800 (PST) From: Utkarsh Singh To: Notmuch mailing list Subject: [Utkarsh Singh] Re: [PATCH] emacs: Add more front ends for address completion References: <878rujxuvi.fsf@gmail.com> Date: Thu, 10 Feb 2022 09:00:00 +0530 Message-ID: <875ypnxutj.fsf@gmail.com> MIME-Version: 1.0 Message-ID-Hash: I3HR4J23BPBA65ZERKJZ2AN6O4SG2LRT X-Message-ID-Hash: I3HR4J23BPBA65ZERKJZ2AN6O4SG2LRT X-MailFrom: utkarsh190601@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644463710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references:list-id:list-help:list-owner:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=qMNPgjlHgGJXlh9tuG0j3pItb9YAsWmow+BQvB53sso=; b=cPipb5rmaHQ6FP2uzkEg0GuTNpPV6tOwlFsei1L/jIxEUxR/94y5hLNU6rvZKVY78AnPIm 1zkX6gjv5jXdA0GFvTS0xDG7yPKwBpwL0cczioBxb2cO0xbTAkGF+2rd3Xpej+MZ43UKCr CdAt5RYwEqwOkZD0Mzvp3MxTT1UJLrbxbnoPDRdDAtJv8GH3SvXrBLSXx1Ysc9nZtgDzto 99sBO8pMaxOEZ5GhwcLhKjRfKJu7TOsjbqCmscdXyfJCh1gtDjqr4rNC+gky57E6kmeatt /+M+bJyOqMOUsByzC3xWbD0RZ4pGihk7l9eI1nFXVwvctbaNNarO3Vo/oYHMAQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644463710; a=rsa-sha256; cv=none; b=QGUtaGNVSv1rUVVacqXj04wru+eBal/JviffcPb4gmVDUpGblXVZZ3G2pPU4uFssYoNSGy WYsIEvmMCkm82un9aPGmEZSl3Y/07lfpip6jCirwU6TXMVmtCFZhmTZopEwQETiJLEhqim ITKxj+FUQYy0YW8MQOO0mzVnaF+o281NxXSLQcw/xqGZ1+MLzhmeSdg95RXnXSdhXQIxhY 3jVeoxiuTILAXY1mBmmmQfOO85vXZUOBSjhQU12xitEnYWs3crAFf2854tVK2zQQWTIU0v z2uDDFz009Kj51JLNpWtSCw3T6H0R89ZVBCMheG3DA1lrCHWSl5uEce0joE2NQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=iVgUh889; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=iVgUh889; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 7055640964 X-Spam-Score: -1.23 X-Migadu-Scanner: scn1.migadu.com X-TUID: IbuOD4lL7mIs -------------------- Start of forwarded message -------------------- From: Utkarsh Singh To: Tomi Ollila Subject: Re: [PATCH] emacs: Add more front ends for address completion Date: Thu, 10 Feb 2022 08:58:49 +0530 Hello Tomi, On 2022-02-09, 23:59 +0200, Tomi Ollila wrote: > On Tue, Feb 08 2022, Utkarsh Singh wrote: > >> Hello maintainers, >> >> Emacs Lisp Package Archive (ELPA) now includes a package called 'corfu', >> according to its documentation: >> >> Corfu enhances the default completion in region function with a >> completion overlay. The current candidates are shown in a popup >> below or above the point. Corfu is the minimalistic >> ~completion-in-region~ counterpart of the >> [[https://github.com/minad/vertico][Vertico]] minibuffer UI. >> >> Hence, this patch tries to add support for `completion-in-region' in >> `notmuch-address-expand-name'. By default, this behaviour is turned off >> so that existing users can enjoy existing completion techniques. > > The current "default" (i.e. w/o any notmuch emacs mua configuration) is to > use completing-read to do the completion. If "company" is available, then > company is used by default (w/ all address harvesting and so on...). > > This is "messy" enough ;( (i.e the notmuch-address-selection-function > is called if company mode is not available or notmuch-address-command > is a string instead of 'internal or 'as-is (or whatnot, too tired to do > deep investigation there ;/) > > This change, contributes even more "complexity" there. To keep the > complexity to the same level would be adding more > notmuch-address-selection-functions and have the defcustom there list > the options (also probably the name of notmuch-address-selection-function > would need to be changed to notmuch-fallback-address-selection-function > ;/) > I think, in general, you're right about the complexity and we should try minimize it. But this patch was originally derived from a bug I was experiencing with `(global-corfu-mode 1)' in `notmuch-message-mode'. Here are the steps to reproduce the bug: 1. [Install](https://notmuchmail.org/#index7h2) `notmuch`. 2. In emacs -Q session, evaluate the following ```elisp (progn (add-to-list 'load-path "/usr/share/emacs/site-lisp") ; Notmuch Emacs interface (package-initialize) (package-install 'corfu) (package-install 'vertico) (require 'notmuch) (require 'corfu) (require 'vertico) (vertico-mode 1) (corfu-global-mode 1) (notmuch-mua-new-mail)) ``` 3. Press `TAB` to generate address completion, then press `RET` to select address of your choice. After selection, you will notice that `notmuch-address-expand-name` fails to insert desired address, that is, you will get the following: ``` To: ``` Note: Check the trailing spaces. > All this said, I think this is not simple to solve, as this otherwise fine > change would indicate :/ No problem, I'm willing to help the maintainers on this matter. -- Utkarsh Singh https://utkarshsingh.xyz/ -------------------- End of forwarded message -------------------- -- Utkarsh Singh https://utkarshsingh.xyz/