[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/eat 2dd4e42773 01/15: Prefer 'pcase-exhaustive' over 'pcas
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/eat 2dd4e42773 01/15: Prefer 'pcase-exhaustive' over 'pcase' |
Date: |
Tue, 29 Nov 2022 05:58:37 -0500 (EST) |
branch: elpa/eat
commit 2dd4e42773c099120e8b2624870f516149fe3066
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Prefer 'pcase-exhaustive' over 'pcase'
* eat.el (eat--t-erase-in-line, eat--t-erase-in-disp)
(eat--t-set-mouse-mode, eat--t-send-device-attrs)
(eat--t-handle-output, eat-term-input-event)
(eat--manipulate-kill-ring, eat--trace-replay-eval):
Prefer 'pcase-exhaustive' over 'pcase'.
---
eat.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/eat.el b/eat.el
index 02e226dd4d..550a3de6ec 100644
--- a/eat.el
+++ b/eat.el
@@ -2699,7 +2699,7 @@ N default to 1."
N defaults to 0. When N is 0, erase cursor to end of line. When N is
1, erase beginning of line to cursor. When N is 2, erase whole line."
(let ((face (eat--t-term-face eat--t-term)))
- (pcase n
+ (pcase-exhaustive n
((or 0 'nil (pred (< 2)))
;; Delete cursor position (inclusive) to end of line.
(delete-region (point) (car (eat--t-eol)))
@@ -2761,7 +2761,7 @@ is 1, erase beginning of display to cursor. In both on
the previous
cases, don't move cursor. When N is 2, erase display and reset cursor
to (1, 1). When N is 3, also erase the scrollback."
(let ((face (eat--t-term-face eat--t-term)))
- (pcase n
+ (pcase-exhaustive n
((or 0 'nil (pred (< 3)))
;; Delete from cursor position (inclusive) to end of terminal.
(delete-region (point) (point-max))
@@ -3421,11 +3421,12 @@ MODE should be one of nil and `x10', `normal',
`button-event',
(setf (eat--t-term-mouse-pressed eat--t-term) nil))
;; Inform the UI.
(funcall (eat--t-term-grab-mouse-fn eat--t-term) eat--t-term
- (pcase mode
+ (pcase-exhaustive mode
('x10 :click)
('normal :modifier-click)
('button-event :drag)
- ('any-event :all))))
+ ('any-event :all)
+ ('nil nil))))
(defun eat--t-enable-x10-mouse ()
"Enable X10 mouse tracking."
@@ -3472,7 +3473,7 @@ MODE should be one of nil and `x10', `normal',
`button-event',
PARAMS is the parameter list and FORMAT is the format of parameters in
output."
(setq params (or params '((0))))
- (pcase format
+ (pcase-exhaustive format
('nil
(when (= (caar params) 0)
(funcall (eat--t-term-input-fn eat--t-term) eat--t-term
@@ -3659,7 +3660,7 @@ DATA is the selection data encoded in base64."
"Parse and evaluate OUTPUT."
(let ((index 0))
(while (< index (length output))
- (pcase (eat--t-term-parser-state eat--t-term)
+ (pcase-exhaustive (eat--t-term-parser-state eat--t-term)
('nil
;; Regular expression to find the end of plain text.
(let ((match (string-match
@@ -3681,7 +3682,7 @@ DATA is the selection data encoded in base64."
(setq index match))
;; Dispatch control sequence.
(cl-incf index)
- (pcase (aref output (1- index))
+ (pcase-exhaustive (aref output (1- index))
(?\a
(eat--t-bell))
(?\b
@@ -4472,7 +4473,7 @@ client process may get confused."
('prior ?5)
('next ?6)
(_ ?1))
- (pcase (event-modifiers ev)
+ (pcase-exhaustive (event-modifiers ev)
((and (pred (memq 'control))
(pred (memq 'meta))
(pred (memq 'shift)))
@@ -5447,13 +5448,12 @@ selection, or nil if none."
(let ((inhibit-eol-conversion t)
(select-enable-clipboard (eq selection :clipboard))
(select-enable-primary (eq selection :primary)))
- (pcase data
+ (pcase-exhaustive data
('t
(when eat-enable-yank-to-terminal
(ignore-error error
(current-kill 0 'do-not-move))))
- ((and (pred stringp)
- str)
+ ((and (pred stringp) str)
(when eat-enable-kill-from-terminal
(kill-new str))))))
@@ -6715,7 +6715,7 @@ FN is the original definition of `eat--eshell-cleanup',
which see."
(let ((inhibit-read-only t))
(setq eat--trace-replay-progress
(- (car data) eat--trace-replay-recording-start-time))
- (pcase data
+ (pcase-exhaustive data
(`(,time create ,_ui ,width ,height ,variables)
(setq eat--trace-replay-recording-start-time time
eat--trace-replay-progress 0)
- [nongnu] elpa/eat updated (f3fed64957 -> d8171b9a8c), ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 0e82988d6f 03/15: Use 'setf' + 'plist-get' instead of 'plist-put', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat a736f08ea9 02/15: Prefer 'and-let*' and 'when-let*' over 'when-let', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 9a9d9165f2 05/15: * eat.el (eat--bell): Use 'ding' instead of 'beep', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 59c0745e75 12/15: Don't put 'error' as the only then part of 'if', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 3e496e8db8 14/15: ; Merge diverged elpa/eat branch of NonGNU ELPA, ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 5ce98430e8 07/15: Use more readable '?\C-\s' instead of '?\C-\ ', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 10d9f3cb56 11/15: Use 'mapc' to make & kill multiple local variables, ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 2dd4e42773 01/15: Prefer 'pcase-exhaustive' over 'pcase',
ELPA Syncer <=
- [nongnu] elpa/eat dc99739fb8 04/15: * eat.el (eat--trace-exec): Use "-*- mode: MD -*-", ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat c19cf68b28 08/15: * eat.el (eat-term-make-keymap): Use 'cl-flet', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 1b2b7aee26 13/15: Bump version to 0.1, ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 528bfe424d 10/15: Put declare-function and defvar outside functions, ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 31f93da3fd 06/15: * eat.el (eat-mode): Fix char mode 'help-echo', ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat 86e247137b 09/15: Use 'vector' directly instead of backquote, ELPA Syncer, 2022/11/29
- [nongnu] elpa/eat d8171b9a8c 15/15: ; Ignore a commit while generating ChangeLog, ELPA Syncer, 2022/11/29