[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 7b55a3dab6 1/6: Merge from origin/emacs-28
From: |
Stefan Kangas |
Subject: |
master 7b55a3dab6 1/6: Merge from origin/emacs-28 |
Date: |
Thu, 28 Jul 2022 08:57:37 -0400 (EDT) |
branch: master
commit 7b55a3dab66aa25ddb6c89d8d7f3b6c86a097de6
Merge: 0db604a914 23112f89f9
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Merge from origin/emacs-28
23112f89f9 ; Improve documentation of 'file-name-with-extension'
4be938169d Release the desktop lock in 'kill-emacs-hook'
4ea1f6c7f8 ; * doc/lispref/tips.texi (Documentation Tips): Fix typos....
# Conflicts:
# doc/lispref/tips.texi
---
doc/lispref/tips.texi | 4 ++--
lisp/desktop.el | 12 +++++++++---
lisp/files.el | 12 +++++++-----
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index d03698d354..9faf3f33ba 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -712,7 +712,7 @@ two exceptions: write @code{t} and @code{nil} without
surrounding
punctuation. For example:
@example
- CODE can be `lambda', nil, or t.
+CODE can be `lambda', nil, or t.
@end example
Note that when Emacs displays these doc strings, Emacs will usually
@@ -868,7 +868,7 @@ find an alternate phrasing that conveys the meaning.
@item
Try to avoid using abbreviations such as ``e.g.'' (for ``for
example''), ``i.e.'' (for ``that is''), ``no.'' (for ``number''),
-``c.f.'' (for ``in contrast to'') and ``w.r.t.'' (for ``with respect
+``cf.'' (for ``in contrast to'') and ``w.r.t.'' (for ``with respect
to'') as much as possible. It is almost always clearer and easier to
read the expanded version.@footnote{We do use these occasionally, but
try not to overdo it.}
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 850d2a86ef..a0931e053e 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -791,7 +791,10 @@ if different)."
;; ----------------------------------------------------------------------------
(unless noninteractive
- (add-hook 'kill-emacs-query-functions #'desktop-kill))
+ (add-hook 'kill-emacs-query-functions #'desktop-kill)
+ ;; Certain things should be done even if
+ ;; `kill-emacs-query-functions' are not called.
+ (add-hook 'kill-emacs-hook #'desktop--on-kill))
(defun desktop-kill ()
"If `desktop-save-mode' is non-nil, do what `desktop-save' says to do.
@@ -818,12 +821,15 @@ is nil, ask the user where to save the desktop."
(file-error
(unless (yes-or-no-p "Error while saving the desktop. Ignore? ")
(signal (car err) (cdr err))))))
+ (desktop--on-kill)
+ t)
+
+(defun desktop--on-kill ()
;; If we own it, we don't anymore.
(when (eq (emacs-pid) (desktop-owner))
;; Allow exiting Emacs even if we can't delete the desktop file.
(ignore-error 'file-error
- (desktop-release-lock)))
- t)
+ (desktop-release-lock))))
;; ----------------------------------------------------------------------------
(defun desktop-list* (&rest args)
diff --git a/lisp/files.el b/lisp/files.el
index 37ed796a68..bea0c13d25 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5119,14 +5119,16 @@ extension, the value is \"\"."
"")))))
(defun file-name-with-extension (filename extension)
- "Set the EXTENSION of a FILENAME.
+ "Return FILENAME modified to have the specified EXTENSION.
The extension (in a file name) is the part that begins with the last \".\".
+This function removes any existing extension from FILENAME, and then
+appends EXTENSION to it.
-Trims a leading dot from the EXTENSION so that either \"foo\" or
-\".foo\" can be given.
+EXTENSION may include the leading dot; if it doesn't, this function
+will provide it.
-Errors if the FILENAME or EXTENSION are empty, or if the given
-FILENAME has the format of a directory.
+It is an error if FILENAME or EXTENSION is empty, or if FILENAME
+is in the form of a directory name according to `directory-name-p'.
See also `file-name-sans-extension'."
(let ((extn (string-trim-left extension "[.]")))
- master updated (0db604a914 -> 1ec70ef3df), Stefan Kangas, 2022/07/28
- master cf252ef4db 5/6: Merge from origin/emacs-28, Stefan Kangas, 2022/07/28
- master 7b55a3dab6 1/6: Merge from origin/emacs-28,
Stefan Kangas <=
- master eeb51e3db7 4/6: ; Merge from origin/emacs-28, Stefan Kangas, 2022/07/28
- master 5f6f1c0754 2/6: ; Merge from origin/emacs-28, Stefan Kangas, 2022/07/28
- master 1ec70ef3df 6/6: ; Merge from origin/emacs-28, Stefan Kangas, 2022/07/28
- master 224f7564c6 3/6: Merge from origin/emacs-28, Stefan Kangas, 2022/07/28