diff lisp/files.el @ 91005:424b655804ca

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 846-851) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 88-92) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 242-244) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-246
author Miles Bader <miles@gnu.org>
date Mon, 13 Aug 2007 13:48:35 +0000
parents f55f9811f5d7 e5a68f18fcb9
children b83d0dadb2a7
line wrap: on
line diff
--- a/lisp/files.el	Wed Aug 08 16:39:00 2007 +0000
+++ b/lisp/files.el	Mon Aug 13 13:48:35 2007 +0000
@@ -1937,7 +1937,7 @@
   ;; c++-mode, java-mode and more) are added through autoload
   ;; directives in that file.  That way is discouraged since it
   ;; spreads out the definition of the initial value.
-  (mapc
+  (mapcar
    (lambda (elt)
      (cons (purecopy (car elt)) (cdr elt)))
    `(;; do this first, so that .html.pl is Polish html, not Perl
@@ -2310,7 +2310,12 @@
     ;; Next compare the filename against the entries in auto-mode-alist.
     (unless done
       (if buffer-file-name
-	  (let ((name buffer-file-name))
+	  (let ((name buffer-file-name)
+		(remote-id (file-remote-p buffer-file-name)))
+	    ;; Remove remote file name identification.
+	    (when (and (stringp remote-id)
+		       (string-match (regexp-quote remote-id) name))
+	      (setq name (substring name (match-end 0))))
 	    ;; Remove backup-suffixes from file name.
 	    (setq name (file-name-sans-versions name))
 	    (while name
@@ -3988,8 +3993,9 @@
 
 (defun toggle-read-only (&optional arg)
   "Change whether this buffer is visiting its file read-only.
-With arg, set read-only iff arg is positive.
-If visiting file read-only and `view-read-only' is non-nil, enter view mode."
+With prefix argument ARG, make the buffer read-only if ARG is
+positive, otherwise make it writable.  If visiting file read-only
+and `view-read-only' is non-nil, enter view mode."
   (interactive "P")
   (if (and arg
            (if (> (prefix-numeric-value arg) 0) buffer-read-only
@@ -4632,7 +4638,7 @@
 
 (defun wildcard-to-regexp (wildcard)
   "Given a shell file name pattern WILDCARD, return an equivalent regexp.
-The generated regexp will match a filename iff the filename
+The generated regexp will match a filename only if the filename
 matches that wildcard according to shell rules.  Only wildcards known
 by `sh' are supported."
   (let* ((i (string-match "[[.*+\\^$?]" wildcard))