/[emacs]/emacs/lisp/dired.el
ViewVC logotype

Diff of /emacs/lisp/dired.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.226 by rms, Fri Mar 29 14:43:14 2002 UTC revision 1.227 by rms, Wed Apr 10 15:15:23 2002 UTC
# Line 1373  Creates a buffer if necessary." Line 1373  Creates a buffer if necessary."
1373      (select-window (posn-window (event-end event)))      (select-window (posn-window (event-end event)))
1374      (find-file-other-window (file-name-sans-versions file t))))      (find-file-other-window (file-name-sans-versions file t))))
1375    
1376    (defcustom dired-view-command-alist
1377      '(("[.]ps\\'" . "gv -spartan -color -watch")
1378        ("[.]pdf\\'" . "xpdf")
1379        ("[.]dvi\\'" . "xdvi -sidemargin 0.5 -topmargin 1"))
1380      "Alist specifying how to view special types of files.
1381    Each element has the form (REGEXP . SHELL-COMMAND).
1382    When the file name matches REGEXP, `dired-view-file'
1383    invokes SHELL-COMMAND to view the file, putting the file name
1384    at the end of the command."
1385      :group 'dired
1386      :type '(alist :key-type regexp :value-type string)
1387      :version 21.4)
1388    
1389  (defun dired-view-file ()  (defun dired-view-file ()
1390    "In Dired, examine a file in view mode, returning to dired when done.    "In Dired, examine a file in view mode, returning to dired when done.
1391  When file is a directory, show it in this buffer if it is inserted;  When file is a directory, show it in this buffer if it is inserted.
1392  otherwise, display it in another buffer."  Some kinds of files are displayed using external viewer programs;
1393    see `dired-view-command-alist'.  Otherwise, display it in another buffer."
1394    (interactive)    (interactive)
1395    (let ((file (dired-get-file-for-visit)))    (let ((file (dired-get-file-for-visit)))
1396      (if (file-directory-p file)      (if (file-directory-p file)
1397          (or (and (cdr dired-subdir-alist)          (or (and (cdr dired-subdir-alist)
1398                   (dired-goto-subdir file))                   (dired-goto-subdir file))
1399              (dired file))              (dired file))
1400        (view-file file))))        (let (cmd)
1401            ;; Look for some other way to view a certain file.
1402            (dolist (elt dired-view-command-alist)
1403              (if (string-match (car elt) file)
1404                  (setq cmd (cdr elt))))
1405            (if cmd
1406                (dired-run-shell-command (concat cmd " " file))
1407              (view-file file))))))
1408    
1409  (defun dired-find-file-other-window ()  (defun dired-find-file-other-window ()
1410    "In Dired, visit this file or directory in another window."    "In Dired, visit this file or directory in another window."
# Line 2983  Use \\[dired-hide-subdir] to (un)hide a Line 3004  Use \\[dired-hide-subdir] to (un)hide a
3004  If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is  If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is
3005  true then the type of the file linked to by FILE is printed instead."  true then the type of the file linked to by FILE is printed instead."
3006    t)    t)
3007    
3008    (autoload 'dired-run-shell-command "dired-aux")
3009    
3010  (if (eq system-type 'vax-vms)  (if (eq system-type 'vax-vms)
3011      (load "dired-vms"))      (load "dired-vms"))

Legend:
Removed from v.1.226  
changed lines
  Added in v.1.227

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26