emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/dired.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/dired.el
Date: Fri, 29 Aug 2003 12:10:45 -0400

Index: emacs/lisp/dired.el
diff -c emacs/lisp/dired.el:1.264 emacs/lisp/dired.el:1.265
*** emacs/lisp/dired.el:1.264   Wed Jul  9 11:52:59 2003
--- emacs/lisp/dired.el Fri Aug 29 12:10:45 2003
***************
*** 192,197 ****
--- 192,211 ----
  ;; Note this can't simply be run inside function `dired-ls' as the hook
  ;; functions probably depend on the dired-subdir-alist to be OK.
  
+ (defcustom dired-view-command-alist
+   '(("[.]\\(ps\\|ps_pages\\|eps\\)\\'" . "gv -spartan -color -watch %s")
+     ("[.]pdf\\'" . "xpdf %s")
+     ("[.]\\(jpe?g\\|gif\\|png\\)\\'" . "eog %s")
+     ("[.]dvi\\'" . "xdvi -sidemargin 0.5 -topmargin 1 %s"))
+   "Alist specifying how to view special types of files.
+ Each element has the form (REGEXP . SHELL-COMMAND).
+ When the file name matches REGEXP, `dired-view-file'
+ invokes SHELL-COMMAND to view the file, processing it through `format'.
+ Use `%s' in SHELL-COMMAND to specify where to put the file name."
+   :group 'dired
+   :type '(alist :key-type regexp :value-type string)
+   :version "21.4")
+ 
  ;; Internal variables
  
  (defvar dired-marker-char ?*          ; the answer is 42
***************
*** 1392,1412 ****
        (set-buffer (window-buffer window))
        (goto-char pos)
        (setq file (dired-get-file-for-visit)))
!     (select-window window)
!     (find-file-other-window (file-name-sans-versions file t))))
! 
! (defcustom dired-view-command-alist
!   '(("[.]ps\\'" . "gv -spartan -color -watch")
!     ("[.]pdf\\'" . "xpdf")
!     ("[.]dvi\\'" . "xdvi -sidemargin 0.5 -topmargin 1"))
!   "Alist specifying how to view special types of files.
! Each element has the form (REGEXP . SHELL-COMMAND).
! When the file name matches REGEXP, `dired-view-file'
! invokes SHELL-COMMAND to view the file, putting the file name
! at the end of the command."
!   :group 'dired
!   :type '(alist :key-type regexp :value-type string)
!   :version "21.4")
  
  (defun dired-view-file ()
    "In Dired, examine a file in view mode, returning to dired when done.
--- 1406,1429 ----
        (set-buffer (window-buffer window))
        (goto-char pos)
        (setq file (dired-get-file-for-visit)))
!     (if (file-directory-p file)
!       (or (and (cdr dired-subdir-alist)
!                (dired-goto-subdir file))
!           (progn
!             (select-window window)
!             (dired-other-window file)))
!       (let (cmd)
!       ;; Look for some other way to view a certain file.
!       (dolist (elt dired-view-command-alist)
!         (if (string-match (car elt) file)
!             (setq cmd (cdr elt))))
!       (if cmd
!           (call-process shell-file-name nil 0 nil
!                         "-c"
!                         (concat (format cmd (shell-quote-argument file))
!                                 " &"))
!         (select-window window)
!         (find-file-other-window (file-name-sans-versions file t)))))))
  
  (defun dired-view-file ()
    "In Dired, examine a file in view mode, returning to dired when done.
***************
*** 1427,1434 ****
        (if cmd
            (call-process shell-file-name nil 0 nil
                          "-c"
!                         (concat cmd " "
!                                 (shell-quote-argument file)
                                  " &"))
          (view-file file))))))
  
--- 1444,1450 ----
        (if cmd
            (call-process shell-file-name nil 0 nil
                          "-c"
!                         (concat (format cmd (shell-quote-argument file))
                                  " &"))
          (view-file file))))))
  




reply via email to

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