]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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 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 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 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 agoFix typo and argument in treesit-beginning-of-defun, etc
Theodor Thornhill [Thu, 19 May 2022 16:35:13 +0000 (09:35 -0700)]
Fix typo and argument in treesit-beginning-of-defun, etc

* lisp/treesit.el (treesit-beginning-of-defun, treesit-end-of-defun):
Fix typo, add shield for argument.

2 years ago; * lisp/treesit.el (treesit-node-at): Fix typo.
Yuan Fu [Sat, 14 May 2022 15:57:23 +0000 (08:57 -0700)]
; * lisp/treesit.el (treesit-node-at): Fix typo.

2 years agoExtract out treesit-search-forward
Yuan Fu [Fri, 13 May 2022 23:39:29 +0000 (16:39 -0700)]
Extract out treesit-search-forward

* lisp/treesit.el (treesit-search-forward, treesit-search-beginning,
treesit-search-end): New functions.
(treesit-traverse-defun): Remove function.
(treesit-beginning-of-defun, treesit-end-of-defun): Replace
'treesit-traverse-defun' with 'treesit-search-forward' and fiends.
* test/src/treesit-tests.el: Add reminder for tests.

2 years ago* lisp/treesit.el (treesit-node-at): Add check for nil node.
Yuan Fu [Fri, 13 May 2022 23:34:26 +0000 (16:34 -0700)]
* lisp/treesit.el (treesit-node-at): Add check for nil node.

2 years agoAdd defun navigation
Yuan Fu [Fri, 13 May 2022 21:00:56 +0000 (14:00 -0700)]
Add defun navigation

* lisp/treesit.el (treesit-defun-query): New variable.
(treesit-traverse-defun, treesit-beginning-of-defun,
treesit-end-of-defun): New functions.
* test/src/treesit-tests.el: Add reminders for tests.

2 years agoNew node traversal functions
Yuan Fu [Fri, 13 May 2022 20:47:41 +0000 (13:47 -0700)]
New node traversal functions

* lisp/treesit.el (treesit-traverse-parent): New alias.
(treesit-traverse-depth-first, treesit--traverse-breadth-first-1,
treesit-traverse-breadth-first, treesit-next-sibling-or-up,
treesit-traverse-forward-depth-first): New functions.
* test/src/treesit-tests.el (treesit-node-supplemental): Add reminders
for tests.

2 years agoRedefine treesit-node-at
Yuan Fu [Fri, 13 May 2022 20:38:21 +0000 (13:38 -0700)]
Redefine treesit-node-at

The old 'treesit-node-at' becomes 'treesit-node-on'.  The new
'treesit-node-at' has slightly different semantics.  Now
'treesit-node-on' gets the smallest node covering a range and
'treesit-node-at' gets the smallest node after a position.

The reason of change can be found in the docstring of
'treesit-node-on' (the BEWARE part): its result can be sometimes
surprising/unexpected.

* doc/lispref/parsing.texi (Retrieving Node): Update manual.
* lisp/treesit.el (treesit-node-at): Change to new definition.
(treesit-node-on): Inherits the old definition of
'treesit-node-at'.  Parameter END is now mandatory.
(treesit-language-at, treesit-node-field-name): Use the new '-on'
function.
(treesit-font-lock-fontify-region, treesit-simple-indent-presets,
treesit-indent): Use the new '-at' function.
* test/src/treesit-tests.el (treesit-node-supplemental): Update tests.

2 years agoFix compilation warnings
Yuan Fu [Mon, 9 May 2022 19:49:55 +0000 (12:49 -0700)]
Fix compilation warnings

* src/treesit.c: Add static keywords, remove unused variables, add
const qualifier.

2 years agoRemove call to nconc to improve performance
Yuan Fu [Mon, 9 May 2022 19:34:01 +0000 (12:34 -0700)]
Remove call to nconc to improve performance

* src/treesit.c (struct capture_range): New struct.
(ts_predicate_capture_name_to_text, ts_predicate_equal,
ts_predicate_match, ts_eval_predicates): Replace capture list with
capture_range.
(Ftreesit_query_capture): Remove call to nconc.

2 years ago; Merge from master.
Yuan Fu [Sat, 7 May 2022 08:57:39 +0000 (01:57 -0700)]
; Merge from master.

