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

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

[elpa] master 7507951 4/4: Merge commit '082a702f5a4a07bc10052befd7a2b20


From: Artur Malabarba
Subject: [elpa] master 7507951 4/4: Merge commit '082a702f5a4a07bc10052befd7a2b20cc8a0cdb8'
Date: Sat, 31 Oct 2015 06:36:20 +0000

branch: master
commit 7507951dd0aea01dcf22ee1d6592bdf917b0f2c5
Merge: a4a72c0 082a702
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    Merge commit '082a702f5a4a07bc10052befd7a2b20cc8a0cdb8'
---
 packages/beacon/beacon.el |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/packages/beacon/beacon.el b/packages/beacon/beacon.el
index 5b6d924..63ebbae 100644
--- a/packages/beacon/beacon.el
+++ b/packages/beacon/beacon.el
@@ -5,7 +5,7 @@
 ;; Author: Artur Malabarba <address@hidden>
 ;; URL: https://github.com/Malabarba/beacon
 ;; Keywords: convenience
-;; Version: 0.4
+;; Version: 0.5.1
 ;; Package-Requires: ((seq "1.11"))
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -38,6 +38,24 @@
 ;;; Code:
 
 (require 'seq)
+(require 'faces)
+(unless (fboundp 'seq-mapn)
+  ;; This is for people who are on outdated Emacs snapshots. Will be
+  ;; deleted in a couple of weeks.
+  (defun seq-mapn (function sequence &rest sequences)
+    "Like `seq-map' but FUNCTION is mapped over all SEQUENCES.
+The arity of FUNCTION must match the number of SEQUENCES, and the
+mapping stops on the shortest sequence.
+Return a list of the results.
+
+\(fn FUNCTION SEQUENCES...)"
+    (let ((result nil)
+          (sequences (seq-map (lambda (s) (seq-into s 'list))
+                            (cons sequence sequences))))
+      (while (not (memq nil sequences))
+        (push (apply function (seq-map #'car sequences)) result)
+        (setq sequences (seq-map #'cdr sequences)))
+      (nreverse result))))
 
 (defgroup beacon nil
   "Customization group for beacon."
@@ -235,7 +253,8 @@ Only returns `beacon-size' elements."
 
 (defun beacon--color-range ()
   "Return a list of background colors for the beacon."
-  (let* ((default-bg (face-attribute 'default :background))
+  (let* ((default-bg (or (background-color-at-point)
+                         (face-background 'default)))
          (bg (color-values (if (string-match "\\`unspecified-" default-bg)
                                (face-attribute 'beacon-fallback-background 
:background)
                              default-bg)))



reply via email to

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