From 96c43d398a960361308cec536f3519ad5a74c61c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 11 May 2023 19:48:18 -0700 Subject: [PATCH 1/7] Simplify soap-decode-data-time use of encode-time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/net/soap-client.el (soap-decode-date-time): Call encode-time directly instead of via ‘apply’. No need for the two nil args. --- lisp/net/soap-client.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 866b33decc6..2991d29f870 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -717,12 +717,9 @@ representing leap seconds." second) minute hour day month year second-fraction datatype time-zone) (let ((time - ;; Continue calling encode-time the old way, for backward - ;; compatibility in GNU ELPA. - (apply - #'encode-time (list - (if new-decode-time new-decode-time-second second) - minute hour day month year nil nil time-zone)))) + ;; Call encode-time the old way, for Emacs<27. + (encode-time (if new-decode-time new-decode-time-second second) + minute hour day month year time-zone))) (if new-decode-time (with-no-warnings (decode-time time nil t)) (decode-time time)))))) From a8732cb07aa3d707fd1a5271b1d6645ca3c84c3c Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 12 May 2023 03:19:11 +0000 Subject: [PATCH 2/7] Don't set background_filled_p * src/haikufont.c (haikufont_draw): Don't set `background_filled_p' when filling the background. --- src/haikufont.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/haikufont.c b/src/haikufont.c index b4c2e547247..b6a9cb34c4d 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -1127,7 +1127,6 @@ haikufont_draw (struct glyph_string *s, int from, int to, haiku_draw_background_rect (s, s->face, x, y - ascent, s->width, height); - s->background_filled_p = 1; } BView_SetHighColor (view, foreground); From 6234c3e0411a1d70bed2c85bbfb438d4479be51b Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Fri, 12 May 2023 05:10:50 -0400 Subject: [PATCH 3/7] soap-client.el: Bump version to 3.2.3 * lisp/net/soap-client.el: Bump version to 3.2.3. --- lisp/net/soap-client.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 2991d29f870..010e86354b6 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -5,7 +5,7 @@ ;; Author: Alexandru Harsanyi ;; Author: Thomas Fitzsimmons ;; Created: December, 2009 -;; Version: 3.2.2 +;; Version: 3.2.3 ;; Keywords: soap, web-services, comm, hypermedia ;; Package: soap-client ;; URL: https://github.com/alex-hhh/emacs-soap-client From c9cf673d505b2dd9a666fed50d7f3b2f7dff163f Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 12 May 2023 10:33:15 +0000 Subject: [PATCH 4/7] CC Mode: Fontify function names after long stretches of macros. This fixes bug#63322. * lisp/progmodes/cc-engine.el (c-find-decl-spots): When a search back over syntactic whitespace hits its limit, set cfd-match-pos and cfd-continue-pos to cfd-start-pos. * lisp/progmodes/cc-mode.el (c-fl-decl-start): Remove an unneeded (and harmful) condition on (point)'s position in the main loop. --- lisp/progmodes/cc-engine.el | 21 +++++++++++++++------ lisp/progmodes/cc-mode.el | 2 -- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 8b34daf03c2..d21e082d0b6 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -6244,6 +6244,9 @@ comment at the start of cc-engine.el for more info." ;; prefix". The declaration prefix is the earlier of `cfd-prop-match' and ;; `cfd-re-match'. `cfd-match-pos' is set to the decl prefix. ;; + ;; The variables which this macro should set for `c-find-decl-spots' are + ;; `cfd-match-pos' and `cfd-continue-pos'. + ;; ;; This macro might do hidden buffer changes. '(progn @@ -6586,11 +6589,17 @@ comment at the start of cc-engine.el for more info." ;; and so we can continue the search from this point. If we ;; didn't hit `c-find-decl-syntactic-pos' then we're now in ;; the right spot to begin searching anyway. - (if (and (eq (point) c-find-decl-syntactic-pos) - c-find-decl-match-pos) - (setq cfd-match-pos c-find-decl-match-pos - cfd-continue-pos syntactic-pos) - + (cond + ((and (eq (point) c-find-decl-syntactic-pos) + c-find-decl-match-pos) + (setq cfd-match-pos c-find-decl-match-pos + cfd-continue-pos syntactic-pos)) + ((save-excursion (c-beginning-of-macro)) + ;; The `c-backward-syntactic-ws' ~40 lines up failed to find non + ;; syntactic-ws and hit its limit, leaving us in a macro. + (setq cfd-match-pos cfd-start-pos + cfd-continue-pos cfd-start-pos)) + (t (setq c-find-decl-syntactic-pos syntactic-pos) (when (if (bobp) @@ -6608,7 +6617,7 @@ comment at the start of cc-engine.el for more info." (c-find-decl-prefix-search)) ; sets cfd-continue-pos (setq c-find-decl-match-pos (and (< cfd-match-pos cfd-start-pos) - cfd-match-pos))))) ; end of `cond' + cfd-match-pos)))))) ; end of `cond' ;; Advance `cfd-continue-pos' if it's before the start position. ;; The closest continue position that might have effect at or diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 330202bb5f9..11a1d3fe6c2 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2444,8 +2444,6 @@ with // and /*, not more generic line and block comments." (setq pseudo (c-cheap-inside-bracelist-p (c-parse-state))))))) (goto-char pseudo)) t) - (or (> (point) bod-lim) - (eq bod-lim (point-min))) ;; Move forward to the start of the next declaration. (progn (c-forward-syntactic-ws) ;; Have we got stuck in a comment at EOB? From cbb59267c757b747c48a2690f96073614e8b4fd4 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 12 May 2023 12:45:32 +0200 Subject: [PATCH 5/7] Add trailing space to PROMPT in yes-or-no-p * doc/lispref/minibuf.texi (Yes-or-No Queries): Describe PROMPT massage for y-or-n-p and yes-or-no-p. * lisp/subr.el (y-or-n-p): Adapt docstring. * src/fns.c (Fyes_or_no_p): Add trailing space to PROMPT if needed. (Bug#63399) --- doc/lispref/minibuf.texi | 6 ++++++ lisp/subr.el | 4 +++- src/fns.c | 11 ++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 5d59387fb1f..ff12808762f 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2200,6 +2200,9 @@ the expected answers (@kbd{y}, @kbd{n}, @kbd{@key{SPC}}, @kbd{@key{DEL}}, or something that quits), the function responds @samp{Please answer y or n.}, and repeats the request. +If @var{prompt} is a non-empty string, and it ends with a non-space +character, a @samp{SPC} character will be appended to it. + This function actually uses the minibuffer, but does not allow editing of the answer. The cursor moves to the minibuffer while the question is being asked. @@ -2240,6 +2243,9 @@ minibuffer, followed by the value of @code{yes-or-no-prompt} @w{(default responses; otherwise, the function responds @w{@samp{Please answer yes or no.}}, waits about two seconds and repeats the request. +If @var{prompt} is a non-empty string, and it ends with a non-space +character, a @samp{SPC} character will be appended to it. + @code{yes-or-no-p} requires more work from the user than @code{y-or-n-p} and is appropriate for more crucial decisions. diff --git a/lisp/subr.el b/lisp/subr.el index 0501fc67a3e..a52abb38772 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3590,7 +3590,9 @@ confusing to some users.") Return t if answer is \"y\" and nil if it is \"n\". PROMPT is the string to display to ask the question; `y-or-n-p' -adds \"(y or n) \" to it. +adds \"(y or n) \" to it. If PROMPT is a non-empty string, and +it ends with a non-space character, a space character will be +appended to it. If you bind the variable `help-form' to a non-nil value while calling this function, then pressing `help-char' diff --git a/src/fns.c b/src/fns.c index bb6efdda655..561f526f8d0 100644 --- a/src/fns.c +++ b/src/fns.c @@ -26,6 +26,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include "lisp.h" #include "bignum.h" @@ -3202,7 +3203,9 @@ DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0, Return t if answer is yes, and nil if the answer is no. PROMPT is the string to display to ask the question; `yes-or-no-p' -appends `yes-or-no-prompt' (default \"(yes or no) \") to it. +appends `yes-or-no-prompt' (default \"(yes or no) \") to it. If +PROMPT is a non-empty string, and it ends with a non-space character, +a space character will be appended to it. The user must confirm the answer with RET, and can edit it until it has been confirmed. @@ -3234,6 +3237,12 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) if (use_short_answers) return call1 (intern ("y-or-n-p"), prompt); + { + char *s = SSDATA (prompt); + ptrdiff_t len = strlen (s); + if ((len > 0) && !isspace (s[len - 1])) + prompt = CALLN (Fconcat, prompt, build_string (" ")); + } prompt = CALLN (Fconcat, prompt, Vyes_or_no_prompt); specpdl_ref count = SPECPDL_INDEX (); From 0b39e4daee4383d9e535148a973e0d5701125ada Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Thu, 11 May 2023 19:22:49 +0000 Subject: [PATCH 6/7] Handle case-insensitivity for safe-local-variable-directories. * lisp/emacs-lisp/files.el (hack-local-variables-filter): Use 'file-equal-p' when checking 'safe-local-variable-directories'. * doc/lispref/variables.texi (File Local Variables): Remove sentences in 'safe-local-variable-directories' description about case-sensitivity and trailing slash behaviors. * doc/emacs/custom.texi (Safe File Variables): Remove sentence about 'safe-local-variable-directories' trailing slash behavior. (Bug#61901) --- doc/emacs/custom.texi | 7 +++---- doc/lispref/variables.texi | 8 +++----- lisp/files.el | 5 ++++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index d8abf81c75f..d8221f51425 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1359,10 +1359,9 @@ certain directories, and skip the confirmation prompt when local variables are loaded from those directories, even if the variables are risky. The variable @code{safe-local-variable-directories} holds the list of such directories. The names of the directories in this list -must be full absolute file names, and should end in a slash. If the -variable @code{enable-remote-dir-locals} has a non-@code{nil} value, -the list can include remote directories as well (@pxref{Remote -Files}). +must be full absolute file names. If the variable +@code{enable-remote-dir-locals} has a non-@code{nil} value, the list +can include remote directories as well (@pxref{Remote Files}). @vindex enable-local-variables The variable @code{enable-local-variables} allows you to change the diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index b3a8cd8110c..4eda035473e 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1982,11 +1982,9 @@ This is a list of directories where local variables are always enabled. Directory-local variables loaded from these directories, such as the variables in @file{.dir-locals.el}, will be enabled even if they are risky. The directories in this list must be -fully-expanded absolute file names that end in a directory separator -character. They may also be remote directories if the variable -@code{enable-remote-dir-locals} is set non-@code{nil}. Directories in -this list are matched case-sensitively, even if the filesystem is -case-sensitive. +fully-expanded absolute file names. They may also be remote +directories if the variable @code{enable-remote-dir-locals} is set +non-@code{nil}. @end defvar @defun hack-local-variables &optional handle-mode diff --git a/lisp/files.el b/lisp/files.el index 35d794f6dcf..148f47cbc97 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3934,7 +3934,10 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil." (null unsafe-vars) (null risky-vars)) (memq enable-local-variables '(:all :safe)) - (member dir-name safe-local-variable-directories) + (delq nil (mapcar (lambda (dir) + (and dir-name dir + (file-equal-p dir dir-name))) + safe-local-variable-directories)) (hack-local-variables-confirm all-vars unsafe-vars risky-vars dir-name)) (dolist (elt all-vars) From 3e132b972e30c5b0cb75ed29d8ca5a845434d6fe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 12 May 2023 14:07:36 +0300 Subject: [PATCH 7/7] Fix files-tests broken by a recent change * test/lisp/files-tests.el (files-tests-safe-local-variable-directories): Fix this test: since we are now using 'file-equal-p' the directory used as a safe one should actually exist. (Bug#61901) --- test/lisp/files-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index e87bb3cfa0a..f6c7be88b05 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -170,7 +170,7 @@ form.") ;; safe-local-variable-directories should be risky, ;; so use it as an arbitrary risky variable. (let ((test-alist '((safe-local-variable-directories . "some_val"))) - (fakedir "/test1/test2/") + (fakedir default-directory) (enable-local-eval t)) (with-temp-buffer (setq safe-local-variable-directories (list fakedir))