commit a8732cb07aa3d707fd1a5271b1d6645ca3c84c3c (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Fri May 12 03:19:11 2023 +0000 Don't set background_filled_p * src/haikufont.c (haikufont_draw): Don't set `background_filled_p' when filling the background. 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); commit 96c43d398a960361308cec536f3519ad5a74c61c Author: Paul Eggert Date: Thu May 11 19:48:18 2023 -0700 Simplify soap-decode-data-time use of encode-time * lisp/net/soap-client.el (soap-decode-date-time): Call encode-time directly instead of via ‘apply’. No need for the two nil args. 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 @@ soap-decode-date-time 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)))))) commit 30501083f2ff24ee1291a68e83c65b89c644f44b Author: Thomas Fitzsimmons Date: Thu May 11 17:28:30 2023 -0400 soap-client.el: Bump version to 3.2.2 * lisp/net/soap-client.el: Bump version to 3.2.2. diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 90d9725f0a7..866b33decc6 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.1 +;; Version: 3.2.2 ;; Keywords: soap, web-services, comm, hypermedia ;; Package: soap-client ;; URL: https://github.com/alex-hhh/emacs-soap-client commit e6dd77595548cd71364080310e8a9d3713ec0934 Author: Thomas Fitzsimmons Date: Thu May 11 06:01:32 2023 -0400 soap-client.el: Revert dd0727e1ec1f, add compatibility comment * lisp/net/soap-client.el (soap-decode-date-time): Call encode-time using apply, for GNU ELPA backward compatibility. Remove some tabs. (soap-type-is-array?): Reword docstring to accommodate checkdoc. diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index e4b8bbd9cb5..90d9725f0a7 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -717,9 +717,12 @@ soap-decode-date-time second) minute hour day month year second-fraction datatype time-zone) (let ((time - (encode-time (list - (if new-decode-time new-decode-time-second second) - minute hour day month year nil nil time-zone)))) + ;; 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)))) (if new-decode-time (with-no-warnings (decode-time time nil t)) (decode-time time)))))) @@ -946,7 +949,7 @@ soap-should-encode-value-for-xs-element (t nil))) (defun soap-type-is-array? (type) - "Return t if TYPE defines an ARRAY." + "Return t if TYPE is an ARRAY." (and (soap-xs-complex-type-p type) (eq (soap-xs-complex-type-indicator type) 'array))) commit 1c60b0639b121d20eb245ff60c39d120396aa5bf Author: Eli Zaretskii Date: Thu May 11 19:06:18 2023 +0300 ; * lisp/files.el (Safe File Variables): Remove redundant text. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 80490effb6c..d8abf81c75f 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1364,18 +1364,6 @@ Safe File Variables the list can include remote directories as well (@pxref{Remote Files}). -When @kbd{+} is pressed -at the risky variable confirmation prompt, the directory in question -is added to the @samp{safe-local-variable-directories} variable, and -risky directory-local variables there will be loaded without prompting -in the future. If customizing @samp{safe-local-variable-directories} -manually, the directories in this list must be fully-expanded absolute -paths that end in a directory separator character. Directory paths -may be remote directory paths (@pxref{Remote Files}), if the -@code{enable-remote-dir-locals} variable is set to @code{t}. -Directory paths in this list are case-sensitive, even if the -filesystem is not. - @vindex enable-local-variables The variable @code{enable-local-variables} allows you to change the way Emacs processes local variables. Its default value is @code{t}, commit 1eda3d9dc5c1f883b6bdefe1a6072d3c9e2224e7 Author: Eli Zaretskii Date: Thu May 11 16:52:50 2023 +0300 ; Fix last change * lisp/files.el (safe-local-variable-directories): * doc/lispref/variables.texi (File Local Variables): * doc/emacs/custom.texi (Safe File Variables): Fix wording of documentation in last change. (Bug#61901) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 2ddd39be31f..80490effb6c 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1328,12 +1328,14 @@ Safe File Variables these pairs will thereafter be ignored in this file and in all other files. - For directory-local variable/value pairs -(@pxref{Directory Variables}), typing @kbd{+} at the confirmation -prompt will set all the variable/value pairs, and recognize all -variables in that directory as safe in the future. This option should -only be used for directories whose contents you trust. The @kbd{+} -confirmation prompt option is not available for file-local variables. + When Emacs asks for confirmation for setting directory-local +variables (@pxref{Directory Variables}), typing @kbd{+} at the +confirmation prompt will set all the variables, and also add the +directory to the list in @code{safe-local-variable-directories} +(described below), which will cause Emacs to consider this directory +as safe for loading any directory-local variables in the future. The +@kbd{+} response should only be used for directories whose contents +you trust. @vindex safe-local-variable-values @vindex ignored-local-variable-values @@ -1352,13 +1354,21 @@ Safe File Variables be permanently ignored, customize @code{ignored-local-variable-values}. @vindex safe-local-variable-directories - Sometimes it is helpful to always trust risky variables in a certain -directory, and skip the confirmation prompt when directory-local -variables are loaded there. When @kbd{+} is pressed at the risky -variable confirmation prompt, the directory in question is added to -the @samp{safe-local-variable-directories} variable, and risky -directory-local variables there will be loaded without prompting in -the future. If customizing @samp{safe-local-variable-directories} + Sometimes it is helpful to always trust directory-variables in +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}). + +When @kbd{+} is pressed +at the risky variable confirmation prompt, the directory in question +is added to the @samp{safe-local-variable-directories} variable, and +risky directory-local variables there will be loaded without prompting +in the future. If customizing @samp{safe-local-variable-directories} manually, the directories in this list must be fully-expanded absolute paths that end in a directory separator character. Directory paths may be remote directory paths (@pxref{Remote Files}), if the diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 52a94db3703..b3a8cd8110c 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1982,11 +1982,11 @@ File Local Variables 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 paths that end in a directory separator -character. They may also be remote directory paths if the -@code{enable-remote-dir-locals} variable is set to @code{t}. -Directory paths in this list are case-sensitive, even if the -filesystem is not. +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. @end defvar @defun hack-local-variables &optional handle-mode diff --git a/lisp/files.el b/lisp/files.el index aa01e638c98..35d794f6dcf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3700,7 +3700,10 @@ permanently-enabled-local-variables (defcustom safe-local-variable-directories '() "A list of directories where local variables are always enabled. Directory-local variables loaded from these directories, such as the -variables in .dir-locals.el, will be enabled even if they are risky." +variables in .dir-locals.el, will be enabled even if they are risky. +The names of the directories in the list must be absolute, and must +end in a slash. Remote directories can be included if the +variable `enable-remote-dir-locals' is non-nil." :version "30.1" :type '(repeat string) :risky t commit f24ea84f430d5ae6fd3fa5373610551f62ce25be Author: Antero Mejr Date: Tue May 9 20:51:14 2023 +0000 Add safe-local-variable-directories variable. This variable can be set to automatically load risky dir-local variables from a list of trusted directories. * lisp/emacs-lisp/files.el (safe-local-variable-directories, hack-local-variables-filter, hack-local-variables-confirm): New variable and associated logic. * test/lisp/files-tests.el (files-tests-safe-local-variable-directories): Add tests for same. * doc/emacs/custom.texi (Safe File Variables): Add documentation for same. * doc/lispref/variables.texi (File Local Variables): Add documentation for same. * etc/NEWS (Lisp Changes in Emacs 30.1): Add news entry for same. (Bug#61901) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 87290734cc9..2ddd39be31f 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1328,6 +1328,13 @@ Safe File Variables these pairs will thereafter be ignored in this file and in all other files. + For directory-local variable/value pairs +(@pxref{Directory Variables}), typing @kbd{+} at the confirmation +prompt will set all the variable/value pairs, and recognize all +variables in that directory as safe in the future. This option should +only be used for directories whose contents you trust. The @kbd{+} +confirmation prompt option is not available for file-local variables. + @vindex safe-local-variable-values @vindex ignored-local-variable-values @cindex risky variable @@ -1344,6 +1351,21 @@ Safe File Variables Similarly, if you want to record values of risky variables that should be permanently ignored, customize @code{ignored-local-variable-values}. +@vindex safe-local-variable-directories + Sometimes it is helpful to always trust risky variables in a certain +directory, and skip the confirmation prompt when directory-local +variables are loaded there. When @kbd{+} is pressed at the risky +variable confirmation prompt, the directory in question is added to +the @samp{safe-local-variable-directories} variable, and risky +directory-local variables there will be loaded without prompting in +the future. If customizing @samp{safe-local-variable-directories} +manually, the directories in this list must be fully-expanded absolute +paths that end in a directory separator character. Directory paths +may be remote directory paths (@pxref{Remote Files}), if the +@code{enable-remote-dir-locals} variable is set to @code{t}. +Directory paths in this list are case-sensitive, even if the +filesystem is not. + @vindex enable-local-variables The variable @code{enable-local-variables} allows you to change the way Emacs processes local variables. Its default value is @code{t}, diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index eadb5c36de6..52a94db3703 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1977,6 +1977,18 @@ File Local Variables symbols. @end defvar +@defvar safe-local-variable-directories +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 paths that end in a directory separator +character. They may also be remote directory paths if the +@code{enable-remote-dir-locals} variable is set to @code{t}. +Directory paths in this list are case-sensitive, even if the +filesystem is not. +@end defvar + @defun hack-local-variables &optional handle-mode This function parses, and binds or evaluates as appropriate, any local variables specified by the contents of the current buffer. The variable diff --git a/etc/NEWS b/etc/NEWS index 3c71e52fff4..3bef9d2ed2a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -380,6 +380,11 @@ hooks named after the feature name, like 'esh-mode-unload-hook'. * Lisp Changes in Emacs 30.1 ++++ +** New variable 'safe-local-variable-directories'. +This variable names directories in which Emacs will treat all +directory-local variables as safe. + ** New variable 'inhibit-auto-fill' to temporarily prevent auto-fill. ** Functions and variables to transpose sexps diff --git a/lisp/files.el b/lisp/files.el index c6f53e5eaf8..aa01e638c98 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -681,7 +681,8 @@ enable-local-variables always obeys file local variable specifications and the -*- line, and ignores this variable. -Also see the `permanently-enabled-local-variables' variable." +Also see the `permanently-enabled-local-variables' and +`safe-local-variable-directories' variables." :risky t :type '(choice (const :tag "Query Unsafe" t) (const :tag "Safe Only" :safe) @@ -3696,6 +3697,15 @@ permanently-enabled-local-variables "A list of file-local variables that are always enabled. This overrides any `enable-local-variables' setting.") +(defcustom safe-local-variable-directories '() + "A list of directories where local variables are always enabled. +Directory-local variables loaded from these directories, such as the +variables in .dir-locals.el, will be enabled even if they are risky." + :version "30.1" + :type '(repeat string) + :risky t + :group 'find-file) + (defun hack-local-variables-confirm (all-vars unsafe-vars risky-vars dir-name) "Get confirmation before setting up local variable values. ALL-VARS is the list of all variables to be set up. @@ -3734,7 +3744,11 @@ hack-local-variables-confirm ! -- to apply the local variables list, and permanently mark these values (*) as safe (in the future, they will be set automatically.) i -- to ignore the local variables list, and permanently mark these - values (*) as ignored\n\n") + values (*) as ignored" + (if dir-name " ++ -- to apply the local variables list, and trust all directory-local + variables in this directory\n\n" + "\n\n")) (insert "\n\n")) (dolist (elt all-vars) (cond ((member elt unsafe-vars) @@ -3758,7 +3772,11 @@ hack-local-variables-confirm (pop-to-buffer buf '(display-buffer--maybe-at-bottom)) (let* ((exit-chars '(?y ?n ?\s)) (prompt (format "Please type %s%s: " - (if offer-save "y, n, ! or i" "y or n") + (if offer-save + (if dir-name + "y, n, !, i, +" + "y, n, !, i") + "y or n") (if (< (line-number-at-pos (point-max)) (window-body-height)) "" @@ -3766,8 +3784,13 @@ hack-local-variables-confirm char) (when offer-save (push ?i exit-chars) - (push ?! exit-chars)) + (push ?! exit-chars) + (when dir-name + (push ?+ exit-chars))) (setq char (read-char-choice prompt exit-chars)) + (when (and offer-save dir-name (= char ?+)) + (customize-push-and-save 'safe-local-variable-directories + (list dir-name))) (when (and offer-save (or (= char ?!) (= char ?i)) unsafe-vars) @@ -3776,7 +3799,7 @@ hack-local-variables-confirm 'safe-local-variable-values 'ignored-local-variable-values) unsafe-vars)) - (prog1 (memq char '(?! ?\s ?y)) + (prog1 (memq char '(?! ?\s ?y ?+)) (quit-window t))))))) (defconst hack-local-variable-regexp @@ -3908,6 +3931,7 @@ hack-local-variables-filter (null unsafe-vars) (null risky-vars)) (memq enable-local-variables '(:all :safe)) + (member dir-name safe-local-variable-directories) (hack-local-variables-confirm all-vars unsafe-vars risky-vars dir-name)) (dolist (elt all-vars) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index aadb60e1de7..e87bb3cfa0a 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -166,6 +166,27 @@ files-tests-permanent-local-variables (hack-local-variables) (should (eq lexical-binding nil))))) +(ert-deftest files-tests-safe-local-variable-directories () + ;; 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/") + (enable-local-eval t)) + (with-temp-buffer + (setq safe-local-variable-directories (list fakedir)) + (hack-local-variables-filter test-alist fakedir) + (should (equal file-local-variables-alist test-alist))) + (with-temp-buffer + (setq safe-local-variable-directories (list fakedir)) + (setq noninteractive t) + (hack-local-variables-filter test-alist "wrong") + (should-not (equal file-local-variables-alist test-alist))) + (with-temp-buffer + (setq safe-local-variable-directories '()) + (setq noninteractive t) + (hack-local-variables-filter test-alist fakedir) + (should-not (equal file-local-variables-alist test-alist))))) + (defvar files-test-bug-18141-file (ert-resource-file "files-bug18141.el.gz") "Test file for bug#18141.") commit 44c2befb4a36391f17ee8f3539dee7be62df89f0 Author: Eli Zaretskii Date: Thu May 11 16:25:46 2023 +0300 ; Fix byte-compilation warnings in --without-x build * lisp/x-dnd.el (mwheel): * lisp/term/haiku-win.el (mwheel): Require. * lisp/progmodes/prog-mode.el (treesit-node-at): * lisp/dynamic-setting.el (reconsider-frame-font): Declare. (Bug#63415) diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el index 9ce09657345..ebe25ab9c75 100644 --- a/lisp/dynamic-setting.el +++ b/lisp/dynamic-setting.el @@ -33,6 +33,7 @@ ;;; Customizable variables (declare-function font-get-system-font "xsettings.c" ()) +(declare-function reconsider-frame-font "frame.c" ()) (defvar font-use-system-font) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 04071703184..a434c7e9058 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -36,6 +36,7 @@ (declare-function treesit-available-p "treesit.c") (declare-function treesit-parser-list "treesit.c") (declare-function treesit-node-type "treesit.c") +(declare-function treesit-node-at "treesit.c") (defgroup prog-mode nil "Generic programming mode, from which others derive." diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el index ae5a2f2fc6b..50c9cb5b9d4 100644 --- a/lisp/term/haiku-win.el +++ b/lisp/term/haiku-win.el @@ -36,6 +36,9 @@ (require 'menu-bar) (require 'fontset) (require 'dnd) +;; For when building a --without-x configuration, where this is not +;; preloaded. +(eval-when-compile (require 'mwheel)) (add-to-list 'display-format-alist '(".*" . haiku)) diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index acfbbed9677..b87fc97f8fd 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -31,6 +31,9 @@ ;;; Code: (require 'dnd) +;; For when building a --without-x configuration, where this is not +;; preloaded. +(eval-when-compile (require 'mwheel)) ;;; Customizable variables (defcustom x-dnd-test-function #'x-dnd-default-test-function commit 1174e8ba4d7196a770214721e5973a037684a130 Author: Mattias Engdegård Date: Thu May 11 11:49:06 2023 +0200 More descriptive character escape syntax error messages (bug#63436) * src/lread.c (invalid_escape_syntax_error): Remove. (read_char_escape): Make certain messages more specific than just "Invalid escape character syntax" to help finding and understanding the error. diff --git a/src/lread.c b/src/lread.c index 273120315df..67cd7185d04 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2639,12 +2639,6 @@ character_name_to_code (char const *name, ptrdiff_t name_len, Unicode 9.0.0 the maximum is 83, so this should be safe. */ enum { UNICODE_CHARACTER_NAME_LENGTH_BOUND = 200 }; -static AVOID -invalid_escape_syntax_error (void) -{ - error ("Invalid escape character syntax"); -} - /* Read a character escape sequence, assuming we just read a backslash and one more character (next_char). */ static int @@ -2676,7 +2670,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char) case '\n': /* ?\LF is an error; it's probably a user mistake. */ - error ("Invalid escape character syntax"); + error ("Invalid escape char syntax: \\"); /* \M-x etc: set modifier bit and parse the char to which it applies, allowing for chains such as \M-\S-\A-\H-\s-\C-q. */ @@ -2700,7 +2694,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char) } else /* \M, \S, \H, \A not followed by a hyphen is an error. */ - invalid_escape_syntax_error (); + error ("Invalid escape char syntax: \\%c not followed by -", c); } modifiers |= mod; c1 = READCHAR; @@ -2720,7 +2714,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char) { int c1 = READCHAR; if (c1 != '-') - invalid_escape_syntax_error (); + error ("Invalid escape char syntax: \\%c not followed by -", c); } FALLTHROUGH; /* The prefixes \C- and \^ are equivalent. */ @@ -2785,7 +2779,7 @@ read_char_escape (Lisp_Object readcharfun, int next_char) } if (count == 0) - invalid_escape_syntax_error (); + error ("Invalid escape char syntax: \\x not followed by hex digit"); if (count < 3 && i >= 0x80) i = BYTE8_TO_CHAR (i); modifiers |= i & CHAR_MODIFIER_MASK;