aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-08-23 19:22:29 +0200
committerJoakim Verona2013-08-23 19:22:29 +0200
commit4cf8510dd6d33a59b4b6b9d18a9108fdb4cc6884 (patch)
treecc64fc99caf075ba06ac201efd2866c87ed28239
parentf211300506e978ca56553398cc0e20976cb91247 (diff)
parentcb8d2612434ccdd7524a0da9c4728720c9badab3 (diff)
downloademacs-4cf8510dd6d33a59b4b6b9d18a9108fdb4cc6884.tar.gz
emacs-4cf8510dd6d33a59b4b6b9d18a9108fdb4cc6884.zip
merge from trunk
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/files.el9
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index df9fce72dd9..f633f5f5de7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-08-23 Glenn Morris <rgm@gnu.org>
2
3 * files.el (interpreter-mode-alist): Use tcl-mode for expect scripts.
4
5 * files.el (create-file-buffer): Handle the vital case of a file
6 whose basename is all spaces. (Bug#15162)
7
12013-08-23 Stefan Monnier <monnier@iro.umontreal.ca> 82013-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * textmodes/fill.el (fill-match-adaptive-prefix): Don't throw away 10 * textmodes/fill.el (fill-match-adaptive-prefix): Don't throw away
diff --git a/lisp/files.el b/lisp/files.el
index efd89605b1b..9adbca10369 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1604,12 +1604,16 @@ killed."
1604FILENAME (sans directory) is used unchanged if that name is free; 1604FILENAME (sans directory) is used unchanged if that name is free;
1605otherwise a string <2> or <3> or ... is appended to get an unused name. 1605otherwise a string <2> or <3> or ... is appended to get an unused name.
1606Spaces at the start of FILENAME (sans directory) are removed." 1606Spaces at the start of FILENAME (sans directory) are removed."
1607 ;; ^ Because buffers whose name begins with a space are treated as
1608 ;; internal Emacs buffers.
1607 (let ((lastname (file-name-nondirectory filename))) 1609 (let ((lastname (file-name-nondirectory filename)))
1608 (if (string= lastname "") 1610 (if (string= lastname "")
1609 (setq lastname filename)) 1611 (setq lastname filename))
1610 (save-match-data 1612 (save-match-data
1611 (string-match "^ *\\(.*\\)" lastname) 1613 (if (string-match "\\` +\\(.*\\)" lastname)
1612 (generate-new-buffer (match-string 1 lastname))))) 1614 (if (zerop (length (setq lastname (match-string 1 lastname))))
1615 (setq lastname "SPC")))) ; bug#15162
1616 (generate-new-buffer lastname)))
1613 1617
1614(defun generate-new-buffer (name) 1618(defun generate-new-buffer (name)
1615 "Create and return a buffer with a name based on NAME. 1619 "Create and return a buffer with a name based on NAME.
@@ -2451,6 +2455,7 @@ and `magic-mode-alist', which determines modes based on file contents.")
2451 ("wishx" . tcl-mode) 2455 ("wishx" . tcl-mode)
2452 ("tcl" . tcl-mode) 2456 ("tcl" . tcl-mode)
2453 ("tclsh" . tcl-mode) 2457 ("tclsh" . tcl-mode)
2458 ("expect" . tcl-mode)
2454 ("scm" . scheme-mode) 2459 ("scm" . scheme-mode)
2455 ("ash" . sh-mode) 2460 ("ash" . sh-mode)
2456 ("bash" . sh-mode) 2461 ("bash" . sh-mode)