1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Emacs の po-mode で翻訳時にもポップアップする

1
Posted at

EmacsでGNU gettextのPOファイルの項目を編集するとき、開かれるウィンドウをポップアップにする方法を紹介します。

同様のことをpopwin.elを使って実現する方法はEmacs の po-mode で翻訳時にも popwin するにあります。
この記事では、popwin.elを使わずにEmacsの標準機能でこれを実現します。

Emacsは24.1以上が必要です。po-modeパッケージはpo-mode-version-stringが2.30のものを使用しています。

po-modeはgettextの配布物に含まれている他、MELPAからインストールできます。ただしMELPAで配布されているバージョンは古い可能性があるためご注意ください。

さて、設定方法は以下です。

(add-to-list 'display-buffer-alist
             `(,(rx "*" (+? not-newline) ".po" (*? not-newline) "*")
               (display-buffer-in-side-window)))

ここで、編集するPOファイルは<some-name>.poの形式であることを仮定しています。この場合、生成される項目編集用のバッファは*<POファイルのバッファ名>*となります。
なお、".po" (*? not-newline)の部分は、POファイルを開いているバッファ次第で<some-name>.po<ディレクトリ名>となることがあったからです。

また、POモードでファイルを保存するときは、頻繁にVを使うことでしょう。
このときに表示される*compilation validation*バッファについても、以下のように表示されるウィンドウを控えめにできます。

(add-to-list 'display-buffer-alist
             `(,(rx string-start "*compilation validation*" string-end)
               (display-buffer-in-side-window)))

使用許諾

Copyright (C) 2026 gemmaro

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without any warranty.
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?