aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2016-06-07 21:34:51 -0400
committerGlenn Morris2016-06-07 21:34:51 -0400
commit3db521ccaf3a5b6892bf23ea1305c7cfe9aa1cce (patch)
tree9e64d1c335fd926ec5bdf8260d5357b53313cdda
parente533ea819f73b7715a3413697de5c35268b45d78 (diff)
downloademacs-3db521ccaf3a5b6892bf23ea1305c7cfe9aa1cce.tar.gz
emacs-3db521ccaf3a5b6892bf23ea1305c7cfe9aa1cce.zip
Reduce allout.el's pollution of the namespace.
* lisp/allout.el (allout-set-regexp): Rename from set-allout-regexp. Keep old name as obsolete alias. (allout-produce-mode-menubar-entries, allout-nullify-prefix-data) (allout-solicit-char-in-string) (allout-count-trailing-whitespace-region, allout-regexp-sans-escapes): Rename to add an "allout-" prefix.
-rw-r--r--lisp/allout.el59
1 files changed, 30 insertions, 29 deletions
diff --git a/lisp/allout.el b/lisp/allout.el
index 49bdc06fbb0..3a7b6e64d1b 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -592,7 +592,7 @@ software. By default:
592See `allout-plain-bullets-string' for the standard, alternating 592See `allout-plain-bullets-string' for the standard, alternating
593bullets. 593bullets.
594 594
595You must run `set-allout-regexp' in order for outline mode to 595You must run `allout-set-regexp' in order for outline mode to
596adopt changes of this value. 596adopt changes of this value.
597 597
598DO NOT include the close-square-bracket, `]', on either of the bullet 598DO NOT include the close-square-bracket, `]', on either of the bullet
@@ -947,13 +947,13 @@ case the value of `allout-default-layout' is used.")
947 947
948Any line whose beginning matches this regexp is considered a 948Any line whose beginning matches this regexp is considered a
949heading. This var is set according to the user configuration vars 949heading. This var is set according to the user configuration vars
950by `set-allout-regexp'.") 950by `allout-set-regexp'.")
951(make-variable-buffer-local 'allout-regexp) 951(make-variable-buffer-local 'allout-regexp)
952;;;_ = allout-bullets-string 952;;;_ = allout-bullets-string
953(defvar allout-bullets-string "" 953(defvar allout-bullets-string ""
954 "A string dictating the valid set of outline topic bullets. 954 "A string dictating the valid set of outline topic bullets.
955 955
956This var should *not* be set by the user -- it is set by `set-allout-regexp', 956This var should *not* be set by the user -- it is set by `allout-set-regexp',
957and is produced from the elements of `allout-plain-bullets-string' 957and is produced from the elements of `allout-plain-bullets-string'
958and `allout-distinctive-bullets-string'.") 958and `allout-distinctive-bullets-string'.")
959(make-variable-buffer-local 'allout-bullets-string) 959(make-variable-buffer-local 'allout-bullets-string)
@@ -970,7 +970,7 @@ headers at depth 2 and greater. Use `allout-depth-one-regexp'
970for to seek topics at depth one. 970for to seek topics at depth one.
971 971
972This var is set according to the user configuration vars by 972This var is set according to the user configuration vars by
973`set-allout-regexp'. It is prepared with format strings for two 973`allout-set-regexp'. It is prepared with format strings for two
974decimal numbers, which should each be one less than the depth of the 974decimal numbers, which should each be one less than the depth of the
975topic prefix to be matched.") 975topic prefix to be matched.")
976(make-variable-buffer-local 'allout-depth-specific-regexp) 976(make-variable-buffer-local 'allout-depth-specific-regexp)
@@ -979,7 +979,7 @@ topic prefix to be matched.")
979 "Regular expression to match a heading line prefix for depth one. 979 "Regular expression to match a heading line prefix for depth one.
980 980
981This var is set according to the user configuration vars by 981This var is set according to the user configuration vars by
982`set-allout-regexp'. It is prepared with format strings for two 982`allout-set-regexp'. It is prepared with format strings for two
983decimal numbers, which should each be one less than the depth of the 983decimal numbers, which should each be one less than the depth of the
984topic prefix to be matched.") 984topic prefix to be matched.")
985(make-variable-buffer-local 'allout-depth-one-regexp) 985(make-variable-buffer-local 'allout-depth-one-regexp)
@@ -987,7 +987,7 @@ topic prefix to be matched.")
987(defvar allout-line-boundary-regexp () 987(defvar allout-line-boundary-regexp ()
988 "`allout-regexp' prepended with a newline for the search target. 988 "`allout-regexp' prepended with a newline for the search target.
989 989
990This is properly set by `set-allout-regexp'.") 990This is properly set by `allout-set-regexp'.")
991(make-variable-buffer-local 'allout-line-boundary-regexp) 991(make-variable-buffer-local 'allout-line-boundary-regexp)
992;;;_ = allout-bob-regexp 992;;;_ = allout-bob-regexp
993(defvar allout-bob-regexp () 993(defvar allout-bob-regexp ()
@@ -999,7 +999,7 @@ This is properly set by `set-allout-regexp'.")
999(make-variable-buffer-local 'allout-header-subtraction) 999(make-variable-buffer-local 'allout-header-subtraction)
1000;;;_ = allout-plain-bullets-string-len 1000;;;_ = allout-plain-bullets-string-len
1001(defvar allout-plain-bullets-string-len (length allout-plain-bullets-string) 1001(defvar allout-plain-bullets-string-len (length allout-plain-bullets-string)
1002 "Length of `allout-plain-bullets-string', updated by `set-allout-regexp'.") 1002 "Length of `allout-plain-bullets-string', updated by `allout-set-regexp'.")
1003(make-variable-buffer-local 'allout-plain-bullets-string-len) 1003(make-variable-buffer-local 'allout-plain-bullets-string-len)
1004 1004
1005;;;_ = allout-doublecheck-at-and-shallower 1005;;;_ = allout-doublecheck-at-and-shallower
@@ -1034,7 +1034,7 @@ suitably economical.")
1034 (interactive "sNew lead string: ") 1034 (interactive "sNew lead string: ")
1035 (setq allout-header-prefix header-lead) 1035 (setq allout-header-prefix header-lead)
1036 (setq allout-header-subtraction (1- (length allout-header-prefix))) 1036 (setq allout-header-subtraction (1- (length allout-header-prefix)))
1037 (set-allout-regexp)) 1037 (allout-set-regexp))
1038;;;_ X allout-lead-with-comment-string (header-lead) 1038;;;_ X allout-lead-with-comment-string (header-lead)
1039(defun allout-lead-with-comment-string (&optional header-lead) 1039(defun allout-lead-with-comment-string (&optional header-lead)
1040 "Set the topic-header leading string to specified string. 1040 "Set the topic-header leading string to specified string.
@@ -1114,8 +1114,8 @@ file is programming code."
1114 comment-start 1114 comment-start
1115 (not (eq 'force allout-reindent-bodies))) 1115 (not (eq 'force allout-reindent-bodies)))
1116 (setq allout-reindent-bodies nil))) 1116 (setq allout-reindent-bodies nil)))
1117;;;_ > set-allout-regexp () 1117;;;_ > allout-set-regexp ()
1118(defun set-allout-regexp () 1118(defun allout-set-regexp ()
1119 "Generate proper topic-header regexp form for outline functions. 1119 "Generate proper topic-header regexp form for outline functions.
1120 1120
1121Works with respect to `allout-plain-bullets-string' and 1121Works with respect to `allout-plain-bullets-string' and
@@ -1242,12 +1242,13 @@ Also refresh various data structures that hinge on the regexp."
1242 "[^" allout-primary-bullet "]")) 1242 "[^" allout-primary-bullet "]"))
1243 "\\)" 1243 "\\)"
1244 )))) 1244 ))))
1245(define-obsolete-function-alias 'set-allout-regexp 'allout-set-regexp "25.2")
1245;;;_ : Menu bar 1246;;;_ : Menu bar
1246(defvar allout-mode-exposure-menu) 1247(defvar allout-mode-exposure-menu)
1247(defvar allout-mode-editing-menu) 1248(defvar allout-mode-editing-menu)
1248(defvar allout-mode-navigation-menu) 1249(defvar allout-mode-navigation-menu)
1249(defvar allout-mode-misc-menu) 1250(defvar allout-mode-misc-menu)
1250(defun produce-allout-mode-menubar-entries () 1251(defun allout-produce-mode-menubar-entries ()
1251 (require 'easymenu) 1252 (require 'easymenu)
1252 (easy-menu-define allout-mode-exposure-menu 1253 (easy-menu-define allout-mode-exposure-menu
1253 allout-mode-map-value 1254 allout-mode-map-value
@@ -2029,7 +2030,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
2029 (allout-infer-header-lead-and-primary-bullet) 2030 (allout-infer-header-lead-and-primary-bullet)
2030 (allout-infer-body-reindent) 2031 (allout-infer-body-reindent)
2031 2032
2032 (set-allout-regexp) 2033 (allout-set-regexp)
2033 (allout-add-resumptions '(allout-encryption-ciphertext-rejection-regexps 2034 (allout-add-resumptions '(allout-encryption-ciphertext-rejection-regexps
2034 allout-line-boundary-regexp 2035 allout-line-boundary-regexp
2035 extend) 2036 extend)
@@ -2038,7 +2039,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
2038 extend)) 2039 extend))
2039 2040
2040 (allout-compose-and-institute-keymap) 2041 (allout-compose-and-institute-keymap)
2041 (produce-allout-mode-menubar-entries) 2042 (allout-produce-mode-menubar-entries)
2042 2043
2043 (add-to-invisibility-spec '(allout . t)) 2044 (add-to-invisibility-spec '(allout . t))
2044 2045
@@ -2245,8 +2246,8 @@ the new value of `allout-recent-prefix-beginning'."
2245 allout-recent-prefix-beginning 2246 allout-recent-prefix-beginning
2246 allout-header-subtraction))) 2247 allout-header-subtraction)))
2247 allout-recent-prefix-beginning) 2248 allout-recent-prefix-beginning)
2248;;;_ > nullify-allout-prefix-data () 2249;;;_ > allout-nullify-prefix-data ()
2249(defsubst nullify-allout-prefix-data () 2250(defsubst allout-nullify-prefix-data ()
2250 "Mark allout prefix data as being uninformative." 2251 "Mark allout prefix data as being uninformative."
2251 (setq allout-recent-prefix-end (point) 2252 (setq allout-recent-prefix-end (point)
2252 allout-recent-prefix-beginning (point) 2253 allout-recent-prefix-beginning (point)
@@ -2381,7 +2382,7 @@ Like `allout-current-depth', but respects hidden as well as visible topics."
2381 allout-recent-depth 2382 allout-recent-depth
2382 (progn 2383 (progn
2383 ;; Oops, no prefix, nullify it: 2384 ;; Oops, no prefix, nullify it:
2384 (nullify-allout-prefix-data) 2385 (allout-nullify-prefix-data)
2385 ;; ... and return 0: 2386 ;; ... and return 0:
2386 0))))) 2387 0)))))
2387;;;_ > allout-current-depth () 2388;;;_ > allout-current-depth ()
@@ -3478,11 +3479,11 @@ Offer one suitable for current depth DEPTH as default."
3478 3479
3479 (let* ((default-bullet (or (and (stringp current-bullet) current-bullet) 3480 (let* ((default-bullet (or (and (stringp current-bullet) current-bullet)
3480 (allout-bullet-for-depth depth))) 3481 (allout-bullet-for-depth depth)))
3481 (sans-escapes (regexp-sans-escapes allout-bullets-string)) 3482 (sans-escapes (allout-regexp-sans-escapes allout-bullets-string))
3482 choice) 3483 choice)
3483 (save-excursion 3484 (save-excursion
3484 (goto-char (allout-current-bullet-pos)) 3485 (goto-char (allout-current-bullet-pos))
3485 (setq choice (solicit-char-in-string 3486 (setq choice (allout-solicit-char-in-string
3486 (format-message 3487 (format-message
3487 "Select bullet: %s (`%s' default): " 3488 "Select bullet: %s (`%s' default): "
3488 sans-escapes 3489 sans-escapes
@@ -6341,7 +6342,7 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info."
6341 ;; we had to wait for this 'til now so prior topics are 6342 ;; we had to wait for this 'til now so prior topics are
6342 ;; encrypted, any relevant text shifts are in place: 6343 ;; encrypted, any relevant text shifts are in place:
6343 editing-point (- current-mark-position 6344 editing-point (- current-mark-position
6344 (count-trailing-whitespace-region 6345 (allout-count-trailing-whitespace-region
6345 bo-subtree current-mark-position)))) 6346 bo-subtree current-mark-position))))
6346 (allout-toggle-subtree-encryption) 6347 (allout-toggle-subtree-encryption)
6347 (if (not was-modified) 6348 (if (not was-modified)
@@ -6507,8 +6508,8 @@ not its value."
6507 (allout-end-of-current-subtree) 6508 (allout-end-of-current-subtree)
6508 (exchange-point-and-mark)) 6509 (exchange-point-and-mark))
6509;;;_ : UI: 6510;;;_ : UI:
6510;;;_ > solicit-char-in-string (prompt string &optional do-defaulting) 6511;;;_ > allout-solicit-char-in-string (prompt string &optional do-defaulting)
6511(defun solicit-char-in-string (prompt string &optional do-defaulting) 6512(defun allout-solicit-char-in-string (prompt string &optional do-defaulting)
6512 "Solicit (with first arg PROMPT) choice of a character from string STRING. 6513 "Solicit (with first arg PROMPT) choice of a character from string STRING.
6513 6514
6514Optional arg DO-DEFAULTING indicates to accept empty input (CR)." 6515Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
@@ -6541,8 +6542,8 @@ Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
6541 got) 6542 got)
6542 ) 6543 )
6543;;;_ : Strings: 6544;;;_ : Strings:
6544;;;_ > regexp-sans-escapes (string) 6545;;;_ > allout-regexp-sans-escapes (string)
6545(defun regexp-sans-escapes (regexp &optional successive-backslashes) 6546(defun allout-regexp-sans-escapes (regexp &optional successive-backslashes)
6546 "Return a copy of REGEXP with all character escapes stripped out. 6547 "Return a copy of REGEXP with all character escapes stripped out.
6547 6548
6548Representations of actual backslashes -- `\\\\\\\\' -- are left as a 6549Representations of actual backslashes -- `\\\\\\\\' -- are left as a
@@ -6561,11 +6562,11 @@ Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion."
6561 (if (or (not successive-backslashes) (= 2 successive-backslashes)) 6562 (if (or (not successive-backslashes) (= 2 successive-backslashes))
6562 ;; Include first char: 6563 ;; Include first char:
6563 (concat (substring regexp 0 1) 6564 (concat (substring regexp 0 1)
6564 (regexp-sans-escapes (substring regexp 1))) 6565 (allout-regexp-sans-escapes (substring regexp 1)))
6565 ;; Exclude first char, but maintain count: 6566 ;; Exclude first char, but maintain count:
6566 (regexp-sans-escapes (substring regexp 1) successive-backslashes)))) 6567 (allout-regexp-sans-escapes (substring regexp 1) successive-backslashes))))
6567;;;_ > count-trailing-whitespace-region (beg end) 6568;;;_ > allout-count-trailing-whitespace-region (beg end)
6568(defun count-trailing-whitespace-region (beg end) 6569(defun allout-count-trailing-whitespace-region (beg end)
6569 "Return number of trailing whitespace chars between BEG and END. 6570 "Return number of trailing whitespace chars between BEG and END.
6570 6571
6571If BEG is bigger than END we return 0." 6572If BEG is bigger than END we return 0."
@@ -6797,9 +6798,9 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
6797 "Isearch (regexp) for topic with bullet BULLET." 6798 "Isearch (regexp) for topic with bullet BULLET."
6798 (interactive) 6799 (interactive)
6799 (if (not bullet) 6800 (if (not bullet)
6800 (setq bullet (solicit-char-in-string 6801 (setq bullet (allout-solicit-char-in-string
6801 "ISearch for topic with bullet: " 6802 "ISearch for topic with bullet: "
6802 (regexp-sans-escapes allout-bullets-string)))) 6803 (allout-regexp-sans-escapes allout-bullets-string))))
6803 6804
6804 (let ((isearch-regexp t) 6805 (let ((isearch-regexp t)
6805 (isearch-string (concat "^" 6806 (isearch-string (concat "^"