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

setq-default mode-line-format #32

Open
dwdreisigmeyer opened this issue Dec 29, 2011 · 3 comments
Open

setq-default mode-line-format #32

dwdreisigmeyer opened this issue Dec 29, 2011 · 3 comments

Comments

@dwdreisigmeyer
Copy link

Emacs : 24.0.92 from http://emacsformacosx.com/builds
workgroups.el installed with el-get

A line (setq-default mode-line-format (list "some_list_here")) with (workgroups-mode 1) gives a warning: "Wrong type argument: number-or-marker-p, nil". This did not fix the problem: (setq wg-mode-line-on nil).

@dwdreisigmeyer
Copy link
Author

This fixed the problem:

; Comment out:
; (wg-mode-line-add-display)
; (wg-mode-line-remove-display)
; at the bottom of workgroups.el. Recompile.

Thanks for the fantastic work!

-Dave

@vwood
Copy link

vwood commented Jun 6, 2012

This issue is due to assuming mode-line-position will be in the mode-line-format. I'm getting this problem to, because I wanted to customise my mode-line. Setting wg-mode-line-on to nil doesn't solve this issue, as workgroups still tries to add itself to the mode-line!

Rather than commenting out those lines, I suggest you (fset 'wg-mode-line-add-display (lambda () nil)) and same for wg-mode-line-remove-display, at least until wg-mode-line-on actually works as an option.

@redguardtoo
Copy link

Seem this bug is already reported,
Here is my patch:

diff --git a/site-lisp/workgroups.el/workgroups.el b/site-lisp/workgroups.el/workgroups.el
index 4dccd65..542bc9e 100644
--- a/site-lisp/workgroups.el/workgroups.el
+++ b/site-lisp/workgroups.el/workgroups.el
@@ -1447,11 +1447,12 @@ Query to overwrite if a workgroup with the same name exists."

 (defun wg-mode-line-add-display ()
   "Add Workgroups' mode-line format to `mode-line-format'."
-  (unless (assq 'wg-mode-line-on mode-line-format)
-    (let ((format `(wg-mode-line-on (:eval (wg-mode-line-string))))
-          (pos (1+ (position 'mode-line-position mode-line-format))))
-      (set-default 'mode-line-format
-                   (wg-insert-elt format mode-line-format pos)))))
+  (if wg-mode-line-on
+      (unless (assq 'wg-mode-line-on mode-line-format)
+        (let ((format `(wg-mode-line-on (:eval (wg-mode-line-string))))
+              (pos (1+ (position 'mode-line-position mode-line-format))))
+          (set-default 'mode-line-format
+                       (wg-insert-elt format mode-line-format pos))))))

 (defun wg-mode-line-remove-display ()
   "Remove Workgroups' mode-line format from `mode-line-format'."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants