]> git.eshelyaron.com Git - emacs.git/log
emacs.git
23 months agoFix display of warnings on w32 console
Eli Zaretskii [Tue, 17 Jan 2023 13:44:51 +0000 (15:44 +0200)]
Fix display of warnings on w32 console

* lisp/emacs-lisp/warnings.el (warnings-suppress): Use alternative
symbol for TTY frames on MS-Windows.

23 months agoFix buffer-list-update-hook for indirect buffers
Basil L. Contovounesios [Wed, 11 Jan 2023 16:34:07 +0000 (16:34 +0000)]
Fix buffer-list-update-hook for indirect buffers

Fmake_indirect_buffer can be told whether to run buffer hooks since
bug#49160, but until now it ran buffer-list-update-hook irrespective
of this.

* src/buffer.c (Fmake_indirect_buffer): Don't run
buffer-list-update-hook when called with a non-nil
INHIBIT-BUFFER-HOOKS argument.
(run_buffer_list_update_hook): Don't special-case NULL argument, as
no such callers remain.

* test/src/buffer-tests.el
(buffer-tests-inhibit-buffer-hooks-indirect): Test whether indirect
buffer hooks are run regardless of whether base buffer hooks are
inhibited.  Check that all three buffer hooks, not just
kill-buffer-query-functions, are inhibited.

23 months ago; Fix tree-sitter indent anchor preset
Yuan Fu [Tue, 17 Jan 2023 09:20:51 +0000 (01:20 -0800)]
; Fix tree-sitter indent anchor preset

* lisp/treesit.el:
(treesit-simple-indent-presets): Fix prev-adaptive-prefix.

