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

Merge development to main 20241210_145946 #109

Merged
merged 7 commits into from
Dec 10, 2024
Binary file modified docs/images/casual-dired-screenshot-unicode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/casual-dired-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/casual-editkit-tools-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lisp/casual-dired-sort-by.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
(require 'casual-dired-utils)
(require 'casual-dired-variables)

;;;###autoload (autoload 'casual-dired-sort-by-tmenu "casual-dired-sort-by" nil t)
(transient-define-prefix casual-dired-sort-by-tmenu ()
"Transient menu to sort Dired buffer by different criteria.

Expand Down
18 changes: 10 additions & 8 deletions lisp/casual-dired-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ ASCII-range string."
(casual-lib-quit-one)
(casual-lib-quit-all)])

;;;###autoload (autoload 'casual-dired-search-replace-tmenu "casual-dired-utils" nil t)
(transient-define-prefix casual-dired-search-replace-tmenu ()
["Search & Replace"
["Search in Files"
:pad-keys t
("C-s" "I-search…" dired-do-isearch :transient nil)
("M-s" "I-search regexp…" dired-do-isearch-regexp :transient nil)
("s" "Search first regexp match…" dired-do-search :transient nil)]

["Replace in Files"
("r" "Query regexp and replace…" dired-do-query-replace-regexp :transient nil)]]
("C-s" "I-search…" dired-do-isearch)
("M-s" "I-search regexp…" dired-do-isearch-regexp)
("s" "Search first regexp match…" dired-do-search)]
["Replace in Files"
("r" "Query regexp and replace…" dired-do-query-replace-regexp)]]

["grep-style regex"
("g" "Find regex…" dired-do-find-regexp :transient nil)
("G" "Find regex and replace…" dired-do-find-regexp-and-replace :transient nil)]
[("g" "Find regex…" dired-do-find-regexp)
("G" "Find regex and replace…" dired-do-find-regexp-and-replace)]

[("f" "Find in files (rgrep)…" rgrep)]]

[:class transient-row
(casual-lib-quit-one)
Expand Down
5 changes: 3 additions & 2 deletions lisp/casual-dired.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
("~" "Flag Backups" dired-flag-backup-files :transient t)
("x" "Delete Flagged" dired-do-flagged-delete :transient t)
("r" "Regexp›" casual-dired-regexp-tmenu :transient nil)
("#" "Utils›" casual-dired-utils-tmenu :transient nil)]
("#" "Utils›" casual-dired-utils-tmenu :transient nil)
("/" "Search & Replace›" casual-dired-search-replace-tmenu :transient nil)]

["Navigation"
:pad-keys t
Expand Down Expand Up @@ -190,7 +191,7 @@
:pad-keys t
("C-s" "I-Search…" dired-isearch-filenames :transient nil)
("M-s" "I-Search Regexp…" dired-isearch-filenames-regexp :transient nil)
("/" "Search & Replace›" casual-dired-search-replace-tmenu :transient nil)]
("M-f" "Find in files (rgrep)…" rgrep)]

["New"
("+" "Directory" dired-create-directory :transient t)
Expand Down
24 changes: 22 additions & 2 deletions lisp/casual-editkit-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
(t "Magit Status"))
(message "Not a version controlled buffer.")))

;;;###autoload (autoload 'casual-editkit-open-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-open-tmenu ()
"Menu for ‘Open’ commands.

Expand Down Expand Up @@ -148,6 +149,7 @@ also available from here."

casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-project-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-project-tmenu ()
"Menu for ‘Project’ commands.

Expand Down Expand Up @@ -186,6 +188,7 @@ Commands pertaining to project operations can be accessed here."

casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-edit-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-edit-tmenu ()
"Menu for ‘Edit’ commands.

Expand Down Expand Up @@ -233,6 +236,7 @@ Commands pertaining to editing operations can be accessed here."
("U" "Undo" undo :transient t)
(casual-lib-quit-all)])

;;;###autoload (autoload 'casual-editkit-emoji-symbols-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-emoji-symbols-tmenu ()
"Menu for ‘Emoji & Symbols’ commands.

Expand Down Expand Up @@ -284,6 +288,7 @@ inserting common miscellaneous symbols."
("U" "Undo" undo :transient t)
(casual-lib-quit-all)])

;;;###autoload (autoload 'casual-editkit-mark-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-mark-tmenu ()
"Menu for ‘Mark’ commands.

Expand All @@ -298,6 +303,7 @@ Commands pertaining to marking operations can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-copy-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-copy-tmenu ()
"Menu for ‘Copy’ commands.

