[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/crux a471cbe 102/112: Add crux-recentf-find-directory
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/crux a471cbe 102/112: Add crux-recentf-find-directory |
Date: |
Wed, 11 Aug 2021 09:58:02 -0400 (EDT) |
branch: elpa/crux
commit a471cbed343dc5ff3a7150214726fe4ea0d3cf9e
Author: Martin Polden <mpolden@mpolden.no>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add crux-recentf-find-directory
---
CHANGELOG.md | 1 +
README.md | 1 +
crux.el | 19 ++++++++++++++-----
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4b7604e..8d3510d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
* [#65](https://github.com/bbatsov/crux/pull/65): Add a configuration option
to move using visual lines in `crux-move-to-mode-line-start`.
* [#72](https://github.com/bbatsov/crux/pull/72): Add
`crux-kill-buffer-truename`. Kills path of file visited by current buffer.
+* [#78](https://github.com/bbatsov/crux/pull/78): Add
`crux-recentf-find-directory`. Open recently visited directory.
### Bugs fixed
diff --git a/README.md b/README.md
index 27a2522..939a5ed 100644
--- a/README.md
+++ b/README.md
@@ -67,6 +67,7 @@ Command |
Suggested Keybinding(s)
`crux-smart-open-line` | <kbd>S-RET</kbd> or
<kbd>M-o</kbd> | Insert an empty line and indent it properly (as in most IDEs).
`crux-cleanup-buffer-or-region` | <kbd>C-c n</kbd> | Fix
indentation in buffer and strip whitespace.
`crux-recentf-find-file` | <kbd>C-c f</kbd> or
<kbd>Super-r</kbd> | Open recently visited file.
+`crux-recentf-find-directory` | <kbd>C-c F</kbd> | Open
recently visited directory.
`crux-view-url` | <kbd>C-c u</kbd> | Open
a new buffer containing the contents of URL.
`crux-eval-and-replace` | <kbd>C-c e</kbd> | Eval
a bit of Emacs Lisp code and replace it with its result.
`crux-transpose-windows` | <kbd>C-x 4 t</kbd> |
Transpose the buffers between two windows.
diff --git a/crux.el b/crux.el
index c6f1215..b46c6a0 100644
--- a/crux.el
+++ b/crux.el
@@ -606,17 +606,26 @@ as the current user."
(insert (format-time-string "%c" (current-time))))
;;;###autoload
-(defun crux-recentf-find-file ()
- "Find a recent file using `completing-read'."
+(defun crux-recentf-find-file (&optional filter)
+ "Find a recent file using `completing-read'.
+When optional argument FILTER is a function, it is used to
+transform recent files before completion."
(interactive)
- (let ((file (completing-read "Choose recent file: "
- (mapcar #'abbreviate-file-name recentf-list)
- nil t)))
+ (let* ((filter (if (functionp filter) filter #'abbreviate-file-name))
+ (file (completing-read "Choose recent file: "
+ (delete-dups (mapcar filter recentf-list))
+ nil t)))
(when file
(find-file file))))
(define-obsolete-function-alias 'crux-recentf-ido-find-file
'crux-recentf-find-file "0.4.0")
+;;;###autoload
+(defun crux-recentf-find-directory ()
+ "Find a recent directory using `completing-read'."
+ (interactive)
+ (crux-recentf-find-file (lambda (file) (abbreviate-file-name
(file-name-directory file)))))
+
;; modified from https://www.emacswiki.org/emacs/TransposeWindows
;;;###autoload
(defun crux-transpose-windows (arg)
- [nongnu] elpa/crux 3e07035 073/112: Add missing autoloads, (continued)
- [nongnu] elpa/crux 3e07035 073/112: Add missing autoloads, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 7365fdc 075/112: Add crux-copy-file-preserve-attribute, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e67d040 078/112: Allow crux-sudo-edit on remote files, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2a1a39a 083/112: Add a few GitHub templates, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 5ba2f3b 084/112: Add a changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux c014640 086/112: Tweak some wording, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux dd3f0e5 089/112: Add function crux-kill-and-join-forward, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 23ffa81 092/112: Touch up the previous commit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 519629b 094/112: Update the changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 273390e 101/112: Read file name insead of raw string, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux a471cbe 102/112: Add crux-recentf-find-directory,
ELPA Syncer <=
- [nongnu] elpa/crux 6bfd212 112/112: Update my e-mail, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux ba4b05c 021/112: Support tcsh, fish and ksh for crux-find-shell-init-file, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 785dfba 095/112: crux-smart-open-line-above: Use crux-move-to-mode-line-start, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux c3b6138 107/112: Fixed extra line issue when duplicating, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 6c02dab 071/112: Fold a few long lists, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 9341c6b 072/112: Silence byte compiler, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 5395c06 076/112: New function: crux-find-user-custom-file, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 7569d26 085/112: Bump the copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 139eb6f 096/112: Add crux-kill-buffer-truename, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux fb648f0 099/112: Add missing autoload, ELPA Syncer, 2021/08/11