From aab5bfd074e57d06a79e39d7c7c4760e1f385a06 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 17 Oct 2022 21:41:28 -0500 Subject: Bankruptcy 9 --- lisp/+ecomplete.el | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 lisp/+ecomplete.el (limited to 'lisp/+ecomplete.el') diff --git a/lisp/+ecomplete.el b/lisp/+ecomplete.el deleted file mode 100644 index b1392cf..0000000 --- a/lisp/+ecomplete.el +++ /dev/null @@ -1,45 +0,0 @@ -;;; +ecomplete.el --- ecomplete extras -*- lexical-binding: t; -*- - -;;; Commentary: - -;; see [[https://github.com/oantolin/emacs-config/blob/master/my-lisp/ecomplete-extras.el][oantolin's config]] - -;;; Code: - -(require 'ecomplete) - -(defun +ecomplete--name+address (email) - "Return a pair of the name and address for an EMAIL." - (let (name) - (when (string-match "^\\(?:\\(.*\\) \\)?<\\(.*\\)>$" email) - (setq name (match-string 1 email) - email (match-string 2 email))) - (cons name email))) - -(defun +ecomplete-add-email (email) - "Add email address to ecomplete's database." - (interactive "sEmail address: ") - (pcase-let ((`(,name . ,email) (+ecomplete--name+address email))) - (unless name (setq name (read-string "Name: "))) - (ecomplete-add-item - 'mail email - (format (cond ((equal name "") "%s%s") - ((string-match-p "^\\(?:[A-Za-z0-9 ]*\\|\".*\"\\)$" name) - "%s <%s>") - (t "\"%s\" <%s>")) - name email)) - (ecomplete-save))) - -(defun +ecomplete-remove-email (email) - "Remove email address from ecomplete's database." - (interactive - (list (completing-read "Email address: " - (ecomplete-completion-table 'mail)))) - (when-let ((email (cdr (+ecomplete--name+address email))) - (entry (ecomplete-get-item 'mail email))) - (setf (cdr (assq 'mail ecomplete-database)) - (remove entry (cdr (assq 'mail ecomplete-database)))) - (ecomplete-save))) - -(provide '+ecomplete) -;;; +ecomplete.el ends here -- cgit 1.4.1-21-gabe81