emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 125/287: Added documentation and always respect file in ergoemacs


From: Matthew Fidler
Subject: [elpa] 125/287: Added documentation and always respect file in ergoemacs-open-in-external-app
Date: Wed, 02 Jul 2014 14:45:15 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 2aab252e6d524972f298335129ce3160e7dac7f9
Author: Matthew L. Fidler <address@hidden>
Date:   Wed Jun 18 07:06:16 2014 -0500

    Added documentation and always respect file in 
ergoemacs-open-in-external-app
---
 ergoemacs-functions.el |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 0fcb84f..0c5e915 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -1224,14 +1224,19 @@ Emacs buffers are those whose name starts with *."
 (declare-function dired-get-marked-files "dired.el")
 (declare-function w32-shell-execute "w32fns.c")
 (defun ergoemacs-open-in-external-app (&optional file)
-  "Open the current file or dired marked files in external app."
+  "Open the current file or dired marked files in external app.
+FILE can be a list of files, or a single file.
+If FILE is not specified, it will be:
+- `dired-get-marked-files' for `dired-mode' or `locate-mode'
+- `buffer-file-name' for other files."
   (interactive)
   (let* ((my-file-list
           (cond
-           ((string-equal major-mode "dired-mode") (dired-get-marked-files))
-           ((string-equal major-mode "locate-mode") (dired-get-marked-files))
-           ((not file) (list (buffer-file-name)))
-           (file (list file))))
+           ((listp file) file)
+           (file (list file))
+           ((eq major-mode 'dired-mode) (dired-get-marked-files))
+           ((eq major-mode 'locate-mode) (dired-get-marked-files))
+           ((not file) (list (buffer-file-name)))))
          (do-it (or (<= (length my-file-list) 
ergoemacs-maximum-number-of-file-to-open)
                     (>= 0 ergoemacs-maximum-number-of-file-to-open)
                     (y-or-n-p (format "Open more than %s files? " 
ergoemacs-maximum-number-of-file-to-open)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]