diff options
| author | Po Lu | 2023-02-25 14:24:17 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-25 14:24:17 +0800 |
| commit | d5cccfdc564f1486431f9674503c794df33d7fbc (patch) | |
| tree | 351dc3a1bd2ca77e45b41bf7f209d238e0d4c6cb | |
| parent | ea74f3c0678d0729a8d6307e35c2d228f665afa3 (diff) | |
| parent | 50b55656b9c5ce0d7940bec245f2d9725378d0a0 (diff) | |
| download | emacs-d5cccfdc564f1486431f9674503c794df33d7fbc.tar.gz emacs-d5cccfdc564f1486431f9674503c794df33d7fbc.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
36 files changed, 558 insertions, 417 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 052a10e3797..4c40f414ca0 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -3679,10 +3679,20 @@ in C. | |||
| 3679 | @vindex font-lock-function-name-face | 3679 | @vindex font-lock-function-name-face |
| 3680 | for the name of a function being defined or declared. | 3680 | for the name of a function being defined or declared. |
| 3681 | 3681 | ||
| 3682 | @item font-lock-function-call-face | ||
| 3683 | @vindex font-lock-function-call-face | ||
| 3684 | for the name of a function being called. This face inherits, by | ||
| 3685 | default, from @code{font-lock-function-name-face}. | ||
| 3686 | |||
| 3682 | @item font-lock-variable-name-face | 3687 | @item font-lock-variable-name-face |
| 3683 | @vindex font-lock-variable-name-face | 3688 | @vindex font-lock-variable-name-face |
| 3684 | for the name of a variable being defined or declared. | 3689 | for the name of a variable being defined or declared. |
| 3685 | 3690 | ||
| 3691 | @item font-lock-variable-ref-face | ||
| 3692 | @vindex font-lock-variable-ref-face | ||
| 3693 | for the name of a variable being referenced. This face inherits, by | ||
| 3694 | default, from @code{font-lock-variable-name-face}. | ||
| 3695 | |||
| 3686 | @item font-lock-keyword-face | 3696 | @item font-lock-keyword-face |
| 3687 | @vindex font-lock-keyword-face | 3697 | @vindex font-lock-keyword-face |
| 3688 | for a keyword with special syntactic significance, like @samp{for} and | 3698 | for a keyword with special syntactic significance, like @samp{for} and |
| @@ -3756,11 +3766,16 @@ for numbers. | |||
| 3756 | @vindex font-lock-operator-face | 3766 | @vindex font-lock-operator-face |
| 3757 | for operators. | 3767 | for operators. |
| 3758 | 3768 | ||
| 3759 | @item font-lock-property-face | 3769 | @item font-lock-property-name-face |
| 3760 | @vindex font-lock-property-face | 3770 | @vindex font-lock-property-name-face |
| 3761 | for properties of an object, such as the declaration and use of fields | 3771 | for properties of an object, such as the declaration of fields in a |
| 3762 | in a struct. | 3772 | struct. This face inherits, by default, from |
| 3763 | This face inherits, by default, from @code{font-lock-variable-name-face}. | 3773 | @code{font-lock-variable-name-face}. |
| 3774 | |||
| 3775 | @item font-lock-property-ref-face | ||
| 3776 | @vindex font-lock-property-ref-face | ||
| 3777 | for properties of an object, such as use of fields in a struct. This | ||
| 3778 | face inherits, by default, from @code{font-lock-property-name-face}. | ||
| 3764 | 3779 | ||
| 3765 | For example, | 3780 | For example, |
| 3766 | 3781 | ||
diff --git a/etc/NEWS.29 b/etc/NEWS.29 index 7f84d548149..b6c6f2c6362 100644 --- a/etc/NEWS.29 +++ b/etc/NEWS.29 | |||
| @@ -828,11 +828,12 @@ filter/sentinel error has been handled. | |||
| 828 | +++ | 828 | +++ |
| 829 | ** New faces for font-lock. | 829 | ** New faces for font-lock. |
| 830 | These faces are primarily meant for use with tree-sitter. They are: | 830 | These faces are primarily meant for use with tree-sitter. They are: |
| 831 | 'font-lock-function-call-face', 'font-lock-variable-ref-face', | ||
| 831 | 'font-lock-bracket-face', 'font-lock-delimiter-face', | 832 | 'font-lock-bracket-face', 'font-lock-delimiter-face', |
| 832 | 'font-lock-escape-face', 'font-lock-misc-punctuation-face', | 833 | 'font-lock-escape-face', 'font-lock-misc-punctuation-face', |
| 833 | 'font-lock-number-face', 'font-lock-operator-face', | 834 | 'font-lock-number-face', 'font-lock-operator-face', |
| 834 | 'font-lock-property-face', and 'font-lock-punctuation-face', | 835 | 'font-lock-property-name-face', 'font-lock-property-ref-face', |
| 835 | 'font-lock-regexp-face'. | 836 | 'font-lock-punctuation-face', and 'font-lock-regexp-face'. |
| 836 | 837 | ||
| 837 | +++ | 838 | +++ |
| 838 | ** New face 'variable-pitch-text'. | 839 | ** New face 'variable-pitch-text'. |
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index dea5dbe9410..46e41dd046c 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el | |||
| @@ -68,13 +68,16 @@ Do not call this mode function yourself. It is meant for internal use." | |||
| 68 | font-lock-comment-delimiter-face font-lock-comment-face | 68 | font-lock-comment-delimiter-face font-lock-comment-face |
| 69 | font-lock-constant-face font-lock-delimiter-face | 69 | font-lock-constant-face font-lock-delimiter-face |
| 70 | font-lock-doc-face font-lock-doc-markup-face | 70 | font-lock-doc-face font-lock-doc-markup-face |
| 71 | font-lock-escape-face font-lock-function-name-face | 71 | font-lock-escape-face font-lock-function-call-face |
| 72 | font-lock-function-name-face | ||
| 72 | font-lock-keyword-face font-lock-negation-char-face | 73 | font-lock-keyword-face font-lock-negation-char-face |
| 73 | font-lock-number-face font-lock-misc-punctuation-face | 74 | font-lock-number-face font-lock-misc-punctuation-face |
| 74 | font-lock-operator-face font-lock-preprocessor-face | 75 | font-lock-operator-face font-lock-preprocessor-face |
| 75 | font-lock-property-face font-lock-punctuation-face | 76 | font-lock-property-name-face font-lock-property-ref-face |
| 77 | font-lock-punctuation-face | ||
| 76 | font-lock-regexp-grouping-backslash font-lock-regexp-grouping-construct | 78 | font-lock-regexp-grouping-backslash font-lock-regexp-grouping-construct |
| 77 | font-lock-string-face font-lock-type-face font-lock-variable-name-face | 79 | font-lock-string-face font-lock-type-face font-lock-variable-name-face |
| 80 | font-lock-variable-ref-face | ||
| 78 | font-lock-warning-face button link link-visited fringe | 81 | font-lock-warning-face button link link-visited fringe |
| 79 | header-line tooltip mode-line mode-line-buffer-id | 82 | header-line tooltip mode-line mode-line-buffer-id |
| 80 | mode-line-emphasis mode-line-highlight mode-line-inactive | 83 | mode-line-emphasis mode-line-highlight mode-line-inactive |
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 456ec06a141..d60e3a9dae7 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -272,6 +272,14 @@ for speeding up processing.") | |||
| 272 | . ,(cdr case))) | 272 | . ,(cdr case))) |
| 273 | cases))) | 273 | cases))) |
| 274 | 274 | ||
| 275 | (defsubst byte-opt--fget (f prop) | ||
| 276 | "Simpler and faster version of `function-get'." | ||
| 277 | (let ((val nil)) | ||
| 278 | (while (and (symbolp f) f | ||
| 279 | (null (setq val (get f prop)))) | ||
| 280 | (setq f (symbol-function f))) | ||
| 281 | val)) | ||
| 282 | |||
| 275 | (defun byte-optimize-form-code-walker (form for-effect) | 283 | (defun byte-optimize-form-code-walker (form for-effect) |
| 276 | ;; | 284 | ;; |
| 277 | ;; For normal function calls, We can just mapcar the optimizer the cdr. But | 285 | ;; For normal function calls, We can just mapcar the optimizer the cdr. But |
| @@ -497,7 +505,7 @@ for speeding up processing.") | |||
| 497 | form) | 505 | form) |
| 498 | 506 | ||
| 499 | ((guard (when for-effect | 507 | ((guard (when for-effect |
| 500 | (if-let ((tmp (get fn 'side-effect-free))) | 508 | (if-let ((tmp (byte-opt--fget fn 'side-effect-free))) |
| 501 | (or byte-compile-delete-errors | 509 | (or byte-compile-delete-errors |
| 502 | (eq tmp 'error-free) | 510 | (eq tmp 'error-free) |
| 503 | (progn | 511 | (progn |
| @@ -516,7 +524,7 @@ for speeding up processing.") | |||
| 516 | ;; even if the called function is for-effect, because we | 524 | ;; even if the called function is for-effect, because we |
| 517 | ;; don't know anything about that function. | 525 | ;; don't know anything about that function. |
| 518 | (let ((form (cons fn (mapcar #'byte-optimize-form (cdr form))))) | 526 | (let ((form (cons fn (mapcar #'byte-optimize-form (cdr form))))) |
| 519 | (if (get fn 'pure) | 527 | (if (byte-opt--fget fn 'pure) |
| 520 | (byte-optimize-constant-args form) | 528 | (byte-optimize-constant-args form) |
| 521 | form)))))) | 529 | form)))))) |
| 522 | 530 | ||
| @@ -538,7 +546,7 @@ for speeding up processing.") | |||
| 538 | ;; until a fixpoint has been reached. | 546 | ;; until a fixpoint has been reached. |
| 539 | (and (consp form) | 547 | (and (consp form) |
| 540 | (symbolp (car form)) | 548 | (symbolp (car form)) |
| 541 | (let ((opt (function-get (car form) 'byte-optimizer))) | 549 | (let ((opt (byte-opt--fget (car form) 'byte-optimizer))) |
| 542 | (and opt | 550 | (and opt |
| 543 | (let ((old form) | 551 | (let ((old form) |
| 544 | (new (funcall opt form))) | 552 | (new (funcall opt form))) |
| @@ -1661,7 +1669,7 @@ See Info node `(elisp) Integer Basics'." | |||
| 1661 | frame-visible-p fround ftruncate | 1669 | frame-visible-p fround ftruncate |
| 1662 | get gethash get-buffer get-buffer-window get-file-buffer | 1670 | get gethash get-buffer get-buffer-window get-file-buffer |
| 1663 | hash-table-count | 1671 | hash-table-count |
| 1664 | int-to-string intern-soft isnan | 1672 | intern-soft isnan |
| 1665 | keymap-parent | 1673 | keymap-parent |
| 1666 | ldexp | 1674 | ldexp |
| 1667 | length length< length> length= | 1675 | length length< length> length= |
| @@ -1675,23 +1683,22 @@ See Info node `(elisp) Integer Basics'." | |||
| 1675 | prefix-numeric-value previous-window prin1-to-string propertize | 1683 | prefix-numeric-value previous-window prin1-to-string propertize |
| 1676 | rassq rassoc read-from-string | 1684 | rassq rassoc read-from-string |
| 1677 | regexp-quote region-beginning region-end reverse round | 1685 | regexp-quote region-beginning region-end reverse round |
| 1678 | sin sqrt string string< string= string-equal string-lessp | 1686 | sin sqrt string string-equal string-lessp |
| 1679 | string> | ||
| 1680 | string-search string-to-char | 1687 | string-search string-to-char |
| 1681 | string-to-number string-to-syntax substring | 1688 | string-to-number string-to-syntax substring |
| 1682 | sxhash sxhash-equal sxhash-eq sxhash-eql | 1689 | sxhash-equal sxhash-eq sxhash-eql |
| 1683 | symbol-function symbol-name symbol-plist symbol-value string-make-unibyte | 1690 | symbol-function symbol-name symbol-plist symbol-value |
| 1691 | string-make-unibyte | ||
| 1684 | string-make-multibyte string-as-multibyte string-as-unibyte | 1692 | string-make-multibyte string-as-multibyte string-as-unibyte |
| 1685 | string-to-multibyte | 1693 | string-to-multibyte |
| 1686 | take tan time-convert truncate | 1694 | take tan time-convert truncate |
| 1687 | unibyte-char-to-multibyte upcase user-full-name | 1695 | unibyte-char-to-multibyte upcase user-full-name |
| 1688 | user-login-name user-original-login-name | 1696 | user-login-name |
| 1689 | vconcat | 1697 | vconcat |
| 1690 | window-at window-body-height | 1698 | window-at window-body-height |
| 1691 | window-body-width window-buffer window-dedicated-p window-display-table | 1699 | window-body-width window-buffer window-dedicated-p window-display-table |
| 1692 | window-combination-limit window-frame window-fringes | 1700 | window-combination-limit window-frame window-fringes |
| 1693 | window-height window-hscroll window-inside-edges | 1701 | window-hscroll |
| 1694 | window-inside-absolute-pixel-edges window-inside-pixel-edges | ||
| 1695 | window-left-child window-left-column window-margins window-minibuffer-p | 1702 | window-left-child window-left-column window-margins window-minibuffer-p |
| 1696 | window-next-buffers window-next-sibling window-new-normal | 1703 | window-next-buffers window-next-sibling window-new-normal |
| 1697 | window-new-total window-normal-size window-parameter window-parameters | 1704 | window-new-total window-normal-size window-parameter window-parameters |
| @@ -1699,7 +1706,7 @@ See Info node `(elisp) Integer Basics'." | |||
| 1699 | window-prev-sibling window-scroll-bars | 1706 | window-prev-sibling window-scroll-bars |
| 1700 | window-start window-text-height window-top-child window-top-line | 1707 | window-start window-text-height window-top-child window-top-line |
| 1701 | window-total-height window-total-width window-use-time window-vscroll | 1708 | window-total-height window-total-width window-use-time window-vscroll |
| 1702 | window-width)) | 1709 | )) |
| 1703 | (side-effect-and-error-free-fns | 1710 | (side-effect-and-error-free-fns |
| 1704 | '(arrayp atom | 1711 | '(arrayp atom |
| 1705 | bobp bolp bool-vector-p | 1712 | bobp bolp bool-vector-p |
| @@ -1716,7 +1723,7 @@ See Info node `(elisp) Integer Basics'." | |||
| 1716 | keymapp keywordp | 1723 | keymapp keywordp |
| 1717 | list listp | 1724 | list listp |
| 1718 | make-marker mark-marker markerp max-char | 1725 | make-marker mark-marker markerp max-char |
| 1719 | natnump nlistp not null number-or-marker-p numberp | 1726 | natnump nlistp null number-or-marker-p numberp |
| 1720 | overlayp | 1727 | overlayp |
| 1721 | point point-marker point-min point-max preceding-char | 1728 | point point-marker point-min point-max preceding-char |
| 1722 | processp proper-list-p | 1729 | processp proper-list-p |
| @@ -1763,11 +1770,11 @@ See Info node `(elisp) Integer Basics'." | |||
| 1763 | copysign isnan ldexp float logb | 1770 | copysign isnan ldexp float logb |
| 1764 | floor ceiling round truncate | 1771 | floor ceiling round truncate |
| 1765 | ffloor fceiling fround ftruncate | 1772 | ffloor fceiling fround ftruncate |
| 1766 | string= string-equal string< string-lessp string> | 1773 | string-equal string-lessp |
| 1767 | string-search | 1774 | string-search |
| 1768 | consp atom listp nlistp proper-list-p | 1775 | consp atom listp nlistp proper-list-p |
| 1769 | sequencep arrayp vectorp stringp bool-vector-p hash-table-p | 1776 | sequencep arrayp vectorp stringp bool-vector-p hash-table-p |
| 1770 | null not | 1777 | null |
| 1771 | numberp integerp floatp natnump characterp | 1778 | numberp integerp floatp natnump characterp |
| 1772 | integer-or-marker-p number-or-marker-p char-or-string-p | 1779 | integer-or-marker-p number-or-marker-p char-or-string-p |
| 1773 | symbolp keywordp | 1780 | symbolp keywordp |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b0c9667dc19..095468ad978 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -5079,7 +5079,10 @@ binding slots have been popped." | |||
| 5079 | (defun byte-compile-suppressed-warnings (form) | 5079 | (defun byte-compile-suppressed-warnings (form) |
| 5080 | (let ((byte-compile--suppressed-warnings | 5080 | (let ((byte-compile--suppressed-warnings |
| 5081 | (append (cadadr form) byte-compile--suppressed-warnings))) | 5081 | (append (cadadr form) byte-compile--suppressed-warnings))) |
| 5082 | (byte-compile-form (macroexp-progn (cddr form))))) | 5082 | ;; Propagate the for-effect mode explicitly so that warnings about |
| 5083 | ;; ignored return values can be detected and suppressed correctly. | ||
| 5084 | (byte-compile-form (macroexp-progn (cddr form)) byte-compile--for-effect) | ||
| 5085 | (setq byte-compile--for-effect nil))) | ||
| 5083 | 5086 | ||
| 5084 | ;; Warn about misuses of make-variable-buffer-local. | 5087 | ;; Warn about misuses of make-variable-buffer-local. |
| 5085 | (byte-defop-compiler-1 make-variable-buffer-local | 5088 | (byte-defop-compiler-1 make-variable-buffer-local |
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index b753adcb8a0..ea2766b8dc4 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el | |||
| @@ -309,7 +309,6 @@ asynchronously." | |||
| 309 | (directory (file-name-concat | 309 | (directory (file-name-concat |
| 310 | (or (package-desc-dir pkg-desc) | 310 | (or (package-desc-dir pkg-desc) |
| 311 | (expand-file-name name package-user-dir)) | 311 | (expand-file-name name package-user-dir)) |
| 312 | (plist-get pkg-spec :lisp-dir) | ||
| 313 | (and-let* ((extras (package-desc-extras pkg-desc))) | 312 | (and-let* ((extras (package-desc-extras pkg-desc))) |
| 314 | (alist-get :lisp-dir extras)))) | 313 | (alist-get :lisp-dir extras)))) |
| 315 | (file (or (plist-get pkg-spec :main-file) | 314 | (file (or (plist-get pkg-spec :main-file) |
| @@ -615,6 +614,10 @@ PKG-SPEC is a package specification, a property list describing | |||
| 615 | how to fetch and build the package. See `package-vc--archive-spec-alist' | 614 | how to fetch and build the package. See `package-vc--archive-spec-alist' |
| 616 | for details. The optional argument REV specifies a specific revision to | 615 | for details. The optional argument REV specifies a specific revision to |
| 617 | checkout. This overrides the `:branch' attribute in PKG-SPEC." | 616 | checkout. This overrides the `:branch' attribute in PKG-SPEC." |
| 617 | (unless (eq (package-desc-kind pkg-desc) 'vc) | ||
| 618 | (let ((copy (copy-package-desc pkg-desc))) | ||
| 619 | (setf (package-desc-kind copy) 'vc | ||
| 620 | pkg-desc copy))) | ||
| 618 | (pcase-let* (((map :lisp-dir) pkg-spec) | 621 | (pcase-let* (((map :lisp-dir) pkg-spec) |
| 619 | (name (package-desc-name pkg-desc)) | 622 | (name (package-desc-name pkg-desc)) |
| 620 | (dirname (package-desc-full-name pkg-desc)) | 623 | (dirname (package-desc-full-name pkg-desc)) |
| @@ -826,9 +829,7 @@ regular package, but it will not remove a VC package. | |||
| 826 | rev))) | 829 | rev))) |
| 827 | ((and-let* ((desc (assoc package package-archive-contents #'string=))) | 830 | ((and-let* ((desc (assoc package package-archive-contents #'string=))) |
| 828 | (package-vc--unpack | 831 | (package-vc--unpack |
| 829 | (let ((copy (copy-package-desc (cadr desc)))) | 832 | (cadr desc) |
| 830 | (setf (package-desc-kind copy) 'vc) | ||
| 831 | copy) | ||
| 832 | (or (package-vc--desc->spec (cadr desc)) | 833 | (or (package-vc--desc->spec (cadr desc)) |
| 833 | (and-let* ((extras (package-desc-extras (cadr desc))) | 834 | (and-let* ((extras (package-desc-extras (cadr desc))) |
| 834 | (url (alist-get :url extras)) | 835 | (url (alist-get :url extras)) |
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index 1d3cde69392..e722cbc52dd 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el | |||
| @@ -237,7 +237,7 @@ Otherwise result is a reason code." | |||
| 237 | ((eq (car-safe fun) 'lambda) | 237 | ((eq (car-safe fun) 'lambda) |
| 238 | (unsafep fun unsafep-vars)) | 238 | (unsafep fun unsafep-vars)) |
| 239 | ((not (and (symbolp fun) | 239 | ((not (and (symbolp fun) |
| 240 | (or (get fun 'side-effect-free) | 240 | (or (function-get fun 'side-effect-free) |
| 241 | (eq (get fun 'safe-function) t) | 241 | (eq (get fun 'safe-function) t) |
| 242 | (eq safe-functions t) | 242 | (eq safe-functions t) |
| 243 | (memq fun safe-functions)))) | 243 | (memq fun safe-functions)))) |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 9e944fe188a..b82b7648797 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -2026,6 +2026,12 @@ as the constructs of Haddock, Javadoc and similar systems." | |||
| 2026 | "Font Lock mode face used to highlight function names." | 2026 | "Font Lock mode face used to highlight function names." |
| 2027 | :group 'font-lock-faces) | 2027 | :group 'font-lock-faces) |
| 2028 | 2028 | ||
| 2029 | (defface font-lock-function-call-face | ||
| 2030 | '((t :inherit font-lock-function-name-face)) | ||
| 2031 | "Font Lock mode face used to highlight function calls." | ||
| 2032 | :group 'font-lock-faces | ||
| 2033 | :version "29.1") | ||
| 2034 | |||
| 2029 | (defface font-lock-variable-name-face | 2035 | (defface font-lock-variable-name-face |
| 2030 | '((((class grayscale) (background light)) | 2036 | '((((class grayscale) (background light)) |
| 2031 | :foreground "Gray90" :weight bold :slant italic) | 2037 | :foreground "Gray90" :weight bold :slant italic) |
| @@ -2040,6 +2046,12 @@ as the constructs of Haddock, Javadoc and similar systems." | |||
| 2040 | "Font Lock mode face used to highlight variable names." | 2046 | "Font Lock mode face used to highlight variable names." |
| 2041 | :group 'font-lock-faces) | 2047 | :group 'font-lock-faces) |
| 2042 | 2048 | ||
| 2049 | (defface font-lock-variable-ref-face | ||
| 2050 | '((t :inherit font-lock-variable-name-face)) | ||
| 2051 | "Font Lock mode face used to highlight variable references." | ||
| 2052 | :group 'font-lock-faces | ||
| 2053 | :version "29.1") | ||
| 2054 | |||
| 2043 | (defface font-lock-type-face | 2055 | (defface font-lock-type-face |
| 2044 | '((((class grayscale) (background light)) :foreground "Gray90" :weight bold) | 2056 | '((((class grayscale) (background light)) :foreground "Gray90" :weight bold) |
| 2045 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) | 2057 | (((class grayscale) (background dark)) :foreground "DimGray" :weight bold) |
| @@ -2115,10 +2127,17 @@ as the constructs of Haddock, Javadoc and similar systems." | |||
| 2115 | :group 'font-lock-faces | 2127 | :group 'font-lock-faces |
| 2116 | :version "29.1") | 2128 | :version "29.1") |
| 2117 | 2129 | ||
| 2118 | (defface font-lock-property-face | 2130 | (defface font-lock-property-name-face |
| 2119 | '((t :inherit font-lock-variable-name-face)) | 2131 | '((t :inherit font-lock-variable-name-face)) |
| 2120 | "Font Lock mode face used to highlight properties of an object. | 2132 | "Font Lock mode face used to highlight properties of an object. |
| 2121 | For example, the declaration and use of fields in a struct." | 2133 | For example, the declaration of fields in a struct." |
| 2134 | :group 'font-lock-faces | ||
| 2135 | :version "29.1") | ||
| 2136 | |||
| 2137 | (defface font-lock-property-ref-face | ||
| 2138 | '((t :inherit font-lock-property-name-face)) | ||
| 2139 | "Font Lock mode face used to highlight property references. | ||
| 2140 | For example, property lookup of fields in a struct." | ||
| 2122 | :group 'font-lock-faces | 2141 | :group 'font-lock-faces |
| 2123 | :version "29.1") | 2142 | :version "29.1") |
| 2124 | 2143 | ||
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 94d8794bd23..64aa7a27bde 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -376,11 +376,23 @@ and `kmacro-counter-format'.") | |||
| 376 | (defvar kmacro-view-last-item nil) | 376 | (defvar kmacro-view-last-item nil) |
| 377 | (defvar kmacro-view-item-no 0) | 377 | (defvar kmacro-view-item-no 0) |
| 378 | 378 | ||
| 379 | (defun kmacro--to-vector (object) | ||
| 380 | "Normalize an old-style key sequence to the vector form." | ||
| 381 | (if (not (stringp object)) | ||
| 382 | object | ||
| 383 | (let ((vec (string-to-vector object))) | ||
| 384 | (unless (multibyte-string-p object) | ||
| 385 | (dotimes (i (length vec)) | ||
| 386 | (let ((k (aref vec i))) | ||
| 387 | (when (> k 127) | ||
| 388 | (setf (aref vec i) (+ k ?\M-\C-@ -128)))))) | ||
| 389 | vec))) | ||
| 379 | 390 | ||
| 380 | (defun kmacro-ring-head () | 391 | (defun kmacro-ring-head () |
| 381 | "Return pseudo head element in macro ring." | 392 | "Return pseudo head element in macro ring." |
| 382 | (and last-kbd-macro | 393 | (and last-kbd-macro |
| 383 | (kmacro last-kbd-macro kmacro-counter kmacro-counter-format-start))) | 394 | (kmacro (kmacro--to-vector last-kbd-macro) |
| 395 | kmacro-counter kmacro-counter-format-start))) | ||
| 384 | 396 | ||
| 385 | 397 | ||
| 386 | (defun kmacro-push-ring (&optional elt) | 398 | (defun kmacro-push-ring (&optional elt) |
| @@ -839,12 +851,8 @@ KEYS should be a vector or a string that obeys `key-valid-p'." | |||
| 839 | (setq format (nth 2 mac)) | 851 | (setq format (nth 2 mac)) |
| 840 | (setq counter (nth 1 mac)) | 852 | (setq counter (nth 1 mac)) |
| 841 | (setq mac (nth 0 mac))) | 853 | (setq mac (nth 0 mac))) |
| 842 | (when (stringp mac) | 854 | ;; `kmacro' interprets a string according to `key-parse'. |
| 843 | ;; `kmacro' interprets a string according to `key-parse'. | 855 | (kmacro (kmacro--to-vector mac) counter format))) |
| 844 | (require 'macros) | ||
| 845 | (declare-function macro--string-to-vector "macros") | ||
| 846 | (setq mac (macro--string-to-vector mac))) | ||
| 847 | (kmacro mac counter format))) | ||
| 848 | 856 | ||
| 849 | (defun kmacro-extract-lambda (mac) | 857 | (defun kmacro-extract-lambda (mac) |
| 850 | "Extract kmacro from a kmacro lambda form." | 858 | "Extract kmacro from a kmacro lambda form." |
| @@ -860,8 +868,6 @@ KEYS should be a vector or a string that obeys `key-valid-p'." | |||
| 860 | 868 | ||
| 861 | (cl-defmethod cl-print-object ((object kmacro) stream) | 869 | (cl-defmethod cl-print-object ((object kmacro) stream) |
| 862 | (princ "#f(kmacro " stream) | 870 | (princ "#f(kmacro " stream) |
| 863 | (require 'macros) | ||
| 864 | (declare-function macros--insert-vector-macro "macros" (definition)) | ||
| 865 | (let ((vecdef (kmacro--keys object)) | 871 | (let ((vecdef (kmacro--keys object)) |
| 866 | (counter (kmacro--counter object)) | 872 | (counter (kmacro--counter object)) |
| 867 | (format (kmacro--format object))) | 873 | (format (kmacro--format object))) |
| @@ -943,20 +949,15 @@ Such a \"function\" cannot be called from Lisp, but it is a valid editor command | |||
| 943 | (put symbol 'kmacro t)) | 949 | (put symbol 'kmacro t)) |
| 944 | 950 | ||
| 945 | 951 | ||
| 946 | (cl-defstruct (kmacro-register | 952 | (cl-defmethod register-val-jump-to ((km kmacro) arg) |
| 947 | (:constructor nil) | 953 | (funcall km arg)) ;FIXME: η-reduce? |
| 948 | (:constructor kmacro-make-register (macro))) | ||
| 949 | macro) | ||
| 950 | 954 | ||
| 951 | (cl-defmethod register-val-jump-to ((data kmacro-register) _arg) | 955 | (cl-defmethod register-val-describe ((km kmacro) _verbose) |
| 952 | (kmacro-call-macro current-prefix-arg nil nil (kmacro-register-macro data))) | 956 | (princ (format "a keyboard macro:\n %s" |
| 957 | (key-description (kmacro--keys km))))) | ||
| 953 | 958 | ||
| 954 | (cl-defmethod register-val-describe ((data kmacro-register) _verbose) | 959 | (cl-defmethod register-val-insert ((km kmacro)) |
| 955 | (princ (format "a keyboard macro:\n %s" | 960 | (insert (key-description (kmacro--keys km)))) |
| 956 | (key-description (kmacro-register-macro data))))) | ||
| 957 | |||
| 958 | (cl-defmethod register-val-insert ((data kmacro-register)) | ||
| 959 | (insert (format-kbd-macro (kmacro-register-macro data)))) | ||
| 960 | 961 | ||
| 961 | (defun kmacro-to-register (r) | 962 | (defun kmacro-to-register (r) |
| 962 | "Store the last keyboard macro in register R. | 963 | "Store the last keyboard macro in register R. |
| @@ -966,7 +967,7 @@ Interactively, reads the register using `register-read-with-preview'." | |||
| 966 | (progn | 967 | (progn |
| 967 | (or last-kbd-macro (error "No keyboard macro defined")) | 968 | (or last-kbd-macro (error "No keyboard macro defined")) |
| 968 | (list (register-read-with-preview "Save to register: ")))) | 969 | (list (register-read-with-preview "Save to register: ")))) |
| 969 | (set-register r (kmacro-make-register last-kbd-macro))) | 970 | (set-register r (kmacro-ring-head))) |
| 970 | 971 | ||
| 971 | 972 | ||
| 972 | (defun kmacro-view-macro (&optional _arg) | 973 | (defun kmacro-view-macro (&optional _arg) |
diff --git a/lisp/macros.el b/lisp/macros.el index 59c7796551f..98ee3dc52f9 100644 --- a/lisp/macros.el +++ b/lisp/macros.el | |||
| @@ -46,16 +46,6 @@ | |||
| 46 | " ") | 46 | " ") |
| 47 | ?\])) | 47 | ?\])) |
| 48 | 48 | ||
| 49 | (defun macro--string-to-vector (str) | ||
| 50 | "Convert an old-style string key sequence to the vector form." | ||
| 51 | (let ((vec (string-to-vector str))) | ||
| 52 | (unless (multibyte-string-p str) | ||
| 53 | (dotimes (i (length vec)) | ||
| 54 | (let ((k (aref vec i))) | ||
| 55 | (when (> k 127) | ||
| 56 | (setf (aref vec i) (+ k ?\M-\C-@ -128)))))) | ||
| 57 | vec)) | ||
| 58 | |||
| 59 | ;;;###autoload | 49 | ;;;###autoload |
| 60 | (defun insert-kbd-macro (macroname &optional keys) | 50 | (defun insert-kbd-macro (macroname &optional keys) |
| 61 | "Insert in buffer the definition of kbd macro MACRONAME, as Lisp code. | 51 | "Insert in buffer the definition of kbd macro MACRONAME, as Lisp code. |
| @@ -88,10 +78,8 @@ use this command, and then save the file." | |||
| 88 | (insert "(defalias '")) | 78 | (insert "(defalias '")) |
| 89 | (prin1 macroname (current-buffer)) | 79 | (prin1 macroname (current-buffer)) |
| 90 | (insert "\n ") | 80 | (insert "\n ") |
| 91 | (when (stringp definition) | 81 | (when (or (stringp definition) (vectorp definition)) |
| 92 | (setq definition (macro--string-to-vector definition))) | 82 | (setq definition (kmacro (kmacro--to-vector definition)))) |
| 93 | (if (vectorp definition) | ||
| 94 | (setq definition (kmacro definition))) | ||
| 95 | (if (kmacro-p definition) | 83 | (if (kmacro-p definition) |
| 96 | (let ((vecdef (kmacro--keys definition)) | 84 | (let ((vecdef (kmacro--keys definition)) |
| 97 | (counter (kmacro--counter definition)) | 85 | (counter (kmacro--counter definition)) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 02ceb2979f7..b9639c1e7f7 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -2467,16 +2467,17 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi." | |||
| 2467 | (delete-dups | 2467 | (delete-dups |
| 2468 | (mapcar | 2468 | (mapcar |
| 2469 | (lambda (x) | 2469 | (lambda (x) |
| 2470 | (let* ((list (split-string x ";")) | 2470 | (ignore-errors |
| 2471 | (host (nth 6 list)) | 2471 | (let* ((list (split-string x ";")) |
| 2472 | (text (split-string (nth 9 list) "\" \"" 'omit "\"")) | 2472 | (host (nth 6 list)) |
| 2473 | user) | 2473 | (text (split-string (nth 9 list) "\" \"" 'omit "\"")) |
| 2474 | ;; A user is marked in a TXT field like "u=guest". | 2474 | user) |
| 2475 | (while text | 2475 | ;; A user is marked in a TXT field like "u=guest". |
| 2476 | (when (string-match (rx "u=" (group (+ nonl)) eol) (car text)) | 2476 | (while text |
| 2477 | (setq user (match-string 1 (car text)))) | 2477 | (when (string-match (rx "u=" (group (+ nonl)) eol) (car text)) |
| 2478 | (setq text (cdr text))) | 2478 | (setq user (match-string 1 (car text)))) |
| 2479 | (list user host))) | 2479 | (setq text (cdr text))) |
| 2480 | (list user host)))) | ||
| 2480 | result)))) | 2481 | result)))) |
| 2481 | 2482 | ||
| 2482 | (when tramp-gvfs-enabled | 2483 | (when tramp-gvfs-enabled |
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 9b271a7cfbd..ad7bf94cdcd 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el | |||
| @@ -102,7 +102,7 @@ | |||
| 102 | ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2") | 102 | ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2") |
| 103 | ("2.3.5.26.3" . "26.3") | 103 | ("2.3.5.26.3" . "26.3") |
| 104 | ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2") | 104 | ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2") |
| 105 | ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2") | 105 | ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2") ("2.5.4" . "28.3") |
| 106 | ("2.6.0.29.1" . "29.1"))) | 106 | ("2.6.0.29.1" . "29.1"))) |
| 107 | 107 | ||
| 108 | (add-hook 'tramp-unload-hook | 108 | (add-hook 'tramp-unload-hook |
diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index 72df65a2287..85db39aaeae 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el | |||
| @@ -305,6 +305,7 @@ If NODE is nil, return nil." | |||
| 305 | (and parent | 305 | (and parent |
| 306 | (string-match-p (car regexp) | 306 | (string-match-p (car regexp) |
| 307 | (treesit-node-type parent)) | 307 | (treesit-node-type parent)) |
| 308 | (treesit-node-field-name node) | ||
| 308 | (string-match-p (cdr regexp) | 309 | (string-match-p (cdr regexp) |
| 309 | (treesit-node-field-name | 310 | (treesit-node-field-name |
| 310 | node))) | 311 | node))) |
| @@ -313,7 +314,9 @@ If NODE is nil, return nil." | |||
| 313 | nil)) | 314 | nil)) |
| 314 | 315 | ||
| 315 | (defun c-ts-common-statement-offset (node parent &rest _) | 316 | (defun c-ts-common-statement-offset (node parent &rest _) |
| 316 | "This anchor is used for children of a statement inside a block. | 317 | "Return an indent offset for a statement inside a block. |
| 318 | |||
| 319 | Assumes the anchor is (point-min), i.e., the 0th column. | ||
| 317 | 320 | ||
| 318 | This function basically counts the number of block nodes (i.e., | 321 | This function basically counts the number of block nodes (i.e., |
| 319 | brackets) (defined by `c-ts-common-indent-block-type-regexp') | 322 | brackets) (defined by `c-ts-common-indent-block-type-regexp') |
| @@ -324,6 +327,9 @@ To support GNU style, on each block level, this function also | |||
| 324 | checks whether the opening bracket { is on its own line, if so, | 327 | checks whether the opening bracket { is on its own line, if so, |
| 325 | it adds an extra level, except for the top-level. | 328 | it adds an extra level, except for the top-level. |
| 326 | 329 | ||
| 330 | It also has special handling for bracketless statements and | ||
| 331 | else-if statements, which see. | ||
| 332 | |||
| 327 | PARENT is NODE's parent, BOL is the beginning of non-whitespace | 333 | PARENT is NODE's parent, BOL is the beginning of non-whitespace |
| 328 | characters on the current line." | 334 | characters on the current line." |
| 329 | (let ((level 0)) | 335 | (let ((level 0)) |
| @@ -363,7 +369,13 @@ characters on the current line." | |||
| 363 | (cl-incf level)) | 369 | (cl-incf level)) |
| 364 | ;; Flatten "else if" statements. | 370 | ;; Flatten "else if" statements. |
| 365 | (when (and (c-ts-common--node-is node 'else) | 371 | (when (and (c-ts-common--node-is node 'else) |
| 366 | (c-ts-common--node-is node 'if)) | 372 | (c-ts-common--node-is node 'if) |
| 373 | ;; But if the "if" is on it's own line, still | ||
| 374 | ;; indent a level. | ||
| 375 | (not (save-excursion | ||
| 376 | (goto-char (treesit-node-start node)) | ||
| 377 | (looking-back (rx bol (* whitespace)) | ||
| 378 | (line-beginning-position))))) | ||
| 367 | (cl-decf level))) | 379 | (cl-decf level))) |
| 368 | ;; Go up the tree. | 380 | ;; Go up the tree. |
| 369 | (setq node (treesit-node-parent node))) | 381 | (setq node (treesit-node-parent node))) |
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index b7a487687a8..035df909eb2 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el | |||
| @@ -252,6 +252,33 @@ is actually the parent of point at the moment of indentation." | |||
| 252 | 0 | 252 | 0 |
| 253 | c-ts-mode-indent-offset))) | 253 | c-ts-mode-indent-offset))) |
| 254 | 254 | ||
| 255 | (defun c-ts-mode--anchor-prev-sibling (node &rest _) | ||
| 256 | "Return the start of the previous named sibling of NODE. | ||
| 257 | |||
| 258 | This anchor handles the special case where the previous sibling | ||
| 259 | is a labeled_statement, in that case, return the child of the | ||
| 260 | labeled statement instead. (Actually, recursively go down until | ||
| 261 | the node isn't a labeled_statement.) Eg, | ||
| 262 | |||
| 263 | label: | ||
| 264 | int x = 1; | ||
| 265 | int y = 2; | ||
| 266 | |||
| 267 | The anchor of \"int y = 2;\" should be \"int x = 1;\" rather than | ||
| 268 | the labeled_statement. | ||
| 269 | |||
| 270 | Return nil if a) there is no prev-sibling, or 2) prev-sibling | ||
| 271 | doesn't have a child." | ||
| 272 | (when-let ((prev-sibling (treesit-node-prev-sibling node t))) | ||
| 273 | (while (and prev-sibling | ||
| 274 | (equal "labeled_statement" | ||
| 275 | (treesit-node-type prev-sibling))) | ||
| 276 | ;; The 0th child is the label, the 1th the colon. | ||
| 277 | (setq prev-sibling (treesit-node-child prev-sibling 2))) | ||
| 278 | ;; This could be nil if a) there is no prev-sibling or b) | ||
| 279 | ;; prev-sibling doesn't have a child. | ||
| 280 | (treesit-node-start prev-sibling))) | ||
| 281 | |||
| 255 | (defun c-ts-mode--indent-styles (mode) | 282 | (defun c-ts-mode--indent-styles (mode) |
| 256 | "Indent rules supported by `c-ts-mode'. | 283 | "Indent rules supported by `c-ts-mode'. |
| 257 | MODE is either `c' or `cpp'." | 284 | MODE is either `c' or `cpp'." |
| @@ -277,13 +304,6 @@ MODE is either `c' or `cpp'." | |||
| 277 | ((parent-is "labeled_statement") | 304 | ((parent-is "labeled_statement") |
| 278 | point-min c-ts-common-statement-offset) | 305 | point-min c-ts-common-statement-offset) |
| 279 | 306 | ||
| 280 | ;; Bracketless statement matchers. | ||
| 281 | ((match nil "while_statement" "condition") parent-bol c-ts-mode-indent-offset) | ||
| 282 | ((match nil "if_statement" "consequence") parent-bol c-ts-mode-indent-offset) | ||
| 283 | ((match nil "if_statement" "alternative") parent-bol c-ts-mode-indent-offset) | ||
| 284 | ((match nil "do_statement" "body") parent-bol c-ts-mode-indent-offset) | ||
| 285 | ((match nil "for_statement" "body") parent-bol c-ts-mode-indent-offset) | ||
| 286 | |||
| 287 | ((node-is "preproc") point-min 0) | 307 | ((node-is "preproc") point-min 0) |
| 288 | ((node-is "#endif") point-min 0) | 308 | ((node-is "#endif") point-min 0) |
| 289 | ((match "preproc_call" "compound_statement") point-min 0) | 309 | ((match "preproc_call" "compound_statement") point-min 0) |
| @@ -318,14 +338,18 @@ MODE is either `c' or `cpp'." | |||
| 318 | 338 | ||
| 319 | 339 | ||
| 320 | ;; int[5] a = { 0, 0, 0, 0 }; | 340 | ;; int[5] a = { 0, 0, 0, 0 }; |
| 321 | ((parent-is "initializer_list") parent-bol c-ts-mode-indent-offset) | 341 | ((match nil "initializer_list" nil 1 1) parent-bol c-ts-mode-indent-offset) |
| 342 | ((match nil "initializer_list" nil 2) c-ts-mode--anchor-prev-sibling 0) | ||
| 322 | ;; Statement in enum. | 343 | ;; Statement in enum. |
| 323 | ((parent-is "enumerator_list") point-min c-ts-common-statement-offset) | 344 | ((match nil "enumerator_list" nil 1 1) point-min c-ts-common-statement-offset) |
| 345 | ((match nil "enumerator_list" nil 2) c-ts-mode--anchor-prev-sibling 0) | ||
| 324 | ;; Statement in struct and union. | 346 | ;; Statement in struct and union. |
| 325 | ((parent-is "field_declaration_list") point-min c-ts-common-statement-offset) | 347 | ((match nil "field_declaration_list" nil 1 1) point-min c-ts-common-statement-offset) |
| 348 | ((match nil "field_declaration_list" nil 2) c-ts-mode--anchor-prev-sibling 0) | ||
| 326 | 349 | ||
| 327 | ;; Statement in {} blocks. | 350 | ;; Statement in {} blocks. |
| 328 | ((parent-is "compound_statement") point-min c-ts-common-statement-offset) | 351 | ((match nil "compound_statement" nil 1 1) point-min c-ts-common-statement-offset) |
| 352 | ((match nil "compound_statement" nil 2) c-ts-mode--anchor-prev-sibling 0) | ||
| 329 | ;; Opening bracket. | 353 | ;; Opening bracket. |
| 330 | ((node-is "compound_statement") point-min c-ts-common-statement-offset) | 354 | ((node-is "compound_statement") point-min c-ts-common-statement-offset) |
| 331 | ;; Bug#61291. | 355 | ;; Bug#61291. |
| @@ -506,7 +530,10 @@ MODE is either `c' or `cpp'." | |||
| 506 | declarator: (_) @c-ts-mode--fontify-declarator) | 530 | declarator: (_) @c-ts-mode--fontify-declarator) |
| 507 | 531 | ||
| 508 | (parameter_declaration | 532 | (parameter_declaration |
| 509 | declarator: (_) @c-ts-mode--fontify-declarator)) | 533 | declarator: (_) @c-ts-mode--fontify-declarator) |
| 534 | |||
| 535 | (enumerator | ||
| 536 | name: (identifier) @font-lock-property-name-face)) | ||
| 510 | 537 | ||
| 511 | :language mode | 538 | :language mode |
| 512 | :feature 'assignment | 539 | :feature 'assignment |
| @@ -516,7 +543,7 @@ MODE is either `c' or `cpp'." | |||
| 516 | '((assignment_expression | 543 | '((assignment_expression |
| 517 | left: (identifier) @font-lock-variable-name-face) | 544 | left: (identifier) @font-lock-variable-name-face) |
| 518 | (assignment_expression | 545 | (assignment_expression |
| 519 | left: (field_expression field: (_) @font-lock-property-face)) | 546 | left: (field_expression field: (_) @font-lock-property-ref-face)) |
| 520 | (assignment_expression | 547 | (assignment_expression |
| 521 | left: (pointer_expression | 548 | left: (pointer_expression |
| 522 | (identifier) @font-lock-variable-name-face)) | 549 | (identifier) @font-lock-variable-name-face)) |
| @@ -529,8 +556,8 @@ MODE is either `c' or `cpp'." | |||
| 529 | :feature 'function | 556 | :feature 'function |
| 530 | '((call_expression | 557 | '((call_expression |
| 531 | function: | 558 | function: |
| 532 | [(identifier) @font-lock-function-name-face | 559 | [(identifier) @font-lock-function-call-face |
| 533 | (field_expression field: (field_identifier) @font-lock-function-name-face)])) | 560 | (field_expression field: (field_identifier) @font-lock-function-call-face)])) |
| 534 | 561 | ||
| 535 | :language mode | 562 | :language mode |
| 536 | :feature 'variable | 563 | :feature 'variable |
| @@ -552,9 +579,7 @@ MODE is either `c' or `cpp'." | |||
| 552 | 579 | ||
| 553 | :language mode | 580 | :language mode |
| 554 | :feature 'property | 581 | :feature 'property |
| 555 | '((field_identifier) @font-lock-property-face | 582 | '((field_identifier) @font-lock-property-ref-face) |
| 556 | (enumerator | ||
| 557 | name: (identifier) @font-lock-property-face)) | ||
| 558 | 583 | ||
| 559 | :language mode | 584 | :language mode |
| 560 | :feature 'bracket | 585 | :feature 'bracket |
| @@ -614,6 +639,7 @@ For NODE, OVERRIDE, START, END, and ARGS, see | |||
| 614 | (face (pcase (treesit-node-type (treesit-node-parent | 639 | (face (pcase (treesit-node-type (treesit-node-parent |
| 615 | (or qualified-root | 640 | (or qualified-root |
| 616 | identifier))) | 641 | identifier))) |
| 642 | ("field_declaration" 'font-lock-property-name-face) | ||
| 617 | ("function_declarator" 'font-lock-function-name-face) | 643 | ("function_declarator" 'font-lock-function-name-face) |
| 618 | (_ 'font-lock-variable-name-face)))) | 644 | (_ 'font-lock-variable-name-face)))) |
| 619 | (when identifier | 645 | (when identifier |
| @@ -630,7 +656,7 @@ OVERRIDE, START, END, and ARGS, see `treesit-font-lock-rules'." | |||
| 630 | "call_expression")) | 656 | "call_expression")) |
| 631 | (treesit-fontify-with-override | 657 | (treesit-fontify-with-override |
| 632 | (treesit-node-start node) (treesit-node-end node) | 658 | (treesit-node-start node) (treesit-node-end node) |
| 633 | 'font-lock-variable-name-face override start end))) | 659 | 'font-lock-variable-ref-face override start end))) |
| 634 | 660 | ||
| 635 | (defun c-ts-mode--fontify-defun (node override start end &rest _) | 661 | (defun c-ts-mode--fontify-defun (node override start end &rest _) |
| 636 | "Correctly fontify the DEFUN macro. | 662 | "Correctly fontify the DEFUN macro. |
diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index 04f5d6bdac8..a3f9279ec1c 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el | |||
| @@ -125,7 +125,7 @@ | |||
| 125 | 125 | ||
| 126 | :language 'cmake | 126 | :language 'cmake |
| 127 | :feature 'function | 127 | :feature 'function |
| 128 | '((normal_command (identifier) @font-lock-function-name-face)) | 128 | '((normal_command (identifier) @font-lock-function-call-face)) |
| 129 | 129 | ||
| 130 | :language 'cmake | 130 | :language 'cmake |
| 131 | :feature 'keyword | 131 | :feature 'keyword |
| @@ -154,7 +154,7 @@ | |||
| 154 | :language 'cmake | 154 | :language 'cmake |
| 155 | :feature 'variable | 155 | :feature 'variable |
| 156 | :override t | 156 | :override t |
| 157 | '((variable) @font-lock-variable-name-face) | 157 | '((variable) @font-lock-variable-ref-face) |
| 158 | 158 | ||
| 159 | :language 'cmake | 159 | :language 'cmake |
| 160 | :feature 'error | 160 | :feature 'error |
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 239c85ce25f..4ed8b0368b5 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el | |||
| @@ -708,9 +708,9 @@ compilation and evaluation time conflicts." | |||
| 708 | (treesit-font-lock-rules | 708 | (treesit-font-lock-rules |
| 709 | :language 'c-sharp | 709 | :language 'c-sharp |
| 710 | :feature 'expression | 710 | :feature 'expression |
| 711 | '((conditional_expression (identifier) @font-lock-variable-name-face) | 711 | '((conditional_expression (identifier) @font-lock-variable-ref-face) |
| 712 | (postfix_unary_expression (identifier)* @font-lock-variable-name-face) | 712 | (postfix_unary_expression (identifier)* @font-lock-variable-ref-face) |
| 713 | (initializer_expression (assignment_expression left: (identifier) @font-lock-variable-name-face))) | 713 | (initializer_expression (assignment_expression left: (identifier) @font-lock-variable-ref-face))) |
| 714 | 714 | ||
| 715 | :language 'c-sharp | 715 | :language 'c-sharp |
| 716 | :feature 'bracket | 716 | :feature 'bracket |
| @@ -739,8 +739,8 @@ compilation and evaluation time conflicts." | |||
| 739 | :language 'c-sharp | 739 | :language 'c-sharp |
| 740 | :override t | 740 | :override t |
| 741 | :feature 'property | 741 | :feature 'property |
| 742 | `((attribute (identifier) @font-lock-property-face (attribute_argument_list)) | 742 | `((attribute (identifier) @font-lock-property-ref-face (attribute_argument_list)) |
| 743 | (attribute (identifier) @font-lock-property-face)) | 743 | (attribute (identifier) @font-lock-property-ref-face)) |
| 744 | 744 | ||
| 745 | :language 'c-sharp | 745 | :language 'c-sharp |
| 746 | :override t | 746 | :override t |
| @@ -859,14 +859,14 @@ compilation and evaluation time conflicts." | |||
| 859 | :feature 'function | 859 | :feature 'function |
| 860 | '((invocation_expression | 860 | '((invocation_expression |
| 861 | function: (member_access_expression | 861 | function: (member_access_expression |
| 862 | name: (identifier) @font-lock-function-name-face)) | 862 | name: (identifier) @font-lock-function-call-face)) |
| 863 | (invocation_expression | 863 | (invocation_expression |
| 864 | function: (identifier) @font-lock-function-name-face) | 864 | function: (identifier) @font-lock-function-call-face) |
| 865 | (invocation_expression | 865 | (invocation_expression |
| 866 | function: (member_access_expression | 866 | function: (member_access_expression |
| 867 | name: (generic_name (identifier) @font-lock-function-name-face))) | 867 | name: (generic_name (identifier) @font-lock-function-call-face))) |
| 868 | (invocation_expression | 868 | (invocation_expression |
| 869 | function: (generic_name (identifier) @font-lock-function-name-face))) | 869 | function: (generic_name (identifier) @font-lock-function-call-face))) |
| 870 | 870 | ||
| 871 | :language 'c-sharp | 871 | :language 'c-sharp |
| 872 | :feature 'escape-sequence | 872 | :feature 'escape-sequence |
| @@ -878,23 +878,23 @@ compilation and evaluation time conflicts." | |||
| 878 | :override t | 878 | :override t |
| 879 | '((if_directive | 879 | '((if_directive |
| 880 | "if" @font-lock-preprocessor-face | 880 | "if" @font-lock-preprocessor-face |
| 881 | (identifier) @font-lock-variable-name-face) | 881 | (identifier) @font-lock-variable-ref-face) |
| 882 | (elif_directive | 882 | (elif_directive |
| 883 | "elif" @font-lock-preprocessor-face | 883 | "elif" @font-lock-preprocessor-face |
| 884 | (identifier) @font-lock-variable-name-face) | 884 | (identifier) @font-lock-variable-ref-face) |
| 885 | (else_directive) @font-lock-preprocessor-face | 885 | (else_directive) @font-lock-preprocessor-face |
| 886 | (endif_directive) @font-lock-preprocessor-face | 886 | (endif_directive) @font-lock-preprocessor-face |
| 887 | (define_directive | 887 | (define_directive |
| 888 | "define" @font-lock-preprocessor-face | 888 | "define" @font-lock-preprocessor-face |
| 889 | (identifier) @font-lock-variable-name-face) | 889 | (identifier) @font-lock-variable-ref-face) |
| 890 | (nullable_directive) @font-lock-preprocessor-face | 890 | (nullable_directive) @font-lock-preprocessor-face |
| 891 | (pragma_directive) @font-lock-preprocessor-face | 891 | (pragma_directive) @font-lock-preprocessor-face |
| 892 | (region_directive) @font-lock-preprocessor-face | 892 | (region_directive) @font-lock-preprocessor-face |
| 893 | (endregion_directive) @font-lock-preprocessor-face | 893 | (endregion_directive) @font-lock-preprocessor-face |
| 894 | (region_directive | 894 | (region_directive |
| 895 | (preproc_message) @font-lock-variable-name-face) | 895 | (preproc_message) @font-lock-variable-ref-face) |
| 896 | (endregion_directive | 896 | (endregion_directive |
| 897 | (preproc_message) @font-lock-variable-name-face)))) | 897 | (preproc_message) @font-lock-variable-ref-face)))) |
| 898 | 898 | ||
| 899 | ;;;###autoload | 899 | ;;;###autoload |
| 900 | (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-mode)) | 900 | (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-mode)) |
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4a09da65e53..d0e899cbed5 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el | |||
| @@ -3492,12 +3492,15 @@ If NOERROR, return predicate, else erroring function." | |||
| 3492 | (defvar-local eglot--outstanding-inlay-hints-region (cons nil nil) | 3492 | (defvar-local eglot--outstanding-inlay-hints-region (cons nil nil) |
| 3493 | "Jit-lock-calculated (FROM . TO) region with potentially outdated hints") | 3493 | "Jit-lock-calculated (FROM . TO) region with potentially outdated hints") |
| 3494 | 3494 | ||
| 3495 | (defvar-local eglot--outstanding-inlay-hints-last-region nil) | ||
| 3496 | |||
| 3495 | (defvar-local eglot--outstanding-inlay-regions-timer nil | 3497 | (defvar-local eglot--outstanding-inlay-regions-timer nil |
| 3496 | "Helper timer for `eglot--update-hints'") | 3498 | "Helper timer for `eglot--update-hints'") |
| 3497 | 3499 | ||
| 3498 | (defun eglot--update-hints (from to) | 3500 | (defun eglot--update-hints (from to) |
| 3499 | "Jit-lock function for Eglot inlay hints." | 3501 | "Jit-lock function for Eglot inlay hints." |
| 3500 | (cl-symbol-macrolet ((region eglot--outstanding-inlay-hints-region) | 3502 | (cl-symbol-macrolet ((region eglot--outstanding-inlay-hints-region) |
| 3503 | (last-region eglot--outstanding-inlay-hints-last-region) | ||
| 3501 | (timer eglot--outstanding-inlay-regions-timer)) | 3504 | (timer eglot--outstanding-inlay-regions-timer)) |
| 3502 | (setcar region (min (or (car region) (point-max)) from)) | 3505 | (setcar region (min (or (car region) (point-max)) from)) |
| 3503 | (setcdr region (max (or (cdr region) (point-min)) to)) | 3506 | (setcdr region (max (or (cdr region) (point-min)) to)) |
| @@ -3513,12 +3516,28 @@ If NOERROR, return predicate, else erroring function." | |||
| 3513 | ;; not introducing any more delay over jit-lock's timers. | 3516 | ;; not introducing any more delay over jit-lock's timers. |
| 3514 | (when (= jit-lock-context-unfontify-pos (point-max)) | 3517 | (when (= jit-lock-context-unfontify-pos (point-max)) |
| 3515 | (if timer (cancel-timer timer)) | 3518 | (if timer (cancel-timer timer)) |
| 3516 | (setq timer (run-at-time | 3519 | (let ((buf (current-buffer))) |
| 3517 | 0 nil | 3520 | (setq timer (run-at-time |
| 3518 | (lambda () | 3521 | 0 nil |
| 3519 | (eglot--update-hints-1 (max (car region) (point-min)) | 3522 | (lambda () |
| 3520 | (min (cdr region) (point-max))) | 3523 | (eglot--when-live-buffer buf |
| 3521 | (setq region (cons nil nil) timer nil))))))) | 3524 | ;; HACK: In some pathological situations |
| 3525 | ;; (Emacs's own coding.c, for example), | ||
| 3526 | ;; jit-lock is calling `eglot--update-hints' | ||
| 3527 | ;; repeatedly with same sequence of | ||
| 3528 | ;; arguments, which leads to | ||
| 3529 | ;; `eglot--update-hints-1' being called with | ||
| 3530 | ;; the same region repeatedly. This happens | ||
| 3531 | ;; even if the hint-painting code does | ||
| 3532 | ;; nothing else other than widen, narrow, | ||
| 3533 | ;; move point then restore these things. | ||
| 3534 | ;; Possible Emacs bug, but this fixes it. | ||
| 3535 | (unless (equal last-region region) | ||
| 3536 | (eglot--update-hints-1 (max (car region) (point-min)) | ||
| 3537 | (min (cdr region) (point-max))) | ||
| 3538 | (setq last-region region)) | ||
| 3539 | (setq region (cons nil nil) | ||
| 3540 | timer nil))))))))) | ||
| 3522 | 3541 | ||
| 3523 | (defun eglot--update-hints-1 (from to) | 3542 | (defun eglot--update-hints-1 (from to) |
| 3524 | "Do most work for `eglot--update-hints', including LSP request." | 3543 | "Do most work for `eglot--update-hints', including LSP request." |
| @@ -3529,7 +3548,8 @@ If NOERROR, return predicate, else erroring function." | |||
| 3529 | (let ((ov (make-overlay (point) (point))) | 3548 | (let ((ov (make-overlay (point) (point))) |
| 3530 | (left-pad (and paddingLeft (not (memq (char-before) '(32 9))))) | 3549 | (left-pad (and paddingLeft (not (memq (char-before) '(32 9))))) |
| 3531 | (right-pad (and paddingRight (not (memq (char-after) '(32 9))))) | 3550 | (right-pad (and paddingRight (not (memq (char-after) '(32 9))))) |
| 3532 | (text (if (stringp label) label (plist-get label :value)))) | 3551 | (text (if (stringp label) |
| 3552 | label (plist-get (elt label 0) :value)))) | ||
| 3533 | (overlay-put ov 'before-string | 3553 | (overlay-put ov 'before-string |
| 3534 | (propertize | 3554 | (propertize |
| 3535 | (concat (and left-pad " ") text (and right-pad " ")) | 3555 | (concat (and left-pad " ") text (and right-pad " ")) |
diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 2a2783f45f6..0e019f5bad9 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el | |||
| @@ -134,7 +134,7 @@ | |||
| 134 | (method_spec | 134 | (method_spec |
| 135 | name: (field_identifier) @font-lock-function-name-face) | 135 | name: (field_identifier) @font-lock-function-name-face) |
| 136 | (field_declaration | 136 | (field_declaration |
| 137 | name: (field_identifier) @font-lock-property-face) | 137 | name: (field_identifier) @font-lock-property-name-face) |
| 138 | (parameter_declaration | 138 | (parameter_declaration |
| 139 | name: (identifier) @font-lock-variable-name-face) | 139 | name: (identifier) @font-lock-variable-name-face) |
| 140 | (short_var_declaration | 140 | (short_var_declaration |
| @@ -147,10 +147,10 @@ | |||
| 147 | :language 'go | 147 | :language 'go |
| 148 | :feature 'function | 148 | :feature 'function |
| 149 | '((call_expression | 149 | '((call_expression |
| 150 | function: (identifier) @font-lock-function-name-face) | 150 | function: (identifier) @font-lock-function-call-face) |
| 151 | (call_expression | 151 | (call_expression |
| 152 | function: (selector_expression | 152 | function: (selector_expression |
| 153 | field: (field_identifier) @font-lock-function-name-face))) | 153 | field: (field_identifier) @font-lock-function-call-face))) |
| 154 | 154 | ||
| 155 | :language 'go | 155 | :language 'go |
| 156 | :feature 'keyword | 156 | :feature 'keyword |
| @@ -178,12 +178,12 @@ | |||
| 178 | 178 | ||
| 179 | :language 'go | 179 | :language 'go |
| 180 | :feature 'property | 180 | :feature 'property |
| 181 | '((field_identifier) @font-lock-property-face | 181 | '((selector_expression field: (field_identifier) @font-lock-property-ref-face) |
| 182 | (keyed_element (_ (identifier) @font-lock-property-face))) | 182 | (keyed_element (_ (identifier) @font-lock-property-ref-face))) |
| 183 | 183 | ||
| 184 | :language 'go | 184 | :language 'go |
| 185 | :feature 'variable | 185 | :feature 'variable |
| 186 | '((identifier) @font-lock-variable-name-face) | 186 | '((identifier) @font-lock-variable-ref-face) |
| 187 | 187 | ||
| 188 | :language 'go | 188 | :language 'go |
| 189 | :feature 'escape-sequence | 189 | :feature 'escape-sequence |
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 0560cc33244..54ed8b4277d 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el | |||
| @@ -220,7 +220,7 @@ | |||
| 220 | 220 | ||
| 221 | (method_reference (identifier) @font-lock-type-face) | 221 | (method_reference (identifier) @font-lock-type-face) |
| 222 | 222 | ||
| 223 | (scoped_identifier (identifier) @font-lock-variable-name-face) | 223 | (scoped_identifier (identifier) @font-lock-constant-face) |
| 224 | 224 | ||
| 225 | ((scoped_identifier name: (identifier) @font-lock-type-face) | 225 | ((scoped_identifier name: (identifier) @font-lock-type-face) |
| 226 | (:match "^[A-Z]" @font-lock-type-face)) | 226 | (:match "^[A-Z]" @font-lock-type-face)) |
| @@ -244,7 +244,7 @@ | |||
| 244 | name: (identifier) @font-lock-variable-name-face) | 244 | name: (identifier) @font-lock-variable-name-face) |
| 245 | 245 | ||
| 246 | (element_value_pair | 246 | (element_value_pair |
| 247 | key: (identifier) @font-lock-property-face) | 247 | key: (identifier) @font-lock-property-ref-face) |
| 248 | 248 | ||
| 249 | (formal_parameter | 249 | (formal_parameter |
| 250 | name: (identifier) @font-lock-variable-name-face) | 250 | name: (identifier) @font-lock-variable-name-face) |
| @@ -255,14 +255,14 @@ | |||
| 255 | :override t | 255 | :override t |
| 256 | :feature 'expression | 256 | :feature 'expression |
| 257 | '((method_invocation | 257 | '((method_invocation |
| 258 | object: (identifier) @font-lock-variable-name-face) | 258 | object: (identifier) @font-lock-variable-ref-face) |
| 259 | 259 | ||
| 260 | (method_invocation | 260 | (method_invocation |
| 261 | name: (identifier) @font-lock-function-name-face) | 261 | name: (identifier) @font-lock-function-call-face) |
| 262 | 262 | ||
| 263 | (argument_list (identifier) @font-lock-variable-name-face) | 263 | (argument_list (identifier) @font-lock-variable-name-face) |
| 264 | 264 | ||
| 265 | (expression_statement (identifier) @font-lock-variable-name-face)) | 265 | (expression_statement (identifier) @font-lock-variable-ref-face)) |
| 266 | 266 | ||
| 267 | :language 'java | 267 | :language 'java |
| 268 | :feature 'bracket | 268 | :feature 'bracket |
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index dc49d7e818c..93298f4fb6e 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -3544,11 +3544,10 @@ This function is intended for use in `after-change-functions'." | |||
| 3544 | value: [(function) (arrow_function)]) | 3544 | value: [(function) (arrow_function)]) |
| 3545 | 3545 | ||
| 3546 | (variable_declarator | 3546 | (variable_declarator |
| 3547 | name: (array_pattern | 3547 | name: [(array_pattern (identifier) @font-lock-variable-name-face) |
| 3548 | (identifier) | 3548 | (object_pattern |
| 3549 | (identifier) | 3549 | (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) |
| 3550 | @font-lock-function-name-face) | 3550 | |
| 3551 | value: (array (number) (function))) | ||
| 3552 | ;; full module imports | 3551 | ;; full module imports |
| 3553 | (import_clause (identifier) @font-lock-variable-name-face) | 3552 | (import_clause (identifier) @font-lock-variable-name-face) |
| 3554 | ;; named imports with aliasing | 3553 | ;; named imports with aliasing |
| @@ -3564,15 +3563,13 @@ This function is intended for use in `after-change-functions'." | |||
| 3564 | 3563 | ||
| 3565 | :language 'javascript | 3564 | :language 'javascript |
| 3566 | :feature 'property | 3565 | :feature 'property |
| 3567 | '(((property_identifier) @font-lock-property-face | 3566 | '(((property_identifier) @font-lock-property-ref-face |
| 3568 | (:pred js--treesit-property-not-function-p | 3567 | (:pred js--treesit-property-not-function-p |
| 3569 | @font-lock-property-face)) | 3568 | @font-lock-property-ref-face)) |
| 3570 | |||
| 3571 | (pair value: (identifier) @font-lock-variable-name-face) | ||
| 3572 | 3569 | ||
| 3573 | ((shorthand_property_identifier) @font-lock-property-face) | 3570 | (pair value: (identifier) @font-lock-variable-ref-face) |
| 3574 | 3571 | ||
| 3575 | ((shorthand_property_identifier_pattern) @font-lock-property-face)) | 3572 | ((shorthand_property_identifier) @font-lock-property-ref-face)) |
| 3576 | 3573 | ||
| 3577 | :language 'javascript | 3574 | :language 'javascript |
| 3578 | :feature 'assignment | 3575 | :feature 'assignment |
| @@ -3582,14 +3579,14 @@ This function is intended for use in `after-change-functions'." | |||
| 3582 | :language 'javascript | 3579 | :language 'javascript |
| 3583 | :feature 'function | 3580 | :feature 'function |
| 3584 | '((call_expression | 3581 | '((call_expression |
| 3585 | function: [(identifier) @font-lock-function-name-face | 3582 | function: [(identifier) @font-lock-function-call-face |
| 3586 | (member_expression | 3583 | (member_expression |
| 3587 | property: | 3584 | property: |
| 3588 | (property_identifier) @font-lock-function-name-face)]) | 3585 | (property_identifier) @font-lock-function-call-face)]) |
| 3589 | (method_definition | 3586 | (method_definition |
| 3590 | name: (property_identifier) @font-lock-function-name-face) | 3587 | name: (property_identifier) @font-lock-function-name-face) |
| 3591 | (function_declaration | 3588 | (function_declaration |
| 3592 | name: (identifier) @font-lock-function-name-face) | 3589 | name: (identifier) @font-lock-function-call-face) |
| 3593 | (function | 3590 | (function |
| 3594 | name: (identifier) @font-lock-function-name-face)) | 3591 | name: (identifier) @font-lock-function-name-face)) |
| 3595 | 3592 | ||
| @@ -3597,15 +3594,15 @@ This function is intended for use in `after-change-functions'." | |||
| 3597 | :feature 'jsx | 3594 | :feature 'jsx |
| 3598 | '((jsx_opening_element | 3595 | '((jsx_opening_element |
| 3599 | [(nested_identifier (identifier)) (identifier)] | 3596 | [(nested_identifier (identifier)) (identifier)] |
| 3600 | @font-lock-function-name-face) | 3597 | @font-lock-function-call-face) |
| 3601 | 3598 | ||
| 3602 | (jsx_closing_element | 3599 | (jsx_closing_element |
| 3603 | [(nested_identifier (identifier)) (identifier)] | 3600 | [(nested_identifier (identifier)) (identifier)] |
| 3604 | @font-lock-function-name-face) | 3601 | @font-lock-function-call-face) |
| 3605 | 3602 | ||
| 3606 | (jsx_self_closing_element | 3603 | (jsx_self_closing_element |
| 3607 | [(nested_identifier (identifier)) (identifier)] | 3604 | [(nested_identifier (identifier)) (identifier)] |
| 3608 | @font-lock-function-name-face) | 3605 | @font-lock-function-call-face) |
| 3609 | 3606 | ||
| 3610 | (jsx_attribute | 3607 | (jsx_attribute |
| 3611 | (property_identifier) | 3608 | (property_identifier) |
| @@ -3684,8 +3681,8 @@ For OVERRIDE, START, END, see `treesit-font-lock-rules'." | |||
| 3684 | (treesit-fontify-with-override | 3681 | (treesit-fontify-with-override |
| 3685 | (treesit-node-start node) (treesit-node-end node) | 3682 | (treesit-node-start node) (treesit-node-end node) |
| 3686 | (pcase (treesit-node-type node) | 3683 | (pcase (treesit-node-type node) |
| 3687 | ("identifier" 'font-lock-variable-name-face) | 3684 | ("identifier" 'font-lock-variable-ref-face) |
| 3688 | ("property_identifier" 'font-lock-property-face)) | 3685 | ("property_identifier" 'font-lock-property-ref-face)) |
| 3689 | override start end))) | 3686 | override start end))) |
| 3690 | 3687 | ||
| 3691 | (defun js--treesit-defun-name (node) | 3688 | (defun js--treesit-defun-name (node) |
diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 6bd9d30328e..c5979b9a14c 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el | |||
| @@ -101,7 +101,7 @@ | |||
| 101 | :language 'json | 101 | :language 'json |
| 102 | :feature 'pair | 102 | :feature 'pair |
| 103 | :override t ; Needed for overriding string face on keys. | 103 | :override t ; Needed for overriding string face on keys. |
| 104 | '((pair key: (_) @font-lock-variable-name-face)) | 104 | '((pair key: (_) @font-lock-property-ref-face)) |
| 105 | :language 'json | 105 | :language 'json |
| 106 | :feature 'error | 106 | :feature 'error |
| 107 | :override t | 107 | :override t |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index eab5e70af33..8220e3086fd 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1106,24 +1106,25 @@ fontified." | |||
| 1106 | :language 'python | 1106 | :language 'python |
| 1107 | '((interpolation) @python--treesit-fontify-string-interpolation) | 1107 | '((interpolation) @python--treesit-fontify-string-interpolation) |
| 1108 | 1108 | ||
| 1109 | :feature 'keyword | ||
| 1110 | :language 'python | ||
| 1111 | `([,@python--treesit-keywords] @font-lock-keyword-face | ||
| 1112 | ((identifier) @font-lock-keyword-face | ||
| 1113 | (:match "^self$" @font-lock-keyword-face))) | ||
| 1114 | |||
| 1109 | :feature 'definition | 1115 | :feature 'definition |
| 1110 | :language 'python | 1116 | :language 'python |
| 1111 | '((function_definition | 1117 | '((function_definition |
| 1112 | name: (identifier) @font-lock-function-name-face) | 1118 | name: (identifier) @font-lock-function-name-face) |
| 1113 | (class_definition | 1119 | (class_definition |
| 1114 | name: (identifier) @font-lock-type-face)) | 1120 | name: (identifier) @font-lock-type-face) |
| 1121 | (parameters (identifier) @font-lock-variable-name-face)) | ||
| 1115 | 1122 | ||
| 1116 | :feature 'function | 1123 | :feature 'function |
| 1117 | :language 'python | 1124 | :language 'python |
| 1118 | '((call function: (identifier) @font-lock-function-name-face) | 1125 | '((call function: (identifier) @font-lock-function-call-face) |
| 1119 | (call function: (attribute | 1126 | (call function: (attribute |
| 1120 | attribute: (identifier) @font-lock-function-name-face))) | 1127 | attribute: (identifier) @font-lock-function-call-face))) |
| 1121 | |||
| 1122 | :feature 'keyword | ||
| 1123 | :language 'python | ||
| 1124 | `([,@python--treesit-keywords] @font-lock-keyword-face | ||
| 1125 | ((identifier) @font-lock-keyword-face | ||
| 1126 | (:match "^self$" @font-lock-keyword-face))) | ||
| 1127 | 1128 | ||
| 1128 | :feature 'builtin | 1129 | :feature 'builtin |
| 1129 | :language 'python | 1130 | :language 'python |
| @@ -1146,7 +1147,7 @@ fontified." | |||
| 1146 | @font-lock-variable-name-face) | 1147 | @font-lock-variable-name-face) |
| 1147 | (assignment left: (attribute | 1148 | (assignment left: (attribute |
| 1148 | attribute: (identifier) | 1149 | attribute: (identifier) |
| 1149 | @font-lock-property-face)) | 1150 | @font-lock-property-ref-face)) |
| 1150 | (pattern_list (identifier) | 1151 | (pattern_list (identifier) |
| 1151 | @font-lock-variable-name-face) | 1152 | @font-lock-variable-name-face) |
| 1152 | (tuple_pattern (identifier) | 1153 | (tuple_pattern (identifier) |
| @@ -1183,12 +1184,12 @@ fontified." | |||
| 1183 | :feature 'property | 1184 | :feature 'property |
| 1184 | :language 'python | 1185 | :language 'python |
| 1185 | '((attribute | 1186 | '((attribute |
| 1186 | attribute: (identifier) @font-lock-property-face) | 1187 | attribute: (identifier) @font-lock-property-ref-face) |
| 1187 | (class_definition | 1188 | (class_definition |
| 1188 | body: (block | 1189 | body: (block |
| 1189 | (expression_statement | 1190 | (expression_statement |
| 1190 | (assignment left: | 1191 | (assignment left: |
| 1191 | (identifier) @font-lock-property-face))))) | 1192 | (identifier) @font-lock-property-ref-face))))) |
| 1192 | 1193 | ||
| 1193 | :feature 'operator | 1194 | :feature 'operator |
| 1194 | :language 'python | 1195 | :language 'python |
| @@ -1211,10 +1212,10 @@ fontified." | |||
| 1211 | "Check whether NODE is a variable. | 1212 | "Check whether NODE is a variable. |
| 1212 | NODE's type should be \"identifier\"." | 1213 | NODE's type should be \"identifier\"." |
| 1213 | ;; An identifier can be a function/class name, a property, or a | 1214 | ;; An identifier can be a function/class name, a property, or a |
| 1214 | ;; variables. This function filters out function/class names and | 1215 | ;; variables. This function filters out function/class names, |
| 1215 | ;; properties. | 1216 | ;; properties and method parameters. |
| 1216 | (pcase (treesit-node-type (treesit-node-parent node)) | 1217 | (pcase (treesit-node-type (treesit-node-parent node)) |
| 1217 | ((or "function_definition" "class_definition") nil) | 1218 | ((or "function_definition" "class_definition" "parameters") nil) |
| 1218 | ("attribute" | 1219 | ("attribute" |
| 1219 | (pcase (treesit-node-field-name node) | 1220 | (pcase (treesit-node-field-name node) |
| 1220 | ("object" t) | 1221 | ("object" t) |
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index f15387c91bc..f70c0279d3d 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el | |||
| @@ -292,11 +292,11 @@ values of OVERRIDE" | |||
| 292 | 292 | ||
| 293 | :language language | 293 | :language language |
| 294 | :feature 'global | 294 | :feature 'global |
| 295 | '((global_variable) @font-lock-variable-name-face) | 295 | '((global_variable) @font-lock-variable-ref-face) |
| 296 | 296 | ||
| 297 | :language language | 297 | :language language |
| 298 | :feature 'instance | 298 | :feature 'instance |
| 299 | '((instance_variable) @font-lock-variable-name-face) | 299 | '((instance_variable) @font-lock-variable-ref-face) |
| 300 | 300 | ||
| 301 | :language language | 301 | :language language |
| 302 | :feature 'method-definition | 302 | :feature 'method-definition |
| @@ -350,7 +350,7 @@ values of OVERRIDE" | |||
| 350 | :language language | 350 | :language language |
| 351 | :feature 'function | 351 | :feature 'function |
| 352 | '((call | 352 | '((call |
| 353 | method: (identifier) @font-lock-function-name-face)) | 353 | method: (identifier) @font-lock-function-call-face)) |
| 354 | 354 | ||
| 355 | :language language | 355 | :language language |
| 356 | :feature 'assignment | 356 | :feature 'assignment |
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index ee73ebf7a9f..a46d442a0e5 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el | |||
| @@ -157,7 +157,7 @@ | |||
| 157 | '((function_item name: (identifier) @font-lock-function-name-face) | 157 | '((function_item name: (identifier) @font-lock-function-name-face) |
| 158 | (macro_definition "macro_rules!" @font-lock-constant-face) | 158 | (macro_definition "macro_rules!" @font-lock-constant-face) |
| 159 | (macro_definition (identifier) @font-lock-preprocessor-face) | 159 | (macro_definition (identifier) @font-lock-preprocessor-face) |
| 160 | (field_declaration name: (field_identifier) @font-lock-property-face) | 160 | (field_declaration name: (field_identifier) @font-lock-property-name-face) |
| 161 | (parameter pattern: (_) @rust-ts-mode--fontify-pattern) | 161 | (parameter pattern: (_) @rust-ts-mode--fontify-pattern) |
| 162 | (closure_parameters (_) @rust-ts-mode--fontify-pattern) | 162 | (closure_parameters (_) @rust-ts-mode--fontify-pattern) |
| 163 | (let_declaration pattern: (_) @rust-ts-mode--fontify-pattern) | 163 | (let_declaration pattern: (_) @rust-ts-mode--fontify-pattern) |
| @@ -174,17 +174,17 @@ | |||
| 174 | :feature 'function | 174 | :feature 'function |
| 175 | '((call_expression | 175 | '((call_expression |
| 176 | function: | 176 | function: |
| 177 | [(identifier) @font-lock-function-name-face | 177 | [(identifier) @font-lock-function-call-face |
| 178 | (field_expression | 178 | (field_expression |
| 179 | field: (field_identifier) @font-lock-function-name-face) | 179 | field: (field_identifier) @font-lock-function-call-face) |
| 180 | (scoped_identifier | 180 | (scoped_identifier |
| 181 | name: (identifier) @font-lock-function-name-face)]) | 181 | name: (identifier) @font-lock-function-call-face)]) |
| 182 | (generic_function | 182 | (generic_function |
| 183 | function: [(identifier) @font-lock-function-name-face | 183 | function: [(identifier) @font-lock-function-call-face |
| 184 | (field_expression | 184 | (field_expression |
| 185 | field: (field_identifier) @font-lock-function-name-face) | 185 | field: (field_identifier) @font-lock-function-call-face) |
| 186 | (scoped_identifier | 186 | (scoped_identifier |
| 187 | name: (identifier) @font-lock-function-name-face)]) | 187 | name: (identifier) @font-lock-function-call-face)]) |
| 188 | (macro_invocation macro: (identifier) @font-lock-preprocessor-face)) | 188 | (macro_invocation macro: (identifier) @font-lock-preprocessor-face)) |
| 189 | 189 | ||
| 190 | :language 'rust | 190 | :language 'rust |
| @@ -239,8 +239,8 @@ | |||
| 239 | 239 | ||
| 240 | :language 'rust | 240 | :language 'rust |
| 241 | :feature 'property | 241 | :feature 'property |
| 242 | '((field_identifier) @font-lock-property-face | 242 | '((field_identifier) @font-lock-property-ref-face |
| 243 | (shorthand_field_initializer (identifier) @font-lock-property-face)) | 243 | (shorthand_field_initializer (identifier) @font-lock-property-ref-face)) |
| 244 | 244 | ||
| 245 | ;; Must be under type, otherwise some imports can be highlighted as constants. | 245 | ;; Must be under type, otherwise some imports can be highlighted as constants. |
| 246 | :language 'rust | 246 | :language 'rust |
| @@ -251,25 +251,25 @@ | |||
| 251 | 251 | ||
| 252 | :language 'rust | 252 | :language 'rust |
| 253 | :feature 'variable | 253 | :feature 'variable |
| 254 | '((arguments (identifier) @font-lock-variable-name-face) | 254 | '((arguments (identifier) @font-lock-variable-ref-face) |
| 255 | (array_expression (identifier) @font-lock-variable-name-face) | 255 | (array_expression (identifier) @font-lock-variable-ref-face) |
| 256 | (assignment_expression right: (identifier) @font-lock-variable-name-face) | 256 | (assignment_expression right: (identifier) @font-lock-variable-ref-face) |
| 257 | (binary_expression left: (identifier) @font-lock-variable-name-face) | 257 | (binary_expression left: (identifier) @font-lock-variable-ref-face) |
| 258 | (binary_expression right: (identifier) @font-lock-variable-name-face) | 258 | (binary_expression right: (identifier) @font-lock-variable-ref-face) |
| 259 | (block (identifier) @font-lock-variable-name-face) | 259 | (block (identifier) @font-lock-variable-ref-face) |
| 260 | (compound_assignment_expr right: (identifier) @font-lock-variable-name-face) | 260 | (compound_assignment_expr right: (identifier) @font-lock-variable-ref-face) |
| 261 | (field_expression value: (identifier) @font-lock-variable-name-face) | 261 | (field_expression value: (identifier) @font-lock-variable-ref-face) |
| 262 | (field_initializer value: (identifier) @font-lock-variable-name-face) | 262 | (field_initializer value: (identifier) @font-lock-variable-ref-face) |
| 263 | (if_expression condition: (identifier) @font-lock-variable-name-face) | 263 | (if_expression condition: (identifier) @font-lock-variable-ref-face) |
| 264 | (let_condition value: (identifier) @font-lock-variable-name-face) | 264 | (let_condition value: (identifier) @font-lock-variable-ref-face) |
| 265 | (let_declaration value: (identifier) @font-lock-variable-name-face) | 265 | (let_declaration value: (identifier) @font-lock-variable-ref-face) |
| 266 | (match_arm value: (identifier) @font-lock-variable-name-face) | 266 | (match_arm value: (identifier) @font-lock-variable-ref-face) |
| 267 | (match_expression value: (identifier) @font-lock-variable-name-face) | 267 | (match_expression value: (identifier) @font-lock-variable-ref-face) |
| 268 | (reference_expression value: (identifier) @font-lock-variable-name-face) | 268 | (reference_expression value: (identifier) @font-lock-variable-ref-face) |
| 269 | (return_expression (identifier) @font-lock-variable-name-face) | 269 | (return_expression (identifier) @font-lock-variable-ref-face) |
| 270 | (tuple_expression (identifier) @font-lock-variable-name-face) | 270 | (tuple_expression (identifier) @font-lock-variable-ref-face) |
| 271 | (unary_expression (identifier) @font-lock-variable-name-face) | 271 | (unary_expression (identifier) @font-lock-variable-ref-face) |
| 272 | (while_expression condition: (identifier) @font-lock-variable-name-face)) | 272 | (while_expression condition: (identifier) @font-lock-variable-ref-face)) |
| 273 | 273 | ||
| 274 | :language 'rust | 274 | :language 'rust |
| 275 | :feature 'escape-sequence | 275 | :feature 'escape-sequence |
diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 1646776ce95..d907608d0db 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el | |||
| @@ -245,16 +245,13 @@ Argument LANGUAGE is either `typescript' or `tsx'." | |||
| 245 | :language language | 245 | :language language |
| 246 | :feature 'property | 246 | :feature 'property |
| 247 | `((property_signature | 247 | `((property_signature |
| 248 | name: (property_identifier) @font-lock-property-face) | 248 | name: (property_identifier) @font-lock-property-name-face) |
| 249 | (public_field_definition | 249 | (public_field_definition |
| 250 | name: (property_identifier) @font-lock-property-face) | 250 | name: (property_identifier) @font-lock-property-name-face) |
| 251 | 251 | ||
| 252 | (pair key: (property_identifier) @font-lock-variable-name-face) | 252 | (pair key: (property_identifier) @font-lock-property-ref-face) |
| 253 | 253 | ||
| 254 | ((shorthand_property_identifier) @font-lock-property-face) | 254 | ((shorthand_property_identifier) @font-lock-property-ref-face)) |
| 255 | |||
| 256 | ((shorthand_property_identifier_pattern) | ||
| 257 | @font-lock-property-face)) | ||
| 258 | 255 | ||
| 259 | :language language | 256 | :language language |
| 260 | :feature 'expression | 257 | :feature 'expression |
| @@ -268,30 +265,34 @@ Argument LANGUAGE is either `typescript' or `tsx'." | |||
| 268 | :feature 'function | 265 | :feature 'function |
| 269 | '((call_expression | 266 | '((call_expression |
| 270 | function: | 267 | function: |
| 271 | [(identifier) @font-lock-function-name-face | 268 | [(identifier) @font-lock-function-call-face |
| 272 | (member_expression | 269 | (member_expression |
| 273 | property: (property_identifier) @font-lock-function-name-face)])) | 270 | property: (property_identifier) @font-lock-function-call-face)])) |
| 274 | 271 | ||
| 275 | :language language | 272 | :language language |
| 276 | :feature 'pattern | 273 | :feature 'pattern |
| 277 | `((pair_pattern | 274 | `((pair_pattern |
| 278 | key: (property_identifier) @font-lock-property-face) | 275 | key: (property_identifier) @font-lock-property-ref-face |
| 276 | value: [(identifier) @font-lock-variable-name-face | ||
| 277 | (assignment_pattern left: (identifier) @font-lock-variable-name-face)]) | ||
| 278 | |||
| 279 | (array_pattern (identifier) @font-lock-variable-name-face) | ||
| 279 | 280 | ||
| 280 | (array_pattern (identifier) @font-lock-variable-name-face)) | 281 | ((shorthand_property_identifier_pattern) @font-lock-variable-name-face)) |
| 281 | 282 | ||
| 282 | :language language | 283 | :language language |
| 283 | :feature 'jsx | 284 | :feature 'jsx |
| 284 | `((jsx_opening_element | 285 | `((jsx_opening_element |
| 285 | [(nested_identifier (identifier)) (identifier)] | 286 | [(nested_identifier (identifier)) (identifier)] |
| 286 | @font-lock-function-name-face) | 287 | @font-lock-function-call-face) |
| 287 | 288 | ||
| 288 | (jsx_closing_element | 289 | (jsx_closing_element |
| 289 | [(nested_identifier (identifier)) (identifier)] | 290 | [(nested_identifier (identifier)) (identifier)] |
| 290 | @font-lock-function-name-face) | 291 | @font-lock-function-call-face) |
| 291 | 292 | ||
| 292 | (jsx_self_closing_element | 293 | (jsx_self_closing_element |
| 293 | [(nested_identifier (identifier)) (identifier)] | 294 | [(nested_identifier (identifier)) (identifier)] |
| 294 | @font-lock-function-name-face) | 295 | @font-lock-function-call-face) |
| 295 | 296 | ||
| 296 | (jsx_attribute (property_identifier) @font-lock-constant-face)) | 297 | (jsx_attribute (property_identifier) @font-lock-constant-face)) |
| 297 | 298 | ||
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index a1d7d4bbbec..39e38179359 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el | |||
| @@ -1399,9 +1399,8 @@ for determining whether point is within a selector." | |||
| 1399 | 1399 | ||
| 1400 | :feature 'query | 1400 | :feature 'query |
| 1401 | :language 'css | 1401 | :language 'css |
| 1402 | '((keyword_query) @font-lock-property-face | 1402 | '((keyword_query) @font-lock-property-ref-face |
| 1403 | (feature_name) @font-lock-property-face) | 1403 | (feature_name) @font-lock-property-ref-face) |
| 1404 | |||
| 1405 | 1404 | ||
| 1406 | :feature 'bracket | 1405 | :feature 'bracket |
| 1407 | :language 'css | 1406 | :language 'css |
diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 416542084f1..2ff9d07d13b 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el | |||
| @@ -92,8 +92,8 @@ | |||
| 92 | :language 'toml | 92 | :language 'toml |
| 93 | :feature 'pair | 93 | :feature 'pair |
| 94 | :override t ; Needed for overriding string face on keys. | 94 | :override t ; Needed for overriding string face on keys. |
| 95 | '((bare_key) @font-lock-property-face | 95 | '((bare_key) @font-lock-property-ref-face |
| 96 | (quoted_key) @font-lock-property-face | 96 | (quoted_key) @font-lock-property-ref-face |
| 97 | (table ("[" @font-lock-bracket-face | 97 | (table ("[" @font-lock-bracket-face |
| 98 | (_) @font-lock-type-face | 98 | (_) @font-lock-type-face |
| 99 | "]" @font-lock-bracket-face)) | 99 | "]" @font-lock-bracket-face)) |
diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index a25230e6e61..dc0fa00df27 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el | |||
| @@ -94,22 +94,22 @@ | |||
| 94 | :feature 'property | 94 | :feature 'property |
| 95 | :override t | 95 | :override t |
| 96 | '((block_mapping_pair | 96 | '((block_mapping_pair |
| 97 | key: (flow_node (plain_scalar (string_scalar) @font-lock-property-face))) | 97 | key: (flow_node (plain_scalar (string_scalar) @font-lock-property-ref-face))) |
| 98 | (block_mapping_pair | 98 | (block_mapping_pair |
| 99 | key: (flow_node | 99 | key: (flow_node |
| 100 | [(double_quote_scalar) (single_quote_scalar)] @font-lock-property-face)) | 100 | [(double_quote_scalar) (single_quote_scalar)] @font-lock-property-ref-face)) |
| 101 | (flow_mapping | 101 | (flow_mapping |
| 102 | (_ key: (flow_node (plain_scalar (string_scalar) @font-lock-property-face)))) | 102 | (_ key: (flow_node (plain_scalar (string_scalar) @font-lock-property-ref-face)))) |
| 103 | (flow_mapping | 103 | (flow_mapping |
| 104 | (_ key: | 104 | (_ key: |
| 105 | (flow_node | 105 | (flow_node |
| 106 | [(double_quote_scalar) (single_quote_scalar)] @font-lock-property-face))) | 106 | [(double_quote_scalar) (single_quote_scalar)] @font-lock-property-ref-face))) |
| 107 | (flow_sequence | 107 | (flow_sequence |
| 108 | (_ key: (flow_node (plain_scalar (string_scalar) @font-lock-property-face)))) | 108 | (_ key: (flow_node (plain_scalar (string_scalar) @font-lock-property-ref-face)))) |
| 109 | (flow_sequence | 109 | (flow_sequence |
| 110 | (_ key: | 110 | (_ key: |
| 111 | (flow_node | 111 | (flow_node |
| 112 | [(double_quote_scalar) (single_quote_scalar)] @font-lock-property-face)))) | 112 | [(double_quote_scalar) (single_quote_scalar)] @font-lock-property-ref-face)))) |
| 113 | 113 | ||
| 114 | :language 'yaml | 114 | :language 'yaml |
| 115 | :feature 'error | 115 | :feature 'error |
diff --git a/lisp/treesit.el b/lisp/treesit.el index 644a8018ad2..a413311e824 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el | |||
| @@ -1533,7 +1533,7 @@ Similar to `treesit-indent', but indent a region instead." | |||
| 1533 | (dotimes (jdx idx) | 1533 | (dotimes (jdx idx) |
| 1534 | (let ((anchor (aref meta-vec (* jdx meta-len))) | 1534 | (let ((anchor (aref meta-vec (* jdx meta-len))) |
| 1535 | (offset (aref meta-vec (+ 1 (* jdx meta-len))))) | 1535 | (offset (aref meta-vec (+ 1 (* jdx meta-len))))) |
| 1536 | (when offset | 1536 | (when (and anchor offset) |
| 1537 | (let ((col (save-excursion | 1537 | (let ((col (save-excursion |
| 1538 | (goto-char anchor) | 1538 | (goto-char anchor) |
| 1539 | (+ offset (current-column))))) | 1539 | (+ offset (current-column))))) |
diff --git a/lisp/wdired.el b/lisp/wdired.el index 771458508e6..5572dcb32f3 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el | |||
| @@ -455,6 +455,7 @@ non-nil means return old filename." | |||
| 455 | (setq major-mode 'dired-mode) | 455 | (setq major-mode 'dired-mode) |
| 456 | (setq mode-name "Dired") | 456 | (setq mode-name "Dired") |
| 457 | (dired-advertise) | 457 | (dired-advertise) |
| 458 | (dired-hide-details-update-invisibility-spec) | ||
| 458 | (remove-hook 'kill-buffer-hook #'wdired-check-kill-buffer t) | 459 | (remove-hook 'kill-buffer-hook #'wdired-check-kill-buffer t) |
| 459 | (remove-hook 'before-change-functions #'wdired--before-change-fn t) | 460 | (remove-hook 'before-change-functions #'wdired--before-change-fn t) |
| 460 | (remove-hook 'after-change-functions #'wdired--restore-properties t) | 461 | (remove-hook 'after-change-functions #'wdired--restore-properties t) |
diff --git a/src/macros.c b/src/macros.c index 0db0af89a71..d1541d2817f 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -128,9 +128,9 @@ end_kbd_macro (void) | |||
| 128 | update_mode_lines = 20; | 128 | update_mode_lines = 20; |
| 129 | kset_last_kbd_macro | 129 | kset_last_kbd_macro |
| 130 | (current_kboard, | 130 | (current_kboard, |
| 131 | make_event_array ((current_kboard->kbd_macro_end | 131 | Fvector ((current_kboard->kbd_macro_end |
| 132 | - current_kboard->kbd_macro_buffer), | 132 | - current_kboard->kbd_macro_buffer), |
| 133 | current_kboard->kbd_macro_buffer)); | 133 | current_kboard->kbd_macro_buffer)); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p", | 136 | DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p", |
diff --git a/src/xfaces.c b/src/xfaces.c index 4207b73ee25..953e5be3781 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -4223,7 +4223,9 @@ Default face attributes override any local face attributes. */) | |||
| 4223 | if (EQ (face, Qdefault)) | 4223 | if (EQ (face, Qdefault)) |
| 4224 | { | 4224 | { |
| 4225 | struct face_cache *c = FRAME_FACE_CACHE (f); | 4225 | struct face_cache *c = FRAME_FACE_CACHE (f); |
| 4226 | struct face *newface, *oldface = FACE_FROM_ID_OR_NULL (f, DEFAULT_FACE_ID); | 4226 | struct face *newface; |
| 4227 | struct face *oldface = | ||
| 4228 | c ? FACE_FROM_ID_OR_NULL (f, DEFAULT_FACE_ID) : NULL; | ||
| 4227 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 4229 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 4228 | 4230 | ||
| 4229 | /* This can be NULL (e.g., in batch mode). */ | 4231 | /* This can be NULL (e.g., in batch mode). */ |
diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el index 551fd8b60fc..a325220e8d9 100644 --- a/test/lisp/kmacro-tests.el +++ b/test/lisp/kmacro-tests.el | |||
| @@ -614,6 +614,20 @@ This is a regression test for: Bug#3412, Bug#11817." | |||
| 614 | (kmacro-tests-should-insert "bb" | 614 | (kmacro-tests-should-insert "bb" |
| 615 | (kmacro-tests-simulate-command '(kmacro-tests-symbol-for-test)))) | 615 | (kmacro-tests-simulate-command '(kmacro-tests-symbol-for-test)))) |
| 616 | 616 | ||
| 617 | ;; Bug#61700 inserting named macro when the definition contains things | ||
| 618 | ;; that `key-parse' thinks are named keys | ||
| 619 | (kmacro-tests-deftest kmacro-tests-name-last-macro-key-parse-syntax () | ||
| 620 | "Name last macro can rebind a symbol it binds." | ||
| 621 | ;; Make sure our symbol is unbound. | ||
| 622 | (when (fboundp 'kmacro-tests-symbol-for-test) | ||
| 623 | (fmakunbound 'kmacro-tests-symbol-for-test)) | ||
| 624 | (setplist 'kmacro-tests-symbol-for-test nil) | ||
| 625 | (kmacro-tests-define-macro "<b> hello </>") | ||
| 626 | (kmacro-name-last-macro 'kmacro-tests-symbol-for-test) | ||
| 627 | ;; Now run the function bound to the symbol. | ||
| 628 | (kmacro-tests-should-insert "<b> hello </>" | ||
| 629 | (kmacro-tests-simulate-command '(kmacro-tests-symbol-for-test)))) | ||
| 630 | |||
| 617 | (kmacro-tests-deftest kmacro-tests-store-in-register () | 631 | (kmacro-tests-deftest kmacro-tests-store-in-register () |
| 618 | "Macro can be stored in and retrieved from a register." | 632 | "Macro can be stored in and retrieved from a register." |
| 619 | (use-local-map kmacro-tests-keymap) | 633 | (use-local-map kmacro-tests-keymap) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 97fada91fa2..f19847b0103 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -4557,8 +4557,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4557 | ;; Complete host name. | 4557 | ;; Complete host name. |
| 4558 | (unless (or (tramp-string-empty-or-nil-p method) | 4558 | (unless (or (tramp-string-empty-or-nil-p method) |
| 4559 | (string-empty-p tramp-method-regexp) | 4559 | (string-empty-p tramp-method-regexp) |
| 4560 | (tramp-string-empty-or-nil-p host) | 4560 | (tramp-string-empty-or-nil-p host)) |
| 4561 | (tramp--test-gvfs-p method)) | ||
| 4562 | (should | 4561 | (should |
| 4563 | (member | 4562 | (member |
| 4564 | (concat | 4563 | (concat |
| @@ -4640,171 +4639,181 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4640 | ;; and Bug#60505. | 4639 | ;; and Bug#60505. |
| 4641 | (ert-deftest tramp-test26-interactive-file-name-completion () | 4640 | (ert-deftest tramp-test26-interactive-file-name-completion () |
| 4642 | "Check interactive completion with different `completion-styles'." | 4641 | "Check interactive completion with different `completion-styles'." |
| 4643 | (tramp-cleanup-connection tramp-test-vec nil 'keep-password) | ||
| 4644 | |||
| 4645 | ;; Method, user and host name in completion mode. This kind of | 4642 | ;; Method, user and host name in completion mode. This kind of |
| 4646 | ;; completion does not work on MS Windows. | 4643 | ;; completion does not work on MS Windows. |
| 4647 | (unless (memq system-type '(cygwin windows-nt)) | 4644 | (skip-unless (not (memq system-type '(cygwin windows-nt)))) |
| 4648 | (let ((method (file-remote-p ert-remote-temporary-file-directory 'method)) | 4645 | (tramp-cleanup-connection tramp-test-vec nil 'keep-password) |
| 4649 | (user (file-remote-p ert-remote-temporary-file-directory 'user)) | ||
| 4650 | (host (file-remote-p ert-remote-temporary-file-directory 'host)) | ||
| 4651 | (hop (file-remote-p ert-remote-temporary-file-directory 'hop)) | ||
| 4652 | (orig-syntax tramp-syntax) | ||
| 4653 | (non-essential t) | ||
| 4654 | (inhibit-message t)) | ||
| 4655 | (when (and (stringp host) (string-match tramp-host-with-port-regexp host)) | ||
| 4656 | (setq host (match-string 1 host))) | ||
| 4657 | |||
| 4658 | ;; (trace-function #'tramp-completion-file-name-handler) | ||
| 4659 | ;; (trace-function #'completion-file-name-table) | ||
| 4660 | (unwind-protect | ||
| 4661 | (dolist (syntax (if (tramp--test-expensive-test-p) | ||
| 4662 | (tramp-syntax-values) `(,orig-syntax))) | ||
| 4663 | (tramp-change-syntax syntax) | ||
| 4664 | ;; This has cleaned up all connection data, which are used | ||
| 4665 | ;; for completion. We must refill the cache. | ||
| 4666 | (tramp-set-connection-property tramp-test-vec "property" nil) | ||
| 4667 | 4646 | ||
| 4668 | (dolist | 4647 | (let ((method (file-remote-p ert-remote-temporary-file-directory 'method)) |
| 4669 | (style | 4648 | (user (file-remote-p ert-remote-temporary-file-directory 'user)) |
| 4670 | (if (tramp--test-expensive-test-p) | 4649 | (host (file-remote-p ert-remote-temporary-file-directory 'host)) |
| 4671 | ;; It doesn't work for `initials' and `shorthand' | 4650 | (hop (file-remote-p ert-remote-temporary-file-directory 'hop)) |
| 4672 | ;; completion styles. Should it? | 4651 | (orig-syntax tramp-syntax) |
| 4673 | '(emacs21 emacs22 basic partial-completion substring flex) | 4652 | (non-essential t) |
| 4674 | '(basic))) | 4653 | (inhibit-message t)) |
| 4675 | 4654 | (when (and (stringp host) (string-match tramp-host-with-port-regexp host)) | |
| 4676 | (when (assoc style completion-styles-alist) | 4655 | (setq host (match-string 1 host))) |
| 4677 | (let (;; Force the real minibuffer in batch mode. | 4656 | |
| 4678 | (executing-kbd-macro noninteractive) | 4657 | ;; (trace-function #'tramp-completion-file-name-handler) |
| 4679 | (completion-styles `(,style)) | 4658 | ;; (trace-function #'completion-file-name-table) |
| 4680 | (completions-format 'one-column) | 4659 | (unwind-protect |
| 4681 | completion-category-defaults | 4660 | (dolist (syntax (if (tramp--test-expensive-test-p) |
| 4682 | completion-category-overrides | 4661 | (tramp-syntax-values) `(,orig-syntax))) |
| 4683 | ;; This is needed for the `simplified' syntax, | 4662 | (tramp-change-syntax syntax) |
| 4684 | (tramp-default-method method) | 4663 | ;; This has cleaned up all connection data, which are used |
| 4685 | (method-string | 4664 | ;; for completion. We must refill the cache. |
| 4686 | (unless (string-empty-p tramp-method-regexp) | 4665 | (tramp-set-connection-property tramp-test-vec "property" nil) |
| 4687 | (concat method tramp-postfix-method-format))) | 4666 | |
| 4688 | ;; This is needed for the IPv6 host name syntax. | 4667 | (dolist |
| 4689 | (ipv6-prefix | 4668 | (style |
| 4690 | (and (string-match-p tramp-ipv6-regexp host) | 4669 | (if (tramp--test-expensive-test-p) |
| 4691 | tramp-prefix-ipv6-format)) | 4670 | ;; It doesn't work for `initials' and `shorthand' |
| 4692 | (ipv6-postfix | 4671 | ;; completion styles. Should it? |
| 4693 | (and (string-match-p tramp-ipv6-regexp host) | 4672 | '(emacs21 emacs22 basic partial-completion substring flex) |
| 4694 | tramp-postfix-ipv6-format)) | 4673 | '(basic))) |
| 4695 | ;; The hop string fits only the initial syntax. | 4674 | |
| 4696 | (hop (and (eq tramp-syntax orig-syntax) hop)) | 4675 | (when (assoc style completion-styles-alist) |
| 4697 | test result completions) | 4676 | (let* (;; Force the real minibuffer in batch mode. |
| 4698 | 4677 | (executing-kbd-macro noninteractive) | |
| 4699 | (dolist | 4678 | (completion-styles `(,style)) |
| 4700 | (test-and-result | 4679 | completion-category-defaults |
| 4701 | ;; These are triples (TEST-STRING RESULT-CHECK | 4680 | completion-category-overrides |
| 4702 | ;; COMPLETION-CHECK). | 4681 | ;; This is needed for the `simplified' syntax, |
| 4703 | (append | 4682 | (tramp-default-method method) |
| 4704 | ;; Complete method name. | 4683 | (method-string |
| 4705 | (unless (string-empty-p tramp-method-regexp) | 4684 | (unless (string-empty-p tramp-method-regexp) |
| 4706 | `((,(concat | 4685 | (concat method tramp-postfix-method-format))) |
| 4707 | tramp-prefix-format hop | 4686 | (user-string |
| 4708 | (substring-no-properties | 4687 | (unless (tramp-string-empty-or-nil-p user) |
| 4709 | method 0 (min 2 (length method)))) | 4688 | (concat user tramp-postfix-user-format))) |
| 4710 | ,(concat tramp-prefix-format method-string) | 4689 | ;; This is needed for the IPv6 host name syntax. |
| 4711 | ,method-string))) | 4690 | (ipv6-prefix |
| 4712 | ;; Complete user name. | 4691 | (and (string-match-p tramp-ipv6-regexp host) |
| 4713 | (unless (tramp-string-empty-or-nil-p user) | 4692 | tramp-prefix-ipv6-format)) |
| 4714 | `((,(concat | 4693 | (ipv6-postfix |
| 4715 | tramp-prefix-format hop method-string | 4694 | (and (string-match-p tramp-ipv6-regexp host) |
| 4716 | (substring-no-properties | 4695 | tramp-postfix-ipv6-format)) |
| 4717 | user 0 (min 2 (length user)))) | 4696 | (host-string |
| 4718 | ,(concat | 4697 | (unless (tramp-string-empty-or-nil-p host) |
| 4719 | tramp-prefix-format method-string | 4698 | (concat |
| 4720 | user tramp-postfix-user-format) | 4699 | ipv6-prefix host |
| 4721 | ,(concat | 4700 | ipv6-postfix tramp-postfix-host-format))) |
| 4722 | user tramp-postfix-user-format)))) | 4701 | ;; The hop string fits only the initial syntax. |
| 4723 | ;; Complete host name. | 4702 | (hop (and (eq tramp-syntax orig-syntax) hop)) |
| 4724 | (unless (tramp-string-empty-or-nil-p host) | 4703 | test result completions) |
| 4725 | `((,(concat | 4704 | |
| 4726 | tramp-prefix-format hop method-string | 4705 | (dolist |
| 4727 | ipv6-prefix | 4706 | (test-and-result |
| 4728 | (substring-no-properties | 4707 | ;; These are triples of strings (TEST-STRING |
| 4729 | host 0 (min 2 (length host)))) | 4708 | ;; RESULT-CHECK COMPLETION-CHECK). RESULT-CHECK |
| 4730 | ,(concat | 4709 | ;; could be not unique, in this case it is a list |
| 4731 | tramp-prefix-format method-string | 4710 | ;; (RESULT1 RESULT2 ...). |
| 4732 | ipv6-prefix host | 4711 | (append |
| 4733 | ipv6-postfix tramp-postfix-host-format) | 4712 | ;; Complete method name. |
| 4734 | ,(concat | 4713 | (unless (string-empty-p tramp-method-regexp) |
| 4735 | ipv6-prefix host | 4714 | `((,(concat |
| 4736 | ipv6-postfix tramp-postfix-host-format)))) | 4715 | tramp-prefix-format hop |
| 4737 | ;; Complete user and host name. | 4716 | (substring-no-properties |
| 4738 | (unless (or (tramp-string-empty-or-nil-p user) | 4717 | method 0 (min 2 (length method)))) |
| 4739 | (tramp-string-empty-or-nil-p host)) | 4718 | ,(concat tramp-prefix-format method-string) |
| 4740 | `((,(concat | 4719 | ,method-string))) |
| 4741 | tramp-prefix-format hop method-string | 4720 | ;; Complete user name. |
| 4742 | user tramp-postfix-user-format | 4721 | (unless (tramp-string-empty-or-nil-p user) |
| 4743 | ipv6-prefix | 4722 | `((,(concat |
| 4744 | (substring-no-properties | 4723 | tramp-prefix-format hop method-string |
| 4745 | host 0 (min 2 (length host)))) | 4724 | (substring-no-properties |
| 4746 | ,(concat | 4725 | user 0 (min 2 (length user)))) |
| 4747 | tramp-prefix-format method-string | 4726 | ,(concat |
| 4748 | user tramp-postfix-user-format | 4727 | tramp-prefix-format method-string user-string) |
| 4749 | ipv6-prefix host | 4728 | ,user-string))) |
| 4750 | ipv6-postfix tramp-postfix-host-format) | 4729 | ;; Complete host name. |
| 4751 | ,(concat | 4730 | (unless (tramp-string-empty-or-nil-p host) |
| 4752 | ipv6-prefix host | 4731 | `((,(concat |
| 4753 | ipv6-postfix tramp-postfix-host-format)))))) | 4732 | tramp-prefix-format hop method-string |
| 4754 | 4733 | ipv6-prefix | |
| 4755 | (ignore-errors (kill-buffer "*Completions*")) | 4734 | (substring-no-properties |
| 4756 | ;; (and (bufferp trace-buffer) (kill-buffer trace-buffer)) | 4735 | host 0 (min 2 (length host)))) |
| 4757 | (discard-input) | 4736 | (,(concat |
| 4758 | (setq test (car test-and-result) | 4737 | tramp-prefix-format method-string host-string) |
| 4759 | unread-command-events | 4738 | ,(concat |
| 4760 | (mapcar #'identity (concat test "\t\t\n")) | 4739 | tramp-prefix-format method-string |
| 4761 | completions nil | 4740 | user-string host-string)) |
| 4762 | result (read-file-name "Prompt: ")) | 4741 | ,host-string))) |
| 4763 | 4742 | ;; Complete user and host name. | |
| 4764 | (if (or (not (get-buffer "*Completions*")) | 4743 | (unless (or (tramp-string-empty-or-nil-p user) |
| 4765 | (string-match-p | 4744 | (tramp-string-empty-or-nil-p host)) |
| 4766 | (if (string-empty-p tramp-method-regexp) | 4745 | `((,(concat |
| 4767 | (rx (| (regexp tramp-postfix-user-regexp) | 4746 | tramp-prefix-format hop method-string user-string |
| 4768 | (regexp tramp-postfix-host-regexp)) | 4747 | ipv6-prefix |
| 4769 | eos) | 4748 | (substring-no-properties |
| 4770 | (rx (| (regexp tramp-postfix-method-regexp) | 4749 | host 0 (min 2 (length host)))) |
| 4771 | (regexp tramp-postfix-user-regexp) | 4750 | ,(concat |
| 4772 | (regexp tramp-postfix-host-regexp)) | 4751 | tramp-prefix-format method-string |
| 4773 | eos)) | 4752 | user-string host-string) |
| 4774 | result)) | 4753 | ,host-string))))) |
| 4775 | (progn | 4754 | |
| 4776 | ;; (tramp--test-message | 4755 | (ignore-errors (kill-buffer "*Completions*")) |
| 4777 | ;; "syntax: %s style: %s test: %s result: %s" | 4756 | ;; (and (bufferp trace-buffer) (kill-buffer trace-buffer)) |
| 4778 | ;; syntax style test result) | 4757 | (discard-input) |
| 4779 | (should (string-prefix-p (cadr test-and-result) result))) | 4758 | (setq test (car test-and-result) |
| 4780 | 4759 | unread-command-events | |
| 4781 | (with-current-buffer "*Completions*" | 4760 | (mapcar #'identity (concat test "\t\t\n")) |
| 4782 | ;; We must remove leading `default-directory'. | 4761 | completions nil |
| 4783 | (goto-char (point-min)) | 4762 | result (read-file-name "Prompt: ")) |
| 4784 | (let ((inhibit-read-only t)) | 4763 | |
| 4785 | (while (re-search-forward "//" nil 'noerror) | 4764 | (if (or (not (get-buffer "*Completions*")) |
| 4786 | (delete-region (line-beginning-position) (point)))) | 4765 | (string-match-p |
| 4787 | (goto-char (point-min)) | 4766 | (if (string-empty-p tramp-method-regexp) |
| 4788 | (re-search-forward | 4767 | (rx |
| 4789 | (rx bol (0+ nonl) | 4768 | (| (regexp tramp-postfix-user-regexp) |
| 4790 | (any "Pp") "ossible completions" | 4769 | (regexp tramp-postfix-host-regexp)) |
| 4791 | (0+ nonl) eol)) | 4770 | eos) |
| 4792 | (forward-line 1) | 4771 | (rx |
| 4793 | (setq completions | 4772 | (| (regexp tramp-postfix-method-regexp) |
| 4794 | (split-string | 4773 | (regexp tramp-postfix-user-regexp) |
| 4795 | (buffer-substring-no-properties (point) (point-max)) | 4774 | (regexp tramp-postfix-host-regexp)) |
| 4796 | (rx (any "\r\n")) 'omit))) | 4775 | eos)) |
| 4797 | 4776 | result)) | |
| 4798 | ;; (tramp--test-message | 4777 | (progn |
| 4799 | ;; "syntax: %s style: %s test: %s result: %s completions: %S" | 4778 | ;; (tramp--test-message |
| 4800 | ;; syntax style test result completions) | 4779 | ;; "syntax: %s style: %s test: %s result: %s" |
| 4801 | (should (member (caddr test-and-result) completions)))))))) | 4780 | ;; syntax style test result) |
| 4781 | (if (stringp (cadr test-and-result)) | ||
| 4782 | (should | ||
| 4783 | (string-prefix-p (cadr test-and-result) result)) | ||
| 4784 | (should | ||
| 4785 | (let (res) | ||
| 4786 | (dolist (elem (cadr test-and-result) res) | ||
| 4787 | (setq | ||
| 4788 | res (or res (string-prefix-p elem result)))))))) | ||
| 4789 | |||
| 4790 | (with-current-buffer "*Completions*" | ||
| 4791 | ;; We must remove leading `default-directory'. | ||
| 4792 | (goto-char (point-min)) | ||
| 4793 | (let ((inhibit-read-only t)) | ||
| 4794 | (while (re-search-forward "//" nil 'noerror) | ||
| 4795 | (delete-region (line-beginning-position) (point)))) | ||
| 4796 | (goto-char (point-min)) | ||
| 4797 | (re-search-forward | ||
| 4798 | (rx bol (0+ nonl) | ||
| 4799 | (any "Pp") "ossible completions" | ||
| 4800 | (0+ nonl) eol)) | ||
| 4801 | (forward-line 1) | ||
| 4802 | (setq completions | ||
| 4803 | (split-string | ||
| 4804 | (buffer-substring-no-properties (point) (point-max)) | ||
| 4805 | (rx (any "\r\n\t ")) 'omit))) | ||
| 4806 | |||
| 4807 | ;; (tramp--test-message | ||
| 4808 | ;; "syntax: %s style: %s test: %s result: %s completions: %S" | ||
| 4809 | ;; syntax style test result completions) | ||
| 4810 | (should (member (caddr test-and-result) completions)))))))) | ||
| 4802 | 4811 | ||
| 4803 | ;; Cleanup. | 4812 | ;; Cleanup. |
| 4804 | ;; (tramp--test-message "%s" (tramp-get-buffer-string trace-buffer)) | 4813 | ;; (tramp--test-message "%s" (tramp-get-buffer-string trace-buffer)) |
| 4805 | ;; (untrace-function #'tramp-completion-file-name-handler) | 4814 | ;; (untrace-function #'tramp-completion-file-name-handler) |
| 4806 | ;; (untrace-function #'completion-file-name-table) | 4815 | ;; (untrace-function #'completion-file-name-table) |
| 4807 | (tramp-change-syntax orig-syntax))))) | 4816 | (tramp-change-syntax orig-syntax)))) |
| 4808 | 4817 | ||
| 4809 | (ert-deftest tramp-test27-load () | 4818 | (ert-deftest tramp-test27-load () |
| 4810 | "Check `load'." | 4819 | "Check `load'." |
| @@ -5097,18 +5106,16 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 5097 | (sit-for 0.1 'nodisp)) | 5106 | (sit-for 0.1 'nodisp)) |
| 5098 | (process-send-string proc "foo\r\n") | 5107 | (process-send-string proc "foo\r\n") |
| 5099 | (process-send-eof proc) | 5108 | (process-send-eof proc) |
| 5100 | ;; Read output. | 5109 | ;; Read output. On macOS, there is always newline |
| 5101 | (with-timeout (10 (tramp--test-timeout-handler)) | 5110 | ;; conversion. "telnet" converts \r to <CR><NUL> if |
| 5102 | (while (< (- (point-max) (point-min)) | 5111 | ;; `crlf' flag is FALSE. See telnet(1) man page. |
| 5103 | (length "66\n6F\n6F\n0D\n0A\n")) | 5112 | (let ((expected |
| 5104 | (while (accept-process-output proc 0 nil t)))) | 5113 | (rx "66\n" "6F\n" "6F\n" |
| 5105 | (should | 5114 | (| "0D\n" "0A\n") (? "00\n") "0A\n"))) |
| 5106 | (string-match-p | 5115 | (with-timeout (10 (tramp--test-timeout-handler)) |
| 5107 | ;; On macOS, there is always newline conversion. | 5116 | (while (not (string-match-p expected (buffer-string))) |
| 5108 | ;; "telnet" converts \r to <CR><NUL> if `crlf' | 5117 | (while (accept-process-output proc 0 nil t)))) |
| 5109 | ;; flag is FALSE. See telnet(1) man page. | 5118 | (should (string-match-p expected (buffer-string))))) |
| 5110 | (rx "66\n" "6F\n" "6F\n" (| "0D\n" "0A\n") (? "00\n") "0A\n") | ||
| 5111 | (buffer-string)))) | ||
| 5112 | 5119 | ||
| 5113 | ;; Cleanup. | 5120 | ;; Cleanup. |
| 5114 | (ignore-errors (delete-process proc))))) | 5121 | (ignore-errors (delete-process proc))))) |
| @@ -5388,18 +5395,16 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." | |||
| 5388 | (sit-for 0.1 'nodisp)) | 5395 | (sit-for 0.1 'nodisp)) |
| 5389 | (process-send-string proc "foo\r\n") | 5396 | (process-send-string proc "foo\r\n") |
| 5390 | (process-send-eof proc) | 5397 | (process-send-eof proc) |
| 5391 | ;; Read output. | 5398 | ;; Read output. On macOS, there is always newline |
| 5392 | (with-timeout (10 (tramp--test-timeout-handler)) | 5399 | ;; conversion. "telnet" converts \r to <CR><NUL> if |
| 5393 | (while (< (- (point-max) (point-min)) | 5400 | ;; `crlf' flag is FALSE. See telnet(1) man page. |
| 5394 | (length "66\n6F\n6F\n0D\n0A\n")) | 5401 | (let ((expected |
| 5395 | (while (accept-process-output proc 0 nil t)))) | 5402 | (rx "66\n" "6F\n" "6F\n" |
| 5396 | (should | 5403 | (| "0D\n" "0A\n") (? "00\n") "0A\n"))) |
| 5397 | (string-match-p | 5404 | (with-timeout (10 (tramp--test-timeout-handler)) |
| 5398 | ;; On macOS, there is always newline conversion. | 5405 | (while (not (string-match-p expected (buffer-string))) |
| 5399 | ;; "telnet" converts \r to <CR><NUL> if `crlf' | 5406 | (while (accept-process-output proc 0 nil t)))) |
| 5400 | ;; flag is FALSE. See telnet(1) man page. | 5407 | (should (string-match-p expected (buffer-string))))) |
| 5401 | (rx "66\n" "6F\n" "6F\n" (| "0D\n" "0A\n") (? "00\n") "0A\n") | ||
| 5402 | (buffer-string)))) | ||
| 5403 | 5408 | ||
| 5404 | ;; Cleanup. | 5409 | ;; Cleanup. |
| 5405 | (ignore-errors (delete-process proc))))))))) | 5410 | (ignore-errors (delete-process proc))))))))) |
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts b/test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts index 5a4996f642e..57610b5483e 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | Code: | 1 | Code: |
| 2 | (lambda () | 2 | (lambda () |
| 3 | (c-ts-mode) | 3 | (c-ts-mode) |
| 4 | (setq-local indent-tabs-mode nil) | ||
| 4 | (newline) | 5 | (newline) |
| 5 | (indent-for-tab-command)) | 6 | (indent-for-tab-command)) |
| 6 | 7 | ||
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index 74c2449076f..897c6cd69a8 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el | |||
| @@ -189,5 +189,28 @@ wdired-get-filename before and after editing." | |||
| 189 | (wdired-finish-edit)) | 189 | (wdired-finish-edit)) |
| 190 | (if buf (kill-buffer buf))))))) | 190 | (if buf (kill-buffer buf))))))) |
| 191 | 191 | ||
| 192 | (ert-deftest wdired-test-bug61510 () | ||
| 193 | "Test visibility of symlink target on leaving wdired-mode. | ||
| 194 | When dired-hide-details-mode is enabled and | ||
| 195 | dired-hide-details-hide-symlink-targets is non-nil (the default), | ||
| 196 | the link target becomes invisible. When wdired-mode is enabled | ||
| 197 | the target becomes visible, but on returning to dired-mode, it | ||
| 198 | should be invisible again." | ||
| 199 | (ert-with-temp-directory test-dir | ||
| 200 | (let ((buf (find-file-noselect test-dir)) | ||
| 201 | ;; Default value is t, but set it anyway, to be sure. | ||
| 202 | (dired-hide-details-hide-symlink-targets t)) | ||
| 203 | (unwind-protect | ||
| 204 | (with-current-buffer buf | ||
| 205 | (make-symbolic-link "bar" "foo") | ||
| 206 | (dired-hide-details-mode) | ||
| 207 | (should (memq 'dired-hide-details-link buffer-invisibility-spec)) | ||
| 208 | (dired-toggle-read-only) | ||
| 209 | (should-not (memq 'dired-hide-details-link | ||
| 210 | buffer-invisibility-spec)) | ||
| 211 | (wdired-finish-edit) | ||
| 212 | (should (memq 'dired-hide-details-link buffer-invisibility-spec))) | ||
| 213 | (if buf (kill-buffer buf)))))) | ||
| 214 | |||
| 192 | (provide 'wdired-tests) | 215 | (provide 'wdired-tests) |
| 193 | ;;; wdired-tests.el ends here | 216 | ;;; wdired-tests.el ends here |