]> git.eshelyaron.com Git - emacs.git/log
emacs.git
21 months agoAvoid build failure when building without -fsanitize=address. feature/asan-gc-poisoning
Vibhav Pant [Sun, 18 Dec 2022 14:55:55 +0000 (20:25 +0530)]
Avoid build failure when building without -fsanitize=address.

* src/lisp.h (UNALIGNED_LOAD_SIZE): Only use the sanitizer version of
the macro when USE_SANITIZER_UNALIGNED_LOAD is defined, avoiding link
errors when building without -fsanitize=address.

21 months agosrc/alloc.c: Convert ASan functions to macros to reduce overhead.
Vibhav Pant [Sun, 18 Dec 2022 14:35:33 +0000 (20:05 +0530)]
src/alloc.c: Convert ASan functions to macros to reduce overhead.

* src/alloc.c (ASAN_POISON_ABLOCK, ASAN_UNPOISON_ABLOCK)
(ASAN_POISON_INTERVAL_BLOCK, ASAN_UNPOISON_INTERVAL_BLOCK)
(ASAN_POISON_INTERVAL, ASAN_UNPOISON_INTERVAL)
(ASAN_PREPARE_DEAD_SDATA, ASAN_PREPARE_LIVE_SDATA)
(ASAN_POISON_SBLOCK_DATA, ASAN_POISON_STRING_BLOCK)
(ASAN_UNPOISON_STRING_BLOCK, ASAN_POISON_STRING)
(ASAN_UNPOISON_STRING, ASAN_POISON_FLOAT_BLOCK)
(ASAN_UNPOISON_FLOAT_BLOCK, ASAN_POISON_FLOAT)
(ASAN_UNPOISON_FLOAT, ASAN_POISON_CONS_BLOCK)
(ASAN_POISON_CONS, ASAN_UNPOISON_CONS)
(ASAN_POISON_VECTOR_CONTENTS, ASAN_UNPOISON_VECTOR_CONTENTS)
(ASAN_UNPOISON_VECTOR_BLOCK, ASAN_POISON_SYMBOL_BLOCK)
(ASAN_UNPOISON_SYMBOL_BLOCK, ASAN_POISON_SYMBOL)
(ASAN_UNPOISON_SYMBOL): Rewrite as macros to remove unneeded overhead
when address sanitization is disabled.

21 months agoMake unaligned loads work with sanitization.
Vibhav Pant [Wed, 7 Dec 2022 15:26:17 +0000 (20:56 +0530)]
Make unaligned loads work with sanitization.

Address sanitizer may miss memory bugs that happen during unaligned
loads. To prevent that, compilers may provide additional functions to
perform unaligned loads/stores, which allow sanitizer instrumentation
to check these accesses too. If the necessary header is available, and
AddressSanitizer is enabled, use them.

* configure.ac: Add check for <sanitizer/common_interface_defs.h>.
* src/lisp.h (UNALIGNED_LOAD_SIZE) [ADDRESS_SANITIZER]: New macro. If
the common sanitizer interface is available and address sanitization
is enabled, define it to __sanitizer_unaligned_load(64|32), depending
on the word size of the architecture.
* src/fns.c [HAVE_FAST_UNALIGNED_ACCESS] (Fstring_lessp): Use
'UNALIGNED_LOAD_SIZE' to perform unaligned loads from the two strings.

21 months agosrc/alloc.c: Fix incorrect pointer arithmetic.
Vibhav Pant [Sun, 4 Dec 2022 16:54:07 +0000 (22:24 +0530)]
src/alloc.c: Fix incorrect pointer arithmetic.

* src/alloc.c (live_float_holding): Use parenthesis around the
pointer arithmetic expression to untag 'cp' correctly.

21 months agoMerge branch 'master' into feature/asan-gc-poisoning
Vibhav Pant [Sun, 4 Dec 2022 16:29:43 +0000 (21:59 +0530)]
Merge branch 'master' into feature/asan-gc-poisoning

21 months agoFix potential crash deselecting for property change notifications
Po Lu [Sun, 4 Dec 2022 13:54:52 +0000 (21:54 +0800)]
Fix potential crash deselecting for property change notifications

