1

within a functionTabbar 2.0 と現在のバージョンの Emacs を使用して特定のタブ グループへの切り替えを指定する () 方法について、誰かアイデアをお持ちですか? たとえば、If the sky is blue, then switch to tab group "BLUE"(および/またはその特定のタブ グループ内の最近表示されたタブ/バッファー)。

タブが特定のフレームに関連付けられているように見えるように、フレームごとにタブ グループを編成できる関数をいくつか作成しました。tabbar-forward-groupただし、私の関数は、関数が最終的に正しいグループで停止するまで、さまざまなタブ グループを循環します。この方法は非常に遅いです。

この関数tabbar-current-tabsetは、フォーカスのある現在のタブ グループの名前を決定するために使用されます。結果は、メッセージ内に配置すると表示されます (例: (message "%s" tabbar-current-tabset). などの関数内で使用することもできます。. . (if (not (equal (format "%s" tabbar-current-tabset) "common")). . . (tabbar-forward-group).

特定のタブグループを選択できる機能は、私が見つけた 1 つだけですido-jump-to-tab-group(以下で説明): https://github.com/bamanzi/dotemacs-full/blob/master/init.d/25- tabbar.el  を使用して手動で選択するのを一時停止せずに、特定のタブ グループ (関数にハードコードされている) を選択する方法を探していますido . . .。誰かが解決するのに役立つ可能性があるため、これについて言及します:( If the sky is blue, then switch to tab group "BLUE"および/またはその特定のタブグループ内で最近表示されたタブ/バッファー)。

(defun ido-jump-to-tab-group ()
  "Jump to a tabbar group."
  (interactive)
  (if (< emacs-major-version 24)
      (ido-common-initialization))
  (unless (and (featurep 'tabbar)
               tabbar-mode)
    (error "Error: tabbar-mode not turned on."))
  (set tabbar-tabsets-tabset (tabbar-map-tabsets 'tabbar-selected-tab)) ;; refresh groups
  (let* ( (groups (mapcar #'(lambda (group)
                              (format "%s" (cdr group)))
                          (tabbar-tabs tabbar-tabsets-tabset)))
          (group-name (ido-completing-read "Groups: " groups)) )
    (mapc #'(lambda (group)
              (when (string= group-name (format "%s" (cdr group)))
                  (message "Switch to group '%s', current buffer: %s" (cdr group) (car group))
                  (switch-to-buffer (car group)) ))
          (tabbar-tabs tabbar-tabsets-tabset))) )

  Google 検索中に、Tabbar 2.0 と Emacs Trunk の現在のバージョンでは機能しない、明らかに壊れた機能に出くわしました。それtabbar+switch-grouphttps://gist.github.com/Johniel/4324127ido-jump-to-tab-groupこの問題に関連しているのは( 以外の) 唯一のものです。

4

1 に答える 1