GNU Emacs 32.0.50 (9008bf64c3) のマニュアルを PLaMo 翻訳で機械翻訳したものです。誤訳を含むことがあります。原文: https://www.gnu.org/software/emacs/manual/html_node/elisp/Button-Buffer-Commands.html ・ emacs-doc.conao3.com

42.20.5 ボタンバッファコマンド

これらは、Emacsバッファ内のボタンを特定し、操作するためのコマンドおよび関数です。

push-button は、ユーザーが実際にボタンを押し込む際に使用するコマンドであり、デフォルトではボタン自体のオーバーレイまたはテキストプロパティにあるローカルキーマップを用いて、RET および mouse-2 にバインドされています。forward-button や backward-button のようにボタン外部で有用なコマンドは、button-buffer-map に格納されているキーマップでも利用可能です。ボタンを使用するモードでは、自身のキーマップの親キーマップとして button-buffer-map を利用することが考えられます。あるいは、button-mode を有効にすることでほぼ同様の効果を得られます。これは button-buffer-map をマイナーモードキーマップとしてインストールするだけのマイナーモードです(なお、button-mode を無効にすると、現在のバッファ内のすべてのボタンが削除されます)。

ボタンに nil follow-link 以外のプロパティが設定されており、かつ mouse-1-click-follows-link が設定されている場合、mouse-1 を素早くクリックしても push-button コマンドが実行されます。クリック可能なテキストの定義 を参照してください。

コマンド: プッシュボタン &optional pos use-mouse-action

位置 pos で、ボタンで指定されたアクションを実行します。pos はバッファ位置またはマウスイベントのいずれかです。use-mouse-action が nil 以外であるか、または pos がマウスイベント(マウスイベント を参照)である場合は、action の代わりにボタンの mouse-action プロパティを呼び出すようにします。ボタンに mouse-action プロパティがない場合は、通常通り action を使用します。pos のデフォルト値は point ですが、push-button がマウスイベントの結果としてインタラクティブに呼び出された場合は、そのマウスイベントの位置が使用されます。pos にボタンがない場合は何も行わず nil を返し、それ以外の場合は t を返します。

コマンド: forward-button n &optional wrap display-message no-error

Move to the nth next button, or nth previous button if n is negative. If n is zero, move to the start of any button at point. If wrap is non-nil, moving past either end of the buffer continues from the other end. If display-message is non-nil, the button’s help-echo string is displayed. Any button with a non-nil skip property is skipped over. Returns the button found, and signals an error if no buttons can be found. If no-error is non-nil, return nil instead of signaling the error.

コマンド: backward-button n &optional wrap display-message no-error

Move to the nth previous button, or nth next button if n is negative. If n is zero, move to the start of any button at point. If wrap is non-nil, moving past either end of the buffer continues from the other end. If display-message is non-nil, the button’s help-echo string is displayed. Any button with a non-nil skip property is skipped over. Returns the button found, and signals an error if no buttons can be found. If no-error is non-nil, return nil instead of signaling the error.

関数: next-button pos &optional count-current
関数: previous-button pos &optional count-current

現在のバッファにおいて、位置 pos の次(next-button の場合)または前(previous-button の場合)のボタンを返します。count-current が nil 以外の場合は、次のボタンからではなく、pos にあるボタンを検索対象に含めます。