diff options
| author | Eli Zaretskii | 2024-01-13 05:36:16 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2024-01-13 05:36:16 -0500 |
| commit | f1736571fa3f4bc13dbc217f61bdc6e8efdc24b4 (patch) | |
| tree | bd578b33ecfb44585800ded0bccf2856ba7bea14 /lisp | |
| parent | ccc28245c090c2d5f93184e8887fede3910b977e (diff) | |
| parent | 99efe5c80f9d90de6540ef6f78504c0413947a25 (diff) | |
| download | emacs-f1736571fa3f4bc13dbc217f61bdc6e8efdc24b4.tar.gz emacs-f1736571fa3f4bc13dbc217f61bdc6e8efdc24b4.zip | |
Merge from origin/emacs-29
99efe5c80f9 Fix count of no-op functions (bug#68375)
0c01f97b73c Wrap @pxref of Abbrevs in parentheses (bug#68375)
70a09325d65 ; Fix last change in widget.texi
63411709a8d ; Fix typos
824cf54951c ; * etc/TODO: Add item to make play-sound non-blocking.
4fadbfe300a Add examples to the Widget manual
1bbb610821e Implement missing functions for custom-icon widget
29af214a75a Fix fontification of cgroup2 in fstab (bug#68367)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/cus-edit.el | 58 | ||||
| -rw-r--r-- | lisp/generic-x.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 4 |
3 files changed, 58 insertions, 5 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 0eeca7c2f31..38b6ec984ab 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -5389,9 +5389,49 @@ The following properties have special meanings for this widget: | |||
| 5389 | :hidden-states '(standard) | 5389 | :hidden-states '(standard) |
| 5390 | :action #'custom-icon-action | 5390 | :action #'custom-icon-action |
| 5391 | :custom-set #'custom-icon-set | 5391 | :custom-set #'custom-icon-set |
| 5392 | :custom-reset-current #'custom-redraw) | 5392 | :custom-mark-to-save #'custom-icon-mark-to-save |
| 5393 | ;; Not implemented yet. | 5393 | :custom-reset-current #'custom-redraw |
| 5394 | ;; :custom-reset-saved 'custom-icon-reset-saved) | 5394 | :custom-reset-saved #'custom-icon-reset-saved |
| 5395 | :custom-state-set-and-redraw #'custom-icon-state-set-and-redraw | ||
| 5396 | :custom-reset-standard #'custom-icon-reset-standard | ||
| 5397 | :custom-mark-to-reset-standard #'custom-icon-mark-to-reset-standard) | ||
| 5398 | |||
| 5399 | (defun custom-icon-mark-to-save (widget) | ||
| 5400 | "Mark user customization for icon edited by WIDGET to be saved later." | ||
| 5401 | (let* ((icon (widget-value widget)) | ||
| 5402 | (value (custom--icons-widget-value | ||
| 5403 | (car (widget-get widget :children))))) | ||
| 5404 | (custom-push-theme 'theme-icon icon 'user 'set value))) | ||
| 5405 | |||
| 5406 | (defun custom-icon-reset-saved (widget) | ||
| 5407 | "Restore icon customized by WIDGET to the icon's default attributes. | ||
| 5408 | |||
| 5409 | If there's a theme value for the icon, resets to that. Otherwise, resets to | ||
| 5410 | its standard value." | ||
| 5411 | (let* ((icon (widget-value widget))) | ||
| 5412 | (custom-push-theme 'theme-icon icon 'user 'reset) | ||
| 5413 | (custom-icon-state-set widget) | ||
| 5414 | (custom-redraw widget))) | ||
| 5415 | |||
| 5416 | (defun custom-icon-state-set-and-redraw (widget) | ||
| 5417 | "Set state of icon widget WIDGET and redraw it with up-to-date settings." | ||
| 5418 | (custom-icon-state-set widget) | ||
| 5419 | (custom-redraw-magic widget)) | ||
| 5420 | |||
| 5421 | (defun custom-icon-reset-standard (widget) | ||
| 5422 | "Reset icon edited by WIDGET to its standard value." | ||
| 5423 | (let* ((icon (widget-value widget)) | ||
| 5424 | (themes (get icon 'theme-icon))) | ||
| 5425 | (dolist (theme themes) | ||
| 5426 | (custom-push-theme 'theme-icon icon (car theme) 'reset)) | ||
| 5427 | (custom-save-all)) | ||
| 5428 | (widget-put widget :custom-state 'unknown) | ||
| 5429 | (custom-redraw widget)) | ||
| 5430 | |||
| 5431 | (defun custom-icon-mark-to-reset-standard (widget) | ||
| 5432 | "Reset icon edited by WIDGET to its standard value." | ||
| 5433 | ;; Don't mark for now, there aren't that many icons. | ||
| 5434 | (custom-icon-reset-standard widget)) | ||
| 5395 | 5435 | ||
| 5396 | (defvar custom-icon-extended-menu | 5436 | (defvar custom-icon-extended-menu |
| 5397 | (let ((map (make-sparse-keymap))) | 5437 | (let ((map (make-sparse-keymap))) |
| @@ -5410,6 +5450,18 @@ The following properties have special meanings for this widget: | |||
| 5410 | :enable (memq | 5450 | :enable (memq |
| 5411 | (widget-get custom-actioned-widget :custom-state) | 5451 | (widget-get custom-actioned-widget :custom-state) |
| 5412 | '(modified changed)))) | 5452 | '(modified changed)))) |
| 5453 | (define-key-after map [custom-icon-reset-saved] | ||
| 5454 | '(menu-item "Revert This Session's Customization" | ||
| 5455 | custom-icon-reset-saved | ||
| 5456 | :enable (memq | ||
| 5457 | (widget-get custom-actioned-widget :custom-state) | ||
| 5458 | '(modified set changed rogue)))) | ||
| 5459 | (when (or custom-file init-file-user) | ||
| 5460 | (define-key-after map [custom-icon-reset-standard] | ||
| 5461 | '(menu-item "Erase Customization" custom-icon-reset-standard | ||
| 5462 | :enable (memq | ||
| 5463 | (widget-get custom-actioned-widget :custom-state) | ||
| 5464 | '(modified set changed saved rogue))))) | ||
| 5413 | map) | 5465 | map) |
| 5414 | "A menu for `custom-icon' widgets. | 5466 | "A menu for `custom-icon' widgets. |
| 5415 | Used in `custom-icon-action' to show a menu to the user.") | 5467 | Used in `custom-icon-action' to show a menu to the user.") |
diff --git a/lisp/generic-x.el b/lisp/generic-x.el index b4ae0225943..373bfad92dd 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el | |||
| @@ -1491,6 +1491,7 @@ like an INI file. You can add this hook to `find-file-hook'." | |||
| 1491 | "cd9660" | 1491 | "cd9660" |
| 1492 | "cfs" | 1492 | "cfs" |
| 1493 | "cgroup" | 1493 | "cgroup" |
| 1494 | "cgroup2" | ||
| 1494 | "cifs" | 1495 | "cifs" |
| 1495 | "coda" | 1496 | "coda" |
| 1496 | "coherent" | 1497 | "coherent" |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a44d4215d7c..e2f614f52c2 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1117,7 +1117,7 @@ fontified." | |||
| 1117 | 1117 | ||
| 1118 | (defun python--treesit-fontify-union-types (node override start end &optional type-regex &rest _) | 1118 | (defun python--treesit-fontify-union-types (node override start end &optional type-regex &rest _) |
| 1119 | "Fontify nested union types in the type hints. | 1119 | "Fontify nested union types in the type hints. |
| 1120 | For examlpe, Lvl1 | Lvl2[Lvl3[Lvl4[Lvl5 | None]], Lvl2]. This | 1120 | For example, Lvl1 | Lvl2[Lvl3[Lvl4[Lvl5 | None]], Lvl2]. This |
| 1121 | structure is represented via nesting binary_operator and | 1121 | structure is represented via nesting binary_operator and |
| 1122 | subscript nodes. This function iterates over all levels and | 1122 | subscript nodes. This function iterates over all levels and |
| 1123 | highlight identifier nodes. If TYPE-REGEX is not nil fontify type | 1123 | highlight identifier nodes. If TYPE-REGEX is not nil fontify type |
| @@ -1275,7 +1275,7 @@ fontified." | |||
| 1275 | (subscript (identifier) @font-lock-type-face) | 1275 | (subscript (identifier) @font-lock-type-face) |
| 1276 | (subscript (attribute attribute: (identifier) @font-lock-type-face))])) | 1276 | (subscript (attribute attribute: (identifier) @font-lock-type-face))])) |
| 1277 | 1277 | ||
| 1278 | ;; Patern matching: case [str(), pack0.Type0()]. Take only the | 1278 | ;; Pattern matching: case [str(), pack0.Type0()]. Take only the |
| 1279 | ;; last identifier. | 1279 | ;; last identifier. |
| 1280 | (class_pattern (dotted_name (identifier) @font-lock-type-face :anchor)) | 1280 | (class_pattern (dotted_name (identifier) @font-lock-type-face :anchor)) |
| 1281 | 1281 | ||