[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d31e024 06/11: Support FILE value t, meaning the minor MOD
From: |
Phil |
Subject: |
[elpa] master d31e024 06/11: Support FILE value t, meaning the minor MODE is already loaded |
Date: |
Wed, 13 Jul 2016 13:25:59 +0000 (UTC) |
branch: master
commit d31e024cc98d37700879d4c8675fd10e678e44c1
Author: Phil Sainty <address@hidden>
Commit: Phil Sainty <address@hidden>
Support FILE value t, meaning the minor MODE is already loaded
If FILE is t then it is assumed that the mode is already loaded.
(Note that you can also use 'emacs for this purpose).
These FILE options are relevant to minor modes only.
---
delight.el | 35 ++++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/delight.el b/delight.el
index 8e58890..ba693c4 100644
--- a/delight.el
+++ b/delight.el
@@ -4,7 +4,7 @@
;; URL: http://www.emacswiki.org/emacs/DelightedModes
;; Keywords: convenience
;; Created: 25 Jun 2013
-;; Version: 1.04
+;; Version: 1.05
;; This file is not part of GNU Emacs.
@@ -30,8 +30,30 @@
;; (smart-tab-mode " \\t" "smart-tab")
;; (eldoc-mode nil "eldoc")
;; (rainbow-mode)
+;; (overwrite-mode " Ov" t)
;; (emacs-lisp-mode "Elisp" :major)))
;;
+;; The first argument is the mode symbol.
+;;
+;; The second argument is the replacement name to use in the mode line
+;; (or nil to hide it).
+;;
+;; The third argument is either the keyword :major for major modes or,
+;; for minor modes, the library which defines the mode. This is passed
+;; to ‘eval-after-load’ and so should be either the name (as a string)
+;; of the library file which defines the mode, or the feature (symbol)
+;; provided by that library. If this argument is nil, the mode symbol
+;; will be passed as the feature. If this argument is either t or 'emacs
+;; then it is assumed that the mode is already loaded (you can use this
+;; with standard minor modes that are pre-loaded by default when Emacs
+;; starts).
+;;
+;; To determine which library defines a mode, use e.g.: C-h f
+;; eldoc-mode RET. The name of the library is displayed in the first
+;; paragraph, with an “.el” suffix (in this example it displays
+;; “eldoc.el”, and therefore we could use the value “eldoc” for the
+;; library).
+;;
;; Important note:
;;
;; Although strings are common, any mode-line construct is permitted
@@ -59,8 +81,10 @@
;; you change the sorting criteria) in which cases this library may
;; prove inadequate.
-;;; Changelog:
+;;; Change Log:
;;
+;; 1.05 (2016-03-01) Support FILE value t, meaning that the minor MODE
+;; in question is guaranteed to already be loaded.
;; 1.04 (2016-02-28) Respect `inhibit-mode-name-delight' when already set.
;; 1.03 (2014-05-30) Added support for `mode-line-mode-menu'.
;; 1.02 (2014-05-04) Bug fix for missing 'cl requirement for
@@ -98,8 +122,9 @@ mode-line construct. For details see the `mode-line-format'
variable, and
Info node `(elisp) Mode Line Format'.
The FILE argument is passed through to `eval-after-load'. If FILE is nil then
-the mode symbol is passed as the required feature. Both of these cases are
-relevant to minor modes only.
+the mode symbol is passed as the required feature. If FILE is t then it is
+assumed that the mode is already loaded. (Note that you can also use 'emacs
+for this purpose). These FILE options are relevant to minor modes only.
For major modes you should specify the keyword :major as the value of FILE,
to prevent the mode being treated as a minor mode."
@@ -110,7 +135,7 @@ to prevent the mode being treated as a minor mode."
(assq-delete-all mode delighted-modes)
(add-to-list 'delighted-modes (list mode value file))
(unless (eq file :major)
- (eval-after-load (or file mode)
+ (eval-after-load (if (eq file t) 'emacs (or file mode))
`(let ((minor-delight (assq ',mode minor-mode-alist)))
(when minor-delight
(setcar (cdr minor-delight) ',value)
- [elpa] master updated (a1cdea0 -> 1dca70f), Phil, 2016/07/13
- [elpa] master 1dca70f 11/11: externals-list: Add delight, Phil, 2016/07/13
- [elpa] master 35e5d31 03/11: Bug fix for missing 'cl requirement for destructuring-bind macro, Phil, 2016/07/13
- [elpa] master e0fe27b 01/11: Original release., Phil, 2016/07/13
- [elpa] master e38a9f1 02/11: Added support for FILE argument :major, Phil, 2016/07/13
- [elpa] master 0882ecb 05/11: Respect `inhibit-mode-name-delight' when already set, Phil, 2016/07/13
- [elpa] master d31e024 06/11: Support FILE value t, meaning the minor MODE is already loaded,
Phil <=
- [elpa] master ca6b614 10/11: Add 'packages/delight/' from commit 'cd037ed41ae29dda89e36ff2ac8637aea96acded', Phil, 2016/07/13
- [elpa] master d23fb65 08/11: Added 'Maintainer' header, Phil, 2016/07/13
- [elpa] master 1865c0d 04/11: Added support for `mode-line-mode-menu', Phil, 2016/07/13
- [elpa] master cd037ed 09/11: Changed the URL header to point to Savannah, Phil, 2016/07/13
- [elpa] master 3c19dee 07/11: Updated v1.05 for Savannah and GNU ELPA, Phil, 2016/07/13