]> code.delx.au - gnu-emacs/blobdiff - lisp/dired.el
(ps-print-preprint): Special handling if
[gnu-emacs] / lisp / dired.el
index 6bf16084c008583512380c4af0066d0c06e5f13c..76ce9e8d45d48da54fe4896fdb1389b8db642929 100644 (file)
@@ -1,6 +1,6 @@
 ;;; dired.el --- directory-browsing commands
 
-;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;; Maintainer: FSF
@@ -18,8 +18,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -47,7 +48,7 @@ may contain even `F', `b', `i' and `s'.  See also the variable
 
 ;;;###autoload
 (defvar dired-chown-program
-  (if (memq system-type '(hpux dgux usg-unix-v irix linux))
+  (if (memq system-type '(hpux dgux usg-unix-v irix linux lignux))
       "chown" "/etc/chown")
   "Name of chown command (usually `chown' or `/etc/chown').")
 
@@ -59,7 +60,8 @@ may contain even `F', `b', `i' and `s'.  See also the variable
 ;;;###autoload
 (defvar dired-ls-F-marks-symlinks nil
   "*Informs dired about how `ls -lF' marks symbolic links.
-Set this to t if `insert-directory-program' with `-lF' marks the symbolic link
+Set this to t if `ls' (or whatever program is specified by
+`insert-directory-program') with `-lF' marks the symbolic link
 itself with a trailing @ (usually the case under Ultrix).
 
 Example: if `ln -s foo bar; ls -F bar' gives `bar -> foo', set it to
@@ -384,6 +386,8 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
       (setq dirname dir-or-list))
     (setq dirname (abbreviate-file-name
                   (expand-file-name (directory-file-name dirname))))
+    (if find-file-visit-truename
+       (setq dirname (file-truename dirname)))
     (if (file-directory-p dirname)
        (setq dirname (file-name-as-directory dirname)))
     (if (consp dir-or-list)
@@ -434,9 +438,9 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
                         (and (= (car (nth 5 attributes)) (car modtime))
                              (= (nth 1 (nth 5 attributes)) (cdr modtime)))))
                   nil
-                (message
-                 (substitute-command-keys
-                  "Directory has changed on disk; type \\[revert-buffer] to update Dired")))))
+                (message "%s"
+                         (substitute-command-keys
+                          "Directory has changed on disk; type \\[revert-buffer] to update Dired")))))
       ;; Else a new buffer
       (setq default-directory
            (if (file-directory-p dirname)
@@ -566,7 +570,15 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
        end)
     ;; This makes sure that month names come out in English
     ;; so we can find the start of the file name.
-    (setenv "LC_ALL" "C")
+    ;; But if the user has customized the way of finding the file name,
+    ;; this is not necessary.
+    (if (and (equal dired-move-to-filename-regexp
+                   dired-standard-move-to-filename-regexp)
+            ;; It also isn't necessary if we'd use the C locale anyway.
+            (not (equal (or (getenv "LC_ALL") (getenv "LC_TIME")
+                            (getenv "LANGUAGE") "C")
+                        "C")))
+       (setq process-environment (cons "LC_ALL=C" process-environment)))
     (if (consp dir-or-list)
        ;; In this case, use the file names in the cdr
        ;; exactly as originally given to dired-noselect.
@@ -1189,7 +1201,7 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
                         ;; some ls -b don't escape quotes, argh!
                         ;; This is not needed for GNU ls, though.
                         (or (dired-string-replace-match
-                             "\\([^\\]\\)\"" file "\\1\\\\\"")
+                             "\\([^\\]\\|\\`\\)\"" file "\\1\\\\\"" nil t)
                             file)
                         "\"")))))
     (if (eq localp 'no-dir)
@@ -1246,6 +1258,10 @@ Optional arg GLOBAL means to replace all matches."
   "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] "
   "Regular expression to match a month abbreviation followed by a number.")
 
+(defconst dired-standard-move-to-filename-regexp
+  "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] "
+  "Regular expression to match a month abbreviation followed by a number.")
+
 ;; Move to first char of filename on this line.
 ;; Returns position (point) or nil if no filename on this line."
 (defun dired-move-to-filename (&optional raise-error eol)