commit bb8b8d717f91a85ca41de9e82246e6975e1ed719 (HEAD, refs/remotes/origin/master) Author: Basil L. Contovounesios Date: Sat May 8 17:53:41 2021 +0100 Tiny fixes to recent native compilation docs For discussion, see the following thread: https://lists.gnu.org/r/emacs-devel/2021-05/msg00347.html * doc/lispref/compile.texi (Native Compilation): Fix grammar in @ref online label. (Native-Compilation Functions): Consistently unhyphenate 'sub-process'. Fix grammar. (Native-Compilation Variables): Fix @cindex entry. diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index f0787795ca..ee31b17af7 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -801,13 +801,13 @@ The @code{silly-loop} function is somewhat more complex: @cindex native code In addition to the byte-compilation, described in @ref{Byte -Compilation, previous chapter}, Emacs can also optionally compile Lisp -function definitions into a true compiled code, known as @dfn{native -code}. This feature uses the @file{libgccjit} library, which is part -of the GCC distribution, and requires that Emacs be built with support -for using that library. It also requires to have GCC and Binutils -(the assembler and linker) available on your system for you to be able -to native-compile Lisp code. +Compilation, the previous chapter}, Emacs can also optionally compile +Lisp function definitions into a true compiled code, known as +@dfn{native code}. This feature uses the @file{libgccjit} library, +which is part of the GCC distribution, and requires that Emacs be +built with support for using that library. It also requires to have +GCC and Binutils (the assembler and linker) available on your system +for you to be able to native-compile Lisp code. @vindex native-compile@r{, a Lisp feature} To determine whether the current Emacs process can produce and load @@ -857,7 +857,7 @@ specified, the former takes precedence. @section Native-Compilation Functions @cindex native-compilation functions - Native-Compilation is implemented as side effect of + Native-Compilation is implemented as a side effect of byte-compilation (@pxref{Byte Compilation}). Thus, compiling Lisp code natively always produces its byte code as well, and therefore all the rules and caveats of preparing Lisp code for byte compilation @@ -892,14 +892,14 @@ argument @var{function-or-file} can be a function symbol, a Lisp form, or a name (a string) of the file which contains the Emacs Lisp source code to compile. If the optional argument @var{output} is provided, it must be a string specifying the name of the file to write the -compiled code. Otherwise, if @var{function-or-file} is a function or -a Lisp form, this function returns the compiled object, and if -@var{function-or-file} is a file name, the function returns the full -absolute name of the file it created for the compiled code. The +compiled code into. Otherwise, if @var{function-or-file} is a +function or a Lisp form, this function returns the compiled object, +and if @var{function-or-file} is a file name, the function returns the +full absolute name of the file it created for the compiled code. The output file is by default given the @file{.eln} extension. This function runs the final phase of the native compilation, which -invokes GCC via @file{libgccjit}, in a separate sub-process, which +invokes GCC via @file{libgccjit}, in a separate subprocess, which invokes the same Emacs executable as the process that called this function. @end defun @@ -913,12 +913,12 @@ attempt to compile all the other files, and will terminate with a non-zero status code. @end defun -Native compilation can be run entirely asynchronously, in a -sub-process of the main Emacs process. This leaves the main Emacs -process free to use while the compilation runs in the background. -This is the method used by Emacs to natively-compile any Lisp file or -byte-compiled Lisp file that is loaded into Emacs, when no -natively-compiled file for it is available. +Native compilation can be run entirely asynchronously, in a subprocess +of the main Emacs process. This leaves the main Emacs process free to +use while the compilation runs in the background. This is the method +used by Emacs to natively-compile any Lisp file or byte-compiled Lisp +file that is loaded into Emacs, when no natively-compiled file for it +is available. @defun native-compile-async files &optional recursively load selector This function compiles the named @var{files} asynchronously. The @@ -944,12 +944,12 @@ or the directory should be selected for compilation. On systems with multiple CPU execution units, when @var{files} names more than one file, this function will normally start several -compilation sub-processes in parallel, under the control of +compilation subprocesses in parallel, under the control of @code{native-comp-async-jobs-number} (@pxref{Native-Compilation Variables}). @end defun - The following function allows Lisp program to test whether + The following function allows Lisp programs to test whether native-compilation is available at runtime. @defun native-comp-available-p @@ -962,7 +962,7 @@ whether native-compilation is available should use this predicate. @node Native-Compilation Variables @section Native-Compilation Variables -@cindex native-compilation variable +@cindex native-compilation variables This section documents the variables that control native-compilation. commit d3344e0a7fc9435910a600d831ebdb8b2953b2a5 Author: Basil L. Contovounesios Date: Sat May 8 15:07:38 2021 +0100 ; Fix recent re-builder doc changes. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 99451d0bc6..b38ee995ab 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -251,7 +251,7 @@ matches in the target buffer are highlighted. Each parenthesized sub-expression of the regexp is shown in a distinct face, which makes it easier to verify even very complex regexps. - Note that by default Emacs search ignores case (@xref{Searching and + Note that by default Emacs search ignores case (@pxref{Searching and Case}). To enable case-sensitive regexp search and match, bind @code{case-fold-search} to @code{nil} around the code you want to be case-sensitive. diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index b695dff55a..7d042a9102 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -346,7 +346,7 @@ matching parts of the target buffer will be highlighted. Case-sensitivity can be toggled with \\[reb-toggle-case]. The regexp builder supports three different forms of input which can be set with \\[reb-change-syntax]. More options and details are -provided in the initial comment of`re-builder.el'." +provided in the Commentary section of this library." (interactive) (if (and (string= (buffer-name) reb-buffer) (reb-mode-buffer-p)) commit 79e2d0486c89c6c452df33792976ea6fdf825185 Author: Eli Zaretskii Date: Sat May 8 16:26:41 2021 +0300 Document native-compilation * doc/lispref/loading.texi (How Programs Do Loading) (Library Search): Update for native-compilation features. * doc/lispref/compile.texi (Native Compilation) (Native-Compilation Functions, Native-Compilation Variables): New chapter and sections. * doc/lispref/elisp.texi (Top): Update the top-level menus. * etc/NEWS: Add a reference to the ELisp manual. diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index bf42004095..f0787795ca 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -793,3 +793,248 @@ The @code{silly-loop} function is somewhat more complex: 17 return ; @r{Return value of the top of stack.} @end group @end example + +@node Native Compilation +@chapter Compilation of Lisp to Native Code +@cindex native compilation +@cindex compilation to native code (Emacs Lisp) + +@cindex native code + In addition to the byte-compilation, described in @ref{Byte +Compilation, previous chapter}, Emacs can also optionally compile Lisp +function definitions into a true compiled code, known as @dfn{native +code}. This feature uses the @file{libgccjit} library, which is part +of the GCC distribution, and requires that Emacs be built with support +for using that library. It also requires to have GCC and Binutils +(the assembler and linker) available on your system for you to be able +to native-compile Lisp code. + +@vindex native-compile@r{, a Lisp feature} + To determine whether the current Emacs process can produce and load +natively-compiled Lisp code, test whether the @code{native-compile} +feature is available (@pxref{Named Features}). Alternatively, call +@code{native-comp-available-p} (@pxref{Native-Compilation Functions}). + + Unlike byte-compiled code, natively-compiled Lisp code is executed +directly by the machine's hardware, and therefore runs at full speed +that the host CPU can provide. The resulting speedup generally +depends on what the Lisp code does, but is usually 2.5 to 5 times +faster than the corresponding byte-compiled code. + + Since native code is generally incompatible between different +systems, the natively-compiled code is @emph{not} transportable from +one machine to another, it can only be used on the same machine where +it was produced or on very similar ones (having the same CPU and +run-time libraries). The transportability of natively-compiled code +is the same as that of shared libraries (@file{.so} or @file{.dll} +files). + + Libraries of natively-compiled code include crucial dependencies on +Emacs Lisp primitives (@pxref{What Is a Function}) and their calling +conventions, and thus Emacs usually won't load natively-compiled code +produced by earlier or later Emacs versions; native compilation of the +same Lisp code by a different Emacs version will usually produce a +natively-compiled library under a unique file name that only that +version of Emacs will be able to load. However, the use of unique +file names allows to have in the same directory several versions of +the same Lisp library natively-compiled by several different versions +of Emacs. + +@vindex no-native-compile + A non-@code{nil} file-local variable binding of +@code{no-byte-compile} (@pxref{Byte Compilation}) also disables the +native compilation of that file. In addition, a similar variable +@code{no-native-compile} disables just the native compilation of the +file. If both @code{no-byte-compile} and @code{no-native-compile} are +specified, the former takes precedence. + +@menu +* Native-Compilation Functions:: Functions to natively-compile Lisp. +* Native-Compilation Variables:: Variables controlling native compilation. +@end menu + +@node Native-Compilation Functions +@section Native-Compilation Functions +@cindex native-compilation functions + + Native-Compilation is implemented as side effect of +byte-compilation (@pxref{Byte Compilation}). Thus, compiling Lisp +code natively always produces its byte code as well, and therefore all +the rules and caveats of preparing Lisp code for byte compilation +(@pxref{Compilation Functions}) are valid for native-compilation as +well. + + You can natively-compile either a single function or macro +definition, or a whole file of Lisp code, with the +@code{native-compile} function. Natively-compiling a file will +produce both the corresponding @file{.elc} file with byte code and the +@file{.eln} file with native code. + +@findex native-comp-limple-mode +@vindex native-comp-verbose + Native compilation might produce warning or error messages; these +are normally recorded in the buffer called +@file{*Native-compile-Log*}. In interactive sessions, it uses the +special LIMPLE mode (@code{native-comp-limple-mode}), which sets up +@code{font-lock} as appropriate for this log, and is otherwise the +same as Fundamental mode. Logging of messages resulting from +native-compilation can be controlled by the @code{native-comp-verbose} +variable (@pxref{Native-Compilation Variables}). + + When Emacs is run non-interactively, messages produced by +native-compilation are reported by calling @code{message} +(@pxref{Displaying Messages}), and are usually displayed on the +standard error stream of the terminal from which Emacs was invoked. + +@defun native-compile function-or-file &optional output +This function compiles @var{function-or-file} into native code. The +argument @var{function-or-file} can be a function symbol, a Lisp form, +or a name (a string) of the file which contains the Emacs Lisp source +code to compile. If the optional argument @var{output} is provided, +it must be a string specifying the name of the file to write the +compiled code. Otherwise, if @var{function-or-file} is a function or +a Lisp form, this function returns the compiled object, and if +@var{function-or-file} is a file name, the function returns the full +absolute name of the file it created for the compiled code. The +output file is by default given the @file{.eln} extension. + +This function runs the final phase of the native compilation, which +invokes GCC via @file{libgccjit}, in a separate sub-process, which +invokes the same Emacs executable as the process that called this +function. +@end defun + +@defun batch-native-compile +This function runs native-compilation on files specified on the Emacs +command line in batch mode. It must be used only in a batch execution +of Emacs, as it kills Emacs upon completion of the compilation. If +one or more of the files fail to compile, the Emacs process will +attempt to compile all the other files, and will terminate with a +non-zero status code. +@end defun + +Native compilation can be run entirely asynchronously, in a +sub-process of the main Emacs process. This leaves the main Emacs +process free to use while the compilation runs in the background. +This is the method used by Emacs to natively-compile any Lisp file or +byte-compiled Lisp file that is loaded into Emacs, when no +natively-compiled file for it is available. + +@defun native-compile-async files &optional recursively load selector +This function compiles the named @var{files} asynchronously. The +argument @var{files} should be a single file name (a string) or a list +of one or more file and/or directory names. If directories are +present in the list, the optional argument @var{recursively} should be +non-@code{nil} to cause the compilation to recurse into those +directories. If @var{load} is non-@code{nil}, Emacs will load each +file that it succeeded to compile. The optional argument +@var{selector} allows control of which of @var{files} will be +compiled; it can have one of the following values: + +@table @asis +@item @code{nil} or omitted +Select all the files and directories in @var{files}. +@item a regular expression string +Select the files and directories whose names match the regexp. +@item a function +A predicate function, which will be called with each file and +directory in @var{files}, and should return non-@code{nil} if the file +or the directory should be selected for compilation. +@end table + +On systems with multiple CPU execution units, when @var{files} names +more than one file, this function will normally start several +compilation sub-processes in parallel, under the control of +@code{native-comp-async-jobs-number} (@pxref{Native-Compilation +Variables}). +@end defun + + The following function allows Lisp program to test whether +native-compilation is available at runtime. + +@defun native-comp-available-p +This function returns non-@code{nil} if the running Emacs process has +the native-compilation support compiled into it. On systems that load +@file{libgccjit} dynamically, it also makes sure that library is +available and can be loaded. Lisp programs that need to know up front +whether native-compilation is available should use this predicate. +@end defun + +@node Native-Compilation Variables +@section Native-Compilation Variables +@cindex native-compilation variable + + This section documents the variables that control +native-compilation. + +@defopt native-comp-speed +This variable specifies the optimization level for native compilation. +Its value should be a number between @minus{}1 and 3. Values between +0 and 3 specify the optimization levels equivalent to the +corresponding compiler @option{-O0}, @option{-O1}, etc.@: command-line +options of the compiler. The value @minus{}1 means disable +native-compilation; functions and files will be only byte-compiled. +The default value is 2. +@end defopt + +@defopt native-comp-debug +This variable specifies the level of debugging information produced by +native-compilation. Its value should be a number between zero and 3, +with the following meaning: + +@table @asis +@item 0 +No debugging output. This is the default. +@item 1 +Emit debugging symbols with the native code. This allows easier +debugging of the native code with debuggers such as @command{gdb}. +@item 2 +Like 1, and in addition dump pseudo-C code. +@item 3 +Like 2, and in addition dump the GCC intermediate passes and +@file{libgccjit} log file. +@end table +@end defopt + +@defopt native-comp-verbose +This variable controls the verbosity of native-compilation by +suppressing some or all of the log messages emitted by it. If its +value is zero, the default, all of the log messages are suppressed. +Setting it to a value between 1 and 3 will allow logging of the +messages whose level is above the value. The values have the +following interpretations: + +@table @asis +@item 0 +No logging. This is the default. +@item 1 +Log the final @acronym{LIMPLE} representation of the code. +@item 2 +Log the @acronym{LAP}, the final @acronym{LIMPLE}, and some additional +pass info. +@item 3 +Maximum verbosity: log everything. +@end table +@end defopt + +@defopt native-comp-async-jobs-number +This variable determines the maximum number of native-compilation +subprocesses that will be started simultaneously. It should be a +non-negative number. The default value is zero, which means use half +the number of the CPU execution units, or 1 if the CPU has only one +execution unit. +@end defopt + +@defopt native-comp-async-report-warnings-errors +If this variable's value is non-@code{nil}, warnings and errors from +asynchronous native-compilation subprocesses are reported in the main +Emacs session. The default is @code{t}. +@end defopt + +@defopt native-comp-async-query-on-exit +If this variable's value is non-nil, Emacs will query upon exiting +whether to exit and kill any asynchronous native-compilation +subprocesses that are still running, thus preventing the corresponding +@file{.eln} files from being written. If the value is @code{nil}, the +default, Emacs will kill these subprocesses without querying. +@end defopt diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index be0c835b03..8b440c7977 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -197,6 +197,7 @@ To view this manual in other formats, click * Loading:: Reading files of Lisp code into Lisp. * Byte Compilation:: Compilation makes programs run faster. +* Native Compilation:: Compile Lisp into native machine code. * Debugging:: Tools and tips for debugging Lisp programs. * Read and Print:: Converting Lisp objects to text and back. @@ -646,6 +647,11 @@ Byte Compilation * Byte-Code Objects:: The data type used for byte-compiled functions. * Disassembly:: Disassembling byte-code; how to read byte-code. +Native Compilation + +* Native-Compilation Functions:: Functions to natively-compile Lisp. +* Native-Compilation Variables:: Variables controlling native compilation. + Debugging Lisp Programs * Debugger:: A debugger for the Emacs Lisp evaluator. diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index e68a1ef314..4d683da1ad 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -71,7 +71,11 @@ forms in it, and closes the file. To find the file, @code{load} first looks for a file named @file{@var{filename}.elc}, that is, for a file whose name is @var{filename} with the extension @samp{.elc} appended. If such a -file exists, it is loaded. If there is no file by that name, then +file exists, and Emacs was compiled with native-compilation support +(@pxref{Native Compilation}), @code{load} attempts to find a +corresponding @samp{.eln} file, and if found, loads it instead of +@file{@var{filename}.elc}. Otherwise, it loads +@file{@var{filename}.elc}. If there is no file by that name, then @code{load} looks for a file named @file{@var{filename}.el}. If that file exists, it is loaded. If Emacs was compiled with support for dynamic modules (@pxref{Dynamic Modules}), @code{load} next looks for @@ -109,6 +113,8 @@ explicit directory name. If the option @code{load-prefer-newer} is non-@code{nil}, then when searching suffixes, @code{load} selects whichever version of a file (@samp{.elc}, @samp{.el}, etc.)@: has been modified most recently. +In this case, @code{load} doesn't load the @samp{.eln} +natively-compiled file even if it exists. If @var{filename} is a relative file name, such as @file{foo} or @file{baz/foo.bar}, @code{load} searches for the file using the variable @@ -153,7 +159,8 @@ during compilation. @xref{Compiling Macros}. Messages like @samp{Loading foo...} and @samp{Loading foo...done} appear in the echo area during loading unless @var{nomessage} is -non-@code{nil}. +non-@code{nil}. If a natively-compiled @samp{.eln} file is loaded, +the message says so. @cindex load errors Any unhandled errors while loading a file terminate loading. If the @@ -430,6 +437,28 @@ optional argument @code{stringp} is non-@code{nil}, it instead returns the shadowed files as a string. @end deffn + If Emacs was compiled with support for native compilation +(@pxref{Native Compilation}), then when a @samp{.elc} byte-compiled +file is found by searching @code{load-path}, Emacs will try to look +for a corresponding @samp{.eln} file holding the corresponding +natively-compiled code. The natively-compiled files are looked up in +the directories listed by the @code{native-comp-eln-load-path}. + +@vindex comp-native-version-dir +@defvar native-comp-eln-load-path +This variable holds a list of directories where Emacs looks for +natively-compiled @samp{.eln} files. File names in the list that are +not absolute are interpreted as relative to @code{invocation-directory} +(@pxref{System Environment}). The last directory in the list is the +system directory, i.e.@: the directory with @samp{.eln} files +installed by the Emacs build and installation procedure. In each of +the directories in the list, Emacs looks for @samp{.eln} files in a +subdirectory whose name is constructed from the Emacs version and an +8-character hash that depends on the current native-compilation +@acronym{ABI}; the name of this subdirectory is stored in the variable +@code{comp-native-version-dir}. +@end defvar + @node Loading Non-ASCII @section Loading Non-@acronym{ASCII} Characters @cindex loading, and non-ASCII characters diff --git a/etc/NEWS b/etc/NEWS index 9f4ded3aab..6efadfec6f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -26,7 +26,10 @@ applies, and please also update docstrings as needed. ** Emacs now optionally supports native compilation of Lisp files. To enable this, configure Emacs with the '--with-native-compilation' option. -This requires the libgccjit library to be installed and functional. +This requires the libgccjit library to be installed and functional, +and also requires GCC and Binutils to be available when Lisp code is +natively compiled. See the Info node "(elisp) Native Compilation" for +more details. --- ** Support for building with Motif has been removed. commit 53dfb51f55bf66bb939505c60d12952dd64820a7 Author: Lars Ingebrigtsen Date: Sat May 8 14:22:30 2021 +0200 Don't delete socket on server exit if it was passed in * lisp/server.el (server-sentinel): Don't delete the socket if it was passed in to Emacs (bug#47511). diff --git a/lisp/server.el b/lisp/server.el index 220694f6cb..17332a2b0a 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -413,9 +413,14 @@ If CLIENT is non-nil, add a description of it to the logged message." ;; for possible servers before doing anything, so it *should* be ours. (and (process-contact proc :server) (eq (process-status proc) 'closed) + ;; If this variable is non-nil, the socket was passed in to + ;; Emacs, and not created by Emacs itself (for instance, + ;; created by systemd). In that case, don't delete the socket. + (not internal--daemon-sockname) (ignore-errors (delete-file (process-get proc :server-file)))) - (server-log (format "Status changed to %s: %s" (process-status proc) msg) proc) + (server-log (format "Status changed to %s: %s" + (process-status proc) msg) proc) (server-delete-client proc)) (defun server--on-display-p (frame display) commit 12a37ef6d248ad101407e1800542bc6995044d95 Author: Lars Ingebrigtsen Date: Sat May 8 14:17:11 2021 +0200 Remove dead URL in isearchb.el comments * lisp/isearchb.el: Remove dead URL in comments (bug#47514). diff --git a/lisp/isearchb.el b/lisp/isearchb.el index 67020b76ec..eaf7983cbd 100644 --- a/lisp/isearchb.el +++ b/lisp/isearchb.el @@ -7,7 +7,6 @@ ;; Created: 16 Apr 2004 ;; Version: 1.5 ;; Keywords: lisp -;; X-URL: http://www.newartisans.com/johnw/emacs.html ;; This file is part of GNU Emacs. commit f608b4b93c061e10603551a7d189637f49d90a62 Author: Alan Mackenzie Date: Sat May 8 12:10:00 2021 +0000 Prevent the selected window being a dead mini-window when switching frames This fixes bug #48249 and also a situation where, with recursive minibuffers enabled and minibuffer-follows-selected-frame t, switching frames when a minibuffer was open would leave the mini-window selected on the old frame. * lisp/window.el (record-window-buffer): Add extra parameter DO-MINIBUF, and amend the code such that minibuffers only get processed when that parameter is non-nil. * src/minibuf.c (zip_minibuffer_stacks, read_minibuf): Call Qrecord_window_buffer with the new argument set to Qt. (move_minibuffers_onto_frame): Set the selected window on the old frame when this would otherwise remain the mini-window. diff --git a/lisp/window.el b/lisp/window.el index bba4992ca2..db62d3308f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4361,9 +4361,12 @@ This may be a useful alternative binding for \\[delete-other-windows] ;; The following function is called by `set-window-buffer' _before_ it ;; replaces the buffer of the argument window with the new buffer. -(defun record-window-buffer (&optional window) +(defun record-window-buffer (&optional window do-minibuf) "Record WINDOW's buffer. -WINDOW must be a live window and defaults to the selected one." +WINDOW must be a live window and defaults to the selected one. + +If WINDOW is a minibuffer, it will only be recorded if DO-MINIBUF +is non-nil." (let* ((window (window-normalize-window window t)) (buffer (window-buffer window)) (entry (assq buffer (window-prev-buffers window)))) @@ -4371,14 +4374,13 @@ WINDOW must be a live window and defaults to the selected one." ;; `switch-to-prev-buffer' and `switch-to-next-buffer'. (set-window-next-buffers window nil) - (when entry - ;; Remove all entries for BUFFER from WINDOW's previous buffers. - (set-window-prev-buffers - window (assq-delete-all buffer (window-prev-buffers window)))) - ;; Don't record insignificant buffers. (when (or (not (eq (aref (buffer-name buffer) 0) ?\s)) - (minibufferp buffer)) + (and do-minibuf (minibufferp buffer))) + (when entry + ;; Remove all entries for BUFFER from WINDOW's previous buffers. + (set-window-prev-buffers + window (assq-delete-all buffer (window-prev-buffers window)))) ;; Add an entry for buffer to WINDOW's previous buffers. (with-current-buffer buffer (let ((start (window-start window)) diff --git a/src/minibuf.c b/src/minibuf.c index bc7d439398..167aece973 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -163,9 +163,9 @@ zip_minibuffer_stacks (Lisp_Object dest_window, Lisp_Object source_window) } if (live_minibuffer_p (dw->contents)) - call1 (Qrecord_window_buffer, dest_window); + call2 (Qrecord_window_buffer, dest_window, Qt); if (live_minibuffer_p (sw->contents)) - call1 (Qrecord_window_buffer, source_window); + call2 (Qrecord_window_buffer, source_window, Qt); acc = merge_c (dw->prev_buffers, sw->prev_buffers, minibuffer_ent_greater); @@ -204,6 +204,14 @@ move_minibuffers_onto_frame (struct frame *of, bool for_deletion) zip_minibuffer_stacks (f->minibuffer_window, of->minibuffer_window); if (for_deletion && XFRAME (MB_frame) != of) MB_frame = selected_frame; + if (!for_deletion + && MINI_WINDOW_P (XWINDOW (FRAME_SELECTED_WINDOW (of)))) + { + Lisp_Object old_frame; + XSETFRAME (old_frame, of); + Fset_frame_selected_window (old_frame, + Fframe_first_window (old_frame), Qnil); + } } } @@ -672,7 +680,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, } MB_frame = XWINDOW (XFRAME (selected_frame)->minibuffer_window)->frame; if (live_minibuffer_p (XWINDOW (minibuf_window)->contents)) - call1 (Qrecord_window_buffer, minibuf_window); + call2 (Qrecord_window_buffer, minibuf_window, Qt); record_unwind_protect_void (minibuffer_unwind); record_unwind_protect (restore_window_configuration, commit fdeb1a3dc77ccac28e6cf91b9cc4aa43f3060e7a Author: dalanicolai Date: Sat May 8 13:59:03 2021 +0200 Mention that Emacs is usually case-insensitive in a couple of places * doc/lispref/searching.texi (Regular Expressions): Mention `case-fold-search'. * lisp/emacs-lisp/re-builder.el (re-builder): Mention case sensitivity toggles (bug#47534). Copyright-paperwork-exempt: yes diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 16a8e56e90..99451d0bc6 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -251,6 +251,11 @@ matches in the target buffer are highlighted. Each parenthesized sub-expression of the regexp is shown in a distinct face, which makes it easier to verify even very complex regexps. + Note that by default Emacs search ignores case (@xref{Searching and +Case}). To enable case-sensitive regexp search and match, bind +@code{case-fold-search} to @code{nil} around the code you want to be +case-sensitive. + @menu * Syntax of Regexps:: Rules for writing regular expressions. * Regexp Example:: Illustrates regular expression syntax. diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 455fcac701..b695dff55a 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -341,7 +341,12 @@ the regexp builder. It displays a buffer named \"*RE-Builder*\" in another window, initially containing an empty regexp. As you edit the regexp in the \"*RE-Builder*\" buffer, the -matching parts of the target buffer will be highlighted." +matching parts of the target buffer will be highlighted. + +Case-sensitivity can be toggled with \\[reb-toggle-case]. The +regexp builder supports three different forms of input which can +be set with \\[reb-change-syntax]. More options and details are +provided in the initial comment of`re-builder.el'." (interactive) (if (and (string= (buffer-name) reb-buffer) (reb-mode-buffer-p)) commit a6757d10e859a6a71020369bbbc822272bc0540b Author: Lars Ingebrigtsen Date: Sat May 8 13:42:51 2021 +0200 Revert "Fix moving directories with the same name to trash" This reverts commit f618cc5bc83d3822759c5bb85d15320651ca2431. This patch doesn't cover some corner cases, I think. diff --git a/lisp/files.el b/lisp/files.el index da33ee815f..93a0e07aba 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7932,7 +7932,7 @@ Otherwise, trash FILENAME using the freedesktop.org conventions, (expand-file-name files-base trash-files-dir)) (setq overwrite t files-base (file-name-nondirectory - (make-temp-name + (make-temp-file (expand-file-name files-base trash-files-dir))))) (setq info-fn (expand-file-name commit f618cc5bc83d3822759c5bb85d15320651ca2431 Author: Codruț Constantin Gușoi Date: Sat May 8 13:40:03 2021 +0200 Fix moving directories with the same name to trash * lisp/files.el (move-file-to-trash): Allow moving several directories with the same name to Trash (bug#48280). Copyright-paperwork-exempt: yes diff --git a/lisp/files.el b/lisp/files.el index 93a0e07aba..da33ee815f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7932,7 +7932,7 @@ Otherwise, trash FILENAME using the freedesktop.org conventions, (expand-file-name files-base trash-files-dir)) (setq overwrite t files-base (file-name-nondirectory - (make-temp-file + (make-temp-name (expand-file-name files-base trash-files-dir))))) (setq info-fn (expand-file-name