Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a control variable for enable/disable window number install to mo… #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions window-numbering.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ return a number to have it assigned to the current-window, nil otherwise."
:group 'window-numbering
:type 'function)

(defcustom window-numbering-mode-line nil
"Control whether to display window number in the mode line."
:group 'window-numbering
:type 'boolean)

(defconst window-numbering-mode-line-position 1
"The position in the mode-line `window-numbering-mode' displays the number.")

Expand Down Expand Up @@ -204,14 +209,14 @@ windows to numbers."
(unless window-numbering-table
(save-excursion
(setq window-numbering-table (make-hash-table :size 16))
(window-numbering-install-mode-line)
(when window-numbering-mode-line window-numbering-install-mode-line)
(add-hook 'minibuffer-setup-hook 'window-numbering-update)
(add-hook 'window-configuration-change-hook
'window-numbering-update)
(dolist (frame (frame-list))
(select-frame frame)
(window-numbering-update))))
(window-numbering-clear-mode-line)
(when window-numbering-mode-line window-numbering-clear-mode-line)
(remove-hook 'minibuffer-setup-hook 'window-numbering-update)
(remove-hook 'window-configuration-change-hook
'window-numbering-update)
Expand Down