Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Powerline support to the tracking package. #214

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
22 changes: 17 additions & 5 deletions tracking.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ see there for further explanation."
(defcustom tracking-position 'before-modes
"Where tracked buffers should appear in the mode line.

However, if powerline is enabled, the buffers are added to `global-mode-string' and
placed as specified in the powerline theme.

'before-modes
Before the mode indicators
'after-modes
After the mode indicators
'end
At the end of the mode line"
:type '(choice (const :tag "Before the Mode Indicators" before-modes)
(const :tag "Afterthe Mode Indicators" after-modes)
(const :tag "After the Mode Indicators" after-modes)
(const :tag "At the End of the Mode Line" end))
:group 'tracking)

Expand Down Expand Up @@ -159,6 +162,12 @@ line. The user can cycle through them using
(cond
(tracking-mode
(cond
((featurep 'powerline)
(when (not global-mode-string)
(setq global-mode-string '("")))
(when (not (memq 'tracking-mode-line-buffers global-mode-string))
(setq global-mode-string
(append global-mode-string '(tracking-mode-line-buffers)))))
((eq tracking-position 'before-modes)
(let ((head nil)
(tail (default-value 'mode-line-format)))
Expand Down Expand Up @@ -187,10 +196,13 @@ line. The user can cycle through them using
(add-hook 'window-configuration-change-hook
'tracking-remove-visible-buffers))
(t
(setq mode-line-misc-info (delq 'tracking-mode-line-buffers
mode-line-misc-info))
(setq-default mode-line-format (delq 'tracking-mode-line-buffers
(default-value 'mode-line-format)))
(if (featurep 'powerline)
(setq global-mode-string (delq 'tracking-mode-line-buffers
global-mode-string))
(setq mode-line-misc-info (delq 'tracking-mode-line-buffers
mode-line-misc-info))
(setq-default mode-line-format (delq 'tracking-mode-line-buffers
(default-value 'mode-line-format))))
(remove-hook 'window-configuration-change-hook
'tracking-remove-visible-buffers))))

Expand Down