diff options
| author | Stefan Kangas | 2021-01-31 14:35:44 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-01-31 14:35:44 +0100 |
| commit | 4d635ceffbdfc3f709c09d25d28421e7816ecd8f (patch) | |
| tree | 46db8cb395fb2ab8063fbf309abb6240d45915b8 | |
| parent | 035ef9f5aec01d61ea8b7de353cfbe3d2b15f731 (diff) | |
| download | emacs-4d635ceffbdfc3f709c09d25d28421e7816ecd8f.tar.gz emacs-4d635ceffbdfc3f709c09d25d28421e7816ecd8f.zip | |
Prefer defvar-local in allout
* lisp/allout.el (allout-just-did-undo, allout-mode)
(allout-layout, allout-regexp, allout-bullets-string)
(allout-bullets-string-len, allout-depth-specific-regexp)
(allout-depth-one-regexp, allout-line-boundary-regexp)
(allout-bob-regexp, allout-header-subtraction)
(allout-plain-bullets-string-len, allout-mode-prior-settings)
(allout-outside-normal-auto-fill-function)
(allout-encryption-plaintext-sanitization-regexps)
(allout-encryption-ciphertext-rejection-regexps)
(allout-explicitly-deactivated, allout-recent-prefix-beginning)
(allout-recent-prefix-end, allout-recent-depth)
(allout-recent-end-of-subtree, allout-post-goto-bullet)
(allout-command-counter, allout-this-command-hid-text):
* lisp/allout-widgets.el (allout-widgets-mode)
(allout-widgets-tally, allout-widgets-mode-inhibit)
(allout-inhibit-body-modification-hook)
(allout-widgets-changes-record)
(allout-widgets-undo-exposure-record)
(allout-escaped-prefix-regexp, allout-item-icon-keymap)
(allout-item-body-keymap, allout-cue-span-keymap)
(allout-widgets-last-decoration-timing)
(allout-container-item-widget): Prefer defvar-local.
| -rw-r--r-- | lisp/allout-widgets.el | 36 | ||||
| -rw-r--r-- | lisp/allout.el | 79 |
2 files changed, 39 insertions, 76 deletions
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index d31083e4271..7dcf36851f2 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el | |||
| @@ -78,9 +78,8 @@ | |||
| 78 | ;;; during file load, so the involved code must reside above that | 78 | ;;; during file load, so the involved code must reside above that |
| 79 | ;;; definition in the file. | 79 | ;;; definition in the file. |
| 80 | ;;;_ = allout-widgets-mode | 80 | ;;;_ = allout-widgets-mode |
| 81 | (defvar allout-widgets-mode nil | 81 | (defvar-local allout-widgets-mode nil |
| 82 | "Allout mode enhanced with graphical widgets.") | 82 | "Allout mode enhanced with graphical widgets.") |
| 83 | (make-variable-buffer-local 'allout-widgets-mode) | ||
| 84 | 83 | ||
| 85 | ;;;_ : USER CUSTOMIZATION VARIABLES and incidental functions: | 84 | ;;;_ : USER CUSTOMIZATION VARIABLES and incidental functions: |
| 86 | ;;;_ > defgroup allout-widgets | 85 | ;;;_ > defgroup allout-widgets |
| @@ -243,14 +242,13 @@ decreases as obsolete widgets are garbage collected." | |||
| 243 | :version "24.1" | 242 | :version "24.1" |
| 244 | :type 'boolean | 243 | :type 'boolean |
| 245 | :group 'allout-widgets-developer) | 244 | :group 'allout-widgets-developer) |
| 246 | (defvar allout-widgets-tally nil | 245 | (defvar-local allout-widgets-tally nil |
| 247 | "Hash-table of existing allout widgets, for debugging. | 246 | "Hash-table of existing allout widgets, for debugging. |
| 248 | 247 | ||
| 249 | Table is maintained only if `allout-widgets-maintain-tally' is non-nil. | 248 | Table is maintained only if `allout-widgets-maintain-tally' is non-nil. |
| 250 | 249 | ||
| 251 | The table contents will be out of sync if any widgets are created | 250 | The table contents will be out of sync if any widgets are created |
| 252 | or deleted while this variable is nil.") | 251 | or deleted while this variable is nil.") |
| 253 | (make-variable-buffer-local 'allout-widgets-tally) | ||
| 254 | (defvar allout-widgets-mode-inhibit) ; defined below | 252 | (defvar allout-widgets-mode-inhibit) ; defined below |
| 255 | ;;;_ > allout-widgets-tally-string | 253 | ;;;_ > allout-widgets-tally-string |
| 256 | (defun allout-widgets-tally-string () | 254 | (defun allout-widgets-tally-string () |
| @@ -295,7 +293,7 @@ to publicize it by making it a customization variable)." | |||
| 295 | (message "%s" msg) | 293 | (message "%s" msg) |
| 296 | msg)) | 294 | msg)) |
| 297 | ;;;_ = allout-widgets-mode-inhibit | 295 | ;;;_ = allout-widgets-mode-inhibit |
| 298 | (defvar allout-widgets-mode-inhibit nil | 296 | (defvar-local allout-widgets-mode-inhibit nil |
| 299 | "Inhibit `allout-widgets-mode' from activating widgets. | 297 | "Inhibit `allout-widgets-mode' from activating widgets. |
| 300 | 298 | ||
| 301 | This also inhibits automatic adjustment of widgets to track allout outline | 299 | This also inhibits automatic adjustment of widgets to track allout outline |
| @@ -310,15 +308,13 @@ buffers where this is set to enable and disable widget | |||
| 310 | enhancements, directly.") | 308 | enhancements, directly.") |
| 311 | ;;;###autoload | 309 | ;;;###autoload |
| 312 | (put 'allout-widgets-mode-inhibit 'safe-local-variable 'booleanp) | 310 | (put 'allout-widgets-mode-inhibit 'safe-local-variable 'booleanp) |
| 313 | (make-variable-buffer-local 'allout-widgets-mode-inhibit) | ||
| 314 | ;;;_ = allout-inhibit-body-modification-hook | 311 | ;;;_ = allout-inhibit-body-modification-hook |
| 315 | (defvar allout-inhibit-body-modification-hook nil | 312 | (defvar-local allout-inhibit-body-modification-hook nil |
| 316 | "Override de-escaping of text-prefixes in item bodies during specific changes. | 313 | "Override de-escaping of text-prefixes in item bodies during specific changes. |
| 317 | 314 | ||
| 318 | This is used by `allout-buffer-modification-handler' to signal such changes | 315 | This is used by `allout-buffer-modification-handler' to signal such changes |
| 319 | to `allout-body-modification-handler', and is always reset by | 316 | to `allout-body-modification-handler', and is always reset by |
| 320 | `allout-post-command-business'.") | 317 | `allout-post-command-business'.") |
| 321 | (make-variable-buffer-local 'allout-inhibit-body-modification-hook) | ||
| 322 | ;;;_ = allout-widgets-icons-cache | 318 | ;;;_ = allout-widgets-icons-cache |
| 323 | (defvar allout-widgets-icons-cache nil | 319 | (defvar allout-widgets-icons-cache nil |
| 324 | "Cache allout icon images, as an association list. | 320 | "Cache allout icon images, as an association list. |
| @@ -358,7 +354,7 @@ See \\[describe-mode] for many more options." | |||
| 358 | 354 | ||
| 359 | The structure includes the guides lines, bullet, and bullet cue.") | 355 | The structure includes the guides lines, bullet, and bullet cue.") |
| 360 | ;;;_ = allout-widgets-changes-record | 356 | ;;;_ = allout-widgets-changes-record |
| 361 | (defvar allout-widgets-changes-record nil | 357 | (defvar-local allout-widgets-changes-record nil |
| 362 | "Record outline changes for processing by post-command hook. | 358 | "Record outline changes for processing by post-command hook. |
| 363 | 359 | ||
| 364 | Entries on the list are lists whose first element is a symbol indicating | 360 | Entries on the list are lists whose first element is a symbol indicating |
| @@ -369,14 +365,12 @@ type. For example: | |||
| 369 | 365 | ||
| 370 | The changes are recorded in reverse order, with new values pushed | 366 | The changes are recorded in reverse order, with new values pushed |
| 371 | onto the front.") | 367 | onto the front.") |
| 372 | (make-variable-buffer-local 'allout-widgets-changes-record) | ||
| 373 | ;;;_ = allout-widgets-undo-exposure-record | 368 | ;;;_ = allout-widgets-undo-exposure-record |
| 374 | (defvar allout-widgets-undo-exposure-record nil | 369 | (defvar-local allout-widgets-undo-exposure-record nil |
| 375 | "Record outline undo traces for processing by post-command hook. | 370 | "Record outline undo traces for processing by post-command hook. |
| 376 | 371 | ||
| 377 | The changes are recorded in reverse order, with new values pushed | 372 | The changes are recorded in reverse order, with new values pushed |
| 378 | onto the front.") | 373 | onto the front.") |
| 379 | (make-variable-buffer-local 'allout-widgets-undo-exposure-record) | ||
| 380 | ;;;_ = allout-widgets-last-hook-error | 374 | ;;;_ = allout-widgets-last-hook-error |
| 381 | (defvar allout-widgets-last-hook-error nil | 375 | (defvar allout-widgets-last-hook-error nil |
| 382 | "String holding last error string, for debugging purposes.") | 376 | "String holding last error string, for debugging purposes.") |
| @@ -393,13 +387,12 @@ onto the front.") | |||
| 393 | "Maintained true during `allout-widgets-exposure-undo-processor'") | 387 | "Maintained true during `allout-widgets-exposure-undo-processor'") |
| 394 | ;;;_ , Widget-specific outline text format | 388 | ;;;_ , Widget-specific outline text format |
| 395 | ;;;_ = allout-escaped-prefix-regexp | 389 | ;;;_ = allout-escaped-prefix-regexp |
| 396 | (defvar allout-escaped-prefix-regexp "" | 390 | (defvar-local allout-escaped-prefix-regexp "" |
| 397 | "Regular expression for body text that would look like an item prefix if | 391 | "Regular expression for body text that would look like an item prefix if |
| 398 | not altered with an escape sequence.") | 392 | not altered with an escape sequence.") |
| 399 | (make-variable-buffer-local 'allout-escaped-prefix-regexp) | ||
| 400 | ;;;_ , Widget element formatting | 393 | ;;;_ , Widget element formatting |
| 401 | ;;;_ = allout-item-icon-keymap | 394 | ;;;_ = allout-item-icon-keymap |
| 402 | (defvar allout-item-icon-keymap | 395 | (defvar-local allout-item-icon-keymap |
| 403 | (let ((km (make-sparse-keymap)) | 396 | (let ((km (make-sparse-keymap)) |
| 404 | (as-parent (if (current-local-map) | 397 | (as-parent (if (current-local-map) |
| 405 | (make-composed-keymap (current-local-map) | 398 | (make-composed-keymap (current-local-map) |
| @@ -420,9 +413,8 @@ not altered with an escape sequence.") | |||
| 420 | 413 | ||
| 421 | km) | 414 | km) |
| 422 | "General tree-node key bindings.") | 415 | "General tree-node key bindings.") |
| 423 | (make-variable-buffer-local 'allout-item-icon-keymap) | ||
| 424 | ;;;_ = allout-item-body-keymap | 416 | ;;;_ = allout-item-body-keymap |
| 425 | (defvar allout-item-body-keymap | 417 | (defvar-local allout-item-body-keymap |
| 426 | (let ((km (make-sparse-keymap)) | 418 | (let ((km (make-sparse-keymap)) |
| 427 | (as-parent (if (current-local-map) | 419 | (as-parent (if (current-local-map) |
| 428 | (make-composed-keymap (current-local-map) | 420 | (make-composed-keymap (current-local-map) |
| @@ -432,17 +424,15 @@ not altered with an escape sequence.") | |||
| 432 | (set-keymap-parent km as-parent) | 424 | (set-keymap-parent km as-parent) |
| 433 | km) | 425 | km) |
| 434 | "General key bindings for the text content of outline items.") | 426 | "General key bindings for the text content of outline items.") |
| 435 | (make-variable-buffer-local 'allout-item-body-keymap) | ||
| 436 | ;;;_ = allout-body-span-category | 427 | ;;;_ = allout-body-span-category |
| 437 | (defvar allout-body-span-category nil | 428 | (defvar allout-body-span-category nil |
| 438 | "Symbol carrying allout body-text overlay properties.") | 429 | "Symbol carrying allout body-text overlay properties.") |
| 439 | ;;;_ = allout-cue-span-keymap | 430 | ;;;_ = allout-cue-span-keymap |
| 440 | (defvar allout-cue-span-keymap | 431 | (defvar-local allout-cue-span-keymap |
| 441 | (let ((km (make-sparse-keymap))) | 432 | (let ((km (make-sparse-keymap))) |
| 442 | (set-keymap-parent km allout-item-icon-keymap) | 433 | (set-keymap-parent km allout-item-icon-keymap) |
| 443 | km) | 434 | km) |
| 444 | "Keymap used in the item cue area - the space between the icon and headline.") | 435 | "Keymap used in the item cue area - the space between the icon and headline.") |
| 445 | (make-variable-buffer-local 'allout-cue-span-keymap) | ||
| 446 | ;;;_ = allout-escapes-category | 436 | ;;;_ = allout-escapes-category |
| 447 | (defvar allout-escapes-category nil | 437 | (defvar allout-escapes-category nil |
| 448 | "Symbol for category of text property used to hide escapes of prefix-like | 438 | "Symbol for category of text property used to hide escapes of prefix-like |
| @@ -477,7 +467,7 @@ including things like: | |||
| 477 | (defvar allout-trailing-category nil | 467 | (defvar allout-trailing-category nil |
| 478 | "Symbol carrying common properties of an overlay's trailing newline.") | 468 | "Symbol carrying common properties of an overlay's trailing newline.") |
| 479 | ;;;_ , Developer | 469 | ;;;_ , Developer |
| 480 | (defvar allout-widgets-last-decoration-timing nil | 470 | (defvar-local allout-widgets-last-decoration-timing nil |
| 481 | "Timing details for the last cooperative decoration action. | 471 | "Timing details for the last cooperative decoration action. |
| 482 | 472 | ||
| 483 | This is maintained when `allout-widgets-time-decoration-activity' is set. | 473 | This is maintained when `allout-widgets-time-decoration-activity' is set. |
| @@ -488,7 +478,6 @@ The value is a list containing two elements: | |||
| 488 | 478 | ||
| 489 | When active, the value is revised each time automatic decoration activity | 479 | When active, the value is revised each time automatic decoration activity |
| 490 | happens in the buffer.") | 480 | happens in the buffer.") |
| 491 | (make-variable-buffer-local 'allout-widgets-last-decoration-timing) | ||
| 492 | ;;;_ . mode hookup | 481 | ;;;_ . mode hookup |
| 493 | ;;;_ > define-minor-mode allout-widgets-mode (arg) | 482 | ;;;_ > define-minor-mode allout-widgets-mode (arg) |
| 494 | ;;;###autoload | 483 | ;;;###autoload |
| @@ -693,12 +682,11 @@ outline hot-spot navigation (see `allout-mode')." | |||
| 693 | (allout-get-or-create-item-widget)))))) | 682 | (allout-get-or-create-item-widget)))))) |
| 694 | ;;;_ . settings context | 683 | ;;;_ . settings context |
| 695 | ;;;_ = allout-container-item | 684 | ;;;_ = allout-container-item |
| 696 | (defvar allout-container-item-widget nil | 685 | (defvar-local allout-container-item-widget nil |
| 697 | "A widget for the current outline's overarching container as an item. | 686 | "A widget for the current outline's overarching container as an item. |
| 698 | 687 | ||
| 699 | The item has settings (of the file/connection) and maybe a body, but no | 688 | The item has settings (of the file/connection) and maybe a body, but no |
| 700 | icon/bullet.") | 689 | icon/bullet.") |
| 701 | (make-variable-buffer-local 'allout-container-item-widget) | ||
| 702 | ;;;_ . Hooks and hook helpers | 690 | ;;;_ . Hooks and hook helpers |
| 703 | ;;;_ , major command-loop business: | 691 | ;;;_ , major command-loop business: |
| 704 | ;;;_ > allout-widgets-pre-command-business (&optional recursing) | 692 | ;;;_ > allout-widgets-pre-command-business (&optional recursing) |
diff --git a/lisp/allout.el b/lisp/allout.el index 39aa29b664a..ff0b67556e0 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -830,9 +830,8 @@ such topics are encrypted.)" | |||
| 830 | 830 | ||
| 831 | The value of `buffer-saved-size' at the time of decryption is used, | 831 | The value of `buffer-saved-size' at the time of decryption is used, |
| 832 | for restoring when all encryptions are established.") | 832 | for restoring when all encryptions are established.") |
| 833 | (defvar allout-just-did-undo nil | 833 | (defvar-local allout-just-did-undo nil |
| 834 | "True just after undo commands, until allout-post-command-business.") | 834 | "True just after undo commands, until allout-post-command-business.") |
| 835 | (make-variable-buffer-local 'allout-just-did-undo) | ||
| 836 | 835 | ||
| 837 | ;;;_ + Developer | 836 | ;;;_ + Developer |
| 838 | ;;;_ = allout-developer group | 837 | ;;;_ = allout-developer group |
| @@ -874,10 +873,10 @@ For details, see `allout-toggle-current-subtree-encryption's docstring." | |||
| 874 | msg)) | 873 | msg)) |
| 875 | ;;;_ : Mode activation (defined here because it's referenced early) | 874 | ;;;_ : Mode activation (defined here because it's referenced early) |
| 876 | ;;;_ = allout-mode | 875 | ;;;_ = allout-mode |
| 877 | (defvar allout-mode nil "Allout outline mode minor-mode flag.") | 876 | (defvar-local allout-mode nil |
| 878 | (make-variable-buffer-local 'allout-mode) | 877 | "Allout outline mode minor-mode flag.") |
| 879 | ;;;_ = allout-layout nil | 878 | ;;;_ = allout-layout nil |
| 880 | (defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring. | 879 | (defvar-local allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring. |
| 881 | "Buffer-specific setting for allout layout. | 880 | "Buffer-specific setting for allout layout. |
| 882 | 881 | ||
| 883 | In buffers where this is non-nil (and if `allout-auto-activation' | 882 | In buffers where this is non-nil (and if `allout-auto-activation' |
| @@ -903,34 +902,30 @@ followed by the equivalent of `(allout-expose-topic 0 : -1 -1 0)'. | |||
| 903 | `allout-default-layout' describes the specification format. | 902 | `allout-default-layout' describes the specification format. |
| 904 | `allout-layout' can additionally have the value t, in which | 903 | `allout-layout' can additionally have the value t, in which |
| 905 | case the value of `allout-default-layout' is used.") | 904 | case the value of `allout-default-layout' is used.") |
| 906 | (make-variable-buffer-local 'allout-layout) | ||
| 907 | ;;;###autoload | 905 | ;;;###autoload |
| 908 | (put 'allout-layout 'safe-local-variable | 906 | (put 'allout-layout 'safe-local-variable |
| 909 | (lambda (x) (or (numberp x) (listp x) (memq x '(: * + -))))) | 907 | (lambda (x) (or (numberp x) (listp x) (memq x '(: * + -))))) |
| 910 | 908 | ||
| 911 | ;;;_ : Topic header format | 909 | ;;;_ : Topic header format |
| 912 | ;;;_ = allout-regexp | 910 | ;;;_ = allout-regexp |
| 913 | (defvar allout-regexp "" | 911 | (defvar-local allout-regexp "" |
| 914 | "Regular expression to match the beginning of a heading line. | 912 | "Regular expression to match the beginning of a heading line. |
| 915 | 913 | ||
| 916 | Any line whose beginning matches this regexp is considered a | 914 | Any line whose beginning matches this regexp is considered a |
| 917 | heading. This var is set according to the user configuration vars | 915 | heading. This var is set according to the user configuration vars |
| 918 | by `allout-set-regexp'.") | 916 | by `allout-set-regexp'.") |
| 919 | (make-variable-buffer-local 'allout-regexp) | ||
| 920 | ;;;_ = allout-bullets-string | 917 | ;;;_ = allout-bullets-string |
| 921 | (defvar allout-bullets-string "" | 918 | (defvar-local allout-bullets-string "" |
| 922 | "A string dictating the valid set of outline topic bullets. | 919 | "A string dictating the valid set of outline topic bullets. |
| 923 | 920 | ||
| 924 | This var should *not* be set by the user -- it is set by `allout-set-regexp', | 921 | This var should *not* be set by the user -- it is set by `allout-set-regexp', |
| 925 | and is produced from the elements of `allout-plain-bullets-string' | 922 | and is produced from the elements of `allout-plain-bullets-string' |
| 926 | and `allout-distinctive-bullets-string'.") | 923 | and `allout-distinctive-bullets-string'.") |
| 927 | (make-variable-buffer-local 'allout-bullets-string) | ||
| 928 | ;;;_ = allout-bullets-string-len | 924 | ;;;_ = allout-bullets-string-len |
| 929 | (defvar allout-bullets-string-len 0 | 925 | (defvar-local allout-bullets-string-len 0 |
| 930 | "Length of current buffers' `allout-plain-bullets-string'.") | 926 | "Length of current buffers' `allout-plain-bullets-string'.") |
| 931 | (make-variable-buffer-local 'allout-bullets-string-len) | ||
| 932 | ;;;_ = allout-depth-specific-regexp | 927 | ;;;_ = allout-depth-specific-regexp |
| 933 | (defvar allout-depth-specific-regexp "" | 928 | (defvar-local allout-depth-specific-regexp "" |
| 934 | "Regular expression to match a heading line prefix for a particular depth. | 929 | "Regular expression to match a heading line prefix for a particular depth. |
| 935 | 930 | ||
| 936 | This expression is used to search for depth-specific topic | 931 | This expression is used to search for depth-specific topic |
| @@ -941,34 +936,28 @@ This var is set according to the user configuration vars by | |||
| 941 | `allout-set-regexp'. It is prepared with format strings for two | 936 | `allout-set-regexp'. It is prepared with format strings for two |
| 942 | decimal numbers, which should each be one less than the depth of the | 937 | decimal numbers, which should each be one less than the depth of the |
| 943 | topic prefix to be matched.") | 938 | topic prefix to be matched.") |
| 944 | (make-variable-buffer-local 'allout-depth-specific-regexp) | ||
| 945 | ;;;_ = allout-depth-one-regexp | 939 | ;;;_ = allout-depth-one-regexp |
| 946 | (defvar allout-depth-one-regexp "" | 940 | (defvar-local allout-depth-one-regexp "" |
| 947 | "Regular expression to match a heading line prefix for depth one. | 941 | "Regular expression to match a heading line prefix for depth one. |
| 948 | 942 | ||
| 949 | This var is set according to the user configuration vars by | 943 | This var is set according to the user configuration vars by |
| 950 | `allout-set-regexp'. It is prepared with format strings for two | 944 | `allout-set-regexp'. It is prepared with format strings for two |
| 951 | decimal numbers, which should each be one less than the depth of the | 945 | decimal numbers, which should each be one less than the depth of the |
| 952 | topic prefix to be matched.") | 946 | topic prefix to be matched.") |
| 953 | (make-variable-buffer-local 'allout-depth-one-regexp) | ||
| 954 | ;;;_ = allout-line-boundary-regexp | 947 | ;;;_ = allout-line-boundary-regexp |
| 955 | (defvar allout-line-boundary-regexp () | 948 | (defvar-local allout-line-boundary-regexp () |
| 956 | "`allout-regexp' prepended with a newline for the search target. | 949 | "`allout-regexp' prepended with a newline for the search target. |
| 957 | 950 | ||
| 958 | This is properly set by `allout-set-regexp'.") | 951 | This is properly set by `allout-set-regexp'.") |
| 959 | (make-variable-buffer-local 'allout-line-boundary-regexp) | ||
| 960 | ;;;_ = allout-bob-regexp | 952 | ;;;_ = allout-bob-regexp |
| 961 | (defvar allout-bob-regexp () | 953 | (defvar-local allout-bob-regexp () |
| 962 | "Like `allout-line-boundary-regexp', for headers at beginning of buffer.") | 954 | "Like `allout-line-boundary-regexp', for headers at beginning of buffer.") |
| 963 | (make-variable-buffer-local 'allout-bob-regexp) | ||
| 964 | ;;;_ = allout-header-subtraction | 955 | ;;;_ = allout-header-subtraction |
| 965 | (defvar allout-header-subtraction (1- (length allout-header-prefix)) | 956 | (defvar-local allout-header-subtraction (1- (length allout-header-prefix)) |
| 966 | "Allout-header prefix length to subtract when computing topic depth.") | 957 | "Allout-header prefix length to subtract when computing topic depth.") |
| 967 | (make-variable-buffer-local 'allout-header-subtraction) | ||
| 968 | ;;;_ = allout-plain-bullets-string-len | 958 | ;;;_ = allout-plain-bullets-string-len |
| 969 | (defvar allout-plain-bullets-string-len (length allout-plain-bullets-string) | 959 | (defvar-local allout-plain-bullets-string-len (length allout-plain-bullets-string) |
| 970 | "Length of `allout-plain-bullets-string', updated by `allout-set-regexp'.") | 960 | "Length of `allout-plain-bullets-string', updated by `allout-set-regexp'.") |
| 971 | (make-variable-buffer-local 'allout-plain-bullets-string-len) | ||
| 972 | 961 | ||
| 973 | ;;;_ = allout-doublecheck-at-and-shallower | 962 | ;;;_ = allout-doublecheck-at-and-shallower |
| 974 | (defconst allout-doublecheck-at-and-shallower 3 | 963 | (defconst allout-doublecheck-at-and-shallower 3 |
| @@ -1279,11 +1268,10 @@ Also refresh various data structures that hinge on the regexp." | |||
| 1279 | ["Set New Exposure" allout-expose-topic t]))) | 1268 | ["Set New Exposure" allout-expose-topic t]))) |
| 1280 | ;;;_ : Allout Modal-Variables Utilities | 1269 | ;;;_ : Allout Modal-Variables Utilities |
| 1281 | ;;;_ = allout-mode-prior-settings | 1270 | ;;;_ = allout-mode-prior-settings |
| 1282 | (defvar allout-mode-prior-settings nil | 1271 | (defvar-local allout-mode-prior-settings nil |
| 1283 | "Internal `allout-mode' use; settings to be resumed on mode deactivation. | 1272 | "Internal `allout-mode' use; settings to be resumed on mode deactivation. |
| 1284 | 1273 | ||
| 1285 | See `allout-add-resumptions' and `allout-do-resumptions'.") | 1274 | See `allout-add-resumptions' and `allout-do-resumptions'.") |
| 1286 | (make-variable-buffer-local 'allout-mode-prior-settings) | ||
| 1287 | ;;;_ > allout-add-resumptions (&rest pairs) | 1275 | ;;;_ > allout-add-resumptions (&rest pairs) |
| 1288 | (defun allout-add-resumptions (&rest pairs) | 1276 | (defun allout-add-resumptions (&rest pairs) |
| 1289 | "Set name/value PAIRS. | 1277 | "Set name/value PAIRS. |
| @@ -1466,16 +1454,15 @@ that was affected by the undo.." | |||
| 1466 | :version "24.3") | 1454 | :version "24.3") |
| 1467 | 1455 | ||
| 1468 | ;;;_ = allout-outside-normal-auto-fill-function | 1456 | ;;;_ = allout-outside-normal-auto-fill-function |
| 1469 | (defvar allout-outside-normal-auto-fill-function nil | 1457 | (defvar-local allout-outside-normal-auto-fill-function nil |
| 1470 | "Value of `normal-auto-fill-function' outside of allout mode. | 1458 | "Value of `normal-auto-fill-function' outside of allout mode. |
| 1471 | 1459 | ||
| 1472 | Used by `allout-auto-fill' to do the mandated `normal-auto-fill-function' | 1460 | Used by `allout-auto-fill' to do the mandated `normal-auto-fill-function' |
| 1473 | wrapped within allout's automatic `fill-prefix' setting.") | 1461 | wrapped within allout's automatic `fill-prefix' setting.") |
| 1474 | (make-variable-buffer-local 'allout-outside-normal-auto-fill-function) | ||
| 1475 | ;;;_ = prevent redundant activation by desktop mode: | 1462 | ;;;_ = prevent redundant activation by desktop mode: |
| 1476 | (add-to-list 'desktop-minor-mode-handlers '(allout-mode . nil)) | 1463 | (add-to-list 'desktop-minor-mode-handlers '(allout-mode . nil)) |
| 1477 | ;;;_ = allout-after-save-decrypt | 1464 | ;;;_ = allout-after-save-decrypt |
| 1478 | (defvar allout-after-save-decrypt nil | 1465 | (defvar-local allout-after-save-decrypt nil |
| 1479 | "Internal variable, is nil or has the value of two points: | 1466 | "Internal variable, is nil or has the value of two points: |
| 1480 | 1467 | ||
| 1481 | - the location of a topic to be decrypted after saving is done | 1468 | - the location of a topic to be decrypted after saving is done |
| @@ -1483,9 +1470,8 @@ wrapped within allout's automatic `fill-prefix' setting.") | |||
| 1483 | 1470 | ||
| 1484 | This is used to decrypt the topic that was currently being edited, if it | 1471 | This is used to decrypt the topic that was currently being edited, if it |
| 1485 | was encrypted automatically as part of a file write or autosave.") | 1472 | was encrypted automatically as part of a file write or autosave.") |
| 1486 | (make-variable-buffer-local 'allout-after-save-decrypt) | ||
| 1487 | ;;;_ = allout-encryption-plaintext-sanitization-regexps | 1473 | ;;;_ = allout-encryption-plaintext-sanitization-regexps |
| 1488 | (defvar allout-encryption-plaintext-sanitization-regexps nil | 1474 | (defvar-local allout-encryption-plaintext-sanitization-regexps nil |
| 1489 | "List of regexps whose matches are removed from plaintext before encryption. | 1475 | "List of regexps whose matches are removed from plaintext before encryption. |
| 1490 | 1476 | ||
| 1491 | This is for the sake of removing artifacts, like escapes, that are added on | 1477 | This is for the sake of removing artifacts, like escapes, that are added on |
| @@ -1498,9 +1484,8 @@ Each value can be a regexp or a list with a regexp followed by a | |||
| 1498 | substitution string. If it's just a regexp, all its matches are removed | 1484 | substitution string. If it's just a regexp, all its matches are removed |
| 1499 | before the text is encrypted. If it's a regexp and a substitution, the | 1485 | before the text is encrypted. If it's a regexp and a substitution, the |
| 1500 | substitution is used against the regexp matches, a la `replace-match'.") | 1486 | substitution is used against the regexp matches, a la `replace-match'.") |
| 1501 | (make-variable-buffer-local 'allout-encryption-plaintext-sanitization-regexps) | ||
| 1502 | ;;;_ = allout-encryption-ciphertext-rejection-regexps | 1487 | ;;;_ = allout-encryption-ciphertext-rejection-regexps |
| 1503 | (defvar allout-encryption-ciphertext-rejection-regexps nil | 1488 | (defvar-local allout-encryption-ciphertext-rejection-regexps nil |
| 1504 | "Variable for regexps matching plaintext to remove before encryption. | 1489 | "Variable for regexps matching plaintext to remove before encryption. |
| 1505 | 1490 | ||
| 1506 | This is used to detect strings in encryption results that would | 1491 | This is used to detect strings in encryption results that would |
| @@ -1513,13 +1498,11 @@ Encryptions that result in matches will be retried, up to | |||
| 1513 | `allout-encryption-ciphertext-rejection-ceiling' times, after which | 1498 | `allout-encryption-ciphertext-rejection-ceiling' times, after which |
| 1514 | an error is raised.") | 1499 | an error is raised.") |
| 1515 | 1500 | ||
| 1516 | (make-variable-buffer-local 'allout-encryption-ciphertext-rejection-regexps) | ||
| 1517 | ;;;_ = allout-encryption-ciphertext-rejection-ceiling | 1501 | ;;;_ = allout-encryption-ciphertext-rejection-ceiling |
| 1518 | (defvar allout-encryption-ciphertext-rejection-ceiling 5 | 1502 | (defvar-local allout-encryption-ciphertext-rejection-ceiling 5 |
| 1519 | "Limit on number of times encryption ciphertext is rejected. | 1503 | "Limit on number of times encryption ciphertext is rejected. |
| 1520 | 1504 | ||
| 1521 | See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") | 1505 | See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") |
| 1522 | (make-variable-buffer-local 'allout-encryption-ciphertext-rejection-ceiling) | ||
| 1523 | ;;;_ > allout-mode-p () | 1506 | ;;;_ > allout-mode-p () |
| 1524 | ;; Must define this macro above any uses, or byte compilation will lack | 1507 | ;; Must define this macro above any uses, or byte compilation will lack |
| 1525 | ;; proper def, if file isn't loaded -- eg, during emacs build! | 1508 | ;; proper def, if file isn't loaded -- eg, during emacs build! |
| @@ -1607,10 +1590,9 @@ non-nil in a lasting way.") | |||
| 1607 | 1590 | ||
| 1608 | ;;;_ #2 Mode environment and activation | 1591 | ;;;_ #2 Mode environment and activation |
| 1609 | ;;;_ = allout-explicitly-deactivated | 1592 | ;;;_ = allout-explicitly-deactivated |
| 1610 | (defvar allout-explicitly-deactivated nil | 1593 | (defvar-local allout-explicitly-deactivated nil |
| 1611 | "If t, `allout-mode's last deactivation was deliberate. | 1594 | "If t, `allout-mode's last deactivation was deliberate. |
| 1612 | So `allout-post-command-business' should not reactivate it...") | 1595 | So `allout-post-command-business' should not reactivate it...") |
| 1613 | (make-variable-buffer-local 'allout-explicitly-deactivated) | ||
| 1614 | ;;;_ > allout-setup-menubar () | 1596 | ;;;_ > allout-setup-menubar () |
| 1615 | (defun allout-setup-menubar () | 1597 | (defun allout-setup-menubar () |
| 1616 | "Populate the current buffer's menubar with `allout-mode' stuff." | 1598 | "Populate the current buffer's menubar with `allout-mode' stuff." |
| @@ -2119,21 +2101,17 @@ function can also be used as an `isearch-mode-end-hook'." | |||
| 2119 | ;; for just-established data. This optimization can provide | 2101 | ;; for just-established data. This optimization can provide |
| 2120 | ;; significant speed improvement, but it must be employed carefully. | 2102 | ;; significant speed improvement, but it must be employed carefully. |
| 2121 | ;;;_ = allout-recent-prefix-beginning | 2103 | ;;;_ = allout-recent-prefix-beginning |
| 2122 | (defvar allout-recent-prefix-beginning 0 | 2104 | (defvar-local allout-recent-prefix-beginning 0 |
| 2123 | "Buffer point of the start of the last topic prefix encountered.") | 2105 | "Buffer point of the start of the last topic prefix encountered.") |
| 2124 | (make-variable-buffer-local 'allout-recent-prefix-beginning) | ||
| 2125 | ;;;_ = allout-recent-prefix-end | 2106 | ;;;_ = allout-recent-prefix-end |
| 2126 | (defvar allout-recent-prefix-end 0 | 2107 | (defvar-local allout-recent-prefix-end 0 |
| 2127 | "Buffer point of the end of the last topic prefix encountered.") | 2108 | "Buffer point of the end of the last topic prefix encountered.") |
| 2128 | (make-variable-buffer-local 'allout-recent-prefix-end) | ||
| 2129 | ;;;_ = allout-recent-depth | 2109 | ;;;_ = allout-recent-depth |
| 2130 | (defvar allout-recent-depth 0 | 2110 | (defvar-local allout-recent-depth 0 |
| 2131 | "Depth of the last topic prefix encountered.") | 2111 | "Depth of the last topic prefix encountered.") |
| 2132 | (make-variable-buffer-local 'allout-recent-depth) | ||
| 2133 | ;;;_ = allout-recent-end-of-subtree | 2112 | ;;;_ = allout-recent-end-of-subtree |
| 2134 | (defvar allout-recent-end-of-subtree 0 | 2113 | (defvar-local allout-recent-end-of-subtree 0 |
| 2135 | "Buffer point last returned by `allout-end-of-current-subtree'.") | 2114 | "Buffer point last returned by `allout-end-of-current-subtree'.") |
| 2136 | (make-variable-buffer-local 'allout-recent-end-of-subtree) | ||
| 2137 | ;;;_ > allout-prefix-data () | 2115 | ;;;_ > allout-prefix-data () |
| 2138 | (defsubst allout-prefix-data () | 2116 | (defsubst allout-prefix-data () |
| 2139 | "Register allout-prefix state data. | 2117 | "Register allout-prefix state data. |
| @@ -3213,7 +3191,7 @@ Returns resulting position, else nil if none found." | |||
| 3213 | 3191 | ||
| 3214 | ;;;_ - Fundamental | 3192 | ;;;_ - Fundamental |
| 3215 | ;;;_ = allout-post-goto-bullet | 3193 | ;;;_ = allout-post-goto-bullet |
| 3216 | (defvar allout-post-goto-bullet nil | 3194 | (defvar-local allout-post-goto-bullet nil |
| 3217 | "Outline internal var, for `allout-pre-command-business' hot-spot operation. | 3195 | "Outline internal var, for `allout-pre-command-business' hot-spot operation. |
| 3218 | 3196 | ||
| 3219 | When set, tells post-processing to reposition on topic bullet, and | 3197 | When set, tells post-processing to reposition on topic bullet, and |
| @@ -3221,18 +3199,15 @@ then unset it. Set by `allout-pre-command-business' when implementing | |||
| 3221 | hot-spot operation, where literal characters typed over a topic bullet | 3199 | hot-spot operation, where literal characters typed over a topic bullet |
| 3222 | are mapped to the command of the corresponding control-key on the | 3200 | are mapped to the command of the corresponding control-key on the |
| 3223 | `allout-mode-map-value'.") | 3201 | `allout-mode-map-value'.") |
| 3224 | (make-variable-buffer-local 'allout-post-goto-bullet) | ||
| 3225 | ;;;_ = allout-command-counter | 3202 | ;;;_ = allout-command-counter |
| 3226 | (defvar allout-command-counter 0 | 3203 | (defvar-local allout-command-counter 0 |
| 3227 | "Counter that monotonically increases in allout-mode buffers. | 3204 | "Counter that monotonically increases in allout-mode buffers. |
| 3228 | 3205 | ||
| 3229 | Set by `allout-pre-command-business', to support allout addons in | 3206 | Set by `allout-pre-command-business', to support allout addons in |
| 3230 | coordinating with allout activity.") | 3207 | coordinating with allout activity.") |
| 3231 | (make-variable-buffer-local 'allout-command-counter) | ||
| 3232 | ;;;_ = allout-this-command-hid-text | 3208 | ;;;_ = allout-this-command-hid-text |
| 3233 | (defvar allout-this-command-hid-text nil | 3209 | (defvar-local allout-this-command-hid-text nil |
| 3234 | "True if the most recent allout-mode command hid any text.") | 3210 | "True if the most recent allout-mode command hid any text.") |
| 3235 | (make-variable-buffer-local 'allout-this-command-hid-text) | ||
| 3236 | ;;;_ > allout-post-command-business () | 3211 | ;;;_ > allout-post-command-business () |
| 3237 | (defun allout-post-command-business () | 3212 | (defun allout-post-command-business () |
| 3238 | "Outline `post-command-hook' function. | 3213 | "Outline `post-command-hook' function. |