Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

70 add rename visited file command #73

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/editkit.org
Original file line number Diff line number Diff line change
Expand Up @@ -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]]

Expand Down
Binary file modified docs/images/casual-editkit-open-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions lisp/casual-editkit-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)]]

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion tests/test-casual-editkit-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down