[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor ecff6bb 019/140: with-editor-file-name-history
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor ecff6bb 019/140: with-editor-file-name-history-exclude: new variable |
Date: |
Fri, 6 Aug 2021 12:51:11 -0400 (EDT) |
branch: elpa/with-editor
commit ecff6bb717c7a775228c7171c2b2fe67868b849f
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
with-editor-file-name-history-exclude: new variable
---
with-editor.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/with-editor.el b/with-editor.el
index babbd81..fa01a9d 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -252,6 +252,12 @@ Note that when a package adds an entry here then it
probably
has a reason to disrespect `server-window' and it likely is
not a good idea to change such entries.")
+(defvar with-editor-file-name-history-exclude nil
+ "List of regexps for filenames `server-visit' should no remember.
+When a filename matches any of the regexps, then `server-visit'
+does not add it to the variable `file-name-history', which is
+used when reading a filename in the minibuffer.")
+
;;; Mode Commands
(defvar with-editor-pre-finish-hook nil)
@@ -530,6 +536,16 @@ which may or may not insert the text into the PROCESS'
buffer."
(unless no-default-filter
(internal-default-process-filter process string)))
+(advice-add 'server-visit-files :after
+ 'server-visit-files--with-editor-file-name-history-exclude)
+
+(defun server-visit-files--with-editor-file-name-history-exclude
+ (files _proc &optional _nowait)
+ (pcase-dolist (`(,file _) files)
+ (when (--any (string-match-p it file)
+ with-editor-file-name-history-exclude)
+ (setq file-name-history (delete file file-name-history)))))
+
;;; Augmentations
(cl-defun with-editor-export-editor (&optional (envvar "EDITOR"))
- [nongnu] branch elpa/with-editor created (now 5519b6a), Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor bc6520b 002/140: Replace setenv with push on process-environment, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 580f225 001/140: reincarnation release, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 17df9b9 003/140: add AUTHORS.md and COPYING, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor b3631b8 006/140: make: fix dir target, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor fda7801 005/140: Add one more remap for evil, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 19716e9 007/140: remove with-editor.info, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ecff6bb 019/140: with-editor-file-name-history-exclude: new variable,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 4929d43 015/140: release version 2.5.2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 650e0ad 025/140: manual: include sub-minor part of version in subtitle, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7b6ac3a 026/140: base the Makefile on the same template used for other packages, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d28d074 008/140: regenerate manual after updating org and ox-texinfo+, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f602113 014/140: make: add bump-versions target, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor aaaeb98 022/140: prefer debianized binary name, if available, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor fb1e10a 030/140: Ignore /dir, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 1126035 004/140: Add remaps for common evil commands, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5bb0b8a 012/140: with-editor-sleeping-editor: document csh complications, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 15b2565 013/140: AUTHORS.md: update list of contributors, Jonas Bernoulli, 2021/08/06