summaryrefslogtreecommitdiff
path: root/doc/lispref/variables.texi
Commit message (Collapse)AuthorAge
* Disallow creation of circular variable alias chainsMattias Engdegård2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | Make `defvaralias` signal an error upon attempts to create variable alias cycles. This detects errors earlier and makes the alias traversal during execution simpler and faster since no cycle detection is needed elsewhere. Now variable and function aliases are handled identically in these respects. * src/lisp.h (indirect_variable): Remove declaration. * src/data.c (indirect_variable): Remove. (Findirect_variable): Update doc string. Simplify alias resolution. (Fboundp, find_symbol_value, set_internal, default_value) (set_default_internal, Fmake_variable_buffer_local) (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p) (Flocal_variable_if_set_p, Fvariable_binding_locus): * src/buffer.c (buffer_local_value): * src/eval.c (specbind): Simplify variable alias resolution. (Fdefvaralias): Update doc string. Check for cycles. * doc/lispref/variables.texi (Variable Aliases): Mention that `defvaralias` can signal `cyclic-variable-indirection` but `indirect-variable` cannot. * etc/NEWS: Announce the change. * test/src/eval-tests.el (eval-tests-defvaralias): New test.
* ; * doc/lispref/variables.texi (File Local Variables): Improve indexing.Eli Zaretskii2023-01-28
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* ; Improve documentation of 'setopt'Eli Zaretskii2022-12-18
| | | | | * doc/lispref/variables.texi (Setting Variables): Note about the differences between 'setopt' and 'customize-set-variable'.
* ; Improve description of scoping and let-bindingsEli Zaretskii2022-12-14
| | | | | | | * doc/lispref/variables.texi (Local Variables, Variable Scoping): Explain the move to lexical-binding and elaborate on 'let*'. Suggested by Michael Heerdegen <michael_heerdegen@web.de>. (Bug#60027)
* (Ffunction): Make interpreted closures safe for spaceStefan Monnier2022-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interpreted closures currently just grab a reference to the complete lexical environment, so (lambda (x) (+ x y)) can end up looking like (closure ((foo ...) (y 7) (bar ...) ...) (x) (+ x y)) where the foo/bar/... bindings are not only useless but can prevent the GC from collecting that memory (i.e. it's a representation that is not "safe for space") and it can also make that closure "unwritable" (or more specifically, it can cause the closure's print representation to be u`read`able). Compiled closures don't suffer from this problem because `cconv.el` actually looks at the code and only stores in the compiled closure those variables which are actually used. So, we fix this discrepancy by letting the existing code in `cconv.el` tell `Ffunction` which variables are actually used by the body of the function such that it can filter out the irrelevant elements and return a closure of the form: (closure ((y 7)) (x) (+ x y)) * lisp/loadup.el: Preload `cconv` and set `internal-filter-closure-env-function` once we have a usable `cconv-fv`. * lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): Adjust to new calling convention of `cconv-closure-convert`. (byte-compile-not-lexical-var-p): Delete function, moved to `cconv.el`. (byte-compile-bind): Use `cconv--not-lexical-var-p`. * lisp/emacs-lisp/cconv.el (cconv--dynbound-variables): New var. (cconv-closure-convert): New arg `dynbound-vars` (cconv--warn-unused-msg): Remove special case for `ignored`, so we don't get confused when a function uses an argument called `ignored`, e.g. holding a list of things that it should ignore. (cconv--not-lexical-var-p): New function, moved from `bytecomp.el`. Don't special case keywords and `nil` and `t` since they are already `special-variable-p`. (cconv--analyze-function): Use `cconv--not-lexical-var-p`. (cconv--dynbindings): New dynbound var. (cconv-analyze-form): Use `cconv--not-lexical-var-p`. Remember in `cconv--dynbindings` the vars for which we used dynamic scoping. (cconv-analyze-form): Use `cconv--dynbound-variables` rather than `byte-compile-bound-variables`. (cconv-fv): New function. * src/eval.c (Fsetq, eval_sub): Remove optimization designed when `lexical-binding == nil` was the common case. (Ffunction): Use `internal-filter-closure-env-function` when available. (eval_sub, Ffuncall): Improve error info for `excessive_lisp_nesting`. (internal-filter-closure-env-function): New defvar.
* Add helpers to dynamically assign connection-local valuesJim Porter2022-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/files-x.el (connection-local-criteria) (connection-local-profile-name-for-setq): New variables. (with-connection-local-variables-1): ... let-bind them here. (connection-local-update-profile-variables) (connection-local-profile-name-for-criteria): New functions. (with-connection-local-application-variables, setq-connection-local): New macros. * test/lisp/files-x-tests.el: Require 'tramp-integration' (files-x-test--variable5, remote-lazy-var): New variables. (files-x-test-hack-connection-local-variables-apply): Expand checks. (files-x-test-with-connection-local-variables): Remove 'hack-connection-local-variables-apply' check (it belongs in the above test), and expand some other checks. (files-x-test--get-lazy-var, files-x-test--set-lazy-var): New functions. (files-x-test-connection-local-update-profile-variables) (files-x-test-setq-connection-local): New tests. * doc/lispref/variables.texi (Connection Local Variables): Split into two subsections and document the new features. * etc/NEWS: Announce 'setq-connection-local'.
* ; Remove over-quoting of :application values in connection-local variablesJim Porter2022-10-17
| | | | | | | * test/lisp/files-x-tests.el (files-x-test--application) (files-x-test--another-application): * doc/lispref/variables.texi (Connection Local Variables): Remove extra quotes.
* Mention cond/if as generalized variables in the manualLars Ingebrigtsen2022-10-04
| | | | | * doc/lispref/variables.texi (Setting Generalized Variables): Mention cond and if (bug#52290).
* Merge from origin/emacs-28Stefan Kangas2022-09-23
|\ | | | | | | | | 60ac12d21f Fix shaping with bitmap-only fonts on HarfBuzz 5.2.0 (Bug#... 9f65e52362 ; Minor copyedits of elisp.texi
| * ; Minor copyedits of elisp.texiEli Zaretskii2022-09-22
| | | | | | | | | | * doc/lispref/variables.texi (Setting Generalized Variables): Improve wording.
* | Abolish max-specpdl-size (bug#57911)Mattias Engdegård2022-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The max-lisp-eval-depth limit is sufficient to prevent unbounded stack growth including the specbind stack; simplify matters for the user by not having them to worry about two different limits. This change turns max-specpdl-size into a harmless variable with no effects, to keep existing code happy. * lisp/subr.el (max-specpdl-size): Define as an ordinary (but obsolete) dynamic variable. * admin/grammars/Makefile.in: * doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion): * doc/lispref/control.texi (Cleanups): * doc/lispref/edebug.texi (Checking Whether to Stop): * doc/lispref/eval.texi (Eval): * doc/lispref/variables.texi (Local Variables): * doc/misc/calc.texi (Recursion Depth): Update documentation. * etc/NEWS: Announce. * src/eval.c (FletX): Use safe iteration to guard against circular bindings list. (syms_of_eval): Remove old max-specpdl-size definition. (init_eval_once, restore_stack_limits, call_debugger) (signal_or_quit, grow_specpdl_allocation): * leim/Makefile.in: * lisp/Makefile.in: * lisp/calc/calc-stuff.el (calc-more-recursion-depth) (calc-less-recursion-depth): * lisp/calc/calc.el (calc-do): * lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules): * lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package): * lisp/cus-start.el (standard): * lisp/emacs-lisp/comp.el (comp--native-compile): * lisp/emacs-lisp/edebug.el (edebug-max-depth): (edebug-read-and-maybe-wrap-form, edebug-default-enter): * lisp/emacs-lisp/regexp-opt.el (regexp-opt): * lisp/eshell/esh-mode.el (eshell-mode): * lisp/loadup.el (max-specpdl-size): * lisp/mh-e/mh-e.el (mh-invisible-headers): * lisp/net/shr.el (shr-insert-document, shr-descend): * lisp/play/hanoi.el (hanoi-internal): * lisp/progmodes/cperl-mode.el: * src/fileio.c (Fdo_auto_save): Remove references to and modifications of max-specpdl-size.
* | Raise default max-specpdl-size and max-lisp-eval-depthMattias Engdegård2022-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes have caused bootstrapping to fail for certain configurations, and it was likely getting close to the limits for others. This change raises the limits to those previously used when configured for nativecomp: max-specpdl-size raised from 1800 to 2500 max-lisp-eval-depth raised from 800 to 1600 * src/eval.c (init_eval_once): Raise limits. * doc/lispref/eval.texi (Eval): * doc/lispref/variables.texi (Local Variables): Document new values.
* | Fix generalized variable documentation for recent changeStefan Kangas2022-08-25
| | | | | | | | | | * doc/lispref/variables.texi (Setting Generalized Variables): Delete obsolete generalized variable 'frame-width'.
* | ; Sort list of generalized variablesStefan Kangas2022-08-24
| | | | | | | | | | * doc/lispref/variables.texi (Setting Generalized Variables): Sort list of generalized variables alphabetically.
* | Move generalized variable `substring' doc to elisp manualStefan Kangas2022-08-23
| | | | | | | | | | | | | | * doc/misc/cl.texi (Setf Extensions): Move documentation on 'substring' generalized variable from here... * doc/lispref/variables.texi (Setting Generalized Variables): ...to here.
* | Move generalized variable docs to elisp manualStefan Kangas2022-08-23
| | | | | | | | | | | | | | | | * doc/misc/cl.texi (Setf Extensions): Delete documentation on obsolete generalized variable 'buffer-substring'. Move documentation on generalized variables from here... * doc/lispref/variables.texi (Setting Generalized Variables): ...to here. These variables have already been moved to gv.el.
* | Make it possible to mark generalized variables as obsoleteLars Ingebrigtsen2022-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/variables.texi (Adding Generalized Variables): Document it. * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Alter the interface so that it can also be used by generalized variable warnings. (byte-compile-function-warn): Adjust caller. (byte-compile-check-variable): Adjust caller. * lisp/emacs-lisp/gv.el (gv-get): Warn about obsolete generalized variables (bug#49730). (make-obsolete-generalized-variable): New function.
* | ; Fix typosStefan Kangas2022-07-14
| |
* | Merge from origin/emacs-28Stefan Kangas2022-07-14
|\| | | | | | | | | | | | | | | | | | | | | | | 5e47ec9511 ; * lisp/url/url-http.el (url-http-parse-headers): Fix typo. ba0871bef1 ; Fix typos: prefer American spelling e3e7f31faa Adapt Tramp doc # Conflicts: # etc/NEWS # etc/themes/modus-themes.el # lisp/emacs-lisp/byte-opt.el # test/lisp/so-long-tests/spelling-tests.el
| * ; Fix typos: prefer American spellingStefan Kangas2022-07-13
| |
* | eval.c: New functions `defvar-1` and `defconst-1` (bug#55156)Stefan Monnier2022-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bytecode interpreter can't directly call special forms, so the byte-compiler usually converts special forms into some sequence of byte codes (basically, providing a duplicate definition of the special form). There are still two exceptions to this: `defconst` and `defvar`, where the compiler instead generates a convoluted chunk of code like: (funcall '(lambda (x) (defvar <sym> x <doc>)) <value>) where the quote makes sure we keep the function non-compiled, so as to end up running the special form at run time. Get rid of this workaround by introducing `defvar-1` and `defconst-1` which provide a *functional* interface to the functionality of the corresponding special form. * src/eval.c (defvar, Fdefvar_1, Fdefconst_1): New functions, extracted from `Fdefvar` and `Fdefconst`. (Fdefvar, Fdefconst): Use them. (syms_of_eval): `defsubr` the new functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-tmp-var): Delete const. (byte-compile-defvar): Simplify using the new functions. * doc/lispref/variables.texi (Defining Variables): Adjust the doc of `defvar` to reflect the actual semantics implemented.
* | * lisp/emacs-lisp/macroexp.el (macroexp-let2*): Allow common shorthandStefan Monnier2022-04-11
| |
* | Extend connection-local variables example in Elisp manualMichael Albinus2022-03-20
| | | | | | | | | | * doc/lispref/variables.texi (Connection Local Variables): Explain, how to append variable settings to an existing profile.
* | Make application configurable in 'with-connection-local-variables'Michael Albinus2022-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/variables.texi (Connection Local Variables): Explain 'connection-local-default-application'. * etc/NEWS: Mention 'connection-local-default-application'. * lisp/files-x.el (connection-local-default-application): New variable. (connection-local-criteria-for-default-directory): Use it. (Bug#54405) * test/lisp/files-x-tests.el (files-x-test-with-connection-local-variables): Extend test.
* | Have setopt check typesLars Ingebrigtsen2022-02-17
| | | | | | | | | | | | | | * doc/lispref/variables.texi (Setting Variables): Note type checking. * lisp/cus-edit.el (setopt--set): New function to avoid having Customize saving values, too. (setopt): Use it.
* | ; * doc/lispref/variables.texi (Setting Variables): Fix a typo.Aleksandr Vityazev2022-02-15
| |
* | ; * doc/lispref/variables.texi (Setting Variables): Fix markup.Eli Zaretskii2022-02-14
| |
* | Add a new macro `setopt'Lars Ingebrigtsen2022-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/custom.texi (Examining): Mention it. (Init Syntax): Ditto. * doc/emacs/windows.texi (Window Choice): Adjust example. * doc/lispref/windows.texi (Choosing Window Options): Adjust examples. * doc/lispref/variables.texi (Setting Variables): Document setopt. * doc/misc/eudc.texi (Emacs-only Configuration): Adjust examples. * lisp/cus-edit.el (setopt): New macro.
* | Make connection-local variables user optionsMichael Albinus2022-02-07
| | | | | | | | | | | | | | | | * lisp/files-x.el (connection-local-profile-alist) (connection-local-criteria-alist): Make them user options. * doc/lispref/variables.texi (Connection Local Variables): * etc/NEWS: Document this.
* | Merge from origin/emacs-28Eli Zaretskii2022-01-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
| |
| * Revert "Use @pxref when necessary"Eli Zaretskii2021-11-24
| | | | | | | | | | | | This reverts commit b4f47d2ee2203a9f22bebeb3d09e0fb3fce2f65e. Cleanups should not be done on the release branch: that's unnecessary risk.
* | Improve documentation of multisession variablesEli Zaretskii2021-12-16
| | | | | | | | | | * doc/lispref/variables.texi (Multisession Variables): Improve wording and markup, add indexing.
* | Add support for multisession variablesLars Ingebrigtsen2021-12-16
| | | | | | | | | | | | | | | | | | * doc/lispref/elisp.texi (Top): Add to menu. (Top): * doc/lispref/variables.texi (Variables): Ditto. (Multisession Variables): Document multisession variables. * lisp/emacs-lisp/multisession.el: New file.
* | Edit the lispref manual for define-key/keymap-set falloutLars Ingebrigtsen2021-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/variables.texi (Tips for Defining): * doc/lispref/text.texi (Clickable Text): * doc/lispref/modes.texi (Derived Modes): (Example Major Modes): * doc/lispref/loading.texi (Autoload): (Hooks for Loading): * doc/lispref/keymaps.texi (Creating Keymaps): (Inheritance and Keymaps): (Controlling Active Maps): (Changing Key Bindings): (Low-Level Key Binding): (Remapping Commands): (Translation Keymaps): (Key Binding Commands): * doc/lispref/help.texi (Help Functions): * doc/lispref/display.texi (Abstract Display Example): * doc/lispref/commands.texi (Interactive Codes): (Keyboard Events): (Misc Events): (Classifying Events): (Strings of Events): Prefer `keymap-set' instead of `define-key' most places, and use `defvar-keymap' in some of the examples.
* | Merge from origin/emacs-28Eli Zaretskii2021-11-24
|\| | | | | | | b4f47d2 Use @pxref when necessary
| * Use @pxref when necessaryRobert Pluim2021-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/customize.texi (Composite Types): * doc/lispref/edebug.texi (Specification List): * doc/lispref/variables.texi (Local Variables): * doc/misc/efaq.texi (Basic keys): (Informational files for Emacs): * doc/misc/flymake.texi (Locating a master file): * doc/misc/gnus.texi (Don't Panic): (Oort Gnus): * doc/misc/htmlfontify.texi (Non-interactive): * doc/misc/mh-e.texi (More About MH-E): * doc/misc/pcl-cvs.texi (Entering PCL-CVS): * doc/misc/tramp.texi (Remote processes): * doc/misc/vhdl-mode.texi (Indentation Calculation): (Custom Indentation Functions): Use @pxref when inside parens.
* | Add an optional parameter to kill-all-local-variablesLars Ingebrigtsen2021-10-06
|/ | | | | | | | | | | * doc/lispref/variables.texi (Creating Buffer-Local): Document it (bug#30204). * src/buffer.c (Fkill_all_local_variables): Allow killing permanent local variables, too. * src/print.c (temp_output_buffer_setup): * src/minibuf.c (set_minibuffer_mode): Adjust callers.
* * doc/lispref/variables.texi (named-let): Document TCOStefan Monnier2021-09-13
|
* Document named-let and update some NEWS tagsLars Ingebrigtsen2021-09-13
| | | | * doc/lispref/variables.texi (Local Variables): Document `named-let'.
* ; * doc/lispref/variables.texi (Local Variables): Fix indexing.Eli Zaretskii2021-08-23
|
* Document `dlet'Lars Ingebrigtsen2021-08-23
| | | | * doc/lispref/variables.texi (Local Variables): Document `dlet'.
* ; * doc/lispref/variables.texi (File Local Variables): Fix last change.Eli Zaretskii2021-07-18
|
* Fix documentation of a recent changeset (bug#5003)Eli Zaretskii2021-07-18
| | | | | | | | | | | | | * lisp/files.el (safe-local-variable-values) (ignored-local-variable-values): Doc fix. (ignored-local-variable-values): Add :version tag. * doc/emacs/custom.texi (Safe File Variables): Mention 'ignored-local-variable-values'. * doc/lispref/variables.texi (File Local Variables): Fix wording. * etc/NEWS: Improve wording of the 'ignored-local-variable-values' entry.
* Allow ignoring local variable values permanentlyLars Ingebrigtsen2021-07-18
| | | | | | | | | | * doc/lispref/variables.texi (File Local Variables): Document it. * lisp/files.el (ignored-local-variable-values): New user option (bug#5003). (hack-local-variables-confirm): Allow ignoring permanently. (hack-local-variables-filter): Ignore the permanently ignored variables.
* Add new convenience function `buffer-local-boundp'Lars Ingebrigtsen2021-05-31
| | | | | | | * doc/lispref/variables.texi (Creating Buffer-Local): Document it. * lisp/subr.el (buffer-local-boundp): New function. * src/data.c (Flocal_variable_p): Mention it.
* Always heed the `lexical-binding' local variableLars Ingebrigtsen2021-05-10
| | | | | | | | | | | | | * doc/lispref/variables.texi (File Local Variables): Document `permanently-enabled-local-variables'. * lisp/files.el (enable-local-variables): Mention the new variable. (set-auto-mode): Always call `hack-local-variables'. (hack-local-variables): Factor out the variable gathering into its own function, and respect the new variable (bug#47843). (hack-local-variables--find-variables): Factored out from `hack-local-variables'. (permanently-enabled-local-variables): New variable.
* * Add a note related to native compilation and Dynamic BindingAndrea Corallo2021-04-28
| | | | | * doc/lispref/variables.texi (Dynamic Binding): Add a note related to native compilation.
* Remove several references to Emacs 22 and earlierStefan Kangas2021-03-10
| | | | | | | | | | | | | | | | | | | | | | * admin/charsets/mapfiles/README: * doc/emacs/custom.texi (Saving Customizations): * doc/lispintro/emacs-lisp-intro.texi (Simple Extension): * doc/misc/efaq-w32.texi (Location of init file): * doc/misc/gnus-faq.texi (FAQ 1-3): * doc/misc/gnus.texi (Top, Various, Image Enhancements): * lisp/erc/erc-menu.el (menu): * lisp/progmodes/cfengine.el (cfengine-fill-paragraph): Remove some references to Emacs 22 and earlier. * doc/lispref/buffers.texi: * doc/lispref/eval.texi: * doc/lispref/files.texi: * doc/lispref/keymaps.texi: * doc/lispref/loading.texi: * doc/lispref/minibuf.texi: * doc/lispref/positions.texi: * doc/lispref/variables.texi: Remove comments about "Emacs 19 specific" features.