commit 804f5acda4bd947f058c6843e373797202314467 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri Apr 23 09:25:35 2021 +0300 Revert "Remove the binding for xref-quit-and-goto-xref" This reverts commit 522c34f0e80f60969861b0dc34bc7105249f9994. Making changes to which there was an explicit disagreement and a long discussion is unacceptable. (Bug#44611) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 32f5cb9a43..dfe4eb0ea3 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2242,9 +2242,10 @@ display it in the other window (@code{xref-prev-group}). Display the reference on the current line in the other window (@code{xref-show-location-at-point}). -@kindex C-u RET -To bury the @file{*xref*} buffer before displaying the reference, call -@code{xref-goto-xref} with a prefix argument: @kbd{C-u RET}. +@item @key{TAB} +@findex xref-quit-and-goto-xref +Display the reference on the current line and bury the @file{*xref*} +buffer (@code{xref-quit-and-goto-xref}). @item r @var{pattern} @key{RET} @var{replacement} @key{RET} Perform interactive query-replace on references that match diff --git a/etc/NEWS b/etc/NEWS index 34aeaf028b..61904767b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1644,19 +1644,11 @@ in 'project-list-file'. ** xref -+++ +--- *** Prefix arg of 'xref-goto-xref' quits the "*xref*" buffer. So typing 'C-u RET' in the "*xref*" buffer quits its window before navigating to the selected location. -+++ -*** The TAB binding in *xref* buffers has been removed. Use 'C-u RET' instead. -To restore the old binding, say something like: - - (require 'xref) - (define-key xref--xref-buffer-mode-map - (kbd "TAB") #'xref-quit-and-goto-xref) - *** New user options 'xref-search-program' and 'xref-search-program-alist'. So far 'grep' and 'ripgrep' are supported. 'ripgrep' seems to offer better performance in certain cases, in particular for case-insensitive diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 1e52318ba7..63d25de50a 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -817,6 +817,7 @@ ITEMS is an xref item which " (define-key map (kbd "P") #'xref-prev-group) (define-key map (kbd "r") #'xref-query-replace-in-results) (define-key map (kbd "RET") #'xref-goto-xref) + (define-key map (kbd "TAB") #'xref-quit-and-goto-xref) (define-key map (kbd "C-o") #'xref-show-location-at-point) ;; suggested by Johan Claesson "to further reduce finger movement": (define-key map (kbd ".") #'xref-next-line) commit 08fab316a1be8388a1a4bca05e9c8d04517aa51c Author: Dmitry Gutov Date: Fri Apr 23 03:24:06 2021 +0300 Misc changes * lisp/progmodes/project.el (project-shell, project-eshell): Simplify. (project-switch-commands, project-switch-use-entire-map): Add :group keywords (to fix misattribution to project-vc). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 35ce5eb2d1..5996a76488 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -920,8 +920,7 @@ if one already exists." (let* ((default-directory (project-root (project-current t))) (default-project-shell-name (concat "*" (file-name-nondirectory - (directory-file-name - (file-name-directory default-directory))) + (directory-file-name default-directory)) "-shell*")) (shell-buffer (get-buffer default-project-shell-name))) (if (and shell-buffer (not current-prefix-arg)) @@ -940,8 +939,7 @@ if one already exists." (let* ((default-directory (project-root (project-current t))) (eshell-buffer-name (concat "*" (file-name-nondirectory - (directory-file-name - (file-name-directory default-directory))) + (directory-file-name default-directory)) "-eshell*")) (eshell-buffer (get-buffer eshell-buffer-name))) (if (and eshell-buffer (not current-prefix-arg)) @@ -1323,6 +1321,7 @@ to distinguish the menu entries in the dispatch menu. If KEY is absent, COMMAND must be bound in `project-prefix-map', and the key is looked up in that map." :version "28.1" + :group 'project :package-version '(project . "0.6.0") :type '(repeat (list @@ -1339,6 +1338,7 @@ listed in `project-switch-commands' and signal an error when others are invoked. Otherwise, all keys in `project-prefix-map' are legal even if they aren't listed in the dispatch menu." :type 'boolean + :group 'project :version "28.1") (defun project--keymap-prompt () commit 344f769491a84b6d47ee3722054b214167572219 Author: Amin Bandali Date: Thu Apr 22 20:22:38 2021 -0400 Add support for using a TLS client certificate with 'erc-tls' (bug#47788) * lisp/erc/erc-backend.el (erc-session-client-certificate): New buffer-local variable storing the TLS client certificate used for the current connection. (erc-open-network-stream): Use open-network-stream instead of make-network-process, and pass any additional arguments to it. (erc-server-connect): Add an optional client-certificate argument that if present is passed with the :client-certificate keyword as part of the arguments to erc-server-connect-function. * lisp/erc/erc.el (erc-open): Add new optional client-certificate argument, set it as erc-session-client-certificate, and pass it along to erc-server-connect. (erc): Clarify documentation string with respect to the full-name argument. (erc-tls): Add new client-certificate keyword argument and pass it in the direct call to erc-open (instead of going through erc). (erc-open-tls-stream): Pass any additional arguments (such as :client-certificate) to open-network-stream. Also allow overriding :nowait if desired. * doc/misc/erc.texi: Add documentation for erc-tls, including the new :client-certificate argument. * etc/NEWS: Announce the change. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index d635cac5ab..45a753d43e 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -514,15 +514,82 @@ Non-interactively, it takes the following keyword arguments. That is, if called with the following arguments, @var{server} and @var{full-name} will be set to those values, whereas -@code{erc-compute-port}, @code{erc-compute-nick} and -@code{erc-compute-full-name} will be invoked for the values of the other -parameters. +@code{erc-compute-port} and @code{erc-compute-nick} will be invoked +for the values of the other parameters. @example (erc :server "chat.freenode.net" :full-name "Harry S Truman") @end example @end defun +To connect securely over an encrypted TLS connection, use @kbd{M-x +erc-tls}. + +@defun erc-tls +Select connection parameters and run ERC over TLS@. +Non-interactively, it takes the following keyword arguments. + +@itemize @bullet +@item @var{server} +@item @var{port} +@item @var{nick} +@item @var{password} +@item @var{full-name} +@item @var{client-certificate} +@end itemize + +That is, if called with the following arguments, @var{server} and +@var{full-name} will be set to those values, whereas +@code{erc-compute-port} and @code{erc-compute-nick} will be invoked +for the values of the other parameters, and @code{client-certificate} +will be @code{nil}. + +@example +(erc-tls :server "chat.freenode.net" :full-name "Harry S Truman") +@end example + +To use a certificate with @code{erc-tls}, specify the optional +@var{client-certificate} keyword argument, whose value should be as +described in the documentation of @code{open-network-stream}: if +non-@code{nil}, it should either be a list where the first element is +the file name of the private key corresponding to a client certificate +and the second element is the file name of the client certificate +itself to use when connecting over TLS, or @code{t}, which means that +@code{auth-source} will be queried for the private key and the +certificate. Authenticating using a TLS client certificate is also +refered to as ``CertFP'' (Certificate Fingerprint) authentication by +various IRC networks. + +Examples of use: + +@example +(erc-tls :server "chat.freenode.net" :port 6697 + :client-certificate + '("/home/bandali/my-cert.key" + "/home/bandali/my-cert.crt")) +@end example + +@example +(erc-tls :server "chat.freenode.net" :port 6697 + :client-certificate + `(,(expand-file-name "~/cert-freenode.key") + ,(expand-file-name "~/cert-freenode.crt"))) +@end example + +@example +(erc-tls :server "chat.freenode.net" :port 6697 + :client-certificate t) +@end example + +In the case of @code{:client-certificate t}, you will need to add a +line like the following to your authinfo file +(e.g. @file{~/.authinfo.gpg}): + +@example +machine chat.freenode.net key /home/bandali/my-cert.key cert /home/bandali/my-cert.crt +@end example +@end defun + @subheading Server @defun erc-compute-server &optional server diff --git a/etc/NEWS b/etc/NEWS index 6fe4e98a50..34aeaf028b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1746,6 +1746,42 @@ type for highlighting the entire message but not the sender's nick. The 'erc-status-sidebar' package which provides a HexChat-like activity overview sidebar for joined IRC channels is now part of ERC. ++++ +*** erc-tls now supports specifying a TLS client certificate. +The 'erc-tls' function has been updated to allow specifying a TLS +client certificate for authentication, as an alternative to NickServ +password-based authentication. This is referred to as "CertFP" (short +for Certificate Fingerprint) by several IRC networks. + +To use a certificate with 'erc-tls', specify the ':client-certificate' +optional parameter, whose value should be as described in the +documentation of 'open-network-stream': if non-nil, it should either +be a list where the first element is the file name of the private key +corresponding to a client certificate and the second element is the +file name of the client certificate itself to use when connecting over +TLS, or t, which means that 'auth-source' will be queried for the +private key and the certificate. + +Examples of use: + + (erc-tls :server "chat.freenode.net" :port 6697 + :client-certificate + '("/home/bandali/my-cert.key" + "/home/bandali/my-cert.crt")) + + (erc-tls :server "chat.freenode.net" :port 6697 + :client-certificate + `(,(expand-file-name "~/cert-freenode.key") + ,(expand-file-name "~/cert-freenode.crt"))) + + (erc-tls :server "chat.freenode.net" :port 6697 + :client-certificate t) + +In the case of ':client-certificate t', you will need to add a line +like the following to your authinfo file (e.g. "~/.authinfo.gpg"): + + machine chat.freenode.net key /home/bandali/my-cert.key cert /home/bandali/my-cert.crt + ** Battery --- diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index b1f97aea06..67db572701 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -138,6 +138,13 @@ Use `erc-current-nick' to access this.") (defvar-local erc-session-port nil "The port used to connect to.") +(defvar-local erc-session-client-certificate nil + "TLS client certificate used when connecting over TLS. +If non-nil, should either be a list where the first element is +the certificate key file name, and the second element is the +certificate file name itself, or t, which means that +`auth-source' will be queried for the key and the certificate.") + (defvar-local erc-server-announced-name nil "The name the server announced to use.") @@ -505,18 +512,23 @@ The current buffer is given by BUFFER." (memq (process-status erc-server-process) '(run open))))) ;;;; Connecting to a server -(defun erc-open-network-stream (name buffer host service) - "As `open-network-stream', but does non-blocking IO" - (make-network-process :name name :buffer buffer - :host host :service service :nowait t)) +(defun erc-open-network-stream (name buffer host service &rest parameters) + "Like `open-network-stream', but does non-blocking IO." + (let ((p (plist-put parameters :nowait t))) + (open-network-stream name buffer host service p))) -(defun erc-server-connect (server port buffer) +(defun erc-server-connect (server port buffer &optional client-certificate) "Perform the connection and login using the specified SERVER and PORT. -We will store server variables in the buffer given by BUFFER." - (let ((msg (erc-format-message 'connect ?S server ?p port)) process) +We will store server variables in the buffer given by BUFFER. +CLIENT-CERTIFICATE may optionally be used to specify a TLS client +certificate to use for authentication when connecting over +TLS (see `erc-session-client-certificate' for more details)." + (let ((msg (erc-format-message 'connect ?S server ?p port)) process + (args `(,(format "erc-%s-%s" server port) nil ,server ,port))) + (when client-certificate + (setq args `(,@args :client-certificate ,client-certificate))) (message "%s" msg) - (setq process (funcall erc-server-connect-function - (format "erc-%s-%s" server port) nil server port)) + (setq process (apply erc-server-connect-function args)) (unless (processp process) (error "Connection attempt failed")) ;; Misc server variables diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e20aa8057d..43661a2fc4 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -47,8 +47,12 @@ ;; ;; M-x erc RET ;; -;; After you are connected to a server, you can use C-h m or have a look at -;; the ERC menu. +;; or +;; +;; M-x erc-tls RET +;; +;; to connect over TLS (encrypted). Once you are connected to a +;; server, you can use C-h m or have a look at the ERC menu. ;;; Code: @@ -1967,7 +1971,8 @@ removed from the list will be disabled." (switch-to-buffer buffer))))) (defun erc-open (&optional server port nick full-name - connect passwd tgt-list channel process) + connect passwd tgt-list channel process + client-certificate) "Connect to SERVER on PORT as NICK with FULL-NAME. If CONNECT is non-nil, connect to the server. Otherwise assume @@ -1977,6 +1982,13 @@ target CHANNEL. Use PASSWD as user password on the server. If TGT-LIST is non-nil, use it to initialize `erc-default-recipients'. +CLIENT-CERTIFICATE, if non-nil, should either be a list where the +first element is the file name of the private key corresponding +to a client certificate and the second element is the file name +of the client certificate itself to use when connecting over TLS, +or t, which means that `auth-source' will be queried for the +private key and the certificate. + Returns the buffer for the given server or channel." (let ((server-announced-name (when (and (boundp 'erc-session-server) (string= server erc-session-server)) @@ -2059,6 +2071,8 @@ Returns the buffer for the given server or channel." (if (functionp secret) (funcall secret) secret)))) + ;; client certificate (only useful if connecting over TLS) + (setq erc-session-client-certificate client-certificate) ;; debug output buffer (setq erc-dbuf (when erc-log-p @@ -2079,7 +2093,10 @@ Returns the buffer for the given server or channel." (run-hook-with-args 'erc-connect-pre-hook buffer) (when connect - (erc-server-connect erc-session-server erc-session-port buffer)) + (erc-server-connect erc-session-server + erc-session-port + buffer + erc-session-client-certificate)) (erc-update-mode-line) ;; Now display the buffer in a window as per user wishes. @@ -2196,22 +2213,22 @@ parameters SERVER and NICK." "ERC is a powerful, modular, and extensible IRC client. This function is the main entry point for ERC. -It permits you to select connection parameters, and then starts ERC. +It allows selecting connection parameters, and then starts ERC. Non-interactively, it takes the keyword arguments (server (erc-compute-server)) (port (erc-compute-port)) (nick (erc-compute-nick)) password - (full-name (erc-compute-full-name))) + (full-name (erc-compute-full-name)) That is, if called with (erc :server \"chat.freenode.net\" :full-name \"Harry S Truman\") -then the server and full-name will be set to those values, whereas -`erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will -be invoked for the values of the other parameters." +then the server and full-name will be set to those values, +whereas `erc-compute-port' and `erc-compute-nick' will be invoked +for the values of the other parameters." (interactive (erc-select-read-args)) (erc-open server port nick full-name t password)) @@ -2220,21 +2237,66 @@ be invoked for the values of the other parameters." (defalias 'erc-ssl #'erc-tls) ;;;###autoload -(defun erc-tls (&rest r) - "Interactively select TLS connection parameters and run ERC. -Arguments are the same as for `erc'." +(cl-defun erc-tls (&key (server (erc-compute-server)) + (port (erc-compute-port)) + (nick (erc-compute-nick)) + password + (full-name (erc-compute-full-name)) + client-certificate) + "ERC is a powerful, modular, and extensible IRC client. +This function is the main entry point for ERC over TLS. + +It allows selecting connection parameters, and then starts ERC +over TLS. + +Non-interactively, it takes the keyword arguments + (server (erc-compute-server)) + (port (erc-compute-port)) + (nick (erc-compute-nick)) + password + (full-name (erc-compute-full-name)) + client-certificate + +That is, if called with + + (erc-tls :server \"chat.freenode.net\" :full-name \"Harry S Truman\") + +then the server and full-name will be set to those values, +whereas `erc-compute-port' and `erc-compute-nick' will be invoked +for the values of their respective parameters. + +CLIENT-CERTIFICATE, if non-nil, should either be a list where the +first element is the certificate key file name, and the second +element is the certificate file name itself, or t, which means +that `auth-source' will be queried for the key and the +certificate. Authenticating using a TLS client certificate is +also refered to as \"CertFP\" (Certificate Fingerprint) +authentication by various IRC networks. + +Example usage: + + (erc-tls :server \"chat.freenode.net\" :port 6697 + :client-certificate + '(\"/data/bandali/my-cert.key\" + \"/data/bandali/my-cert.crt\"))" (interactive (let ((erc-default-port erc-default-port-tls)) (erc-select-read-args))) (let ((erc-server-connect-function 'erc-open-tls-stream)) - (apply #'erc r))) + (erc-open server port nick full-name t password + nil nil nil client-certificate))) -(defun erc-open-tls-stream (name buffer host port) +(defun erc-open-tls-stream (name buffer host port &rest parameters) "Open an TLS stream to an IRC server. -The process will be given the name NAME, its target buffer will be -BUFFER. HOST and PORT specify the connection target." - (open-network-stream name buffer host port - :nowait t - :type 'tls)) +The process will be given the name NAME, its target buffer will +be BUFFER. HOST and PORT specify the connection target. +PARAMETERS should be a sequence of keywords and values, per +`open-network-stream'." + (let ((p (plist-put parameters :type 'tls)) + args) + (unless (plist-member p :nowait) + (setq p (plist-put p :nowait t))) + (setq args `(,name ,buffer ,host ,port ,@p)) + (apply #'open-network-stream args))) ;;; Displaying error messages commit 1c3a86e7fc220963a1691462dbfa25b37799e287 Author: Ivan Sokolov Date: Fri Apr 23 03:14:44 2021 +0300 Introduce project-compilation-buffer-name-function * lisp/progmodes/project.el (project-compilation-buffer-name-function): New option. (project-compile): Use it. (project-prefixed-buffer-name): New function. Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1023b75e66..35ce5eb2d1 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -994,12 +994,33 @@ loop using the command \\[fileloop-continue]." (defvar compilation-read-command) (declare-function compilation-read-command "compile") +(defun project-prefixed-buffer-name (mode) + (concat "*" + (file-name-nondirectory + (directory-file-name default-directory)) + "-" + (downcase mode) + "*")) + +(defcustom project-compilation-buffer-name-function nil + "Function to compute the name of a project compilation buffer. +If non-nil, it overrides `compilation-buffer-name-function' for +`project-compile'." + :group 'project + :type '(choice (const :tag "Default" nil) + (const :tag "Prefixed with root directory name" + project-prefixed-buffer-name) + (function :tag "Custom function"))) + ;;;###autoload (defun project-compile () "Run `compile' in the project root." (declare (interactive-only compile)) (interactive) - (let ((default-directory (project-root (project-current t)))) + (let ((default-directory (project-root (project-current t))) + (compilation-buffer-name-function + (or project-compilation-buffer-name-function + compilation-buffer-name-function))) (call-interactively #'compile))) (defun project--read-project-buffer () commit 9a15694a450d5a0d4922418585ea5c12f02bde9e Author: Dmitry Gutov Date: Fri Apr 23 00:19:26 2021 +0300 * lisp/progmodes/xref.el: Remove the "still experimental" note. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 5f1c32b212..1e52318ba7 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -24,11 +24,6 @@ ;;; Commentary: -;; NOTE: The xref API is still experimental and can change in major, -;; backward-incompatible ways. Everyone is encouraged to try it, and -;; report to us any problems or use cases we hadn't anticipated, by -;; sending an email to emacs-devel, or `M-x report-emacs-bug'. -;; ;; This file provides a somewhat generic infrastructure for cross ;; referencing commands, in particular "find-definition". ;; commit 522c34f0e80f60969861b0dc34bc7105249f9994 Author: Dmitry Gutov Date: Fri Apr 23 00:18:01 2021 +0300 Remove the binding for xref-quit-and-goto-xref * lisp/progmodes/xref.el (xref--xref-buffer-mode-map): Remove the binding for xref-quit-and-goto-xref (bug#44611). * doc/emacs/maintaining.texi (Xref Commands): Update. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index dfe4eb0ea3..32f5cb9a43 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2242,10 +2242,9 @@ display it in the other window (@code{xref-prev-group}). Display the reference on the current line in the other window (@code{xref-show-location-at-point}). -@item @key{TAB} -@findex xref-quit-and-goto-xref -Display the reference on the current line and bury the @file{*xref*} -buffer (@code{xref-quit-and-goto-xref}). +@kindex C-u RET +To bury the @file{*xref*} buffer before displaying the reference, call +@code{xref-goto-xref} with a prefix argument: @kbd{C-u RET}. @item r @var{pattern} @key{RET} @var{replacement} @key{RET} Perform interactive query-replace on references that match diff --git a/etc/NEWS b/etc/NEWS index e7258f19b4..6fe4e98a50 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1644,11 +1644,19 @@ in 'project-list-file'. ** xref ---- ++++ *** Prefix arg of 'xref-goto-xref' quits the "*xref*" buffer. So typing 'C-u RET' in the "*xref*" buffer quits its window before navigating to the selected location. ++++ +*** The TAB binding in *xref* buffers has been removed. Use 'C-u RET' instead. +To restore the old binding, say something like: + + (require 'xref) + (define-key xref--xref-buffer-mode-map + (kbd "TAB") #'xref-quit-and-goto-xref) + *** New user options 'xref-search-program' and 'xref-search-program-alist'. So far 'grep' and 'ripgrep' are supported. 'ripgrep' seems to offer better performance in certain cases, in particular for case-insensitive diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 5d99915347..5f1c32b212 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -822,7 +822,6 @@ ITEMS is an xref item which " (define-key map (kbd "P") #'xref-prev-group) (define-key map (kbd "r") #'xref-query-replace-in-results) (define-key map (kbd "RET") #'xref-goto-xref) - (define-key map (kbd "TAB") #'xref-quit-and-goto-xref) (define-key map (kbd "C-o") #'xref-show-location-at-point) ;; suggested by Johan Claesson "to further reduce finger movement": (define-key map (kbd ".") #'xref-next-line) commit 9904aaebf7cf04fe8544417158250575a4be9d18 Author: Eli Zaretskii Date: Thu Apr 22 22:11:08 2021 +0300 ; * configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Fix last change. diff --git a/configure.ac b/configure.ac index 7179fbe415..a1629d73ab 100644 --- a/configure.ac +++ b/configure.ac @@ -5562,7 +5562,10 @@ case "$opsys" in esac ## If they want unexec, disable Windows ASLR for the Emacs binary if test "$with_dumping" = "unexec"; then - LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -Wl,-disable-dynamicbase -Wl,-disable-high-entropy-va -Wl,-default-image-base-low" + case "$canonical" in + x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -Wl,-disable-dynamicbase -Wl,-disable-high-entropy-va -Wl,-default-image-base-low" ;; + *) LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -Wl,-disable-dynamicbase" ;; + esac fi ;; commit ac6b62bdbf01dba8e7f3e075c6672625c71ac746 Author: Stefan Kangas Date: Thu Apr 22 20:34:37 2021 +0200 * lisp/time.el (world-clock-mode): Make non-interactive. diff --git a/lisp/time.el b/lisp/time.el index 5abc6e948b..fd53f634c6 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -534,6 +534,7 @@ If the value is t instead of an alist, use the value of (define-derived-mode world-clock-mode special-mode "World clock" "Major mode for buffer that displays times in various time zones. See `world-clock'." + :interactive nil (setq-local revert-buffer-function #'world-clock-update) (setq show-trailing-whitespace nil)) commit e860430edc35642bb4aebe919a5231e4d5182d54 Author: Stefan Kangas Date: Thu Apr 22 20:27:18 2021 +0200 Minor improvements to world-clock * lisp/time.el (world-clock-mode-map): New variable. Bind 'n' and 'p' to 'next-line' and 'previous-line'. (world-clock-update): Preserve point. diff --git a/lisp/time.el b/lisp/time.el index 7e1d9180f6..5abc6e948b 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -525,6 +525,12 @@ If the value is t instead of an alist, use the value of '((t :inherit font-lock-variable-name-face)) "Face for time zone label in `world-clock' buffer.") +(defvar world-clock-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "n" #'next-line) + (define-key map "p" #'previous-line) + map)) + (define-derived-mode world-clock-mode special-mode "World clock" "Major mode for buffer that displays times in various time zones. See `world-clock'." @@ -591,7 +597,9 @@ To turn off the world time display, go to the window and type `\\[quit-window]'. "Update the `world-clock' buffer." (if (get-buffer world-clock-buffer-name) (with-current-buffer (get-buffer world-clock-buffer-name) - (world-clock-display (time--display-world-list))) + (let ((op (point))) + (world-clock-display (time--display-world-list)) + (goto-char op))) (world-clock-cancel-timer))) ;;;###autoload commit 61828e55a823640870637c471bc7d62ed1e001a6 Author: Eli Zaretskii Date: Thu Apr 22 20:23:23 2021 +0300 Fix MS-Windows link switches for unexec * configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Disable ASLR when linking for unexec. Reported by Nikolay Kudryavtsev . diff --git a/configure.ac b/configure.ac index d3647bdc2a..7179fbe415 100644 --- a/configure.ac +++ b/configure.ac @@ -5560,6 +5560,10 @@ case "$opsys" in x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x400000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; esac + ## If they want unexec, disable Windows ASLR for the Emacs binary + if test "$with_dumping" = "unexec"; then + LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -Wl,-disable-dynamicbase -Wl,-disable-high-entropy-va -Wl,-default-image-base-low" + fi ;; *) LD_SWITCH_SYSTEM_TEMACS= ;; commit 3e41eccc27586fd9e24369a2c82db483a97ad9eb Author: Stefan Kangas Date: Thu Apr 22 18:02:06 2021 +0200 * lisp/progmodes/which-func.el: Doc fixes. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 3303257c98..02a8d72758 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -1,7 +1,6 @@ ;;; which-func.el --- print current function in mode line -*- lexical-binding:t -*- -;; Copyright (C) 1994, 1997-1998, 2001-2021 Free Software Foundation, -;; Inc. +;; Copyright (C) 1994-2021 Free Software Foundation, Inc. ;; Author: Alex Rezinsky ;; (doesn't seem to be responsive any more) @@ -25,17 +24,17 @@ ;;; Commentary: ;; This package prints name of function where your current point is -;; located in mode line. It assumes that you work with imenu package -;; and imenu--index-alist is up to date. +;; located in mode line. It assumes that you work with the imenu +;; package and `imenu--index-alist' is up to date. ;; KNOWN BUGS ;; ---------- ;; Really this package shows not "function where the current point is ;; located now", but "nearest function which defined above the current -;; point". So if your current point is located after end of function -;; FOO but before begin of function BAR, FOO will be displayed in mode -;; line. -;; - if two windows display the same buffer, both windows +;; point". So if your current point is located after the end of +;; function FOO but before the beginning of function BAR, FOO will be +;; displayed in the mode line. +;; - If two windows display the same buffer, both windows ;; show the same `which-func' information. ;; TODO LIST @@ -44,7 +43,7 @@ ;; function determination mechanism should be used to determine the end ;; of a function as well as the beginning of a function. ;; 2. This package should be realized with the help of overlay -;; properties instead of imenu--index-alist variable. +;; properties instead of the `imenu--index-alist' variable. ;;; History: @@ -214,7 +213,7 @@ It creates the Imenu index for the buffer, if necessary." (setq which-func-mode nil)))) (defun which-func-update () - ;; "Update the Which-Function mode display for all windows." + "Update the Which-Function mode display for all windows." ;; (walk-windows 'which-func-update-1 nil 'visible)) (let ((non-essential t)) (which-func-update-1 (selected-window)))) commit eadf4cff7cff116d73f007dcfb1d636e9938df51 Author: Dmitry Gutov Date: Thu Apr 22 03:29:09 2021 +0300 Move part of the fix from project to xref * lisp/progmodes/project.el (project--find-regexp-in-files): Don't unquote file names here. * lisp/progmodes/xref.el (xref-matches-in-files): Do it here. And only if the first element in the list is quoted (bug#47799). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1d0d1bc58a..1023b75e66 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -787,11 +787,7 @@ pattern to search for." (defun project--find-regexp-in-files (regexp files) (unless files (user-error "Empty file list")) - (let ((xrefs (xref-matches-in-files - regexp - ;; FIXME: `xref-matches-in-files' should work with - ;; quoted filenames. - (mapcar #'file-name-unquote files)))) + (let ((xrefs (xref-matches-in-files regexp files))) (unless xrefs (user-error "No matches for: %s" regexp)) xrefs)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3d2f21ab52..5d99915347 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1534,6 +1534,8 @@ FILES must be a list of absolute file names." #'tramp-file-local-name #'file-local-name) files))) + (when (file-name-quoted-p (car files)) + (setq files (mapcar #'file-name-unquote files))) (with-current-buffer output (erase-buffer) (with-temp-buffer commit aaf6b6bf80805d18180e1c16350e9473716f5915 Author: Philipp Stephani Date: Thu Apr 22 16:11:10 2021 +0200 Ensure that argument to 'verify' is a constant expression. Casting NULL is not a constant expression (Bug#47951). * lib-src/seccomp-filter.c (main): Turn check for null pointer representation into a runtime assertion. diff --git a/lib-src/seccomp-filter.c b/lib-src/seccomp-filter.c index 31d0809f8f..dc568e035b 100644 --- a/lib-src/seccomp-filter.c +++ b/lib-src/seccomp-filter.c @@ -35,6 +35,7 @@ variants of those files that can be used to sandbox Emacs before #include "config.h" +#include #include #include #include @@ -169,7 +170,7 @@ main (int argc, char **argv) verify (sizeof (long) == 8 && LONG_MIN == INT64_MIN && LONG_MAX == INT64_MAX); verify (sizeof (void *) == 8); - verify ((uintptr_t) NULL == 0); + assert ((uintptr_t) NULL == 0); /* Allow a clean exit. */ RULE (SCMP_ACT_ALLOW, SCMP_SYS (exit)); commit 47576b429d799b6f1d02c15b3c221c69e59a2ac6 Author: Utkarsh Singh Date: Thu Apr 22 15:44:43 2021 +0200 * lisp/window.el (display-buffer): Doc fix. (Bug#47950) Copyright-paperwork-exempt: yes diff --git a/lisp/window.el b/lisp/window.el index 071761ea50..06d3e43f36 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7411,8 +7411,8 @@ For instance: Buffer display can be further customized to a very high degree; the rest of this docstring explains some of the many -possibilities, and also see `(emacs)Window Choice' for more -information. +possibilities, and also see Info node `(emacs)Window Choice' for +more information. BUFFER-OR-NAME must be a buffer or a string naming a live buffer. Return the window chosen for displaying that buffer, or nil if no commit 2fb271ca35ff96540c0940b0ea5281bdaac953ec Author: Stefan Monnier Date: Thu Apr 22 09:32:04 2021 -0400 Fix unload+reload of files using `custom-initialize-delay` (bug#47072) * lisp/custom.el (custom-initialize-delay): Don't delay if `custom-delayed-init-variables` has already been processed. * lisp/startup.el (command-line): Mark `custom-delayed-init-variables` as processed. diff --git a/lisp/custom.el b/lisp/custom.el index 2c9eadbd47..614f8cf822 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -117,9 +117,10 @@ For the standard setting, use `set-default'." (set-default symbol (eval exp))))))) (defvar custom-delayed-init-variables nil - "List of variables whose initialization is pending.") + "List of variables whose initialization is pending until startup. +Once this list has been processed, this var is set to a non-list value.") -(defun custom-initialize-delay (symbol _value) +(defun custom-initialize-delay (symbol value) "Delay initialization of SYMBOL to the next Emacs start. This is used in files that are preloaded (or for autoloaded variables), so that the initialization is done in the run-time @@ -133,7 +134,11 @@ the :set function." ;; This seemed to be at least as good as setting it to an arbitrary ;; value like nil (evaluating `value' is not an option because it ;; may have undesirable side-effects). - (push symbol custom-delayed-init-variables)) + (if (listp custom-delayed-init-variables) + (push symbol custom-delayed-init-variables) + ;; In case this is called after startup, there is no "later" to which to + ;; delay it, so initialize it "normally" (bug#47072). + (custom-initialize-reset symbol value))) (defun custom-declare-variable (symbol default doc &rest args) "Like `defcustom', but SYMBOL and DEFAULT are evaluated as normal arguments. diff --git a/lisp/startup.el b/lisp/startup.el index 4d4c65e6c4..c1267274d9 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1175,7 +1175,7 @@ please check its value") ;; are dependencies between them. (nreverse custom-delayed-init-variables)) (mapc #'custom-reevaluate-setting custom-delayed-init-variables) - (setq custom-delayed-init-variables nil) + (setq custom-delayed-init-variables t) ;; Warn for invalid user name. (when init-file-user commit 846989498b66f94739e78ca274c8d1176c137591 Author: Alan Mackenzie Date: Thu Apr 22 12:07:21 2021 +0000 Fix unclean "can't happen" error handling in read_minibuf_unwind Also fix a bug where, with minibuffer-follows-selected-frame neither nil nor t, a minibuffer could appear in two frames at the same time. * src/window.c (Fset_window_configuration): Add a new &optional parameter DONT-SET-MINIWINDOW, which inhibits the minibuffer from being restored from the supplied window configuration. (restore_window_configuration): Enhance to match the above. * src/minibuf.c (read_minibuf): Enhance the argument list to the restore_window_configuration calls to match the above. In the main case, restoring the minibuffer is inhibited. (read_minibuf_unwind): Should the frame with the expired minibuffer not be found ("can't happen"), unwind the stacked data nevertheless, rather than just exiting. * src/keyboard.c (read_char_help_form_unwind): Amend a call of Fset_window_configuration. * doc/lispref/windows.texi (Window Configurations): Document the new form of set-window-configuration. * etc/NEWS (Lisp Changes in Emacs 28.1): Amend the entry for set-window-configuration. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index c32d711f12..82d2ce4757 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -5877,7 +5877,7 @@ which window parameters (if any) are saved by this function. @xref{Window Parameters}. @end defun -@defun set-window-configuration configuration &optional dont-set-frame +@defun set-window-configuration configuration &optional dont-set-frame dont-set-miniwindow This function restores the configuration of windows and buffers as specified by @var{configuration}, for the frame that @var{configuration} was created for, regardless of whether that frame @@ -5885,8 +5885,12 @@ is selected or not. The argument @var{configuration} must be a value that was previously returned by @code{current-window-configuration} for that frame. Normally the function also selects the frame which is recorded in the configuration, but if @var{dont-set-frame} is -non-@code{nil}, it leaves selected the frame which was current at the -start of the function. +non-@code{nil}, it leaves selected the frame which was already +selected at the start of the function. + +Normally the function restores the saved minibuffer (if any), but if +@var{dont-set-miniwindow} is non-@code{nil}, the minibuffer current +at the start of the function (if any) remains in the mini-window. If the frame from which @var{configuration} was saved is dead, all this function does is to restore the value of the variable diff --git a/etc/NEWS b/etc/NEWS index 559ffd6d8f..e7258f19b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2674,9 +2674,11 @@ one to another in the init file. The same user option also controls whether the function 'read-answer' accepts short answers. +++ -** 'set-window-configuration' now takes an optional 'dont-set-frame' -parameter which, when non-nil, instructs the function not to select -the frame recorded in the configuration. +** 'set-window-configuration' now takes two optional parameters, +'dont-set-frame' and 'dont-set-miniwindow'. The first of these, when +non-nil, instructs the function not to select the frame recorded in +the configuration. The second prevents the current minibuffer being +replaced by the one stored in the configuration. +++ ** 'define-globalized-minor-mode' now takes a ':predicate' parameter. diff --git a/src/keyboard.c b/src/keyboard.c index 266ebaa5fd..5db45ce8e5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2121,7 +2121,7 @@ read_char_help_form_unwind (void) Lisp_Object window_config = XCAR (help_form_saved_window_configs); help_form_saved_window_configs = XCDR (help_form_saved_window_configs); if (!NILP (window_config)) - Fset_window_configuration (window_config, Qnil); + Fset_window_configuration (window_config, Qnil, Qnil); } #define STOP_POLLING \ diff --git a/src/minibuf.c b/src/minibuf.c index 1a637c86ad..c4482d7f1e 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -660,17 +660,14 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, record_unwind_protect_void (minibuffer_unwind); record_unwind_protect (restore_window_configuration, - Fcons (Qt, Fcurrent_window_configuration (Qnil))); + list3 (Fcurrent_window_configuration (Qnil), Qt, Qt)); /* If the minibuffer window is on a different frame, save that frame's configuration too. */ if (!EQ (mini_frame, selected_frame)) record_unwind_protect (restore_window_configuration, - Fcons (/* Arrange for the frame later to be - switched back to the calling - frame. */ - Qnil, - Fcurrent_window_configuration (mini_frame))); + list3 (Fcurrent_window_configuration (mini_frame), + Qnil, Qt)); /* If the minibuffer is on an iconified or invisible frame, make it visible now. */ @@ -1069,13 +1066,13 @@ read_minibuf_unwind (void) goto found; } } - return; /* expired minibuffer not found. Maybe we should output an - error, here. */ + exp_MB_frame = Qnil; /* "Can't happen." */ found: - if (!EQ (exp_MB_frame, saved_selected_frame)) + if (!EQ (exp_MB_frame, saved_selected_frame) + && !NILP (exp_MB_frame)) do_switch_frame (exp_MB_frame, 0, 0, Qt); /* This also sets - minibuff_window */ + minibuf_window */ /* To keep things predictable, in case it matters, let's be in the minibuffer when we reset the relevant variables. Don't depend on @@ -1185,7 +1182,8 @@ read_minibuf_unwind (void) } /* Restore the selected frame. */ - if (!EQ (exp_MB_frame, saved_selected_frame)) + if (!EQ (exp_MB_frame, saved_selected_frame) + && !NILP (exp_MB_frame)) do_switch_frame (saved_selected_frame, 0, 0, Qt); } @@ -1200,6 +1198,7 @@ minibuffer_unwind (void) Lisp_Object window; Lisp_Object entry; + if (NILP (exp_MB_frame)) return; /* "Can't happen." */ f = XFRAME (exp_MB_frame); window = f->minibuffer_window; w = XWINDOW (window); diff --git a/src/window.c b/src/window.c index a22fab2444..5134c3df63 100644 --- a/src/window.c +++ b/src/window.c @@ -6881,19 +6881,22 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config } DEFUN ("set-window-configuration", Fset_window_configuration, - Sset_window_configuration, 1, 2, 0, + Sset_window_configuration, 1, 3, 0, doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. CONFIGURATION must be a value previously returned by `current-window-configuration' (which see). Normally, this function selects the frame of the CONFIGURATION, but if DONT-SET-FRAME is non-nil, it leaves selected the frame which was -current at the start of the function. +current at the start of the function. If DONT-SET-MINIWINDOW is non-nil, +the mini-window of the frame doesn't get set to the corresponding element +of CONFIGURATION. If CONFIGURATION was made from a frame that is now deleted, only frame-independent values can be restored. In this case, the return value is nil. Otherwise the value is t. */) - (Lisp_Object configuration, Lisp_Object dont_set_frame) + (Lisp_Object configuration, Lisp_Object dont_set_frame, + Lisp_Object dont_set_miniwindow) { register struct save_window_data *data; struct Lisp_Vector *saved_windows; @@ -7104,8 +7107,10 @@ the return value is nil. Otherwise the value is t. */) } } - if (BUFFERP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer))) - /* If saved buffer is alive, install it. */ + if ((NILP (dont_set_miniwindow) || !MINI_WINDOW_P (w)) + && BUFFERP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer))) + /* If saved buffer is alive, install it, unless it's a + minibuffer we explicitly prohibit. */ { wset_buffer (w, p->buffer); w->start_at_line_beg = !NILP (p->start_at_line_beg); @@ -7258,9 +7263,11 @@ void restore_window_configuration (Lisp_Object configuration) { if (CONSP (configuration)) - Fset_window_configuration (XCDR (configuration), XCAR (configuration)); + Fset_window_configuration (XCAR (configuration), + XCAR (XCDR (configuration)), + XCAR (XCDR (XCDR (configuration)))); else - Fset_window_configuration (configuration, Qnil); + Fset_window_configuration (configuration, Qnil, Qnil); } commit 3021ecdedd3883911ca2db2357311f7fecdbd667 Author: Eli Zaretskii Date: Thu Apr 22 14:01:42 2021 +0300 Fix Isearch hscrolling in a corner case * lisp/isearch.el (isearch-update): When we start hscrolled, consider also the case that point ends up being to the left of the hscrolled window's edge. (Bug#46316) diff --git a/lisp/isearch.el b/lisp/isearch.el index f1c61fc167..9f3cfd70fb 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1374,7 +1374,8 @@ The last thing is to trigger a new round of lazy highlighting." ;; the X coordinate it returns is 1 pixel beyond ;; the last visible one. (>= (car visible-p) - (* (window-max-chars-per-line) (frame-char-width)))) + (* (window-max-chars-per-line) (frame-char-width))) + (< (car visible-p) 0)) (set-window-hscroll (selected-window) current-scroll)))) (if isearch-other-end (if (< isearch-other-end (point)) ; isearch-forward? commit 7792f7b3f3cdc40cf8636096fd5966eecebad1b5 Author: Eli Zaretskii Date: Thu Apr 22 13:59:08 2021 +0300 Fix 'window-text-pixel-size' when there's after-string at EOB * src/xdisp.c (move_it_to): Fix logic of reaching TO_CHARPOS when there's a display or overlay string(s) at EOB. (Bug#47860) diff --git a/src/xdisp.c b/src/xdisp.c index 8ffec93e45..7a89089958 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10064,8 +10064,20 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos if ((op & MOVE_TO_POS) != 0 && (IT_CHARPOS (*it) > to_charpos || (IT_CHARPOS (*it) == to_charpos + /* Consider TO_CHARPOS as REACHED if we are at + EOB that ends in something other than a newline. */ && to_charpos == ZV - && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n')))) + && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n') + /* But if we have a display or an overlay string + at EOB, keep going until we exhaust all the + characters of the string(s). */ + && (it->sp == 0 + || (STRINGP (it->string) + && (it->current.overlay_string_index < 0 + || (it->current.overlay_string_index >= 0 + && it->current.overlay_string_index + >= it->n_overlay_strings - 1)) + && IT_STRING_CHARPOS (*it) >= it->end_charpos))))) { reached = 9; goto out; commit 71b14f28068d9327eb236b8577ccbddd65e3b38b Author: Stefan Kangas Date: Thu Apr 22 04:11:02 2021 +0200 Avoid lowering gc-cons-threshold * lisp/cedet/semantic/wisent/comp.el (wisent--compile-grammar): * lisp/international/mule-cmds.el (ucs-names): * lisp/progmodes/ebrowse.el (ebrowse-read): * test/src/coding-tests.el (benchmark-decoder): Avoid lowering gc-cons-treshold. diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index b96fa400d9..a87ed51890 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -3427,7 +3427,7 @@ where: (if (wisent-automaton-p grammar) grammar ;; Grammar already compiled just return it (wisent-with-context compile-grammar - (let* ((gc-cons-threshold 1000000)) + (let* ((gc-cons-threshold (max gc-cons-threshold 1000000))) (garbage-collect) (setq wisent-new-log-flag t) ;; Parse input grammar diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 578d97bcc0..b99db46e45 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -3047,7 +3047,7 @@ on encoding." (#x1D000 . #x1FFFF) ;; (#x20000 . #xDFFFF) CJK Ideograph Extension A, B, etc, unused (#xE0000 . #xE01FF))) - (gc-cons-threshold 10000000) + (gc-cons-threshold (max gc-cons-threshold 10000000)) (names (make-hash-table :size 42943 :test #'equal))) (dolist (range ranges) (let ((c (car range)) diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index cafdb3b828..7524c280f2 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -794,7 +794,7 @@ and TREE is a list of `ebrowse-ts' structures forming the class tree." (ebrowse-hs-version header) ebrowse-version-string)) ;; Read Lisp objects. Temporarily increase `gc-cons-threshold' to ;; prevent a GC that would not free any memory. - (let ((gc-cons-threshold 2000000)) + (let ((gc-cons-threshold (max gc-cons-threshold 2000000))) (while (not (progn (skip-chars-forward " \t\n") (eobp))) (let* ((root (read (current-buffer))) (old-root-ptr (ebrowse-class-in-tree root tree))) diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 0bdcff22ce..0309b2b1ad 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -359,7 +359,7 @@ (delete-region (point-min) (point)))))) (defun benchmark-decoder () - (let ((gc-cons-threshold 4000000)) + (let ((gc-cons-threshold (max gc-cons-threshold 4000000))) (insert "Without optimization:\n") (dolist (files test-file-list) (dolist (file (cdr files))