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 wGAYML6/AmItSgAAgWs5BA (envelope-from ) for ; Tue, 08 Feb 2022 20:08:46 +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 AO7uLL6/AmK7iAAAauVa8A (envelope-from ) for ; Tue, 08 Feb 2022 20:08:46 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 1392F35EBB for ; Tue, 8 Feb 2022 20:08:46 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 76FE25F6C9; Tue, 8 Feb 2022 19:08:43 +0000 (UTC) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by mail.notmuchmail.org (Postfix) with ESMTPS id 65A005F5EB for ; Tue, 8 Feb 2022 14:37:01 +0000 (UTC) Received: by mail-pf1-x430.google.com with SMTP id i17so19158285pfq.13 for ; Tue, 08 Feb 2022 06:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=JJSBvTmluW3F/47I6CxQF4DOq2eyHi5yoaWVjzsB5W8=; b=NUmdxXj1sW5XB4i/x5ot2SOofB9TlwiH/dMu/dFyEdlCe7mZcOejpKoVdOqOxgkLUP fIfKy/uXxtNsl4IkIGyMS6BLs7yG2oHobLI5XXKnK/KkimYlZsQNR4nJxy8RqChFISaY cRNEM9Uw+Q7MCSPBK9z07Y+UTz0Pz21QhYA09OyXgpBe9lwdAujcdztCQ3KBh7s04ekB kE48CfbS+cANckOUyI3FY6iwvEG2eCOESw0JxPvbeYpFgKVVbq/pOiyR1DHkKrDgOM3h 7CLiAymcrjCW039zrxDDyyCkEYDOQONAgKy39EU98DREVA4lYKuxscEFnkHtVxp+S4oe v+qw== 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:date:message-id:mime-version; bh=JJSBvTmluW3F/47I6CxQF4DOq2eyHi5yoaWVjzsB5W8=; b=Az7RA8x2vbnjyZnjVErSAQ1yjtcIifeFECZeOmn7iZFzemjbyzcaxEWq19Nsw9Q4w3 tjBfInO0x00qtfOmYb2KzdRIMp2UwAPKe8kWcxyci0sGpiKfkMW3ZbuVaOwHQ3QSHy7D YDJP7A3stnGT0lAiytHQOkY8lsrvU0FMtqxoRFguGHMxgwLiS4/xAJ+xo2VLyDbsvNsI qw13HnzC+GoruA36vfvn/skcNNhkOGkwhDLocmUxORbP+vSOls8C8MMMMzp4Vnc5I/dt hpc+qOr/ta97KP566jwqdeKsktre4KAvHXLfU43xjqz4CPMUrHZ1eSRGh2LFHS10EJtI 2UCQ== X-Gm-Message-State: AOAM532ha3uZ4VNwjuMmAU6fkcDSGM9XUvjPJw1hHLoBKfED/XyX3H6e wb6gC4abkhZYhdxn7pQchEkoBc+qWbM= X-Google-Smtp-Source: ABdhPJw8Nh0mbqKpcNIXltVfuIjZOrj1Qq+iBJTIEMTG4ppZN+DQAml4UW/NjEFEB15OYBGhckID7w== X-Received: by 2002:a05:6a00:1409:: with SMTP id l9mr4567656pfu.23.1644331019384; Tue, 08 Feb 2022 06:36:59 -0800 (PST) Received: from localhost ([103.77.1.158]) by smtp.gmail.com with ESMTPSA id f3sm16877445pfe.67.2022.02.08.06.36.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:36:58 -0800 (PST) From: Utkarsh Singh To: Notmuch mailing list Subject: [PATCH] emacs: Add more front ends for address completion Date: Tue, 08 Feb 2022 20:08:34 +0530 Message-ID: <87bkzhbez9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 Message-ID-Hash: YGMUTCT35QUY2KYLZZJCHQ7LYSBLWZW7 X-Message-ID-Hash: YGMUTCT35QUY2KYLZZJCHQ7LYSBLWZW7 X-Mailman-Approved-At: Tue, 08 Feb 2022 19:08:41 +0000 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: 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=1644347326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type:list-id: list-help:list-owner:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=YsahyOkeMtG+eiPNI220nUF1Y99Gs4A5XsOBzI1KlmI=; b=Qfho51lhYjtzjpQqwlY/wi/M/nB2MnM5AQQXqMQv7hztXxhHIqdzGIlXc85yNm/4oC09zC C/HarxbGNGrIBmX7+yYXYAeAOKO7H7LO4fmTyYWcX1hg26IzlghGnxaYpC2Jwg0EiOTUUc q2XbsRdKw3KniFJ1WsbisQeN9ut0xDdaM4Gb9toGVdCVa5sC//V/bcD787msGBr5kHZ1yY mvaJrF3HW5oWJ0BjL7U/dVaCRx8Y+jYA2xPphnSg+3yo/31GlbYWriXDaQ+YfN14w4Dnbt ay3l7v4CgLyne+wjSJwEypPRk6a/c4xft8uxTAiiEEiIzKH+Vpl0o+i1aNEFRA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644347326; a=rsa-sha256; cv=none; b=cqcB6Ke8BWZWibcCR6xLQLDQ5LIrv268erjIhx3JAmft9rN4P8QqPtb1gssbfdd0C5UtTu nnne+srHKfdy9tXhGklWJIqBroOXQQMQoToQM30scRu0ZXmKXph1X5vb5s2QQ/qR3KYbqB BzkM/kokCbIztkJpFEu0+RThjTsr0sUIcuPEqwTfEDMkVY0KQCcijcZc3/6L8D+2Wzo/+3 yClMCE+5QpXNYyrrfQO2/lg+EplMP1NVNulBm0SelfNwx2TusbK2T0wlHFVBiUMjTuWMzm q05Yj4s3eqTnGM5h/15DOWrNOtGs0wDNeHSmlqy2UFwZscHTBW5VvxazNg74PQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=NUmdxXj1; 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 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.22 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=NUmdxXj1; 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 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1392F35EBB X-Spam-Score: -2.22 X-Migadu-Scanner: scn0.migadu.com X-TUID: mokzrOw0jOxJ --=-=-= Content-Type: text/plain 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. Thank you, Utkarsh Singh -- Utkarsh Singh https://utkarshsingh.xyz/ --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-emacs-Add-more-front-ends-for-address-completion.patch Content-Description: patch >From fdc88b81fef763f7d7dcdc899aa8e90482c574fa Mon Sep 17 00:00:00 2001 From: Utkarsh Singh Date: Tue, 8 Feb 2022 19:17:26 +0530 Subject: [PATCH] emacs: Add more front ends for address completion Add support for address completion through completion-in-region. * notmuch-address.el (notmuch-address-use-completion-in-region): Introduce customizable variable to activate the new front end. (notmuch-address-selection-function, notmuch-address-expand-name): Use it. --- emacs/notmuch-address.el | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 1a4cdda2..cfb56a3a 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -123,10 +123,10 @@ you should make sure it is not somewhere publicly readable." (defcustom notmuch-address-selection-function 'notmuch-address-selection-function "The function to select address from given list. -The function is called with PROMPT, COLLECTION, and INITIAL-INPUT -as arguments (subset of what `completing-read' can be called -with). While executed the value of `completion-ignore-case' -is t. See documentation of function +The function is called with PROMPT, COLLECTION, INITIAL-INPUT, +BEG and END as arguments (subset of what `completing-read' can be +called with). While executed the value of +`completion-ignore-case' is t. See documentation of function `notmuch-address-selection-function' to know how address selection is made by default." :type 'function @@ -150,13 +150,19 @@ matching `notmuch-address-completion-headers-regexp'." :group 'notmuch-send :group 'notmuch-address) +(defcustom notmuch-address-use-completion-in-region nil + "Use `completion-in-region' for address completion." + :type 'boolean + :group 'notmuch-send + :group 'notmuch-address) + ;;; Setup -(defun notmuch-address-selection-function (prompt collection initial-input) - "Call (`completing-read' - PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)" - (completing-read - prompt collection nil nil initial-input 'notmuch-address-history)) +(defun notmuch-address-selection-function (prompt collection initial-input beg end) + (if notmuch-address-use-completion-in-region + (completion-in-region beg end collection) + (completing-read + prompt collection nil nil initial-input 'notmuch-address-history))) (defvar notmuch-address-completion-headers-regexp "^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):") @@ -245,7 +251,9 @@ requiring external commands." (funcall notmuch-address-selection-function (format "Address (%s matches): " num-options) options - orig))))) + orig + beg + end))))) (if chosen (progn (push chosen notmuch-address-history) -- 2.35.1 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --=-=-=--