emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 59/117: Add ergoemacs-mode-line option


From: Matthew Fidler
Subject: [elpa] 59/117: Add ergoemacs-mode-line option
Date: Fri, 25 Jul 2014 13:24:14 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 0ab81990cc357cf7d05b53cfe1b59ee5ffcbd938
Author: Matthew L. Fidler <address@hidden>
Date:   Fri Jul 18 06:56:15 2014 -0500

    Add ergoemacs-mode-line option
---
 ergoemacs-mode.el |   39 ++++++++++++++++++++++++---------------
 1 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index 9beacda..10aa048 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -281,28 +281,37 @@ Valid values are:
   (load "ergoemacs-shortcuts"))
 
 (defvar ergoemacs-theme)
+(defcustom ergoemacs-mode-line 'always
+  "Ergoemacs-keybindings minor mode version number used."
+  :type '(choice
+         (const :tag "Always Show Mode Line" t)
+         (const :tag "Do not show layout" no-layout)
+         (const :tag "Never Show Mode Line" nil))
+  :group 'ergoemacs-mode)
 (defun ergoemacs-mode-line (&optional text)
   "Set ergoemacs-mode-line"
   ;; (ergoemacs-debug-heading "Set Mode Line to %s" (or text "Default"))
-  (if text
+  (let ((new-text (and text (or (and (not ergoemacs-mode-line) "") text))))
+    (if new-text
+        (setq minor-mode-alist
+              (mapcar (lambda(x)
+                        (if (not (eq 'ergoemacs-mode (nth 0 x)))
+                            x
+                          `(ergoemacs-mode ,new-text)))
+                      minor-mode-alist))
       (setq minor-mode-alist
             (mapcar (lambda(x)
                       (if (not (eq 'ergoemacs-mode (nth 0 x)))
                           x
-                        `(ergoemacs-mode ,text)))
-                    minor-mode-alist))
-    (setq minor-mode-alist
-          (mapcar (lambda(x)
-                    (if (not (eq 'ergoemacs-mode (nth 0 x)))
-                        x
-                      `(ergoemacs-mode ,(concat
-                                         (if (string= "standard" (or 
ergoemacs-theme "standard"))
-                                             " ErgoEmacs"
-                                           (concat " Ergo"
-                                                   (upcase (substring 
ergoemacs-theme 0 1))
-                                                   (substring ergoemacs-theme 
1)))
-                                         "[" ergoemacs-keyboard-layout "]"))))
-                  minor-mode-alist)))
+                        `(ergoemacs-mode ,(if (or (not ergoemacs-mode-line) 
(eq ergoemacs-mode-line 'no-layout)) ""
+                                            (concat
+                                             (if (string= "standard" (or 
ergoemacs-theme "standard"))
+                                                 " ErgoEmacs"
+                                               (concat " Ergo"
+                                                       (upcase (substring 
ergoemacs-theme 0 1))
+                                                       (substring 
ergoemacs-theme 1)))
+                                             "[" ergoemacs-keyboard-layout 
"]")))))
+                    minor-mode-alist))))
   (ergoemacs-debug-flush))
 
 (require 'lookup-word-on-internet nil "NOERROR")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]