summaryrefslogtreecommitdiff
path: root/lisp/custom.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Remove some useless commentsStefan Kangas2021-04-161-2/+0
|
* Don't override load-path in require-themeBasil L. Contovounesios2021-03-051-2/+2
| | | | | | * lisp/custom.el (require-theme): Open-code 'require' error, because binding load-path can prevent other libraries from loading on error, such as debug.el, which gives a misleading error. (Bug#45068)
* Decouple require-theme from load-themeBasil L. Contovounesios2021-03-041-22/+24
| | | | | | | | | | | | | | | | | * lisp/custom.el (require-theme): Refashion after 'require', as a function for loading only named features. Do not call load-theme (bug#45068). * etc/NEWS: Update its announcement accordingly. * doc/lispref/customize.texi (Custom Themes): Document it. * etc/themes/modus-operandi-theme.el: * etc/themes/modus-vivendi-theme.el: Remove redundant calls to 'provide'. * test/lisp/custom-tests.el (custom-tests--with-temp-dir): New macro. (custom-theme--load-path): Use it. (custom-tests-require-theme): New test.
* Add 'require-theme' functionProtesilaos Stavrou2021-03-011-0/+24
| | | | | | | | | * etc/NEWS: Document new function. * lisp/custom.el (require-theme): Add function. This follows from the discussion on bug#45068 where it became apparent that there was no equivalent mechanism to 'require' that read through the 'custom-theme-load-path'.
* * lisp/gnus/gnus-art.el: Fix misuse of `standard-value`.Stefan Monnier2021-02-021-1/+5
| | | | | | | | | | * lisp/custom.el (custom--standard-value): New function. * lisp/gnus/gnus-art.el: (gnus-article-browse-html-parts) (gnus-article-browse-html-article): * lisp/dired-aux.el (dired-do-find-regexp-and-replace): * lisp/emacs-lisp/package-x.el (package-upload-buffer-internal): * lisp/startup.el (command-line): Use it.
* * lisp/startup.el: Fix bug#45857, bug#30994, and bug#45913.Stefan Monnier2021-01-191-11/+1
| | | | | | | | | | | | | | | (command-line): Don't re-evaluate the `custom-delayed-init-variables` a second time after reading the `early-init.el` file. (x-apply-session-resources): Set `blink-cursor-mode` rather than `no-blinking-cursor`. * lisp/frame.el (blink-cursor-start): Turn `blink-cursor-mode` off if `blink-cursor-mode` was set to nil. (blink-cursor-mode): Default to it being enabled regardless of `window-system`. * lisp/custom.el (custom-initialize-delay): Fox docstring now that autoload.el preserves the `:initialize` info.
* Fix marking "delayed-initialization" vars as dynamically scopedStefan Monnier2021-01-141-5/+6
| | | | | | | | | | | | | We used to mark those vars as dynbound in `custom-reevaluate-setting` which forced us to bind `current-load-list` around it to avoid having the vars be associated with the wrong file. Move this marking to `custom-initialize-delay` so we don't need this workaround. * lisp/custom.el (custom-initialize-delay): Mark the var as dynamic. (custom-reevaluate-setting): Don't use `defvar` here. * lisp/startup.el (command-line): Don't let-bind `current-load-list` around calls to `custom-reevaluate-setting`.
* ; * lisp/custom.el (defcustom): Fix last change.Basil L. Contovounesios2021-01-101-2/+2
|
* Add a link to the manual from the defcustom doc stringLars Ingebrigtsen2021-01-101-0/+2
| | | | | * lisp/custom.el (defcustom): Add a link to the manual for the :type element.
* * lisp/emacs-lisp/autoload.el: Improve last changeStefan Monnier2021-01-051-2/+6
| | | | | | | | | | | | | | | | | It turns out there were other places that used `custom-initialize-delay` on autoloaded variables and used various hacks to make it work with `autoload.el`. The new code makes those hacks unneeded. Also, there's no point trying to "optimize" those rare cases anyway, so I simplified the `autoload.el` code for those cases. (make-autoload): For non-trivial cases, just include the whole `defcustom` instead of trying to mimic it. * lisp/mail/rmail.el (rmail-spool-directory): Remove hacks. * lisp/info.el (Info-default-directory-list): Remove `progn` hack. * lisp/custom.el (custom-declare-variable) (custom-handle-all-keywords): Don't use pseudo-group `nil`.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Merge from origin/emacs-27Michael Albinus2020-11-251-3/+7
|\ | | | | | | | | | | 6442cdc0e4 Revert extra focus redirection in do_switch_frame (Bug#24803) fc4379f1ae Minor cleanup of tramp-tests.el on MS Windows dea3d6aa18 Fix handling of defcustom :local tag
| * Fix handling of defcustom :local tagBasil L. Contovounesios2020-11-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | For discussion, see the following emacs-devel thread: https://lists.gnu.org/r/emacs-devel/2020-11/msg00734.html * lisp/custom.el (custom-declare-variable): Delay call to make-variable-buffer-local until after user option has been initialized with a value. Otherwise the user option may be initialized to nil. * test/lisp/custom-tests.el (custom--test-local-option) (custom--test-permanent-option): New :local user options. (custom-test-local-option): New test for defcustom :local keyword.
* | Go back to not using custom-push-theme when enabling a themeMauro Aranda2020-11-061-2/+24
| | | | | | | | | | | | | | | | | | * lisp/custom.el (enable-theme): Relying on custom-push-theme to handle theme settings and prior user settings was a mistake. The theme settings haven't changed between loading the theme and enabling it, so we don't need all of what custom-push-theme does. However, we still need to save a user setting outside of Customize, in order to be able to get back to it, so do that in enable-theme itself.
* | custom-theme-set-variables more resilient against removed librariesLars Ingebrigtsen2020-11-011-1/+4
| | | | | | | | | | * lisp/custom.el (custom-theme-set-variables): Don't bug out on settings that require a library that has been removed (bug#38843).
* | Preserve user customizations after disabling a themeMauro Aranda2020-09-051-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/custom.el (enable-theme): Since we are enabling the theme, bind custom--inhibit-theme-enable to nil. Then rely on custom-push-theme to do the right thing with the theme settings and prior user settings, instead of manipulating the property here. This way, when disabling a theme, we restore user preferences, even when the values were changed outside of customize. (disable-theme): Call custom-push-theme instead of handling theme settings directly. (custom-push-theme): Avoid another instance of Bug#28904: we don't need the changed theme when the value recorded for it is going to be the same as the recorded for the user theme. * test/lisp/custom-tests.el (custom--test-theme-variables): Get rid of a portion of the test that will always fail, because the user theme has priority over every other theme. Expect the test to pass now that we preserve user customizations after disabling a theme (bug#34027).
* | Keep the user theme in sync when marking a variable as setMauro Aranda2020-08-271-0/+3
| | | | | | | | | | | | | | * lisp/custom.el (customize-mark-as-set): Keep the user theme in sync even if the new value of the variable is the saved-value or the standard-value. If we don't do this, custom themes might end up stepping over the user preferences in a session (bug#28904).
* | * lisp/custom.el (custom-add-choice): Fix previous commit.Juri Linkov2020-08-091-2/+2
| |
* | Add new utility function custom-add-choiceLars Ingebrigtsen2020-08-081-0/+14
|/ | | | * lisp/custom.el (custom-add-choice): New function (bug#41225).
* Fix saving multiple themesMauro Aranda2020-01-111-1/+1
| | | | | * lisp/custom.el (enable-theme): Be side-effect free when modifying custom-enabled-themes. (Bug#19999)
* Fix reverting customizationsEli Zaretskii2020-01-011-1/+4
| | | | | | * lisp/custom.el (custom-push-theme): Don't use setcar to modify the recorded value of PROP; instead, cons a new property list by deleting the old value and adding the new one. (Bug#38812)
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Correct small misprint in defcustom's docstringFilipp Gunbin2019-11-251-1/+1
| | | | * lisp/custom.el (defcustom): Correct misprint in docstring.
* Fix load-theme bug with user-emacs-directoryPaul Eggert2019-09-011-0/+1
| | | | | * lisp/custom.el (custom-theme-directory): Delay initialization, since the value depends on user-emacs-directory (Bug#37256).
* Doc string clarification for defcustomLars Ingebrigtsen2019-08-011-0/+5
| | | | | * lisp/custom.el (defcustom): Mention `custom-declare-variable' in the doc string(bug#22703).
* Add :local specifier to defcustomJuanma Barranquero2019-06-271-0/+8
| | | | | | * lisp/custom.el (custom-declare-variable): Allow the new :local parameter (bug#14591). (defcustom): Document it.
* Go back to "Maintainer: emacs-devel@gnu.org"Paul Eggert2019-05-251-0/+1
| | | | | | Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is no special maintainer for a file. Although this wasn't documented it was common practice and removing the lines didn't have consensus.
* Fixes for "Maintainer:" and related linesPaul Eggert2019-05-191-1/+0
| | | | | | Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines, which are not that useful. It also cleans up and regularizes a few similar lines.
* * lisp/custom.el: Avoid adding vars to load-history multiple timesStefan Monnier2019-05-061-10/+11
| | | | | | | | | | | | | | | Avoid the abuse of (eval `(defvar ...)) which tends to end up adding redundant entries in `load-history`, as discussed in https://lists.gnu.org/r/help-gnu-emacs/2019-03/msg00237.html (custom-initialize-default): Don't add to load-history. (custom-declare-variable): Use internal--define-uninitialized-variable and only add the var to load-history once. Do it before calling `initialize` so the special-variable-p flag is set. * src/eval.c (Finternal__define_uninitialized_variable): New function. (Fdefvar, Fdefconst): Use it. (syms_of_eval): Defsubr' it.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Minor custom.el simplificationsBasil L. Contovounesios2018-07-131-57/+46
| | | | | | | | | | | | | | * lisp/custom.el (custom-quote): Duplicate macroexp-quote. (custom-load-symbol, customize-mark-to-save, customize-mark-as-set) (custom-theme-name-valid-p, enable-theme, custom-enabled-themes) (disable-theme): Simplify logic.
* | * lisp/custom.el: Use lexical-bindingBasil L. Contovounesios2018-07-131-25/+25
| | | | | | | | | | | | Remove duplicate 'Custom Themes' comment heading. (deftheme, custom-declare-theme): Fix advertised calling convention. (custom-enabled-themes): Fix message grammar.
* | Fix custom-available-themes file expansionBasil L. Contovounesios2018-07-131-10/+16
| | | | | | | | | | | | | | | | | | | | For discussion, see thread starting at https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00222.html. * lisp/custom.el: (custom-available-themes): Use directory-files instead of performing arbitrary wildcard expansion in file names. (custom-theme--load-path): Document return value. * test/lisp/custom-tests.el: New file. (custom-theme--load-path): New test.
* | Improve loading of byte-compiled custom themesBasil L. Contovounesios2018-07-131-37/+41
| | | | | | | | | | | | | | | | * lisp/custom.el (load-theme): Load byte-compiled file of safe themes when available. https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00614.html https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00060.html
* | Apply non-user themes only when askedDaniel Colascione2018-06-161-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Theme settings now generally aren't actually applied until a call to `enable-theme-, either one made explicitly or implicitly through `load-theme' with NO-ENABLE nil. This change has the effect of not applying theme changes just because we load a lisp file containing a theme specification. The previous behavior is preserved for the special case of the `user' theme, which is frequently used for ad-hoc customization. * lisp/cus-face.el (custom-theme-set-faces): Call `custom--should-apply-setting' to decide whether to apply a setting. * lisp/custom.el (custom--should-apply-setting): New function. (custom--inhibit-theme-enable): Add `apply-only-user' option; default to it. (custom-push-theme, custom-theme-set-variables): Call `custom--should-apply-setting' to decide whether to apply a setting.
* | Clarify that enabling a theme does not disable other themesDaniel Colascione2018-06-121-2/+11
|/ | | | | | | | Avoid user confusion by explicitly stating that enabling a theme does not imply disabling other themes and that theme load functions are not theme switch functions. * lisp/custom.el (load-theme, enable-theme): Clarify docstrings.
* * lisp/custom.el (defcustom): Fix docstring (Bug#27891).Noam Postavsky2018-01-301-1/+2
|
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* ; * lisp/custom.el: Comments.Glenn Morris2017-02-211-2/+9
|
* Tweak recent custom-reevaluate-setting changeGlenn Morris2017-02-211-11/+7
| | | | | * lisp/custom.el (custom-reevaluate-setting): Tweak previous change to avoid font-lock init issues.
* Ensure delayed-init custom variables get marked specialGlenn Morris2017-02-201-3/+11
| | | | | * lisp/custom.el (custom-reevaluate-setting): If the variable has never been set, defvar it. (Bug#25770)
* Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | Run admin/update-copyright.
* Grammar fix in doc stringWieland Hoffmann2016-02-211-1/+1
| | | | | | * lisp/custom.el (defgroup): Grammar fix in doc string. Copyright-paperwork-exempt: yes
* * lisp/custom.el (defface): Revert indentation change. (Bug#22524)Leo Liu2016-02-051-2/+1
|
* * lisp/custom.el (defcustom): Doc fix.Glenn Morris2016-01-281-0/+1
| | | | | * doc/lispref/customize.texi (Variable Definitions): Defcustom should always have a type.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* * lisp/custom.el (custom-declare-variable): Shorten code againArtur Malabarba2015-10-251-8/+7
| | | | | | Without using pcase this time. We can't use pcase because it is loaded after custom in loadup.el. Also add a comment explaining this to future dummies like me.
* Revert commit that broke 'make bootstrap'Paul Eggert2015-10-251-23/+34
| | | | | | * lisp/custom.el (custom-declare-variable): Revert commit 79fac080d277fed07b3c192890ad59d36d9f83b6. custom.el needs to work even when pcase has not been defined yet, when doing bootstrapping.