emacs: define prot-dired-count-marks command

This commit is contained in:
Protesilaos 2026-07-02 12:55:41 +03:00
parent 2bbafcbe0f
commit 8e24cc6c14
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
2 changed files with 20 additions and 0 deletions

View file

@ -12754,6 +12754,16 @@ belong to the given subset of CONSEQUENCES.
;;;; General commands
;;;###autoload
(defun prot-dired-count-marks ()
"Print message with the number of Dired marked files."
(interactive nil dired-mode)
(if-let* ((files (dired-get-marked-files))
(length (length files))
(_ (> length 1)))
(message "%d files are marked" length)
(user-error "No files found")))
;;;###autoload
(defun prot-dired-open-directory-externally ()
"Open the current directory in an external file manager."

View file

@ -39,6 +39,16 @@
;;;; General commands
;;;###autoload
(defun prot-dired-count-marks ()
"Print message with the number of Dired marked files."
(interactive nil dired-mode)
(if-let* ((files (dired-get-marked-files))
(length (length files))
(_ (> length 1)))
(message "%d files are marked" length)
(user-error "No files found")))
;;;###autoload
(defun prot-dired-open-directory-externally ()
"Open the current directory in an external file manager."