projects
/
elisp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dec8397
)
Added selector/quick-pick-recent-filter.
author
Francois Fleuret
<francois@fleuret.org>
Wed, 2 Aug 2017 06:06:16 +0000
(08:06 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Wed, 2 Aug 2017 06:06:16 +0000
(08:06 +0200)
selector.el
patch
|
blob
|
history
diff --git
a/selector.el
b/selector.el
index
bf9a852
..
ab50928
100644
(file)
--- a/
selector.el
+++ b/
selector.el
@@
-73,6
+73,11
@@
Otherwise use the mode-line."
:type 'hook
:group 'selector)
:type 'hook
:group 'selector)
+(defcustom selector/quick-pick-recent-filter nil
+ "Regexp specifying which filenames should be hidden by `selector/quick-pick-recent'"
+ :type 'string
+ :group 'selector)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defface selector/selection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defface selector/selection
@@
-390,27
+395,37
@@
filename."
(file-name-nondirectory filename)))
(selector/find-file filename)))
(file-name-nondirectory filename)))
(selector/find-file filename)))
-(defun selector/quick-pick-recent ()
+(defun selector/quick-pick-recent (
universal
)
"Open a file picked in `recentf-list' with the dynamic
"Open a file picked in `recentf-list' with the dynamic
-pattern-matching search implemented in `selector/select'. With a
-prefix argument, allows to edit the filename after selection."
- (interactive)
+pattern-matching search implemented in `selector/select'. Without
+a prefix argument, hide files matching
+`selector/quick-pick-recent-filter'. With a prefix argument before the
+selection of the file per se, permits to edit it before opening."
+ (interactive "P")
(unless (and (boundp recentf-mode) recentf-mode)
(error "recentf mode must be turned on"))
(unless (and (boundp recentf-mode) recentf-mode)
(error "recentf mode must be turned on"))
- ;; (setq selector/previous-filename "")
-
- (selector/select
-
- (mapcar
- (lambda (s)
- (cons (selector/filename-to-string s) s))
- recentf-list)
+ (let ((l
+ (mapcar
+ (lambda (s) (cons (selector/filename-to-string s) s))
+ (if (and (not universal) selector/quick-pick-recent-filter)
+ (delq nil
+ (mapcar
+ (lambda (x) (and (not (string-match selector/quick-pick-recent-filter x)) x))
+ recentf-list)
+ )
+ recentf-list
+ )
+ )
+ ))
- 'selector/pick-file
- "*selector find-file*"
- ))
+ (selector/select
+ l
+ 'selector/pick-file
+ "*selector find-file*"
+ ))
+ )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; To search in the current buffer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; To search in the current buffer