[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sesman 19151a8b60 065/100: Add colors for marking dir, pr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sesman 19151a8b60 065/100: Add colors for marking dir, proj and buf in listings |
Date: |
Tue, 28 Dec 2021 14:06:03 -0500 (EST) |
branch: elpa/sesman
commit 19151a8b60ea751875715bedea0dce3b9a04048a
Author: Vitalie Spinu <spinuvit@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>
Add colors for marking dir, proj and buf in listings
---
sesman-browser.el | 68 +++++++++++++++++++++++++++++++++++++++----------------
1 file changed, 49 insertions(+), 19 deletions(-)
diff --git a/sesman-browser.el b/sesman-browser.el
index 935e1bc7e6..5e2e1898f6 100644
--- a/sesman-browser.el
+++ b/sesman-browser.el
@@ -40,13 +40,6 @@
:group 'sesman
:link '(url-link :tag "GitHub" "https://github.com/vspinu/sesman"))
-(defvar-local sesman-browser--sort-types '(name relevance))
-(defcustom sesman-browser-sort-type 'name
- "Default sorting type in sesman browser buffers.
-Currently can be either 'name or 'relevance."
- :type '(choice (const name) (const relevance))
- :group 'sesman-browser)
-
(defface sesman-browser-highligh
'((default (:inherit highlight :weight bold)))
"Face used to highlight currently selected button."
@@ -57,6 +50,33 @@ Currently can be either 'name or 'relevance."
"Face used to highlight currently selected object."
:group 'sesman-browser)
+(defface sesman-browser-project-face
+ '((default (:inherit font-lock-comment-face)))
+ "Face used to mark projects."
+ :group 'sesman-browser)
+
+(defface sesman-browser-directory-face
+ '((default (:inherit font-lock-constant-face)))
+ "Face used to mark directories."
+ :group 'sesman-browser)
+
+(defface sesman-browser-buffer-face
+ '((default (:inherit font-lock-keyword-face)))
+ "Face used to mark buffers."
+ :group 'sesman-browser)
+
+(defface sesman-browser-project-face
+ '((default (:inherit font-lock-comment-face)))
+ "Face used to mark projects."
+ :group 'sesman-browser)
+
+(defvar-local sesman-browser--sort-types '(name relevance))
+(defcustom sesman-browser-sort-type 'name
+ "Default sorting type in sesman browser buffers.
+Currently can be either 'name or 'relevance."
+ :type '(choice (const name) (const relevance))
+ :group 'sesman-browser)
+
(defvar sesman-browser-map
(let (sesman-browser-map)
(define-prefix-command 'sesman-browser-map)
@@ -332,7 +352,9 @@ See `sesman-browser-sort-type' for the default sorting
type."
(propertize (symbol-name sesman-browser-sort-type) 'face 'bold)))
(define-derived-mode sesman-browser-mode special-mode "SesmanBrowser"
- "Interactive view of Sesman sessions."
+ "Interactive view of Sesman sessions.
+When applicable, system specific commands are locally bound to j when point is
+on a session object."
;; ensure there is a sesman-system here
(sesman--system)
(delete-all-overlays)
@@ -371,20 +393,27 @@ See `sesman-browser-sort-type' for the default sorting
type."
(vert-stop))
(dolist (grp link-groups)
(let* ((type (car grp))
- (short-type (or (plist-get sesman--cxt-abbrevs type) type)))
+ (face (intern (format "sesman-browser-%s-face" type)))
+ (short-type (propertize (or (plist-get sesman--cxt-abbrevs type)
+ (symbol-value type))
+ 'face (list (if (facep face)
+ face
+
'font-lock-function-name-face)
+ 'sesman-browser-button))))
(dolist (link (cdr grp))
(when (> (current-column) fill-column)
(insert "\n" (format head-template " "))
(setq vert-stop nil))
- (insert (propertize (format "%s(%s)" short-type
- (sesman--abbrev-path-maybe
- (sesman--lnk-value link)))
- :sesman-stop (car link)
- :sesman-vertical-stop (unless vert-stop (setq
vert-stop t))
- :sesman-link link
- 'cursor-sensor-functions (list
#'sesman-browser--sensor-function)
- 'mouse-face 'highlight
- 'face 'sesman-browser-button))
+ (let ((link-spec (propertize (format "(%s)"
+ (sesman--abbrev-path-maybe
+ (sesman--lnk-value link)))
+ 'face 'sesman-browser-button)))
+ (insert (propertize (concat short-type link-spec)
+ :sesman-stop (car link)
+ :sesman-vertical-stop (unless vert-stop
(setq vert-stop t))
+ :sesman-link link
+ 'cursor-sensor-functions (list
#'sesman-browser--sensor-function)
+ 'mouse-face 'highlight)))
(insert " ")))))
(insert "\n")
@@ -425,7 +454,8 @@ See `sesman-browser-sort-type' for the default sorting
type."
;;;###autoload
(defun sesman-browser ()
- "Display an interactive session browser."
+ "Display an interactive session browser.
+See `sesman-browser-mode' for more details."
(interactive)
(let* ((system (sesman--system))
(pop-to (called-interactively-p 'any))
- [nongnu] elpa/sesman 0d8d1bef45 022/100: Version 0.1.1, (continued)
- [nongnu] elpa/sesman 0d8d1bef45 022/100: Version 0.1.1, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman e341db8d97 095/100: Update menu, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 0d3d016732 023/100: Add autoloads for user level commands, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 2e4205c7d9 046/100: Fix return value of sesman-grouped-links, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman ae68b3facf 042/100: [#8] Improve session "info" infrastructure, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 9108444fd8 040/100: Better sorting and de-duplication in a number of core functions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman ba2756caf7 063/100: Fix compilation warnings, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman fcdb6846f3 061/100: Make checkdoc happy, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 602d818dd0 073/100: Autoload sesman keymap, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 2b1b624e7a 074/100: Implement friendly session mechanism, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 19151a8b60 065/100: Add colors for marking dir, proj and buf in listings,
ELPA Syncer <=
- [nongnu] elpa/sesman 1f5b2b2338 075/100: More consistent empty prefix in sesman-info, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 59f4a2442e 077/100: Simplify system API by subsuming sesman-linked/friendly-sessions into sesman-sessions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 4b2507d1ee 076/100: Optimize sesman-current-session, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman edee869c20 096/100: Sesman menu: Add Browser, Move Unlink, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 93123f6cef 093/100: Rename seman-menu-open -> sesman-menu-open, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 966c13812f 088/100: [Fix #14] Rewrite the usage of when-let*, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman b527f7a638 043/100: Make sesman-system permanent local, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 95f8354d1a 041/100: Add sesman-relevant-[link|session]-p functions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman cf7997e279 035/100: Add sesman-project generic, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 0ea1d3e645 048/100: [Fix #7] Implement WHICH argument in `sesman-restart`, ELPA Syncer, 2021/12/28