Yuan Fu [Wed, 5 Oct 2022 21:11:33 +0000 (14:11 -0700)]
Add tree-sitter admin notes
starter-guide: Guide on writing major mode features.
build-module: Script for building official language definitions.
html-manual: HTML version of the manual for easy access.
* admin/notes/tree-sitter/build-module/README: New file.
* admin/notes/tree-sitter/build-module/batch.sh: New file.
* admin/notes/tree-sitter/build-module/build.sh: New file.
* admin/notes/tree-sitter/starter-guide: New file.
* admin/notes/tree-sitter/html-manual/Accessing-Node.html: New file.
* admin/notes/tree-sitter/html-manual/Language-Definitions.html: New file.
* admin/notes/tree-sitter/html-manual/Multiple-Languages.html: New file.
* admin/notes/tree-sitter/html-manual/Parser_002dbased-Font-Lock.html:
New file.
* admin/notes/tree-sitter/html-manual/Parser_002dbased-Indentation.html:
New file.
* admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html: New
file.
* admin/notes/tree-sitter/html-manual/Pattern-Matching.html: New file.
* admin/notes/tree-sitter/html-manual/Retrieving-Node.html: New file.
* admin/notes/tree-sitter/html-manual/Tree_002dsitter-C-API.html: New
file.
* admin/notes/tree-sitter/html-manual/Using-Parser.html: New file.
* admin/notes/tree-sitter/html-manual/build-manual.sh: New file.
* admin/notes/tree-sitter/html-manual/manual.css: New file.
Stefan Kangas [Wed, 5 Oct 2022 13:23:39 +0000 (15:23 +0200)]
Add face help-key-binding in help-char echo
* src/keyboard.c (echo_add_key): Add help-key-binding face to the
"?" key in 'help-char' echo. (Bug#57906)
(syms_of_keyboard) <Qhelp_key_binding>: New DEFSYM.
Po Lu [Wed, 5 Oct 2022 00:31:44 +0000 (08:31 +0800)]
Fix bug in "macintization" of x_draw_glyph_string
* src/nsterm.m (ns_draw_stretch_glyph_string): Restore text decoration
drawing code ommitted during "macintization" to convert the X function
into NS code. Reported by Qiantan Hong <qthong@stanford.edu>.
Yuan Fu [Tue, 4 Oct 2022 20:28:46 +0000 (13:28 -0700)]
Add :override flag for tree-sitter font-lock
* doc/lispref/modes.texi (Parser-based Font Lock): Update manual.
* lisp/treesit.el (treesit-font-lock-settings): Update docstring.
(treesit-font-lock-rules): Handle :override.
(treesit-font-lock-fontify-region): Handle :override. Also set
inhibit-point-motion-hooks to t.
Yuan Fu [Sun, 2 Oct 2022 03:25:25 +0000 (20:25 -0700)]
Ignore some capture name in treesit-font-lock-fontify-region
* doc/lispref/modes.texi (Parser-based Font Lock): Update manual.
* lisp/treesit.el: (treesit-font-lock-fontify-region): Ignore names
that are not face nor function.
(treesit-font-lock-rules): Update docstring.
src/comp.c: Use libgccjit's bitcast API for type coercion, when available.
* (type_to_cast_index, define_type_punning, define_cast_from_to,
define_cast_functions): Define functions when
gcc_jit_context_new_bitcast is not available.
* (emit_coerce): Use gcc_jit_context_new_bitcast to coerce types, when
available.
Brian Cully [Tue, 4 Oct 2022 16:56:23 +0000 (18:56 +0200)]
Provide Podman containers on their own method in Tramp
* lisp/net/tramp-docker.el (tramp-podman-program): New defcustom.
(tramp-podman-method): New defconst.
(tramp-docker-program): Remove "podman" from option list.
(top): Update comments to refer to Docker-alike where necessary.
Add description for how to use the podman method.
Alan Mackenzie [Tue, 4 Oct 2022 16:19:33 +0000 (16:19 +0000)]
CC Mode: Optimize c-fontify-new-found-type and amend a debug spec
* lisp/progmodes/cc-fonts.el (c-fontify-new-found-type): Write the `face'
property directly, rather than removing `fontified' properties and letting
font-lock do the work.
* lisp/progmodes/cc-defs.el (cc-eval-when-compile): Amend the debug spec from
t to (&rest body), in line with the fix to bug #16184.
Stefan Kangas [Tue, 4 Oct 2022 15:36:09 +0000 (17:36 +0200)]
image-dired: Shorten several long names
* lisp/image/image-dired.el (image-dired-image-mode-map)
(image-dired-image-mode): Rename from
'image-dired-display-image-mode-map' and
'image-dired-display-image-mode'. Update all uses and make old
names into obsolete aliases.
(image-dired-display-this, image-dired-display-next)
(image-dired-display-previous): Rename from
'image-dired-display-thumbnail-original-image',
'image-dired-display-next-thumbnail-original', and
'image-dired-display-previous-thumbnail-original'. Update all uses
and make old names into obsolete aliases.
* doc/emacs/dired.texi (Image-Dired): Update documentation for the
above changes, and improve indexing.
Improve manual display tests of undisplayable chars (bug#58168)
Test display of multibyte raw bytes, as well as undisplayable
multibyte chars (C1 controls and other values).
The test still assumes that raw bytes should be displayed identically
to undisplayable characters (such as C1 controls) because that is how
the display code currently works.
* test/manual/redisplay-testsuite.el (test-redisplay-5-toggle)
(test-redisplay-5): Fix likely typo (#x3fffc) of raw byte value.
(test-redisplay-6): New.
* lisp/gnus/message.el (message-mode): Set the image cropping function.
(message--yank-media-image-handler): Factor out...
(message--image-part-string): ... here for reuse.
(message--update-image-crop): Update the cropped data.
Alan Mackenzie [Tue, 4 Oct 2022 13:22:32 +0000 (13:22 +0000)]
CC Mode: Make c-forward-declarator move over a suffix after parens, e.g. const
Also tidy up several inaccuracies in the code.
* lisp/progmodes/cc-engine.el (c-forward-decl-arglist): Move point for modes
other than C++ Mode.
(c-forward-declarator): Move over a suffix following arglist parens
(e.g. const). Set the ARGLIST element of the return value to non-nil on
encountering an unbalanced open parenthesis. Don't move forward out of
enclosing parens.
* lisp/progmodes/cc-mode.el (c-fl-decl-end): Handle being in a multi-line
string. Move forward over token after declarator.
* doc/lispref/display.texi (Showing Images): Adjust.
* lisp/image.el (image-map): Move all keys under the "i" prefix.
(image--repeat-map): New map.
(image-increase-size, image-rotate, image-decrease-size): Make
repeatable.
(image--delayed-change-size): New function.
Denys Nykula [Tue, 4 Oct 2022 12:17:38 +0000 (14:17 +0200)]
Add Ukrainian tutorial
* etc/tutorials/TUTORIAL.uk: Create the translation.
* lisp/language/cyrillic.el: Link "Emacs Tutorial"
to the translation if the system is Ukrainian, and
add our modern greeting as a sample text.
* etc/NEWS:
* etc/tutorials/TUTORIAL.translators: Attribute my work (bug#55250).
Po Lu [Tue, 4 Oct 2022 01:25:06 +0000 (09:25 +0800)]
Fix deiconification handling on FVWM and possibly other window managers
I can't believe we weren't doing this before.
* src/xterm.c (x_handle_wm_state): New function.
(handle_one_xevent): Handle window state changes in WM_STATE
messages, and use them for signalling deiconification.
(bug#58164)
Stefan Kangas [Mon, 3 Oct 2022 22:07:22 +0000 (00:07 +0200)]
Merge from origin/emacs-28
992611b10a Fix documentation of 'TAB' in cc-mode 08e485a2a5 Fix 'org-export-dispatch' command name in manual e5a49f44ff * src/emacs.c (load_pdump): Fix use of xpalloc. 7ff5207624 Avoid assertion violation in 'xpalloc'
Juri Linkov [Mon, 3 Oct 2022 19:54:16 +0000 (22:54 +0300)]
* lisp/repeat.el (repeat-exit-key): Replace type 'key-sequence' with 'key'.
(repeat-post-hook, repeat-echo-message-string): Add backward-compatibility
code for repeat-exit-key to keep support for 'key-sequence' type (bug#55986).
Juri Linkov [Mon, 3 Oct 2022 19:51:33 +0000 (22:51 +0300)]
* lisp/repeat.el (repeat-exit): New command.
(repeat-exit-function): New variable.
(repeat-post-hook): Set repeat-exit-function.
Call repeat-exit from run-with-idle-timer.
Also use repeat--exit.
(repeat--exit): New internal function.
* lisp/help-fns.el (help-fns--insert-menu-bindings): Make this
work better for menus that turn out to not be reachable after all
-- i.e., don't insert " and " before the heading in certain cases.
* lisp/ecomplete.el (ecomplete-add-item): Allow forcing new values.
(ecomplete--remove-item):
(ecomplete--prompt-type): New functions.
(ecomplete-edit, ecomplete-remove): New commands.
Po Lu [Mon, 3 Oct 2022 12:18:22 +0000 (20:18 +0800)]
Fix coding systems used for X input methods
* doc/emacs/mule.texi (International): Refer to X Coding as
well.
(Communication Coding): Document that locale-coding-system is
not always used on X to decode keyboard input.
(X Coding): New node.
* etc/NEWS: Announce change to input method coding resolution.
* lisp/term/x-win.el (x-get-input-coding-system): New function.
* src/coding.c (syms_of_coding): Update doc string of
locale-coding-system.
* src/xfns.c (struct x_xim_text_conversion_data)
(x_xim_text_to_utf8_unix_1, x_xim_text_to_utf8_unix_2)
(x_xim_text_to_utf8_unix): Accept dpyinfo. Use the coding
system specified inside if possible.
(xic_preedit_draw_callback): Pass dpyinfo.
* src/xterm.c (handle_one_xevent): Use XIM coding system for IM
input.
(xim_open_dpy): Try to determine the input method coding system.
(mark_xterm): Mark `xim_coding'.
(syms_of_xterm): New variable `x-input-coding-system'.
* src/xterm.h (struct x_display_info): New field `xim_coding'.
(FRAME_X_XIM_CODING): New macro.
We do not want to support several keymap formats in
`keymap-set' and friends -- the point is to have an
interface with easy-to-understand semantics that
give good feedback on valid/invalid key sequences.
Paul Eggert [Sun, 2 Oct 2022 23:49:20 +0000 (16:49 -0700)]
Port TZ settings to POSIX
* lisp/Makefile.in (.el.elc):
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-times):
Use the POSIX standard TZ=UTC0 rather than the GNU extension
TZ=UTC to set the time zone to UTC.
Paul Eggert [Sun, 2 Oct 2022 20:37:39 +0000 (13:37 -0700)]
Prefer static_assert to verify in seccomp-filter
Prefer static_assert in just one file for now; the idea is to do
it elsewhere eventually. static_assert is standard (starting with
C23) whereas verify is not, and static_assert can be used even in
pre-C23 files due to Gnulib’s support for it.
* lib-src/seccomp-filter.c: Do not include verify.h.
Prefer static_assert to verify.
Alan Mackenzie [Sun, 2 Oct 2022 20:31:12 +0000 (20:31 +0000)]
Suppress irritating/misleading message in make bootstrap about old .elc files
These are the "compile-first" .elc files, artificially given an old timestamp
to cause them later to be native compiled. This fixes bug #58224.
* lisp/Makefile.in (compile-first .el.elc): Give these .elc's the UTC epoch.
Amend the comment.
* src/lread.c (Fload): New variable, epoch_timestamp, initialized to binary
zero. Compare with this the timestamp of .elc's being loaded, and if they
match, don't output the message about the source file being newer than the
file being loaded.
Juri Linkov [Sun, 2 Oct 2022 18:50:08 +0000 (21:50 +0300)]
* lisp/vc/vc-git.el (vc-git-checkin): Add more checks for vc-git-patch-string
Check that vc-git-patch-string contains the same changes that already exists
in the staged area when files were added/removed by vc commands (bug#52349).
Juri Linkov [Sun, 2 Oct 2022 18:34:57 +0000 (21:34 +0300)]
In vc-git-log-incoming use the repository in the command "fetch" (bug#50340)
* lisp/vc/vc-git.el (vc-git-log-incoming): Use repository part
from non-nil remote-location in the command "fetch".
* lisp/vc/vc.el (vc-log-incoming, vc-log-outgoing): Mention in
docstrings and prompts that REMOTE-LOCATION can be a remote branch name.
* doc/emacs/maintaining.texi (VC Change Log): For commands
vc-log-incoming and vc-log-outgoing, use the term "remote location"
instead of "repository".
Stefan Monnier [Sun, 2 Oct 2022 17:52:57 +0000 (13:52 -0400)]
keymap.el: Ease up support for non-`kbd` formats.
While we want to standardize on the `kbd` syntax for user-facing code,
the internal vector representation of key sequences is not going away,
so let's not impose silly `key-description + key-parse` roundtrips.
Also, provide some support for packages stuck with user configs defined
to hold old-style key formats.
* lisp/keymap.el (keymap-set): Allow vectors as `key`.
(key-parse-old-format): New function, which stands out better than
`key-description` when searching for uses of the old syntax.
Fix coding system problems in gnus-read-ephemeral-bug-group
* lisp/gnus/gnus-group.el (gnus-read-ephemeral-bug-group): Don't
bind coding system variables, because that leads to loading other
files (like cookie files) using that coding system (bug#58227).
* lisp/url/url-handlers.el (url-insert-file-literally): New function.
(url-insert): Allow forcing no-decode.
Stefan Kangas [Sun, 2 Oct 2022 13:16:17 +0000 (15:16 +0200)]
Decrease use of the word "Emacsen" in Tramp docs
* lisp/net/tramp-archive.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-uu.el:
* lisp/net/tramp.el: Don't say "Emacsen" when a different wording
would be clearer.