Po Lu [Fri, 30 Sep 2022 06:54:15 +0000 (14:54 +0800)]
Fix calculation of frame times when X server time overflows
* etc/TODO: Add TODO about frame synchronization and animations.
* src/xterm.c (x_display_set_last_user_time): Handle cases when
the monotonic time is not the server time due to the latter
overflowing.
* lisp/language/indian.el ("Toto"): New language environment.
Add input method.
* lisp/international/fontset.el (script-representative-chars):
Support Toto.
* lisp/leim/quail/indian.el ("toto"): New input method.
* etc/NEWS: Announce the new language environment.
Stefan Kangas [Thu, 29 Sep 2022 16:44:03 +0000 (18:44 +0200)]
Fix loading wallpaper.el on MS-Windows
* lisp/image/wallpaper.el (wallpaper--find-command)
(wallpaper--find-command-args): Avoid backtrace when
'wallpaper--find-setter' returns nil, e.g. on MS-Windows.
(Bug#58167)
Alan Mackenzie [Thu, 29 Sep 2022 15:22:42 +0000 (15:22 +0000)]
CC Mode: Refactor c-forward-delarator and callers
c-forward-declarator now moves over a complete declarator, including any
arglist expression, but possibly not including certain C++20 constructs.
* lisp/progmodes/cc-engine.el (c-forward-decl-arglist): New function,
extracted from c-do-declarators.
(c-forward-declarator): Extend the result list by one element, denoting
whether the function parsed an argument list. Insert special handling for a
C++ operator<op> construct. If there is a parenthesis expression, and it is
an argument list, move forward over it.
(c-do-declarators): Append an optional parameter, cdd-anon-accepted
instructing the function to handle declarators without identifiers. Extract
c-forward-decl-arglist.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): New &optional
parameter accept-anon, as above. Analyze and use the identifier location
returned by c-do-declarators, rather than using c-last-identifier-range.
(c-font-lock-single-decl): Determine accept-anon from the context, passing it
as argument to c-font-lock-declarators.
* lisp/progmodes/cc-langs.el (c-opt-identifier-prefix-key): Make a
c-lang-defvar out of this existing c-lang-defconst.
* lisp/progmodes/cc-mode.el (c-fl-decl-end): Adapt for the new
c-forward-declarator which now moves over arglists. Amend better to handle
certain syntactically invalid constructs in C++.
Peter Münster [Wed, 28 Sep 2022 23:39:30 +0000 (01:39 +0200)]
New command image-dired-do-flagged-delete
* lisp/image/image-dired.el (image-dired-delete-marked): Remove command,
because it was too buggy.
(image-dired-do-flagged-delete): New command that does almost the same
as the above removed command but with flagged images.
(image-dired-thumbnail-mode-map): Bind "x" to
'image-dired-do-flagged-delete'.
Peter Münster [Wed, 28 Sep 2022 23:25:10 +0000 (01:25 +0200)]
image-dired-delete-char: Don't disturb formatting
* lisp/image/image-dired.el (image-dired-delete-char): Don't disturb
the expected formatting of the thumbnail buffer (always one
space/newline after a thumbnail).
Stefan Kangas [Thu, 29 Sep 2022 14:10:27 +0000 (16:10 +0200)]
wallpaper-set: Get monitor name on non-graphical display
* lisp/image/wallpaper.el
(wallpaper--format-arg): Break out function from here...
(wallpaper--x-monitor-name): ...to here. Try to get the monitor name
non-graphical displays, and prompt if that doesn't work.
(wallpaper-default-set-function): Improve debugging output.
Ref. https://lists.gnu.org/r/emacs-devel/2022-09/msg01910.html
Stefan Kangas [Tue, 27 Sep 2022 16:16:51 +0000 (18:16 +0200)]
Make format-spec accept function substitutions
* lisp/format-spec.el (format-spec): Accept a function producing the
substitution for a character.
* doc/lispref/strings.texi (Custom Format Strings): Document the
above change.
* test/lisp/format-spec-tests.el (format-spec/function): New test.
Ref. https://lists.gnu.org/r/emacs-devel/2022-09/msg01875.html
* lisp/language/indian.el ("Wancho"): New language environment.
Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Wancho.
* lisp/leim/quail/indian.el ("wancho"): New input method.
* etc/HELLO: Add a Wancho greeting.
* etc/NEWS: Announce the new language environment.
Add support for the Mende Kikakui script (bug#58151)
* lisp/language/misc-lang.el ("Mende Kikakui"): New language environment.
Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Mende Kikakui, Indic Siyaq Numbers,
Ottoman Siyaq Numbers.
* lisp/leim/quail/misc-lang.el ("mende-kikakui"): New input method.
* etc/HELLO: Add Mende Kikakui greeting.
* etc/NEWS: Announce the new language environment.
Stefan Kangas [Wed, 28 Sep 2022 12:50:24 +0000 (14:50 +0200)]
Add .mailmap for proper git log output
This file is used to fix a few misspelled names in various git
listings (e.g., "git log"). This can be used to fix incorrect
attribution, poor display, or names showing up more than once.
It also allows updating an old email addresses to a new one.
See "man git-shortlog" for more information on the format.
* lisp/language/misc-lang.el ("Adlam"): New language environment.
Add composition rules for Adlam. Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars):
Support Adlam.
* lisp/leim/quail/misc-lang.el ("adlam"): New input method.
* etc/HELLO: Add Adlam greeting.
* etc/NEWS: Announce the new language environment.
Po Lu [Wed, 28 Sep 2022 12:33:24 +0000 (20:33 +0800)]
Apply root window coordinate optimizations to crossing events as well
* src/xterm.c (xi_compute_root_window_offset_enter): New
function.
(handle_one_xevent): Apply root window crossing optimizations to
XI_Enter and XI_Leave events too. Not strictly necessary but
since we apply them to motion events it would be consistent to
apply them to crossing events as well as recommended by the
ICCCM.
* doc/emacs/misc.texi (DocView Navigation):
* lisp/doc-view.el (doc-view-imenu-title-format, doc-view-imenu-flatten):
(doc-view--imenu-subtree): customizable format for imenu entry titles,
and flag to disable nested submenus.
* lisp/doc-view.el (doc-view--pdf-outline): clean up whitespace
markers '\r' and '\t' in imenu item titles (bug#58131).
* lisp/net/eww.el (eww-follow-link): Do a text property search instead
of re-rendering to follow #target links in the same page. (bug#58118)
(eww-link-keymap): Bind <mouse-2> to eww-follow-link as well.
Stefan Kangas [Tue, 27 Sep 2022 22:41:01 +0000 (00:41 +0200)]
image-dired: End thumbnail file names with ".jpg"
* lisp/image/image-dired-util.el (image-dired-thumb-name): Always
end thumbnail name in ".jpg" and simplify naming to just use the
SHA-1 hash. (Bug#57961)
* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/image-dired): Adjust test for the above
change.
* etc/NEWS: Announce the above change.
Paul Eggert [Wed, 28 Sep 2022 08:06:10 +0000 (01:06 -0700)]
Port better to C23 bool+true+false keywords
C23 is adding the C++ keywords bool, true, and false;
prefer them to <stdbool.h> if they are available.
* admin/merge-gnulib (GNULIB_MODULES):
Add stdbool, which emulates C23 on pre-C23 platforms.
(AVOIDED_MODULES): Remove stdbool; Gnulib has renamed
this module to stdbool-c99 and nobody uses it so it does
not need to be avoided.
* m4/c-bool.m4: New file, from Gnulib stdbool module.
* lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h:
* src/emacs-module.c, src/nsterm.m, src/systhread.h:
* test/src/emacs-module-resources/mod-test.c:
Use the C23 style and use bool without including <stdbool.h>.
The Gnulib stdbool module causes config.h to include stdbool.h
on pre-C23 platforms.
* src/emacs-module.h.in:
Don’t include <stdbool.h> if C23 or later, or if
it has already been included.
Michael Albinus [Tue, 27 Sep 2022 16:46:28 +0000 (18:46 +0200)]
Some tramp-docker.el adaptions
* lisp/net/tramp-docker.el (tramp-docker--completion-function):
Add ;;;###tramp-autoload cookie. Make implementation more robust.
(tramp-methods) Use `tramp-default-remote-shell'.
* lisp/doc-view.el (doc-view-imenu-enabled): user option to disable
imenu generation.
* lisp/doc-view.el (doc-view--outline-rx):
(doc-view--pdf-outline, doc-view--imenu-subtree, doc-view-imenu-index):
functions implementing the imenu index generation via mutool.
* lisp/doc-view.el (doc-view-imenu-setup, doc-view-mode): setup of the
new functionality in doc-view mode.
* lisp/imenu.el (imenu-submenus-on-top):
(imenu--split-menu): new local variable to optionally inhibit
grouping of entries with children at the top of imenu menus.
* doc/emacs/misc.texi: documentation for the new functionality
(bug#58103).
Richard Hansen [Mon, 26 Sep 2022 21:07:52 +0000 (17:07 -0400)]
ert-x: Improve realism of `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): Set
`inhibit-read-only' and `buffer-read-only' to nil when executing the
body to provide a more realistic test environment.
Po Lu [Tue, 27 Sep 2022 02:50:34 +0000 (10:50 +0800)]
Optimize coordinate translation during event handling
These changes noticeably improve turning the mouse wheel on top of
scroll bars etc over slow network connections.
* src/xterm.c (x_dnd_note_self_position, x_dnd_note_self_wheel)
(x_dnd_note_self_drop): Use x_translate_coordinates.
(x_compute_root_window_offset): New function for calculating and
caching root window offsets of edit window.
(x_translate_coordinates): New function. Use cached values
whenever possible.
(xi_compute_root_window_offset)
(xi_compute_root_window_offset_pinch): New wrappers for XI2
events.
(x_construct_mouse_click, handle_one_xevent): Use
x_translate_coordinates wherever appropriate.
* src/xterm.h (struct x_output): New fields for keeping track of
the root window offset of the edit window.
Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
* src/composite.c (composition_gstring_adjust_zero_width): New function.
* src/composite.h: Declare it.
* src/font.c (Ffont_shape_gstring): Use it before putting gstring to cache.
Stefan Kangas [Mon, 26 Sep 2022 19:26:50 +0000 (21:26 +0200)]
Set XFCE wallpaper also in single-workspace-mode
This fixes setting the wallpaper on XFCE whether or not the
"/backdrop/single-workspace-mode" setting is true or false.
That XFCE setting controls whether or not the same wallpaper is used
on all workspaces or not.
* lisp/image/wallpaper.el (wallpaper-setter)
(wallpaper-command-args, wallpaper-default-set-function): Allow
using a function for getting the command line arguments.
(wallpaper-xfce-command-args): New function.
(wallpaper--default-setters): Use above new function for XFCE.
Alan Mackenzie [Mon, 26 Sep 2022 19:16:33 +0000 (19:16 +0000)]
CC Mode: Handle C++20 concepts
* lisp/progmodes/cc-align.el (c-lineup-topmost-intro-cont): Amend so as not to
indent lines following a requires line.
* lisp/progmodes/cc-engine.el (c-forward-primary-expression)
(c-forward-c++-requires-clause): New functions.
(c-forward-declarator): Skip forward over any trailing requires clause.
(c-forward-decl-or-cast-1): Skip requires clauses before and after the type.
Amend the second element of the return list to include information on two
consecutive identifiers in <...>.
(c-looking-at-or-maybe-in-bracelist): Don't recognize braces in requires
expressions as brace lists.
(c-guess-basic-syntax): CASE 5D.7: New case to handle the continuation of a
"concept foo = " line.
* lisp/progmodes/cc-fonts.el (c-basic-matchers-before): Add a new clause to
handle the declaration of a concept.
(c-get-fontification-context): Treat the arglist of a requires construct as a
declaration arglist.
* lisp/progmodes/cc-langs.el (c-equals-nontype-decl-kwds/key)
(c-fun-name-substitute-kwds/key, c-pre-concept-<>-kwds/key): New
c-lang-consts/vars.
(c-constant-key): New c-lang-var.
(c-type-decl-suffix-key): Include "requires" in the keywords matched.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): Fix an off by one error. Use
equal rather than eq to compare two syntax contexts.
Stefan Kangas [Mon, 26 Sep 2022 12:38:25 +0000 (14:38 +0200)]
Fix setting the wallpaper in XFCE
* lisp/image/wallpaper.el (wallpaper-command-args)
(wallpaper-default-set-function): Support new format specifiers
%S for screen, %W for workspace, and %M for monitor.
(wallpaper--default-setters): Use above new specifiers for XFCE.
(wallpaper--format-arg): New defun broken out from...
(wallpaper-default-set-function): ...here.
(wallpaper--get-height-or-width): Support noninteractive use.
* test/lisp/image/wallpaper-tests.el (wallpaper--format-arg/filename)
(wallpaper--format-arg/filename-hex)
(wallpaper--format-arg/width, wallpaper--format-arg/screen)
(wallpaper--format-arg/monitor, wallpaper--format-arg/workspace):
New tests.
Stefan Kangas [Sun, 18 Sep 2022 09:48:24 +0000 (11:48 +0200)]
Rewrite wallpaper.el to use a cl-defstruct
* lisp/image/wallpaper.el
(wallpaper--default-commands): Delete variable.
(wallpaper-setter): New cl-defstruct.
(wallpaper--default-methods-create): New macro.
(wallpaper--default-setters):
(wallpaper--current-setter): New variables.
(wallpaper--find-setter): New defun to pick a wallpaper-setter.
(wallpaper--find-command, wallpaper--find-command-args):
Use 'wallpaper--find-setter'.
(wallpaper-command): Doc fix.
* test/lisp/image/wallpaper-tests.el
(wallpaper--find-command/return-string)
(wallpaper--find-command-args/return-list)
(wallpaper--image-file-regexp/return-string): New tests.
* lisp/vc/log-edit.el (log-edit-summary-separator): Add new face.
(log-edit-font-lock-keywords): Replace hardcoded face attributes with
named face.
* etc/NEWS: Announce the new face.
* lisp/net/eww.el (eww-tag-input): Don't claim to have an URL here
(bug#58091).
* lisp/net/shr.el (shr-next-link, shr-previous-link): Search for
shr-tab-stop instead of shr-url so that we can be more general.
(shr-urlify): Mark all links as tabbable-to.