Stefan Kangas [Fri, 3 Dec 2021 05:30:26 +0000 (06:30 +0100)]
Merge from origin/emacs-28
9c222b9c1a Port to C compilers that lack size-0 arrays fed35a8951 Port emacsclient to Solaris 10 f35d6a9c73 * CONTRIBUTE: Improve commit message instructions e0ee1d003a Work around IBM XL C compiler bug 6b99b6eb8b * admin/make-tarball.txt: Various clarifications. bbf4140091 * admin/diff-tar-files: Don't assume .tar.gz. 0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
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”.
Po Lu [Fri, 3 Dec 2021 02:12:29 +0000 (10:12 +0800)]
Make momentum scrolling much nicer
* lisp/pixel-scroll.el (pixel-scroll-precision-momentum-tick):
Set default value to 0.01.
(pixel-scroll-precision-momentum-seconds): New user option.
(pixel-scroll-start-momentum): Improvements to momentum
algorithm.
* 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.
Eli Zaretskii [Thu, 2 Dec 2021 17:44:46 +0000 (19:44 +0200)]
Support display of non-ASCII characters with aligned columns
* src/xdisp.c (get_normal_width): New function.
(gui_produce_glyphs): Use 'get_normal_width' to widen on display
characters whose width is not an integral multiple of the
"standard" width.
(syms_of_xdisp) <align-columns-display>: New boolean variable.
Stefan Kangas [Thu, 2 Dec 2021 17:17:14 +0000 (18:17 +0100)]
update_autogen: Remove unused -H flag
We now update ChangeLog files only when preparing a new release, so
this flag is never used. Keeping it risks confusing more than it
helps.
* admin/update_autogen: Remove the -H flag as it is no longer used.
* doc/lispref/processes.texi (Asynchronous Processes): Document it.
* lisp/cus-start.el (standard): Customize.
* src/process.c (read_process_output_error_handler)
(exec_sentinel_error_handler): Use it.
(syms_of_process): New variable process-error-pause-time (bug#19457).
Eli Zaretskii [Thu, 2 Dec 2021 10:32:17 +0000 (12:32 +0200)]
Fix recent changes related to 'glyphless-display-mode'
* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Fix
spelling of "bidirectional".
* lisp/international/characters.el (char-acronym-table): Fix
acronyms for LRI and RLI: use their accepted shorthands.
(glyphless-char-display-control): Fix spelling of doc string.
* doc/lispref/display.texi (Glyphless Chars): Fix spelling and add
a cross-reference.
Gemini is a relatively new text-based web protocol, similar to
gopher. There's the "elpher" package to browse gopher and gemini
pages. Adding it to the regexp will make Emacs be aware of gemini links,
e.g. in ERC.
* lisp/net/browse-url.el (browse-url-button-regexp): Add support
for the gemini: URL type.
* lisp/international/characters.el (char-acronym-table): Add the
ISOLATE characters.
(update-glyphless-char-display): Implement bidi-control, and mark
all Cf characters we don't know about as UNK.
(glyphless--bidi-control-characters): New variable.
(glyphless-char-display-control): Add a new type -- bidi-control.
* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Add a
new type -- bidi-control.
cedet/semantic/bovine/c.el:1462:25: Warning: value returned from
(string= s "static") is unused
* lisp/cedet/semantic/bovine/c.el (semantic-tag-protection): Merge two
`when` into an `if` and set `prot` instead of throwing away a result.
Use `pcase` while we're at it.
Po Lu [Thu, 2 Dec 2021 03:01:59 +0000 (11:01 +0800)]
Add some primitive momentum-based precision scrolling
The algorithm used to scroll the display kinetically is very
simple and needs improvement. Someone should work on that
eventually.
* lisp/pixel-scroll.el (pixel-scroll-precision-use-momentum):
New user option.
(pixel-scroll-precision-mode-map): Add
`pixel-scroll-start-momentum'.
(pixel-scroll-kinetic-state):
(pixel-scroll-accumulate-velocity):
(pixel-scroll-calculate-velocity): New functions.
(pixel-scroll-start-momentum): New command.
* doc/emacs/dired.texi (Misc Dired Features): Document it (bug#23812).
* lisp/dired.el (dired-free-space): New user option.
(dired-insert-directory): Use it from here.
(dired--insert-disk-space): New function that uses the user option.
* lisp/files.el (insert-directory): Don't transform "total" here.
* lisp/ls-lisp.el (ls-lisp--insert-directory): Or here. Instead
just leave the "total <num>" bit alone, and let Dired transform it.
* test/lisp/files-tests.el (files-tests): Move "available" tests
to dired-tests.
* test/lisp/dired-tests.el (data-dir): Moved here.
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).
Robert Pluim [Wed, 1 Dec 2021 16:11:07 +0000 (17:11 +0100)]
characters.el: remove repetition in glyphless-char-display-control
* lisp/international/characters.el (glyphless-char-display-method):
New custom widget for the different options for displaying glyphless
characters.
(glyphless-char-display-control): Use 'glyphless-char-display-method'.
Fix closure-conversion of shadowed captured lambda-lifted vars
Lambda-lifted variables (ones passed explicitly to lambda-lifted
functions) that are also captured in an outer closure and shadowed
were renamed incorrectly (bug#51982).
Reported by Paul Pogonyshev.
* lisp/emacs-lisp/cconv.el (cconv--lifted-arg): New.
(cconv-convert): Provide correct definiens for the closed-over
variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
* test/lisp/emacs-lisp/cconv-tests.el (cconv-tests--intern-all)
(cconv-closure-convert-remap-var): Add tests.
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.
Use proportional fonts in the Gnus headers by default
* lisp/gnus/gnus-art.el (gnus-header): Inherit from `variable-pitch'.
(gnus--variable-pitch-p): New helper function.
(gnus-article-treat-fold-headers): Fill using pixel filling.
Eli Zaretskii [Wed, 1 Dec 2021 13:36:55 +0000 (15:36 +0200)]
Support precision mouse scrolling on MS-Windows
* src/w32fns.c (w32_wnd_proc): Pass the WM_SETTINGCHANGE message
to the Lisp thread.
* src/w32term.c (w32_construct_mouse_wheel): Support mice with
precision scrolling wheel.
(w32_get_mouse_wheel_vertical_delta): New function.
(w32_read_socket): When the WM_SETTINGCHANGE is received, call
'w32_get_mouse_wheel_vertical_delta'.
(w32_initialize): Call 'w32_get_mouse_wheel_vertical_delta' at
startup.
* src/nsterm.m (syms_of_nsterm):
* src/haikuterm.c (syms_of_haikuterm):
* src/xterm.c (syms_of_xterm): Remove window-system specific
variables for coalescing mwheel events.
* src/keyboard.c (syms_of_keyboard)
<mwheel-coalesce-scroll-events>: New variable, to replace the
above platform-specific ones.
* doc/lispref/commands.texi (Misc Events): Improve wording of the
description of mouse-wheel events.
Stefan Kangas [Wed, 1 Dec 2021 10:23:29 +0000 (11:23 +0100)]
update_autogen: Remove deprecated -I flag
* admin/update_autogen (info_dir): Remove deprecated -I flag; it is no
longer used since info/dir is now generated at install time if needed,
and is not in the repository any more.
Po Lu [Wed, 1 Dec 2021 01:33:35 +0000 (09:33 +0800)]
Make pixel scrolling faster
* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down): Get
rid of big motion loop.
(pixel-scroll-precision-scroll-up): Stop subtracting height of
window lines.
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.