Changeset - b0edcf4aa1c0
[Not reviewed]
0 1 0
Sergey Pashinin - 11 years ago 2014-08-30 12:12:06
sergey@pashinin.com
removed wg-mode-line-disable

Use wg-mode-line-display-on
1 file changed with 2 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/workgroups2.el
Show inline comments
 
@@ -163,13 +163,13 @@ Don't do it with Emacs --daemon option."
 

	
 
(defcustom wg-modeline-string " wg"
 
  "Appears in modeline."
 
  :type 'string
 
  :group 'workgroups)
 

	
 
(defcustom wg-mode-line-display-on t
 
(defcustom wg-mode-line-display-on (not (featurep 'powerline))
 
  "Toggles Workgroups' mode-line display."
 
  :type 'boolean
 
  :group 'workgroups
 
  :set (lambda (sym val)
 
         (custom-set-default sym val)
 
         (force-mode-line-update)))
 
@@ -178,18 +178,12 @@ Don't do it with Emacs --daemon option."
 
  "Non-nil means use faces in the mode-line display.
 
It can be tricky to choose faces that are visible in both active
 
and inactive mode-lines, so this feature defaults to off."
 
  :type 'boolean
 
  :group 'workgroups)
 

	
 
(defcustom wg-mode-line-disable (featurep 'powerline)
 
  "Do not do any modeline modifications.
 
There are problems with powerline."
 
  :type 'boolean
 
  :group 'workgroups)
 

	
 
(defcustom wg-mode-line-decor-left-brace "("
 
  "String displayed at the left of the mode-line display."
 
  :type 'string
 
  :group 'workgroups)
 

	
 
(defcustom wg-mode-line-decor-right-brace ")"
 
@@ -1705,14 +1699,13 @@ Frame defaults to `selected-frame'.  See `wg-buffer-auto-association'."
 
                   (:mode wg-nowg-string)
 
                   (:brace wg-mode-line-decor-right-brace))
 
               "")))))
 

	
 
(defun wg-change-modeline ()
 
  "Add Workgroups' mode-line format to `mode-line-format'."
 
  (unless (or (assq 'wg-mode-line-display-on mode-line-format)
 
              wg-mode-line-disable)
 
  (unless (assq 'wg-mode-line-display-on mode-line-format)
 
    (let ((format '(wg-mode-line-display-on (:eval (wg-mode-line-string))))
 
          (pos (or (cl-position 'mode-line-position mode-line-format) 10)))
 
      (set-default 'mode-line-format (-insert-at (1+ pos) format mode-line-format))
 
      (force-mode-line-update))))
 

	
 
(defun wg-remove-mode-line-display ()
0 comments (0 inline, 0 general)