Index: allout.el =================================================================== RCS file: /sources/emacs/emacs/lisp/allout.el,v retrieving revision 1.103 diff -u -u -r1.103 allout.el --- allout.el 8 Jan 2008 20:44:36 -0000 1.103 +++ allout.el 21 Jan 2008 18:37:48 -0000 @@ -155,11 +155,11 @@ ("*" allout-rebullet-current-heading) ("#" allout-number-siblings) ("\C-k" allout-kill-line t) - ("\M-k" allout-copy-line-as-kill t) + ([?\M-k] allout-copy-line-as-kill t) ("\C-y" allout-yank t) - ("\M-y" allout-yank-pop t) + ([?\M-y] allout-yank-pop t) ("\C-k" allout-kill-topic) - ("\M-k" allout-copy-topic-as-kill) + ([?\M-k] allout-copy-topic-as-kill) ; Miscellaneous commands: ;([?\C-\ ] allout-mark-topic) ("@" allout-resolve-xref) @@ -886,7 +886,7 @@ (make-variable-buffer-local 'allout-depth-one-regexp) ;;;_ = allout-line-boundary-regexp (defvar allout-line-boundary-regexp () - "`allout-regexp' with outline style beginning-of-line anchor. + "`allout-regexp' prepended with a newline for the search target. This is properly set by `set-allout-regexp'.") (make-variable-buffer-local 'allout-line-boundary-regexp) @@ -1058,7 +1058,7 @@ (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) (setq allout-header-subtraction (1- (length allout-header-prefix))) - (let (new-part old-part) + (let (new-part old-part formfeed-part) (setq new-part (concat "\\(" (regexp-quote allout-header-prefix) "[ \t]*" @@ -1072,18 +1072,26 @@ "\\)" "+" " ?[^" allout-primary-bullet "]") + formfeed-part "\\(\^L\\)" + allout-regexp (concat new-part "\\|" old-part - "\\|\^l") + "\\|" + formfeed-part) allout-line-boundary-regexp (concat "\n" new-part "\\|" - "\n" old-part) + "\n" old-part + "\\|" + "\n" formfeed-part) allout-bob-regexp (concat "\\`" new-part "\\|" - "\\`" old-part)) + "\\`" old-part + "\\|" + "\\`" formfeed-part + )) (setq allout-depth-specific-regexp (concat "\\(^\\|\\`\\)" @@ -1501,13 +1509,12 @@ (condition-case failure (setq allout-after-save-decrypt (allout-encrypt-decrypted except-mark)) - (message "allout-write-file-hook-handler suppressing error %s" - failure) - (sit-for 2) - (error "allout-write-file-hook-handler suppressing error %s" - failure)))) + (error (message + "allout-write-file-hook-handler suppressing error %s" + failure) + (sit-for 2))))) )) - nil) + nil) ;;;_ > allout-auto-save-hook-handler () (defun allout-auto-save-hook-handler () "Implement `allout-encrypt-unencrypted-on-saves' policy for auto save." @@ -2146,7 +2153,7 @@ ;;; &optional prelen) (defun allout-overlay-insert-in-front-handler (ol after beg end &optional prelen) - "Shift the overlay so stuff inserted in front of it is excluded." + "Shift the overlay so stuff inserted in front of it is not included." (if after ;; XXX Shouldn't moving the overlay should be unnecessary, if overlay ;; front-advance on the overlay worked as it should? @@ -2253,9 +2260,10 @@ "Register allout-prefix state data. For reference by `allout-recent' funcs. Returns BEGINNING." - (setq allout-recent-prefix-end (or (match-end 1) (match-end 2)) + (setq allout-recent-prefix-end (or (match-end 1) (match-end 2) (match-end 3)) allout-recent-prefix-beginning (or (match-beginning 1) - (match-beginning 2)) + (match-beginning 2) + (match-beginning 3)) allout-recent-depth (max 1 (- allout-recent-prefix-end allout-recent-prefix-beginning allout-header-subtraction))) @@ -2384,6 +2392,8 @@ (defun allout-depth () "Return depth of topic most immediately containing point. +Does not do doublecheck for aberrant topic header. + Return zero if point is not within any topic. Like `allout-current-depth', but respects hidden as well as visible topics." @@ -2572,10 +2582,14 @@ (when (re-search-forward allout-line-boundary-regexp nil 0) (allout-prefix-data) + (goto-char allout-recent-prefix-beginning) + (while (not (bolp)) + (forward-char -1)) (and (allout-do-doublecheck) ;; this will set allout-recent-* on the first non-aberrant topic, ;; whether it's the current one or one that disqualifies it: (allout-aberrant-container-p)) + ;; this may or may not be the same as above depending on doublecheck: (goto-char allout-recent-prefix-beginning)))) ;;;_ > allout-this-or-next-heading (defun allout-this-or-next-heading () @@ -5459,10 +5473,10 @@ (nreverse result)))) ;;;_ > allout-region-active-p () (defmacro allout-region-active-p () - (if (fboundp 'use-region-p) - '(use-region-p) - '(region-active-p))) -;;;_ > allout-process-exposed (&optional func from to frombuf + (cond ((fboundp 'use-region-p) '(use-region-p)) + ((fboundp 'region-active-p) '(region-active-p)) + (t 'mark-active))) +;;_ > allout-process-exposed (&optional func from to frombuf ;;; tobuf format) (defun allout-process-exposed (&optional func from to frombuf tobuf format start-num)