bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58487: [PATCH] Allow filtering what items are added to Ecomplete


From: Philip Kaludercic
Subject: bug#58487: [PATCH] Allow filtering what items are added to Ecomplete
Date: Thu, 13 Oct 2022 10:06:07 +0000

Tags: patch


I've had this as a customisation in my local .emacs file, implemented as
advice around ecomplete-add-item:

--8<---------------cut here---------------start------------->8---
(define-advice ecomplete-add-item (:around (oldfun type key text))
  "Filter out common pseudo addresses from the database.
OLDFUN is `ecomplete-add-item', passed by `advice-add', that will
be invoked with TYPE, KEY and TEXT if KEY doesn't match a known
address I don't care about."
  (unless (string-match-p
           (rx (or (: "@noreply.github.com" eos)
                   (: "@reply.github.com" eos)
                   (: bos "notifications@github.com" eos)
                   (: "@debbugs.gnu.org" eos)))
           key)
    (funcall oldfun type key text)))
--8<---------------cut here---------------end--------------->8---

Having this as a regular option seems preferable to me, so I'd like to
suggest it here.

In GNU Emacs 29.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.17.6) of 2022-10-13 built on rhea
Repository revision: 0b170c6caeeb669df3cf97c54c43da9cf77e6b42
Repository branch: master
System Description: Fedora Linux 36 (Workstation Edition)

Configured using:
 'configure --with-pgtk --with-imagemagick'

Attachment: 0001-Allow-filtering-what-items-are-added-to-Ecomplete.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]