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, 17 Feb 2005 11:03:44 +0100

> > Yes.  `re-search-forward' has a performance problem.
> > `fill-cvs-emacs' is the fastest.  `fill-skip-char' is better
> > than `re-search-forward'.  So, our new function will be...
> >
> > (defun LaTeX-fill-delete-newlines (from to justify nosqueeze squeeze-after)

I checked in.

> >   ;; COMPATIBILITY for Emacs <= 22.1
> 
> This should be "... for Emacs < 22.1 and XEmacs".
> 
Thank you.

> >   (if (fboundp 'fill-delete-newlines)
> >       (fill-delete-newlines from to justify nosqueeze squeeze-after)
> >     (if (featurep 'xemacs)
> >         (when (featurep 'mule)
> >           (goto-char from)
> >           (while (re-search-forward "\\(\\cj\\)\n\\(\\cj\\)" to t)
> 
> It would be good to use something like the value of
> `word-across-newline' in the regular expression,
> i.e. "\\(\\cj\\|\\cc\\|\\ct\\)\n\\(\\cj\\|\\cc\\|\\ct\\)".  If the
> variable `word-across-newline' should be used, one somehow will have
> to silence the byte compiler.

To define `LaTeX-nospace-between-char-regexp' looks good to me.

(defcustom LaTeX-nospace-between-char-regexp
  (when (featurep 'mule)
    (if (boundp 'word-across-newline)
	word-across-newline
      "\\c|"))
  "Regular expression of such characters which can be a word across newline."
  :group 'LaTeX
  :type 'regexp)

# Where to put it?
# After `;;; Filling' ?

Using this variable,

> >           (while (re-search-forward "\\(\\cj\\)\n\\(\\cj\\)" to t)

is changed to...

	  (let ((remove-newline (cancat LaTeX-nospace-between-char-regexp "\n"
					LaTeX-nospace-between-char-regexp)))
	    (while (re-search-forward remove-newline to t)

> >> A little bit shorter: `LaTeX-nospace-between-char-regexp'.
> >> Any better suggestions?
> >
> With the above function we don't even need it.
> 
We can use it in `LaTeX-fill-move-to-break-point', too:

(defun LaTeX-fill-move-to-break-point (linebeg)
...
    ;; Cancel `forward-char' which is called just before
    ;; `LaTeX-fill-move-to-break-point' if the char before point matches
    ;; `LaTeX-nospace-between-char-regexp'.
    (if (and (featurep 'mule)
	     (TeX-looking-at-backward LaTeX-nospace-between-char-regexp))
	(backward-char 1)
      (skip-chars-backward "^ \n"))

Any better suggestion?
I'll check in this change this night.

> >       ;; This else-sentence was copied from the function `fill-delete-newlines'
> >       ;; in `fill.el' (CVS Emacs, 2005-02-17).
(snip)
> > ;; Is comment appropriate?
> 
> Yep.  You could add something like "... and adapted accordingly"
> because the checks for the fill-space text property were removed.
> (AFAICS this property is not used in Emacs 21.3.)
> 
Thanks.

---
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.