Po Lu [Mon, 5 Dec 2022 12:41:37 +0000 (20:41 +0800)]
Fix build with old XCB
* src/xfns.c (x_get_net_workarea):
* src/xterm.c (x_dnd_compute_toplevels, x_dnd_get_proxy_proto)
(x_dnd_get_wm_state_and_proto, handle_one_xevent): Do not
include xcb_aux.h. Use XA_ constants instead of XCB_ATOM_ ones.
Stefan Kangas [Mon, 5 Dec 2022 05:30:21 +0000 (06:30 +0100)]
Merge from origin/emacs-29
ec00d292ec0 Improve treesit-fontify-with-override 4bcdb1cc65b Make killing a non-last client work the same no matter th... a27f61f6f48 Use the function 'window-system' on the tab-bar/tab-line ... 432b9655ae0 Restore font-lock-type-face for lisp mode &symbols
Sean Whitton [Sun, 4 Dec 2022 22:56:35 +0000 (15:56 -0700)]
Improve passing user switches to Git log commands (bug#59414)
* lisp/vc/vc-git.el (vc-git-log-switches): Revise docstring.
(vc-git-shortlog-switches): New defcustom.
(vc-git-print-log): Use vc-git-log-switches or
vc-git-shortlog-switches depending on whether printing a shortlog.
(vc-git-log-outgoing, vc-git-log-incoming): Use
vc-git-shortlog-switches.
(vc-git-log-search, vc-git-expanded-log-entry): Use
vc-git-log-switches.
* etc/NEWS: Document the new defcustom.
Yuan Fu [Sun, 4 Dec 2022 08:22:28 +0000 (00:22 -0800)]
Improve treesit-fontify-with-override
This also fixes fontification problem with c-ts-mode--fontify-defun.
Now treesit-fontify-with-override clips the fontification region for
the user, so no need for (max start node-start) shenanigans anymore.
More importantly it doesn't fontify unless the region between
node-start and node-end intersects with the region between start and
end, which fixes the problem with c-ts-mode--fontify-defun.
* lisp/treesit.el (treesit-fontify-with-override): Add optional
parameter BOUND-START and BOUND-END. Wrap the function body in a
when-form.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator)
(c-ts-mode--fontify-variable)
(c-ts-mode--fontify-defun)
(c-ts-fontify-error)
* lisp/progmodes/js.el (js--fontify-template-string)
* lisp/progmodes/python.el (python--treesit-fontify-string): Use the
new signature.
Jim Porter [Fri, 2 Dec 2022 20:14:50 +0000 (12:14 -0800)]
Make killing a non-last client work the same no matter the auto-stop setting
Previously, if 'server-stop-automatically' was configured for
'kill-terminal' or 'delete-frame', killing a client via
'save-buffers-kill-terminal' wouldn't prompt about the saving files in
the client's buffer list (as it does when not using those settings).
This change ensures that those settings only apply when killing the
last client, as described in the manual (bug#51993).
* lisp/server.el (server-save-buffers-kill-terminal): Handle
'server-stop-automatically' behavior in this function, rather than
calling 'server-stop-automatically--handle-delete-frame'.
Juri Linkov [Sun, 4 Dec 2022 19:30:34 +0000 (21:30 +0200)]
Use the function 'window-system' on the tab-bar/tab-line (bug#59620)
* lisp/tab-bar.el (tab-bar-separator)
(tab-bar-format-align-right, tab-bar-auto-width):
* lisp/tab-line.el (tab-line-format-template): Replace the variable
'window-system' with the function call '(window-system)'.
Tom Gillespie [Sun, 4 Dec 2022 06:41:15 +0000 (22:41 -0800)]
Restore font-lock-type-face for lisp mode &symbols
* lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2)
(lisp-el-font-lock-keywords-2): Restore use of type face instead of
builtin face for &symbol keywords. This fixes what appears to be
a copy paste error that changed the face for common lisp and emacs
lisp &symbol style keywords that was introduced in commit a498e5f83 by restoring the type face to font-lock-type-face as
consistent with the comments.
Kai Ma [Sat, 3 Dec 2022 10:17:26 +0000 (18:17 +0800)]
Prevent a segfault when deleting a fullscreen frame on NextStep.
* nsterm.m ([EmacsView resetCursorRects:]): Be defensive when
accessing FRAME_OUTPUT_DATA. [resetCursorRects:] can be called
from the event loop after the frame is deleted. When this
happens, emacsframe is NULL. This means there is an underlying
leak of the EmacsView object! (Bug#59794)
Do not merge to master.
Po Lu [Sun, 4 Dec 2022 12:01:31 +0000 (20:01 +0800)]
Make Emacs build with Xfixes support on old versions of the library
* src/xterm.c (xfixes_toggle_visible_pointer):
(x_toggle_visible_pointer):
(XTtoggle_invisible_pointer, x_term_init): Disable code
requiring fixes 4.0 or later when the fixes library is older.
* src/xterm.h: Define missing types needed by other extensions
when the fixes library is too old.
* configure.ac: Allow building with any version of the Xfixes
extension library.
Speed up Unicode normalisation tests by a factor of 5
After this change, ucs-normalize-tests are still very slow but
somewhat less disastrously so (from 100 to 20 min on this machine).
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--normalization-equal-p)
(ucs-normalize-tests--normalization-chareq-p)
(ucs-normalize-tests--rule1-holds-p)
(ucs-normalize-tests--rule2-holds-p)
(ucs-normalize-tests--part1-rule2):
Run only over the Unicode code space.
Hoist `with-current-buffer` to reduce overhead.
Fix and expand tests broken by commit 2772ebe366 of 2022-11-28
* test/lisp/emacs-lisp/comp-tests.el
(with-test-native-compile-prune-cache)
(test-native-compile-prune-cache)
(test-native-compile-prune-cache/delete-only-eln)
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
Check that the last directory in `native-comp-eln-load-path' is
not affected by `native-compile-prune-cache'.
Eli Zaretskii [Sat, 3 Dec 2022 10:21:00 +0000 (12:21 +0200)]
Fix handling of relative directories in "--init-directory=DIR"
* lisp/startup.el (command-line): Interpret non-absolute file
names in '--init-directory' relative to the directory from
which Emacs is started. (Bug#59795)
Eli Zaretskii [Sat, 3 Dec 2022 09:32:00 +0000 (11:32 +0200)]
Fix gud-minor-mode-menu
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode)
(easy-mmode-define-keymap): Don't declare obsolete, since we are
still using it in gud.el. (Bug#59769) (Bug#59605)
Do not merge to master.
Eli Zaretskii [Sat, 3 Dec 2022 09:16:41 +0000 (11:16 +0200)]
Revert "Make easy-mmode-defmap obsolete and adjust only caller"
This reverts commit 8bb5c1bfec0929f2ba419e1c503f5acc01c336c2.
That commit lost too many useful features in the GUD menus
and caused several bugs, the last of them bug#59769.
* test/lisp/server-tests.el (server-tests/can-create-frames-p):
Don't attempt to create frames if TERM=dumb, which what we have
if run from M-x compile (for instance).
(server-tests/server-force-stop/keeps-frames): Delete created frame so
that it doesn't cause trouble for other tests.
Yikai Zhao [Tue, 29 Nov 2022 14:30:14 +0000 (22:30 +0800)]
Speed up auto-completion in 'sh-script-mode'
* lisp/progmodes/sh-script.el (sh--cmd-completion-table-gen): New
function, replacement for 'sh--cmd-completion-table'.
(sh--cmd-completion-table): Function removed.
(sh-completion-at-point-function): Use
'sh--cmd-completion-table-gen'. (Bug#59678)
* lisp/emacs-lisp/multisession.el (multisession-edit-value):
Do not use `bound-and-true-p' on a non-symbol. This reverts
commit bd586121ac21e046f60f75eeb0200866c38d6f9f.
Po Lu [Fri, 2 Dec 2022 13:00:30 +0000 (21:00 +0800)]
More behind the scenes transparent speedups around xselect.c
* src/xdisp.c (display_menu_bar): Fix compiler warning about
NULL pointer dereference.
* src/xfns.c (Fx_begin_drag): Use x_intern_atoms.
(Fx_change_window_property): Pass dpyinfo to
x_fill_property_data.
* src/xselect.c (lisp_data_to_selection_data): Use
x_intern_atoms instead of syncing for each atom.
(x_fill_property_data, x_send_client_event): Use
x_intern_cached_atom.
* src/xterm.c (x_intern_atoms): New function.
* src/xterm.h: Update prototypes.
Stefan Kangas [Fri, 2 Dec 2022 11:36:35 +0000 (12:36 +0100)]
Merge from origin/emacs-29
39e0c60176 * lisp/tab-bar.el (tab-bar-format-align-right): Fix alignm... bf66b90b9a Fix the width of margins for icons in outline-minor-mode (... 2e4960d63d ; Change c-ts-mode--base-mode to c-ts-base-mode 1aa1f8432b Add new TypeScript mode tsx-ts-mode ad0563855f Add case and match to python--treesit-keywords (bug#59720) 16e68e64f9 ; * lisp/progmodes/c-ts-mode.el: Change rx to regexp-opt. 3bccef6f52 project-files (VC-aware): Make sure the VC backend is loaded 03a40b974c term--update-term-menu: Add the menu to term-terminal-menu 368c7c7d8e Improve detection of very long lines 9c58ea37af ; Fix last change in proced.el 0c1495574a Add colors to Proced (bug#59407) 91dba5b066 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/e... 70ecdebc92 ; Fix typos (don't abbreviate "with" or "without") d94c5870c0 ; * lisp/tab-bar.el (tab-bar-change-tab-group): Doc fix.
Juri Linkov [Fri, 2 Dec 2022 07:59:53 +0000 (09:59 +0200)]
* lisp/tab-bar.el (tab-bar-format-align-right): Fix alignment on TTY frames.
Calculate the alignment from the left edge instead of the right edge
since the `right' spec doesn't work on TTY frames when windows are split
horizontally (bug#59620).
* lisp/emacs-lisp/icons.el (icons--create): Handle :width as well.
* lisp/outline.el (outline--margin-width, outline-margin-width):
New variables.
(outline-open-in-margins, outline-close-in-margins)
(outline-close-rtl-in-margins): Don't inherit from parents.
Use `:width font' instead of `:height 10'.
(outline-minor-mode): Calculate the number of columns for margins
to fit the icons.
There are in fact two languages supporting TypeScript for tree-sitter.
Because TSX causes some ambiguities with types there are two grammars,
one called typescript and one called tsx. To account for this and to
be as correct as possible we enable using both.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Change to a function to accomodate
the two languages.
(typescript-ts-mode--font-lock-settings): Change to a function to
accomodate the two languages.
(typescript-ts-base-mode): Parent mode for typescript-ts-mode
and tsx-ts-mode.
(typescript-ts-mode): Derive from typescript-ts-base-mode and
extend with language specific settings
(tsx-ts-mode): New major mode that derives from
typescript-ts-base-mode and extend it with language specific
settings
Add autoload cookies for the respective file type extensions: .ts and
.tsx.
Sean Whitton [Thu, 1 Dec 2022 22:14:28 +0000 (15:14 -0700)]
term--update-term-menu: Add the menu to term-terminal-menu
Reading bug#5641, the intention was to add this to the existing
"Terminal" menu for term-mode buffers, not to the local keymaps of all
other buffers. Moreover, the existing code signaled errors when
switching to buffers with no local keymap, such as term-mode buffers
whose processes have died.
* lisp/term.el (term--update-term-menu): Add the menu to
term-terminal-menu, instead of implicitly trying to add it to every
local keymap.
Eli Zaretskii [Thu, 1 Dec 2022 18:15:52 +0000 (20:15 +0200)]
; Fix last change in proced.el
* lisp/proced.el (proced-low-memory-usage-threshold)
(proced-medium-memory-usage-threshold, proced-run-status-code)
(proced-interruptible-sleep-status-code)
(proced-uninterruptible-sleep-status-code, proced-executable): Fix
doc strings.
(proced-format-time): Simplify the format, to avoid bogus warnings
from the byte-compiler.
* etc/NEWS: Move Proced entries to one place and fix their
wording.
Laurence Warne [Wed, 16 Nov 2022 14:32:44 +0000 (14:32 +0000)]
Add colors to Proced (bug#59407)
Add a new custom variable proced-enable-color-flag which when set to a
non-nil value (defaults to nil), will prompt some format functions to
furnish their respective process attributes with colors and effects in
order to make them easier to distinguish and highlight possible issues
(e.g. high memory usage), in a manner similar to htop.
In particular, the current Emacs process id is highlighted purple in
both the process id and parent process id columns, session leaders
have their process ids underlined, larger memory sizes for rss
are highlighted in darker shades of orange, and the first word in the
args property (the executable) is highlighted in blue.
* lisp/proced.el (proced-grammar-alist): Update to use the new format
functions.
(proced-low-memory-usage-threshold): New custom variable to determine
whether a value represents 'low' memory usage, used only in
proced-format-memory for coloring.
(proced-medium-memory-usage-threshold): New custom variable to
determine whether a value represents 'medium' memory usage, used only
in proced-format-memory for coloring.
(proced-enable-color-flag): New custom variable to toggle coloring.
(proced-run-status-code, proced-interruptible-sleep-status-code)
(proced-uninterruptible-sleep-status-code, proced-executable)
(proced-executable, proced-memory-gb, proced-memory-mb)
(proced-memory-default, proced-pid, proced-ppid, proced-pgrp)
(proced-sess, proced-cpu, proced-mem, proced-user, proced-time-colon):
New faces.
(proced-format-time): Edit function to color colons using
proced-time-colon.
(proced-format-args): Edit function to color executables using
proced-executable.
(proced-format-state): New function to color states.
(proced-format-pid): New function to color process ids.
(proced-format-ppid): New function to color parent process ids.
(proced-format-pgrp): New function to color process group ids.
(proced-format-sess): New function to color process session leader
ids.
(proced-format-cpu): New function to color cpu utilization.
(proced-format-mem): New function to color memory utilization.
(proced-format-user): New function to color the user a process
belongs to.
Eli Zaretskii [Thu, 1 Dec 2022 12:40:47 +0000 (14:40 +0200)]
Fix compilation of Org 9.6 on MS-Windows
* lisp/org/org-clock.el (org-x11idle-exists-p): Don't try to
invoke "command x11idle" on MS-Windows and MS-DOS. This fixes a
hang during byte-compilation of Org.
Po Lu [Thu, 1 Dec 2022 06:24:43 +0000 (14:24 +0800)]
Merge from origin/emacs-29
4161023a63 Fix crashes and memory leaks during display deinitialization 785fa80159 New user option: project-vc-extra-root-markers 7a1f1825fd Add inline to c-ts-mode--keywords 3d976d6a03 Remove duplicate "friend" from c-ts-mode--keywords 01e7d4b2a1 Make treesit-defun-prefer-top-level more flexible fb5d9ff559 Fix c-ts-mode defun movement (bug#59628) 7397f2099b * lisp/tab-bar.el: Keep tabs of the same group together (b... 832b013ef0 Insert news for installed packages only cc6efa7992 ; Fix type error in 'package-maintainers' ee32ae7c36 ; * etc/NEWS: Add missing tree-sitter based modes. 33546d6dd2 ; * etc/NEWS: Move an entry to a proper place. (bug#59718) 8617edfffd ; Fix typos
Dmitry Gutov [Thu, 1 Dec 2022 02:05:49 +0000 (04:05 +0200)]
New user option: project-vc-extra-root-markers
* lisp/progmodes/project.el: Commentary update.
(project-vc, project-vc-include-untracked, project-vc-name):
Update docstrings. Rename 'VC project' to 'VC-aware project'.
(project-vc-extra-root-markers): New option (bug#41572).
(project-try-vc): Use it. Construct a single regexp from all and
validate it using the MATCH argument of 'directory-files'. Call
'locate-dominating-file' directly.
(project-ignores): Support VC-aware project instances with nil
value of VC backend.
* test/lisp/progmodes/project-tests.el (project-vc-recognizes-git)
(project-vc-extra-root-markers-supports-wildcards)
New tests.
(project-tests--this-file): New variable.