Expand All @@ -315,6 +321,7 @@ Commands pertaining to copying can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-kill-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-kill-tmenu ()
"Menu for ‘Kill (Cut)’ commands.

Expand All @@ -331,6 +338,7 @@ Commands pertaining to kill ring operations can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-sort-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-sort-tmenu ()
"Menu for ‘Sort’ commands.

Expand All @@ -350,6 +358,7 @@ Commands pertaining to sorting operations can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-transpose-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-transpose-tmenu ()
"Menu for ‘Transpose’ commands.

Expand All @@ -365,6 +374,7 @@ Commands pertaining to transpose operations can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-delete-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-delete-tmenu ()
"Menu for ‘Delete’ commands.

Expand All @@ -383,6 +393,7 @@ Commands pertaining to delete can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-move-text-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-move-text-tmenu ()
"Menu for ‘Move’ commands.

Expand Down Expand Up @@ -431,6 +442,7 @@ can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-windows-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-windows-tmenu ()
"Menu for ‘Window’ commands.

Expand Down Expand Up @@ -504,6 +516,7 @@ Commands pertaining to window management operations can be accessed here."

casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-windows-delete-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-windows-delete-tmenu ()
"Menu for ‘Window Delete’ commands.

Expand All @@ -516,7 +529,7 @@ accessed here."
("f" "On Right" windmove-delete-right)]
[(casual-lib-quit-all)])


;;;###autoload (autoload 'casual-editkit-bookmarks-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-bookmarks-tmenu ()
"Menu for ‘Bookmarks’ commands.

Expand All @@ -528,6 +541,7 @@ accessed here."
("J" "Jump to Bookmark…" bookmark-jump)]
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-search-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-search-tmenu ()
"Menu for ‘Search & Replace’ commands.

Expand Down Expand Up @@ -556,14 +570,16 @@ accessed here."

casual-editkit-navigation-group)


;;;###autoload (autoload 'casual-editkit-tools-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-tools-tmenu ()
"Menu for ‘Tools’ commands.

