summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-09-19 10:29:42 +0200
committerPhilipp Stephani <phst@google.com>2017-09-24 10:02:00 +0200
commit1eb4e5c3c8e70813c8042a38a2b67be74b16500e (patch)
tree2dd4bb0690520cc15ec467b6c7561a32a088784b
parent535db535a9168ae73740f50b57210eb127c37119 (diff)
downloademacs-1eb4e5c3c8e70813c8042a38a2b67be74b16500e.tar.gz
emacs-1eb4e5c3c8e70813c8042a38a2b67be74b16500e.tar.bz2
emacs-1eb4e5c3c8e70813c8042a38a2b67be74b16500e.zip
Make FILENAME argument of 'file-name-base' mandatory
* lisp/files.el (file-name-base): Make FILENAME argument mandatory. * lisp/autoinsert.el (auto-insert-alist): * lisp/progmodes/cperl-mode.el (cperl-electric-pod): * lisp/progmodes/idlwave.el (idlwave-parse-definition): * lisp/textmodes/reftex-ref.el (reftex-replace-prefix-escapes): Fix all callers.
-rw-r--r--doc/lispref/files.texi4
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/autoinsert.el10
-rw-r--r--lisp/files.el4
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/progmodes/idlwave.el2
-rw-r--r--lisp/textmodes/reftex-ref.el2
7 files changed, 14 insertions, 13 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 6be998f0b2e..e4a4bfe5986 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2106,7 +2106,7 @@ Note that the @samp{.~3~} in the two last examples is the backup part,
not an extension.
@end defun
-@defun file-name-base &optional filename
+@defun file-name-base filename
This function is the composition of @code{file-name-sans-extension}
and @code{file-name-nondirectory}. For example,
@@ -2114,8 +2114,6 @@ and @code{file-name-nondirectory}. For example,
(file-name-base "/my/home/foo.c")
@result{} "foo"
@end example
-
-The @var{filename} argument defaults to @code{buffer-file-name}.
@end defun
@node Relative File Names
diff --git a/etc/NEWS b/etc/NEWS
index 0e62a2bbb42..aacdf79b573 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -48,6 +48,9 @@ sets the XTerm window title. The default is to set the window title.
* Incompatible Lisp Changes in Emacs 27.1
+** The FILENAME argument to 'file-name-base' is now mandatory and no
+longer defaults to 'buffer-file-name'.
+
* Lisp Changes in Emacs 27.1
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 2820c8a9afa..a43e068a4dc 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -141,14 +141,14 @@ If this contains a %s, that will be replaced by the matching rule."
"
.\\\" You may distribute this file under the terms of the GNU Free
.\\\" Documentation License.
-.TH " (file-name-base)
+.TH " (file-name-base (buffer-file-name))
" " (file-name-extension (buffer-file-name))
" " (format-time-string "%Y-%m-%d ")
"\n.SH NAME\n"
- (file-name-base)
+ (file-name-base (buffer-file-name))
" \\- " str
"\n.SH SYNOPSIS
-.B " (file-name-base)
+.B " (file-name-base (buffer-file-name))
"\n"
_
"
@@ -211,7 +211,7 @@ If this contains a %s, that will be replaced by the matching rule."
\(provide '"
- (file-name-base)
+ (file-name-base (buffer-file-name))
")
\;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n")
(("\\.texi\\(nfo\\)?\\'" . "Texinfo file skeleton")
@@ -219,7 +219,7 @@ If this contains a %s, that will be replaced by the matching rule."
"\\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename "
- (file-name-base) ".info\n"
+ (file-name-base (buffer-file-name)) ".info\n"
"@settitle " str "
@c %**end of header
@copying\n"
diff --git a/lisp/files.el b/lisp/files.el
index c55c8097c16..fe7cb1a8a94 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4479,8 +4479,8 @@ extension, the value is \"\"."
"")))))
(defun file-name-base (&optional filename)
- "Return the base name of the FILENAME: no directory, no extension.
-FILENAME defaults to `buffer-file-name'."
+ "Return the base name of the FILENAME: no directory, no extension."
+ (declare (advertised-calling-convention (filename) "27.1"))
(file-name-sans-extension
(file-name-nondirectory (or filename (buffer-file-name)))))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index abd77bd973d..e956637572c 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -2314,7 +2314,7 @@ to nil."
nil t)))) ; Only one
(progn
(forward-word-strictly 1)
- (setq name (file-name-base)
+ (setq name (file-name-base (buffer-file-name))
p (point))
(insert " NAME\n\n" name
" - \n\n=head1 SYNOPSIS\n\n\n\n"
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 9231e118907..92a42b1cb94 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -5240,7 +5240,7 @@ Can run from `after-save-hook'."
class
(cond ((not (boundp 'idlwave-scanning-lib))
(list 'buffer (buffer-file-name)))
-; ((string= (downcase (file-name-base))
+; ((string= (downcase (file-name-base (buffer-file-name))
; (downcase name))
; (list 'lib))
; (t (cons 'lib (file-name-nondirectory (buffer-file-name))))
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index c2c5ca3de06..f9f23201b43 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -314,7 +314,7 @@ also applies `reftex-translate-to-ascii-function' to the string."
(save-match-data
(cond
((equal letter "f")
- (file-name-base))
+ (file-name-base (buffer-file-name)))
((equal letter "F")
(let ((masterdir (file-name-directory (reftex-TeX-master-file)))
(file (file-name-sans-extension (buffer-file-name))))