]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoRemove treesit manual entries for deleted functions
Yuan Fu [Fri, 19 Aug 2022 07:25:10 +0000 (00:25 -0700)]
Remove treesit manual entries for deleted functions

* doc/lispref/parsing.texi: Remove documentation for
treesit-get-parser-create and treesit-get-parser.

2 years agoAdd treesit-parser-delete
Yuan Fu [Thu, 18 Aug 2022 08:44:39 +0000 (01:44 -0700)]
Add treesit-parser-delete

* src/treesit.c (ts_record_change): Replace CHECK_TS_PARSER with
ts_check_parser.
(make_ts_parser): Initialize deleted field.
(Ftreesit_parser_delete): Replace CHECK_TS_PARSER with
ts_check_parser. Set deleted field.
(Ftreesit_parser_buffer, Ftreesit_parser_language): Replace
CHECK_TS_PARSER with ts_check_parser.
(ts_check_parser): New function.
(Ftreesit_parser_root_node, Ftreesit_parser_set_included_ranges)
(Ftreesit_parser_included_ranges): Replace CHECK_TS_PARSER with
ts_check_parser.
(Qtreesit_parser_deleted): New symbol.
(Qtreesit_parser_deleted): New error.
* src/treesit.h (Lisp_TS_Parser): New field 'deleted'.

2 years ago* src/treesit.c (make_ts_parser): Initialize timestamp field.
Yuan Fu [Mon, 20 Jun 2022 02:06:56 +0000 (19:06 -0700)]
* src/treesit.c (make_ts_parser): Initialize timestamp field.

2 years ago; * lisp/treesit.el (treesit-traverse-forward): Fix docstring.
Yuan Fu [Sat, 18 Jun 2022 23:57:50 +0000 (16:57 -0700)]
; * lisp/treesit.el (treesit-traverse-forward): Fix docstring.

2 years agoFix double-free in treesit.c
Yuan Fu [Sat, 18 Jun 2022 00:04:00 +0000 (17:04 -0700)]
Fix double-free in treesit.c

* src/treesit.c (Ftreesit_query_capture): Remove free at the end.

2 years agoChange treesit-parser-list from variable to function
Yuan Fu [Fri, 17 Jun 2022 00:55:07 +0000 (17:55 -0700)]
Change treesit-parser-list from variable to function

Effectively making the list internal.  Now Emacs user cannot shoot
themselves in the foot by removing a parser from the list, make
chaanges to buffer and add that parser back to the list.

* doc/lispref/parsing.texi (Language Definitions, Using Parser)
(Retrieving Node, Multiple Languages): Change variable to function.
* lisp/treesit.el (treesit-language-at, treesit-node-on)
(treesit-buffer-root-node, treesit-indent, treesit-check-indent)
(treesit-search-forward, treesit-search-beginning)
(treesit-end-of-defun, treesit-inspect-mode): Change variable to
function.
* src/buffer.c (bset_ts_parser_list, reset_buffer, init_buffer_once):
Add ts_parser_list.
* src/buffer.h (struct buffer): Add ts_parser_list.
* src/treesit.c (ts_record_change, Ftreesit_parser_create): Use the
buffer field instead of the old buffer local variable.
(Ftreesit_parser_delete, Ftreesit_parser_list): New functions.
(syms_of_treesit): Remove treesit-parser-list.
* test/src/treesit-tests.el (treesit-basic-parsing): Use the new
function.

2 years agoAdd treesit test for previous change
Yuan Fu [Thu, 16 Jun 2022 18:25:08 +0000 (11:25 -0700)]
Add treesit test for previous change

* test/src/treesit-tests.el (treesit-cross-boundary): New test.

2 years agoConsolidate treesit parser create functions
Yuan Fu [Thu, 16 Jun 2022 08:11:09 +0000 (01:11 -0700)]
Consolidate treesit parser create functions

Merge treesit-parser-create, treesit-get-parser,
treesit-get-parser-create into one: treesit-parser-create.

* src/treesit.c (Ftreesit_parser_language): make BUFFER parameter
optional, add new parameter NO-REUSE.  Optionally reuse parser.
* test/src/treesit-tests.el: Change all parser creation to use
treesit-parser-create.  Remove tests for the removed functions.
* lisp/treesit.el (treesit-get-parser, treesit-get-parser-create):
Remove.
* lisp/treesit.el (treesit-set-ranges, treesit-get-ranges)
(treesit-buffer-root-node, treesit-query-string)
(treesit-font-lock-fontify-region, treesit-search-forward)
(treesit-query-validate): Change to use treesit-parser-create.

2 years agoFix treesit function ts_record_change and friends
Yuan Fu [Thu, 16 Jun 2022 04:53:15 +0000 (21:53 -0700)]
Fix treesit function ts_record_change and friends

In ts_record_change, the way we calculate tree-sitter change was
wrong:

    ptrdiff_t affected_start =
      max (visible_beg, start_byte) - visible_beg;
    ptrdiff_t affected_old_end =
      min (visible_end, affected_start + bytes_del);
    ptrdiff_t affected_new_end =
      affected_start + bytes_ins;

I changed it to below (also renamed variables)

    ptrdiff_t start_offset =
      min (visible_end,
           max (visible_beg, start_byte)) - visible_beg;
    ptrdiff_t old_end_offset =
      min (visible_end,
           max (visible_beg, old_end_byte)) - visible_beg;
    ptrdiff_t new_end_offset =
      min (visible_end,
           max (visible_beg, new_end_byte)) - visible_beg;

