Changeset 4284

Show
Ignore:
Timestamp:
10/23/09 14:53:10 (5 weeks ago)
Author:
gls
Message:

Further bug fixes for tables and for verbatim blocks

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Fortify/fortify.el

    r4282 r4284  
    17711771  ;; If we fail, we simply hand back the string with the trailing backquotes removed. 
    17721772  (goto-char *fortify-region-start*) 
    1773   (cond ((search-forward str *fortify-region-end* t) 
    1774          (newfortify-region (- (point) (length str)) (- (point) 1))) 
    1775         (t (substring str 0 (+ 1 (or (position-if '(lambda (c) (not (= c ?\`))) str :from-end t) -1)))))) 
     1773  (let ((epos (+ 1 (or (position-if '(lambda (c) (not (= c ?\`))) str :from-end t) -1)))) 
     1774    (cond ((search-forward str *fortify-region-end* t) 
     1775           (newfortify-region (- (point) (length str)) (- (point) (- (length str) epos)))) 
     1776          (t (substring str 0 epos))))) 
    17761777 
    17771778;;; **************************************************************** 
     
    22022203                                                (push "" result) 
    22032204                                                (setq lns (cdr lns)) 
    2204                                                 (while (and lns 
    2205                                                             (or (not (string= (car lns) "}}}")) 
    2206                                                                 (> (position ?\} (car lns)) begin-indent))) 
    2207                                                   (push (concat "\\lind{" (number-to-string (or curindent 0)) "}{\\tt" 
     2205                                                (do ((prefix (concat "\\lind{" (number-to-string (or curindent 0)) "}") 
     2206                                                             "\\hfil\\break\\null")) 
     2207                                                    ((or (null lns) 
     2208                                                         (and (string= (fortress-trim-string (car lns)) "}}}") 
     2209                                                              (not (> (position ?\} (car lns)) begin-indent))))) 
     2210                                                  (push (concat prefix 
     2211                                                                "{\\tt " 
    22082212                                                                (fortress-render-string-contents 
    22092213                                                                 (fortress-trim-string-right 
    22102214                                                                  (substring (car lns)  
    2211                                                                              (if (string= (car lns) "}}}") 
     2215                                                                             (if (string= (fortress-trim-string (car lns)) "}}}") 
    22122216                                                                                 (+ begin-indent 1) 
    22132217                                                                               (min begin-indent 
    2214                                                                                     (or (position-if '(lambda (c) (not (= c ?\s))) (car lns)) 
     2218                                                                                    (or (position-if-not '(lambda (c) (= c ?\s)) (car lns)) 
    22152219                                                                                        (length (car lns)))))))) 
    22162220                                                                "}") 
    22172221                                                        result)  
    22182222                                                  (setq lns (cdr lns))) 
     2223                                                (push (concat (pop result) " \\\\") result) 
    22192224                                                (setq hrule-last nil) 
    22202225                                                (setq continue-previous-line nil) 
     
    24162421         (assert (every '(lambda (x) (= x (car pipes))) pipes)) 
    24172422         (let* ((ncols (- col-from-right)) 
    2418                 (header-seps (cons (make-string (- min-initial-pipe-count 1) ?\|) most-header-seps)) 
     2423                (header-seps (cons (if (> min-initial-pipe-count 1) (make-string (- min-initial-pipe-count 1) ?\|) "@{}") most-header-seps)) 
    24192424                (semi-final-rows (fortress-convert-neutral-table-cells row-types rows)) 
    24202425                (best-column-types (fortress-best-column-types row-types semi-final-rows ncols))