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: Sat, 01 Jan 2005 09:32:47 -0500

Index: emacs/lisp/dired.el
diff -c emacs/lisp/dired.el:1.299 emacs/lisp/dired.el:1.300
*** emacs/lisp/dired.el:1.299   Fri Dec 17 15:18:02 2004
--- emacs/lisp/dired.el Sat Jan  1 14:19:57 2005
***************
*** 200,221 ****
  ;; 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.
  
- ;; Fixme: This should use mailcap.
- (defcustom dired-view-command-alist
-   '(("\\.\\(ps\\|ps_pages\\|eps\\)\\'" . "gv %s")
-     ("\\.pdf\\'" . "xpdf %s")
-     ;; ("\\.pod\\'" . "perldoc %s")
-     ("\\.\\(jpe?g\\|gif\\|png\\)\\'" . "eog %s")
-     ("\\.dvi\\'" . "xdvi %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
--- 200,205 ----
***************
*** 1666,1706 ****
            (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.
  When file is a directory, show it in this buffer if it is inserted.
! Some kinds of files are displayed using external viewer programs;
! see `dired-view-command-alist'.  Otherwise, display it in another buffer."
    (interactive)
    (let ((file (dired-get-file-for-visit)))
      (if (file-directory-p file)
        (or (and (cdr dired-subdir-alist)
                 (dired-goto-subdir file))
            (dired 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))
!                                 " &"))
!         (view-file file))))))
  
  (defun dired-find-file-other-window ()
    "In Dired, visit this file or directory in another window."
--- 1650,1669 ----
            (progn
              (select-window window)
              (dired-other-window 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.
  When file is a directory, show it in this buffer if it is inserted.
! Otherwise, display it in another buffer."
    (interactive)
    (let ((file (dired-get-file-for-visit)))
      (if (file-directory-p file)
        (or (and (cdr dired-subdir-alist)
                 (dired-goto-subdir file))
            (dired file))
!       (view-file file))))
  
  (defun dired-find-file-other-window ()
    "In Dired, visit this file or directory in another window."




reply via email to

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