branch: elpa/casual
commit 8d9be3f509eb6a5a1462ba41454a4e569b18454b
Merge: b207a1b14d 44e634d975
Author: Charles Choi <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #73 from kickingvegas/70-add-rename-visited-file-command
70 add rename visited file command
---
docs/editkit.org | 2 +-
docs/images/casual-editkit-open-screenshot.png | Bin 158382 -> 170624 bytes
lisp/casual-editkit-utils.el | 11 +++++++++--
tests/test-casual-editkit-utils.el | 6 +++++-
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/docs/editkit.org b/docs/editkit.org
index f8a9dcfb51..52bbf01eec 100644
--- a/docs/editkit.org
+++ b/docs/editkit.org
@@ -128,7 +128,7 @@ Operations related to search and replace are captured by
this menu. Note that th
[[file:images/casual-editkit-search-screenshot.png]]
** Open commands (~casual-editkit-open-tmenu~)
-Commands related to opening a file (either for writing or read-only) are
supported here. The *Project* sub-menu is also offered here.
+Commands related to opening a file (either for writing or read-only) are
supported here. Included are commands for visiting and renaming a file or
buffer. The *Project* sub-menu is also offered here.
[[file:images/casual-editkit-open-screenshot.png]]
diff --git a/docs/images/casual-editkit-open-screenshot.png
b/docs/images/casual-editkit-open-screenshot.png
index 23cc9e8aef..d6d1773808 100644
Binary files a/docs/images/casual-editkit-open-screenshot.png and
b/docs/images/casual-editkit-open-screenshot.png differ
diff --git a/lisp/casual-editkit-utils.el b/lisp/casual-editkit-utils.el
index 59014f5ac9..6a4bbe6fb3 100644
--- a/lisp/casual-editkit-utils.el
+++ b/lisp/casual-editkit-utils.el
@@ -136,6 +136,13 @@ also available from here."
("V" "Visit other…" find-file-read-only-other-window)
("M-v" "Visit in frame…" find-file-read-only-other-frame)]
+ ["Rename"
+ :pad-keys t
+ ("r" "File…" rename-visited-file
+ :inapt-if-not buffer-file-name)
+ ("R" "Buffer…" rename-buffer)
+ ("M-r" "Buffer Uniquely" rename-uniquely)]
+
["Project"
("p" "Project›" casual-editkit-project-tmenu)]]
@@ -636,11 +643,11 @@ Commands pertaining to rectangle operations can be
accessed here."
:transient t)]
["Replace"
- ("s" "String" string-rectangle
+ ("s" "String…" string-rectangle
:if-not casual-editkit-buffer-read-only-p
:inapt-if-not use-region-p
:transient t)
- ("i" "String Insert" string-insert-rectangle
+ ("i" "String Insert…" string-insert-rectangle
:if-not casual-editkit-buffer-read-only-p
:inapt-if-not use-region-p
:transient t)
diff --git a/tests/test-casual-editkit-utils.el
b/tests/test-casual-editkit-utils.el
index 364577b6e0..41c83f57ba 100644
--- a/tests/test-casual-editkit-utils.el
+++ b/tests/test-casual-editkit-utils.el
@@ -31,8 +31,9 @@
(let ((tmpfile "casual-editkit-open-tmenu.txt"))
(casualt-editkit-setup tmpfile)
- (cl-letf (;;((symbol-function #') (lambda () t))
+ (cl-letf (;; ((symbol-function #'buffer-file-name) (lambda () t))
(casualt-mock #'find-file)
+ (casualt-mock #'rename-visited-file)
(casualt-mock #'find-file-other-window)
(casualt-mock #'find-file-other-frame)
(casualt-mock #'find-alternate-file)
@@ -41,6 +42,9 @@
(let ((test-vectors
'((:binding "f" :command find-file)
+ (:binding "r" :command rename-visited-file)
+ (:binding "R" :command rename-buffer)
+ (:binding "M-r" :command rename-uniquely)
(:binding "F" :command find-file-other-window)
(:binding "M-n" :command find-file-other-frame)
(:binding "a" :command find-alternate-file)