Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jyp committed Jan 9, 2024
1 parent 172eb6c commit dc98245
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions boon-main.el
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ Return nil if no changes are made."

;;;###autoload
(defun boon-toggle-case ()
"Toggle the case of the character at point, or cycle the case of the region if it is active."
"Toggle the case.
Cycle the case of the region if it is active. If not toggle the
case of the character at point."
(interactive)
(if (use-region-p)
(call-interactively 'boon-toggle-region-case)
Expand Down Expand Up @@ -287,6 +289,7 @@ If there is more than one, use mc/create-fake-cursor-at-point."

;;;###autoload
(defun boon-exchange (regs)
"WIP"
(interactive (list (boon-spec-select-top "exchange")))
(let ((last-command nil)) ;; we never want to append to the last kill here
(boon-take-region regs))
Expand Down Expand Up @@ -334,7 +337,7 @@ If there is more than one, use mc/create-fake-cursor-at-point."

;;;###autoload
(defun boon-substitute-region (reg-sel &optional changes)
"Kill the regions REGS, and switch to insertion mode or replay CHANGES."
"Kill the regions REG-SEL, and switch to insertion mode or replay CHANGES."
(interactive (list (boon-spec-select-top "replace")))
(boon-interactive-insert reg-sel)

Expand Down Expand Up @@ -366,7 +369,8 @@ Replace the region if it is active."

;;;###autoload
(defun boon-quote-character (char)
"Execute the command which were bound to the character CHAR if boon was not enabled."
"Execute the command which would bound to the character CHAR.
\(If boon was not enabled.\)"
(interactive (list (read-char))) ;; use read-char so that multiple-cursors advice kicks in.
(let* ((keymap (make-composed-keymap
(let ((boon-mode-map-alist nil)) (current-active-maps))))
Expand Down Expand Up @@ -410,20 +414,22 @@ Replace the region if it is active."
(keyboard-quit))))

(defun boon-god-control-swap (event)
"Swap the control 'bit' in EVENT, unless C-c <event> is a prefix reserved for modes."
"Swap the control \"bit\" in EVENT.
Act as identity function if C-c <event> is a prefix reserved for modes."
(interactive (list (read-key)))
(cond
((memq event '(9 13 ?{ ?} ?\[ ?\] ?$ ?& ?= ?< ?> ?: ?\; ?/ ?? ?. ?, ?' ?` ?\" )) event)
((<= event 27) (+ 96 event))
((not (eq 0 (logand (lsh 1 26) event))) (logxor (lsh 1 26) event))
((not (eq 0 (logand (ash 1 26) event))) (logxor (ash 1 26) event))
(t (list 'control event))))

;;;###autoload
(defun boon-c-god (arg)
"Input a key sequence, prepending C- to each key (unless such
key is already reserved for minor mode, see
`boon-god-control-swap'), and run the command bound to that
sequence."
sequence. The universal argument ARG is forwarded to the
inputted command."
(interactive "P")
(let ((keys '((control c)))
(binding (key-binding (kbd "C-c")))
Expand Down

0 comments on commit dc98245

Please sign in to comment.