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

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

[elpa] master d54c70d 4/4: Merge commit 'c44ef65515f50bd38304a6f50adebc9


From: Artur Malabarba
Subject: [elpa] master d54c70d 4/4: Merge commit 'c44ef65515f50bd38304a6f50adebc984fb8e431'
Date: Thu, 09 Apr 2015 16:28:57 +0000

branch: master
commit d54c70dc4abd441ee7cee86b2771b3b0f1a5f29b
Merge: 2b62400 c44ef65
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    Merge commit 'c44ef65515f50bd38304a6f50adebc984fb8e431'
---
 packages/spinner/README.org                        |    5 +++-
 packages/spinner/all-spinners.gif                  |  Bin 0 -> 18314 bytes
 .../spinner/{spinner.gif => some-spinners.gif}     |  Bin 1932043 -> 1932043 
bytes
 packages/spinner/spinner.el                        |   26 +++++++++++--------
 4 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/packages/spinner/README.org b/packages/spinner/README.org
index 2f3dc39..85c649b 100644
--- a/packages/spinner/README.org
+++ b/packages/spinner/README.org
@@ -2,7 +2,10 @@
 
 Add spinners and progress-bars to the mode-line for ongoing operations.
 
-[[file:spinner.gif]]
+[[file:some-spinners.gif]]
+
+[[file:all-spinners.gif]]
+
 * Usage
 
 1. Add ~(spinner "1.0")~ to your package’s dependencies.
diff --git a/packages/spinner/all-spinners.gif 
b/packages/spinner/all-spinners.gif
new file mode 100644
index 0000000..5540b68
Binary files /dev/null and b/packages/spinner/all-spinners.gif differ
diff --git a/packages/spinner/spinner.gif b/packages/spinner/some-spinners.gif
similarity index 100%
rename from packages/spinner/spinner.gif
rename to packages/spinner/some-spinners.gif
diff --git a/packages/spinner/spinner.el b/packages/spinner/spinner.el
index a21bf42..5573030 100644
--- a/packages/spinner/spinner.el
+++ b/packages/spinner/spinner.el
@@ -2,10 +2,10 @@
 
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
-;; Author: Artur Malabarba <address@hidden>
-;; Version: 1.0
+;; Author: Artur Malabarba <address@hidden>
+;; Version: 1.1
 ;; Package-Requires: ((cl-lib "0.5"))
-;; URL: https://github.com/Bruce-Connor/spinner.el
+;; URL: https://github.com/Malabarba/spinner.el
 ;; Keywords: processes mode-line
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 ;; 1 Usage
 ;; ═══════
 ;;
-;; 1. Add `(spinner "1.0")' to your package’s dependencies.
+;; 1. Add `(spinner "1.1")' to your package’s dependencies.
 ;;
 ;; 2. Call `(spinner-start)' and a spinner will be added to the
 ;; mode-line.
@@ -104,7 +104,7 @@ Applications can override this value.")
 
 ;;; The main function
 ;;;###autoload
-(defun spinner-start (&optional type fps)
+(defun spinner-start (&optional type fps noadd)
   "Start a mode-line spinner of given TYPE.
 Spinners are buffer local. It is added to the mode-line in the
 buffer where `spinner-start' is called.
@@ -116,6 +116,11 @@ buffer where the spinner was created.
 FPS, if given, is the number of desired frames per second.
 Default is `spinner-frames-per-second'.
 
+If NOADD is non-nil, the spinner is not added to the mode-line.
+It is then your responsibility to add the symbol
+`spinner--mode-line-construct' somewhere in the mode-line,
+probably as part of a minor-mode lighter.
+
 If TYPE is nil, use the first element of `spinner-types'.
 If TYPE is `random', use a random element of `spinner-types'.
 If it is a symbol, it specifies an element of `spinner-types'.
@@ -138,12 +143,11 @@ is chosen as the spinner type."
   (setq spinner--counter 0)
 
   ;; Maybe add to mode-line.
-  (unless (memq 'spinner--mode-line-construct mode-line-format)
-    (setq mode-line-format (cl-copy-list mode-line-format))
-    (let ((cell (memq 'mode-line-buffer-identification mode-line-format)))
-      (if cell
-          (setcdr cell (cons 'spinner--mode-line-construct (cdr cell)))
-        (setcdr (last mode-line-format) '(spinner--mode-line-construct)))))
+  (unless (or noadd
+              (memq 'spinner--mode-line-construct mode-line-process))
+    (setq mode-line-process
+          (list (or mode-line-process "")
+                'spinner--mode-line-construct)))
 
   ;; Create timer.
   (when (timerp spinner--timer)



reply via email to

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