diff options
| author | Basil L. Contovounesios | 2018-05-11 15:35:09 +0100 |
|---|---|---|
| committer | Stefan Monnier | 2018-07-13 11:28:16 -0400 |
| commit | feb6863e64a94466af867d63c1e8fef4cc5e84fc (patch) | |
| tree | c531a4afd66f64ac309b8e5cfef66021967eb1fa | |
| parent | 5c3db916927e08361d6a3172b53460f91ec81047 (diff) | |
| download | emacs-feb6863e64a94466af867d63c1e8fef4cc5e84fc.tar.gz emacs-feb6863e64a94466af867d63c1e8fef4cc5e84fc.zip | |
* lisp/cus-theme.el: Use lexical-binding
| -rw-r--r-- | lisp/cus-theme.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index e5e787771b9..53389956ad2 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cus-theme.el -- custom theme creation user interface | 1 | ;;; cus-theme.el -- custom theme creation user interface -*- lexical-binding: t -*- |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright (C) 2001-2018 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2001-2018 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| @@ -47,7 +47,7 @@ | |||
| 47 | Do not call this mode function yourself. It is meant for internal use." | 47 | Do not call this mode function yourself. It is meant for internal use." |
| 48 | (use-local-map custom-new-theme-mode-map) | 48 | (use-local-map custom-new-theme-mode-map) |
| 49 | (custom--initialize-widget-variables) | 49 | (custom--initialize-widget-variables) |
| 50 | (set (make-local-variable 'revert-buffer-function) 'custom-theme-revert)) | 50 | (set (make-local-variable 'revert-buffer-function) #'custom-theme-revert)) |
| 51 | (put 'custom-new-theme-mode 'mode-class 'special) | 51 | (put 'custom-new-theme-mode 'mode-class 'special) |
| 52 | 52 | ||
| 53 | (defvar custom-theme-name nil) | 53 | (defvar custom-theme-name nil) |
| @@ -118,13 +118,13 @@ remove them from your saved Custom file.\n\n")) | |||
| 118 | :tag " Visit Theme " | 118 | :tag " Visit Theme " |
| 119 | :help-echo "Insert the settings of a pre-defined theme." | 119 | :help-echo "Insert the settings of a pre-defined theme." |
| 120 | :action (lambda (_widget &optional _event) | 120 | :action (lambda (_widget &optional _event) |
| 121 | (call-interactively 'custom-theme-visit-theme))) | 121 | (call-interactively #'custom-theme-visit-theme))) |
| 122 | (widget-insert " ") | 122 | (widget-insert " ") |
| 123 | (widget-create 'push-button | 123 | (widget-create 'push-button |
| 124 | :tag " Merge Theme " | 124 | :tag " Merge Theme " |
| 125 | :help-echo "Merge in the settings of a pre-defined theme." | 125 | :help-echo "Merge in the settings of a pre-defined theme." |
| 126 | :action (lambda (_widget &optional _event) | 126 | :action (lambda (_widget &optional _event) |
| 127 | (call-interactively 'custom-theme-merge-theme))) | 127 | (call-interactively #'custom-theme-merge-theme))) |
| 128 | (widget-insert " ") | 128 | (widget-insert " ") |
| 129 | (widget-create 'push-button | 129 | (widget-create 'push-button |
| 130 | :tag " Revert " | 130 | :tag " Revert " |
| @@ -142,7 +142,7 @@ remove them from your saved Custom file.\n\n")) | |||
| 142 | (widget-create 'text | 142 | (widget-create 'text |
| 143 | :value (format-time-string "Created %Y-%m-%d."))) | 143 | :value (format-time-string "Created %Y-%m-%d."))) |
| 144 | (widget-create 'push-button | 144 | (widget-create 'push-button |
| 145 | :notify (function custom-theme-write) | 145 | :notify #'custom-theme-write |
| 146 | " Save Theme ") | 146 | " Save Theme ") |
| 147 | (when (eq theme 'user) | 147 | (when (eq theme 'user) |
| 148 | (setq custom-theme--migrate-settings t) | 148 | (setq custom-theme--migrate-settings t) |
| @@ -188,7 +188,7 @@ remove them from your saved Custom file.\n\n")) | |||
| 188 | :mouse-face 'highlight | 188 | :mouse-face 'highlight |
| 189 | :pressed-face 'highlight | 189 | :pressed-face 'highlight |
| 190 | :action (lambda (_widget &optional _event) | 190 | :action (lambda (_widget &optional _event) |
| 191 | (call-interactively 'custom-theme-add-face))) | 191 | (call-interactively #'custom-theme-add-face))) |
| 192 | 192 | ||
| 193 | ;; If THEME is non-nil, insert all of that theme's variables. | 193 | ;; If THEME is non-nil, insert all of that theme's variables. |
| 194 | (widget-insert "\n\n Theme variables:\n ") | 194 | (widget-insert "\n\n Theme variables:\n ") |
| @@ -207,7 +207,7 @@ remove them from your saved Custom file.\n\n")) | |||
| 207 | :mouse-face 'highlight | 207 | :mouse-face 'highlight |
| 208 | :pressed-face 'highlight | 208 | :pressed-face 'highlight |
| 209 | :action (lambda (_widget &optional _event) | 209 | :action (lambda (_widget &optional _event) |
| 210 | (call-interactively 'custom-theme-add-variable))) | 210 | (call-interactively #'custom-theme-add-variable))) |
| 211 | (widget-insert ?\n) | 211 | (widget-insert ?\n) |
| 212 | (widget-setup) | 212 | (widget-setup) |
| 213 | (goto-char (point-min)) | 213 | (goto-char (point-min)) |
| @@ -254,7 +254,7 @@ interactively, this defaults to the current value of VAR." | |||
| 254 | :tag (custom-unlispify-tag-name symbol) | 254 | :tag (custom-unlispify-tag-name symbol) |
| 255 | :value symbol | 255 | :value symbol |
| 256 | :shown-value (list val) | 256 | :shown-value (list val) |
| 257 | :notify 'ignore | 257 | :notify #'ignore |
| 258 | :custom-level 0 | 258 | :custom-level 0 |
| 259 | :custom-state 'hidden | 259 | :custom-state 'hidden |
| 260 | :custom-style 'simple)) | 260 | :custom-style 'simple)) |
| @@ -313,7 +313,7 @@ SPEC, if non-nil, should be a face spec to which to set the widget." | |||
| 313 | (interactive | 313 | (interactive |
| 314 | (list | 314 | (list |
| 315 | (intern (completing-read "Find custom theme: " | 315 | (intern (completing-read "Find custom theme: " |
| 316 | (mapcar 'symbol-name | 316 | (mapcar #'symbol-name |
| 317 | (custom-available-themes)))))) | 317 | (custom-available-themes)))))) |
| 318 | (unless (custom-theme-name-valid-p theme) | 318 | (unless (custom-theme-name-valid-p theme) |
| 319 | (error "No valid theme named `%s'" theme)) | 319 | (error "No valid theme named `%s'" theme)) |
| @@ -328,7 +328,7 @@ SPEC, if non-nil, should be a face spec to which to set the widget." | |||
| 328 | (interactive | 328 | (interactive |
| 329 | (list | 329 | (list |
| 330 | (intern (completing-read "Merge custom theme: " | 330 | (intern (completing-read "Merge custom theme: " |
| 331 | (mapcar 'symbol-name | 331 | (mapcar #'symbol-name |
| 332 | (custom-available-themes)))))) | 332 | (custom-available-themes)))))) |
| 333 | (unless (eq theme 'user) | 333 | (unless (eq theme 'user) |
| 334 | (unless (custom-theme-name-valid-p theme) | 334 | (unless (custom-theme-name-valid-p theme) |
| @@ -343,8 +343,8 @@ SPEC, if non-nil, should be a face spec to which to set the widget." | |||
| 343 | (memq name '(custom-enabled-themes | 343 | (memq name '(custom-enabled-themes |
| 344 | custom-safe-themes))) | 344 | custom-safe-themes))) |
| 345 | (funcall (if option | 345 | (funcall (if option |
| 346 | 'custom-theme-add-variable | 346 | #'custom-theme-add-variable |
| 347 | 'custom-theme-add-face) | 347 | #'custom-theme-add-face) |
| 348 | name value))))) | 348 | name value))))) |
| 349 | theme) | 349 | theme) |
| 350 | 350 | ||
| @@ -475,7 +475,7 @@ It includes all faces in list FACES." | |||
| 475 | (interactive | 475 | (interactive |
| 476 | (list | 476 | (list |
| 477 | (intern (completing-read "Describe custom theme: " | 477 | (intern (completing-read "Describe custom theme: " |
| 478 | (mapcar 'symbol-name | 478 | (mapcar #'symbol-name |
| 479 | (custom-available-themes)))))) | 479 | (custom-available-themes)))))) |
| 480 | (unless (custom-theme-name-valid-p theme) | 480 | (unless (custom-theme-name-valid-p theme) |
| 481 | (error "Invalid theme name `%s'" theme)) | 481 | (error "Invalid theme name `%s'" theme)) |
| @@ -616,11 +616,11 @@ Theme files are named *-theme.el in `")) | |||
| 616 | (widget-create 'push-button | 616 | (widget-create 'push-button |
| 617 | :tag " Save Theme Settings " | 617 | :tag " Save Theme Settings " |
| 618 | :help-echo "Save the selected themes for future sessions." | 618 | :help-echo "Save the selected themes for future sessions." |
| 619 | :action 'custom-theme-save) | 619 | :action #'custom-theme-save) |
| 620 | (widget-insert ?\n) | 620 | (widget-insert ?\n) |
| 621 | (widget-create 'checkbox | 621 | (widget-create 'checkbox |
| 622 | :value custom-theme-allow-multiple-selections | 622 | :value custom-theme-allow-multiple-selections |
| 623 | :action 'custom-theme-selections-toggle) | 623 | :action #'custom-theme-selections-toggle) |
| 624 | (widget-insert (propertize " Select more than one theme at a time" | 624 | (widget-insert (propertize " Select more than one theme at a time" |
| 625 | 'face '(variable-pitch (:height 0.9)))) | 625 | 'face '(variable-pitch (:height 0.9)))) |
| 626 | 626 | ||
| @@ -632,13 +632,13 @@ Theme files are named *-theme.el in `")) | |||
| 632 | :value (custom-theme-enabled-p theme) | 632 | :value (custom-theme-enabled-p theme) |
| 633 | :theme-name theme | 633 | :theme-name theme |
| 634 | :help-echo help-echo | 634 | :help-echo help-echo |
| 635 | :action 'custom-theme-checkbox-toggle)) | 635 | :action #'custom-theme-checkbox-toggle)) |
| 636 | (push (cons theme widget) custom--listed-themes) | 636 | (push (cons theme widget) custom--listed-themes) |
| 637 | (widget-create-child-and-convert widget 'push-button | 637 | (widget-create-child-and-convert widget 'push-button |
| 638 | :button-face-get 'ignore | 638 | :button-face-get 'ignore |
| 639 | :mouse-face-get 'ignore | 639 | :mouse-face-get 'ignore |
| 640 | :value (format " %s" theme) | 640 | :value (format " %s" theme) |
| 641 | :action 'widget-parent-action | 641 | :action #'widget-parent-action |
| 642 | :help-echo help-echo) | 642 | :help-echo help-echo) |
| 643 | (widget-insert " -- " | 643 | (widget-insert " -- " |
| 644 | (propertize (custom-theme-summary theme) | 644 | (propertize (custom-theme-summary theme) |