[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d2c5a18 03/23: Better documentation and simplified logic
From: |
Artur Malabarba |
Subject: |
[elpa] master d2c5a18 03/23: Better documentation and simplified logic |
Date: |
Wed, 30 Sep 2015 12:15:57 +0000 |
branch: master
commit d2c5a182f268f7c66721b49bde259ecfffe82b13
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
Better documentation and simplified logic
---
rich-minority.el | 73 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 41 insertions(+), 32 deletions(-)
diff --git a/rich-minority.el b/rich-minority.el
index 32696fa..744d83f 100644
--- a/rich-minority.el
+++ b/rich-minority.el
@@ -61,15 +61,18 @@ Please include your emacs and rich-minority versions."
(defcustom rm-excluded-modes '(" hl-p")
"List of minor modes you want to hide from the mode-line.
-- If empty (or nil), all minor modes are shown in the
- mode-line (but see also `rm-included-modes').
+Has three possible values:
-- Otherwise this is a list of minor mode names that will be
- hidden in the minor-modes list.
+- nil: All minor modes are shown in the mode-line (but see also
+ `rm-included-modes').
-The elements are strings. If you want to use REGEXPs instead, you
-can set this variable to a single string (instead of a list) and
-this will be compared to each minor-mode lighter as a regexp.
+- List of strings: Represents a list of minor mode names that
+ will be hidden from the minor-modes list.
+
+- A string: If this variable is set to a single string, this
+ string must be a regexp. This regexp will be compared to each
+ minor-mode lighter, and those which match are hidden from the
+ minor-mode list.
If you'd like to use a list of regexps, simply use something like the
following:
(setq rm-excluded-modes (mapconcat 'identity list-of-regexps \"\\\\|\"))
@@ -85,16 +88,17 @@ minor-mode lighters start with a space."
(defcustom rm-included-modes nil
"List of minor modes you want to include in the mode-line.
-- If empty (or nil), all minor modes are shown in the
- mode-line (but see also `rm-excluded-modes').
+- nil: All minor modes are shown in the mode-line (but see also
+ `rm-excluded-modes').
-- Otherwise, this is a list of minor mode names are allowed on
- the minor-modes list. Any minor-mode whose lighter is not in
- this list will NOT be displayed.
+- List of strings: Represents a list of minor mode names that are
+ allowed on the minor-modes list. Any minor-mode whose lighter
+ is not in this list will NOT be displayed.
-The elements are strings. If you want to use REGEXPs instead, you
-can set this variable to a single string (instead of a list) and
-this will be compared to each minor-mode lighter as a regexp.
+- A string: If this variable is set to a single string, this
+ string must be a regexp. This regexp will be compared to each
+ minor-mode lighter, and only those which match are displayed on
+ the minor-mode list.
If you'd like to use a list of regexps, simply use something like the
following:
(setq rm-included-modes (mapconcat 'identity list-of-regexps \"\\\\|\"))
@@ -107,10 +111,20 @@ minor-mode lighters start with a space."
:package-version '(rich-minority . "0.1"))
(defcustom rm-text-properties
- '(("\\` Ovwrt\\'" 'face 'font-lock-warning-face)
- (t 'face 'sml/folder))
- ""
- :type '(repeat (cons (choice regexp (const :tag "Fallback" t)) (repeat
sexp)))
+ '(("\\` Ovwrt\\'" 'face 'font-lock-warning-face))
+ "Alist of text properties to be applied to minor-mode lighters.
+The car of each element must be a regexp, and the cdr must be a
+list of text properties.
+
+ (REGEXP PROPERTY-NAME PROPERTY-VALUE ...)
+
+If the regexp matches a minor mode lighter, the text properties
+are applied to it. They are tested in order, and search stops at
+the first match.
+
+These properties take priority over those defined in
+`rm-base-text-properties'."
+ :type '(repeat (cons regexp (repeat sexp)))
:group 'rich-minority
:package-version '(rich-minority . "0.1"))
@@ -130,7 +144,7 @@ minor-mode lighters start with a space."
(defcustom rm-base-text-properties
'('help-echo 'rm--help-echo
- 'mouse-face 'mode-line-highlight
+ 'mouse-face 'mode-line-highlight
'local-map 'mode-line-minor-mode-keymap)
"List of text propeties to apply to every minor mode."
:type '(repeat sexp)
@@ -142,18 +156,13 @@ minor-mode lighters start with a space."
(if (null (stringp mode))
`(:propertize ,mode ,@rm-base-text-properties)
(let ((al rm-text-properties)
- done)
- (or (progn
- (while (and (null done) al)
- (setq done (pop al))
- (if (or (eq (car done) t)
- (string-match (car done) mode))
- (setq al (eval `(propertize ,mode
- ,@rm-base-text-properties
- ,@(cdr done))))
- (setq done nil)))
- al)
- (eval `(propertize ,mode ,@rm-base-text-properties))))))
+ done prop)
+ (while (and (null done) al)
+ (setq done (pop al))
+ (if (string-match (car done) mode)
+ (setq prop (cdr done))
+ (setq done nil)))
+ (eval `(propertize ,mode ,@prop ,@rm-base-text-properties)))))
(defun rm--remove-hidden-modes (li)
"Remove from LI elements that match `rm-excluded-modes' or don't match
`rm-included-modes'."
- [elpa] master updated (a727eab -> 38cb49d), Artur Malabarba, 2015/10/08
- [elpa] master 983d5fa 02/23: File created and working, Artur Malabarba, 2015/10/08
- [elpa] master 10f8aaf 19/23: Stop using obsolete variables. Fix #8, Artur Malabarba, 2015/10/08
- [elpa] master 7b07cce 18/23: Readme improvements, Artur Malabarba, 2015/10/08
- [elpa] master cc00f17 16/23: Fix keymap bug. Fix Bruce-Connor/smart-mode-line#105, Artur Malabarba, 2015/10/08
- [elpa] master 87c40ea 06/23: In-file doc, Artur Malabarba, 2015/10/08
- [elpa] master 2c8e195 05/23: Implemented the actual minor mode, Artur Malabarba, 2015/10/08
- [elpa] master 4614c55 14/23: Define rich-minority-version, Artur Malabarba, 2015/10/08
- [elpa] master 3b2ead3 12/23: Add comparison to Diminish., Artur Malabarba, 2015/10/08
- [elpa] master bde4f6f 20/23: Fix a bytecomp warning, Artur Malabarba, 2015/10/08
- [elpa] master d2c5a18 03/23: Better documentation and simplified logic,
Artur Malabarba <=
- [elpa] master ac66dbd 10/23: Fix bug with rm-included-modes not working., Artur Malabarba, 2015/10/08
- [elpa] master e02f1f2 08/23: Add cl-lib dependency, Artur Malabarba, 2015/10/08
- [elpa] master 49083a0 09/23: No error if using sml., Artur Malabarba, 2015/10/08
- [elpa] master a3611ad 13/23: Expand on the comparison to Diminish., Artur Malabarba, 2015/10/08
- [elpa] master 0831780 21/23: Version 1.0, Artur Malabarba, 2015/10/08
- [elpa] master 38cb49d 23/23: Add 'packages/rich-minority/' from commit 'f46444fb2f6d3c18c4c9e1e528f951894e6d5da3', Artur Malabarba, 2015/10/08
- [elpa] master f9359de 11/23: Rename variables to blacklist and whitelist, Artur Malabarba, 2015/10/08
- [elpa] master 0fb68d8 07/23: Use cl-lib correctly, Artur Malabarba, 2015/10/08
- [elpa] master 0e24049 04/23: Org mode documentation., Artur Malabarba, 2015/10/08
- [elpa] master 7fb1f00 15/23: Merge pull request #5 from tarsius/version, Artur Malabarba, 2015/10/08