[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/eat 528bfe424d 10/15: Put declare-function and defvar outs
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/eat 528bfe424d 10/15: Put declare-function and defvar outside functions |
Date: |
Tue, 29 Nov 2022 05:58:38 -0500 (EST) |
branch: elpa/eat
commit 528bfe424d94aed66b94fb6f8b4b20ce49d41166
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Put declare-function and defvar outside functions
* eat.el (eat--flip-slow-blink-state)
(eat--flip-fast-blink-state, eat-blink-mode)
(eat--eshell-output-filter, eat--eshell-cleanup)
(eat--eshell-process-output-queue, eat--eshell-sentinel)
(eat-eshell-mode, eat--eshell-visual-sentinel)
(eat--eshell-exec-visual, eat-eshell-visual-command-mode)
(eat-project): Move 'declare-function's and 'defvar's outside.
---
eat.el | 54 ++++++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/eat.el b/eat.el
index d7946cf071..14d182d923 100644
--- a/eat.el
+++ b/eat.el
@@ -4939,11 +4939,12 @@ return \"eat-color\", otherwise return \"eat-mono\"."
(defvar eat--fast-blink-timer nil
"Timer for blinking rapidly blinking text.")
+(declare-function face-remap-add-relative "face-remap"
+ (face &rest specs))
+(declare-function face-remap-remove-relative "face-remap" (cookie))
+
(defun eat--flip-slow-blink-state ()
"Flip the state of slowly blinking text."
- (declare-function face-remap-add-relative "face-remap"
- (face &rest specs))
- (declare-function face-remap-remove-relative "face-remap" (cookie))
(face-remap-remove-relative eat--slow-blink-remap)
(setq eat--slow-blink-remap
(face-remap-add-relative
@@ -4953,9 +4954,6 @@ return \"eat-color\", otherwise return \"eat-mono\"."
(defun eat--flip-fast-blink-state ()
"Flip the state of rapidly blinking text."
- (declare-function face-remap-add-relative "face-remap"
- (face &rest specs))
- (declare-function face-remap-remove-relative "face-remap" (cookie))
(face-remap-remove-relative eat--fast-blink-remap)
(setq eat--fast-blink-remap
(face-remap-add-relative
@@ -4985,8 +4983,6 @@ return \"eat-color\", otherwise return \"eat-mono\"."
(define-minor-mode eat-blink-mode
"Toggle blinking of text with blink attribute."
:lighter " Eat-Blink"
- (declare-function face-remap-add-relative "face-remap"
- (face &rest specs))
(cond
(eat-blink-mode
(setq eat-blink-mode nil)
@@ -5979,10 +5975,11 @@ PROGRAM can be a shell command."
;;;;; Process Handling.
+(defvar eshell-last-output-start) ; In `esh-mode'.
+(defvar eshell-last-output-end) ; In `esh-mode'.
+
(defun eat--eshell-output-filter ()
"Handle output from subprocess."
- (defvar eshell-last-output-start) ; In `esh-mode'.
- (defvar eshell-last-output-end) ; In `esh-mode'.
(let ((inhibit-quit t) ; Don't disturb!
(inhibit-read-only t)
(str (buffer-substring-no-properties
@@ -6029,8 +6026,6 @@ PROGRAM can be a shell command."
(defun eat--eshell-cleanup ()
"Cleanup everything."
- (defvar eshell-last-output-start) ; In `esh-mode'.
- (defvar eshell-last-output-end) ; In `esh-mode'.
(when eat--terminal
(let ((inhibit-read-only t))
(goto-char (eat-term-end eat--terminal))
@@ -6049,9 +6044,10 @@ PROGRAM can be a shell command."
(eat--eshell-char-mode -1)
(setq buffer-read-only nil))))
+(declare-function eshell-output-filter "esh-mode" (process string))
+
(defun eat--eshell-process-output-queue (process buffer)
"Process the output queue on BUFFER from PROCESS."
- (declare-function eshell-output-filter "esh-mode" (process string))
(when (buffer-live-p buffer)
(with-current-buffer buffer
(when eat--process-output-queue-timer
@@ -6089,9 +6085,10 @@ PROGRAM can be a shell command."
#'eat--eshell-process-output-queue process
(current-buffer))))))))
+(declare-function eshell-sentinel "esh-proc" (proc string))
+
(defun eat--eshell-sentinel (process message)
"Process status message MESSAGE from PROCESS."
- (declare-function eshell-sentinel "esh-proc" (proc string))
(when (buffer-live-p (process-buffer process))
(with-current-buffer (process-buffer process)
(cl-letf* ((process-send-string
@@ -6208,6 +6205,11 @@ sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(kill-local-variable 'eat--output-queue-first-chunk-time)
(kill-local-variable 'eat--process-output-queue-timer))))
+(declare-function eshell-gather-process-output "esh-proc"
+ (command args))
+(defvar eshell-variable-aliases-list) ; In `esh-var'.
+(defvar eshell-last-async-procs) ; In `esh-cmd'.
+
;;;###autoload
(define-minor-mode eat-eshell-mode
"Toggle Eat terminal emulation is Eshell."
@@ -6263,10 +6265,6 @@ sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(down-mouse-3 . eat-eshell-char-mode)))))
"]")))))))
:group 'eat-ehell
- (defvar eshell-variable-aliases-list) ; In `esh-var'.
- (defvar eshell-last-async-procs) ; In `esh-cmd'.
- (declare-function eshell-gather-process-output "esh-proc"
- (command args))
(cond
(eat-eshell-mode
(let ((buffers nil))
@@ -6326,6 +6324,8 @@ sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
;;;; Eshell Visual Command Handling.
+(defvar eshell-destroy-buffer-when-process-dies) ; In `em-term'.
+
;; Adapted from `em-term'.
(defun eat--eshell-visual-sentinel (proc _msg)
"Clean up the buffer visiting PROC.
@@ -6334,7 +6334,6 @@ If `eshell-destroy-buffer-when-process-dies' is non-nil,
destroy
the buffer.
MSG describes PROC's status."
- (defvar eshell-destroy-buffer-when-process-dies) ; In `em-term'.
(when eshell-destroy-buffer-when-process-dies
(let ((proc-buf (process-buffer proc)))
(when (and proc-buf (buffer-live-p proc-buf)
@@ -6347,15 +6346,16 @@ MSG describes PROC's status."
(switch-to-buffer buf)))
(kill-buffer proc-buf)))))
+(defvar eshell-interpreter-alist) ; In `esh-ext'.
+(declare-function eshell-find-interpreter "esh-ext"
+ (file args &optional no-examine-p))
+(declare-function eshell-stringify-list "esh-util" (args))
+
(defun eat--eshell-exec-visual (&rest args)
"Run the specified PROGRAM in a terminal emulation buffer.
ARGS are passed to the program. At the moment, no piping of input is
allowed."
- (declare-function eshell-find-interpreter "esh-ext"
- (file args &optional no-examine-p))
- (declare-function eshell-stringify-list "esh-util" (args))
- (defvar eshell-interpreter-alist) ; In `esh-ext'.
(require 'esh-ext)
(require 'esh-util)
(let* ((eshell-interpreter-alist nil)
@@ -6384,12 +6384,13 @@ allowed."
(eat-semi-char-mode)))
nil)
+(declare-function eshell-exec-visual "em-term" (&rest args))
+
;;;###autoload
(define-minor-mode eat-eshell-visual-command-mode
"Toggle running Eshell visual commands with Eat."
:group 'eat-eshell
:global t
- (declare-function eshell-exec-visual "em-term" (&rest args))
(if eat-eshell-visual-command-mode
(advice-add #'eshell-exec-visual :override
#'eat--eshell-exec-visual)
@@ -6398,6 +6399,9 @@ allowed."
;;;; Project Integration.
+(declare-function project-root "project" (project))
+(declare-function project-prefixed-buffer-name "project" (mode))
+
;;;###autoload
(defun eat-project (&optional arg)
"Start Eat in the current project's root directory.
@@ -6411,8 +6415,6 @@ With a numeric prefix ARG (like \\[universal-argument] 42
\\[eshell]),
switch to the session with that number, or create it if it doesn't
already exist."
(interactive "P")
- (declare-function project-root "project" (project))
- (declare-function project-prefixed-buffer-name "project" (mode))
(require 'project)
(let* ((default-directory (project-root (project-current t)))
(eat-buffer-name (project-prefixed-buffer-name "eat")))
- [nongnu] elpa/eat a736f08ea9 02/15: Prefer 'and-let*' and 'when-let*' over 'when-let', (continued)
- [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, 2022/11/29
- [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 <=
- [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