Show
Ignore:
Timestamp:
07/29/06 07:48:34 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/allout.el

    r4111 r4131  
    581581 
    582582\(If set, this makes it an even better practice to exercise changes by 
    583 doing byte-compilation with a repeat count, so the file is loaded at the 
    584 of compilation.) 
     583doing byte-compilation with a repeat count, so the file is loaded after 
     584compilation.) 
    585585 
    586586See `allout-run-unit-tests' to see what's run." 
     
    11081108(defmacro allout-unprotected (expr) 
    11091109  "Enable internal outline operations to alter invisible text." 
    1110   `(let ((inhibit-read-only t)) 
     1110  `(let ((inhibit-read-only t) 
     1111         (inhibit-field-text-motion t)) 
    11111112     ,expr)) 
    11121113;;;_   = allout-mode-hook 
     
    19211922(defun allout-e-o-prefix-p () 
    19221923  "True if point is located where current topic prefix ends, heading begins." 
    1923   (and (save-excursion (beginning-of-line) 
     1924  (and (save-excursion (let ((inhibit-field-text-motion t)) 
     1925                         (beginning-of-line)) 
    19241926                       (looking-at allout-regexp)) 
    19251927       (= (point)(save-excursion (allout-end-of-prefix)(point))))) 
     
    20232025  "Like beginning of line, but to visible text." 
    20242026 
    2025   ;; XXX We would use `(move-beginning-of-line 1)', but it gets 
    2026   ;; stuck on some hidden newlines, eg at column 80, as of GNU Emacs 22.0.50. 
    2027   ;; Conversely, `beginning-of-line' can make no progress in other 
    2028   ;; situations.  Both are necessary, in the order used below. 
    2029   (move-beginning-of-line 1) 
    2030   (beginning-of-line) 
    2031   (while (or (not (bolp)) (allout-hidden-p)) 
     2027  ;; This combination of move-beginning-of-line and beginning-of-line is 
     2028  ;; deliberate, but the (beginning-of-line) may now be superfluous. 
     2029  (let ((inhibit-field-text-motion t)) 
     2030    (move-beginning-of-line 1) 
    20322031    (beginning-of-line) 
    2033     (if (or (allout-hidden-p) (not (bolp))) 
    2034         (forward-char -1)))) 
     2032    (while (and (not (bobp)) (or (not (bolp)) (allout-hidden-p))) 
     2033      (beginning-of-line) 
     2034      (if (or (allout-hidden-p) (not (bolp))) 
     2035          (forward-char -1))))) 
    20352036;;;_   > allout-end-of-current-line () 
    20362037(defun allout-end-of-current-line () 
     
    20392040  ;; `move-end-of-line' doesn't suffer the same problem as 
    20402041  ;; `move-beginning-of-line'. 
    2041   (end-of-line) 
    2042   (while (allout-hidden-p) 
     2042  (let ((inhibit-field-text-motion t)) 
    20432043    (end-of-line) 
    2044     (if (allout-hidden-p) (forward-char 1)))) 
     2044    (while (allout-hidden-p) 
     2045      (end-of-line) 
     2046      (if (allout-hidden-p) (forward-char 1))))) 
    20452047;;;_   > allout-next-heading () 
    20462048(defsubst allout-next-heading () 
     
    25802582 
    25812583  (interactive "p") 
    2582   (let* ((backward (if (< arg 0) (setq arg (* -1 arg)))) 
     2584  (let* ((inhibit-field-text-motion t) 
     2585         (backward (if (< arg 0) (setq arg (* -1 arg)))) 
    25832586         (step (if backward -1 1)) 
    25842587         prev got) 
     
    27582761 
    27592762      (if mapped-binding 
    2760           (setq allout-post-goto-bullet on-bullet 
    2761                 this-command mapped-binding))))) 
     2763          (setq this-command mapped-binding))))) 
    27622764 
    27632765;;;_   > allout-find-file-hook () 
     
    30123014 
    30133015  (allout-beginning-of-current-line) 
    3014   (let* ((depth (+ (allout-current-depth) relative-depth)) 
     3016  (let* ((inhibit-field-text-motion t) 
     3017         (depth (+ (allout-current-depth) relative-depth)) 
    30153018         (opening-on-blank (if (looking-at "^\$") 
    30163019                               (not (setq before nil)))) 
     
    36303633 
    36313634  (interactive) 
    3632   (let* ((collapsed (allout-current-topic-collapsed-p)) 
     3635  (let* ((inhibit-field-text-motion t) 
     3636         (collapsed (allout-current-topic-collapsed-p)) 
    36333637         (beg (prog1 (allout-back-to-current-heading) (beginning-of-line))) 
    36343638         (depth (allout-recent-depth))) 
     
    36803684  (if (< (allout-mark-marker t) (point)) 
    36813685      (exchange-point-and-mark)) 
    3682   (let* ((subj-beg (point)) 
     3686  (let* ((inhibit-field-text-motion t) 
     3687         (subj-beg (point)) 
    36833688         (into-bol (bolp)) 
    36843689         (subj-end (allout-mark-marker t)) 
     
    38493854        (error "Current heading lacks cross-reference bullet `%s'" 
    38503855               allout-file-xref-bullet) 
    3851       (let (file-name) 
     3856      (let ((inhibit-field-text-motion t) 
     3857            file-name) 
    38523858        (save-excursion 
    38533859          (let* ((text-start allout-recent-prefix-end) 
     
    38973903  (save-excursion 
    38983904    (allout-back-to-current-heading) 
    3899     (end-of-line) 
     3905    (let ((inhibit-field-text-motion t)) 
     3906      (end-of-line)) 
    39003907    (allout-flag-region (point) 
    39013908                        ;; Exposing must not leave trailing blanks hidden, 
     
    39863993  (interactive) 
    39873994  (save-excursion 
    3988     (let ((orig-pt (point)) 
     3995    (let ((inhibit-field-text-motion t) 
     3996          (orig-pt (point)) 
    39893997          (orig-pref (allout-goto-prefix)) 
    39903998          (last-at (point)) 
     
    40184026  (allout-back-to-current-heading) 
    40194027  (save-excursion 
    4020     (end-of-line) 
     4028    (let ((inhibit-field-text-motion t)) 
     4029      (end-of-line)) 
    40214030    (allout-flag-region (point) 
    40224031                        (progn (allout-end-of-entry) (point)) 
     
    40884097          (t (goto-char 0) 
    40894098             (message sibs-msg) 
     4099             (allout-goto-prefix) 
    40904100             (allout-expose-topic '(0 :)) 
    40914101             (message (concat sibs-msg "  Done.")))) 
     
    40954105  "Show all subheadings of this heading, but not their bodies." 
    40964106  (interactive) 
    4097   (beginning-of-line) 
     4107  (let ((inhibit-field-text-motion t)) 
     4108    (beginning-of-line)) 
    40984109  (allout-show-children t)) 
    40994110;;;_   > allout-hide-current-leaves () 
     
    41254136      (narrow-to-region start end) 
    41264137      (goto-char (point-min)) 
    4127       (while (not (eobp)) 
    4128         (end-of-line) 
    4129         (allout-flag-region (point) (allout-end-of-entry) t) 
    4130         (if (not (eobp)) 
    4131             (forward-char 
    4132              (if (looking-at "\n\n") 
    4133                  2 1))))))) 
     4138      (let ((inhibit-field-text-motion t)) 
     4139        (while (not (eobp)) 
     4140          (end-of-line) 
     4141          (allout-flag-region (point) (allout-end-of-entry) t) 
     4142          (if (not (eobp)) 
     4143              (forward-char 
     4144               (if (looking-at "\n\n") 
     4145                   2 1)))))))) 
    41344146 
    41354147;;;_   > allout-expose-topic (spec) 
     
    42844296 
    42854297  (interactive "xExposure spec: ") 
    4286   (let ((depth (allout-current-depth)) 
     4298  (let ((inhibit-field-text-motion t) 
     4299        (depth (allout-current-depth)) 
    42874300        max-pos) 
    42884301    (cond ((null spec) nil) 
     
    44634476  (save-excursion 
    44644477    (let* 
    4465         ;; state vars: 
    4466         (strings prefix result depth new-depth out gone-out bullet beg 
     4478        ((inhibit-field-text-motion t) 
     4479         ;; state vars: 
     4480         strings prefix result depth new-depth out gone-out bullet beg 
    44674481                 next done) 
    44684482 
     
    47434757across LaTeX processing, within the context of a `verbatim' 
    47444758environment.  Leaves point at the end of the line." 
    4745   (beginning-of-line) 
    4746   (let ((beg (point)) 
    4747         (end (progn (end-of-line)(point)))) 
    4748     (goto-char beg) 
    4749     (while (re-search-forward "\\\\" 
    4750             ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#" 
    4751                               end       ; bounded by end-of-line 
    4752                               1)        ; no matches, move to end & return nil 
    4753       (goto-char (match-beginning 0)) 
    4754       (insert "\\") 
    4755       (setq end (1+ end)) 
    4756       (goto-char (1+ (match-end 0)))))) 
     4759  (let ((inhibit-field-text-motion t)) 
     4760    (beginning-of-line) 
     4761    (let ((beg (point)) 
     4762          (end (progn (end-of-line)(point)))) 
     4763      (goto-char beg) 
     4764      (while (re-search-forward "\\\\" 
     4765                                ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#" 
     4766                                end     ; bounded by end-of-line 
     4767                                1)   ; no matches, move to end & return nil 
     4768        (goto-char (match-beginning 0)) 
     4769        (insert "\\") 
     4770        (setq end (1+ end)) 
     4771        (goto-char (1+ (match-end 0))))))) 
    47574772;;;_   > allout-insert-latex-header (buffer) 
    47584773(defun allout-insert-latex-header (buffer) 
     
    56025617  "Put the region around topic currently containing point." 
    56035618  (interactive) 
    5604   (beginning-of-line) 
     5619  (let ((inhibit-field-text-motion t)) 
     5620    (beginning-of-line)) 
    56055621  (allout-goto-prefix) 
    56065622  (push-mark (point)) 
     
    56775693      nil 
    56785694    (save-excursion 
    5679       (let ((section-data (allout-file-vars-section-data)) 
     5695      (let ((inhibit-field-text-motion t) 
     5696            (section-data (allout-file-vars-section-data)) 
    56805697            beg prefix suffix) 
    56815698        (if section-data