【Emacs】tab-bar-mode のタブ削除・新規タブのボタンが小さいので大きくした / How to make the tab deletion and new tab buttons in tab-bar-mode enlarged

こうする.define-iconで調整する.修正の本質は

:height (1.0 . em)

を追加することにあり,この1.0を変えれば大きさも変化する.タブ履歴のほうは heightを0.9にしてみた.

ただしこのときのEmacsのバージョンは29.4である.

(with-eval-after-load 'tab-bar

  (setq tab-bar-new-button-show t)  ;; nil: 新規タブボタンは非表示
  (setq tab-bar-close-button-show t) ;; nil:タブ削除ボタンは非表示

  (setq tab-bar-new-tab-to 'right) ;; 新規タブは一番右

  ;; 各ボタンの有無はお好みで
  (setq tab-bar-format '(tab-bar-format-history
                         tab-bar-format-tabs
                         tab-bar-separator tab-bar-format-add-tab))

  (setq tab-bar-history-limit 100) ;; ヒストリの最大履歴

  (require 'icons) ;; define-icon をロードするため
  
  ;; 新規タブマークが小さすぎるので大きくする
  (define-icon tab-bar-new nil
    `((image "tabs/new.xpm"
             :height (1.0 . em)
             :margin ,tab-bar-button-margin
             :ascent center)
      (text " + "))
    "Icon for creating a new tab."
    :version "29.1"
    :help-echo "New tab")

  ;; タブ削除マークが小さすぎるので大きくする
  (define-icon tab-bar-close nil
    `((image "tabs/close.xpm"
             :height (1.0 . em)
             :margin ,tab-bar-button-margin
             :ascent center)
      (text " x"))
    "Icon for closing the clicked tab."
    :version "29.1"
    :help-echo "Click to close tab")

  ;; タブの履歴マークも小さすぎるのでついでに大きくする
  (define-icon tab-bar-back nil
    `((image "tabs/left-arrow.xpm"
             :height (0.9 . em)
             :margin ,tab-bar-button-margin
             :ascent center)
      (text " < "))
    "Icon for going back in tab history."
    :version "29.1")
  (define-icon tab-bar-forward nil
    `((image "tabs/right-arrow.xpm"
             :height (0.9 . em)
             :margin ,tab-bar-button-margin
             :ascent center)
      (text " > "))
    "Icon for going forward in tab history."
    :version "29.1")

  (setq tab-bar-history-limit 100) ;; ヒストリの最大履歴

  (tab-bar-mode 1)
  (tab-bar-history-mode 1) ;; 各タブについて,ウィンドウ構成のヒストリを記憶する
  )

Emacs開発者のブランチにはボタン拡大のコミットがされており,Emacs 30 系では反映されていると思われる.

git.savannah.gnu.org

tab-bar-mode についてはこちらの記事も参考に.

tam5917.hatenablog.com