[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/dired-aux.el
From: |
Francesco Potortì |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/dired-aux.el |
Date: |
Wed, 17 Apr 2002 05:54:47 -0400 |
Index: emacs/lisp/dired-aux.el
diff -c emacs/lisp/dired-aux.el:1.100 emacs/lisp/dired-aux.el:1.101
*** emacs/lisp/dired-aux.el:1.100 Fri Mar 29 09:44:07 2002
--- emacs/lisp/dired-aux.el Wed Apr 17 05:54:47 2002
***************
*** 43,48 ****
--- 43,51 ----
;;;###begin dired-cmd.el
;; Diffing and compressing
+ (defconst dired-star-subst-regexp "\\(^\\|[ \t]\\)\\*\\([ \t]\\|$\\)")
+ (defconst dired-quark-subst-regexp "\\(^\\|[ \t]\\)\\?\\([ \t]\\|$\\)")
+
;;;###autoload
(defun dired-diff (file &optional switches)
"Compare file at point with file FILE using `diff'.
***************
*** 102,108 ****
(setq failures
(dired-bunch-files 10000
(function dired-check-process)
! (append
(list operation program new-attribute)
(if (string-match "gnu" system-configuration)
'("--") nil))
--- 105,111 ----
(setq failures
(dired-bunch-files 10000
(function dired-check-process)
! (append
(list operation program new-attribute)
(if (string-match "gnu" system-configuration)
'("--") nil))
***************
*** 355,367 ****
files)
current-prefix-arg
files)))
! (let* ((on-each (not (string-match "\\(^\\|[ \t]\\)\\*\\([ \t]\\|$\\)"
command)))
! (subst (not (string-match "\\(^\\|[ \t]\\)\\?\\([ \t]\\|$\\)"
command)))
(star (not (string-match "\\*" command)))
(qmark (not (string-match "\\?" command))))
;; Get confirmation for wildcards that may have been meant
;; to control substitution of a file name or the file name list.
! (if (cond ((and star (not on-each))
(y-or-n-p "Confirm--do you mean to use `*' as a wildcard? "))
((and qmark (not subst))
(y-or-n-p "Confirm--do you mean to use `?' as a wildcard? "))
--- 358,372 ----
files)
current-prefix-arg
files)))
! (let* ((on-each (not (string-match dired-star-subst-regexp command)))
! (subst (not (string-match dired-quark-subst-regexp command)))
(star (not (string-match "\\*" command)))
(qmark (not (string-match "\\?" command))))
;; Get confirmation for wildcards that may have been meant
;; to control substitution of a file name or the file name list.
! (if (cond ((not (or on-each subst))
! (error "You can not combine `*' and `?' substitution marks"))
! ((and star (not on-each))
(y-or-n-p "Confirm--do you mean to use `*' as a wildcard? "))
((and qmark (not subst))
(y-or-n-p "Confirm--do you mean to use `?' as a wildcard? "))
***************
*** 395,409 ****
;; (coming from interactive P and currently ignored) to decide what to do.
;; Smart would be a way to access basename or extension of file names.
(let ((stuff-it
! (cond ((string-match "\\(^\\|[ \t]\\)\\*\\([ \t]\\|$\\)" command)
! (lambda (x)
! (string-match "\\(^\\|[ \t]\\)\\(\\*\\)\\([ \t]\\|$\\)"
command)
! (replace-match x t t command 2)))
! ((string-match "\\(^\\|[ \t]\\)\\?\\([ \t]\\|$\\)" command)
! (lambda (x)
! (string-match "\\(^\\|[ \t]\\)\\(\\?\\)\\([ \t]\\|$\\)"
command)
! (replace-match x t t command 2)))
! (t (lambda (x) (concat command dired-mark-separator x))))))
(if on-each
(mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";")
(let ((files (mapconcat 'shell-quote-argument
--- 400,414 ----
;; (coming from interactive P and currently ignored) to decide what to do.
;; Smart would be a way to access basename or extension of file names.
(let ((stuff-it
! (if (or (string-match dired-star-subst-regexp command)
! (string-match dired-quark-subst-regexp command))
! (lambda (x)
! (let ((retval command))
! (while (string-match
! "\\(^\\|[ \t]\\)\\([*?]\\)\\([ \t]\\|$\\)" retval)
! (setq retval (replace-match x t t retval 2)))
! retval))
! (lambda (x) (concat command dired-mark-separator x)))))
(if on-each
(mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";")
(let ((files (mapconcat 'shell-quote-argument
***************
*** 576,582 ****
(setq suffix (car suffixes) suffixes nil))
(setq suffixes (cdr suffixes))))
;; If so, compute desired new name.
! (if suffix
(setq newname (concat (substring file 0 (match-beginning 0))
(nth 1 suffix))))
(cond (handler
--- 581,587 ----
(setq suffix (car suffixes) suffixes nil))
(setq suffixes (cdr suffixes))))
;; If so, compute desired new name.
! (if suffix
(setq newname (concat (substring file 0 (match-beginning 0))
(nth 1 suffix))))
(cond (handler
***************
*** 847,853 ****
;; It inserts the file's absolute name, rather than
;; the relative one. That may be hard to fix since it
;; is probably controlled by something in ftp.
! (goto-char opoint)
(let ((inserted-name (dired-get-filename 'verbatim)))
(if (file-name-directory inserted-name)
(progn
--- 852,858 ----
;; It inserts the file's absolute name, rather than
;; the relative one. That may be hard to fix since it
;; is probably controlled by something in ftp.
! (goto-char opoint)
(let ((inserted-name (dired-get-filename 'verbatim)))
(if (file-name-directory inserted-name)
(progn
***************
*** 2013,2021 ****
(defun dired-show-file-type (file &optional deref-symlinks)
"Print the type of FILE, according to the `file' command.
If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is
! true then the type of the file linked to by FILE is printed instead."
(interactive (list (dired-get-filename t) current-prefix-arg))
! (with-temp-buffer
(if deref-symlinks
(call-process "file" nil t t "-L" file)
(call-process "file" nil t t file))
--- 2018,2026 ----
(defun dired-show-file-type (file &optional deref-symlinks)
"Print the type of FILE, according to the `file' command.
If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is
! true then the type of the file linked to by FILE is printed instead."
(interactive (list (dired-get-filename t) current-prefix-arg))
! (with-temp-buffer
(if deref-symlinks
(call-process "file" nil t t "-L" file)
(call-process "file" nil t t file))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/dired-aux.el,
Francesco Potortì <=