diff options
| author | Sam Steingold | 2001-01-24 21:17:10 +0000 |
|---|---|---|
| committer | Sam Steingold | 2001-01-24 21:17:10 +0000 |
| commit | e95b0c08b9dcb032afd3768f0cde7e9678291723 (patch) | |
| tree | 622e9e3f15f9734bab5b232d9d9f2fba9d136917 | |
| parent | f9aaedb63443f85726c8ef286ff53eb1805c8568 (diff) | |
| download | emacs-e95b0c08b9dcb032afd3768f0cde7e9678291723.tar.gz emacs-e95b0c08b9dcb032afd3768f0cde7e9678291723.zip | |
use replace-regexps-in-string instead of dired- and gs-replace-in-string
which are removed
| -rw-r--r-- | lisp/ChangeLog | 35 | ||||
| -rw-r--r-- | lisp/dired-aux.el | 62 | ||||
| -rw-r--r-- | lisp/dired.el | 85 | ||||
| -rw-r--r-- | lisp/gs.el | 43 |
4 files changed, 107 insertions, 118 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e428435116..dcd425b3cc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2001-01-24 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * dired.el (dired-replace-in-string): Removed. | ||
| 4 | (dired-sort-toggle): Use `replace-regexps-in-string' | ||
| 5 | instead of `dired-replace-in-string'. | ||
| 6 | * dired-aux.el (dired-shell-stuff-it, dired-rename-subdir, | ||
| 7 | dired-rename-subdir-2, dired-insert-subdir-doinsert): Ditto. | ||
| 8 | * gs.el (gs-replace-in-string): Removed. | ||
| 9 | (gs-options): Use `replace-regexps-in-string' | ||
| 10 | instead of `gs-replace-in-string'. | ||
| 11 | |||
| 1 | 2001-01-24 Eli Zaretskii <eliz@is.elta.co.il> | 12 | 2001-01-24 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 13 | ||
| 3 | * mail/emacsbug.el (report-emacs-bug): Mention the fact that the | 14 | * mail/emacsbug.el (report-emacs-bug): Mention the fact that the |
| @@ -14,7 +25,7 @@ | |||
| 14 | the tool-bar. | 25 | the tool-bar. |
| 15 | 26 | ||
| 16 | * frame.el (frame-initialize): Create the initial frame invisible. | 27 | * frame.el (frame-initialize): Create the initial frame invisible. |
| 17 | 28 | ||
| 18 | 2001-01-24 ShengHuo ZHU <zsh@cs.rochester.edu> | 29 | 2001-01-24 ShengHuo ZHU <zsh@cs.rochester.edu> |
| 19 | 30 | ||
| 20 | * language/chinese.el (chinese-iso-8bit): MIME:GB2312. | 31 | * language/chinese.el (chinese-iso-8bit): MIME:GB2312. |
| @@ -22,7 +33,7 @@ | |||
| 22 | 33 | ||
| 23 | 2001-01-24 Gerd Moellmann <gerd@gnu.org> | 34 | 2001-01-24 Gerd Moellmann <gerd@gnu.org> |
| 24 | 35 | ||
| 25 | * international/mule-cmds.el (universal-coding-system-argument): | 36 | * international/mule-cmds.el (universal-coding-system-argument): |
| 26 | Handle commands with prefix args. | 37 | Handle commands with prefix args. |
| 27 | 38 | ||
| 28 | 2001-01-24 Edward M. Reingold <reingold@emr.cs.uiuc.edu> | 39 | 2001-01-24 Edward M. Reingold <reingold@emr.cs.uiuc.edu> |
| @@ -83,7 +94,7 @@ | |||
| 83 | * textmodes/texinfo.el (texinfo-mode): Use backward-paragraph | 94 | * textmodes/texinfo.el (texinfo-mode): Use backward-paragraph |
| 84 | as font-lock-beginning-of-syntax-function in font-lock-defaults. | 95 | as font-lock-beginning-of-syntax-function in font-lock-defaults. |
| 85 | 96 | ||
| 86 | * jit-lock.el (jit-lock-fontify-now): Don't bind | 97 | * jit-lock.el (jit-lock-fontify-now): Don't bind |
| 87 | font-lock-beginning-of-syntax-function to nil. | 98 | font-lock-beginning-of-syntax-function to nil. |
| 88 | 99 | ||
| 89 | 2001-01-19 Eli Zaretskii <eliz@is.elta.co.il> | 100 | 2001-01-19 Eli Zaretskii <eliz@is.elta.co.il> |
| @@ -96,7 +107,7 @@ | |||
| 96 | 107 | ||
| 97 | * font-lock.el (font-lock-default-fontify-region): Fix last | 108 | * font-lock.el (font-lock-default-fontify-region): Fix last |
| 98 | change. | 109 | change. |
| 99 | 110 | ||
| 100 | * font-lock.el (font-lock-multiline): Default to nil. | 111 | * font-lock.el (font-lock-multiline): Default to nil. |
| 101 | (font-lock-default-fontify-region): If font-lock-multiline is | 112 | (font-lock-default-fontify-region): If font-lock-multiline is |
| 102 | nil, don't check the property `font-lock-multiline'. | 113 | nil, don't check the property `font-lock-multiline'. |
| @@ -107,23 +118,23 @@ | |||
| 107 | 2001-01-19 Michael Kifer <kifer@cs.sunysb.edu> | 118 | 2001-01-19 Michael Kifer <kifer@cs.sunysb.edu> |
| 108 | 119 | ||
| 109 | * viper.el: Call initial-major-mode on startup. | 120 | * viper.el: Call initial-major-mode on startup. |
| 110 | 121 | ||
| 111 | * ediff.el (ediff-patch-file): Use better defaults. | 122 | * ediff.el (ediff-patch-file): Use better defaults. |
| 112 | 123 | ||
| 113 | * ediff-vers.el: Fix for 8+3 DOS file systems. | 124 | * ediff-vers.el: Fix for 8+3 DOS file systems. |
| 114 | 125 | ||
| 115 | 2001-01-19 Colin Walters <walters@cis.ohio-state.edu> | 126 | 2001-01-19 Colin Walters <walters@cis.ohio-state.edu> |
| 116 | 127 | ||
| 117 | * ediff-util.el (ediff-compare-custom-diffs-maybe): Put diff in | 128 | * ediff-util.el (ediff-compare-custom-diffs-maybe): Put diff in |
| 118 | diff mode, if available. | 129 | diff mode, if available. |
| 119 | 130 | ||
| 120 | 2001-01-19 Michael Kifer <kifer@cs.sunysb.edu> | 131 | 2001-01-19 Michael Kifer <kifer@cs.sunysb.edu> |
| 121 | 132 | ||
| 122 | * ediff-hook.el (ediff-xemacs-init-menus): Fixed add-menu-button. | 133 | * ediff-hook.el (ediff-xemacs-init-menus): Fixed add-menu-button. |
| 123 | 134 | ||
| 124 | * ediff-init.el (subst-char-in-string): Define and use it, unless | 135 | * ediff-init.el (subst-char-in-string): Define and use it, unless |
| 125 | it's already defined. | 136 | it's already defined. |
| 126 | 137 | ||
| 127 | 2001-01-18 Gerd Moellmann <gerd@gnu.org> | 138 | 2001-01-18 Gerd Moellmann <gerd@gnu.org> |
| 128 | 139 | ||
| 129 | * tooltip.el (tooltip-hide-delay): New user-option. | 140 | * tooltip.el (tooltip-hide-delay): New user-option. |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4b966711012..05d998176f7 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -99,7 +99,7 @@ With prefix arg, prompt for argument SWITCHES which is options for `diff'." | |||
| 99 | (setq failures | 99 | (setq failures |
| 100 | (dired-bunch-files 10000 | 100 | (dired-bunch-files 10000 |
| 101 | (function dired-check-process) | 101 | (function dired-check-process) |
| 102 | (append | 102 | (append |
| 103 | (list operation program new-attribute) | 103 | (list operation program new-attribute) |
| 104 | (if (string-match "gnu" system-configuration) | 104 | (if (string-match "gnu" system-configuration) |
| 105 | '("--") nil)) | 105 | '("--") nil)) |
| @@ -198,7 +198,7 @@ Uses the shell command coming from variables `lpr-command' and | |||
| 198 | nil op-symbol files | 198 | nil op-symbol files |
| 199 | (function read-string) | 199 | (function read-string) |
| 200 | (format prompt (dired-mark-prompt arg files)) initial)) | 200 | (format prompt (dired-mark-prompt arg files)) initial)) |
| 201 | 201 | ||
| 202 | ;;; Cleaning a directory: flagging some backups for deletion. | 202 | ;;; Cleaning a directory: flagging some backups for deletion. |
| 203 | 203 | ||
| 204 | (defvar dired-file-version-alist) | 204 | (defvar dired-file-version-alist) |
| @@ -290,7 +290,7 @@ with a prefix argument." | |||
| 290 | (progn (beginning-of-line) | 290 | (progn (beginning-of-line) |
| 291 | (delete-char 1) | 291 | (delete-char 1) |
| 292 | (insert dired-del-marker))))) | 292 | (insert dired-del-marker))))) |
| 293 | 293 | ||
| 294 | ;;; Shell commands | 294 | ;;; Shell commands |
| 295 | 295 | ||
| 296 | (defun dired-read-shell-command (prompt arg files) | 296 | (defun dired-read-shell-command (prompt arg files) |
| @@ -379,12 +379,10 @@ the list of file names explicitly with the FILE-LIST argument." | |||
| 379 | ;; your cmd. | 379 | ;; your cmd. |
| 380 | (let ((stuff-it | 380 | (let ((stuff-it |
| 381 | (cond ((string-match "\\*" command) | 381 | (cond ((string-match "\\*" command) |
| 382 | (function (lambda (x) | 382 | (lambda (x) (replace-regexp-in-string "\\*" x command))) |
| 383 | (dired-replace-in-string "\\*" x command)))) | ||
| 384 | ((string-match "\\?" command) | 383 | ((string-match "\\?" command) |
| 385 | (function (lambda (x) | 384 | (lambda (x) (replace-regexp-in-string "\\?" x command))) |
| 386 | (dired-replace-in-string "\\?" x command)))) | 385 | (t (lambda (x) (concat command " " x)))))) |
| 387 | (t (function (lambda (x) (concat command " " x))))))) | ||
| 388 | (if on-each | 386 | (if on-each |
| 389 | (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") | 387 | (mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";") |
| 390 | (let ((fns (mapconcat 'shell-quote-argument | 388 | (let ((fns (mapconcat 'shell-quote-argument |
| @@ -402,7 +400,7 @@ the list of file names explicitly with the FILE-LIST argument." | |||
| 402 | (shell-command command))) | 400 | (shell-command command))) |
| 403 | ;; Return nil for sake of nconc in dired-bunch-files. | 401 | ;; Return nil for sake of nconc in dired-bunch-files. |
| 404 | nil) | 402 | nil) |
| 405 | 403 | ||
| 406 | ;; In Emacs 19 this will return program's exit status. | 404 | ;; In Emacs 19 this will return program's exit status. |
| 407 | ;; This is a separate function so that ange-ftp can redefine it. | 405 | ;; This is a separate function so that ange-ftp can redefine it. |
| 408 | (defun dired-call-process (program discard &rest arguments) | 406 | (defun dired-call-process (program discard &rest arguments) |
| @@ -441,7 +439,7 @@ the list of file names explicitly with the FILE-LIST argument." | |||
| 441 | (kill-buffer err-buffer) | 439 | (kill-buffer err-buffer) |
| 442 | (message "%s...done" msg) | 440 | (message "%s...done" msg) |
| 443 | nil)))) | 441 | nil)))) |
| 444 | 442 | ||
| 445 | ;; Commands that delete or redisplay part of the dired buffer. | 443 | ;; Commands that delete or redisplay part of the dired buffer. |
| 446 | 444 | ||
| 447 | (defun dired-kill-line (&optional arg) | 445 | (defun dired-kill-line (&optional arg) |
| @@ -500,7 +498,7 @@ and use this command with a prefix argument (the value does not matter)." | |||
| 500 | count)))) | 498 | count)))) |
| 501 | 499 | ||
| 502 | ;;;###end dired-cmd.el | 500 | ;;;###end dired-cmd.el |
| 503 | 501 | ||
| 504 | ;;; 30K | 502 | ;;; 30K |
| 505 | ;;;###begin dired-cp.el | 503 | ;;;###begin dired-cp.el |
| 506 | 504 | ||
| @@ -557,7 +555,7 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.") | |||
| 557 | (setq suffix (car suffixes) suffixes nil)) | 555 | (setq suffix (car suffixes) suffixes nil)) |
| 558 | (setq suffixes (cdr suffixes)))) | 556 | (setq suffixes (cdr suffixes)))) |
| 559 | ;; If so, compute desired new name. | 557 | ;; If so, compute desired new name. |
| 560 | (if suffix | 558 | (if suffix |
| 561 | (setq newname (concat (substring file 0 (match-beginning 0)) | 559 | (setq newname (concat (substring file 0 (match-beginning 0)) |
| 562 | (nth 1 suffix)))) | 560 | (nth 1 suffix)))) |
| 563 | (cond (handler | 561 | (cond (handler |
| @@ -591,7 +589,7 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.") | |||
| 591 | "compress" "-f" file)) | 589 | "compress" "-f" file)) |
| 592 | ;; Don't use NEWNAME with `compress'. | 590 | ;; Don't use NEWNAME with `compress'. |
| 593 | (concat file ".Z")))))))) | 591 | (concat file ".Z")))))))) |
| 594 | 592 | ||
| 595 | (defun dired-mark-confirm (op-symbol arg) | 593 | (defun dired-mark-confirm (op-symbol arg) |
| 596 | ;; Request confirmation from the user that the operation described | 594 | ;; Request confirmation from the user that the operation described |
| 597 | ;; by OP-SYMBOL is to be performed on the marked files. | 595 | ;; by OP-SYMBOL is to be performed on the marked files. |
| @@ -676,7 +674,7 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.") | |||
| 676 | (apply 'message qprompt qs-args) | 674 | (apply 'message qprompt qs-args) |
| 677 | (setq char (set qs-var (read-char)))) | 675 | (setq char (set qs-var (read-char)))) |
| 678 | (memq (cdr elt) '(t y yes))))))) | 676 | (memq (cdr elt) '(t y yes))))))) |
| 679 | 677 | ||
| 680 | ;;;###autoload | 678 | ;;;###autoload |
| 681 | (defun dired-do-compress (&optional arg) | 679 | (defun dired-do-compress (&optional arg) |
| 682 | "Compress or uncompress marked (or next ARG) files." | 680 | "Compress or uncompress marked (or next ARG) files." |
| @@ -749,7 +747,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 749 | arg) | 747 | arg) |
| 750 | (dired-move-to-filename) | 748 | (dired-move-to-filename) |
| 751 | (message "Redisplaying...done"))) | 749 | (message "Redisplaying...done"))) |
| 752 | 750 | ||
| 753 | (defun dired-update-file-line (file) | 751 | (defun dired-update-file-line (file) |
| 754 | ;; Delete the current line, and insert an entry for FILE. | 752 | ;; Delete the current line, and insert an entry for FILE. |
| 755 | ;; If FILE is nil, then just delete the current line. | 753 | ;; If FILE is nil, then just delete the current line. |
| @@ -849,7 +847,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 849 | ;; It inserts the file's absolute name, rather than | 847 | ;; It inserts the file's absolute name, rather than |
| 850 | ;; the relative one. That may be hard to fix since it | 848 | ;; the relative one. That may be hard to fix since it |
| 851 | ;; is probably controlled by something in ftp. | 849 | ;; is probably controlled by something in ftp. |
| 852 | (goto-char opoint) | 850 | (goto-char opoint) |
| 853 | (let ((inserted-name (dired-get-filename 'verbatim))) | 851 | (let ((inserted-name (dired-get-filename 'verbatim))) |
| 854 | (if (file-name-directory inserted-name) | 852 | (if (file-name-directory inserted-name) |
| 855 | (progn | 853 | (progn |
| @@ -931,7 +929,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 931 | (save-excursion (forward-line 1) (point)))) | 929 | (save-excursion (forward-line 1) (point)))) |
| 932 | (setq file (directory-file-name file)) | 930 | (setq file (directory-file-name file)) |
| 933 | (dired-add-entry file (if (eq ?\040 marker) nil marker))))) | 931 | (dired-add-entry file (if (eq ?\040 marker) nil marker))))) |
| 934 | 932 | ||
| 935 | ;;; Copy, move/rename, making hard and symbolic links | 933 | ;;; Copy, move/rename, making hard and symbolic links |
| 936 | 934 | ||
| 937 | (defcustom dired-recursive-copies nil | 935 | (defcustom dired-recursive-copies nil |
| @@ -1028,7 +1026,7 @@ Special value `always' suppresses confirmation." | |||
| 1028 | (if (and buffer-file-name | 1026 | (if (and buffer-file-name |
| 1029 | (dired-in-this-tree buffer-file-name expanded-from-dir)) | 1027 | (dired-in-this-tree buffer-file-name expanded-from-dir)) |
| 1030 | (let ((modflag (buffer-modified-p)) | 1028 | (let ((modflag (buffer-modified-p)) |
| 1031 | (to-file (dired-replace-in-string | 1029 | (to-file (replace-regexp-in-string |
| 1032 | (concat "^" (regexp-quote from-dir)) | 1030 | (concat "^" (regexp-quote from-dir)) |
| 1033 | to-dir | 1031 | to-dir |
| 1034 | buffer-file-name))) | 1032 | buffer-file-name))) |
| @@ -1087,8 +1085,8 @@ Special value `always' suppresses confirmation." | |||
| 1087 | ;; Update buffer-local dired-subdir-alist | 1085 | ;; Update buffer-local dired-subdir-alist |
| 1088 | (setcar elt | 1086 | (setcar elt |
| 1089 | (dired-normalize-subdir | 1087 | (dired-normalize-subdir |
| 1090 | (dired-replace-in-string regexp newtext (car elt))))))) | 1088 | (replace-regexp-in-string regexp newtext (car elt))))))) |
| 1091 | 1089 | ||
| 1092 | ;; The basic function for half a dozen variations on cp/mv/ln/ln -s. | 1090 | ;; The basic function for half a dozen variations on cp/mv/ln/ln -s. |
| 1093 | (defun dired-create-files (file-creator operation fn-list name-constructor | 1091 | (defun dired-create-files (file-creator operation fn-list name-constructor |
| 1094 | &optional marker-char) | 1092 | &optional marker-char) |
| @@ -1183,7 +1181,7 @@ ESC or `q' to not overwrite any of the remaining files, | |||
| 1183 | (message "%s: %s file%s" | 1181 | (message "%s: %s file%s" |
| 1184 | operation success-count (dired-plural-s success-count))))) | 1182 | operation success-count (dired-plural-s success-count))))) |
| 1185 | (dired-move-to-filename)) | 1183 | (dired-move-to-filename)) |
| 1186 | 1184 | ||
| 1187 | (defun dired-do-create-files (op-symbol file-creator operation arg | 1185 | (defun dired-do-create-files (op-symbol file-creator operation arg |
| 1188 | &optional marker-char op1 | 1186 | &optional marker-char op1 |
| 1189 | how-to) | 1187 | how-to) |
| @@ -1304,7 +1302,7 @@ Optional arg HOW-TO is used to set the value of the into-dir variable | |||
| 1304 | (dired-current-directory))))) | 1302 | (dired-current-directory))))) |
| 1305 | (or other-dir this-dir)) | 1303 | (or other-dir this-dir)) |
| 1306 | this-dir))) | 1304 | this-dir))) |
| 1307 | 1305 | ||
| 1308 | ;;;###autoload | 1306 | ;;;###autoload |
| 1309 | (defun dired-create-directory (directory) | 1307 | (defun dired-create-directory (directory) |
| 1310 | "Create a directory called DIRECTORY." | 1308 | "Create a directory called DIRECTORY." |
| @@ -1381,7 +1379,7 @@ When renaming multiple or marked files, you specify a directory." | |||
| 1381 | (dired-do-create-files 'move (function dired-rename-file) | 1379 | (dired-do-create-files 'move (function dired-rename-file) |
| 1382 | "Move" arg dired-keep-marker-rename "Rename")) | 1380 | "Move" arg dired-keep-marker-rename "Rename")) |
| 1383 | ;;;###end dired-cp.el | 1381 | ;;;###end dired-cp.el |
| 1384 | 1382 | ||
| 1385 | ;;; 5K | 1383 | ;;; 5K |
| 1386 | ;;;###begin dired-re.el | 1384 | ;;;###begin dired-re.el |
| 1387 | (defun dired-do-create-files-regexp | 1385 | (defun dired-do-create-files-regexp |
| @@ -1544,7 +1542,7 @@ Type SPC or `y' to %s one file, DEL or `n' to skip to next, | |||
| 1544 | (dired-rename-non-directory (function downcase) "Rename downcase" arg)) | 1542 | (dired-rename-non-directory (function downcase) "Rename downcase" arg)) |
| 1545 | 1543 | ||
| 1546 | ;;;###end dired-re.el | 1544 | ;;;###end dired-re.el |
| 1547 | 1545 | ||
| 1548 | ;;; 13K | 1546 | ;;; 13K |
| 1549 | ;;;###begin dired-ins.el | 1547 | ;;;###begin dired-ins.el |
| 1550 | 1548 | ||
| @@ -1697,7 +1695,7 @@ With optional arg REMEMBER-MARKS, return an alist of marked files." | |||
| 1697 | (message "Reading directory %s..." dirname) | 1695 | (message "Reading directory %s..." dirname) |
| 1698 | (let ((dired-actual-switches | 1696 | (let ((dired-actual-switches |
| 1699 | (or switches | 1697 | (or switches |
| 1700 | (dired-replace-in-string "R" "" dired-actual-switches)))) | 1698 | (replace-regexp-in-string "R" "" dired-actual-switches)))) |
| 1701 | (if (equal dirname (car (car (reverse dired-subdir-alist)))) | 1699 | (if (equal dirname (car (car (reverse dired-subdir-alist)))) |
| 1702 | ;; top level directory may contain wildcards: | 1700 | ;; top level directory may contain wildcards: |
| 1703 | (dired-readin-insert dired-directory) | 1701 | (dired-readin-insert dired-directory) |
| @@ -1800,7 +1798,7 @@ is always equal to STRING." | |||
| 1800 | (setq result | 1798 | (setq result |
| 1801 | (cons (substring str end) result))) | 1799 | (cons (substring str end) result))) |
| 1802 | (nreverse result))) | 1800 | (nreverse result))) |
| 1803 | 1801 | ||
| 1804 | ;;; moving by subdirectories | 1802 | ;;; moving by subdirectories |
| 1805 | 1803 | ||
| 1806 | ;;;###autoload | 1804 | ;;;###autoload |
| @@ -1843,7 +1841,7 @@ The next char is either \\n, or \\r if DIR is hidden." | |||
| 1843 | ;; at either \r or \n after this function succeeds. | 1841 | ;; at either \r or \n after this function succeeds. |
| 1844 | (progn (skip-chars-forward "^\r\n") | 1842 | (progn (skip-chars-forward "^\r\n") |
| 1845 | (point))))) | 1843 | (point))))) |
| 1846 | 1844 | ||
| 1847 | ;;;###autoload | 1845 | ;;;###autoload |
| 1848 | (defun dired-mark-subdir-files () | 1846 | (defun dired-mark-subdir-files () |
| 1849 | "Mark all files except `.' and `..' in current subdirectory. | 1847 | "Mark all files except `.' and `..' in current subdirectory. |
| @@ -1905,7 +1903,7 @@ Lower levels are unaffected." | |||
| 1905 | (if pos | 1903 | (if pos |
| 1906 | (goto-char pos) | 1904 | (goto-char pos) |
| 1907 | (error "At the bottom")))) | 1905 | (error "At the bottom")))) |
| 1908 | 1906 | ||
| 1909 | ;;; hiding | 1907 | ;;; hiding |
| 1910 | 1908 | ||
| 1911 | (defun dired-unhide-subdir () | 1909 | (defun dired-unhide-subdir () |
| @@ -1972,7 +1970,7 @@ Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." | |||
| 1972 | 1970 | ||
| 1973 | ;;;###end dired-ins.el | 1971 | ;;;###end dired-ins.el |
| 1974 | 1972 | ||
| 1975 | 1973 | ||
| 1976 | ;; Functions for searching in tags style among marked files. | 1974 | ;; Functions for searching in tags style among marked files. |
| 1977 | 1975 | ||
| 1978 | ;;;###autoload | 1976 | ;;;###autoload |
| @@ -1992,14 +1990,14 @@ with the command \\[tags-loop-continue]." | |||
| 1992 | (interactive | 1990 | (interactive |
| 1993 | "sQuery replace in marked files (regexp): \nsQuery replace %s by: \nP") | 1991 | "sQuery replace in marked files (regexp): \nsQuery replace %s by: \nP") |
| 1994 | (tags-query-replace from to delimited '(dired-get-marked-files))) | 1992 | (tags-query-replace from to delimited '(dired-get-marked-files))) |
| 1995 | 1993 | ||
| 1996 | ;;;###autoload | 1994 | ;;;###autoload |
| 1997 | (defun dired-show-file-type (file &optional deref-symlinks) | 1995 | (defun dired-show-file-type (file &optional deref-symlinks) |
| 1998 | "Print the type of FILE, according to the `file' command. | 1996 | "Print the type of FILE, according to the `file' command. |
| 1999 | If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is | 1997 | If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is |
| 2000 | true then the type of the file linked to by FILE is printed instead." | 1998 | true then the type of the file linked to by FILE is printed instead." |
| 2001 | (interactive (list (dired-get-filename t) current-prefix-arg)) | 1999 | (interactive (list (dired-get-filename t) current-prefix-arg)) |
| 2002 | (with-temp-buffer | 2000 | (with-temp-buffer |
| 2003 | (if deref-symlinks | 2001 | (if deref-symlinks |
| 2004 | (call-process "file" nil t t "-L" file) | 2002 | (call-process "file" nil t t "-L" file) |
| 2005 | (call-process "file" nil t t file)) | 2003 | (call-process "file" nil t t file)) |
diff --git a/lisp/dired.el b/lisp/dired.el index 7b77ee77239..481fe3b6862 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -292,7 +292,7 @@ Subexpression 2 must end right before the \\n or \\r.") | |||
| 292 | '(".+" (dired-move-to-filename) nil (0 font-lock-function-name-face))) | 292 | '(".+" (dired-move-to-filename) nil (0 font-lock-function-name-face))) |
| 293 | ;; | 293 | ;; |
| 294 | ;; Symbolic links. | 294 | ;; Symbolic links. |
| 295 | (list dired-re-sym | 295 | (list dired-re-sym |
| 296 | '(".+" (dired-move-to-filename) nil (0 font-lock-keyword-face))) | 296 | '(".+" (dired-move-to-filename) nil (0 font-lock-keyword-face))) |
| 297 | ;; | 297 | ;; |
| 298 | ;; Files suffixed with `completion-ignored-extensions'. | 298 | ;; Files suffixed with `completion-ignored-extensions'. |
| @@ -303,7 +303,7 @@ Subexpression 2 must end right before the \\n or \\r.") | |||
| 303 | (list (concat "\\(" (mapconcat 'identity extensions "\\|") "\\|#\\)$") | 303 | (list (concat "\\(" (mapconcat 'identity extensions "\\|") "\\|#\\)$") |
| 304 | '(".+" (dired-move-to-filename) nil (0 font-lock-string-face)))))) | 304 | '(".+" (dired-move-to-filename) nil (0 font-lock-string-face)))))) |
| 305 | "Additional expressions to highlight in Dired mode.") | 305 | "Additional expressions to highlight in Dired mode.") |
| 306 | 306 | ||
| 307 | ;;; Macros must be defined before they are used, for the byte compiler. | 307 | ;;; Macros must be defined before they are used, for the byte compiler. |
| 308 | 308 | ||
| 309 | ;; Mark all files for which CONDITION evals to non-nil. | 309 | ;; Mark all files for which CONDITION evals to non-nil. |
| @@ -406,10 +406,10 @@ Optional second argument ARG forces to use other files. If ARG is an | |||
| 406 | (save-excursion | 406 | (save-excursion |
| 407 | (nreverse (dired-map-over-marks (dired-get-filename localp) arg)))) | 407 | (nreverse (dired-map-over-marks (dired-get-filename localp) arg)))) |
| 408 | 408 | ||
| 409 | 409 | ||
| 410 | ;; Function dired-ls is redefinable for VMS, ange-ftp, Prospero or | 410 | ;; Function dired-ls is redefinable for VMS, ange-ftp, Prospero or |
| 411 | ;; other special applications. | 411 | ;; other special applications. |
| 412 | 412 | ||
| 413 | ;; The dired command | 413 | ;; The dired command |
| 414 | 414 | ||
| 415 | (defun dired-read-dir-and-switches (str) | 415 | (defun dired-read-dir-and-switches (str) |
| @@ -514,12 +514,12 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." | |||
| 514 | (setq buffer (create-file-buffer (directory-file-name dirname))))) | 514 | (setq buffer (create-file-buffer (directory-file-name dirname))))) |
| 515 | (set-buffer buffer) | 515 | (set-buffer buffer) |
| 516 | (if (not new-buffer-p) ; existing buffer ... | 516 | (if (not new-buffer-p) ; existing buffer ... |
| 517 | (cond (switches ; ... but new switches | 517 | (cond (switches ; ... but new switches |
| 518 | ;; file list may have changed | 518 | ;; file list may have changed |
| 519 | (if (consp dir-or-list) | 519 | (if (consp dir-or-list) |
| 520 | (setq dired-directory dir-or-list)) | 520 | (setq dired-directory dir-or-list)) |
| 521 | ;; this calls dired-revert | 521 | ;; this calls dired-revert |
| 522 | (dired-sort-other switches)) | 522 | (dired-sort-other switches)) |
| 523 | ;; If directory has changed on disk, offer to revert. | 523 | ;; If directory has changed on disk, offer to revert. |
| 524 | ((if (let ((attributes (file-attributes dirname)) | 524 | ((if (let ((attributes (file-attributes dirname)) |
| 525 | (modtime (visited-file-modtime))) | 525 | (modtime (visited-file-modtime))) |
| @@ -586,7 +586,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." | |||
| 586 | (setq blist (cdr blist)))))) | 586 | (setq blist (cdr blist)))))) |
| 587 | found)) | 587 | found)) |
| 588 | 588 | ||
| 589 | 589 | ||
| 590 | ;; Read in a new dired buffer | 590 | ;; Read in a new dired buffer |
| 591 | 591 | ||
| 592 | ;; dired-readin differs from dired-insert-subdir in that it accepts | 592 | ;; dired-readin differs from dired-insert-subdir in that it accepts |
| @@ -749,7 +749,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." | |||
| 749 | ;; boundaries. | 749 | ;; boundaries. |
| 750 | (save-excursion (insert " " (directory-file-name dir) ":\n"))) | 750 | (save-excursion (insert " " (directory-file-name dir) ":\n"))) |
| 751 | 751 | ||
| 752 | 752 | ||
| 753 | ;; Reverting a dired buffer | 753 | ;; Reverting a dired buffer |
| 754 | 754 | ||
| 755 | (defun dired-revert (&optional arg noconfirm) | 755 | (defun dired-revert (&optional arg noconfirm) |
| @@ -857,7 +857,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." | |||
| 857 | (let ((handler (find-file-name-handler dir 'dired-uncache))) | 857 | (let ((handler (find-file-name-handler dir 'dired-uncache))) |
| 858 | (if handler | 858 | (if handler |
| 859 | (funcall handler 'dired-uncache dir)))) | 859 | (funcall handler 'dired-uncache dir)))) |
| 860 | 860 | ||
| 861 | ;; dired mode key bindings and initialization | 861 | ;; dired mode key bindings and initialization |
| 862 | 862 | ||
| 863 | (defvar dired-mode-map nil "Local keymap for dired-mode buffers.") | 863 | (defvar dired-mode-map nil "Local keymap for dired-mode buffers.") |
| @@ -1188,7 +1188,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." | |||
| 1188 | :help "Copy current file or all marked files")) | 1188 | :help "Copy current file or all marked files")) |
| 1189 | 1189 | ||
| 1190 | (setq dired-mode-map map))) | 1190 | (setq dired-mode-map map))) |
| 1191 | 1191 | ||
| 1192 | ;; Dired mode is suitable only for specially formatted data. | 1192 | ;; Dired mode is suitable only for specially formatted data. |
| 1193 | (put 'dired-mode 'mode-class 'special) | 1193 | (put 'dired-mode 'mode-class 'special) |
| 1194 | 1194 | ||
| @@ -1282,7 +1282,7 @@ Keybindings: | |||
| 1282 | (set (make-local-variable 'font-lock-defaults) '(dired-font-lock-keywords t)) | 1282 | (set (make-local-variable 'font-lock-defaults) '(dired-font-lock-keywords t)) |
| 1283 | (dired-sort-other dired-actual-switches t) | 1283 | (dired-sort-other dired-actual-switches t) |
| 1284 | (run-hooks 'dired-mode-hook)) | 1284 | (run-hooks 'dired-mode-hook)) |
| 1285 | 1285 | ||
| 1286 | ;; Idiosyncratic dired commands that don't deal with marks. | 1286 | ;; Idiosyncratic dired commands that don't deal with marks. |
| 1287 | 1287 | ||
| 1288 | (defun dired-summary () | 1288 | (defun dired-summary () |
| @@ -1402,7 +1402,7 @@ otherwise, display it in another buffer." | |||
| 1402 | (interactive) | 1402 | (interactive) |
| 1403 | (let ((file (file-name-sans-versions (dired-get-filename) t))) | 1403 | (let ((file (file-name-sans-versions (dired-get-filename) t))) |
| 1404 | (display-buffer (find-file-noselect file)))) | 1404 | (display-buffer (find-file-noselect file)))) |
| 1405 | 1405 | ||
| 1406 | ;;; Functions for extracting and manipulating file names in dired buffers. | 1406 | ;;; Functions for extracting and manipulating file names in dired buffers. |
| 1407 | 1407 | ||
| 1408 | (defun dired-get-filename (&optional localp no-error-if-not-filep) | 1408 | (defun dired-get-filename (&optional localp no-error-if-not-filep) |
| @@ -1492,7 +1492,7 @@ DIR must be a directory name, not a file name." | |||
| 1492 | ;;; (or no-error | 1492 | ;;; (or no-error |
| 1493 | ;;; (error "%s: not in directory tree growing at %s" file dir)) | 1493 | ;;; (error "%s: not in directory tree growing at %s" file dir)) |
| 1494 | file)) | 1494 | file)) |
| 1495 | 1495 | ||
| 1496 | ;;; Functions for finding the file name in a dired buffer line. | 1496 | ;;; Functions for finding the file name in a dired buffer line. |
| 1497 | 1497 | ||
| 1498 | (defvar dired-move-to-filename-regexp | 1498 | (defvar dired-move-to-filename-regexp |
| @@ -1502,7 +1502,7 @@ DIR must be a directory name, not a file name." | |||
| 1502 | ;; weiand: changed: month ends potentially with . or , or ., | 1502 | ;; weiand: changed: month ends potentially with . or , or ., |
| 1503 | ;;old (month (concat l l "+ *")) | 1503 | ;;old (month (concat l l "+ *")) |
| 1504 | (month (concat l l "+[.]?,? *")) | 1504 | (month (concat l l "+[.]?,? *")) |
| 1505 | ;; Recognize any non-ASCII character. | 1505 | ;; Recognize any non-ASCII character. |
| 1506 | ;; The purpose is to match a Kanji character. | 1506 | ;; The purpose is to match a Kanji character. |
| 1507 | (k "[^\0-\177]") | 1507 | (k "[^\0-\177]") |
| 1508 | ;; (k "[^\x00-\x7f\x80-\xff]") | 1508 | ;; (k "[^\x00-\x7f\x80-\xff]") |
| @@ -1515,7 +1515,7 @@ DIR must be a directory name, not a file name." | |||
| 1515 | (western (concat "\\(" month s dd "\\|" dd s month "\\)" | 1515 | (western (concat "\\(" month s dd "\\|" dd s month "\\)" |
| 1516 | ;; weiand: changed: year potentially unaligned | 1516 | ;; weiand: changed: year potentially unaligned |
| 1517 | ;;old s "\\(" HH:MM "\\|" s yyyy "\\|" yyyy s "\\)")) | 1517 | ;;old s "\\(" HH:MM "\\|" s yyyy "\\|" yyyy s "\\)")) |
| 1518 | s "\\(" HH:MM | 1518 | s "\\(" HH:MM |
| 1519 | "\\|" yyyy s s "?" | 1519 | "\\|" yyyy s s "?" |
| 1520 | "\\|" s "?" yyyy | 1520 | "\\|" s "?" yyyy |
| 1521 | "\\)")) | 1521 | "\\)")) |
| @@ -1612,7 +1612,7 @@ regardless of the language.") | |||
| 1612 | nil | 1612 | nil |
| 1613 | (point)))) | 1613 | (point)))) |
| 1614 | 1614 | ||
| 1615 | 1615 | ||
| 1616 | ;; Keeping Dired buffers in sync with the filesystem and with each other | 1616 | ;; Keeping Dired buffers in sync with the filesystem and with each other |
| 1617 | 1617 | ||
| 1618 | (defun dired-buffers-for-dir (dir &optional file) | 1618 | (defun dired-buffers-for-dir (dir &optional file) |
| @@ -1677,7 +1677,7 @@ regardless of the language.") | |||
| 1677 | (substring pattern matched-in-pattern)) | 1677 | (substring pattern matched-in-pattern)) |
| 1678 | "\\'"))) | 1678 | "\\'"))) |
| 1679 | 1679 | ||
| 1680 | 1680 | ||
| 1681 | 1681 | ||
| 1682 | (defun dired-advertise () | 1682 | (defun dired-advertise () |
| 1683 | ;;"Advertise in variable `dired-buffers' that we dired `default-directory'." | 1683 | ;;"Advertise in variable `dired-buffers' that we dired `default-directory'." |
| @@ -1696,7 +1696,7 @@ regardless of the language.") | |||
| 1696 | ;; Removing is also done as a side-effect in dired-buffer-for-dir. | 1696 | ;; Removing is also done as a side-effect in dired-buffer-for-dir. |
| 1697 | (setq dired-buffers | 1697 | (setq dired-buffers |
| 1698 | (delq (assoc (expand-file-name dir) dired-buffers) dired-buffers))) | 1698 | (delq (assoc (expand-file-name dir) dired-buffers) dired-buffers))) |
| 1699 | 1699 | ||
| 1700 | ;; Tree Dired | 1700 | ;; Tree Dired |
| 1701 | 1701 | ||
| 1702 | ;;; utility functions | 1702 | ;;; utility functions |
| @@ -1898,7 +1898,7 @@ Returns the new value of the alist." | |||
| 1898 | ;; You may redefine this function as you wish, e.g. like in dired-x.el. | 1898 | ;; You may redefine this function as you wish, e.g. like in dired-x.el. |
| 1899 | (end-of-line) | 1899 | (end-of-line) |
| 1900 | (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) | 1900 | (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) |
| 1901 | 1901 | ||
| 1902 | ;; These are hooks which make tree dired work. | 1902 | ;; These are hooks which make tree dired work. |
| 1903 | ;; They are in this file because other parts of dired need to call them. | 1903 | ;; They are in this file because other parts of dired need to call them. |
| 1904 | ;; But they don't call the rest of tree dired unless there are subdirs loaded. | 1904 | ;; But they don't call the rest of tree dired unless there are subdirs loaded. |
| @@ -1935,7 +1935,7 @@ Optional argument means return a file name relative to `default-directory'." | |||
| 1935 | (if (or (null (cdr dired-subdir-alist)) (not (dired-next-subdir 1 t t))) | 1935 | (if (or (null (cdr dired-subdir-alist)) (not (dired-next-subdir 1 t t))) |
| 1936 | (point-max) | 1936 | (point-max) |
| 1937 | (point)))) | 1937 | (point)))) |
| 1938 | 1938 | ||
| 1939 | ;; Deleting files | 1939 | ;; Deleting files |
| 1940 | 1940 | ||
| 1941 | (defcustom dired-recursive-deletes nil ; Default only delete empty directories. | 1941 | (defcustom dired-recursive-deletes nil ; Default only delete empty directories. |
| @@ -1951,7 +1951,7 @@ Anything else means ask for each directory." | |||
| 1951 | (const :tag "Ask for each top directory only" top)) | 1951 | (const :tag "Ask for each top directory only" top)) |
| 1952 | :group 'dired) | 1952 | :group 'dired) |
| 1953 | 1953 | ||
| 1954 | ;; Match anything but `.' and `..'. | 1954 | ;; Match anything but `.' and `..'. |
| 1955 | (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") | 1955 | (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") |
| 1956 | 1956 | ||
| 1957 | ;; Delete file, possibly delete a directory and all its files. | 1957 | ;; Delete file, possibly delete a directory and all its files. |
| @@ -2064,7 +2064,7 @@ if there are no flagged files." | |||
| 2064 | (save-excursion (and (cdr dired-subdir-alist) | 2064 | (save-excursion (and (cdr dired-subdir-alist) |
| 2065 | (dired-goto-subdir fn) | 2065 | (dired-goto-subdir fn) |
| 2066 | (dired-kill-subdir)))) | 2066 | (dired-kill-subdir)))) |
| 2067 | 2067 | ||
| 2068 | ;; Confirmation | 2068 | ;; Confirmation |
| 2069 | 2069 | ||
| 2070 | (defun dired-marker-regexp () | 2070 | (defun dired-marker-regexp () |
| @@ -2184,7 +2184,7 @@ FILES is the list of marked files." | |||
| 2184 | j (1+ j) | 2184 | j (1+ j) |
| 2185 | files (cdr files))) | 2185 | files (cdr files))) |
| 2186 | rows)) | 2186 | rows)) |
| 2187 | 2187 | ||
| 2188 | ;; Commands to mark or flag file(s) at or near current line. | 2188 | ;; Commands to mark or flag file(s) at or near current line. |
| 2189 | 2189 | ||
| 2190 | (defun dired-repeat-over-lines (arg function) | 2190 | (defun dired-repeat-over-lines (arg function) |
| @@ -2325,7 +2325,7 @@ As always, hidden subdirs are not affected." | |||
| 2325 | (list ?\040 dired-marker-char) | 2325 | (list ?\040 dired-marker-char) |
| 2326 | (list dired-marker-char ?\040)))) | 2326 | (list dired-marker-char ?\040)))) |
| 2327 | (forward-line 1))))) | 2327 | (forward-line 1))))) |
| 2328 | 2328 | ||
| 2329 | ;;; Commands to mark or flag files based on their characteristics or names. | 2329 | ;;; Commands to mark or flag files based on their characteristics or names. |
| 2330 | 2330 | ||
| 2331 | (defvar dired-regexp-history nil | 2331 | (defvar dired-regexp-history nil |
| @@ -2444,7 +2444,7 @@ A prefix argument says to unflag those files instead." | |||
| 2444 | "auto save file"))) | 2444 | "auto save file"))) |
| 2445 | 2445 | ||
| 2446 | (defvar dired-garbage-files-regexp | 2446 | (defvar dired-garbage-files-regexp |
| 2447 | "\\.log$\\|\\.toc$\\|\\.dvi$\\|\\.bak$\\|\\.orig$\\|\\.rej$" | 2447 | "\\.log$\\|\\.toc$\\|\\.dvi$\\|\\.bak$\\|\\.orig$\\|\\.rej$" |
| 2448 | "*Regular expression to match \"garbage\" files for `dired-flag-garbage-files'.") | 2448 | "*Regular expression to match \"garbage\" files for `dired-flag-garbage-files'.") |
| 2449 | 2449 | ||
| 2450 | (defun dired-flag-garbage-files () | 2450 | (defun dired-flag-garbage-files () |
| @@ -2504,7 +2504,7 @@ OLD and NEW are both characters used to mark files." | |||
| 2504 | 2504 | ||
| 2505 | (defun dired-unmark-all-files (mark &optional arg) | 2505 | (defun dired-unmark-all-files (mark &optional arg) |
| 2506 | "Remove a specific mark (or any mark) from every file. | 2506 | "Remove a specific mark (or any mark) from every file. |
| 2507 | After this command, type the mark character to remove, | 2507 | After this command, type the mark character to remove, |
| 2508 | or type RET to remove all marks. | 2508 | or type RET to remove all marks. |
| 2509 | With prefix arg, query for each marked file. | 2509 | With prefix arg, query for each marked file. |
| 2510 | Type \\[help-command] at that time for help." | 2510 | Type \\[help-command] at that time for help." |
| @@ -2529,7 +2529,7 @@ Type SPC or `y' to unmark one file, DEL or `n' to skip to next, | |||
| 2529 | (message (if (= count 1) "1 mark removed" | 2529 | (message (if (= count 1) "1 mark removed" |
| 2530 | "%d marks removed") | 2530 | "%d marks removed") |
| 2531 | count)))) | 2531 | count)))) |
| 2532 | 2532 | ||
| 2533 | ;; Logging failures operating on files, and showing the results. | 2533 | ;; Logging failures operating on files, and showing the results. |
| 2534 | 2534 | ||
| 2535 | (defvar dired-log-buffer "*Dired log*") | 2535 | (defvar dired-log-buffer "*Dired log*") |
| @@ -2579,7 +2579,7 @@ Thus, use \\[backward-page] to find the beginning of a group of errors." | |||
| 2579 | ;; Log a summary describing a bunch of errors. | 2579 | ;; Log a summary describing a bunch of errors. |
| 2580 | (dired-log (concat "\n" string)) | 2580 | (dired-log (concat "\n" string)) |
| 2581 | (dired-log t)) | 2581 | (dired-log t)) |
| 2582 | 2582 | ||
| 2583 | ;;; Sorting | 2583 | ;;; Sorting |
| 2584 | 2584 | ||
| 2585 | ;; Most ls can only sort by name or by date (with -t), nothing else. | 2585 | ;; Most ls can only sort by name or by date (with -t), nothing else. |
| @@ -2629,15 +2629,15 @@ With a prefix argument you can edit the current listing switches instead." | |||
| 2629 | (if (string-match " " dired-actual-switches) | 2629 | (if (string-match " " dired-actual-switches) |
| 2630 | ;; New toggle scheme: add/remove a trailing " -t" | 2630 | ;; New toggle scheme: add/remove a trailing " -t" |
| 2631 | (if (string-match " -t\\'" dired-actual-switches) | 2631 | (if (string-match " -t\\'" dired-actual-switches) |
| 2632 | (dired-replace-in-string " -t\\'" "" dired-actual-switches) | 2632 | (replace-regexp-in-string " -t\\'" "" dired-actual-switches) |
| 2633 | (concat dired-actual-switches " -t")) | 2633 | (concat dired-actual-switches " -t")) |
| 2634 | ;; old toggle scheme: look for some 't' switch and add/remove it | 2634 | ;; old toggle scheme: look for some 't' switch and add/remove it |
| 2635 | (concat | 2635 | (concat |
| 2636 | "-l" | 2636 | "-l" |
| 2637 | (dired-replace-in-string (concat "[-lt" | 2637 | (replace-regexp-in-string (concat "[-lt" |
| 2638 | dired-ls-sorting-switches "]") | 2638 | dired-ls-sorting-switches "]") |
| 2639 | "" | 2639 | "" |
| 2640 | dired-actual-switches) | 2640 | dired-actual-switches) |
| 2641 | (if (string-match (concat "[t" dired-ls-sorting-switches "]") | 2641 | (if (string-match (concat "[t" dired-ls-sorting-switches "]") |
| 2642 | dired-actual-switches) | 2642 | dired-actual-switches) |
| 2643 | "" | 2643 | "" |
| @@ -2645,17 +2645,6 @@ With a prefix argument you can edit the current listing switches instead." | |||
| 2645 | (dired-sort-set-modeline) | 2645 | (dired-sort-set-modeline) |
| 2646 | (revert-buffer)) | 2646 | (revert-buffer)) |
| 2647 | 2647 | ||
| 2648 | (defun dired-replace-in-string (regexp newtext string) | ||
| 2649 | ;; Replace REGEXP with NEWTEXT everywhere in STRING and return result. | ||
| 2650 | ;; NEWTEXT is taken literally---no \\DIGIT escapes will be recognized. | ||
| 2651 | (let ((result "") (start 0) mb me) | ||
| 2652 | (while (string-match regexp string start) | ||
| 2653 | (setq mb (match-beginning 0) | ||
| 2654 | me (match-end 0) | ||
| 2655 | result (concat result (substring string start mb) newtext) | ||
| 2656 | start me)) | ||
| 2657 | (concat result (substring string start)))) | ||
| 2658 | |||
| 2659 | (defun dired-sort-other (switches &optional no-revert) | 2648 | (defun dired-sort-other (switches &optional no-revert) |
| 2660 | ;; Specify new ls SWITCHES for current dired buffer. Values matching | 2649 | ;; Specify new ls SWITCHES for current dired buffer. Values matching |
| 2661 | ;; `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp' set the | 2650 | ;; `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp' set the |
| @@ -2700,7 +2689,7 @@ To be called first in body of `dired-sort-other', etc." | |||
| 2700 | ;; No pre-R subdir alist, so revert to main directory | 2689 | ;; No pre-R subdir alist, so revert to main directory |
| 2701 | ;; listing: | 2690 | ;; listing: |
| 2702 | (list (car (reverse dired-subdir-alist)))))))) | 2691 | (list (car (reverse dired-subdir-alist)))))))) |
| 2703 | 2692 | ||
| 2704 | ;; To make this file smaller, the less common commands | 2693 | ;; To make this file smaller, the less common commands |
| 2705 | ;; go in a separate file. But autoload them here | 2694 | ;; go in a separate file. But autoload them here |
| 2706 | ;; to make the separation invisible. | 2695 | ;; to make the separation invisible. |
| @@ -2913,9 +2902,9 @@ Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." | |||
| 2913 | (autoload 'dired-show-file-type "dired-aux" | 2902 | (autoload 'dired-show-file-type "dired-aux" |
| 2914 | "Print the type of FILE, according to the `file' command. | 2903 | "Print the type of FILE, according to the `file' command. |
| 2915 | If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is | 2904 | If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is |
| 2916 | true then the type of the file linked to by FILE is printed instead." | 2905 | true then the type of the file linked to by FILE is printed instead." |
| 2917 | t) | 2906 | t) |
| 2918 | 2907 | ||
| 2919 | (if (eq system-type 'vax-vms) | 2908 | (if (eq system-type 'vax-vms) |
| 2920 | (load "dired-vms")) | 2909 | (load "dired-vms")) |
| 2921 | 2910 | ||
diff --git a/lisp/gs.el b/lisp/gs.el index cbce2002cf4..89a21e19fcb 100644 --- a/lisp/gs.el +++ b/lisp/gs.el | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | "The Ghostscript device to use to produce images.") | 36 | "The Ghostscript device to use to produce images.") |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | (defvar gs-options | 39 | (defvar gs-options |
| 40 | '("-q" | 40 | '("-q" |
| 41 | ;"-dNOPAUSE" | 41 | ;"-dNOPAUSE" |
| 42 | "-dBATCH" | 42 | "-dBATCH" |
| @@ -46,54 +46,45 @@ | |||
| 46 | Arguments may contain place-holders `<file>' for the name of the | 46 | Arguments may contain place-holders `<file>' for the name of the |
| 47 | input file, and `<device>' for the device to use.") | 47 | input file, and `<device>' for the device to use.") |
| 48 | 48 | ||
| 49 | |||
| 50 | (defun gs-replace-in-string (string find repl) | ||
| 51 | "Return STRING with all occurrences of FIND replaced by REPL. | ||
| 52 | FIND is a regular expression." | ||
| 53 | (while (string-match find string) | ||
| 54 | (setq string (replace-match repl nil t string))) | ||
| 55 | string) | ||
| 56 | |||
| 57 | |||
| 58 | (defun gs-options (device file) | 49 | (defun gs-options (device file) |
| 59 | "Return a list of command line options with place-holders replaced. | 50 | "Return a list of command line options with place-holders replaced. |
| 60 | DEVICE is the value to substitute for the place-holder `<device>', | 51 | DEVICE is the value to substitute for the place-holder `<device>', |
| 61 | FILE is the value to substitute for the place-holder `<file>'." | 52 | FILE is the value to substitute for the place-holder `<file>'." |
| 62 | (mapcar #'(lambda (option) | 53 | (mapcar #'(lambda (option) |
| 63 | (setq option (gs-replace-in-string option "<device>" device) | 54 | (setq option (replace-regexp-in-string "<device>" device option) |
| 64 | option (gs-replace-in-string option "<file>" file))) | 55 | option (replace-regexp-in-string "<file>" file option))) |
| 65 | gs-options)) | 56 | gs-options)) |
| 66 | 57 | ||
| 67 | 58 | ||
| 68 | ;; The GHOSTVIEW property (taken from gv 3.5.8). | 59 | ;; The GHOSTVIEW property (taken from gv 3.5.8). |
| 69 | ;; | 60 | ;; |
| 70 | ;; Type: | 61 | ;; Type: |
| 71 | ;; | 62 | ;; |
| 72 | ;; STRING | 63 | ;; STRING |
| 73 | ;; | 64 | ;; |
| 74 | ;; Parameters: | 65 | ;; Parameters: |
| 75 | ;; | 66 | ;; |
| 76 | ;; BPIXMAP ORIENT LLX LLY URX URY XDPI YDPI [LEFT BOTTOM TOP RIGHT] | 67 | ;; BPIXMAP ORIENT LLX LLY URX URY XDPI YDPI [LEFT BOTTOM TOP RIGHT] |
| 77 | ;; | 68 | ;; |
| 78 | ;; Scanf format: "%d %d %d %d %d %d %f %f %d %d %d %d" | 69 | ;; Scanf format: "%d %d %d %d %d %d %f %f %d %d %d %d" |
| 79 | ;; | 70 | ;; |
| 80 | ;; Explanation of parameters: | 71 | ;; Explanation of parameters: |
| 81 | ;; | 72 | ;; |
| 82 | ;; BPIXMAP: pixmap id of the backing pixmap for the window. If no | 73 | ;; BPIXMAP: pixmap id of the backing pixmap for the window. If no |
| 83 | ;; pixmap is to be used, this parameter should be zero. This | 74 | ;; pixmap is to be used, this parameter should be zero. This |
| 84 | ;; parameter must be zero when drawing on a pixmap. | 75 | ;; parameter must be zero when drawing on a pixmap. |
| 85 | ;; | 76 | ;; |
| 86 | ;; ORIENT: orientation of the page. The number represents clockwise | 77 | ;; ORIENT: orientation of the page. The number represents clockwise |
| 87 | ;; rotation of the paper in degrees. Permitted values are 0, 90, 180, | 78 | ;; rotation of the paper in degrees. Permitted values are 0, 90, 180, |
| 88 | ;; 270. | 79 | ;; 270. |
| 89 | ;; | 80 | ;; |
| 90 | ;; LLX, LLY, URX, URY: Bounding box of the drawable. The bounding box | 81 | ;; LLX, LLY, URX, URY: Bounding box of the drawable. The bounding box |
| 91 | ;; is specified in PostScript points in default user coordinates. | 82 | ;; is specified in PostScript points in default user coordinates. |
| 92 | ;; | 83 | ;; |
| 93 | ;; XDPI, YDPI: Resolution of window. (This can be derived from the | 84 | ;; XDPI, YDPI: Resolution of window. (This can be derived from the |
| 94 | ;; other parameters, but not without roundoff error. These values are | 85 | ;; other parameters, but not without roundoff error. These values are |
| 95 | ;; included to avoid this error.) | 86 | ;; included to avoid this error.) |
| 96 | ;; | 87 | ;; |
| 97 | ;; LEFT, BOTTOM, TOP, RIGHT: (optional) Margins around the window. | 88 | ;; LEFT, BOTTOM, TOP, RIGHT: (optional) Margins around the window. |
| 98 | ;; The margins extend the imageable area beyond the boundaries of the | 89 | ;; The margins extend the imageable area beyond the boundaries of the |
| 99 | ;; window. This is primarily used for popup zoom windows. I have | 90 | ;; window. This is primarily used for popup zoom windows. I have |
| @@ -116,7 +107,7 @@ FILE is the value to substitute for the place-holder `<file>'." | |||
| 116 | (/ (float (x-display-mm-height frame)) | 107 | (/ (float (x-display-mm-height frame)) |
| 117 | (float (x-display-pixel-height frame)))))) | 108 | (float (x-display-pixel-height frame)))))) |
| 118 | (/ (* 25.4 mm) 72.0))) | 109 | (/ (* 25.4 mm) 72.0))) |
| 119 | 110 | ||
| 120 | 111 | ||
| 121 | (defun gs-set-ghostview-window-prop (frame spec img-width img-height) | 112 | (defun gs-set-ghostview-window-prop (frame spec img-width img-height) |
| 122 | "Set the `GHOSTVIEW' window property of FRAME. | 113 | "Set the `GHOSTVIEW' window property of FRAME. |
| @@ -148,7 +139,7 @@ image in pixels." | |||
| 148 | (t "Monochrome")))) | 139 | (t "Monochrome")))) |
| 149 | (x-change-window-property "GHOSTVIEW_COLORS" | 140 | (x-change-window-property "GHOSTVIEW_COLORS" |
| 150 | (format "%s %s" mode pixel-colors)))) | 141 | (format "%s %s" mode pixel-colors)))) |
| 151 | 142 | ||
| 152 | 143 | ||
| 153 | ; | 144 | ; |
| 154 | ;;;###autoload | 145 | ;;;###autoload |
| @@ -178,7 +169,7 @@ the form \"WINDOW-ID PIXMAP-ID\". Value is non-nil if successful." | |||
| 178 | ; :bounding-box (22 171 567 738) | 169 | ; :bounding-box (22 171 567 738) |
| 179 | ; :file ,ps-file))) | 170 | ; :file ,ps-file))) |
| 180 | ; (put-text-property 1 2 'display spec))) | 171 | ; (put-text-property 1 2 'display spec))) |
| 181 | ; | 172 | ; |
| 182 | 173 | ||
| 183 | (provide 'gs) | 174 | (provide 'gs) |
| 184 | 175 | ||