about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-07-16T09·08+0800
committerChris Feng <chris.w.feng@gmail.com>2017-07-16T09·08+0800
commit7d967e73619e3628848b711f482b5db816636bda (patch)
tree3487a048f9d8d66c9e8b68bda9f40d845d3d1287
parent19515dc0749e820be5ec528c7a9a7bdceaac7c65 (diff)
Allow customizing workspace indexes
* exwm-workspace.el (exwm-workspace-index-map): New variable for
customizing workspace indexes.
(exwm-workspace--update-switch-history): Use it.
-rw-r--r--exwm-workspace.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 8c22b7c1d805..bebd954940f2 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -35,6 +35,10 @@
 (defvar exwm-workspace--list nil "List of all workspaces (Emacs frames).")
 (defvar exwm-workspace--current nil "Current active workspace.")
 (defvar exwm-workspace-current-index 0 "Index of current active workspace.")
+(defvar exwm-workspace-index-map #'number-to-string
+  "Function for mapping a workspace index to a string for display.
+
+By default `number-to-string' is applied which yields 0 1 2 ... .")
 
 (defsubst exwm-workspace--position (frame)
   "Retrieve index of given FRAME in workspace list.
@@ -168,7 +172,7 @@ Please manually run the hook `exwm-workspace-list-change-hook' afterwards.")
                 (lambda (j)
                   (format (if (= i j) "[%s]" " %s ")
                           (propertize
-                           (int-to-string j)
+                           (apply exwm-workspace-index-map (list j))
                            'face
                            (cond ((frame-parameter (elt exwm-workspace--list j)
                                                    'exwm-urgency)