[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/popup 967cde1 067/184: Merge pull request #30 from tkf/sum
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/popup 967cde1 067/184: Merge pull request #30 from tkf/summary-face |
Date: |
Wed, 6 Oct 2021 00:01:08 -0400 (EDT) |
branch: elpa/popup
commit 967cde19eb6e93ce7d2c1022912f881341a6a9ad
Merge: d655fd2 5a892e5
Author: Tomohiro Matsuyama <tomo@cx4a.org>
Commit: Tomohiro Matsuyama <tomo@cx4a.org>
Merge pull request #30 from tkf/summary-face
Summary face
---
popup.el | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/popup.el b/popup.el
index afddcb4..3caa82f 100644
--- a/popup.el
+++ b/popup.el
@@ -213,6 +213,11 @@ buffer."
"Face for popup."
:group 'popup)
+(defface popup-summary-face
+ '((t (:background "lightgray" :foreground "dimgray")))
+ "Face for popup summary."
+ :group 'popup)
+
(defface popup-scroll-bar-foreground-face
'((t (:background "black")))
"Foreground face for scroll-bar."
@@ -237,7 +242,7 @@ buffer."
(defstruct popup
point row column width height min-height direction overlays keymap
parent depth
- face mouse-face selection-face
+ face mouse-face selection-face summary-face
margin-left margin-right margin-left-cancel scroll-bar symbol
cursor offset scroll-top current-height list newlines
pattern original-list)
@@ -367,13 +372,26 @@ usual."
(and (eq (overlay-get overlay 'display) nil)
(eq (overlay-get overlay 'after-string) nil))))
-(defun* popup-set-line-item (popup line &key item face mouse-face margin-left
margin-right scroll-bar-char symbol summary keymap)
+(defun* popup-set-line-item (popup
+ line
+ &key
+ item
+ face
+ mouse-face
+ margin-left
+ margin-right
+ scroll-bar-char
+ symbol
+ summary
+ summary-face
+ keymap)
(let* ((overlay (popup-line-overlay popup line))
(content (popup-create-line-string popup (popup-x-to-string item)
:margin-left margin-left
:margin-right margin-right
:symbol symbol
- :summary summary))
+ :summary summary
+ :summary-face summary-face))
(start 0)
(prefix (overlay-get overlay 'prefix))
(postfix (overlay-get overlay 'postfix))
@@ -401,7 +419,14 @@ usual."
scroll-bar-char
postfix))))
-(defun* popup-create-line-string (popup string &key margin-left margin-right
symbol summary)
+(defun* popup-create-line-string (popup
+ string
+ &key
+ margin-left
+ margin-right
+ symbol
+ summary
+ summary-face)
(let* ((popup-width (popup-width popup))
(summary-width (string-width summary))
(content-width (max
@@ -417,6 +442,9 @@ usual."
(truncated-summary
(car (popup-substring-by-width
summary (max (- popup-width string-width spacing) 0)))))
+ (when summary-face
+ (put-text-property 0 (length truncated-summary)
+ 'face summary-face truncated-summary))
(concat margin-left
string
(make-string spacing ? )
@@ -459,6 +487,7 @@ number at the point."
(face 'popup-face)
mouse-face
(selection-face face)
+ (summary-face 'popup-summary-face)
scroll-bar
margin-left
margin-right
@@ -611,6 +640,7 @@ KEYMAP is a keymap that will be put on the popup contents."
:face face
:mouse-face mouse-face
:selection-face selection-face
+ :summary-face summary-face
:margin-left margin-left
:margin-right margin-right
:margin-left-cancel margin-left-cancel
@@ -651,6 +681,7 @@ KEYMAP is a keymap that will be put on the popup contents."
with popup-face = (popup-face popup)
with mouse-face = (popup-mouse-face popup)
with selection-face = (popup-selection-face popup)
+ with summary-face-0 = (popup-summary-face popup)
with list = (popup-list popup)
with length = (length list)
with thum-size = (max (/ (* height height) (max length 1)) 1)
@@ -671,6 +702,7 @@ KEYMAP is a keymap that will be put on the popup contents."
for face = (if (= i cursor)
(or (popup-item-selection-face item) selection-face)
(or (popup-item-face item) popup-face))
+ for summary-face = (unless (= i cursor) summary-face-0)
for empty-char = (propertize " " 'face face)
for scroll-bar-char = (if scroll-bar
(cond
@@ -700,6 +732,7 @@ KEYMAP is a keymap that will be put on the popup contents."
:scroll-bar-char scroll-bar-char
:symbol sym
:summary summary
+ :summary-face summary-face
:keymap keymap)
finally
@@ -1027,6 +1060,11 @@ PROMPT is a prompt string when reading events during
event loop."
"Face for popup menu selection."
:group 'popup)
+(defface popup-menu-summary-face
+ '((t (:background "lightgray" :foreground "dimgray")))
+ "Face for popup summary."
+ :group 'popup)
+
(defvar popup-menu-show-tip-function 'popup-tip
"Function used for showing tooltip by `popup-menu-show-quick-help'.")
@@ -1237,6 +1275,7 @@ isearch canceled. The arguments is whole filtered list of
items."
:face 'popup-menu-face
:mouse-face 'popup-menu-mouse-face
:selection-face 'popup-menu-selection-face
+ :summary-face 'popup-menu-summary-face
:margin-left margin-left
:margin-right margin-right
:scroll-bar scroll-bar
- [nongnu] elpa/popup cb51206 008/184: Add mouse support., (continued)
- [nongnu] elpa/popup cb51206 008/184: Add mouse support., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 6862a47 011/184: Fixed cascade menu corruption., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 4212a36 021/184: Add tests/run-test.el, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup d669e38 025/184: Remove junk., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 6e467e2 026/184: Add Travis CI build status, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 13dbaf5 037/184: Change test helper spec, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup c0937ea 053/184: Truncate summary first, then string itself, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup a49ffd0 081/184: Rename :initial-cursor keyword option to :cursor., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 5809969 041/184: Add test case for margin, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup e5794f8 052/184: Truncate summary when it is too long, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 967cde1 067/184: Merge pull request #30 from tkf/summary-face,
ELPA Syncer <=
- [nongnu] elpa/popup e164f3b 098/184: fixed without ignore-errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 34be113 116/184: Merge pull request #78 from aki2o/fix-popup-delete, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup dcc9ee5 119/184: Merge pull request #80 from ancane/master, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 0bead7c 086/184: Use cl-lib functions instead of cl in tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 29c6db4 130/184: Pass filtering function as an argument to popup-menu*, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 5374e55 110/184: Merge pull request #73 from auto-complete/add-initial-index-test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 47008e1 135/184: Allow the user to specify a custom function to build the regexp in isearch, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 3d62f15 161/184: Merge pull request #112 from PuercoWork/patch-1, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup cf2cefe 166/184: Fixed compile warning, free variable from display line numbers., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 51f4430 171/184: Fixed to not use emacs 26.1 as dep., ELPA Syncer, 2021/10/06