After deleting the dedicated window, such as a window with *Completions*
buffer, select the previously selected window, like most of other 'cond'
branches do in this function (bug#52491).
Martin Rudalics [Wed, 15 Dec 2021 17:53:49 +0000 (18:53 +0100)]
Fix control buffer window height in 'ediff-setup-control-buffer' (Bug#49277)
* lisp/vc/ediff-util.el (ediff-setup-control-buffer): Emulate
original 'shrink-window-if-larger-than-buffer' call by calling
'fit-window-to-buffer' with an appropriate maximum height
argument (Bug#49277).
Philipp Stephani [Tue, 14 Dec 2021 10:17:37 +0000 (11:17 +0100)]
Remove maintainer comment from Emacs 28 module snippet.
This is the same as 44c13eefe8d30841000a96d82f467fb8d222e365 on
master. We should also remove this comment on the release branch,
otherwise it ends up in the emacs-module.h shipped to users.
Kévin Le Gouguec [Mon, 13 Dec 2021 04:17:00 +0000 (05:17 +0100)]
Make `M-x run-python' select the window again
Interactively, we want M-x run-python to focus the interpreter buffer.
The previous code failed in two ways:
- the call to 'display-buffer' was not reached if an interpreter
was already running,
- set-buffer is ineffectual if the interpreter's window is not
selected: once Emacs returns to the command loop, the current buffer
will revert back to what the selected window contains.
* lisp/progmodes/python.el (python-shell-make-comint): Handle the SHOW
argument regardless of whether an interpreter buffer exists, and use
pop-to-buffer to select the window.
(run-python): Delegate buffer management to
'python-shell-make-comint'.
* test/lisp/progmodes/python-tests.el
(python-tests--run-python-selects-window): Rename from
'python-tests--bug31398', and adjust assertions (bug#52380).
Po Lu [Fri, 10 Dec 2021 13:36:59 +0000 (21:36 +0800)]
Fix the DJGPP port
* config.bat:
* msdos/sed1v2.inp:
* msdos/sed2v2.inp:
* msdos/sed3v2.inp:
* msdos/sedlibmk.inp: Update for Emacs 28.
* msdos/langinfo.h: New file.
* lisp/loadup.el: Use correct path to temacs when dumping on
MS-DOS.
* src/callproc.c (environ) [MSDOS]: New declaration.
(child_setup, emacs_spawn): Update MS-DOS parts for Emacs 28.
* src/fileio.c (Fcopy_file): Don't use copy_file_range on
MS-DOS.
* src/msdos.c (initialize_msdos_display): Add
`defined_color_hook'.
(openat, fchmodat, futimens, utimensat): New functions.
* src/msdos.h (FRAME_X_DISPLAY): New macro.
* src/process.c: Make some more things conditional on
subprocess support.
(PIPECONN_P, PIPECONN1_P) [!subprocesses]: New placeholder
macros.
(Fnum_processors): Return 1 on MSDOS.
(open_channel_for_module): Avoid subprocess specific code
on MSDOS.
Paul Eggert [Thu, 9 Dec 2021 17:03:10 +0000 (09:03 -0800)]
emacsclient takes more care about XDG_RUNTIME_DIR
* lib-src/emacsclient.c (set_local_socket): Revert to the Emacs 27
behavior of not trying TMPDIR if XDG_RUNTIME_DIR is set.
This is one of the suggestions made by Jim Porter and
independently by Ulrich Mueller in Bug#51327.
Emacs got better at quoting shell arguments and the original value
works correctly for vc-git-grep. At the same time, the value
introduced on that commit caused a regression on lgrep.
* lisp/progmodes/grep.el (grep-files-aliases): Use previous value for
`all'. Fixes bug#52367
Eli Zaretskii [Wed, 8 Dec 2021 14:22:10 +0000 (16:22 +0200)]
Fix mode-line display in Calendar mode
* lisp/help.el (substitute-command-keys): New optional argument
NO-FACE, to avoid putting the 'help-key-binding' face on the key
bindings.
* lisp/calendar/calendar.el (calendar-mode-line-entry): Call
'substitute-command-keys' with the new optional argument non-nil.
(Bug#52366)
* doc/lispref/help.texi (Keys in Documentation): Document the new
optional argument of 'substitute-command-keys'.
* etc/NEWS: Announce the addition of a new argument to
'substitute-command-keys'.
Robert Pluim [Tue, 7 Dec 2021 17:43:01 +0000 (18:43 +0100)]
Document native-comp-async-report-warning-errors more
The docstring has a description of how fix problems in lisp code
detected by native compilation, but not the Emacs Lisp manual, so
document it there as well.
* doc/lispref/compile.texi (Native-Compilation Functions): Refer to
'native-comp-async-report-warning-errors'
(Native-Compilation Variables): Explain potential cause of warnings
from native compilation.
Juri Linkov [Mon, 6 Dec 2021 17:24:09 +0000 (19:24 +0200)]
Select the right buffer for event in context-menu functions (bug#9923)
* lisp/mouse.el (context-menu-region):
* lisp/progmodes/prog-mode.el (prog-context-menu):
Switch to the buffer displayed by the window of the event
before using syntax-ppss, char-after.
Stefan Kangas [Fri, 3 Dec 2021 14:57:56 +0000 (15:57 +0100)]
; FAQ: Normalize references to the NEWS.NN file
* doc/misc/efaq.texi (New in Emacs 26, New in Emacs 25)
(New in Emacs 24, New in Emacs 23, New in Emacs 22)
(New in Emacs 21, New in Emacs 20): Normalize the format for
referring to the NEWS.NN file.
Paul Eggert [Fri, 3 Dec 2021 03:01:33 +0000 (19:01 -0800)]
Port to C compilers that lack size-0 arrays
The C standard does not allow size-zero arrays, so redo struct
Lisp_Subr to not use size-zero arrays when native compilation is
not being used. Formerly, the code was using size-zero arrays (a
GNU C extension) to avoid using memory unnecessarily when
HAVE_NATIVE_COMP is not defined. Replace this hack with the
more-traditional hack of putting the relevant members inside
‘#ifdef HAVE_NATIVE_COMP’.
* src/alloc.c (cleanup_vector, mark_object):
* src/comp.c (make_subr):
* src/data.c (Fsubr_native_lambda_list, Fsubr_native_comp_unit):
* src/eval.c (init_eval_once, funcall_lambda):
* src/lisp.h (SUBR_NATIVE_COMPILEDP, SUBR_NATIVE_COMPILED_DYNP)
(SUBR_TYPE):
* src/lread.c (Fload):
Conditionally compile with ‘#ifdef HAVE_NATIVE_COMP’ instead of
with ‘if (NATIVE_COMP_FLAG)’. Redo members like native_comp_u[0]
to be plain native_comp_u. Put all uses of these members inside
‘#ifdef HAVE_NATIVE_COMP’.
* src/lisp.h (struct Lisp_Subr): Members native_comp_u,
native_c_name, lambda_list, type are now all ifdeffed out if
HAVE_NATIVE_COMP is not defined, instead of being size-zero
arrays. All uses changed.
* src/pdumper.c (dump_subr, dump_cold_native_subr)
(dump_do_dump_relocation):
* src/comp.h (NATIVE_COMP_FLAG): Remove; no longer needed.
Paul Eggert [Fri, 3 Dec 2021 02:43:43 +0000 (18:43 -0800)]
Port emacsclient to Solaris 10
Without this patch, the build fails on Solaris 10 with the diagnostic
“Undefined symbol acl_trivial first referenced in file
../lib/libgnu.a(file-has-acl.o)”.
* lib-src/Makefile.in (LIB_HAS_ACL): New macro.
(emacsclient${EXEEXT}): Link with $(LIB_HAS_ACL).
Paul Eggert [Fri, 3 Dec 2021 02:18:39 +0000 (18:18 -0800)]
Work around IBM XL C compiler bug
* src/fileio.c (Fcopy_file): Work around a compiler bug in IBM XL
C for AIX, V12.1 (5765-J02, 5725-C72). Without this patch, the
compiler incorrectly complains “Initialization between types "int"
and "struct timespec" is not allowed” and “Initialization between
types "long" and "struct timespec" is not allowed”.
* test/lisp/tab-bar-tests.el: New file.
(tab-bar-tests-close-other-tabs-with-arg): Test for regression
that closed the selected tab after selecting it.
Juri Linkov [Wed, 1 Dec 2021 17:41:37 +0000 (19:41 +0200)]
* lisp/repeat.el: Use same logic for repeat-check-key and repeat-exit-timeout.
* lisp/repeat.el (repeat-check-key): Use for repeat-check-key the same logic
as is used for repeat-exit-timeout in repeat-post-hook (bug#51390).
(repeat-post-hook): Check for repeat-exit-timeout symbol property.
Juri Linkov [Wed, 1 Dec 2021 17:36:00 +0000 (19:36 +0200)]
* lisp/help.el (help--analyze-key): Prefer posn-set-point over mouse-set-point
* lisp/help.el (help--analyze-key): Use posn-set-point instead of
mouse-set-point that runs the hook mouse-leave-buffer-hook via
mouse-minibuffer-check. Using posn-set-point also unnecessitates
extra conditions added in bug#51421.
* lisp/isearch.el (isearch-describe-key, isearch-describe-mode):
Add precautions to not call isearch-update when the executed
command exited isearch-mode (bug#51173).
Alan Mackenzie [Wed, 1 Dec 2021 15:41:09 +0000 (15:41 +0000)]
CC Mode: Recognise "struct foo {" as introducing a type declaration
This fixes bug #52157.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): If such a construct
is parsed, set the flag at-type-decl which is part of the function's return
value.
Juri Linkov [Tue, 30 Nov 2021 19:05:05 +0000 (21:05 +0200)]
* lisp/repeat.el: Fix long-standing problem when a random key activates map
* lisp/repeat.el (repeat-check-key): New defcustom (bug#51390).
(repeat--command-property): New internal function.
(repeat-check-key): New function.
(repeat-post-hook): Use repeat--command-property and repeat-check-key.
* test/lisp/repeat-tests.el (repeat-tests-check-key): New test.