Also previously only visible_end is changed (in a wrong way)

    XTS_PARSER (lisp_parser)->visible_end = affected_new_end;

Now we have a whole new bunch of code that makes the right change.

* src/treesit.c (ts_tree_edit_1): Add assertion.
(ts_record_change): See above.
(ts_ensure_position_synced): Add assertion.
(ts_ensure_parsed): Only free if non-NULL.
(make_ts_parser): Add assertion.
(Ftreesit_parser_set_included_ranges): Ensure parsed before setting ranges.
(Ftreesit_parser_included_ranges): Add assertion.

2 years ago; Minor optimization in treesit range function
Yuan Fu [Wed, 15 Jun 2022 19:17:10 +0000 (12:17 -0700)]
; Minor optimization in treesit range function

* src/treesit.c (Ftreesit_parser_set_included_ranges): Lift
assignment out of the loop.

2 years ago; * src/treesit.c: Add comment to explain design decisions.
Yuan Fu [Wed, 15 Jun 2022 19:15:24 +0000 (12:15 -0700)]
; * src/treesit.c: Add comment to explain design decisions.

2 years ago; * src/treesit.c (ts_check_buffer_size): Improve error message.
Yuan Fu [Wed, 15 Jun 2022 19:14:54 +0000 (12:14 -0700)]
; * src/treesit.c (ts_check_buffer_size): Improve error message.

2 years ago; * src/treesit.c (ts_read_buffer): Clarify comments.
Yuan Fu [Wed, 15 Jun 2022 19:14:26 +0000 (12:14 -0700)]
; * src/treesit.c (ts_read_buffer): Clarify comments.

2 years ago* src/treesit.c (ts_check_range_argument): Check for point-min/max.
Yuan Fu [Wed, 15 Jun 2022 18:33:35 +0000 (11:33 -0700)]
* src/treesit.c (ts_check_range_argument): Check for point-min/max.

2 years agoFix compile warnings and errors in treesit.c
Yuan Fu [Wed, 15 Jun 2022 04:04:52 +0000 (21:04 -0700)]
Fix compile warnings and errors in treesit.c

* src/treesit.c (ts_initialize): Fix.
(Ftreesit_parser_set_included_ranges): Fix.
(Ftreesit_query_compile): Fix.

2 years agoMerge remote-tracking branch 'savannah/master' into feature/tree-sitter
Yuan Fu [Tue, 14 Jun 2022 22:59:46 +0000 (15:59 -0700)]
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter

2 years agoMerge branch 'feature/tree-sitter-depth-control' into feature/tree-sitter
Yuan Fu [Tue, 14 Jun 2022 22:52:01 +0000 (15:52 -0700)]
Merge branch 'feature/tree-sitter-depth-control' into feature/tree-sitter

2 years agoAdd manual for treesit-traverse-forward and friends
Yuan Fu [Tue, 14 Jun 2022 22:49:44 +0000 (15:49 -0700)]
Add manual for treesit-traverse-forward and friends

* doc/lispref/parsing.texi (Retrieving Node): Add manual entry for
treesit-traverse-depth-first, treesit-traverse-breadth-first,
treesit-traverse-forward.
* lisp/treesit.el (treesit-traverse-forward): Fix docstring.

2 years agoChange treesit-check-query and mention it in documentation
Yuan Fu [Tue, 14 Jun 2022 21:30:39 +0000 (14:30 -0700)]
Change treesit-check-query and mention it in documentation

* doc/lispref/parsing.texi (Pattern Matching): Mention it.
* lisp/treesit.el (treesit-check-query): Rename to
treesit-query-validate.
* src/treesit.c (Ftreesit_query_capture, Ftreesit_query_compile):
Mention it.

2 years agoAdd treesit-query-compile to manual
Yuan Fu [Tue, 14 Jun 2022 21:17:17 +0000 (14:17 -0700)]
Add treesit-query-compile to manual

* doc/lispref/parsing.texi: Add treesit-query-compile.

2 years ago; * doc/lispref/parsing.texi: Minor fix-up.
Yuan Fu [Tue, 14 Jun 2022 21:16:11 +0000 (14:16 -0700)]
; * doc/lispref/parsing.texi: Minor fix-up.

2 years agoAdd test for treesit-query-compile
Yuan Fu [Tue, 14 Jun 2022 20:32:14 +0000 (13:32 -0700)]
Add test for treesit-query-compile

* test/src/treesit-tests.el (treesit-query-api): Rename pattern to
query, and add treesit-query-compile into the mix.

2 years agoAdd abbrev tables for minibuffer-mode and minibuffer-inactive-mode
Sean Whitton [Mon, 13 Jun 2022 17:24:17 +0000 (12:24 -0500)]
Add abbrev tables for minibuffer-mode and minibuffer-inactive-mode