* src/xselect.c (x_cancel_selection_transfer): Catch errors
around XSelectInput.

21 months agoMake a boxed menu bar have a shadow at its right end (bug#59778)
Manuel Giraud [Sat, 3 Dec 2022 21:47:02 +0000 (22:47 +0100)]
Make a boxed menu bar have a shadow at its right end (bug#59778)

* src/xdisp.c (display_menu_bar) [HAVE_X_WINDOWS]: Make a boxed
menu bar have a shadow at its right end in non-toolkit X builds.

21 months agoMake Emacs build with Xfixes support on old versions of the library
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.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Sun, 4 Dec 2022 05:31:24 +0000 (06:31 +0100)]
Merge from origin/emacs-29

96af584af6c Fix comment-start-skip in tree-sitter modes (bug#59690)
520a4e12f8e ; * lisp/treesit.el (treesit-end-of-defun): Guard against...
2c4d92d30f6 ; * lisp/subr.el (posn-col-row): Revert inadvertent change.
6fb9a03cbdf ; Remove debugging leftover message
c5ba47c889e Speed up Unicode normalisation tests by a factor of 5
afa4fcb95b4 Fix "C-h k" when clicking on another frame
f6e2f30f394 ; Fix typos
bd58dcedfb9 Fix and expand tests broken by commit 2772ebe366 of 2022-...
a0dd9fdebe3 ; Add cross-reference to string-equal docstring
11c3c54d8ad Fix handling of relative directories in "--init-directory...
401f76cc3d6 Make sure 'user-emacs-directory' ends in a slash

21 months ago; Merge from origin/emacs-29
Stefan Kangas [Sun, 4 Dec 2022 05:31:24 +0000 (06:31 +0100)]
; Merge from origin/emacs-29

The following commits were skipped:

641ef36403b Fix gud-minor-mode-menu
3623d5c195d Revert "Make easy-mmode-defmap obsolete and adjust only c...

21 months agoMerge from origin/emacs-29
Stefan Kangas [Sun, 4 Dec 2022 05:31:24 +0000 (06:31 +0100)]
Merge from origin/emacs-29

17d40c163e0 vc-git-print-log: Don't assume vc-git-log-switches is a list

21 months agoFix comment-start-skip in tree-sitter modes (bug#59690)
Yuan Fu [Sat, 3 Dec 2022 01:03:21 +0000 (17:03 -0800)]
Fix comment-start-skip in tree-sitter modes (bug#59690)

* lisp/progmodes/c-ts-mode.el (c-ts-mode)
(c++-ts-mode)
* lisp/progmodes/csharp-mode.el (csharp-ts-mode)
* lisp/progmodes/java-ts-mode.el (java-ts-mode)
* lisp/progmodes/js.el (js-ts-mode)
* lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode): Remove the group
from the regexp.

21 months ago; * lisp/treesit.el (treesit-end-of-defun): Guard against nil value.
Yuan Fu [Fri, 2 Dec 2022 05:19:14 +0000 (21:19 -0800)]
; * lisp/treesit.el (treesit-end-of-defun): Guard against nil value.

21 months ago; * lisp/subr.el (posn-col-row): Revert inadvertent change.
Eli Zaretskii [Sat, 3 Dec 2022 20:09:16 +0000 (22:09 +0200)]
; * lisp/subr.el (posn-col-row): Revert inadvertent change.

21 months ago; Remove debugging leftover message
Eli Zaretskii [Sat, 3 Dec 2022 20:06:34 +0000 (22:06 +0200)]
; Remove debugging leftover message

* lisp/emacs-lisp/comp.el (comp--native-compile): Remove
unnecessary call to 'message'.  (Bug#59766)

21 months agoSpeed up Unicode normalisation tests by a factor of 5
Mattias Engdegård [Sat, 3 Dec 2022 18:19:28 +0000 (19:19 +0100)]
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.

21 months agoFix "C-h k" when clicking on another frame
Eli Zaretskii [Sat, 3 Dec 2022 19:43:36 +0000 (21:43 +0200)]
Fix "C-h k" when clicking on another frame

* lisp/help.el (help--analyze-key): Don't barf if the key sequence
includes a switch-frame event.  (Bug#59785)

21 months agoMerge branch 'master' into feature/asan-gc-poisoning
Vibhav Pant [Sat, 3 Dec 2022 15:31:10 +0000 (21:01 +0530)]
Merge branch 'master' into feature/asan-gc-poisoning

21 months ago; src/alloc.c: Use the correct preprocessor check for ASan poisoning
Vibhav Pant [Sat, 3 Dec 2022 14:55:13 +0000 (20:25 +0530)]
; src/alloc.c: Use the correct preprocessor check for ASan poisoning

21 months ago; Fix typos
Stefan Kangas [Sat, 3 Dec 2022 14:31:07 +0000 (15:31 +0100)]
; Fix typos

21 months agoImprove performance of other_frames and XTfullscreen_hook
Po Lu [Sat, 3 Dec 2022 13:05:05 +0000 (21:05 +0800)]
Improve performance of other_frames and XTfullscreen_hook

* src/frame.c (other_frames):
* src/xterm.c (XTfullscreen_hook, x_check_fullscreen)
(x_set_window_size_1): Avoid extraneous calls to x_sync.

21 months agoFix and expand tests broken by commit 2772ebe366 of 2022-11-28
Juanma Barranquero [Sat, 3 Dec 2022 11:01:10 +0000 (12:01 +0100)]
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'.

21 months ago; Add cross-reference to string-equal docstring
Stefan Kangas [Sat, 3 Dec 2022 10:29:37 +0000 (11:29 +0100)]
; Add cross-reference to string-equal docstring

* lisp/subr.el (string-equal-ignore-case):
* src/fns.c (Fstring_equal): Doc fix; add cross-references.

21 months agoFix handling of relative directories in "--init-directory=DIR"
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)

21 months agoDon't trigger ASan use-after-poison while checking for live pointers
Vibhav Pant [Sat, 3 Dec 2022 10:10:50 +0000 (15:40 +0530)]
Don't trigger ASan use-after-poison while checking for live pointers

* src/alloc.c (live_string_holding, live_cons_holding)
(live_symbol_holding, live_float_holding) [GC_ASAN_POISON_OBJECTS]:
When compiling with address sanitization and GC poisoning support,
return NULL if the passed address is poisoned, or if the Lisp object
it resides in is poisoned. This fixes a rare use-after-poison abort
when these functions are called on a pointer that might be referring
to a now dead/sweep object.

21 months agoMake sure 'user-emacs-directory' ends in a slash
Eli Zaretskii [Sat, 3 Dec 2022 10:03:13 +0000 (12:03 +0200)]
Make sure 'user-emacs-directory' ends in a slash

* lisp/startup.el (command-line): Make sure 'user-emacs-directory'
has the form of a directory.

21 months agoFix gud-minor-mode-menu
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.

21 months agoRevert "Make easy-mmode-defmap obsolete and adjust only caller"
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.

Do not merge to master.

21 months agovc-git-print-log: Don't assume vc-git-log-switches is a list
Sean Whitton [Sat, 3 Dec 2022 06:42:10 +0000 (23:42 -0700)]
vc-git-print-log: Don't assume vc-git-log-switches is a list

* lisp/vc/vc-git.el (vc-git-print-log): Call ensure-list on
vc-git-log-switches to handle the case where it's a singular string.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Sat, 3 Dec 2022 05:30:29 +0000 (06:30 +0100)]
Merge from origin/emacs-29

1e36ad9458 ; server-tests: remove CI debugging
54633fcd76 ; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#...
8413e95138 ; server-test CI debugging
4b3eb928fe Fix server-tests run noninteractively (bug#59742)
1b567f5a67 Use file-name-nondirectory to determine default project-name
f72cda2b82 Speed up auto-completion in 'sh-script-mode'
e5b0141b0d Fix error editing multisession variables (bug#59710)

21 months ago; Merge from origin/emacs-29
Stefan Kangas [Sat, 3 Dec 2022 05:30:29 +0000 (06:30 +0100)]
; Merge from origin/emacs-29

The following commits were skipped:

24ca490d7d ; Fix a typo in .clang-format.
a48cd7bb9f ; Make clang-format format indent preprocessor blocks corr...

21 months agoMerge from origin/emacs-29
Stefan Kangas [Sat, 3 Dec 2022 05:30:29 +0000 (06:30 +0100)]
Merge from origin/emacs-29

2b9cd50f93 Add tsx-ts-mode to eglot-server-programs

21 months ago* lisp/bindings.el (bound-and-true-p): Verify argument is a symbol
Juanma Barranquero [Sat, 3 Dec 2022 01:04:48 +0000 (02:04 +0100)]
* lisp/bindings.el (bound-and-true-p): Verify argument is a symbol

21 months ago* lisp/emacs-lisp/cl-macs.el (cl-flet): Optimize a bit more
Stefan Monnier [Sat, 3 Dec 2022 00:15:46 +0000 (19:15 -0500)]
* lisp/emacs-lisp/cl-macs.el (cl-flet): Optimize a bit more

Also optimize the case where we use `cl-flet` to introduce a local alias.

21 months ago; server-tests: remove CI debugging
Mattias Engdegård [Fri, 2 Dec 2022 17:26:04 +0000 (18:26 +0100)]
; server-tests: remove CI debugging

21 months ago; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#59779).
Eli Zaretskii [Fri, 2 Dec 2022 17:08:08 +0000 (19:08 +0200)]
; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#59779).

21 months ago; server-test CI debugging
Mattias Engdegård [Fri, 2 Dec 2022 17:06:00 +0000 (18:06 +0100)]
; server-test CI debugging

21 months agoFix server-tests run noninteractively (bug#59742)
Mattias Engdegård [Fri, 2 Dec 2022 16:27:16 +0000 (17:27 +0100)]
Fix server-tests run noninteractively (bug#59742)

This may or may not fix the test run from CI.

* 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.

21 months agoUse file-name-nondirectory to determine default project-name
Randy Taylor [Fri, 2 Dec 2022 03:12:07 +0000 (22:12 -0500)]
Use file-name-nondirectory to determine default project-name

* lisp/progmodes/project.el (project-name):
Use file-name-nondirectory instead of file-name-base (bug#59756).

21 months agoSpeed up auto-completion in 'sh-script-mode'
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)

21 months agoFix error editing multisession variables (bug#59710)
Juanma Barranquero [Fri, 2 Dec 2022 13:14:26 +0000 (14:14 +0100)]
Fix error editing multisession variables (bug#59710)

* lisp/emacs-lisp/multisession.el (multisession-edit-value):
Do not use `bound-and-true-p' on a non-symbol.  This reverts
commit bd586121ac21e046f60f75eeb0200866c38d6f9f.

21 months agoMore behind the scenes transparent speedups around xselect.c
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.

21 months ago; Fix a typo in .clang-format.
dickmao [Thu, 1 Dec 2022 21:54:06 +0000 (16:54 -0500)]
; Fix a typo in .clang-format.

21 months ago; Make clang-format format indent preprocessor blocks correctly.
Vibhav Pant [Wed, 30 Nov 2022 17:37:44 +0000 (23:07 +0530)]
; Make clang-format format indent preprocessor blocks correctly.

(cherry picked from commit 1abda0c83981a6d35dd4b2dd3e88e9886d13cb09)

21 months ago; Fix typo in .clang-format (Bug#59768)
dickmao [Thu, 1 Dec 2022 21:54:06 +0000 (16:54 -0500)]
; Fix typo in .clang-format (Bug#59768)

21 months agoAdd tsx-ts-mode to eglot-server-programs
Brian Leung [Fri, 2 Dec 2022 11:02:30 +0000 (03:02 -0800)]
Add tsx-ts-mode to eglot-server-programs

* lisp/progmodes/eglot.el (eglot-server-programs): Add
tsx-ts-mode.  (Bug#59770)

21 months agoMerge from origin/emacs-29
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.

# Conflicts:
# etc/NEWS

21 months ago* lisp/tab-bar.el (tab-bar-format-align-right): Fix alignment on TTY frames.
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).

21 months agoFix the width of margins for icons in outline-minor-mode (bug#59719)
Juri Linkov [Fri, 2 Dec 2022 07:54:22 +0000 (09:54 +0200)]
Fix the width of margins for icons in outline-minor-mode (bug#59719)

* doc/lispref/display.texi (Icons): Add :width spec.

* 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.

21 months ago; Change c-ts-mode--base-mode to c-ts-base-mode
Yuan Fu [Fri, 2 Dec 2022 04:42:35 +0000 (20:42 -0800)]
; Change c-ts-mode--base-mode to c-ts-base-mode

* lisp/progmodes/c-ts-mode.el (c-ts-mode--base-mode)
(c-ts-mode, c++-ts-mode): Change to c-ts-base-mode.

21 months agoAdd new TypeScript mode tsx-ts-mode
Theodor Thornhill [Tue, 29 Nov 2022 20:39:38 +0000 (21:39 +0100)]
Add new TypeScript mode tsx-ts-mode

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.

* etc/NEWS: Mention the new mode.

21 months agoAdd case and match to python--treesit-keywords (bug#59720)
Daniel Martín [Wed, 30 Nov 2022 15:11:46 +0000 (16:11 +0100)]
Add case and match to python--treesit-keywords (bug#59720)

* lisp/progmodes/python.el (python--treesit-keywords): Add "case" and
"match" keywords.

21 months ago; * lisp/progmodes/c-ts-mode.el: Change rx to regexp-opt.
Yuan Fu [Fri, 2 Dec 2022 02:57:54 +0000 (18:57 -0800)]
; * lisp/progmodes/c-ts-mode.el: Change rx to regexp-opt.

21 months agoproject-files (VC-aware): Make sure the VC backend is loaded
Dmitry Gutov [Fri, 2 Dec 2022 02:03:03 +0000 (04:03 +0200)]
project-files (VC-aware): Make sure the VC backend is loaded

* lisp/progmodes/project.el (project-files):
Make sure the VC backend is loaded (bug#59734).

21 months agoterm--update-term-menu: Add the menu to term-terminal-menu
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.

21 months agoImprove detection of very long lines
Eli Zaretskii [Thu, 1 Dec 2022 22:07:53 +0000 (00:07 +0200)]
Improve detection of very long lines

* src/xdisp.c (redisplay_window): Recheck for long lines if the
restriction has changed.  (Bug#56682)

21 months ago; Fix last change in proced.el
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.

21 months agoAdd colors to Proced (bug#59407)
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.

21 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Thu, 1 Dec 2022 17:34:32 +0000 (19:34 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

21 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 1 Dec 2022 15:54:53 +0000 (16:54 +0100)]
Merge from origin/emacs-29

70ecdebc92 ; Fix typos (don't abbreviate "with" or "without")
a86ccb5f9d ; Fix recently added treesit documentation
2d5cf7329e ; * etc/NEWS: Fix wording and punctuation of recently adde...
61311d6862 ; Fix test failure on CI

# Conflicts:
# etc/NEWS

21 months ago; Merge from origin/emacs-29
Stefan Kangas [Thu, 1 Dec 2022 15:54:50 +0000 (16:54 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

0a5ede0149 ; Auto-commit of loaddefs files.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 1 Dec 2022 15:54:50 +0000 (16:54 +0100)]
Merge from origin/emacs-29

91a9598baf Update project docs and NEWS

# Conflicts:
# etc/NEWS

21 months ago; Merge from origin/emacs-29
Stefan Kangas [Thu, 1 Dec 2022 15:54:48 +0000 (16:54 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

b7b2455c5f Update publicsuffix.txt from upstream

21 months ago; Fix typos (don't abbreviate "with" or "without")
Stefan Kangas [Thu, 1 Dec 2022 15:36:09 +0000 (16:36 +0100)]
; Fix typos (don't abbreviate "with" or "without")

21 months ago; * lisp/tab-bar.el (tab-bar-change-tab-group): Doc fix.
Eli Zaretskii [Thu, 1 Dec 2022 15:34:26 +0000 (17:34 +0200)]
; * lisp/tab-bar.el (tab-bar-change-tab-group): Doc fix.

21 months ago; Fix recently added treesit documentation
Eli Zaretskii [Thu, 1 Dec 2022 15:25:28 +0000 (17:25 +0200)]
; Fix recently added treesit documentation

* lisp/treesit.el (treesit-defun-prefer-top-level):
* doc/lispref/positions.texi (List Motion): Fix wording.

21 months ago; * etc/NEWS: Fix wording and punctuation of recently added entries.
Eli Zaretskii [Thu, 1 Dec 2022 15:11:43 +0000 (17:11 +0200)]
; * etc/NEWS: Fix wording and punctuation of recently added entries.

21 months ago; * etc/NEWS.29: Resurrect Local variables that keep disappearing...
Eli Zaretskii [Thu, 1 Dec 2022 15:08:02 +0000 (17:08 +0200)]
; * etc/NEWS.29: Resurrect Local variables that keep disappearing...

21 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 1 Dec 2022 15:07:59 +0000 (17:07 +0200)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

21 months ago; Fix test failure on CI
Dmitry Gutov [Thu, 1 Dec 2022 14:38:52 +0000 (16:38 +0200)]
; Fix test failure on CI

21 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Thu, 1 Dec 2022 14:33:12 +0000 (15:33 +0100)]
; Auto-commit of loaddefs files.

21 months agoUpdate project docs and NEWS
Dmitry Gutov [Thu, 1 Dec 2022 14:24:10 +0000 (16:24 +0200)]
Update project docs and NEWS

* doc/emacs/maintaining.texi (Projects): Update the name.

* etc/NEWS: Mention new option (bug#41572).

21 months agoUpdate publicsuffix.txt from upstream
Stefan Kangas [Thu, 1 Dec 2022 05:01:28 +0000 (06:01 +0100)]
Update publicsuffix.txt from upstream

* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2022-11-29 18:15:27 UTC.

(cherry picked from commit de00aef3e151e0eefe20feda74cf90578e8ff109)

21 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 1 Dec 2022 13:38:29 +0000 (14:38 +0100)]
Merge from origin/emacs-29

5d1a1019c6 Add highlighting Python operators (bug#59629)
8b3baadf67 Fix compilation of Org 9.6 on MS-Windows
3b5b99ac91 * doc/lispref/frames.texi (Input Focus): Clarify for XInpu...
4b2f5425d7 Fix types in various defcustom declarations

21 months agoAdd highlighting Python operators (bug#59629)
kobarity [Sun, 27 Nov 2022 09:52:32 +0000 (18:52 +0900)]
Add highlighting Python operators (bug#59629)

* lisp/progmodes/python.el (python-rx): Remove "is" and
"not" from operator.
(python-font-lock-keywords-maximum-decoration): Add
highlighting operators.
* test/lisp/progmodes/python-tests.el
(python-font-lock-assignment-statement-1)
(python-font-lock-assignment-statement-2)
(python-font-lock-assignment-statement-3)
(python-font-lock-assignment-statement-4)
(python-font-lock-assignment-statement-5)
(python-font-lock-assignment-statement-6)
(python-font-lock-assignment-statement-7)
(python-font-lock-assignment-statement-8)
(python-font-lock-assignment-statement-9)
(python-font-lock-assignment-statement-10)
(python-font-lock-assignment-statement-11)
(python-font-lock-assignment-statement-12)
(python-font-lock-assignment-statement-13)
(python-font-lock-assignment-statement-14)
(python-font-lock-assignment-statement-15)
(python-font-lock-assignment-statement-16)
(python-font-lock-assignment-statement-17)
(python-font-lock-assignment-statement-18)
(python-font-lock-assignment-statement-multiline-1)
(python-font-lock-assignment-statement-multiline-2)
(python-font-lock-assignment-statement-multiline-3)
(python-font-lock-assignment-statement-multiline-4)
(python-font-lock-assignment-statement-multiline-5)
(python-font-lock-assignment-statement-multiline-6)
(python-font-lock-escape-sequence-multiline-string): Modify
expectations to include faces for operators.
(python-font-lock-operator-1, python-font-lock-operator-2): New tests.

21 months agoFix compilation of Org 9.6 on MS-Windows
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.

21 months ago* doc/lispref/frames.texi (Input Focus): Clarify for XInput 2 support.
Po Lu [Thu, 1 Dec 2022 11:15:28 +0000 (19:15 +0800)]
* doc/lispref/frames.texi (Input Focus): Clarify for XInput 2 support.

21 months agoMake sure the menu-bar height is updated on X when fonts change
Manuel Giraud [Fri, 25 Nov 2022 14:50:41 +0000 (15:50 +0100)]
Make sure the menu-bar height is updated on X when fonts change

* src/xdisp.c (display_menu_bar) [HAVE_X_WINDOWS]: Update
menu_bar_window height in non-toolkit X builds.  (Bug#59351)

21 months agoFix types in various defcustom declarations
Mattias Engdegård [Thu, 1 Dec 2022 11:40:28 +0000 (12:40 +0100)]
Fix types in various defcustom declarations

* lisp/org/ob-clojure.el
(ob-clojure-babashka-command, ob-clojure-nbb-command):
Account for the possibility of nil (commands absent).
* lisp/org/org.el (org-safe-remote-resources):
* lisp/org/ox-md.el (org-md-toplevel-hlevel):
* lisp/progmodes/project.el (project-vc-extra-root-markers):
Fix incorrect or invalid types.

21 months agoFinish up last change with more speedups
Po Lu [Thu, 1 Dec 2022 07:08:31 +0000 (15:08 +0800)]
Finish up last change with more speedups

* src/xterm.c (x_atom_refs):
* src/xterm.h (struct x_display_info): Add some new atoms to be
interned at connection setup.

21 months agoRemove unnecessary error checks in xselect.c
Po Lu [Thu, 1 Dec 2022 06:51:29 +0000 (14:51 +0800)]
Remove unnecessary error checks in xselect.c

* src/xselect.c (x_own_selection): Don't sync around
XSetSelectionOwner, as the atom and window specified are always
correct.

21 months ago; * src/xselect.c (syms_of_xselect_for_pdumper): Fix last change.
Po Lu [Thu, 1 Dec 2022 06:47:18 +0000 (14:47 +0800)]
; * src/xselect.c (syms_of_xselect_for_pdumper): Fix last change.

Author:

21 months agoFix pdumper build
Po Lu [Thu, 1 Dec 2022 06:43:44 +0000 (14:43 +0800)]
Fix pdumper build

* src/xselect.c (mark_xselect): Don't mark if
outstanding_transfers.next is still NULL.

21 months agoSpeed up handling X selection requests
Po Lu [Thu, 1 Dec 2022 06:33:23 +0000 (14:33 +0800)]
Speed up handling X selection requests

* etc/NEWS: Announce speedup.
* src/alloc.c (garbage_collect): Call mark_xselect.
* src/xftfont.c (xftfont_end_for_frame): Fix crash on display IO
error.
* src/xselect.c (struct selection_data, struct transfer): New
structures.
(outstading_transfers): New variable.
(SELECTED_EVENTS, x_selection_request_lisp_error): Stop checking
cs->nofree.
(x_catch_errors_unwind): Delete function.
(c_size_for_format, x_size_for_format, selection_data_for_offset)
(selection_data_size, transfer_selecting_event)
(x_continue_selection_transfer, x_remove_selection_transfers)
(x_selection_transfer_timeout): New functions.
(x_reply_selection_request): When handling selection requests,
never wait for property notifications synchronously.  Instead,
write out the selection data as the client reads it from the
event loop.
(x_handle_selection_request, x_convert_selection)
(x_handle_property_notify, x_get_window_property)
(lisp_data_to_selection_data): Don't ever use pointers to Lisp
string data! Instead, just store the string object itself.
(syms_of_xselect): Initialize outstanding transfer list.
(syms_of_xselect_for_pdumper):
* src/xterm.c (x_delete_display): Remove outstanding selection
transfers.
* src/xterm.h: Update prototypes.

21 months agoMerge from origin/emacs-29
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

# Conflicts:
# etc/NEWS

21 months ago; Merge from origin/emacs-29
Po Lu [Thu, 1 Dec 2022 06:24:38 +0000 (14:24 +0800)]
; Merge from origin/emacs-29

The following commit was skipped:

646f2cf67e ; * etc/NEWS: Resurrect the lost Local variables section.

21 months agoMerge from origin/emacs-29
Po Lu [Thu, 1 Dec 2022 06:24:38 +0000 (14:24 +0800)]
Merge from origin/emacs-29

2a8f31b996 project-current: Improve the docstring

21 months agoFix crashes and memory leaks during display deinitialization
Po Lu [Thu, 1 Dec 2022 06:21:14 +0000 (14:21 +0800)]
Fix crashes and memory leaks during display deinitialization

* .dir-locals.el (c-mode): Add more noise macro names.
* src/frame.c (delete_frame): Do not delete terminal if force is
Qnoelisp.

* src/xterm.c (x_wm_supports): Fix coding style.
(x_delete_display): Delete the supported atoms list.
(x_delete_terminal): Delete all terminals.  Free the scratch
cursor GC.

21 months agoUpdate publicsuffix.txt from upstream
Stefan Kangas [Thu, 1 Dec 2022 05:01:28 +0000 (06:01 +0100)]
Update publicsuffix.txt from upstream

* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2022-11-29 18:15:27 UTC.

21 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Thu, 1 Dec 2022 04:10:57 +0000 (05:10 +0100)]
; Auto-commit of loaddefs files.

21 months agoNew user option: project-vc-extra-root-markers
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.

21 months agoAdd inline to c-ts-mode--keywords
Daniel Martín [Wed, 30 Nov 2022 18:58:42 +0000 (19:58 +0100)]
Add inline to c-ts-mode--keywords

* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Add "inline", a
keyword available since C99 to define inline functions in C.

21 months agoRemove duplicate "friend" from c-ts-mode--keywords
Daniel Martín [Wed, 30 Nov 2022 23:26:04 +0000 (00:26 +0100)]
Remove duplicate "friend" from c-ts-mode--keywords

* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Remove duplicate
keyword.

21 months agoMake treesit-defun-prefer-top-level more flexible
Yuan Fu [Wed, 30 Nov 2022 23:05:07 +0000 (15:05 -0800)]
Make treesit-defun-prefer-top-level more flexible

* doc/lispref/positions.texi (List Motion): Update manual.
* lisp/treesit.el (treesit-defun-prefer-top-level): Update docstring.
(treesit--defun-maybe-top-level): Change to accept new format.

21 months agoFix c-ts-mode defun movement (bug#59628)
Yuan Fu [Wed, 30 Nov 2022 22:59:06 +0000 (14:59 -0800)]
Fix c-ts-mode defun movement (bug#59628)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--end-of-defun): New function.
(c-ts-mode--base-mode): Use more specific regexp, and set
treesit-defun-prefer-top-level.
(c-ts-mode)
(c++-ts-mode): Set end-of-defun-function.

21 months agoUpdate to Transient v0.3.7-182-gfe7dcbd
Jonas Bernoulli [Wed, 30 Nov 2022 20:32:40 +0000 (21:32 +0100)]
Update to Transient v0.3.7-182-gfe7dcbd

21 months ago* lisp/tab-bar.el: Keep tabs of the same group together (bug#59721)
Juri Linkov [Wed, 30 Nov 2022 19:36:33 +0000 (21:36 +0200)]
* lisp/tab-bar.el: Keep tabs of the same group together (bug#59721)

(tab-bar-tab-post-change-group-functions): Change the default value to
'(tab-bar-move-tab-to-group)'.  Improve docstring.
(tab-bar-change-tab-group): Improve docstring.

21 months agoInsert news for installed packages only
muffinmad [Mon, 28 Nov 2022 21:09:59 +0000 (23:09 +0200)]
Insert news for installed packages only

* lisp/emacs-lisp/package.el (describe-package-1): Check package is
installed and "news" is a regular file.  (Bug#59684)

21 months ago; Fix type error in 'package-maintainers'
Philip Kaludercic [Tue, 29 Nov 2022 21:35:55 +0000 (22:35 +0100)]
; Fix type error in 'package-maintainers'

* lisp/emacs-lisp/package.el (package-maintainers): Pass the email
address to 'ietf-drums-parse-address' (Bug#59676).

21 months ago; * etc/NEWS: Add missing tree-sitter based modes.
Eli Zaretskii [Wed, 30 Nov 2022 18:29:04 +0000 (20:29 +0200)]
; * etc/NEWS: Add missing tree-sitter based modes.