summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-08-13 13:51:08 +0000
committerMiles Bader <miles@gnu.org>2007-08-13 13:51:08 +0000
commite8ffd486dbb18f8e1e091bcd6b86bf3964cc4cba (patch)
treec65d3c3f6f61b82b8f9917c057b2af8236aae6f2 /lisp/files.el
parent9bba0f5a0113698fe737e567f527ac723125f728 (diff)
parent1b533623e21dd20ec8fb05285cdc47398a5619a1 (diff)
downloademacs-e8ffd486dbb18f8e1e091bcd6b86bf3964cc4cba.tar.gz
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--multi-tty--0--patch-31
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 33e9f9eb12c..da8c1e95d6e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1937,7 +1937,7 @@ since only a single case-insensitive search through the alist is made."
;; 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 @@ we don't actually set it to the same mode the buffer already has."
;; 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
@@ -3989,8 +3994,9 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'."
(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
@@ -4633,7 +4639,7 @@ FILENAME should lack slashes. You can redefine this for customization."
(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))