1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-30 08:09:04 +00:00
Commit Graph

164198 Commits

Author SHA1 Message Date
Xi Lu
d2efee31ed ; Update htmlfontify documentation
* doc/misc/htmlfontify.texi (Customization): Remove 'hfy-find-cmd',
add 'hfy-exclude-file-rules'.
(Requirements): Remove text about 'find' program.
2023-01-15 11:49:45 +02:00
Eli Zaretskii
72d2604d1f Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29 2023-01-15 11:19:20 +02:00
Eli Zaretskii
cf31182684 ; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix. 2023-01-15 11:18:44 +02:00
Yuan Fu
3fa10f6e54
; 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.
2023-01-15 01:11:38 -08:00
Yuan Fu
25a5575f16
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.
2023-01-15 01:11:38 -08:00
Yuan Fu
252b2c01af
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.
2023-01-15 01:11:38 -08:00
Yuan Fu
189d976dba
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.
2023-01-15 01:11:37 -08:00
Yuan Fu
c78e19d99c
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.
2023-01-15 01:11:37 -08:00
Yuan Fu
d13a329acf
; 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.
2023-01-15 01:11:37 -08:00
Yuan Fu
d428d51066
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.
2023-01-15 01:11:37 -08:00
Yuan Fu
f02998939c
; 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.
2023-01-15 01:11:36 -08:00
Eli Zaretskii
b365a7cc32 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)
2023-01-15 10:47:24 +02:00
Eli Zaretskii
b5e0260f42 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)
2023-01-15 08:10:33 +02:00
Stefan Kangas
256791edd4 ; Auto-commit of loaddefs files. 2023-01-15 05:08:49 +01:00
Stefan Kangas
920a7d38e9 ; Fix typos 2023-01-15 02:14:19 +01:00
Theodor Thornhill
48a62c5546 Add constructor_declaration as java-ts-mode defun
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Extend
treesit-defun-type-regexp.
2023-01-14 23:07:43 +01:00
Gregory Heytings
72c45fa910 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.
2023-01-14 22:24:33 +01:00
Sean Whitton
1ef359095e ; * etc/NEWS (--with-native-compilation=aot): Tweak wording.
I've observed people thinking that this is a completely new feature.
2023-01-14 12:50:54 -07:00
Juri Linkov
a8eb9dd400 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.
2023-01-14 20:56:33 +02:00
Michael Albinus
fd77de542d ; * etc/NEWS: Fix typos. 2023-01-14 19:30:55 +01:00
Eli Zaretskii
195afb68e3 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29 2023-01-14 18:30:05 +02:00
Eli Zaretskii
cd83bc930c ; * lisp/htmlfontify.el (hfy-exclude-file-rules): Fix :version. 2023-01-14 18:15:46 +02:00
Theodor Thornhill
8d7ad65665 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.
2023-01-14 15:20:49 +01:00
Stefan Monnier
96601cd90b 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
900b09c023), but be more careful not to burp on false positives.
2023-01-14 09:06:27 -05:00
Theodor Thornhill
10032f424c 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.
2023-01-14 12:32:59 +01:00
Theodor Thornhill
e2e937300f 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.
2023-01-14 12:32:59 +01:00
Eli Zaretskii
0116e27b26 ; Fix NEWS markup 2023-01-14 11:53:37 +02:00
Eli Zaretskii
435ba92ccc ; Fix last change in htmlfontify.el 2023-01-14 11:10:53 +02:00
Xi Lu
7100ecd7a4 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'.
2023-01-14 11:05:53 +02:00
Eli Zaretskii
f102145d38 ; * etc/PROBLEMS: Describe problems with MuPDF 1.21. (Bug#60308) 2023-01-14 10:52:06 +02:00
Eli Zaretskii
79971ebacc 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.
2023-01-14 10:26:40 +02:00
Eshel Yaron
f1032bf24e 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
2023-01-14 10:12:11 +02:00
Paul Eggert
1b9ffd2811 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.
2023-01-13 23:39:51 -08:00
Yuan Fu
dc33a12223
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.
2023-01-13 17:32:14 -08:00
Stefan Monnier
59c3c53efa * 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.
2023-01-13 17:38:04 -05:00
Michael Albinus
9f8f8ed1ba 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.
2023-01-13 19:35:52 +01:00
Eli Zaretskii
861556c133 Fix minibuffer-completion tests
* test/lisp/minibuffer-tests.el (completions-header-format-test):
Fix the test which first fired, and then drew the target...
2023-01-13 15:36:00 +02:00
Arash Esbati
c0578edc8f ; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo (bug#60780). 2023-01-13 15:24:25 +02:00
Daniel Martín
c6bbf9cc27
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.
2023-01-13 00:55:24 -08:00
Yuan Fu
a760364f5f
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.
2023-01-13 00:55:24 -08:00
Eli Zaretskii
2a2b1d09ac 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)
2023-01-13 10:39:58 +02:00
Eli Zaretskii
dfb38fb2ee ; 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.
2023-01-13 09:13:24 +02:00
Eli Zaretskii
e8a89a18b6 ; Fix non-tree-sitter builds
* src/fns.c (internal_equal): Call treesit_node_eq only if
tree-sitter was compiled in.
2023-01-13 08:58:03 +02:00
Stefan Kangas
f27a330b99 ; 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)
2023-01-13 02:50:39 +01:00
Yuan Fu
956889d8ff
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.
2023-01-12 17:11:38 -08:00
Yuan Fu
8f446c2d39
Fix c-ts-mode comment indentation (bug#60270)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Move the
star rule up.
2023-01-12 17:11:37 -08:00
Sean Whitton
083badc9c1 * lisp/subr.el (while-let): Use if-let, not if-let* (bug#60758). 2023-01-12 17:09:01 -07:00
Gregory Heytings
9ecebcdded * 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).
2023-01-12 19:47:28 +02:00
Eli Zaretskii
cfd2b3504a 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.
2023-01-12 16:36:35 +02:00
Po Lu
53b47df822 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.
2023-01-12 18:36:14 +08:00