From a9d4cfb414e85b19600ddce6b147ca64c5645f18 Mon Sep 17 00:00:00 2001 From: deb0ch Date: Sat, 17 Dec 2016 13:59:18 +0100 Subject: [PATCH] improve docstrings and documentation --- README.org | 7 +++++-- winum.el | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 80e22d1..94b585d 100644 --- a/README.org +++ b/README.org @@ -162,7 +162,8 @@ Several options are available through Emacs' Customize interface under automatic assignment begins. The function should return a number to have it assigned to the current-window, =nil= otherwise. - Default: =nil= + This function along with `winum-auto-assign-0-to-minibuffer' are the only ways + to have 0 assigned to a window. Example: always assign *Calculator* the number 9 and *NeoTree* the number 0: @@ -179,6 +180,8 @@ Several options are available through Emacs' Customize interface under (setq winum-assign-func 'my-winum-assign-func) #+END_SRC + Default: =nil= + - =winum-auto-setup-mode-line= When nil, =winum-mode= will not display window numbers in the mode-line. You @@ -195,7 +198,7 @@ Several options are available through Emacs' Customize interface under - =winum-ignored-buffers= - List of buffers to ignore when selecting window. + List of buffers to ignore when assigning numbers. Default: '(" *which-key*") diff --git a/winum.el b/winum.el index 7ab74c8..8f2b0d6 100644 --- a/winum.el +++ b/winum.el @@ -77,8 +77,22 @@ Has effect only when `winum-scope' is not 'frame-local." "Function called for each window by `winum-mode'. This is called before automatic assignment begins. The function should return a number to have it assigned to the current-window, nil otherwise. + This function along with `winum-auto-assign-0-to-minibuffer' are the only -ways to have 0 assigned to a window." +ways to have 0 assigned to a window. + +Example: always assign *Calculator* the number 9 and *NeoTree* the number 0: + + (defun my-winum-assign-func () + (cond + ((equal (buffer-name) \"*Calculator*\") + 9) + ((string-match-p (buffer-name) \".*\\*NeoTree\\*.*\") + 0) + (t + nil))) + + (setq winum-assign-func 'my-winum-assign-func)" :group 'winum :type 'function) @@ -93,7 +107,7 @@ numbers in the mode-line.") :type 'integer) (defcustom winum-ignored-buffers '(" *which-key*") - "List of buffers to ignore when selecting window." + "List of buffers to ignore when assigning numbers." :group 'winum :type '(repeat string))