/[emacs]/emacs/lisp/international/kinsoku.el
ViewVC logotype

Diff of /emacs/lisp/international/kinsoku.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by lektu, Tue Feb 4 13:09:38 2003 UTC revision 1.11 by handa, Fri Aug 29 12:06:24 2003 UTC
# Line 121  The value 0 means there's no limitation. Line 121  The value 0 means there's no limitation.
121    
122  ;; Try to resolve `kinsoku' restriction by making the current line longer.  ;; Try to resolve `kinsoku' restriction by making the current line longer.
123  (defun kinsoku-longer ()  (defun kinsoku-longer ()
124    (let ((pos-and-column (save-excursion    (let ((pos-and-column
125                            (forward-char 1)           (save-excursion
126                            (while (aref (char-category-set (following-char)) ?>)             (forward-char 1)
127                              (forward-char 1))             (while (and (not (eobp))
128                            (cons (point) (current-column)))))                         (or (aref (char-category-set (following-char)) ?>)
129                               ;; protect non-kinsoku words
130                               (not (or (eq (preceding-char) ? )
131                                        (aref (char-category-set (preceding-char))
132                                              ?|)))))
133                 (forward-char 1))
134               (cons (point) (current-column)))))
135      (if (or (<= kinsoku-limit 0)      (if (or (<= kinsoku-limit 0)
136              (< (cdr pos-and-column) (+ (current-fill-column) kinsoku-limit)))              (< (cdr pos-and-column) (+ (current-fill-column) kinsoku-limit)))
137          (goto-char (car pos-and-column)))))          (goto-char (car pos-and-column)))))
# Line 135  The value 0 means there's no limitation. Line 141  The value 0 means there's no limitation.
141  (defun kinsoku-shorter (linebeg)  (defun kinsoku-shorter (linebeg)
142    (let ((pos (save-excursion    (let ((pos (save-excursion
143                 (forward-char -1)                 (forward-char -1)
144                 (while (and (< linebeg (point))                 (while (and
145                             (or (aref (char-category-set (preceding-char)) ?<)                         (< linebeg (point))
146                                 (aref (char-category-set (following-char)) ?>)))                         (or (aref (char-category-set (preceding-char)) ?<)
147                               (aref (char-category-set (following-char)) ?>)
148                               ;; protect non-kinsoku words
149                               (not (or (eq (preceding-char) ? )
150                                        (aref (char-category-set (preceding-char))
151                                              ?|)))))
152                   (forward-char -1))                   (forward-char -1))
153                 (point))))                 (point))))
154      (if (< linebeg pos)      (if (< linebeg pos)

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26