Compare commits
No commits in common. "c5455e866e8a5f7eab6a7263e2057aff5f1118b9" and "d7b7eecf0860c63eab9cc4013d08e2a4a83fcc5e" have entirely different histories.
c5455e866e
...
d7b7eecf08
53
README.org
53
README.org
|
@ -3,20 +3,17 @@
|
|||
[[https://github.com/syl20bnr/spacemacs][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]] [[https://melpa.org/#/winum][file:https://melpa.org/packages/winum-badge.svg]] [[https://stable.melpa.org/#/winum][file:https://stable.melpa.org/packages/winum-badge.svg]]
|
||||
|
||||
* Contents :TOC:noexport:
|
||||
- [[#introduction][Introduction]]
|
||||
- [[#changelog][Changelog]]
|
||||
- [[#sep-11-2019][Sep. 11 2019]]
|
||||
- [[#nov-15-2018][Nov. 15 2018]]
|
||||
- [[#initial-release-whats-changed-since-window-numbering][Initial release: what's changed since window-numbering]]
|
||||
- [[#installation][Installation]]
|
||||
- [[#introduction][Introduction]]
|
||||
- [[#whats-changed-since-window-numbering][What's changed since window-numbering]]
|
||||
- [[#installation][Installation]]
|
||||
- [[#using-melpa][Using Melpa]]
|
||||
- [[#manual-installation][Manual installation]]
|
||||
- [[#how-to-use][How to use]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#how-to-use][How to use]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#keybindings][Keybindings]]
|
||||
- [[#customize-options][Customize options]]
|
||||
- [[#configuration-file-example][Configuration file example]]
|
||||
- [[#future-developments][Future developments]]
|
||||
- [[#future-developments][Future developments]]
|
||||
|
||||
* Introduction
|
||||
Window numbers for Emacs: Navigate your windows and frames using numbers !
|
||||
|
@ -28,15 +25,7 @@ from [[https://github.com/abo-abo/ace-window][ace-window]].
|
|||
This version brings, among other things, support for number sets across multiple
|
||||
frames, giving the user a smoother experience of multi-screen Emacs.
|
||||
|
||||
* Changelog
|
||||
** Sep. 11 2019
|
||||
- Added customize variable =winum-ignored-buffers-regexp= to ignored buffers
|
||||
based on regexps.
|
||||
** Nov. 15 2018
|
||||
- Added customize variable =winum-format=, a format string to configure how the
|
||||
window number appears in the mode-line
|
||||
|
||||
** Initial release: what's changed since window-numbering
|
||||
* What's changed since window-numbering
|
||||
This package brings a lot of additions to the old window-numbering:
|
||||
|
||||
- Number sets across multiple frames, giving a smoother experience of
|
||||
|
@ -235,7 +224,7 @@ Several options are available through Emacs' Customize interface under
|
|||
((equal (buffer-name) "*Calculator*") 9)
|
||||
((equal (buffer-name) "*Flycheck errors*") 8)))
|
||||
|
||||
(defun winum-assign-0-to-neotree ()
|
||||
(defun winum-assign-0-to-neotree-and ()
|
||||
(when (string-match-p (buffer-name) ".*\\*NeoTree\\*.*") 10))
|
||||
|
||||
(add-to-list 'winum-assign-functions #'winum-assign-9-to-calculator-8-to-flycheck-errors)
|
||||
|
@ -252,14 +241,6 @@ Several options are available through Emacs' Customize interface under
|
|||
|
||||
Default: =t=
|
||||
|
||||
- =winum-format=
|
||||
|
||||
Format string defining how the window number looks like in the mode-line.
|
||||
This string is passed to the =format= function along with the result of
|
||||
=winum-get-number-string=.
|
||||
|
||||
Default: =" %s "=
|
||||
|
||||
- =winum-mode-line-position=
|
||||
|
||||
The position in the mode-line =winum-mode= displays the number.
|
||||
|
@ -272,13 +253,6 @@ Several options are available through Emacs' Customize interface under
|
|||
|
||||
Default: '(" *which-key*")
|
||||
|
||||
- =winum-ignored-buffers-regexp=
|
||||
|
||||
List of regexps for buffer names. Matching buffers will be ignored when
|
||||
assigning numbers. See [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html][Emacs' documentation on regexps]] for syntax.
|
||||
|
||||
Default: '()
|
||||
|
||||
- face: =winum-face=
|
||||
|
||||
Face used for the number in the mode-line.
|
||||
|
@ -310,7 +284,7 @@ available winum options.
|
|||
((equal (buffer-name) "*Calculator*") 9)
|
||||
((equal (buffer-name) "*Flycheck errors*") 8)))
|
||||
|
||||
(defun winum-assign-0-to-neotree ()
|
||||
(defun winum-assign-0-to-neotree-and ()
|
||||
(when (string-match-p (buffer-name) ".*\\*NeoTree\\*.*") 10))
|
||||
|
||||
(add-to-list 'winum-assign-functions #'winum-assign-9-to-calculator-8-to-flycheck-errors)
|
||||
|
@ -323,10 +297,8 @@ available winum options.
|
|||
winum-auto-assign-0-to-minibuffer t
|
||||
winum-assign-func 'my-winum-assign-func
|
||||
winum-auto-setup-mode-line t
|
||||
winum-format " %s "
|
||||
winum-mode-line-position 1
|
||||
winum-ignored-buffers '(" *which-key*")
|
||||
winum-ignored-buffers-regexp '(" \\*Treemacs-.*"))
|
||||
winum-ignored-buffers '(" *which-key*"))
|
||||
|
||||
(winum-mode)
|
||||
#+END_SRC
|
||||
|
@ -349,4 +321,9 @@ available winum options.
|
|||
|
||||
- Autocomplete read-from-minibuffer
|
||||
|
||||
- Add =winum-format= customize variable
|
||||
|
||||
Format string for displaying the window number in the mode-line. Default to
|
||||
" %n " to get a space on each side of the window number.
|
||||
|
||||
- Things that you have thought of and I haven't :smile_cat:
|
||||
|
|
46
winum.el
46
winum.el
|
@ -17,7 +17,7 @@
|
|||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;;
|
||||
;; Author: Thomas de Beauchêne <thomas.de.beauchene@gmail.com>
|
||||
;; Version: 2.2.0
|
||||
;; Version: 2.0.0
|
||||
;; Keywords: convenience, frames, windows, multi-screen
|
||||
;; URL: http://github.com/deb0ch/winum.el
|
||||
;; Created: 2016
|
||||
|
@ -143,25 +143,11 @@ numbers in the mode-line."
|
|||
:group 'winum
|
||||
:type 'integer)
|
||||
|
||||
(defcustom winum-format " %s "
|
||||
"Format string defining how the window number looks like in the mode-line.
|
||||
This string is passed to the `format' function along with the
|
||||
result of `winum-get-number-string'."
|
||||
:group 'winum
|
||||
:type 'string)
|
||||
|
||||
(defcustom winum-ignored-buffers '(" *which-key*")
|
||||
"List of buffers to ignore when assigning numbers."
|
||||
:group 'winum
|
||||
:type '(repeat string))
|
||||
|
||||
(defcustom winum-ignored-buffers-regexp '()
|
||||
"List of regexps for buffer names to ignore when assigning numbers.
|
||||
See Info node `(emacs) Regexps' or Info node `(elisp) Regular Expressions'"
|
||||
:group 'winum
|
||||
:type '(repeat string)
|
||||
:risky t)
|
||||
|
||||
(defface winum-face '()
|
||||
"Face used for the number in the mode-line."
|
||||
:group 'winum)
|
||||
|
@ -222,10 +208,6 @@ To get a number given a window, use the `cdr' of a value.
|
|||
|
||||
Such a structure allows for per-frame bidirectional fast access.")
|
||||
|
||||
(defvar winum--mode-line-segment
|
||||
'(:eval (format winum-format (winum-get-number-string)))
|
||||
"What is pushed into `mode-line-format' when setting it up automatically.")
|
||||
|
||||
(defvar winum--last-used-scope winum-scope
|
||||
"Tracks the last used `winum-scope'.
|
||||
Needed to detect scope changes at runtime.")
|
||||
|
@ -430,26 +412,23 @@ POSITION: position in the mode-line."
|
|||
(dotimes (i (min (or position winum-mode-line-position 1)
|
||||
(length mode-line)))
|
||||
(push (pop mode-line) res))
|
||||
(unless (equal (car mode-line) winum--mode-line-segment)
|
||||
(push winum--mode-line-segment res))
|
||||
(unless (equal (car mode-line) '(:eval (winum-get-number-string)))
|
||||
(push '(:eval (winum-get-number-string)) res))
|
||||
(while mode-line
|
||||
(push (pop mode-line) res))
|
||||
(let ((nres (nreverse res)))
|
||||
(setq mode-line-format nres)
|
||||
(setq-default mode-line-format nres)))
|
||||
(setq-default mode-line-format (nreverse res)))
|
||||
(force-mode-line-update t))
|
||||
|
||||
(defun winum--clear-mode-line ()
|
||||
"Remove the window number of `winum-mode' from the mode-line."
|
||||
(let ((mode-line (default-value 'mode-line-format))
|
||||
res)
|
||||
(res))
|
||||
(while mode-line
|
||||
(let ((item (pop mode-line)))
|
||||
(unless (equal item winum--mode-line-segment)
|
||||
(push item res))))
|
||||
(let ((nres (nreverse res)))
|
||||
(setq mode-line-format nres)
|
||||
(setq-default mode-line-format nres)))
|
||||
(let ((item (car mode-line)))
|
||||
(unless (equal item '(:eval (winum-get-number-string)))
|
||||
(push item res)))
|
||||
(pop mode-line))
|
||||
(setq-default mode-line-format (nreverse res)))
|
||||
(force-mode-line-update t))
|
||||
|
||||
(defun winum--update ()
|
||||
|
@ -545,10 +524,7 @@ windows, however a higher number can be reserved by the user-defined
|
|||
(or (not (and (frame-live-p f)
|
||||
(frame-visible-p f)))
|
||||
(string= "initial_terminal" (terminal-name f))
|
||||
(member (buffer-name (window-buffer window)) winum-ignored-buffers)
|
||||
(cl-some
|
||||
(lambda (regex) (string-match regex (buffer-name (window-buffer window))))
|
||||
winum-ignored-buffers-regexp))))
|
||||
(member (buffer-name (window-buffer window)) winum-ignored-buffers))))
|
||||
|
||||
(defun winum--list-windows-in-frame (&optional f)
|
||||
"List windows in frame F using natural Emacs ordering."
|
||||
|
|
Loading…
Reference in a new issue