diff options
Diffstat (limited to 'doc/lispref/variables.texi')
| -rw-r--r-- | doc/lispref/variables.texi | 16 |
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 |
| 622 | functions, use a name that ends in @samp{-function} or | 624 | functions, 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 |
| 660 | The value specifies options for a command. | 662 | The value specifies options for a command. |
| 661 | 663 | ||
| 664 | @cindex internal variables, naming conventions | ||
| 662 | @item @var{prefix}--@dots{} | 665 | @item @var{prefix}--@dots{} |
| 663 | The variable is intended for internal use and is defined in the file | 666 | The 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 | ||
| 2654 | If @var{symbol} does not have a connection-local | 2657 | If @var{symbol} does not have a connection-local |
| 2655 | binding, the value is the default binding of the variable. | 2658 | binding, the value is the default binding of the variable. |
| 2659 | |||
| 2660 | The difference to @code{with-connection-local@{-application@}-variables} | ||
| 2661 | is, that @code{symbol} is not set buffer-local. A typical usage pattern | ||
| 2662 | is to use only the the connection value of a variable if it exists, and | ||
| 2663 | not to use its default value otherwise (using @code{my-app-variable} | ||
| 2664 | initialized 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 |