[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:11386] auctex-ja LaTeX-fill-paragraph



ずいぶん前に話題になった、Emacs20.[23]+auctex-jaで
LaTeX-fill-paragraphが動かないという件ですが、以下のコードを.
emacsに放り込めばうまく動くような気がするので報告します。
(弱気モード:-)
試してもらえると嬉しいです。

(eval-after-load "latex"
  '(defun LaTeX-fill-region-as-para-do (from to justify-flag)
     "Fill region as one paragraph: break lines to fit `fill-column'."
     (let (indent-to-left-margin-original)
       (fset 'indent-to-left-margin-original
             (symbol-function 'indent-to-left-margin))
       (defun indent-to-left-margin ()
         (LaTeX-indent-line)
         (setq prefixcol (current-column))
         (setq fill-prefix nil))
       (fill-region-as-paragraph from to justify-flag)
       (fset 'indent-to-left-margin
             (symbol-function 'indent-to-left-margin-original)))))

怠け者なので、fill-region-as-paragraphを利用しようと無理しま
した。そのために、すごくdirtyなことをやっています。なぜか
(fill-region-as-paragraph)が、(indent-according-to-mode)じゃ
なくて、(indent-to-left-margin)を呼んでいるのが悪いと思うの
ですが…。

鍋谷さんにauctex-jaの方を直してもらえるなら、こんなにdirtyに
はしない方がいいと思います。

(fill-region-as-paragraph)をコピーしてきて、

1. (indent-to-left-margin)を(LaTeX-indent-line)に直す。
2. 544行目からの次のコードを
		  (and fill-prefix (not (equal fill-prefix ""))
		       (progn
			 (insert-and-inherit fill-prefix)
			 (setq prefixcol (current-column))))))
  (setq prefixcol (current-column)))に変更。
3. 不要なコードをどんどん外す。

というような作業をやればいいのではないかと。私が直して、話題
のNMUをしようかと思いましたが、今日はここまでで疲れたので、
とりあえず報告とテストのお願いだけ。

-- 
川村 尚生