2 years agoAdd tree-sitter intergration
Yuan Fu [Sun, 13 Mar 2022 06:10:06 +0000 (22:10 -0800)]
Add tree-sitter intergration

* configure.ac (HAVE_TREE_SITTER, TREE_SITTER_OBJ): New variables.
(DYNAMIC_LIB_SUFFIX): new variable, I copied code from MODULES_SUFFIX
so the diff looks this way.
* doc/lispref/elisp.texi (Top): Add tree-sitter manual.
* doc/lispref/modes.texi (Font Lock Mode): mention tree-sitter.
(Parser-based Font Lock): New section.
(Auto-Indentation): Mention tree-sitter.
(Parser-based Indentation): New section.
* doc/lispref/parsing.texi (Parsing Program Source): New chapter.
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add
treesit-parser and treesit-node type.
* lisp/treesit.el: New file.
* src/Makefile.in (TREE_SITTER_LIBS, TREE_SITTER_FLAGS,
TREE_SITTER_OBJ): New variables.
* src/alloc.c:
(cleanup_vector): Add cleanup code for treesit-parser and
treesit-node.
* src/casefiddle.c (casify_region): Notify tree-sitter parser of
buffer change.
* src/data.c (Ftype_of): Add treesit-parser and treesit-node type
(Qtreesit_parser, Qtreesit_node): New symbol.
* src/emacs.c (main): Add symbols in treesit.c.
* src/eval.c (define_error): Move the function to here.
* src/insdel.c (insert_1_both, insert_from_string_1, insert_from_gap,
insert_from_buffer_1, replace_range, del_range_2): Notify tree-sitter
parser of buffer change.
* src/json.c (define_error): Move this function out.
* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add treesit-parser and
treesit-node.
* src/lread.c (Vdynamic_library_suffixes): New variable.
* src/print.c (print_vectorlike): Add code for printing
treesit-parser and treesit-node.
* src/treesit.c: New file.
* src/treesit.h: New file.
* test/src/treesit-tests.el: New file.

2 years agoFix 32-bit Haiku build
Po Lu [Sat, 7 May 2022 06:19:53 +0000 (06:19 +0000)]
Fix 32-bit Haiku build

* src/haiku_support.cc (MessageReceived): Fix type of
`old_what'.

2 years agoImplement `sticky' frame parameter on Haiku
Po Lu [Sat, 7 May 2022 06:17:46 +0000 (06:17 +0000)]
Implement `sticky' frame parameter on Haiku

* src/haiku_support.cc (BWindow_set_sticky): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_set_sticky, haiku_frame_parm_handlers):
New frame param handler.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sat, 7 May 2022 04:30:32 +0000 (06:30 +0200)]
Merge from origin/emacs-28

afdf72eeb2 Fix bug#55274
5bfac7c774 Provide reference for OTF tags in the ELisp manual

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Sat, 7 May 2022 04:30:32 +0000 (06:30 +0200)]
; Merge from origin/emacs-28

The following commit was skipped:

936009cfe5 Be more resilient towards errors during error handling

2 years agoFix race conditions in the Haiku file dialog
Po Lu [Sat, 7 May 2022 03:20:35 +0000 (03:20 +0000)]
Fix race conditions in the Haiku file dialog

* src/haiku_support.cc (current_file_panel_port): Delete
variable.
(class EmacsWindow, MessageReceived): Stop handling file panel
events here.
(class EmacsFilePanelCallbackLooper): New class.
(be_popup_file_dialog): Use a separate looper to handle file
panel events.

2 years agoFix freezes with some oddball menus
Po Lu [Sat, 7 May 2022 01:34:35 +0000 (09:34 +0800)]
Fix freezes with some oddball menus

* src/xmenu.c (x_activate_menubar): Clear flag if dispatching
the event failed.
* src/xterm.c (handle_one_xevent): Check for sensitive
CascadeButton instead of row column type.

2 years ago(icomplete-exhibit): Fix use in-buffer
Stefan Monnier [Fri, 6 May 2022 20:44:54 +0000 (16:44 -0400)]
(icomplete-exhibit): Fix use in-buffer

Also prefer #' to quote function names and remove redundant :group args.

* lisp/icomplete.el (icomplete-exhibit): Don't presume the completion
field ends at `point-max`.

2 years agoMake elisp-mode-syntax-propertize tighter to reflect syntax
Lars Ingebrigtsen [Fri, 6 May 2022 20:13:41 +0000 (22:13 +0200)]
Make elisp-mode-syntax-propertize tighter to reflect syntax

* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize): ?\N
and #s are case sensitive, so don't case-fold.  (And adjust regexps.)

2 years agoMake down-list signal an error if called inside a string
Lars Ingebrigtsen [Fri, 6 May 2022 19:13:32 +0000 (21:13 +0200)]
Make down-list signal an error if called inside a string

* lisp/emacs-lisp/lisp.el (down-list): Signal an error inside a
string (bug#5588).

2 years agoAdd char-folding of double quotes in isearch-fold-quotes-mode (bug#24510)
Juri Linkov [Fri, 6 May 2022 18:06:47 +0000 (21:06 +0300)]
Add char-folding of double quotes in isearch-fold-quotes-mode (bug#24510)

* lisp/isearch.el (isearch-fold-quotes-mode): Add char-folding of
double quotation marks.

* test/lisp/subr-tests.el (test-local-set-state): Test values
after setting state.

2 years agoFix handling of IMAP search strings
Eric Abrahamsen [Fri, 6 May 2022 17:14:08 +0000 (10:14 -0700)]
Fix handling of IMAP search strings

* lisp/gnus/gnus-search.el (gnus-search-imap-handle-string): This was
a misunderstanding of what `multibyte-string-p' means.  The check was
actually supposed to be whether the string was non-ascii or not.

