Re: Issues with japanese support

Masayuki Ataka <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
From: Ralf Angeli <[email protected]>
Subject: Re: Issues with japanese support
Date: Thu, 03 Mar 2005 09:13:22 +0100

> * Masayuki Ataka (2005-03-02) writes:
> 
> >> > Ikumi's question is `What for this fill-space text property is set?'
> >> > If this property is not used, it is something like a garbage.
> >> 
> >> Argh, when looking at what Emacs 21 does, I forgot that we actually
> >> set the property in other compatibility code.  If you think that
> >> checking for the property in `LaTeX-fill-delete-newlines' is useful,
> >> please add the code from `fill-delete-newlines' I left out.
> >
> > In CVS Emacs, 'fill-space is used for checking double space
> > after period, using variable `sentence-end-without-space', which
> > is not available in Emacs 21.4.
> 
> Hm, I don't see such a connection.  AFAICS
> `sentence-end-without-space' is only used for adding extra spaces to
> sentence endings at the end of a line before the newlines will get
> removed in `fill-delete-newlines'.
 
Sorry, I saw the different code and had wrong understanding.

> The 'fill-space property in contrast is used, i.e. checked, during the
> loop deleting newlines.  Because such properties may be added by
> `LaTeX-fill-newline' I think it could indeed be useful to check for
> them in `LaTeX-fill-delete-newlines'.
 
Grappling with fill-space two days, I couldn't find the
necessary condition for using fill-space.  However, if we are
in the case that fill-space is used, we should cope with it.
If no objection, I'll add the following.

*** latex.el	02  3 2005 08:57:07 +0900	5.335
--- latex.el	05  3 2005 02:31:38 +0900	
***************
*** 2552,2557 ****
--- 2552,2564 ----
        ;; Return the fill-prefix we used
        fill-prefix)))
  
+ ;; The `fill-space' property carries the string with which a newline
+ ;; should be replaced when unbreaking a line (in fill-delete-newlines).
+ ;; It is added to newline characters by fill-newline when the default
+ ;; behavior of fill-delete-newlines is not what we want.
+ (unless (featurep 'xemacs)
+   (add-to-list 'text-property-default-nonsticky '(fill-space . t)))
+ 
  (defun LaTeX-fill-delete-newlines (from to justify nosqueeze squeeze-after)
    ;; COMPATIBILITY for Emacs < 22.1 and XEmacs
    (if (fboundp 'fill-delete-newlines)
***************
*** 2567,2577 ****
        ;; This else-sentence was copied from the function `fill-delete-newlines'
        ;; in `fill.el' (CVS Emacs, 2005-02-17) and adapted accordingly.
        (while (search-forward "\n" to t)
! 	(let ((prev (char-before (match-beginning 0)))
! 	      (next (following-char)))
! 	  (when (or (aref (char-category-set next) ?|)
! 		    (aref (char-category-set prev) ?|))
! 	    (delete-char -1)))))
  
      ;; Make sure sentences ending at end of line get an extra space.
      (if (or (not (boundp 'sentence-end-double-space))
--- 2574,2586 ----
        ;; This else-sentence was copied from the function `fill-delete-newlines'
        ;; in `fill.el' (CVS Emacs, 2005-02-17) and adapted accordingly.
        (while (search-forward "\n" to t)
!   	(if (get-text-property (match-beginning 0) 'fill-space)
!   	    (replace-match (get-text-property (match-beginning 0) 'fill-space))
! 	  (let ((prev (char-before (match-beginning 0)))
! 		(next (following-char)))
! 	    (when (or (aref (char-category-set next) ?|)
! 		      (aref (char-category-set prev) ?|))
! 	      (delete-char -1))))))
  
      ;; Make sure sentences ending at end of line get an extra space.
      (if (or (not (boundp 'sentence-end-double-space))

regards,
---
email: [email protected]
Name:: Masayuki Ataka // (Japan)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.