diff options
| author | Ken Manheimer | 2008-01-24 17:45:28 +0000 |
|---|---|---|
| committer | Ken Manheimer | 2008-01-24 17:45:28 +0000 |
| commit | 42c3e51c12e3a9fde8de77d34e0bf68f92c51551 (patch) | |
| tree | 641dc5e048ecbcdf921977d6351cdefbe6364bfd | |
| parent | 1c19d20efe080c1ff95764a79bb8a5486c83d446 (diff) | |
| download | emacs-42c3e51c12e3a9fde8de77d34e0bf68f92c51551.tar.gz emacs-42c3e51c12e3a9fde8de77d34e0bf68f92c51551.zip | |
(allout-keybindings-list): In initial setting, express
meta-prefixed allout keys as vectors instead of strings, since the
string form is interpreted in some cases as composed key
modifiers, eg, accented keys.
(allout-line-boundary-regexp): Clarify description.
(set-allout-regexp): Repair the expressions so that the formfeed part is
identified as one of the top-level groups, and is included in all the
forms, not just the -line-boundary-regexp one.
(allout-prefix-data): Incorporate information from the various allout
regexp's formfeed alternative group, when present.
(allout-write-file-hook-handler): Rectify mangling of the error handling.
It was broken in 2007-12-06T19:56:41Z!deego@gnufans.org, where an `error' condition-case handler was
apparently reformatted as if it was a call to the error function. An
apparent repair attempt in version 1.101 situated the original body of the
error handling code as bogus condition-case handlers. I've returned to
just about the working code that was originally there, removing an
unnecessary - but benign - enclosing 'progn'. \(Automated or cursory code
fixes often aren't.)
(allout-region-active-p): Fallback to value of mark-active if neither
use-region-p nor region-active-p are present, for compatability with
current and recent emacs major releases.
| -rw-r--r-- | lisp/allout.el | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/lisp/allout.el b/lisp/allout.el index 48371938242..4cdb8735f8a 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -155,11 +155,11 @@ unless optional third, non-nil element is present.") | |||
| 155 | ("*" allout-rebullet-current-heading) | 155 | ("*" allout-rebullet-current-heading) |
| 156 | ("#" allout-number-siblings) | 156 | ("#" allout-number-siblings) |
| 157 | ("\C-k" allout-kill-line t) | 157 | ("\C-k" allout-kill-line t) |
| 158 | ("\M-k" allout-copy-line-as-kill t) | 158 | ([?\M-k] allout-copy-line-as-kill t) |
| 159 | ("\C-y" allout-yank t) | 159 | ("\C-y" allout-yank t) |
| 160 | ("\M-y" allout-yank-pop t) | 160 | ([?\M-y] allout-yank-pop t) |
| 161 | ("\C-k" allout-kill-topic) | 161 | ("\C-k" allout-kill-topic) |
| 162 | ("\M-k" allout-copy-topic-as-kill) | 162 | ([?\M-k] allout-copy-topic-as-kill) |
| 163 | ; Miscellaneous commands: | 163 | ; Miscellaneous commands: |
| 164 | ;([?\C-\ ] allout-mark-topic) | 164 | ;([?\C-\ ] allout-mark-topic) |
| 165 | ("@" allout-resolve-xref) | 165 | ("@" allout-resolve-xref) |
| @@ -886,7 +886,7 @@ topic prefix to be matched.") | |||
| 886 | (make-variable-buffer-local 'allout-depth-one-regexp) | 886 | (make-variable-buffer-local 'allout-depth-one-regexp) |
| 887 | ;;;_ = allout-line-boundary-regexp | 887 | ;;;_ = allout-line-boundary-regexp |
| 888 | (defvar allout-line-boundary-regexp () | 888 | (defvar allout-line-boundary-regexp () |
| 889 | "`allout-regexp' with outline style beginning-of-line anchor. | 889 | "`allout-regexp' prepended with a newline for the search target. |
| 890 | 890 | ||
| 891 | This is properly set by `set-allout-regexp'.") | 891 | This is properly set by `set-allout-regexp'.") |
| 892 | (make-variable-buffer-local 'allout-line-boundary-regexp) | 892 | (make-variable-buffer-local 'allout-line-boundary-regexp) |
| @@ -1058,7 +1058,7 @@ Also refresh various data structures that hinge on the regexp." | |||
| 1058 | (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) | 1058 | (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) |
| 1059 | (setq allout-header-subtraction (1- (length allout-header-prefix))) | 1059 | (setq allout-header-subtraction (1- (length allout-header-prefix))) |
| 1060 | 1060 | ||
| 1061 | (let (new-part old-part) | 1061 | (let (new-part old-part formfeed-part) |
| 1062 | (setq new-part (concat "\\(" | 1062 | (setq new-part (concat "\\(" |
| 1063 | (regexp-quote allout-header-prefix) | 1063 | (regexp-quote allout-header-prefix) |
| 1064 | "[ \t]*" | 1064 | "[ \t]*" |
| @@ -1072,18 +1072,26 @@ Also refresh various data structures that hinge on the regexp." | |||
| 1072 | "\\)" | 1072 | "\\)" |
| 1073 | "+" | 1073 | "+" |
| 1074 | " ?[^" allout-primary-bullet "]") | 1074 | " ?[^" allout-primary-bullet "]") |
| 1075 | formfeed-part "\\(\^L\\)" | ||
| 1076 | |||
| 1075 | allout-regexp (concat new-part | 1077 | allout-regexp (concat new-part |
| 1076 | "\\|" | 1078 | "\\|" |
| 1077 | old-part | 1079 | old-part |
| 1078 | "\\|\^l") | 1080 | "\\|" |
| 1081 | formfeed-part) | ||
| 1079 | 1082 | ||
| 1080 | allout-line-boundary-regexp (concat "\n" new-part | 1083 | allout-line-boundary-regexp (concat "\n" new-part |
| 1081 | "\\|" | 1084 | "\\|" |
| 1082 | "\n" old-part) | 1085 | "\n" old-part |
| 1086 | "\\|" | ||
| 1087 | "\n" formfeed-part) | ||
| 1083 | 1088 | ||
| 1084 | allout-bob-regexp (concat "\\`" new-part | 1089 | allout-bob-regexp (concat "\\`" new-part |
| 1085 | "\\|" | 1090 | "\\|" |
| 1086 | "\\`" old-part)) | 1091 | "\\`" old-part |
| 1092 | "\\|" | ||
| 1093 | "\\`" formfeed-part | ||
| 1094 | )) | ||
| 1087 | 1095 | ||
| 1088 | (setq allout-depth-specific-regexp | 1096 | (setq allout-depth-specific-regexp |
| 1089 | (concat "\\(^\\|\\`\\)" | 1097 | (concat "\\(^\\|\\`\\)" |
| @@ -1501,13 +1509,12 @@ See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") | |||
| 1501 | (condition-case failure | 1509 | (condition-case failure |
| 1502 | (setq allout-after-save-decrypt | 1510 | (setq allout-after-save-decrypt |
| 1503 | (allout-encrypt-decrypted except-mark)) | 1511 | (allout-encrypt-decrypted except-mark)) |
| 1504 | (message "allout-write-file-hook-handler suppressing error %s" | 1512 | (error (message |
| 1505 | failure) | 1513 | "allout-write-file-hook-handler suppressing error %s" |
| 1506 | (sit-for 2) | 1514 | failure) |
| 1507 | (error "allout-write-file-hook-handler suppressing error %s" | 1515 | (sit-for 2))))) |
| 1508 | failure)))) | ||
| 1509 | )) | 1516 | )) |
| 1510 | nil) | 1517 | nil) |
| 1511 | ;;;_ > allout-auto-save-hook-handler () | 1518 | ;;;_ > allout-auto-save-hook-handler () |
| 1512 | (defun allout-auto-save-hook-handler () | 1519 | (defun allout-auto-save-hook-handler () |
| 1513 | "Implement `allout-encrypt-unencrypted-on-saves' policy for auto save." | 1520 | "Implement `allout-encrypt-unencrypted-on-saves' policy for auto save." |
| @@ -2253,9 +2260,10 @@ function can also be used as an `isearch-mode-end-hook'." | |||
| 2253 | "Register allout-prefix state data. | 2260 | "Register allout-prefix state data. |
| 2254 | 2261 | ||
| 2255 | For reference by `allout-recent' funcs. Returns BEGINNING." | 2262 | For reference by `allout-recent' funcs. Returns BEGINNING." |
| 2256 | (setq allout-recent-prefix-end (or (match-end 1) (match-end 2)) | 2263 | (setq allout-recent-prefix-end (or (match-end 1) (match-end 2) (match-end 3)) |
| 2257 | allout-recent-prefix-beginning (or (match-beginning 1) | 2264 | allout-recent-prefix-beginning (or (match-beginning 1) |
| 2258 | (match-beginning 2)) | 2265 | (match-beginning 2) |
| 2266 | (match-beginning 3)) | ||
| 2259 | allout-recent-depth (max 1 (- allout-recent-prefix-end | 2267 | allout-recent-depth (max 1 (- allout-recent-prefix-end |
| 2260 | allout-recent-prefix-beginning | 2268 | allout-recent-prefix-beginning |
| 2261 | allout-header-subtraction))) | 2269 | allout-header-subtraction))) |
| @@ -2384,6 +2392,8 @@ Actually, returns prefix beginning point." | |||
| 2384 | (defun allout-depth () | 2392 | (defun allout-depth () |
| 2385 | "Return depth of topic most immediately containing point. | 2393 | "Return depth of topic most immediately containing point. |
| 2386 | 2394 | ||
| 2395 | Does not do doublecheck for aberrant topic header. | ||
| 2396 | |||
| 2387 | Return zero if point is not within any topic. | 2397 | Return zero if point is not within any topic. |
| 2388 | 2398 | ||
| 2389 | Like `allout-current-depth', but respects hidden as well as visible topics." | 2399 | Like `allout-current-depth', but respects hidden as well as visible topics." |
| @@ -2572,10 +2582,14 @@ We skip anomolous low-level topics, a la `allout-aberrant-container-p'." | |||
| 2572 | 2582 | ||
| 2573 | (when (re-search-forward allout-line-boundary-regexp nil 0) | 2583 | (when (re-search-forward allout-line-boundary-regexp nil 0) |
| 2574 | (allout-prefix-data) | 2584 | (allout-prefix-data) |
| 2585 | (goto-char allout-recent-prefix-beginning) | ||
| 2586 | (while (not (bolp)) | ||
| 2587 | (forward-char -1)) | ||
| 2575 | (and (allout-do-doublecheck) | 2588 | (and (allout-do-doublecheck) |
| 2576 | ;; this will set allout-recent-* on the first non-aberrant topic, | 2589 | ;; this will set allout-recent-* on the first non-aberrant topic, |
| 2577 | ;; whether it's the current one or one that disqualifies it: | 2590 | ;; whether it's the current one or one that disqualifies it: |
| 2578 | (allout-aberrant-container-p)) | 2591 | (allout-aberrant-container-p)) |
| 2592 | ;; this may or may not be the same as above depending on doublecheck: | ||
| 2579 | (goto-char allout-recent-prefix-beginning)))) | 2593 | (goto-char allout-recent-prefix-beginning)))) |
| 2580 | ;;;_ > allout-this-or-next-heading | 2594 | ;;;_ > allout-this-or-next-heading |
| 2581 | (defun allout-this-or-next-heading () | 2595 | (defun allout-this-or-next-heading () |
| @@ -5459,10 +5473,10 @@ header and body. The elements of that list are: | |||
| 5459 | (nreverse result)))) | 5473 | (nreverse result)))) |
| 5460 | ;;;_ > allout-region-active-p () | 5474 | ;;;_ > allout-region-active-p () |
| 5461 | (defmacro allout-region-active-p () | 5475 | (defmacro allout-region-active-p () |
| 5462 | (if (fboundp 'use-region-p) | 5476 | (cond ((fboundp 'use-region-p) '(use-region-p)) |
| 5463 | '(use-region-p) | 5477 | ((fboundp 'region-active-p) '(region-active-p)) |
| 5464 | '(region-active-p))) | 5478 | (t 'mark-active))) |
| 5465 | ;;;_ > allout-process-exposed (&optional func from to frombuf | 5479 | ;;_ > allout-process-exposed (&optional func from to frombuf |
| 5466 | ;;; tobuf format) | 5480 | ;;; tobuf format) |
| 5467 | (defun allout-process-exposed (&optional func from to frombuf tobuf | 5481 | (defun allout-process-exposed (&optional func from to frombuf tobuf |
| 5468 | format start-num) | 5482 | format start-num) |