Re: Issues with japanese support

Ralf Angeli <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
* Masayuki Ataka (2005-02-16) writes:

> Maybe we need a new variable for Emacs21 and XEmacs.
>   (defvar LaTeX-word-across-newline
>     (if (boundp 'word-across-newline) word-across-newline "\\c|"))

Although I have a `re-search-forward' phobia since we had these
performance problems related to filling, I think this would be a
pragmatic solution.  At least there is not much difference in
execution time between the following two implementations (work only
with Emacs):

(with-temp-buffer
  (dotimes (i 100000)
    (insert "いいいい\nいいい\n"))
  (goto-char (point-min))
  (abs (- (prog1 (float-time (current-time))
	    (while (search-forward "\n" nil 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)))))
	  (float-time (current-time)))))

(with-temp-buffer
  (dotimes (i 100000)
    (insert "いいいい\nいいい\n"))
  (goto-char (point-min))
  (abs (- (prog1 (float-time (current-time))
	    (while (re-search-forward "\\(\\c|\\)\n\\(\\c|\\)" nil t)
	      (replace-match "\\1\\2")))
	  (float-time (current-time)))))


What I don't like is the name `LaTeX-word-across-newline'.  What about
something matching better its value/purpose, like
`LaTeX-nospace-between-words-char-regexp'.  Argh, I created a
monster.  A little bit shorter: `LaTeX-nospace-between-char-regexp'.
Any better suggestions?

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