From 7d98ad02fd92c5323f7eb0f74780b3fe07d19301 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 08:50:52 +0000 Subject: * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. --- lisp/files.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 9cc64284d15..e2cde74d6a1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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 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 -- cgit v1.2.1 From f4ef535bcf07af2c5e9a91a38cba6b3312a26a0a Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 08:57:24 +0000 Subject: * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. --- lisp/files.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 444e402f438..135ccfafb92 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2259,7 +2259,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 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 -- cgit v1.2.1 From 9fd25d141e926833cf5885603d11c2122c471fe8 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 12:43:06 +0000 Subject: * net/tramp.el (tramp-handle-file-remote-p): Return a string as remote identification. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 135ccfafb92..8e6fb9ff725 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2260,7 +2260,7 @@ we don't actually set it to the same mode the buffer already has." (unless done (if buffer-file-name (let ((name buffer-file-name) - (remote-id (file-remote-p buffer-file-name))) + (remote-id (regexp-quote (file-remote-p buffer-file-name)))) ;; Remove remote file name identification. (when (and (stringp remote-id) (string-match remote-id name)) -- cgit v1.2.1 From 31c855e2a5015e9c0013d8f24bbc6eab7dc74112 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 12:46:33 +0000 Subject: *** empty log message *** --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index e2cde74d6a1..3be6c2429cd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2314,7 +2314,7 @@ we don't actually set it to the same mode the buffer already has." (remote-id (file-remote-p buffer-file-name))) ;; Remove remote file name identification. (when (and (stringp remote-id) - (string-match remote-id name)) + (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)) -- cgit v1.2.1 From 972c4265e726f3fb1fdcb3f0b06b428a6f0af8e3 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Aug 2007 12:48:27 +0000 Subject: *** empty log message *** --- lisp/files.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 8e6fb9ff725..dfa3cef384d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2260,10 +2260,10 @@ we don't actually set it to the same mode the buffer already has." (unless done (if buffer-file-name (let ((name buffer-file-name) - (remote-id (regexp-quote (file-remote-p buffer-file-name)))) + (remote-id (file-remote-p buffer-file-name))) ;; Remove remote file name identification. (when (and (stringp remote-id) - (string-match remote-id name)) + (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)) -- cgit v1.2.1 From a68f2006ee8483b49da5d168aba2ab447623af18 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 8 Aug 2007 07:38:50 +0000 Subject: Replace `iff' in doc-strings and comments. --- lisp/files.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index dfa3cef384d..4d952f3f935 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3941,8 +3941,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 @@ -4568,7 +4569,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)) -- cgit v1.2.1 From cb69b6a210d71b60972d019348612cd8bba8b0a0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 8 Aug 2007 14:06:02 +0000 Subject: (auto-mode-alist): Use the purecopied text (duh!). --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 4d952f3f935..8ade456ee07 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1886,7 +1886,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 -- cgit v1.2.1