* lisp/minibuffer.el (minibuffer-mode, minibuffer-inactive-mode): Add
an abbrev table for each of these modes (bug#55946).

2 years agoSupport compiled queries in treesit-query-capture
Yuan Fu [Tue, 14 Jun 2022 18:36:22 +0000 (11:36 -0700)]
Support compiled queries in treesit-query-capture

Last commit added this new type, this commit adds functionalities.
treesit.el only has documentation changes.

* lisp/treesit.el (treesit-query-in, treesit-font-lock-settings,
treesit-defun-query): Update docstring.
* src/treesit.c (make_ts_query): New function.
(Ftreesit_query_compile): New function.
(Ftreesit_query_capture): Remove code that creates a query object and
instead either use make_ts_query or use the give compiled query.  Free
the query object conditonally.
(syms_of_treesit): New symbol.

2 years ago* src/treesit.c (Ftreesit_query_p): New function.
Yuan Fu [Tue, 14 Jun 2022 06:07:19 +0000 (23:07 -0700)]
* src/treesit.c (Ftreesit_query_p): New function.

2 years agoAdd new type treesit-compiled-query
Yuan Fu [Tue, 14 Jun 2022 06:01:04 +0000 (23:01 -0700)]
Add new type treesit-compiled-query

No intergration/interaction with the new type, just adding it.

* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add new type.
* src/alloc.c (cleanup_vector): Add gc for the new type.
* src/data.c (Ftype_of): Add switch case for the new type.
(syms_of_data): Add symbols for the new type.
* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add new type.
* src/treesit.c (Ftreesit_compiled_query_p): New function.
(syms_of_treesit): Add symbol for the new type.
* src/treesit.h (struct Lisp_TS_Query): New struct.
(TS_COMPILED_QUERY_P, XTS_COMPILED_QUERY, CHECK_TS_COMPILED_QUERY):
New macros.
* src/print.c (print_vectorlike): Add printing for the new type.

2 years agoSimplify byte-compiler assuming cconv normalisations
Mattias Engdegård [Mon, 6 Jun 2022 09:10:05 +0000 (11:10 +0200)]
Simplify byte-compiler assuming cconv normalisations

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker)
(byte-optimize-let-form, byte-optimize-letX):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unwind-protect):
Simplify source optimisation and codegen code that can now rely on
normalised let/let* and unwind-protect forms.

2 years agoRun cconv for dynbound code as well
Mattias Engdegård [Tue, 14 Jun 2022 17:09:20 +0000 (19:09 +0200)]
Run cconv for dynbound code as well

Make cconv work for dynamically bound code and always run it.
This allows later stages to benefit from transformations and
normalisations in cconv.

* lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): Always run
cconv.
* lisp/emacs-lisp/cconv.el (cconv--analyze-function)
(cconv-analyze-form): In dynbound code, treat all variable bindings
as dynamic (lambda, let, let* and condition-case).

2 years agoNormalise setq during macro-expansion
Mattias Engdegård [Fri, 3 Jun 2022 18:31:10 +0000 (20:31 +0200)]
Normalise setq during macro-expansion

Early normalisation of setq during macroexpand-all allows later
stages, cconv, byte-opt and codegen, to be simplified and duplicated
checks to be eliminated.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Normalise all setq forms to a sequence of (setq VAR EXPR).
Emit warnings if necessary.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq):
Simplify.
* test/lisp/emacs-lisp/bytecomp-tests.el: Adapt and add tests.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el;
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el:
New files.

2 years ago* lisp/replace.el (read-regexp): Use minibuffer-message in the minibuffer.
Juri Linkov [Tue, 14 Jun 2022 16:35:02 +0000 (19:35 +0300)]
* lisp/replace.el (read-regexp): Use minibuffer-message in the minibuffer.

2 years agoAdd more characters with macron in C-x 8 map and latin input methods
Robert Pluim [Wed, 8 Jun 2022 12:51:31 +0000 (14:51 +0200)]
Add more characters with macron in C-x 8 map and latin input methods

* lisp/international/iso-transl.el (iso-transl-char-map): Add
sequences for {AE,ae,G,g} with macron.
* lisp/leim/quail/latin-post.el ("latin-postfix"): Add missing entries
for {AE,ae,G,g} with macron.
* lisp/leim/quail/latin-pre.el ("latin-prefix"): Add entries for
'letter with macron' for {A,a,E,e,AE,ae,I,I,O,o,U,u,Y,y} with macron.