23 months agoFix treesit-node-first-child-for-pos (bug#60127)
Yuan Fu [Tue, 17 Jan 2023 08:57:54 +0000 (00:57 -0800)]
Fix treesit-node-first-child-for-pos (bug#60127)

The problem is due to a bug in ts_node_first_child_for_pos, but
tree-sitter is moving pretty slowly right now so I reimplemented a
correct version of it in treesit.c.

* src/treesit.c (treesit_cursor_first_child_for_byte): New function.
(Ftreesit_node_first_child_for_pos): Use the new function.

23 months ago; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change.
Yuan Fu [Tue, 17 Jan 2023 04:32:15 +0000 (20:32 -0800)]
; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor change.

23 months agoFix hfy-exclude-file-rules (bug#60562)
Mattias Engdegård [Sun, 15 Jan 2023 14:23:44 +0000 (15:23 +0100)]
Fix hfy-exclude-file-rules (bug#60562)

* lisp/htmlfontify.el (hfy-exclude-file-rules):
Fix broken defcustom type; no longer fails test-custom-opts.
Fix regexps not to use newline-sensitive patterns like `.` and `$`
which do not make sense when matching file names.
Better doc string.
* lisp/htmlfontify.el (hfy-list-files): Simplify regexp argument.

23 months agoCC Mode: Prevent ids in temporary "declarators" getting into c-found-types
Alan Mackenzie [Mon, 16 Jan 2023 17:44:44 +0000 (17:44 +0000)]
CC Mode: Prevent ids in temporary "declarators" getting into c-found-types

This should fix bug #60765.  In the scenario type an identifier in front of
foo (bar, baz), as when started a new statement.  This temporarily makes the
function call a declarator, and bar and baz types.  Don't enter bar and baz
into c-found-types.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1) (CASE 6): When a
'maybe type triggers this case, set `unsafe-maybe' to non-nil.

23 months ago; Fix more quoting in w32fns.c.
Eli Zaretskii [Mon, 16 Jan 2023 14:55:01 +0000 (16:55 +0200)]
; Fix more quoting in w32fns.c.

23 months ago; Avoid byte-compiler warning in eglot.el
Eli Zaretskii [Mon, 16 Jan 2023 14:52:48 +0000 (16:52 +0200)]
; Avoid byte-compiler warning in eglot.el

* lisp/progmodes/eglot.el (eglot): Rename INTERACTIVE to avoid
byte-compiler warning.  Update the doc string.  (Bug#60557)

23 months ago; * lisp/progmodes/eglot.el: Remove stray space.
Eli Zaretskii [Mon, 16 Jan 2023 14:08:46 +0000 (16:08 +0200)]
; * lisp/progmodes/eglot.el: Remove stray space.

23 months ago; * src/w32fns.c: Fix quoting. Patch by Arash Esbati <arash@gnu.org>.
Eli Zaretskii [Mon, 16 Jan 2023 14:00:18 +0000 (16:00 +0200)]
; * src/w32fns.c: Fix quoting.  Patch by Arash Esbati <arash@gnu.org>.

23 months agoFix M-x eglot prompt when connection already exists (bug#60557)
João Távora [Mon, 16 Jan 2023 11:48:09 +0000 (11:48 +0000)]
Fix M-x eglot prompt when connection already exists (bug#60557)

Before this change, if a current connection existed at the time of M-x
eglot, user would be first asked to enter into M-x eglot's interactive
spec details about new command line arguments, and only afterwards be
prompted about what to do with the current connection (which could be
to reconnect to it using the same arguments, or tear it down and make
a new one).

This is very confusing, as users may not be fully aware of the
distinction between "reconnect" vs "disconnect-and-connect".  They
might not know if any new command line arguments provided are taking
effect or not.

This change simplifies this and removes the option to "reconnect
instead" from M-x eglot (users can do that at any time via M-x
eglot-reconnect).  It also ensures that users are informed about a
current connection before asking to enter new command line arguments
and not the other way round.

* lisp/progmodes/eglot.el (eglot): Rework.

23 months agoFix tree-sitter indent preset function (bug#60270)
Yuan Fu [Mon, 16 Jan 2023 08:23:47 +0000 (00:23 -0800)]
Fix tree-sitter indent preset function (bug#60270)

* lisp/treesit.el (treesit-simple-indent-presets): Fix
prev-adaptive-prefix so it doesn't return nil if the previous line has
no prefix.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

23 months agoruby-ts-mode: Support the option ruby-block-indent
Dmitry Gutov [Mon, 16 Jan 2023 03:17:05 +0000 (05:17 +0200)]
ruby-ts-mode: Support the option ruby-block-indent

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--block-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it.

* test/lisp/progmodes/ruby-ts-mode-tests.el:
Run indent test for ruby-block-indent.rb.

23 months agoImprove indentation for jsx
Theodor Thornhill [Sun, 15 Jan 2023 20:31:16 +0000 (21:31 +0100)]
Improve indentation for jsx

* lisp/progmodes/js.el (js--treesit-indent-rules): Use more parent
anchors and fix typo with wrong indent offset variable.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Use more parent anchors.

23 months ago* lisp/subr.el (while-let): Fix docs if-let->if-let* (bug#60758).
Sean Whitton [Sun, 15 Jan 2023 17:01:41 +0000 (10:01 -0700)]
* lisp/subr.el (while-let): Fix docs if-let->if-let* (bug#60758).

23 months agoRevert "* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758)."
Sean Whitton [Sun, 15 Jan 2023 16:57:41 +0000 (09:57 -0700)]
Revert "* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758)."

This reverts commit 083badc9c122a802080552e7771e78ee47c01e3c.

23 months agoBump use-package version for Emacs 29.1
Stefan Kangas [Sun, 15 Jan 2023 13:30:46 +0000 (14:30 +0100)]
Bump use-package version for Emacs 29.1

* lisp/use-package/use-package.el: Bump version to 2.4.5.

23 months agoImprove error message from sqlite-mode.el
Eli Zaretskii [Sun, 15 Jan 2023 10:06:54 +0000 (12:06 +0200)]
Improve error message from sqlite-mode.el

* lisp/sqlite-mode.el (sqlite-mode-open-file): Add error
checking.  (Bug#60490)

23 months ago; Fix last change: remove unused @anchor.
Eli Zaretskii [Sun, 15 Jan 2023 09:52:46 +0000 (11:52 +0200)]
; Fix last change: remove unused @anchor.

23 months ago; Update htmlfontify documentation
Xi Lu [Sun, 15 Jan 2023 09:49:45 +0000 (11:49 +0200)]
; Update htmlfontify documentation

* doc/misc/htmlfontify.texi (Customization): Remove 'hfy-find-cmd',
add 'hfy-exclude-file-rules'.
(Requirements): Remove text about 'find' program.

23 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sun, 15 Jan 2023 09:19:20 +0000 (11:19 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

23 months ago; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.
Eli Zaretskii [Sun, 15 Jan 2023 09:18:44 +0000 (11:18 +0200)]
; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.

23 months ago; Add more c-ts-mode indent and filling tests
Yuan Fu [Sat, 14 Jan 2023 07:42:44 +0000 (23:42 -0800)]
; Add more c-ts-mode indent and filling tests

* test/lisp/progmodes/c-ts-mode-resources/filling.erts: New file.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: More tests.
* test/lisp/progmodes/c-ts-mode-tests.el:
(c-ts-mode-test-filling): new test.

23 months agoFix c-ts-mode block comment indentation (bug#60270)
Yuan Fu [Sun, 15 Jan 2023 09:01:38 +0000 (01:01 -0800)]
Fix c-ts-mode block comment indentation (bug#60270)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-2nd-line-anchor): Handle another edge case.

23 months agoFix c-ts-mode label indent
Yuan Fu [Sun, 15 Jan 2023 08:21:10 +0000 (00:21 -0800)]
Fix c-ts-mode label indent

Fix indentation of the statement right under a label.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Fix.
(c-ts-mode--top-level-label-matcher): Fix.

23 months agoFix statement indent for c-ts-mode (bug#59686) (bug#60280)
Yuan Fu [Sun, 15 Jan 2023 08:16:58 +0000 (00:16 -0800)]
Fix statement indent for c-ts-mode (bug#59686) (bug#60280)

Instead of trying to figure out the correct anchor, now we just count
the layers of {} blocks between the node and the root node.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Use new offset functions
c-ts-mode--close-bracket-offset and c-ts-mode--statement-offset.
(c-ts-mode--bracket-children-anchor): Remove function.
(c-ts-mode--top-level-label-matcher): New variable.
(c-ts-mode--statement-offset)
(c-ts-mode--close-bracket-offset): New offset functions.

23 months agoAllow offset in tree-sitter indent rules to be functions
Yuan Fu [Sun, 15 Jan 2023 08:15:25 +0000 (00:15 -0800)]
Allow offset in tree-sitter indent rules to be functions

This is needed for fixing C indentation.  See next comment.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent): Try evaluating OFFSET as a
function if it's not integer nor variable.

23 months ago; Minor change in c-ts-mode--indent-styles
Yuan Fu [Sun, 15 Jan 2023 04:53:10 +0000 (20:53 -0800)]
; Minor change in c-ts-mode--indent-styles

; * lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Move top-level label rule to GNU style.

23 months agoSupport filling line comments in c-ts-mode
Yuan Fu [Sat, 14 Jan 2023 07:31:18 +0000 (23:31 -0800)]
Support filling line comments in c-ts-mode

Now we handle line comments separately because for line comments, each
line is an individual node, unlike block comments, where the whole
block comment is a single node.  fill-comment-paragraph turns out to
do the job perfectly fine.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--fill-paragraph): Extract out most parts into
c-ts-mode--fill-block-comment.
(c-ts-mode--fill-block-comment): New extracted function.

23 months ago; Fix c-ts-mode filling
Yuan Fu [Sat, 14 Jan 2023 07:05:45 +0000 (23:05 -0800)]
; Fix c-ts-mode filling

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-regexp): New variable.
(c-ts-mode--fill-paragraph): Use the new variable, and make sure
start-marker is always initialized.

23 months agoFix expansion of wildcards in ls-lisp.el
Eli Zaretskii [Sun, 15 Jan 2023 08:47:24 +0000 (10:47 +0200)]
Fix expansion of wildcards in ls-lisp.el

* lisp/ls-lisp.el (ls-lisp--dired): Fix error message text.
Handle the case of a wildcard specifying directories.  (Bug#60819)

23 months agoFix messages displayed when diary is shown
Eli Zaretskii [Sun, 15 Jan 2023 06:10:33 +0000 (08:10 +0200)]
Fix messages displayed when diary is shown

* lisp/calendar/diary-lib.el (diary-list-entries): Display the
"...done" message only if there's no important message in the
echo-area.  (Bug#60795)

23 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Sun, 15 Jan 2023 04:08:49 +0000 (05:08 +0100)]
; Auto-commit of loaddefs files.

23 months ago; Fix typos
Stefan Kangas [Sun, 15 Jan 2023 01:10:32 +0000 (02:10 +0100)]
; Fix typos

23 months agoAdd constructor_declaration as java-ts-mode defun
Theodor Thornhill [Sat, 14 Jan 2023 21:39:08 +0000 (22:39 +0100)]
Add constructor_declaration as java-ts-mode defun

* lisp/progmodes/java-ts-mode.el (java-ts-mode): Extend
treesit-defun-type-regexp.

23 months agoFurther improvement for non-string values in pcomplete
Gregory Heytings [Wed, 4 Jan 2023 16:48:03 +0000 (16:48 +0000)]
Further improvement for non-string values in pcomplete

* lisp/pcomplete.el (pcomplete-arg): Use the string representation
of the argument value instead of the text representation of the
argument.  Return the value, even when it is not a string, when
index is 'last'.  Fixes bug#60464.

23 months ago; * etc/NEWS (--with-native-compilation=aot): Tweak wording.
Sean Whitton [Sat, 14 Jan 2023 19:50:54 +0000 (12:50 -0700)]
; * etc/NEWS (--with-native-compilation=aot): Tweak wording.

I've observed people thinking that this is a completely new feature.

23 months agoFix the case in first-completion revealed by minibuffer-tests
Juri Linkov [Sat, 14 Jan 2023 18:56:33 +0000 (20:56 +0200)]
Fix the case in first-completion revealed by minibuffer-tests

* lisp/simple.el (first-completion): Add the text-property 'first-completion'
when the first completion is at the beginning of the buffer.

* test/lisp/minibuffer-tests.el (completions-header-format-test):
Revert the recent change.

23 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Sat, 14 Jan 2023 18:30:55 +0000 (19:30 +0100)]
; * etc/NEWS: Fix typos.

23 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sat, 14 Jan 2023 16:30:05 +0000 (18:30 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

23 months ago; * lisp/htmlfontify.el (hfy-exclude-file-rules): Fix :version.
Eli Zaretskii [Sat, 14 Jan 2023 16:15:46 +0000 (18:15 +0200)]
; * lisp/htmlfontify.el (hfy-exclude-file-rules): Fix :version.

23 months agoFix indent and font-lock for annotation_type
Theodor Thornhill [Sat, 14 Jan 2023 14:18:40 +0000 (15:18 +0100)]
Fix indent and font-lock for annotation_type

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Indent
inside body.
(java-ts-mode--font-lock-settings): Add rule for name in
annotation_type_element_declaration.

23 months agoapropos.el: Fix bug#60628
Stefan Monnier [Sat, 14 Jan 2023 14:06:10 +0000 (09:06 -0500)]
apropos.el: Fix bug#60628

* lisp/apropos.el (apropos--map-preloaded-atoms): New function.
(apropos-documentation): Use it.
(apropos-documentation-check-elc-file): Don't presume #@ is preceded by
a newline (since that's not the case any more since commit
900b09c0235d54d5), but be more careful not to burp on false positives.

23 months agoFix indentation of some declarations and statements
Theodor Thornhill [Fri, 13 Jan 2023 10:33:58 +0000 (11:33 +0100)]
Fix indentation of some declarations and statements

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new
rules so that we don't anchor at col 0.

23 months agoFix indentation of object_expressions in csharp-ts-mode
Theodor Thornhill [Thu, 12 Jan 2023 08:06:45 +0000 (09:06 +0100)]
Fix indentation of object_expressions in csharp-ts-mode

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): Make
sure the opening brace is indented at parent-bol, and everything else
is indented.

23 months ago; Fix NEWS markup
Eli Zaretskii [Sat, 14 Jan 2023 09:53:37 +0000 (11:53 +0200)]
; Fix NEWS markup

23 months ago; Fix last change in htmlfontify.el
Eli Zaretskii [Sat, 14 Jan 2023 09:10:53 +0000 (11:10 +0200)]
; Fix last change in htmlfontify.el

23 months agoReplace 'hfy-find-cmd' with 'directory-files-recursively'.
Xi Lu [Sat, 7 Jan 2023 14:46:40 +0000 (22:46 +0800)]
Replace 'hfy-find-cmd' with 'directory-files-recursively'.

This removes a potential vulnerability to maliciously
named files.  (Bug#60562)
* lisp/htmlfontify.el (hfy-exclude-file-rules): New defcustom.
(hfy-list-files): Reimplement using 'directory-files-recursively'.

23 months ago; * etc/PROBLEMS: Describe problems with MuPDF 1.21. (Bug#60308)
Eli Zaretskii [Sat, 14 Jan 2023 08:52:06 +0000 (10:52 +0200)]
; * etc/PROBLEMS: Describe problems with MuPDF 1.21.  (Bug#60308)

23 months agoDisable and document 'doc-view-mupdf-use-svg' (bug#58041)
Eli Zaretskii [Sat, 14 Jan 2023 08:26:40 +0000 (10:26 +0200)]
Disable and document 'doc-view-mupdf-use-svg' (bug#58041)

* lisp/doc-view.el (doc-view-mupdf-use-svg): Disable by default.
* etc/NEWS: Document.  Patch by Visuwesh <visuweshm@gmail.com>.
Do not merge to master.

23 months agoEglot: don't use "nil" as minibuffer initial input
Eshel Yaron [Sat, 14 Jan 2023 08:12:11 +0000 (10:12 +0200)]
Eglot: don't use "nil" as minibuffer initial input

Doing M-x eglot in a buffer for which buffer-file-name is nil, prompts
the user for a major mode to manage by invoking completing-read.  The
way completing-read was called would end up with the string "nil" as
the initial minibuffer input, which is not very useful nor is it a
valid input.
* lisp/progmodes/eglot.el (eglot--guess-contact): Tweak prompt for
major mode.  (Bug#60379)

Copyright-paperwork-exempt: yes

23 months agoFix dependency bug when building lwlib
Paul Eggert [Sat, 14 Jan 2023 02:22:47 +0000 (18:22 -0800)]
Fix dependency bug when building lwlib

* lwlib/Makefile.in (DEPFLAGS): Use OBJS to calculate dependency
file names, not ALLOBJS.  This fixes a typo introduced
in 2015-05-15 "Replace AC_SUBST_FILE in configure with include in
Makefiles" that caused lwlib/*.o to not be rebuilt sometimes
when that was needed.

23 months agoFix use of build_pure_c_string in treesit.c
Yuan Fu [Sat, 14 Jan 2023 01:26:08 +0000 (17:26 -0800)]
Fix use of build_pure_c_string in treesit.c

This is brought up in bug#60691.  build_pure_c_string should only be
used in places such as syms_of_treesit, which are called just once,
during dumping.

* src/treesit.c (Vtreesit_str_libtree_sitter):
(Vtreesit_str_tree_sitter):
(Vtreesit_str_dot):
(Vtreesit_str_question_mark):
(Vtreesit_str_star):
(Vtreesit_str_plus):
(Vtreesit_str_pound_equal):
(Vtreesit_str_pound_match):
(Vtreesit_str_pound_pred):
(Vtreesit_str_open_bracket):
(Vtreesit_str_close_bracket):
(Vtreesit_str_open_paren):
(Vtreesit_str_close_paren):
(Vtreesit_str_space):
(Vtreesit_str_equal):
(Vtreesit_str_match):
(Vtreesit_str_pred): New variables.

(treesit_load_language):
(Ftreesit_pattern_expand):
(Ftreesit_query_expand):
(treesit_eval_predicates): Use new varaibles.

(treesit_check_buffer_size):
(treesit_compose_query_signal_data):
(treesit_check_range_argument):
(Ftreesit_parser_set_included_ranges):
(treesit_predicate_capture_name_to_node):
(treesit_predicate_equal):
(treesit_predicate_match):
(treesit_predicate_pred): Use build_string for signal message.

(syms_of_treesit): Initialize new variables.

23 months ago* lisp/subr.el (combine-change-calls-1): Fix bug#60467
Stefan Monnier [Fri, 13 Jan 2023 22:38:04 +0000 (17:38 -0500)]
* lisp/subr.el (combine-change-calls-1): Fix bug#60467

Don't stop at timestamps.  Strip them for now, to be on the safe side.
Don't merge into `master` where we'll use a better fix.

23 months agoAdapt tramp-tests.el (do not merge with master)
Michael Albinus [Fri, 13 Jan 2023 18:35:52 +0000 (19:35 +0100)]
Adapt tramp-tests.el  (do not merge with master)

* test/lisp/net/tramp-tests.el (tramp--test-container-p):
Rename from `tramp--test-docker-p'.  Handle also "podman" method.
Adapt callees.

23 months agoFix minibuffer-completion tests
Eli Zaretskii [Fri, 13 Jan 2023 13:36:00 +0000 (15:36 +0200)]
Fix minibuffer-completion tests

* test/lisp/minibuffer-tests.el (completions-header-format-test):
Fix the test which first fired, and then drew the target...

23 months ago; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo (bug#60780).
Arash Esbati [Fri, 13 Jan 2023 13:24:25 +0000 (15:24 +0200)]
; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo (bug#60780).

23 months agoAdd c-ts-mode tests
Daniel Martín [Sun, 8 Jan 2023 13:04:24 +0000 (14:04 +0100)]
Add c-ts-mode tests

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New .erts file
to test indentation of typical C constructs and prevent regression of
bug fixes.
* test/lisp/progmodes/c-ts-mode-tests.el: New file with c-ts-mode
tests.

23 months agoFix c-ts-mode--fill-paragraph
Yuan Fu [Fri, 13 Jan 2023 01:29:14 +0000 (17:29 -0800)]
Fix c-ts-mode--fill-paragraph

Example:

       doc: /* Return non-nil if NODE1 and NODE2 are the same node.
If any one of NODE1 and NODE2 is nil, return nil.
This function uses the same equivalence metric as `equal'.  */

* lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix the
case where there are words before the /*, like the example above.

23 months agoFix minor issues with 'pp' and related commands
Eli Zaretskii [Fri, 13 Jan 2023 08:39:58 +0000 (10:39 +0200)]
Fix minor issues with 'pp' and related commands

* etc/NEWS:
* lisp/emacs-lisp/pp.el (pp-use-max-width, pp-emacs-lisp-code):
Mention in doc string that formatting via 'pp-emacs-lisp-code'
could be slow.
(pp-eval-expression, pp-macroexpand-expression): Honor
'pp-use-max-width'.  (Bug#58687)

23 months ago; Improve documentation of tree-sitter node comparison
Eli Zaretskii [Fri, 13 Jan 2023 07:13:24 +0000 (09:13 +0200)]
; Improve documentation of tree-sitter node comparison

* doc/lispref/parsing.texi (Accessing Node Information):
* src/treesit.c (Ftreesit_node_eq): Improve documentation of node
comparison.

23 months ago; Fix non-tree-sitter builds
Eli Zaretskii [Fri, 13 Jan 2023 06:58:03 +0000 (08:58 +0200)]
; Fix non-tree-sitter builds

* src/fns.c (internal_equal): Call treesit_node_eq only if
tree-sitter was compiled in.

23 months ago; Fix typo in ert-with-temp-file
Stefan Kangas [Fri, 13 Jan 2023 01:44:44 +0000 (02:44 +0100)]
; Fix typo in ert-with-temp-file

* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Fix typo.
Reported by F. Jason Park <jp@neverwas.me>.  (Bug#60730)

23 months agoEqual now recognizes tree-sitter nodes (bug#60659)
Yuan Fu [Fri, 13 Jan 2023 01:07:21 +0000 (17:07 -0800)]
Equal now recognizes tree-sitter nodes (bug#60659)

Now equal uses ts_node_eq to check equality between nodes.

* doc/lispref/parsing.texi:
(Accessing Node Information): Update manual.
* src/fns.c (internal_equal): Handle tree-sitter nodes.
* src/treesit.c (treesit_node_eq): New function.
(Ftreesit_node_eq): Factor out.  Update docstring.
* src/treesit.h (treesit_node_eq): Declare new function.

23 months agoFix c-ts-mode comment indentation (bug#60270)
Yuan Fu [Wed, 11 Jan 2023 09:26:21 +0000 (01:26 -0800)]
Fix c-ts-mode comment indentation (bug#60270)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Move the
star rule up.

23 months ago* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758).
Sean Whitton [Fri, 13 Jan 2023 00:09:01 +0000 (17:09 -0700)]
* lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758).

23 months ago* lisp/simple.el (next-completion): Handle first completion specially.
Gregory Heytings [Thu, 12 Jan 2023 17:47:28 +0000 (19:47 +0200)]
* lisp/simple.el (next-completion): Handle first completion specially.

When completions-header-format is nil and completion-show-help is nil,
the first completion is at the beginning the buffer, so 'M-<down>'
missed it and moved to the second completion.  Handle this case by
setting/checking the special text-property 'first-completion' that
is nil at the first call (bug#60411).

23 months agoFix encoding with 'utf-8-auto'
Eli Zaretskii [Thu, 12 Jan 2023 14:36:35 +0000 (16:36 +0200)]
Fix encoding with 'utf-8-auto'

* src/coding.c (encode_coding_utf_8): Fix encoding with
'utf-8-auto': it should produce BOM, per the documentation of
the :bom attribute.  (Bug#60750)

* lisp/international/mule.el (define-coding-system): Doc fix.

* test/src/coding-tests.el (coding-tests): Use
'with-coding-priority' instead of 'prefer-coding-system', as the
latter has global persistent effect and affects further tests.

23 months agoReport cursor correctly on PGTK when there is a margin
Po Lu [Thu, 12 Jan 2023 10:36:14 +0000 (18:36 +0800)]
Report cursor correctly on PGTK when there is a margin

* src/pgtkterm.c (pgtk_draw_window_cursor): Adjust frame_x by
the margin width as well.

23 months agoUpdate to Org 9.6.1
Kyle Meyer [Thu, 12 Jan 2023 02:15:37 +0000 (21:15 -0500)]
Update to Org 9.6.1

23 months agoAdd support for annotation_type_declaration
Theodor Thornhill [Wed, 11 Jan 2023 20:49:04 +0000 (21:49 +0100)]
Add support for annotation_type_declaration

* lisp/progmodes/java-ts-mode.el (java-ts-mode--keywords): Add new
keyword.
(java-ts-mode--font-lock-settings): Add font-locking to the type
feature.

23 months ago* etc/NEWS: Mention incompatible changes in 'outline-minor-mode-cycle-map'.
Juri Linkov [Wed, 11 Jan 2023 19:37:33 +0000 (21:37 +0200)]
* etc/NEWS: Mention incompatible changes in 'outline-minor-mode-cycle-map'.

* lisp/outline.el (outline-minor-mode-cycle--bind):
Add docstring (bug#60426).
(outline-minor-mode-cycle--bind): Default 'map' to
'outline-minor-mode-cycle-map'.
(outline-minor-mode-cycle-map): Improve docstring.
(outline-minor-mode): Move margin-cycling keys to
'outline-minor-mode-cycle-map'.

23 months agoEnsure VC package names are not empty
Philip Kaludercic [Wed, 11 Jan 2023 08:27:01 +0000 (09:27 +0100)]
Ensure VC package names are not empty

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Raise an error
if the package name is empty.
(package-vc-install): Avoid generating an empty file name, if a URL
ends with a slash, and raise an error if the package name is empty.

23 months agoHandle missing package description when unpacking vc packages
Philip Kaludercic [Wed, 11 Jan 2023 08:21:57 +0000 (09:21 +0100)]
Handle missing package description when unpacking vc packages

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Create a dummy
descriptor if PKG-DESC is nil.

23 months agoCC Mode: partially revert commit from 2022-10-04
Alan Mackenzie [Tue, 10 Jan 2023 20:29:37 +0000 (20:29 +0000)]
CC Mode: partially revert commit from 2022-10-04

This reversion is of an ill-advised optimization, which resulted in non-type
identifiers getting fontified as types.

* lisp/progmodes/cc-fonts.el (c-fontify-new-found-type): Rather than writing
the expected face directly to the text, instead remove the `fontified'
property.  This allows the full font-lock mechanism to fontify the buffer
correctly.

23 months agoFix reftex-citation docstring (bug#60710)
Manuel Uberti [Tue, 10 Jan 2023 14:51:46 +0000 (15:51 +0100)]
Fix reftex-citation docstring (bug#60710)

* lisp/textmodes/reftex-cite.el (reftex-citation): Fix spelling.

23 months agoImprove 'describe-char-fold-equivalences' docstring
Robert Pluim [Tue, 10 Jan 2023 14:22:34 +0000 (15:22 +0100)]
Improve 'describe-char-fold-equivalences' docstring

* lisp/char-fold.el (describe-char-fold-equivalences): Explain what
the output looks like.

23 months agoRemove obsolete server buffers on MOTD in erc-track
F. Jason Park [Wed, 4 Jan 2023 07:10:53 +0000 (23:10 -0800)]
Remove obsolete server buffers on MOTD in erc-track

* lisp/erc/erc-networks.el
(erc-networks--copy-server-buffer-functions): New internal hook
through which modules can perform housekeeping when server buffers
belonging to the same network context are merged.
(erc-networks--copy-over-server-buffer-contents): Run new internal
hook `erc-networks--copy-server-buffer-functions'.
* lisp/erc/erc-track.el (erc-track-enable, erc-track-disable): Manage
membership in `erc-networks--copy-server-buffer-functions' hook.
(erc-track--replace-killed-buffer): New function to replace server
buffer being killed in `erc-modified-channels-alist'.
* test/lisp/erc/erc-scenarios-base-association.el
(erc-scenarios-networks-merge-server-track): New test.
* test/lisp/erc/resources/networks/merge-server/track.eld: New test
data.  (Bug#60560.)

23 months ago; Fix wrong type in erc-ignore hide-list options
F. Jason Park [Tue, 3 Jan 2023 02:13:08 +0000 (18:13 -0800)]
; Fix wrong type in erc-ignore hide-list options

* lisp/erc/erc.el (erc-network-hide-list, erc-channel-hide-list):
Fix type in custom definition.

23 months ago; Kill some stray buffers left behind by ERC tests
F. Jason Park [Wed, 4 Jan 2023 07:10:53 +0000 (23:10 -0800)]
; Kill some stray buffers left behind by ERC tests

* test/lisp/erc/erc-services-tests.el
(erc--auth-source-search--plstore-standard,
erc--auth-source-search--plstore-announced,
erc--auth-source-search--plstore-overrides): Kill buffer renamed by
plstore.  In the future, try using the `:buffer' keyword introduced in
Emacs 29.
* test/lisp/erc/resources/erc-d/erc-d-t.el
(erc-d-t-kill-related-buffers): Don't forget about `erc-dcc-chat-mode'
buffers.

23 months agoFix completion-auto-help docstring (bug#60709)
Manuel Uberti [Tue, 10 Jan 2023 13:24:04 +0000 (14:24 +0100)]
Fix completion-auto-help docstring (bug#60709)

* lisp/minibuffer.el (completion-auto-help): Remove extra period.

23 months agoFix c-ts-mode comment indent
Yuan Fu [Tue, 10 Jan 2023 05:46:07 +0000 (21:46 -0800)]
Fix c-ts-mode comment indent

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-2nd-line-matcher): Also make sure PARENT is a
comment node.

23 months agoHighlight identifier in import statements in js-ts-mode
Yuan Fu [Tue, 10 Jan 2023 05:31:38 +0000 (21:31 -0800)]
Highlight identifier in import statements in js-ts-mode

Follow-up on bug#60689.  This commit just copied the change in
e385c099b8c to js-ts-mode.

* lisp/progmodes/js.el:
(js--treesit-font-lock-settings): Add import query.

23 months agoDon't print named tree-sitter nodes with parenthesizes (bug#60696)
Yuan Fu [Tue, 10 Jan 2023 04:15:12 +0000 (20:15 -0800)]
Don't print named tree-sitter nodes with parenthesizes (bug#60696)

* src/print.c (print_vectorlike): Use empty string as delimiters if
the node is named.

23 months agoImprove fontification for import-statements in typescript-ts-mode
Jostein Kjønigsen [Mon, 9 Jan 2023 10:17:53 +0000 (11:17 +0100)]
Improve fontification for import-statements in typescript-ts-mode

(bug#60689)

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--font-lock-settings): Add rules to highlight the
actual imports in import-statements.

23 months agoFix c-ts-mode indentation for 2nd line in block comment (bug#60270)
Yuan Fu [Mon, 9 Jan 2023 09:44:44 +0000 (01:44 -0800)]
Fix c-ts-mode indentation for 2nd line in block comment (bug#60270)

If the first line is "/*" or "/*   ", indent like this:

/*
   aaa

If the first line is "/*   some text", indent like this:

/*   some text
     aaa

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
(c-ts-mode--looking-at-star): Minor refactor.
(c-ts-mode--comment-2nd-line-matcher)
(c-ts-mode--comment-2nd-line-anchor): New functions.
* lisp/treesit.el (treesit-simple-indent-presets):
prev-adaptive-prefix doesn't handle the comment-start-skip case (i.e,
2nd line) anymore.  (Handled by the new matcher.)

23 months ago; xref.el: Bump version
Dmitry Gutov [Tue, 10 Jan 2023 00:02:09 +0000 (02:02 +0200)]
; xref.el: Bump version

23 months ago; project.el: Bump version
Dmitry Gutov [Tue, 10 Jan 2023 00:00:29 +0000 (02:00 +0200)]
; project.el: Bump version

23 months ago; * src/callint.c (Finteractive): Doc string clarification.
Eli Zaretskii [Mon, 9 Jan 2023 12:03:04 +0000 (14:03 +0200)]
; * src/callint.c (Finteractive): Doc string clarification.

23 months ago* lisp/vc/diff-mode.el (diff-font-lock-keywords): Check for limit.
Juri Linkov [Mon, 9 Jan 2023 07:54:19 +0000 (09:54 +0200)]
* lisp/vc/diff-mode.el (diff-font-lock-keywords): Check for limit.

This check is necessary since 'diff-beginning-of-hunk' can move
not only backwards, but also forwards (bug#60660).

23 months agoMinor improvement for tree-sitter explorer
Yuan Fu [Mon, 9 Jan 2023 04:30:07 +0000 (20:30 -0800)]
Minor improvement for tree-sitter explorer

If you open an empty python buffer and type

1 + 2
a
b

Currently the explorer only displays the top-level node at point, ie,
only 1 + 2, only a, or only b. That's kind of awkward, so if the
buffer is small, show the entire parse tree.

* lisp/treesit.el (treesit--explorer-refresh): See above.

23 months agoMake sure NODE is not the root node in tree-sitter indent (bug#60602)
Yuan Fu [Mon, 9 Jan 2023 03:05:19 +0000 (19:05 -0800)]
Make sure NODE is not the root node in tree-sitter indent (bug#60602)

There are two possible ways to solve the problem raised in the bug
report: either make sure NODE is never the root (so that parent is
never nil), or allow parent to be nil.

If we go with the latter, a lot of matcher and anchor functions need
change (they need to guard against a null parent).  I tried it, and
needing to check for null parent is pretty annoying.  In comparison,
if NODE is never the root, it is very convenient for the user, and it
doesn't complicate the rule that much (and it's rather intuitive,
people usually don't think of the case where NODE is the root node).
So that's what I choose.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-indent-function): Update docstring.
(treesit--indent-1): Make sure NODE is not the root.

23 months agoFix label indent of GNU and Linux style in c-ts-mode (bug#60543)
Yuan Fu [Mon, 9 Jan 2023 00:57:29 +0000 (16:57 -0800)]
Fix label indent of GNU and Linux style in c-ts-mode (bug#60543)

The previous fix isn't correct.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): New indent rule.  Fix the rule for Linux
style.
(c-ts-mode--top-level-label-matcher): New function.

23 months agoImprove go-ts-mode Imenu, navigation and electric pair (bug#60407)
Evgeni Kolev [Thu, 29 Dec 2022 15:49:40 +0000 (17:49 +0200)]
Improve go-ts-mode Imenu, navigation and electric pair (bug#60407)

The Imenu items are extended to support "Method", "Struct",
"Interface", "Alias" and "Type".

go-ts-mode is updated to use the Imenu facility added in commit
b39dc7ab27a696a8607ab859aeff3c71509231f5.

Variable electric-indent-chars is set in order to improve integration
with Electric Pair mode.

* lisp/progmodes/go-ts-mode.el (go-ts-mode--imenu-1) (go-ts-mode--imenu):
Remove functions.
(go-ts-mode--defun-name, go-ts-mode--interface-node-p)
(go-ts-mode--struct-node-p, go-ts-mode--other-type-node-p)
(go-ts-mode--alias-node-p): New functions.
(go-ts-mode): Improve Imenu settings, navigation, add Electric Pair
mode settings.

23 months ago; ruby.rb: Fix pattern matching syntax and extend the example
Dmitry Gutov [Sun, 8 Jan 2023 22:57:36 +0000 (00:57 +0200)]
; ruby.rb: Fix pattern matching syntax and extend the example

23 months agoRevert "Add c-or-c++-ts-mode (bug#59613)"
Yuan Fu [Sun, 8 Jan 2023 17:40:49 +0000 (09:40 -0800)]
Revert "Add c-or-c++-ts-mode (bug#59613)"

This reverts commit 1df2826639c912396fac0af108301533dac71406.

I forgot about the feature freeze, sorry :-)

23 months ago; * src/pgtkfns.c (parse_resource_key): Use recursive schema lookup
Tad Fisher [Wed, 4 Jan 2023 21:40:17 +0000 (13:40 -0800)]
; * src/pgtkfns.c (parse_resource_key): Use recursive schema lookup

XDG_DATA_DIRS may consist of multiple directories, and
g_settings_schema_source_get_default composes these into a recursive
schema source. One must pass TRUE to g_settings_schema_source_lookup,
otherwise only the first directory in XDG_DATA_DIRS is searched.

It follows that in the case that the directory containing the compiled
GSettings schema for Emacs is not the first in XDG_DATA_DIRS,
parse_resource_key will not accept any resource key, which causes
pgtk_get_defaults_value and pgtk_set_defaults_value to fail.

This impacts systems that compose multiple GSettings schema sources
via XDG_DATA_DIRS, such Flatpak and NixOS.

Supporting GIO documentation for g_settings_schema_source_get_default:

> The returned source may actually consist of multiple schema sources
> from different directories, depending on which directories were given
> in `XDG_DATA_DIRS` and `GSETTINGS_SCHEMA_DIR`. For this reason, all
> lookups performed against the default source should probably be done
> recursively.

Bug#60565

Copyright-paperwork-exempt: yes

23 months agoAdd back renamed function 'font-lock-fontify-syntactically-region'
Benson Chu [Sun, 1 Jan 2023 01:45:43 +0000 (19:45 -0600)]
Add back renamed function 'font-lock-fontify-syntactically-region'

A more accurate replacement for font-lock-fontify-syntactically-region
would be a function that funcalls the
font-lock-fontify-syntactically-function variable. That way, callers
of the function can inherit new behavior, if the value of that variable
changes.

* lisp/font-lock.el (font-lock-fontify-syntactically-region):
Add function back, remove its obsolete alias.

Copyright-paperwork-exempt: yes

23 months ago; * lisp/progmodes/ruby-ts-mode.el: Fix compilation warnings (bug#60647).
Eli Zaretskii [Sun, 8 Jan 2023 10:56:13 +0000 (12:56 +0200)]
; * lisp/progmodes/ruby-ts-mode.el: Fix compilation warnings (bug#60647).