Masayuki Ataka
2005-02-26 09:13:50 UTC
I wrote the code for kinsoku in LaTeX-fill-move-to-break-point.
Kinsoku is a process especially for Japanese, which moves
fill's break point when the char at the break point should not
be at the end of line or at the beginning of line; they are
called `Gyoto-kinsosku' and `Gyomatsu-kinsoku', respectively.
Kinsoku is done in CVS Emacs with fill-move-to-break-point.
So, this code is for Emacs 21 and XEmacs. I confirmed that
this function works fine in Emacs 21.4. But I'm not sure this
works on early XEmacs.
If no objection, I'll commit this.
Comments and suggestions are welcome.
regards,
---
email: ***@milk.freemail.ne.jp
Name:: Masayuki Ataka // (Japan)
P.S.
---
I can't see `charset-after' in the source code of XEmacs 21.2.
Index: latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/latex.el,v
retrieving revision 5.334
diff -c -r5.334 latex.el
*** latex.el 24 Feb 2005 08:38:34 -0000 5.334
--- latex.el 26 Feb 2005 08:59:39 -0000
***************
*** 2615,2621 ****
(concat "^[ \t]+\\|^[ \t]*" TeX-comment-start-regexp "+[ \t]*")
(1- (line-beginning-position)))
(goto-char (match-end 0))
! (skip-chars-forward "^ \n" (point-max)))))
;; Cater for \verb|...| (and similar) contructs which should not be
;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
;; doc.sty) where |...| is allowed. Arbitrary delimiters may be
--- 2615,2637 ----
(concat "^[ \t]+\\|^[ \t]*" TeX-comment-start-regexp "+[ \t]*")
(1- (line-beginning-position)))
(goto-char (match-end 0))
! (skip-chars-forward "^ \n" (point-max))))
! ;; This code was copied from the function `fill-move-to-break-point'
! ;; in `fill.el' (CVS Emacs, 2005-02-22) and adapted accordingly.
! (when (and (< linebeg (point))
! ;; If we are going to break the line after or
! ;; before a non-ascii character, we may have to
! ;; run a special function for the charset of the
! ;; character to find the correct break point.
! enable-multibyte-characters
! (fboundp 'charset-after)
! (not (and (eq (charset-after (1- (point))) 'ascii)
! (eq (charset-after (point)) 'ascii))))
! ;; Make sure we take SOMETHING after the fill prefix if any.
! (if (fboundp 'fill-find-break-point)
! (fill-find-break-point linebeg)
! (when (fboundp 'kinsoku-prcess) ;XEmacs
! (kinsoku-prcess)))))
;; Cater for \verb|...| (and similar) contructs which should not be
;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
;; doc.sty) where |...| is allowed. Arbitrary delimiters may be
Kinsoku is a process especially for Japanese, which moves
fill's break point when the char at the break point should not
be at the end of line or at the beginning of line; they are
called `Gyoto-kinsosku' and `Gyomatsu-kinsoku', respectively.
Kinsoku is done in CVS Emacs with fill-move-to-break-point.
So, this code is for Emacs 21 and XEmacs. I confirmed that
this function works fine in Emacs 21.4. But I'm not sure this
works on early XEmacs.
If no objection, I'll commit this.
Comments and suggestions are welcome.
regards,
---
email: ***@milk.freemail.ne.jp
Name:: Masayuki Ataka // (Japan)
P.S.
---
I can't see `charset-after' in the source code of XEmacs 21.2.
Index: latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/latex.el,v
retrieving revision 5.334
diff -c -r5.334 latex.el
*** latex.el 24 Feb 2005 08:38:34 -0000 5.334
--- latex.el 26 Feb 2005 08:59:39 -0000
***************
*** 2615,2621 ****
(concat "^[ \t]+\\|^[ \t]*" TeX-comment-start-regexp "+[ \t]*")
(1- (line-beginning-position)))
(goto-char (match-end 0))
! (skip-chars-forward "^ \n" (point-max)))))
;; Cater for \verb|...| (and similar) contructs which should not be
;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
;; doc.sty) where |...| is allowed. Arbitrary delimiters may be
--- 2615,2637 ----
(concat "^[ \t]+\\|^[ \t]*" TeX-comment-start-regexp "+[ \t]*")
(1- (line-beginning-position)))
(goto-char (match-end 0))
! (skip-chars-forward "^ \n" (point-max))))
! ;; This code was copied from the function `fill-move-to-break-point'
! ;; in `fill.el' (CVS Emacs, 2005-02-22) and adapted accordingly.
! (when (and (< linebeg (point))
! ;; If we are going to break the line after or
! ;; before a non-ascii character, we may have to
! ;; run a special function for the charset of the
! ;; character to find the correct break point.
! enable-multibyte-characters
! (fboundp 'charset-after)
! (not (and (eq (charset-after (1- (point))) 'ascii)
! (eq (charset-after (point)) 'ascii))))
! ;; Make sure we take SOMETHING after the fill prefix if any.
! (if (fboundp 'fill-find-break-point)
! (fill-find-break-point linebeg)
! (when (fboundp 'kinsoku-prcess) ;XEmacs
! (kinsoku-prcess)))))
;; Cater for \verb|...| (and similar) contructs which should not be
;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
;; doc.sty) where |...| is allowed. Arbitrary delimiters may be