2 years agoFurther log-view-file-next fix-ups
Lars Ingebrigtsen [Fri, 6 May 2022 17:09:12 +0000 (19:09 +0200)]
Further log-view-file-next fix-ups

* doc/emacs/maintaining.texi (VC Change Log): Remove the entries
for commands now removed from most VCs.
* lisp/vc/log-view.el (log-view-mode-menu): Disable menu entries
(bug#14531).

2 years agoDon't force Gnus cache usage in nnvirtual
Eric Abrahamsen [Fri, 6 May 2022 16:37:07 +0000 (09:37 -0700)]
Don't force Gnus cache usage in nnvirtual

* lisp/gnus/nnvirtual.el (nnvirtual-retrieve-headers): We're not sure
why this was happening, but it shouldn't be necessary. Simply calling
`gnus-retrieve-headers' directly will use the cache if the user has
configured it.

2 years agoFix forward-sexp for Unicode names in Emacs Lisp mode
Lars Ingebrigtsen [Fri, 6 May 2022 16:38:09 +0000 (18:38 +0200)]
Fix forward-sexp for Unicode names in Emacs Lisp mode

* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize):
Make forward-sexp work for Unicode character names (bug#23354).

2 years agoHandle elisp #-syntax better in Emacs Lisp mode
Noam Postavsky [Fri, 6 May 2022 16:31:00 +0000 (18:31 +0200)]
Handle elisp #-syntax better in Emacs Lisp mode

* elisp-mode.el (elisp-mode-syntax-propertize): New function.
(emacs-lisp-mode): Set it as syntax-propertize-function (bug#15998).

2 years agoFix bug#55274
Michael Albinus [Fri, 6 May 2022 15:33:41 +0000 (17:33 +0200)]
Fix bug#55274

* lisp/dired-aux.el (dired-do-compress-to): Use `file-local-name'
for shell out-file.  (Bug#55274)

2 years ago* lisp/emacs-lisp/smie.el (smie-auto-fill): Fix bug#19342
Stefan Monnier [Fri, 6 May 2022 15:09:58 +0000 (11:09 -0400)]
* lisp/emacs-lisp/smie.el (smie-auto-fill): Fix bug#19342

2 years agoRespect help-window-keep-selected in shortdoc buttons
Lars Ingebrigtsen [Fri, 6 May 2022 14:21:07 +0000 (16:21 +0200)]
Respect help-window-keep-selected in shortdoc buttons

* lisp/help-fns.el (help-fns--mention-shortdoc-groups): Respect
help-window-keep-selected.

* lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Allow
reusing the window.

2 years agoMove buffer-local-set-state to subr because it's used at runtime
Lars Ingebrigtsen [Fri, 6 May 2022 14:09:38 +0000 (16:09 +0200)]
Move buffer-local-set-state to subr because it's used at runtime

* lisp/subr.el (buffer-local-set-state)
(buffer-local-set-state--get, buffer-local-restore-state): Moved
from easy-mmode.el because they have to be available run-time.

2 years ago; Improve documentation of 'buffer-local-set-state'
Eli Zaretskii [Fri, 6 May 2022 12:15:27 +0000 (15:15 +0300)]
; Improve documentation of 'buffer-local-set-state'

* lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state)
(buffer-local-restore-state): Doc fixes.

* doc/lispref/modes.texi (Defining Minor Modes): Fix a typo and
improve wording and indexing.

2 years agoMake compilation-parse-errors more resilient
Lars Ingebrigtsen [Fri, 6 May 2022 12:14:31 +0000 (14:14 +0200)]
Make compilation-parse-errors more resilient

* lisp/progmodes/compile.el (compilation-parse-errors): Be more
resilient in the presence of regexp alist not being completely set
up (bug#55282).

2 years agoImprove font specs generated by the Haiku font dialog
Po Lu [Fri, 6 May 2022 12:06:16 +0000 (12:06 +0000)]
Improve font specs generated by the Haiku font dialog

* src/haikufont.c (Fx_select_font): Use `nil' instead of
`unspecified' to be consistent with other font dialogs.

2 years agoFix inhibiting reading the user init file with "emacs -x"
Lars Ingebrigtsen [Fri, 6 May 2022 12:04:55 +0000 (14:04 +0200)]
Fix inhibiting reading the user init file with "emacs -x"

* lisp/startup.el (command-line): Really inhibit loading the user
init file with "emacs -x".

2 years agoRemove the P/N/M-p/M-n bindings from the general log-view map
Lars Ingebrigtsen [Fri, 6 May 2022 11:45:11 +0000 (13:45 +0200)]
Remove the P/N/M-p/M-n bindings from the general log-view map

* lisp/vc/log-view.el (log-view-mode-map): Remove the P/N/M-p/M-n
bindings (that are only usable in some VCs).
* lisp/vc/vc-sccs.el (vc-sccs-log-view-mode):
* lisp/vc/vc-rcs.el (vc-rcs-log-view-mode):
* lisp/vc/vc-cvs.el (vc-cvs-log-view-mode): New modes that bind
the P/N/M-p/M-n commands (bug#14531).

2 years agoDon't override search-default-mode set by user in info/help
Lars Ingebrigtsen [Fri, 6 May 2022 11:30:12 +0000 (13:30 +0200)]
Don't override search-default-mode set by user in info/help

* lisp/info.el (Info-mode):
* lisp/help-mode.el (help-mode): Don't override isearch mode set
by the user.

2 years agoChar-fold quotation characters in *info* and *Help*
Lars Ingebrigtsen [Fri, 6 May 2022 11:28:20 +0000 (13:28 +0200)]
Char-fold quotation characters in *info* and *Help*

* lisp/info.el (Info-mode):
* lisp/help-mode.el (help-mode): Use it.
* lisp/isearch.el (isearch-fold-quotes-mode): New minor mode
(bug#24510).

2 years agoRegenerate ldefs-boot.el
Lars Ingebrigtsen [Fri, 6 May 2022 11:21:07 +0000 (13:21 +0200)]
Regenerate ldefs-boot.el

2 years agoAutoload the buffer-local-set* things
Lars Ingebrigtsen [Fri, 6 May 2022 11:20:47 +0000 (13:20 +0200)]
Autoload the buffer-local-set* things

* lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state--get)
(buffer-local-restore-state): Autoload.  Perhaps it would be
better to move these functions to subr.el or something...

2 years agoAdd new helper macros for minor modes to restore variables
Lars Ingebrigtsen [Fri, 6 May 2022 11:10:45 +0000 (13:10 +0200)]
Add new helper macros for minor modes to restore variables

* doc/lispref/modes.texi (Defining Minor Modes): Document it.

* lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state): New macro.
(buffer-local-set-state--get): Helper function.
(buffer-local-restore-state): New function.

* lisp/textmodes/word-wrap-mode.el (word-wrap-whitespace-mode):
Use it to simplify code.

2 years agoFix thinko in tramp-skeleton-write-region
Michael Albinus [Fri, 6 May 2022 08:37:57 +0000 (10:37 +0200)]
Fix thinko in tramp-skeleton-write-region

* lisp/net/tramp.el (tramp-skeleton-write-region): Fix typos.
Flush cache in time.  (Bug#55247)
(tramp-handle-lock-file): Suppress messages in `write-region'.

2 years agoFix calculation of display resolution on Haiku
Po Lu [Fri, 6 May 2022 07:28:23 +0000 (07:28 +0000)]
Fix calculation of display resolution on Haiku

* src/haiku_support.cc (BScreen_px_dim): Rename to
`be_get_screen_dimensions'.
(BScreen_res): Rename to `be_get_display_resolution' and fix
resolution computation.
* src/haiku_support.h: Update prototypes.

* src/haikufns.c (compute_tip_xy, Fx_display_pixel_width)
(Fx_display_pixel_height, Fx_display_mm_height)
(Fx_display_mm_width): Update accordingly.

* src/haikuterm.c (haiku_term_init): Likewise.

2 years agoProvide reference for OTF tags in the ELisp manual
Eli Zaretskii [Fri, 6 May 2022 07:27:20 +0000 (10:27 +0300)]
Provide reference for OTF tags in the ELisp manual

* doc/lispref/display.texi (Low-Level Font): Provide the canonical
reference URL for OTF tags.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Fri, 6 May 2022 04:30:28 +0000 (06:30 +0200)]
Merge from origin/emacs-28

69c56cbe6e ; * src/w32notify.c: Fix a typo in a comment.
3b9e60ba2f ; * src/window.c (Fset_window_start): Mention the effect o...

2 years agoFix more problems with display of composite glyph strings on Haiku
Po Lu [Fri, 6 May 2022 04:11:38 +0000 (04:11 +0000)]
Fix more problems with display of composite glyph strings on Haiku

* src/haikuterm.c
(haiku_draw_composite_glyph_string_foreground): Fix pen size of
placeholder rectangle.

2 years agoFix mouse face persisting inside Lucid menus on XI2
Po Lu [Fri, 6 May 2022 03:55:35 +0000 (11:55 +0800)]
Fix mouse face persisting inside Lucid menus on XI2

* src/xmenu.c (create_and_show_popup_menu): Call `x_mouse_leave'
on Lucid as well when the input extension is being used.

* src/xterm.c (x_mouse_leave): Enable on Lucid XI2 builds.
* src/xterm.h: Update prototypes.

2 years ago* lwlib/lwlib.c (lw_separator_p): Fix empty strings being separators.
Po Lu [Fri, 6 May 2022 03:32:19 +0000 (11:32 +0800)]
* lwlib/lwlib.c (lw_separator_p): Fix empty strings being separators.

2 years agoFix menu dismissal problems on Xt builds with XI2
Po Lu [Fri, 6 May 2022 03:01:39 +0000 (11:01 +0800)]
Fix menu dismissal problems on Xt builds with XI2

* src/xmenu.c (prepare_for_entry_into_toolkit_menu)
(leave_toolkit_menu): New functions.
(create_and_show_popup_menu): Replace some of the grab logic
with resetting the XI event mask instead.

2 years agoFix more issues with DND state on multiple displays
Po Lu [Fri, 6 May 2022 01:35:23 +0000 (09:35 +0800)]
Fix more issues with DND state on multiple displays

* src/xterm.c (handle_one_xevent): Don't update DND state on the
wrong display.

2 years agoImprove safety of DND when Emacs is connected to multiple displays
Po Lu [Fri, 6 May 2022 00:39:14 +0000 (08:39 +0800)]
Improve safety of DND when Emacs is connected to multiple displays

* src/xterm.c (x_dnd_begin_drag_and_drop): Don't check movement
frame unless we know it comes from the right display.

2 years agoGnulib update via admin/merge-gnulib
Paul Eggert [Thu, 5 May 2022 22:36:33 +0000 (15:36 -0700)]
Gnulib update via admin/merge-gnulib

2 years ago* lisp/emacs-lisp/crm.el: Set completion-list-insert-choice-function.
James N. V. Cash [Thu, 5 May 2022 18:15:51 +0000 (21:15 +0300)]
* lisp/emacs-lisp/crm.el: Set completion-list-insert-choice-function.

* lisp/emacs-lisp/crm.el (completing-read-multiple): Set buffer-local
completion-list-insert-choice-function that handles string values of args.
https://lists.gnu.org/archive/html/emacs-devel/2022-05/msg00017.html

2 years ago* lisp/desktop.el: Enable tab-bar-mode after restoring frames with a tab bar.
Juri Linkov [Thu, 5 May 2022 18:08:30 +0000 (21:08 +0300)]
* lisp/desktop.el: Enable tab-bar-mode after restoring frames with a tab bar.

(desktop-restore-frameset): Enable tab-bar-mode when a restored frame
contains the frame parameter tab-bar-lines (bug#55070).

2 years agoBe more resilient towards errors during error handling
Lars Ingebrigtsen [Thu, 5 May 2022 11:22:33 +0000 (13:22 +0200)]
Be more resilient towards errors during error handling

* src/print.c (print_error_message): Avoid infinite recursion if
`substitute-command-keys' bugs out (bug#55269).

(cherry picked from commit 8364f058b821eba31f84dcded175cca403a965a5)

2 years agotimestamp doc minor improvements
Paul Eggert [Thu, 5 May 2022 15:56:19 +0000 (08:56 -0700)]
timestamp doc minor improvements

* doc/lispref/os.texi (Time of Day, Time Conversion)
(Time Calculations): Fix some confusion about decoded times,
timestamps, and time values.  Exclude floating-point infinities
and NaNs from timestamps, as the code doesn’t always follow
IEEE-754 rules for them and whatever the code does, doesn’t matter
for timestamps anyway.

2 years ago* doc/emacs/misc.texi (Interactive Shell): Fix paren typo.
Glenn Morris [Thu, 5 May 2022 14:57:21 +0000 (07:57 -0700)]
* doc/emacs/misc.texi (Interactive Shell): Fix paren typo.

2 years agoFix a mistaken test case in test-undo-region
Lars Ingebrigtsen [Thu, 5 May 2022 14:38:39 +0000 (16:38 +0200)]
Fix a mistaken test case in test-undo-region

* test/lisp/simple-tests.el (test-undo-region): Fix failing cases
(bug#21523) -- the crossing-region case shouldn't be included,
either.

2 years agoAdvertise OSC directory tracking more
Lars Ingebrigtsen [Thu, 5 May 2022 13:04:43 +0000 (15:04 +0200)]
Advertise OSC directory tracking more

* doc/emacs/misc.texi (Interactive Shell): Document OSC directory
tracking more.
* lisp/shell.el (shell-dirtrack-mode): Link to the OSC directory
tracking function.

2 years agoSet GC line width on more GCs
Po Lu [Thu, 5 May 2022 13:04:48 +0000 (21:04 +0800)]
Set GC line width on more GCs

* src/xterm.c (x_set_cursor_gc, x_set_mouse_face_gc)
(x_draw_bar_cursor): Make created scratch GCs have a line-width
of 1.

2 years agoSort completions in Info references/menu correctly
Lars Ingebrigtsen [Thu, 5 May 2022 11:30:14 +0000 (13:30 +0200)]
Sort completions in Info references/menu correctly

* lisp/info.el (Info-follow-reference): Sort completions in the
order they appear in the buffer (bug#54175).
(Info-menu-update): Ditto.

2 years agoBe more resilient towards errors during error handling
Lars Ingebrigtsen [Thu, 5 May 2022 11:22:33 +0000 (13:22 +0200)]
Be more resilient towards errors during error handling

* src/print.c (print_error_message): Avoid infinite recursion if
`substitute-command-keys' bugs out (bug#55269).

2 years agoAvoid resizing mini buffer when displaying page numbers
Philip Kaludercic [Wed, 4 May 2022 12:24:31 +0000 (14:24 +0200)]
Avoid resizing mini buffer when displaying page numbers

* doc-view.el (doc-view-goto-page): Do not insert a newline at the end
of the "current info" if not necessary.

2 years agoDescribe kmacro registers better
Lars Ingebrigtsen [Thu, 5 May 2022 11:09:57 +0000 (13:09 +0200)]
Describe kmacro registers better

* lisp/kmacro.el (register-val-describe): Allow describing macros
that contain mouse events (bug#55266).

2 years agoSpeed up opening fonts on Haiku
Po Lu [Thu, 5 May 2022 09:46:05 +0000 (09:46 +0000)]
Speed up opening fonts on Haiku

* src/font.h (font_property_index): Note that some font drivers
use the extra data in a font entity to store driver-specific
information.

* src/haiku_font_support.cc (BFont_find): Set font indices.
(be_open_font_at_index): New function.
(BFont_open_pattern): Clean up coding style.
* src/haiku_support.h (enum haiku_font_specification)
(struct haiku_font_pattern): New fields and specifications for
indices.
* src/haikufont.c (haikufont_pattern_to_entity, haikufont_open):
Use indices to open fonts if available in the extra data.

2 years agoFix font weight reporting on macOS
Po Lu [Thu, 5 May 2022 09:01:53 +0000 (17:01 +0800)]
Fix font weight reporting on macOS

* src/macfont.m (macfont_store_descriptor_attributes): Fix
numeric values for the addition of `medium'.

* src/nsterm.m (ns_font_desc_to_font_spec): Adjust accordingly.
(ns_create_font_panel_buttons): Try to fix button width.

2 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Po Lu [Thu, 5 May 2022 07:56:19 +0000 (15:56 +0800)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

2 years agoImprove appearance of macOS font panel buttons
Po Lu [Thu, 5 May 2022 07:55:33 +0000 (15:55 +0800)]
Improve appearance of macOS font panel buttons

* src/nsterm.m (ns_create_font_panel_buttons):
([EmacsView noteUserCancelledSelection]): New functions.
([EmacsView showFontPanel]): Use those buttons instead.

2 years agoAdd Tramp test
Michael Albinus [Thu, 5 May 2022 07:54:31 +0000 (09:54 +0200)]
Add Tramp test

* test/lisp/net/tramp-tests.el (tar-mode): Require.
(tramp-test10-write-region-other-file-name-handler): New test.
(tramp-test31-interrupt-process, tramp-test31-signal-process):
Tag them :unstable unconditionally.

* test/lisp/net/tramp-resources/foo.tar.gz: New resource file.

2 years ago; * src/w32notify.c: Fix a typo in a comment.
Eli Zaretskii [Thu, 5 May 2022 07:38:40 +0000 (10:38 +0300)]
; * src/w32notify.c: Fix a typo in a comment.

2 years agoFix min size reporting of style pane in Haiku font dialogs
Po Lu [Thu, 5 May 2022 06:33:49 +0000 (06:33 +0000)]
Fix min size reporting of style pane in Haiku font dialogs

* src/haiku_support.cc (class DualLayoutView):
(MinSize): Implement correctly with both views.

2 years ago; * src/window.c (Fset_window_start): Mention the effect on vscroll.
Eli Zaretskii [Thu, 5 May 2022 05:57:49 +0000 (08:57 +0300)]
; * src/window.c (Fset_window_start): Mention the effect on vscroll.

2 years agoUse bswap_32 and bswap_16 in Motif DND code
Po Lu [Thu, 5 May 2022 05:44:19 +0000 (13:44 +0800)]
Use bswap_32 and bswap_16 in Motif DND code

* src/xterm.c (SWAPCARD32, SAPCARD16): Use glibc/gnulib
byte-swapping functions if checking is disabled.

2 years agoTake size into account when previewing fonts on Haiku
Po Lu [Thu, 5 May 2022 04:58:47 +0000 (04:58 +0000)]
Take size into account when previewing fonts on Haiku

* src/haiku_support.cc (MessageReceived): Decode size sent and
handle `UPDATE_PREVIEW_DIALOG' message.
(UpdatePreview): Add current size.
(EmacsFontSelectionDialog): Assign correct modification messages
to the size entry.

2 years agoAllow displaying font preview on Haiku
Po Lu [Thu, 5 May 2022 03:10:30 +0000 (03:10 +0000)]
Allow displaying font preview on Haiku

* src/haiku_support.cc (class EmacsFontPreviewDialog)
(class DualLayoutView): New classes.
(class EmacsFontSelectionDialog): Add field for preview,
checkbox and layout view.
(MessageReceived): Handle new font preview messages.
(EmacsFontSelectionDialog): New constructor.
(FrameResized): Resize the layout view instead.

2 years agoFix device reporting from scroll bar events on X
Po Lu [Thu, 5 May 2022 01:03:30 +0000 (09:03 +0800)]
Fix device reporting from scroll bar events on X

* src/xterm.c (x_scroll_bar_handle_click): New argument
`device'.
(handle_one_xevent): Set it appropriately as long as required.

2 years agoTranscription error
dickmao [Wed, 4 May 2022 23:23:53 +0000 (19:23 -0400)]
Transcription error

* lisp/gnus/gnus-topic.el (gnus-topic-display-missing-topic):
Indent.
(gnus-topic-update-topic-line): Insert missing fourth argument.

2 years agoRevert "server-execute: Initialize the *scratch* buffer"
Sean Whitton [Wed, 4 May 2022 23:31:28 +0000 (16:31 -0700)]
Revert "server-execute: Initialize the *scratch* buffer"

This reverts commit f2d2fe6fc8ef0b6087c4a8a69d05a4e521b23047.

To be replaced with factoring out *scratch* buffer initialization.

2 years agoStop esh-var-tests leaving temp files behind
Glenn Morris [Wed, 4 May 2022 22:02:40 +0000 (15:02 -0700)]
Stop esh-var-tests leaving temp files behind

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/quoted-interp-temp-cmd): Don't leave temporary files.

2 years agoRemove bogus mode check from gnus topic update functions
Eric Abrahamsen [Wed, 4 May 2022 19:54:37 +0000 (12:54 -0700)]
Remove bogus mode check from gnus topic update functions

* lisp/gnus/gnus-topic.el (gnus-topic-update-topics-containing-group):
(gnus-topic-update-topic): These functions originally checked to see
if we were in group mode, but later that check was changed to
'gnus-topic-mode, which never passes because 'gnus-topic-mode isn't a
major mode. Revert to checking for 'gnus-group-mode, and use
`derived-mode-p' while we're at it.

2 years ago* lisp/tab-bar.el: Use pixel-based alignment (bug#55207)
Juri Linkov [Wed, 4 May 2022 19:32:30 +0000 (22:32 +0300)]
* lisp/tab-bar.el: Use pixel-based alignment (bug#55207)

* lisp/tab-bar.el (tab-bar-format-align-right): Use string-pixel-width
on the string with tab-bar face to get the width in pixels to align.
(tab-bar-format-global): Remove string-trim-right to keep padding-right.

2 years agoRemove unused lexvar in subr-x-tests.el
Basil L. Contovounesios [Wed, 4 May 2022 18:54:49 +0000 (21:54 +0300)]
Remove unused lexvar in subr-x-tests.el

* test/lisp/emacs-lisp/subr-x-tests.el
(test-with-buffer-unmodified-if-unchanged): Pacify unused lexvar
byte-compiler warning.  Simplify slightly and reindent.

2 years ago* src/xterm.c (handle_one_xevent): Fix int/Lisp_Object mix-up.
Glenn Morris [Wed, 4 May 2022 14:48:22 +0000 (07:48 -0700)]
* src/xterm.c (handle_one_xevent): Fix int/Lisp_Object mix-up.

; Flagged by --enable-check-lisp-object-type

2 years ago; Re-fix last change in doc of 'with-buffer-unmodified-if-unchanged'.
Robert Pluim [Wed, 4 May 2022 12:53:34 +0000 (14:53 +0200)]
; Re-fix last change in doc of 'with-buffer-unmodified-if-unchanged'.

2 years ago* etc/NEWS: Improve some NEWS entries
Robert Pluim [Wed, 4 May 2022 12:48:27 +0000 (14:48 +0200)]
* etc/NEWS: Improve some NEWS entries

2 years ago; * etc/PROBLEMS: Fix typo.
Robert Pluim [Wed, 4 May 2022 12:46:59 +0000 (14:46 +0200)]
; * etc/PROBLEMS: Fix typo.