[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/window-commander 83eb90586a 051/170: ; Alter comments a
From: |
ELPA Syncer |
Subject: |
[elpa] externals/window-commander 83eb90586a 051/170: ; Alter comments and docstrings to comply with Emacs' conventions |
Date: |
Wed, 28 Jun 2023 19:00:25 -0400 (EDT) |
branch: externals/window-commander
commit 83eb90586a504413b2064026a14797b8e222c6e1
Author: Daniel Semyonov <cmstr@dsemy.com>
Commit: Daniel Semyonov <cmstr@dsemy.com>
; Alter comments and docstrings to comply with Emacs' conventions
---
swsw.el | 70 +++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 36 insertions(+), 34 deletions(-)
diff --git a/swsw.el b/swsw.el
index 80b1fdc7cd..6502a7d8a5 100644
--- a/swsw.el
+++ b/swsw.el
@@ -9,6 +9,8 @@
;; Keywords: convenience
;; URL: https://dsemy.com/software/swsw
+;; This file is not part of GNU Emacs.
+
;; swsw is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
@@ -29,7 +31,7 @@
;;
;; Usage:
;;
-;; Enable `swsw-mode':
+;; Enable ‘swsw-mode’:
;;
;; (swsw-mode)
;;
@@ -40,16 +42,16 @@
;; (swsw-mode))
;;
;; When swsw-mode is active:
-;; - A window ID is displayed using a mode line lighter or a display function
(see
-;; `swsw-display-function').
-;; - A single (predefined) character corresponds to the minibuffer (see
-;; `swsw-minibuffer-id').
-;; - Window IDs are assigned to all windows on all frames (by default, see
-;; `swsw-scope').
+;; - A window ID is displayed using a mode line lighter or a display
+;; function (see ‘swsw-display-function’).
+;; - A single (predefined) character corresponds to the minibuffer
+;; (see ‘swsw-minibuffer-id’).
+;; - Window IDs are assigned to all windows on all frames (by default,
+;; see ‘swsw-scope’).
;;
;; C-x o ID switches focus to the window which corresponds to ID.
;;
-;; You can customize `swsw-mode' using the customize interface:
+;; You can customize ‘swsw-mode’ using the customize interface:
;;
;; M-x customize-group RET swsw RET
@@ -75,8 +77,8 @@
(defcustom swsw-scope t
"Scope of all window operations.
t means consider all windows on all existing frames.
-0 (the number zero) means consider all windows on all visible and iconified
-frames.
+0 (the number zero) means consider all windows on all visible and
+ iconified frames.
‘visible’ means consider all windows on all visible frames.
‘current’ means consider only the currently selected frame."
:group 'swsw
@@ -87,11 +89,13 @@ frames.
(const
:tag "All window on the currently selected frame" current)))
-(defvar swsw-display-function 'lighter) ; Avoid byte-compilation warning.
+(defvar swsw-display-function) ; Avoid byte-compilation warning.
(defun swsw--set-display-function (sym fun)
- "Call the previous display function with nil as the sole argument (turning
-it off), set SYM's value to FUN, and call FUN with t as the sole argument."
+ "Set the variable ‘swsw-display-function’.
+Call the previous display function with nil as the sole argument
+\(turning it off), set SYM's value to FUN, and call FUN with t as the
+sole argument (turning it on)."
(unless (or (not (boundp 'swsw-display-function))
(eq swsw-display-function 'lighter))
(funcall swsw-display-function nil))
@@ -101,9 +105,9 @@ it off), set SYM's value to FUN, and call FUN with t as the
sole argument."
(defcustom swsw-display-function 'lighter
"Function used to display the ID of each window.
-This function is called with t as the sole argument when enabling `swsw-mode',
-and with nil as the sole argument when disabling it.
-If set to `lighter', use the mode line lighter of `swsw-mode'"
+This function is called with t as the sole argument when enabling
+‘swsw-mode’, and with nil as the sole argument when disabling it.
+If set to ‘lighter’, use the mode line lighter of ‘swsw-mode’."
:group 'swsw
:type '(radio (const :tag "Mode line lighter" lighter)
(function :tag "Display function"))
@@ -124,7 +128,7 @@ If set to `lighter', use the mode line lighter of
`swsw-mode'"
"Alist of active active windows and their IDs.")
(defun swsw--get-scope ()
- "Return the current scope of `swsw-mode'."
+ "Return the current scope in which windows should be tracked."
(if (eq swsw-scope 'current)
(selected-frame)
swsw-scope))
@@ -175,7 +179,7 @@ If set to `lighter', use the mode line lighter of
`swsw-mode'"
(reverse (apply #'string (window-parameter window 'swsw-id)))))
(defun swsw--read-id (len)
- "Read a window ID of length LEN using `read-char'."
+ "Read a window ID of length LEN using ‘read-char’."
(let ((acc 1) id)
;; Special case for the minibuffer.
(if (eq (car (push (read-char) id)) swsw-minibuffer-id)
@@ -186,8 +190,10 @@ If set to `lighter', use the mode line lighter of
`swsw-mode'"
(list id))))
(defun swsw-select (&optional id)
- "Select window by its ID."
- ;; If there are less than 3 windows, don't get an ID.
+ "Select a window by its ID.
+If less than three windows have been assigned an ID,
+call ‘other-window’.
+This command is intended to be used only when ‘swsw-mode’ is enabled."
(interactive (unless (< (length swsw-window-list) 3)
(run-hooks 'swsw-before-select-hook)
(unwind-protect
@@ -246,25 +252,21 @@ Use \\[swsw-select] to select a window."
(force-mode-line-update t))
(defun swsw-mode-line-display-function (switch)
- "Display window IDs on the mode line if SWITCH isn't `nil', and disable
-displaying window IDs on the mode line if SWITCH is `nil'.
-
-This display function shows the window IDs at the beginning of the mode line,
-similarly to `ace-window-display-mode'.
-This display function respects `swsw-id-format'."
+ "Display window IDs at the beginning of the mode line.
+Display window IDs if SWITCH isn't nil, and disable displaying window
+IDs if SWITCH is nil.
+This display function respects ‘swsw-id-format’."
(if switch
(swsw--mode-line-display)
(swsw--mode-line-hide)))
(defun swsw-mode-line-conditional-display-function (switch)
- "Add a hook to `swsw-before-select-hook' which displays window IDs on the
-mode line and add a hook to `swsw-after-select-hook' which hides window IDs
-from the mode line if SWITCH isn't `nil', and remove those hooks if SWITCH is
-`nil'.
-
-This display function shows the window IDs at the beginning of the mode line,
-similarly to `ace-window-display-mode'.
-This display function respects `swsw-id-format'."
+ "Display window IDs at the beginning of the mode line, conditionally.
+Add a hook to ‘swsw-before-select-hook’ which displays window IDs on
+the mode line and add a hook to ‘swsw-after-select-hook’ which hides
+window IDs from the mode line if SWITCH isn't nil, and remove those
+hooks if SWITCH is nil.
+This display function respects ‘swsw-id-format’."
(if switch
(progn
(add-hook 'swsw-before-select-hook #'swsw--mode-line-display)
- [elpa] externals/window-commander 9873ff1bd2 020/170: * swsw.el (swsw-select): Add before and after hooks., (continued)
- [elpa] externals/window-commander 9873ff1bd2 020/170: * swsw.el (swsw-select): Add before and after hooks., ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 63e295f599 025/170: Add a user option to customize the scope of window tracking, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 721d0208f7 026/170: Update the window list after deleting a frame, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 082e03382e 033/170: * swsw.el (swsw-select): Ensure 'swsw-after-select-hook' runs., ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 4a7ea31b37 036/170: * swsw.el (swsw-mode): Bind 'C-x o' to 'swsw-select', ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 8044341fdb 040/170: ; Update README to no longer suggest binding 'C-x o' in 'swsw-mode-map', ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander b0b55f010c 041/170: ; Improve the docstrings for the reference display functions, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander c0f5277538 045/170: ; Update the URL property of the package, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 8fc0e7dfa7 046/170: ; Bump required emacs version to 26.1, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 40f7a25f82 047/170: ; Add license information to the title page of the Info node, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 83eb90586a 051/170: ; Alter comments and docstrings to comply with Emacs' conventions,
ELPA Syncer <=
- [elpa] externals/window-commander 08b56d124c 015/170: Add support for multi-character IDs, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 96809a6cae 019/170: Add the ability to change the way window IDs are displayed, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 4c84ca310f 016/170: ; Update README to reflect recent changes, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 48db8fe39b 021/170: Add a reference implementation for a conditional display function, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 8a8be23f1b 050/170: ; Include license information in created package archives, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander ec011dc3b9 053/170: ; Fix inconsistency in URL between swsw.el and swsw-pkg.el, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 0a3edee2e5 055/170: ; Bump version to 1.1.1 and update NEWS file, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 0b67d7bc00 056/170: * swsw.el (swsw-display-function): Define early only when byte-compiling, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 5446df0f3e 059/170: * swsw.el (swsw--get-id-length): Fix the calculation of the ID length, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 095091cf33 057/170: Handle cases where there are less than three tracked windows better, ELPA Syncer, 2023/06/28