Commands pertaining to invoking different tools can be accessed here."
["Tools"
["Shells & REPLs"
("s" "Shell" shell)
("!" "Shell Command…" shell-command)
("&" "Shell Command &…" async-shell-command)
("e" "Eshell" eshell)
("i" "IELM" ielm)
("t" "term" term)
Expand Down Expand Up @@ -593,6 +609,7 @@ Commands pertaining to invoking different tools can be accessed here."

casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-registers-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-registers-tmenu ()
"Menu for ‘Registers’ commands.

Expand All @@ -618,6 +635,7 @@ Commands pertaining to register operations can be accessed here."

casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-rectangle-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-rectangle-tmenu ()
"Menu for ‘Rectangle’ commands.

Expand Down Expand Up @@ -674,6 +692,7 @@ Commands pertaining to rectangle operations can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-transform-text-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-transform-text-tmenu ()
"Menu for ‘Transform’ commands.

Expand All @@ -687,6 +706,7 @@ Commands pertaining to transformation operations can be accessed here."
casual-editkit-cursor-navigation-group
casual-editkit-navigation-group)

;;;###autoload (autoload 'casual-editkit-macro-tmenu "casual-editkit-utils" nil t)
(transient-define-prefix casual-editkit-macro-tmenu ()
"Menu for ‘Macro’ commands.

Expand Down
1 change: 1 addition & 0 deletions lisp/casual-ibuffer-filter.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The value from `ibuffer-saved-filter-groups' is used."
(advice-add #'ibuffer-update :after #'casual-ibuffer--ibuffer-update)

;; Transients
;;;###autoload (autoload 'casual-ibuffer-filter-tmenu "casual-ibuffer-filter" nil t)
(transient-define-prefix casual-ibuffer-filter-tmenu ()
"Casual IBuffer filter menu."
:refresh-suffixes t
Expand Down
1 change: 1 addition & 0 deletions lisp/casual-ibuffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
(casual-lib-quit-one)
(casual-lib-quit-all)])

;;;###autoload (autoload 'casual-ibuffer-sortby-tmenu "casual-ibuffer" nil t)
(transient-define-prefix casual-ibuffer-sortby-tmenu ()
["IBuffer: Sort By"
[("v" "Recency" ibuffer-do-sort-by-recency)
Expand Down
1 change: 1 addition & 0 deletions lisp/casual-isearch.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
(isearch-toggle-symbol)
(isearch-edit-string))

;;;###autoload (autoload 'casual-isearch-tmenu "casual-isearch" nil t)
(transient-define-prefix casual-isearch-tmenu ()
"Transient menu for I-Search."
[["Edit Search String"
Expand Down
2 changes: 1 addition & 1 deletion lisp/casual.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Charles Choi <[email protected]>
;; URL: https://github.com/kickingvegas/casual
;; Keywords: tools, wp
;; Version: 2.2.2
;; Version: 2.2.3-rc.1
;; Package-Requires: ((emacs "29.1") (transient "0.6.0"))

;; This program is free software; you can redistribute it and/or modify
Expand Down
33 changes: 21 additions & 12 deletions tests/test-casual-dired-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,28 @@

(ert-deftest test-casual-dired-search-replace-tmenu-bindings ()
(casualt-dired-setup)
(cl-letf ((casualt-mock #'dired-do-find-regexp)
(casualt-mock #'dired-do-isearch)
(casualt-mock #'dired-do-isearch-regexp)
(casualt-mock #'dired-do-search)
(casualt-mock #'dired-do-query-replace-regexp)
(casualt-mock #'dired-do-find-regexp-and-replace)
(casualt-mock #'rgrep))

(let ((test-vectors
'((:binding "C-s" :command dired-do-isearch)
(:binding "M-s" :command dired-do-isearch-regexp)
(:binding "s" :command dired-do-search)
(:binding "r" :command dired-do-query-replace-regexp)
(:binding "g" :command dired-do-find-regexp)
(:binding "G" :command dired-do-find-regexp-and-replace)
(:binding "f" :command rgrep))))

(casualt-suffix-testcase-runner test-vectors
#'casual-dired-search-replace-tmenu
'(lambda () (random 5000)))))
(casualt-dired-breakdown))

(let ((test-vectors (list)))
(push (casualt-suffix-test-vector "g" #'dired-do-find-regexp) test-vectors)
(push (casualt-suffix-test-vector "" #'dired-do-isearch) test-vectors)
(push (casualt-suffix-test-vector "ó" #'dired-do-isearch-regexp) test-vectors)
(push (casualt-suffix-test-vector "s" #'dired-do-search) test-vectors)
(push (casualt-suffix-test-vector "r" #'dired-do-query-replace-regexp) test-vectors)
(push (casualt-suffix-test-vector "G" #'dired-do-find-regexp-and-replace) test-vectors)

(casualt-suffix-testbench-runner test-vectors
#'casual-dired-search-replace-tmenu
'(lambda () (random 5000))))
(casualt-dired-breakdown t))

(ert-deftest test-casual-dired-elisp-tmenu-bindings ()
(casualt-dired-setup)
Expand Down
4 changes: 3 additions & 1 deletion tests/test-casual-dired.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
((symbol-function #'dired-do-async-shell-command) (lambda (x) (interactive)(print "WARNING: override")))
((symbol-function #'image-dired) (lambda (x) (interactive)(print "WARNING: override"))))

(let ((test-vectors (list)))
(let ((test-vectors (list))
(dired-use-ls-dired t))
(push (casualt-suffix-test-vector "o" #'dired-find-file-other-window) test-vectors)
(push (casualt-suffix-test-vector "v" #'dired-view-file) test-vectors)
(push (casualt-suffix-test-vector "C" #'dired-do-copy) test-vectors)
Expand Down Expand Up @@ -88,6 +89,7 @@

;;(push (casualt-suffix-test-vector "+q" #'dired-create-directory) test-vectors)
(push (casualt-suffix-test-vector "F" #'dired-create-empty-file) test-vectors)
(push (casualt-suffix-test-vector "æ" #'rgrep) test-vectors)

(casualt-suffix-testbench-runner test-vectors
#'casual-dired-tmenu
Expand Down
4 changes: 4 additions & 0 deletions tests/test-casual-editkit-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@
(casualt-editkit-setup tmpfile)
(cl-letf (;;((symbol-function #') (lambda () t))
(casualt-mock #'shell)
(casualt-mock #'shell-command)
(casualt-mock #'async-shell-command)
(casualt-mock #'eshell)
(casualt-mock #'ielm)
(casualt-mock #'term)
Expand All @@ -507,6 +509,8 @@

(let ((test-vectors
'((:binding "s" :command shell)
(:binding "!" :command shell-command)
(:binding "&" :command async-shell-command)
(:binding "e" :command eshell)
(:binding "i" :command ielm)
(:binding "t" :command term)
Expand Down