mule-ja
[Top][All Lists]
Advanced

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

[mule-ja:46] line-height property


From: ynyaaa
Subject: [mule-ja:46] line-height property
Date: Sun, 28 Jun 2015 00:26:10 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

矢木です。

line-height プロパティに関する問題点について報告します。

実行環境は次の通りです。
GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570
Microsoft Windows [Version 6.0.6002]

1. Info の記述と実装の食い違い

info の (elisp)Line Height には次のように書かれています。

>   If the property value is a list of the form ‘(HEIGHT TOTAL)’, that
>adds extra space _below_ the display line.  First Emacs uses HEIGHT as a
>height spec to control extra space _above_ the line; then it adds enough
>space _below_ the line to bring the total line height up to TOTAL.  In
>this case, the other ways to specify the line spacing are ignored.

しかし実際に値を設定してみると、
(put-text-property (point-min) (point-max) 'line-height '(1.5 2.0))
によって行の上側に0.5行分、下側に1行分の間隔が表示され、
全体では2.5行分の高さになります。

Infoの記述通りならば上下共に0.5行分の間隔が表示されて
全体では2行分の高さになるべきだと思います。

2. 設定できない場合

line-height プロパティが意味を持つのは改行コード上のみのようで、
かつ改行位置が表示されていなければなりません。ゆえに

   truncate-lines が nil で折り返し表示されている表示行
   truncate-lines が t で切り捨て表示されている表示行
   バッファ末尾の改行を持たない行

については個別にスペーシングを設定することができません。

3. line-height の値が t の時のバグ

line-height プロパティに t を指定した行であって
display プロパティが指定されていない行が沢山ある場合、
ウィンドウ開始位置の変更を伴うコマンドがおかしくなります。

下の式を評価して M->, C-v, M-v, C-n, C-p などで移動しようとすると
M-> : バッファ中程に移動し、末尾に移動できない
C-v : End of buffer(バッファの先頭でも)
M-v : 数百行戻る
C-p, C-n : ウィンドウ端から出ようとすると変な所に移動してしまい、
      その後1行づつスクロールする

(dotimes (i 1000)
  (insert (format "%d" i) (propertize "\n" 'line-height t)))

display プロパティにスペースや画像が指定されていている場合は
少し振る舞いが変化するようです。

おわり



reply via email to

[Prev in Thread] Current Thread [Next in Thread]