summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog.172
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/emacs-lisp/find-func.el6
-rw-r--r--lisp/files.el17
-rw-r--r--lisp/mh-e/mh-compat.el23
-rw-r--r--lisp/mh-e/mh-mime.el10
-rw-r--r--lisp/mh-e/mh-show.el2
-rw-r--r--lisp/mh-e/mh-thread.el2
-rw-r--r--lisp/progmodes/elisp-mode.el3
-rw-r--r--lisp/recentf.el3
-rw-r--r--lisp/subr.el9
11 files changed, 51 insertions, 28 deletions
diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17
index 2f1957ad0ca..f0b2651f870 100644
--- a/lisp/ChangeLog.17
+++ b/lisp/ChangeLog.17
@@ -3737,7 +3737,7 @@
* net/tramp.el (tramp-read-passwd): Ignore errors from `auth-source-*'.
* net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use "\n"
- as end-of-line delimeter for passwords, when running on MS Windows.
+ as end-of-line delimiter for passwords, when running on MS Windows.
2014-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/lisp/desktop.el b/lisp/desktop.el
index dba3277c091..1f460b7a3ed 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -408,7 +408,7 @@ See related options `desktop-restore-reuses-frames',
:group 'desktop
:version "24.4")
-(defcustom desktop-restore-in-current-display nil
+(defcustom desktop-restore-in-current-display t
"Controls how restoring of frames treats displays.
If t, restores frames into the current display.
If nil, restores frames into their original displays (if possible).
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 71437ce89bd..4a7b7109106 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -404,8 +404,10 @@ signal an error.
If VERBOSE is non-nil, and FUNCTION is an alias, display a
message about the whole chain of aliases."
- (let ((def (if (symbolp function)
- (find-function-advised-original function)))
+ (let ((def (when (symbolp function)
+ (or (fboundp function)
+ (signal 'void-function (list function)))
+ (find-function-advised-original function)))
aliases)
;; FIXME for completeness, it might be nice to print something like:
;; foo (which is advised), which is an alias for bar (which is advised).
diff --git a/lisp/files.el b/lisp/files.el
index b737c101588..db274e2782d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4320,8 +4320,8 @@ the group would be preserved too."
(defun file-name-sans-extension (filename)
"Return FILENAME sans final \"extension\".
-The extension, in a file name, is the part that follows the last `.',
-except that a leading `.', if any, doesn't count."
+The extension, in a file name, is the part that begins with the last `.',
+except that a leading `.' of the file name, if there is one, doesn't count."
(save-match-data
(let ((file (file-name-sans-versions (file-name-nondirectory filename)))
directory)
@@ -4336,15 +4336,16 @@ except that a leading `.', if any, doesn't count."
(defun file-name-extension (filename &optional period)
"Return FILENAME's final \"extension\".
-The extension, in a file name, is the part that follows the last `.',
-excluding version numbers and backup suffixes,
-except that a leading `.', if any, doesn't count.
+The extension, in a file name, is the part that begins with the last `.',
+excluding version numbers and backup suffixes, except that a leading `.'
+of the file name, if there is one, doesn't count.
Return nil for extensionless file names such as `foo'.
Return the empty string for file names such as `foo.'.
-If PERIOD is non-nil, then the returned value includes the period
-that delimits the extension, and if FILENAME has no extension,
-the value is \"\"."
+By default, the returned value excludes the period that starts the
+extension, but if the optional argument PERIOD is non-nil, the period
+is included in the value, and in that case, if FILENAME has no
+extension, the value is \"\"."
(save-match-data
(let ((file (file-name-sans-versions (file-name-nondirectory filename))))
(if (and (string-match "\\.[^.]*\\'" file)
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 10a8b6e219c..21ff5cb2cb8 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -75,11 +75,24 @@ introduced in Emacs 22."
'cancel-timer
'delete-itimer))
-;; Emacs 24 renamed flet to cl-flet.
-(defalias 'mh-cl-flet
- (if (fboundp 'cl-flet)
- 'cl-flet
- 'flet))
+;; Emacs 24 made flet obsolete and suggested either cl-flet or
+;; cl-letf. This macro is based upon gmm-flet from Gnus.
+(defmacro mh-flet (bindings &rest body)
+ "Make temporary overriding function definitions.
+This is an analogue of a dynamically scoped `let' that operates on
+the function cell of FUNCs rather than their value cell.
+
+\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
+ (if (fboundp 'cl-letf)
+ `(cl-letf ,(mapcar (lambda (binding)
+ `((symbol-function ',(car binding))
+ (lambda ,@(cdr binding))))
+ bindings)
+ ,@body)
+ `(flet ,bindings ,@body)))
+(put 'mh-flet 'lisp-indent-function 1)
+(put 'mh-flet 'edebug-form-spec
+ '((&rest (sexp sexp &rest form)) &rest form))
(defun mh-display-color-cells (&optional display)
"Return the number of color cells supported by DISPLAY.
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index df3a42ec0f7..b8d700ddf5f 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -268,7 +268,7 @@ usually reads the file \"/etc/mailcap\"."
(buffer-read-only nil))
(when (string-match "^[^% \t]+$" method)
(setq method (concat method " %s")))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle function)
(mh-handle-set-external-undisplayer folder handle function)))
@@ -525,7 +525,7 @@ parsed and then displayed."
(let ((handles ())
(folder mh-show-folder-buffer)
(raw-message-data (buffer-string)))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle function)
(mh-handle-set-external-undisplayer folder handle function)))
@@ -1049,7 +1049,7 @@ attachment, the attachment is hidden."
(function (get-text-property (point) 'mh-callback))
(buffer-read-only nil)
(folder mh-show-folder-buffer))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle function)
(mh-handle-set-external-undisplayer folder handle function)))
@@ -1070,7 +1070,7 @@ to click the MIME button."
(mm-inline-media-tests mh-mm-inline-media-tests)
(data (get-text-property (point) 'mh-data))
(function (get-text-property (point) 'mh-callback)))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle func)
(mh-handle-set-external-undisplayer folder handle func)))
@@ -1166,7 +1166,7 @@ this ;-)"
(defun mh-display-emphasis ()
"Display graphical emphasis."
(when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p))
- (mh-cl-flet
+ (mh-flet
((article-goto-body ())) ; shadow this function to do nothing
(save-excursion
(goto-char (point-min))
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index afe9812eea8..26e821696a8 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -900,7 +900,7 @@ See also `mh-folder-mode'.
(interactive)
;; Don't allow Gnus to create buttons while highlighting, maybe this is bad
;; style?
- (mh-cl-flet
+ (mh-flet
((gnus-article-add-button (&rest args) nil))
(let* ((modified (buffer-modified-p))
(gnus-article-buffer (buffer-name))
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index 5135e7e88fa..e6acdba8b30 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -647,7 +647,7 @@ Only information about messages in MSG-LIST are added to the tree."
(defun mh-thread-set-tables (folder)
"Use the tables of FOLDER in current buffer."
- (mh-cl-flet
+ (mh-flet
((mh-get-table (symbol)
(with-current-buffer folder
(symbol-value symbol))))
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2ad22ddd0ff..f3607911aa1 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1566,7 +1566,8 @@ In the absence of INDEX, just call `eldoc-docstring-format-sym-doc'."
ARGLIST is either a string, or a list of strings or symbols."
(let ((str (cond ((stringp arglist) arglist)
((not (listp arglist)) nil)
- (t (help--make-usage-docstring 'toto arglist)))))
+ (t (substitute-command-keys
+ (help--make-usage-docstring 'toto arglist))))))
(if (and str (string-match "\\`([^ )]+ ?" str))
(replace-match "(" t t str)
str)))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 3321f2fe101..dc9489752fb 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1186,6 +1186,9 @@ IGNORE other arguments."
:format "%[%t\n%]"
:help-echo ,(concat "Open " (cdr menu-element))
:action recentf-open-files-action
+ ;; Override the (problematic) follow-link property of the
+ ;; `link' widget (bug#22434).
+ :follow-link nil
,(cdr menu-element))))
(defun recentf-open-files-items (files)
diff --git a/lisp/subr.el b/lisp/subr.el
index 6e679e70f7e..b66ff288b7a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -486,13 +486,16 @@ of course, also replace TO with a slightly larger value
(list from)
(or inc (setq inc 1))
(when (zerop inc) (error "The increment can not be zero"))
- (let (seq (n 0) (next from))
+ (let (seq (n 0) (next from) (last from))
(if (> inc 0)
- (while (<= next to)
+ ;; The (>= next last) condition protects against integer
+ ;; overflow in computing NEXT.
+ (while (and (>= next last) (<= next to))
(setq seq (cons next seq)
n (1+ n)
+ last next
next (+ from (* n inc))))
- (while (>= next to)
+ (while (and (<= next last) (>= next to))
(setq seq (cons next seq)
n (1+ n)
next (+ from (* n inc)))))