(Bug#55668)

2 years agoFix errors when aligning text in find-dired
Stephen Berman [Tue, 14 Jun 2022 13:37:53 +0000 (15:37 +0200)]
Fix errors when aligning text in find-dired

* lisp/find-dired.el (find-dired-filter): Don't error out while
trying to align the text (by just removing that code) (bug#46218).

2 years agoMake flymake-proc--delete-temp-directory slightly safer
Lars Ingebrigtsen [Tue, 14 Jun 2022 13:24:19 +0000 (15:24 +0200)]
Make flymake-proc--delete-temp-directory slightly safer

* lisp/progmodes/flymake-proc.el
(flymake-proc--delete-temp-directory): Temp dir name may be
abbreviatated, so expand it first (bug#46203).

2 years agoFix .dir-local.el caching for symlinks
Lars Ingebrigtsen [Tue, 14 Jun 2022 13:01:44 +0000 (15:01 +0200)]
Fix .dir-local.el caching for symlinks

* lisp/files.el (dir-locals-read-from-dir): We want the time stamp
of the actual file, not the time stamp of the symlink (if
.dir-locals.el is a symlink) (bug#46122).

2 years agoLeave the contents on the *Backtrace* buffer on `q'
Lars Ingebrigtsen [Tue, 14 Jun 2022 12:38:05 +0000 (14:38 +0200)]
Leave the contents on the *Backtrace* buffer on `q'

* lisp/emacs-lisp/debug.el (debug): Don't clear the contents of
the buffer on `q' (bug#55863).

2 years agoFix gud parsing of empty jdb classpaths
Lars Ingebrigtsen [Tue, 14 Jun 2022 12:26:58 +0000 (14:26 +0200)]
Fix gud parsing of empty jdb classpaths

* lisp/progmodes/gud.el (gud-jdb-marker-filter): Parse empty
classpaths (like classpath: []) correctly (bug#55957).

2 years agoBind Cmd-t to menu-set-font on macOS
Daniel Martín [Tue, 14 Jun 2022 12:23:06 +0000 (14:23 +0200)]
Bind Cmd-t to menu-set-font on macOS

* lisp/term/ns-win.el (global-map): set-frame-font asks for a font
using the minibuffer, but the former ns-popup-font-panel always showed
the graphical font panel on macOS.  To preserve the same behavior,
bind it to menu-set-font, which is also called by Options, Set Default
Font (bug#55967).

2 years agoAllow using alists in ido completion and hitting TAB
Lars Ingebrigtsen [Tue, 14 Jun 2022 12:16:55 +0000 (14:16 +0200)]
Allow using alists in ido completion and hitting TAB

* lisp/ido.el (ido-completion-help): Allow using an alist
COMPLETIONS (bug#46091).

2 years agoMention how to only get syntactic font locking in the manual
Lars Ingebrigtsen [Mon, 13 Jun 2022 18:57:25 +0000 (20:57 +0200)]
Mention how to only get syntactic font locking in the manual

* doc/lispref/modes.texi (Syntactic Font Lock): Note how to only
get syntactic font locking (bug#46039).

2 years ago; Improve doc of `x-dnd-native-test-function'
Po Lu [Tue, 14 Jun 2022 11:49:58 +0000 (19:49 +0800)]
; Improve doc of `x-dnd-native-test-function'

* src/xterm.c (syms_of_xterm): Improve doc.  Suggested by Eli
Zaretskii <eliz@gnu.org>.

2 years agoFix Tramp problem with non-essential
Michael Albinus [Tue, 14 Jun 2022 11:04:34 +0000 (13:04 +0200)]
Fix Tramp problem with non-essential

* lisp/net/tramp.el (tramp-run-real-handler):
Handle also functions which use a `tramp-file-name' for the file
name handler.  (Bug#55832)
(tramp-get-home-directory, tramp-get-remote-uid)
(tramp-get-remote-gid): VEC can also be nil.

2 years ago; * lisp/emacs-lisp/cconv.el: Fix outdated comments.
Mattias Engdegård [Tue, 14 Jun 2022 10:08:15 +0000 (12:08 +0200)]
; * lisp/emacs-lisp/cconv.el: Fix outdated comments.

2 years agoFix mishandling of dnd-scroll-margin with scroll bar motion
Po Lu [Tue, 14 Jun 2022 09:43:08 +0000 (17:43 +0800)]
Fix mishandling of dnd-scroll-margin with scroll bar motion

* lisp/dnd.el (dnd-handle-movement): Ignore posns inside scroll
bars for now.

2 years ago* lisp/minibuffer.el (minibuffer-complete-history): New command.
Juri Linkov [Tue, 14 Jun 2022 07:14:52 +0000 (10:14 +0300)]
* lisp/minibuffer.el (minibuffer-complete-history): New command.

(minibuffer-complete-defaults): New command.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00498.html

2 years ago* lisp/simple.el (completion-auto-wrap): Rename from completion-wrap-movement.
Juri Linkov [Tue, 14 Jun 2022 07:04:56 +0000 (10:04 +0300)]
* lisp/simple.el (completion-auto-wrap): Rename from completion-wrap-movement.

(next-completion): Use completion-auto-wrap.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00139.html

2 years agoFix out of date parts in NS doc and keyboard bindings
Po Lu [Tue, 14 Jun 2022 06:06:59 +0000 (14:06 +0800)]
Fix out of date parts in NS doc and keyboard bindings

* doc/emacs/macos.texi (Mac / GNUstep Events): Remove
`ns-drag-n-drop' which doesn't exist anymore.  Add events to
concept index and document `ns-show-prefs'.  (bug#55940)
* lisp/term/ns-win.el (global-map): Remove ns-popup-font-panel.

2 years agoHandle coordinates of Motif drop start messages
Po Lu [Tue, 14 Jun 2022 05:52:38 +0000 (13:52 +0800)]
Handle coordinates of Motif drop start messages

* src/xterm.c (xm_read_drop_start_message): New function.
(xm_read_drag_motion_message): Check that the originator is
correct.
(x_coords_from_dnd_message): Read drop start messages as well.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 14 Jun 2022 04:30:43 +0000 (06:30 +0200)]
Merge from origin/emacs-28

73400e4002 Clarify what a Calc registeri in in calc-insert-register

2 years agoHandle coordinate extraction for more event types
Po Lu [Tue, 14 Jun 2022 02:12:48 +0000 (10:12 +0800)]
Handle coordinate extraction for more event types

* src/xterm.c (xm_read_drag_motion_message): New function.
(x_coords_from_dnd_message): Handle XM_DRAG_REASON_DRAG_MOTION.

2 years agoUse coordinates provided by DND messages if available
Po Lu [Tue, 14 Jun 2022 01:41:59 +0000 (09:41 +0800)]
Use coordinates provided by DND messages if available

This avoids an extra sync, which matters when dropping onto
Emacs running over a slow connection.

* src/xselect.c (x_handle_dnd_message): New args
`root_window_coords', `root_x' and `root_y'.
* src/xterm.c (x_coords_from_dnd_message): New function.
(handle_one_xevent): Pass root window coordinates to
x_handle_dnd_message.
* src/xterm.h: Update prototypes.

2 years agoproject--git-submodules: Parse more strictly
Dmitry Gutov [Tue, 14 Jun 2022 01:00:22 +0000 (04:00 +0300)]
project--git-submodules: Parse more strictly

* lisp/progmodes/project.el (project--git-submodules):
Don't mistake 'load-path' for 'path' (bug#55396).

2 years agoDefault decoded-time dst slot to -1
Paul Eggert [Mon, 13 Jun 2022 21:25:58 +0000 (14:25 -0700)]
Default decoded-time dst slot to -1

* lisp/simple.el (decoded-time): Default dst slot to -1.
Improve related doc strings.

2 years ago; * lisp/treesit.el (treesit-defun-query): Improve docstring.
Yuan Fu [Mon, 13 Jun 2022 21:00:08 +0000 (14:00 -0700)]
; * lisp/treesit.el (treesit-defun-query): Improve docstring.

2 years agoUse the up-only parameter in treesit navigation functions
Yuan Fu [Mon, 13 Jun 2022 20:53:11 +0000 (13:53 -0700)]
Use the up-only parameter in treesit navigation functions

* lisp/treesit.el(treesit-inspect-node-at-point,
treesit-end-of-defun): Set up-only to t.

2 years agoAdd depth control for treesit traverse functions
Yuan Fu [Mon, 13 Jun 2022 20:48:24 +0000 (13:48 -0700)]
Add depth control for treesit traverse functions

* lisp/treesit.el (treesit-traverse-depth-first,
treesit-traverse-forward): Add depth parameter.
(treesit-search-forward, treesit-search-beginning,
treesit-search-end): Add up-only parameter.

2 years agoFix treesit-search-forward
Yuan Fu [Mon, 13 Jun 2022 20:22:17 +0000 (13:22 -0700)]
Fix treesit-search-forward

Move the check for movement

    (if (> arg 0)
        ;; Make sure we moved forward.
        (> (funcall pos-fn node) starting-point)
      ;; Make sure we moved backward.
      (< (funcall pos-fn node) starting-point))

into cl-loop:

    if (treesit-node-eq cap-node node)

becomes

    if (and (treesit-node-eq cap-node node)
            (if (> arg 0)
                ;; Make sure we moved forward.
                (> (funcall pos-fn node)
                   starting-point)
              ;; Make sure we moved backward.
              (< (funcall pos-fn node)
                 starting-point)))

* lisp/treesit.el (treesit-search-forward): Move the check.

2 years agoPacify GCC 12.1.1 -Wanalyzer-use-of-uninitialized-value
Paul Eggert [Mon, 13 Jun 2022 20:37:37 +0000 (13:37 -0700)]
Pacify GCC 12.1.1 -Wanalyzer-use-of-uninitialized-value

* src/xfont.c (xfont_list_pattern): Initialize a local.
Although I’m not sure this is needed, it doesn’t change
behavior (except possibly to make undefined behavior defined).

2 years agoPacify GCC 12.1.1 in default developer build
Paul Eggert [Mon, 13 Jun 2022 20:21:18 +0000 (13:21 -0700)]
Pacify GCC 12.1.1 in default developer build

* src/pdumper.c (pdumper_load): Use explicit memset to work around
GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105961>.

2 years ago* lisp/progmodes/grep.el (grep-read-files): Combine files with aliases.
Juri Linkov [Mon, 13 Jun 2022 17:19:32 +0000 (20:19 +0300)]
* lisp/progmodes/grep.el (grep-read-files): Combine files with aliases.

Use completion-table-merge to combine completions of files from
read-file-name-internal with a list of defaults from grep-files-aliases
(bug#55800).

2 years agoMention \`M-x ...' in the lispref manual
Lars Ingebrigtsen [Mon, 13 Jun 2022 15:30:36 +0000 (17:30 +0200)]
Mention \`M-x ...' in the lispref manual

* doc/lispref/help.texi (Keys in Documentation): Note \`M-x ...'
syntax.

2 years agoClarify what a Calc registeri in in calc-insert-register
Lars Ingebrigtsen [Mon, 13 Jun 2022 15:14:08 +0000 (17:14 +0200)]
Clarify what a Calc registeri in in calc-insert-register

* lisp/calc/calc-yank.el (calc-insert-register): Note that these
aren't normal registers (bug#55943).

2 years agoAllow saying \\=`M-x ...' in a doc string
Lars Ingebrigtsen [Mon, 13 Jun 2022 15:02:55 +0000 (17:02 +0200)]
Allow saying \\=`M-x ...' in a doc string

* lisp/help.el (substitute-command-keys): Allow saying \\=`M-x
foo' in doc strings (and have it be fontified as a key binding).

2 years agoMassage In-Reply-To data in message-mail
Lars Ingebrigtsen [Mon, 13 Jun 2022 14:46:14 +0000 (16:46 +0200)]
Massage In-Reply-To data in message-mail

* lisp/gnus/message.el (message-mail): Fix up Message-IDs from
Firefox (bug#55926).

2 years agoMatch complete words in dns-mode
Lassi Kortela [Mon, 13 Jun 2022 14:32:45 +0000 (16:32 +0200)]
Match complete words in dns-mode

* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords): Match
complete words like SOA and not all words that contain the string
SOA (bug#55944).

Copyright-paperwork-exempt: yes

2 years agoAllow `query-replace' to do exact replacement of the current item
Lars Ingebrigtsen [Mon, 13 Jun 2022 14:17:40 +0000 (16:17 +0200)]
Allow `query-replace' to do exact replacement of the current item

* doc/emacs/search.texi (Query Replace): Document it.

* lisp/replace.el (query-replace-help): Amend help text.
(query-replace-map): Bind `E' to the exact case replacement.
(perform-replace): Allow editing a replacement with exact case
(bug#8504).

2 years agoAdd to mode cedilla characters to iso-transl-char-map
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:57:26 +0000 (15:57 +0200)]
Add to mode cedilla characters to iso-transl-char-map

* lisp/international/iso-transl.el (iso-transl-char-map): Add some
more cedilla characters.

2 years agoAdd support for the Meetei Mayek script
समीर सिंह Sameer Singh [Sat, 11 Jun 2022 13:23:43 +0000 (18:53 +0530)]
Add support for the Meetei Mayek script

* lisp/language/indian.el ("Meetei Mayek"): New language environment.
Add composition rules for Meetei Mayek. Add sample text and input method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Meetei Mayek.
* lisp/leim/quail/indian.el ("meetei-mayek"): New input method.

* etc/HELLO: Add a Meetei Mayek greeting.
* etc/NEWS: Announce the new language environment.

2 years agoMake the ediff control panel mode line prettier
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:49:56 +0000 (15:49 +0200)]
Make the ediff control panel mode line prettier

* lisp/vc/ediff-wind.el (ediff-refresh-mode-lines): Don't include
"Quick Help" in the mode line in the plain version (bug#12840).
(ediff-make-wide-control-buffer-id): Make the informative part of
the mode line bold.  (Code from Michael Heerdegen.)

2 years ago; * etc/NEWS: Fix wording.
Eli Zaretskii [Mon, 13 Jun 2022 13:46:45 +0000 (16:46 +0300)]
; * etc/NEWS: Fix wording.

2 years ago; * doc/lispref/minibuf.texi (Text from Minibuffer): Fix indexing.
Eli Zaretskii [Mon, 13 Jun 2022 13:45:05 +0000 (16:45 +0300)]
; * doc/lispref/minibuf.texi (Text from Minibuffer): Fix indexing.

2 years agoAllow rgrep users to indicate case folding easier
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:32:57 +0000 (15:32 +0200)]
Allow rgrep users to indicate case folding easier

* lisp/progmodes/grep.el (rgrep): Allow the user to toggle case
sensitivity interactively (bug#16913).

2 years agoAdd a `M-c' command to `read-regexp'
Lars Ingebrigtsen [Mon, 13 Jun 2022 13:31:25 +0000 (15:31 +0200)]
Add a `M-c' command to `read-regexp'

* doc/lispref/minibuf.texi (Text from Minibuffer): Document it.

* lisp/replace.el (read-regexp): Add a `M-c' command to indicate
case folding (bug#16913).

2 years agobindat (strz): Error on null byte if packing variable-length string
Richard Hansen [Mon, 13 Jun 2022 12:32:01 +0000 (14:32 +0200)]
bindat (strz): Error on null byte if packing variable-length string

* lisp/emacs-lisp/bindat.el (strz): Signal an error if a null byte is
encountered while packing a string to a variable-length strz field.
* test/lisp/emacs-lisp/bindat-tests.el (strz): Add tests (bug#55938).

2 years ago* files.el (auto-mode-alist): Add entry to `.eld` files
Stefan Monnier [Mon, 13 Jun 2022 12:58:09 +0000 (08:58 -0400)]
* files.el (auto-mode-alist): Add entry to `.eld` files

2 years agoMake `/ a' in *Package* filter by name
Lars Ingebrigtsen [Mon, 13 Jun 2022 12:20:22 +0000 (14:20 +0200)]
Make `/ a' in *Package* filter by name

* lisp/emacs-lisp/package.el (package-menu-filter-by-archive):
Filter by package name instead of by regexp, so that if the user
types "gnu", they won't get "nongnu", too (bug#55919).

2 years ago* lisp/find-dired.el (find-dired): Make directory clickable.
Visuwesh [Sun, 12 Jun 2022 10:35:08 +0000 (12:35 +0200)]
* lisp/find-dired.el (find-dired): Make directory clickable.

* lisp/find-dired.el (find-dired): Make the directory line
clickable (bug#55906).

2 years agoRespect test function when performing local drag-and-drop
Po Lu [Mon, 13 Jun 2022 07:01:06 +0000 (15:01 +0800)]
Respect test function when performing local drag-and-drop

* lisp/x-dnd.el (x-dnd-test-function): Fix doc string to
describe what is actually accepted.
(x-dnd-known-types, x-dnd-targets-list): Fix coding style.
(x-dnd-handle-native-drop): New function.

* src/xselect.c (x_atom_to_symbol): Export.

* src/xterm.c (x_dnd_note_self_drop): Call new variable to
determine what action to return.
(x_clear_dnd_action): New function.
(x_dnd_begin_drag_and_drop): Respect new variable.
(syms_of_xterm): New defvar `x-dnd-native-test-function'.
* src/xterm.h: Update prototypes.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Mon, 13 Jun 2022 04:55:57 +0000 (06:55 +0200)]
Merge from origin/emacs-28

d6f080d3de ; * doc/man/etags.1: Bump man page date.

2 years agoImprove DND tooltip updating
Po Lu [Mon, 13 Jun 2022 04:49:12 +0000 (12:49 +0800)]
Improve DND tooltip updating

* src/xterm.c (x_dnd_update_tooltip_now): Add missing part of
last change.
(x_monitors_changed_cb, handle_one_xevent): Only update if a
change in monitor configuration really happened.

2 years agoKeep tooltip position in sync with monitor changes
Po Lu [Mon, 13 Jun 2022 01:42:12 +0000 (09:42 +0800)]
Keep tooltip position in sync with monitor changes

* src/xterm.c (x_dnd_update_tooltip_now): New function.
(x_monitors_changed_cb):
(handle_one_xevent): Call that function on monitor change.

2 years agoFix special DND event coordinates
Po Lu [Mon, 13 Jun 2022 01:11:08 +0000 (09:11 +0800)]
Fix special DND event coordinates

* src/xterm.c (x_dnd_note_self_drop): Set DND action to
XdndActionPrivate.
(x_dnd_begin_drag_and_drop): Don't return XdndPrivate specially
here.
(handle_one_xevent): Fix order of arguments to
x_dnd_note_self_drop.

2 years ago* lisp/icomplete.el: Consider a list in minibuffer-default (bug#55800)
Juri Linkov [Sun, 12 Jun 2022 18:24:01 +0000 (21:24 +0300)]
* lisp/icomplete.el: Consider a list in minibuffer-default (bug#55800)

* lisp/icomplete.el (icomplete--sorted-completions): Handle a string value
in the first element of the list of default values in minibuffer-default.

2 years ago; * lisp/isearch.el (isearch-search-fun-in-text-property): Doc fix.
Eli Zaretskii [Sun, 12 Jun 2022 17:43:24 +0000 (20:43 +0300)]
; * lisp/isearch.el (isearch-search-fun-in-text-property): Doc fix.

2 years ago* lisp/isearch.el (isearch-search-fun-in-text-property): Handle ^/$ specially.
Juri Linkov [Sun, 12 Jun 2022 16:45:15 +0000 (19:45 +0300)]
* lisp/isearch.el (isearch-search-fun-in-text-property): Handle ^/$ specially.

When the regexp contains ^ or $ then use a temporary buffer to find matches
at the beginning/end of the region with the given text property (bug#14013).

2 years agoFix encoding of multibyte ToolTalk filenames
Po Lu [Sun, 12 Jun 2022 14:04:47 +0000 (22:04 +0800)]
Fix encoding of multibyte ToolTalk filenames

* lisp/select.el (xselect-convert-to-dt-netfile): Encode file
name before computing its tooltalk name, since the indices work
on bytes.

* test/lisp/dnd-tests.el (dnd-tests-begin-file-drag): Add test.

2 years agoFix handling of scroll bar clicks on Haiku
Po Lu [Sun, 12 Jun 2022 13:04:19 +0000 (13:04 +0000)]
Fix handling of scroll bar clicks on Haiku

* src/haiku_support.cc (class EmacsView, BasicMouseDown)
(BasicMouseUp): Move MouseDown and MouseUp here.  New parameter
`scroll_bar'.
(MouseDown, MouseUp): Call basic variants.

(class EmacsScrollBar): New field `parent'.
(BScrollBar_make_for_view): Rename to
`be_create_scroll_bar_for_view'.
* src/haiku_support.h (struct haiku_button_event): New field
`scroll_bar'.
* src/haikuterm.c (haiku_scroll_bar_from_widget): Handle NULL
widget.
(haiku_scroll_bar_create): Update calls.
(haiku_mouse_position): Fix scroll bar part.
(haiku_read_socket): Handle button events on scroll bars as
scroll bar click events.

2 years ago; * doc/man/etags.1: Bump man page date.
Stefan Kangas [Sun, 12 Jun 2022 10:41:15 +0000 (12:41 +0200)]
; * doc/man/etags.1: Bump man page date.

2 years agoUse BASE_EQ when comparing with Qunbound
Mattias Engdegård [Sun, 12 Jun 2022 10:05:03 +0000 (12:05 +0200)]
Use BASE_EQ when comparing with Qunbound

Qunbound is uninterned and can therefore never be EQ to any symbol
with position.

* src/buffer.c (Fbuffer_local_value, buffer_lisp_local_variables)
(buffer_local_variables_1):
* src/bytecode.c (exec_byte_code):
* src/comp.c (compile_function, Fcomp__compile_ctxt_to_file):
* src/composite.c (composition_gstring_cache_clear_font):
* src/data.c (Fboundp, Fsymbol_value, set_internal)
(Fdefault_boundp, Fdefault_value, Fmake_variable_buffer_local):
* src/emacs-module.c (module_global_reference_p):
* src/eval.c (Fdefault_toplevel_value, defvar)
(run_hook_with_args):
* src/fns.c (hash_put, Fmaphash):
* src/font.c (font_put_extra):
* src/frame.c (gui_set_frame_parameters)
(gui_frame_get_and_record_arg, gui_default_parameter)
(gui_figure_window_size):
* src/haikufns.c (get_geometry_from_preferences)
(haiku_create_frame, haiku_create_tip_frame):
* src/haikuterm.c (haiku_draw_text_decoration)
(haiku_default_font_parameter):
* src/json.c (lisp_to_json_nonscalar_1):
* src/keymap.c (access_keymap_1, access_keymap, current_minor_maps):
* src/lread.c (readevalloop, define_symbol):
* src/minibuf.c (read_minibuf, Ftry_completion):
(Fall_completions, Ftest_completion):
* src/pgtkfns.c (pgtk_default_font_parameter, Fx_create_frame)
(x_create_tip_frame):
* src/pgtkselect.c (Fpgtk_own_selection_internal):
* src/print.c (print):
* src/profiler.c (evict_lower_half, record_backtrace):
* src/terminal.c (create_terminal):
* src/textprop.c (set_properties):
* src/w32fns.c (my_create_window, w32_icon)
(w32_default_font_parameter, Fx_create_frame)
(w32_create_tip_frame):
* src/w32term.c (w32_draw_glyph_string):
* src/xdisp.c (handle_single_display_spec)
(cursor_row_fully_visible_p, calc_pixel_width_or_height):
* src/xfns.c (x_default_scroll_bar_color_parameter, x_icon_verify)
(x_icon, x_default_font_parameter, Fx_create_frame)
(x_create_tip_frame):
* src/xselect.c (x_handle_selection_request):
* src/xterm.c (x_draw_glyph_string, x_term_init):
Use BASE_EQ instead of EQ when comparing with Qunbound.

2 years agoMake find-sibling-file-search non-private
Lars Ingebrigtsen [Sun, 12 Jun 2022 10:08:32 +0000 (12:08 +0200)]
Make find-sibling-file-search non-private

* lisp/files.el (find-sibling-file-search): Rename to be non-private.
(find-sibling-file): Adjust call.

2 years agoFix "C-x C-d" with wildcard arguments
Eli Zaretskii [Sun, 12 Jun 2022 10:03:32 +0000 (13:03 +0300)]
Fix "C-x C-d" with wildcard arguments

* lisp/files.el (list-directory): Make sure 'default-directory' is
set to a valid value if the argument DIRNAME included wildcards.
(Bug#55877)

2 years agoFix phantom drag-and-drop targets showing up in some programs
Po Lu [Sun, 12 Jun 2022 08:41:40 +0000 (16:41 +0800)]
Fix phantom drag-and-drop targets showing up in some programs

* src/xterm.c (x_dnd_cleanup_drag_and_drop)
(x_dnd_begin_drag_and_drop): Delete XdndTypeList if it was set
after the DND operation completes.  Some programs apparently
think its presence on the drag source means there are more than
3 targets.

2 years agobindat (str, strz): Reject non-ASCII, non-`eight-bit' characters
Richard Hansen [Sun, 12 Jun 2022 05:19:43 +0000 (01:19 -0400)]
bindat (str, strz): Reject non-ASCII, non-`eight-bit' characters

* lisp/emacs-lisp/bindat.el (str) (strz): Signal an error if the user
attempts to pack a multibyte string containing characters other than
ASCII and `eight-bit' characters (bug#55897).
* doc/lispref/processes.texi (Bindat Types): Update documentation.
* test/lisp/emacs-lisp/bindat-tests.el (str) (strz): Add tests.

2 years agoDon't repetitively initialize type lists during DND
Po Lu [Sun, 12 Jun 2022 05:45:18 +0000 (13:45 +0800)]
Don't repetitively initialize type lists during DND

* src/xterm.c (x_dnd_send_enter): Only set XdndTypeList once.
(x_dnd_begin_drag_and_drop): Clear type list flag.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sun, 12 Jun 2022 04:30:25 +0000 (06:30 +0200)]
Merge from origin/emacs-28

cbd2c87a5d ; Fix last change in whitespace.el.
52ad2b53cb Fix doc strings in whitespace.el

2 years ago* lisp/emacs-lisp/find-func.el (find-function-advised-original): Simplify
Stefan Monnier [Sun, 12 Jun 2022 03:50:35 +0000 (23:50 -0400)]
* lisp/emacs-lisp/find-func.el (find-function-advised-original): Simplify

2 years ago* configure.ac (HAVE_TREE_SITTER): Not set TREE_SITTER_LIBS.
Yuan Fu [Sun, 12 Jun 2022 03:42:26 +0000 (20:42 -0700)]
* configure.ac (HAVE_TREE_SITTER): Not set TREE_SITTER_LIBS.

2 years agoRename treesit-traverse-forward-depth-first
Yuan Fu [Sun, 12 Jun 2022 03:24:38 +0000 (20:24 -0700)]
Rename treesit-traverse-forward-depth-first

* lisp/treesit.el (treesit-traverse-forward): Rename to
'treesit-traverse-forward'.
(treesit-traverse-forward, treesit-search-forward): Use
the new name.

2 years agoUse cached monitor info during DND if available
Po Lu [Sun, 12 Jun 2022 02:17:19 +0000 (10:17 +0800)]
Use cached monitor info during DND if available

* src/xterm.c (x_dnd_begin_drag_and_drop): Use previously cached
monitor attributes if they exist.

2 years ago* src/nsfns.m (ns_move_tooltip_to_mouse_location): Handle invisible frames.
Po Lu [Sun, 12 Jun 2022 02:13:04 +0000 (10:13 +0800)]
* src/nsfns.m (ns_move_tooltip_to_mouse_location): Handle invisible frames.

2 years agoDon't rely on XdndAware on frames for dropping to work
Po Lu [Sun, 12 Jun 2022 01:32:30 +0000 (09:32 +0800)]
Don't rely on XdndAware on frames for dropping to work

* src/xterm.c (x_dnd_get_target_window): New parameter
WAS_FRAME.  If toplevel is a frame, set it and clear proto and
motif.
(x_dnd_send_enter, x_dnd_send_position, x_dnd_send_leave)
(x_dnd_send_drop): Remove special-cased self dropping code.
(x_dnd_note_self_position, x_dnd_note_self_drop): New functions.

(x_dnd_begin_drag_and_drop, x_dnd_update_state):
(handle_one_xevent): Handle our own frames using those functions
instead.