Additional linting

Running `M-x checkdoc` on some of the modules that passed the package-lint but
failed additional lints.
This commit is contained in:
William Carroll 2020-08-31 16:07:11 +01:00
parent 2a51698672
commit 5d3bb0b7ea
7 changed files with 29 additions and 31 deletions

View file

@ -1,5 +1,9 @@
;;; email.el --- My Emacs email settings -*- lexical-binding: t -*-
;;; email.el --- My email settings -*- lexical-binding: t -*-
;; Author: William Carroll <wpcarro@gmail.com>
;; Version: 0.0.1
;; URL: https://git.wpcarro.dev/wpcarro/briefcase
;; Package-Requires: ((emacs "24"))
;;; Commentary:
;; Attempting to configure to `notmuch' for my personal use.

View file

@ -2,8 +2,8 @@
;; Author: William Carroll <wpcarro@gmail.com>
;; Version: 0.0.1
;; URL: https://git.wpcarro.dev/wpcarro/briefcase
;; Package-Requires: ((emacs "24"))
;; Homepage: https://user.git.corp.google.com/wpcarro/briefcase
;;; Commentary:
;; Sometimes Emacs's function names and argument ordering is great; other times,
@ -16,7 +16,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun region-to-string ()
"Returns the string in the active region."
"Return the string in the active region."
(buffer-substring-no-properties (region-beginning)
(region-end)))

View file

@ -107,20 +107,6 @@
(evil-set-initial-state 'exwm-mode 'emacs)
(setq exwm-workspace-number
(list/length window-manager--named-workspaces))
;; EXWM supports "line-mode" and "char-mode".
;;
;; Note: It appears that calling `exwm-input-set-key' works if it's called
;; during startup. Once a session has started, it seems like this function is
;; significantly less useful. Is this a bug?
;;
;; Glossary:
;; - char-mode: All keystrokes except `exwm' global ones are passed to the
;; application.
;; - line-mode:
;;
;; `exwm-input-global-keys' = {line,char}-mode; can also call `exwm-input-set-key'
;; `exwm-mode-map' = line-mode
;; `???' = char-mode. Is there a mode-map for this?
(let ((kbds `(
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window sizing
@ -176,7 +162,8 @@
(setq exwm-input-global-keys
(->> kbds
(-map (lambda (plist)
`(,(kbd (plist-get plist :key)) . ,(plist-get plist :fn)))))))
`(,(kbd (plist-get plist :key)) .
,(plist-get plist :fn)))))))
(setq exwm-input-simulation-keys
;; TODO: Consider supporting M-d and other readline style KBDs.
'(([?\C-b] . [left])
@ -304,7 +291,8 @@ Ivy is used to capture the user's input."
(defun window-manager--label->index (label workspaces)
"Return the index of the workspace in WORKSPACES named LABEL."
(let ((index (-elem-index label (-map #'window-manager--named-workspace-label workspaces))))
(let ((index (-elem-index label (-map #'window-manager--named-workspace-label
workspaces))))
(if index index (error (format "No workspace found for label: %s" label)))))
(defun window-manager--register-kbd (workspace)
@ -312,7 +300,8 @@ Ivy is used to capture the user's input."
Currently using super- as the prefix for switching workspaces."
(let ((handler (lambda ()
(interactive)
(window-manager--switch (window-manager--named-workspace-label workspace))))
(window-manager--switch
(window-manager--named-workspace-label workspace))))
(key (window-manager--named-workspace-kbd workspace)))
(exwm-input-set-key
(kbd/for 'workspace key)
@ -321,10 +310,12 @@ Currently using super- as the prefix for switching workspaces."
(defun window-manager--change-workspace (workspace)
"Switch EXWM workspaces to the WORKSPACE struct."
(exwm-workspace-switch
(window-manager--label->index (window-manager--named-workspace-label workspace)
window-manager--named-workspaces))
(window-manager--label->index
(window-manager--named-workspace-label workspace)
window-manager--named-workspaces))
(window-manager--alert
(string/format "Switched to: %s" (window-manager--named-workspace-label workspace))))
(string/format "Switched to: %s"
(window-manager--named-workspace-label workspace))))
(defun window-manager--switch (label)
"Switch to a named workspaces using LABEL."
@ -339,7 +330,8 @@ Currently using super- as the prefix for switching workspaces."
(defun window-manager-toggle-previous ()
"Focus the previously active EXWM workspace."
(interactive)
(window-manager--change-workspace (cycle/focus-previous! window-manager--workspaces)))
(window-manager--change-workspace
(cycle/focus-previous! window-manager--workspaces)))
(defun window-manager--exwm-buffer? (x)
"Return t if buffer X is an EXWM buffer."
@ -347,7 +339,8 @@ Currently using super- as the prefix for switching workspaces."
(defun window-manager--application-name (buffer)
"Return the name of the application running in the EXWM BUFFER.
This function asssumes that BUFFER passes the `window-manager--exwm-buffer?' predicate."
This function asssumes that BUFFER passes the `window-manager--exwm-buffer?'
predicate."
(with-current-buffer buffer exwm-class-name))
;; TODO: Support disambiguating between two or more instances of the same
@ -358,9 +351,10 @@ This function asssumes that BUFFER passes the `window-manager--exwm-buffer?' pre
(interactive)
(let* ((buffer-alist (->> (buffer-list)
(-filter #'window-manager--exwm-buffer?)
(-map (lambda (buffer)
(cons (window-manager--application-name buffer)
buffer)))))
(-map
(lambda (buffer)
(cons (window-manager--application-name buffer)
buffer)))))
(label (completing-read "Switch to EXWM buffer: " buffer-alist)))
(exwm-workspace-switch-to-buffer
(alist-get label buffer-alist nil nil #'string=))))

View file

@ -3,7 +3,7 @@
;; Author: William Carroll <wpcarro@gmail.com>
;; Version: 0.0.1
;; Package-Requires: ((emacs "25.1"))
;; Homepage: https://user.git.corp.google.com/wpcarro/briefcase
;; URL: https://git.wpcarro.dev/wpcarro/briefcase
;;; Commentary:
;; This is the home of any configuration that couldn't find a better home.

View file

@ -24,7 +24,6 @@
:config
(evil-set-initial-state 'org-mode 'normal)
(general-add-hook 'org-mode-hook
;; TODO: consider supporting `(disable (list linum-mode company-mode))'
(list (disable linum-mode)
(disable company-mode)))
(setq org-startup-folded nil)

View file

@ -6,7 +6,7 @@
;; Homepage: https://user.git.corp.google.com/wpcarro/briefcase
;;; Commentary:
;; Helpers for my shell scripting. Includes bash, zsh, etc.
;; Helpers for my shell scripting. Includes bash, zsh, etc.
;;; Code:

View file

@ -2,6 +2,7 @@
;; Author: William Carroll <wpcarro@gmail.com>
;; Version: 0.0.1
;; URL: https://git.wpcarro.dev/wpcarro/briefcase
;; Package-Requires: ((emacs "24"))
;;; Commentary: