comparison lispref/variables.texi @ 83311:c016d82bf02b

Merged from miles@gnu.org--gnu-2005 (patch 423-434) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-423 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-424 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425 Remove "-face" suffix from gnus faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-426 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-427 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-428 Remove "-face" suffix from MH-E faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-429 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-430 Remove "-face" suffix from cc-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431 Remove "-face" suffix from eshell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-432 Remove "-face" suffix from ediff faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-433 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-434 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-351
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 21 Jun 2005 15:42:45 +0000
parents 5565eb3af021
children 443baf51aba7
comparison
equal deleted inserted replaced
83310:e58cb448e07c 83311:c016d82bf02b
1720 If a file local variable could specify a function that would 1720 If a file local variable could specify a function that would
1721 be called later, or an expression that would be executed later, simply 1721 be called later, or an expression that would be executed later, simply
1722 visiting a file could take over your Emacs. To prevent this, Emacs 1722 visiting a file could take over your Emacs. To prevent this, Emacs
1723 takes care not to allow to set such file local variables. 1723 takes care not to allow to set such file local variables.
1724 1724
1725 For one thing, any variable whose name ends in @samp{-command}, 1725 For one thing, any variable whose name ends in any of
1726 @samp{-frame-alist}, @samp{-function}, @samp{-functions}, 1726 @samp{-command}, @samp{-frame-alist}, @samp{-function},
1727 @samp{-hook}, @samp{-hooks}, @samp{-form}, @samp{-forms}, @samp{-map}, 1727 @samp{-functions}, @samp{-hook}, @samp{-hooks}, @samp{-form},
1728 @samp{-map-alist}, @samp{-mode-alist}, @samp{-program}, or 1728 @samp{-forms}, @samp{-map}, @samp{-map-alist}, @samp{-mode-alist},
1729 @samp{-predicate} cannot be given a file local value. In general, 1729 @samp{-program}, or @samp{-predicate} cannot be given a file local
1730 you should use such a name whenever it is appropriate for the 1730 value. In general, you should use such a name whenever it is
1731 variable's meaning. The variables @samp{font-lock-keywords}, 1731 appropriate for the variable's meaning. The variables
1732 @samp{font-lock-keywords-[0-9]}, and 1732 @samp{font-lock-keywords}, @samp{font-lock-keywords} followed by a
1733 @samp{font-lock-syntactic-keywords} cannot be given file local values either. 1733 digit, and @samp{font-lock-syntactic-keywords} cannot be given file
1734 These rules can be overridden by giving the variable's 1734 local values either. These rules can be overridden by giving the
1735 name a non-@code{nil} @code{safe-local-variable} property. If one 1735 variable's name a non-@code{nil} @code{safe-local-variable} property.
1736 gives it a @code{safe-local-variable} property of @code{t}, then one 1736 If one gives it a @code{safe-local-variable} property of @code{t},
1737 can give the variable any file local value. One can also give any 1737 then one can give the variable any file local value. One can also
1738 symbol, including the above, a @code{safe-local-variable} property 1738 give any symbol, including the above, a @code{safe-local-variable}
1739 that is a function taking exactly one argument. In that case, giving 1739 property that is a function taking exactly one argument. In that
1740 a variable with that name a file local value is only allowed if the 1740 case, giving a variable with that name a file local value is only
1741 function returns non-@code{nil} when called with that value as 1741 allowed if the function returns non-@code{nil} when called with that
1742 argument. 1742 value as argument.
1743 1743
1744 In addition, any variable whose name has a non-@code{nil} 1744 In addition, any variable whose name has a non-@code{nil}
1745 @code{risky-local-variable} property is also ignored. So are all 1745 @code{risky-local-variable} property is also ignored. So are all
1746 variables listed in @code{ignored-local-variables}: 1746 variables listed in @code{ignored-local-variables}:
1747 1747
1783 variable---either because you realize its old name was not well 1783 variable---either because you realize its old name was not well
1784 chosen, or because its meaning has partly changed---it can be useful 1784 chosen, or because its meaning has partly changed---it can be useful
1785 to keep the old name as an @emph{alias} of the new one for 1785 to keep the old name as an @emph{alias} of the new one for
1786 compatibility. You can do this with @code{defvaralias}. 1786 compatibility. You can do this with @code{defvaralias}.
1787 1787
1788 @defun defvaralias alias-var base-var &optional docstring 1788 @defun defvaralias new-alias base-variable &optional docstring
1789 This function defines the symbol @var{alias-var} as a variable alias 1789 This function defines the symbol @var{new-alias} as a variable alias
1790 for symbol @var{base-var}. This means that retrieving the value of 1790 for symbol @var{base-variable}. This means that retrieving the value of
1791 @var{alias-var} returns the value of @var{base-var}, and changing the 1791 @var{new-alias} returns the value of @var{base-variable}, and changing the
1792 value of @var{alias-var} changes the value of @var{base-var}. 1792 value of @var{new-alias} changes the value of @var{base-variable}.
1793 1793
1794 If the @var{docstring} argument is non-@code{nil}, it specifies the 1794 If the @var{docstring} argument is non-@code{nil}, it specifies the
1795 documentation for @var{alias-var}; otherwise, the alias gets the same 1795 documentation for @var{new-alias}; otherwise, the alias gets the same
1796 documentation as @var{base-var} has, if any, unless @var{base-var} is 1796 documentation as @var{base-variable} has, if any, unless
1797 itself an alias, in which case @var{alias-var} gets the documentation 1797 @var{base-variable} is itself an alias, in which case @var{new-alias} gets
1798 of the variable at the end of the chain of aliases. 1798 the documentation of the variable at the end of the chain of aliases.
1799 1799
1800 This function returns @var{base-var}. 1800 This function returns @var{base-variable}.
1801 @end defun 1801 @end defun
1802 1802
1803 Variable aliases are convenient for replacing an old name for a 1803 Variable aliases are convenient for replacing an old name for a
1804 variable with a new name. @code{make-obsolete-variable} declares that 1804 variable with a new name. @code{make-obsolete-variable} declares that
1805 the old name is obsolete and therefore that it may be removed at some 1805 the old name is obsolete and therefore that it may be removed at some
1806 stage in the future. 1806 stage in the future.
1807 1807
1808 @defun make-obsolete-variable variable new &optional when 1808 @defun make-obsolete-variable obsolete-name current-name &optional when
1809 This function makes the byte-compiler warn that the variable 1809 This function makes the byte-compiler warn that the variable
1810 @var{variable} is obsolete. If @var{new} is a symbol, it is the 1810 @var{obsolete-name} is obsolete. If @var{current-name} is a symbol, it is
1811 variable's new name; then the warning message says to use @var{new} 1811 the variable's new name; then the warning message says to use
1812 instead of @var{variable}. If @var{new} is a string, this is the 1812 @var{current-name} instead of @var{obsolete-name}. If @var{current-name}
1813 message and there is no replacement variable. 1813 is a string, this is the message and there is no replacement variable.
1814 1814
1815 If provided, @var{when} should be a string indicating when the 1815 If provided, @var{when} should be a string indicating when the
1816 variable was first made obsolete---for example, a date or a release 1816 variable was first made obsolete---for example, a date or a release
1817 number. 1817 number.
1818 @end defun 1818 @end defun
1819 1819
1820 You can make two variables synonyms and declare one obsolete at the 1820 You can make two variables synonyms and declare one obsolete at the
1821 same time using the macro @code{define-obsolete-variable-alias}. 1821 same time using the macro @code{define-obsolete-variable-alias}.
1822 1822
1823 @defmac define-obsolete-variable-alias variable new &optional when docstring 1823 @defmac define-obsolete-variable-alias obsolete-name current-name &optional when docstring
1824 This macro marks the variable @var{variable} as obsolete and also 1824 This macro marks the variable @var{obsolete-name} as obsolete and also
1825 makes it an alias for the variable @var{new}. A typical call has the form: 1825 makes it an alias for the variable @var{current-name}. It is
1826 1826 equivalent to the following:
1827 @example 1827
1828 (define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") 1828 @example
1829 @end example 1829 (defvaralias @var{obsolete-name} @var{current-name} @var{docstring})
1830 1830 (make-obsolete-variable @var{obsolete-name} @var{current-name} @var{when})
1831 @noindent
1832 which is equivalent to the following two lines of code:
1833
1834 @example
1835 (defvaralias 'oldvar 'newvar "Doc.")
1836 (make-obsolete-variable 'old-var 'new-var "22.1")
1837 @end example 1831 @end example
1838 @end defmac 1832 @end defmac
1839 1833
1840 @defun indirect-variable variable 1834 @defun indirect-variable variable
1841 This function returns the variable at the end of the chain of aliases 1835 This function returns the variable at the end of the chain of aliases