aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/variables.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lispref/variables.texi')
-rw-r--r--doc/lispref/variables.texi16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 29a272eec92..e89b28eb0c0 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -617,6 +617,8 @@ float-pi
617 617
618@node Tips for Defining 618@node Tips for Defining
619@section Tips for Defining Variables Robustly 619@section Tips for Defining Variables Robustly
620@cindex variables, naming conventions
621@cindex naming conventions, variables
620 622
621 When you define a variable whose value is a function, or a list of 623 When you define a variable whose value is a function, or a list of
622functions, use a name that ends in @samp{-function} or 624functions, use a name that ends in @samp{-function} or
@@ -659,6 +661,7 @@ The value is a whole shell command.
659@item @dots{}-switches 661@item @dots{}-switches
660The value specifies options for a command. 662The value specifies options for a command.
661 663
664@cindex internal variables, naming conventions
662@item @var{prefix}--@dots{} 665@item @var{prefix}--@dots{}
663The variable is intended for internal use and is defined in the file 666The variable is intended for internal use and is defined in the file
664@file{@var{prefix}.el}. (Emacs code contributed before 2018 may 667@file{@var{prefix}.el}. (Emacs code contributed before 2018 may
@@ -2653,6 +2656,19 @@ This macro returns the connection-local value of @var{symbol} for
2653 2656
2654If @var{symbol} does not have a connection-local 2657If @var{symbol} does not have a connection-local
2655binding, the value is the default binding of the variable. 2658binding, the value is the default binding of the variable.
2659
2660The difference to @code{with-connection-local@{-application@}-variables}
2661is, that @code{symbol} is not set buffer-local. A typical usage pattern
2662is to use only the the connection value of a variable if it exists, and
2663not to use its default value otherwise (using @code{my-app-variable}
2664initialized above):
2665
2666@lisp
2667(if (connection-local-p my-app-variable 'my-app)
2668 (connection-local-value my-app-variable 'my-app)
2669 ;; Something else.
2670 )
2671@end lisp
2656@end defmac 2672@end defmac
2657 2673
2658@defvar enable-connection-local-variables 2674@defvar enable-connection-local-variables