* lisp/emacs-lisp/lisp-mnt.el (lm-version): Don't burp in a non-file buffer.

This commit is contained in:
Stefan Monnier 2015-04-02 09:59:47 -04:00
parent 23bb07e05d
commit 5e41a51e5c
2 changed files with 10 additions and 4 deletions

View file

@ -436,8 +436,10 @@ This can be found in an RCS or SCCS header."
;; Look for an SCCS header
((re-search-forward
(concat
(regexp-quote "@(#)")
(regexp-quote (file-name-nondirectory (buffer-file-name)))
"@(#)"
(if buffer-file-name
(regexp-quote (file-name-nondirectory buffer-file-name))
"[^\t\n]*")
"\t\\([012345679.]*\\)")
header-max t)
(match-string-no-properties 1)))))))