Commit graph

192 commits

Author SHA1 Message Date
Akib Azmain Turja
5314be930e
* eat.el (eat): Use buffer name for process name 2022-12-28 21:46:27 +06:00
Akib Azmain Turja
e66cca3341
* eat.el (eat-eshell-exec-hook): Make customizable 2022-12-28 21:41:47 +06:00
Akib Azmain Turja
dcbe6b861e
* eat.el (eat-exec-hook): Make customizable 2022-12-28 21:41:11 +06:00
Akib Azmain Turja
328c9d629d
Run eat-eshell-exec-hook as Eshell process is run
* eat.el (eat--eshell-setup-proc-and-term): Run
'eat-eshell-exec-hook' at the very end.
2022-12-28 21:35:39 +06:00
Akib Azmain Turja
a4b20341b3
Don't let font-lock to mess up text face
* eat.el (eat--t-repeated-insert, eat--t-write)
(eat--t-fix-partial-multi-col-char): Add 'font-lock-face' text
property along with 'face' to stop font-lock from removing the
face.
2022-12-22 20:27:50 +06:00
Akib Azmain Turja
fcc02df105
; Release version 0.3.1
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2022-12-21 01:42:43 +06:00
Akib Azmain Turja
764b075255
Fix terminfo path on case-insensitive filesystems
* eat.el (eat--terminfo-path): New variable.
* eat.el (eat-term-terminfo-directory): Change default value to
'PACKAGE-ROOT/terminfo/'.
* Makefile (terminfo): Don't depend on other targets.  Make
directory 'terminfo'.  Write terminfo to both 'e' and
'65' (hexadecimal number of ASCII 'e') directories.
* Makefile (e/eat-mono e/eat-color eat-256color e/eat-truecolor):
Remove target.
* README.org (Quelpa): Update recipe.
2022-12-21 01:05:36 +06:00
Akib Azmain Turja
627458cdd5
* eat.el (eat--t-handle-output): Fix NULL handling 2022-12-20 17:02:53 +06:00
Akib Azmain Turja
877a188021
; * eat.el (eat-eshell-mode): Fix docstring typo 2022-12-19 11:31:56 +06:00
Akib Azmain Turja
dfa7e02557
Fix typo in 'eat--t-scroll-up'
* eat.el (eat--t-scroll-up): Replace 'scroll-begin' with
'scroll-end' in '(< scroll-end (eat--t-disp-width disp))',
since this will always evaluate to t, and thus it was most
probably a typo.
2022-12-17 16:12:17 +06:00
Akib Azmain Turja
ab0ac1ff76
Make sure symbol is used as face parameter value
* eat.el (eat-term-set-parameter): Make sure face parameter
values are symbols.
2022-12-17 16:11:18 +06:00
Akib Azmain Turja
d87392e571
; Release version 0.3
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2022-12-17 01:11:42 +06:00
Akib Azmain Turja
9ca45b4bcd
Allow changing terminal faces terminal-locally
* eat.el (eat--t-term): New slots: bold-face, faint-face,
italic-face, slow-blink-face, fast-blink-face, color-0-face,
color-faces, font-faces.  Use hash table for 'params' slot.
* eat.el (eat--t-set-sgr-params): Use new slot instead using
the faces directly.
* eat.el (eat-term-parameter): Update to work with 'params'
hash table.
* eat.el (eat-term-set-parameter): Update to work with 'params'
hash table.  Handle the following parameters specially:
bold-face, faint-face, italic-face, slow-blink-face,
fast-blink-face, color-0-face, color-1-face, ...,
color-255-face, font-0-face, font-1-face, ..., font-9-face.
2022-12-16 23:21:50 +06:00
Akib Azmain Turja
59fe724b27
Decoding UTF-8 encoded strings encoded as base64
* eat.el (eat--t-set-cwd): Decoding UTF-8 encoded strings encoded as
base64.
* eat.el (eat--t-manipulate-selection): Use 'ignore-errors'
instead of '(ignore-error ...)', since both macro expand to the
same code.
* eat.el (eat--t-set-cmd): Decoding UTF-8 encoded strings encoded as
base64.  Use 'when-let*' instead of 'when' nested in 'let'.
2022-12-16 14:48:24 +06:00
Akib Azmain Turja
61695d9671
Decrease regexp usage while parsing output
* eat.el (eat--t-handle-output): Don't use regular expressions
while parsing plain text and CSI sequences.  Remove useless
code from VT300-specific charset set sequence parser.
2022-12-15 20:18:04 +06:00
Akib Azmain Turja
f912425fb4
Fix handling non-interactive processes in Eshell
* eat.el (eat--eshell-adjust-make-process-args): Check whether
the process going to be run will be interactive process.
* eat.el: Declare function 'eshell-interactive-output-p'.a
2022-12-15 18:57:55 +06:00
Akib Azmain Turja
e597bcfbb2
Don't use '.*-char-property-.*' functions
* eat.el (eat--t-move-before-to-safe): Use
'previous-single-property-change' instead of
'(previous-single-char-property-change'.
* eat.el (eat--t-join-long-line): Use 'get-text-property'
instead of 'get-char-property'.  Handle properly the case where
'next-single-property-change' returns nil.
* eat.el (eat--t-fix-partial-multi-col-char): Handle properly
the case where 'next-single-property-change' returns nil.
2022-12-15 13:52:08 +06:00
Akib Azmain Turja
559c9c362c
Refactor 'eat--eshell-adjust-make-process-args'
* eat.el (eat--eshell-adjust-make-process-args): Move the
'add-hook' out of 'unwind-protect'.
2022-12-15 13:00:06 +06:00
Akib Azmain Turja
162ec61f3d
Remove invisible spaces when killing text
* eat.el (eat-term-filter-string): Remove invisible spaces
preceding multi-column width characters.
* eat.el (eat--t-join-long-line)
(eat--t-fix-partial-multi-col-char): Use
'next-single-property-change' instead of
'next-single-char-property-change'.
2022-12-15 12:41:27 +06:00
Akib Azmain Turja
35df1bc2a4
Refactor 'eat--eshell-adjust-make-process-args'
* eat.el (eat--eshell-adjust-make-process-args): Avoid
unnecessary function overrides.  Overriding functions with
'cl-letf*' is not well documented, and self-overriding a
function (override a function with its own definition) may not
a nop.
2022-12-14 14:32:03 +06:00
Akib Azmain Turja
fc195410e4
Ask if 'stty' is unavailable in Eshell
* eat.el (eat-eshell-fallback-if-stty-not-available): New user
option.
* eat.el (eat--eshell-adjust-make-process-args): If 'stty' is
not available, use 'eat-eshell-fallback-if-stty-not-available'
to determine whether to continue terminal emulation or not.
2022-12-14 14:12:34 +06:00
Akib Azmain Turja
8fce5fe928
; Release version 0.2.3
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2022-12-13 23:45:55 +06:00
Akib Azmain Turja
fd9e8fddc3
Fix shell prompt navigation
* eat.el (eat--post-prompt): Set 'eat--shell-prompt-begin' to
nil at the very end to ensure prompt end text properties are
put.
2022-12-12 14:13:36 +06:00
Akib Azmain Turja
f2d57e2086
Synchronize scroll on all windows showing terminal
* eat.el (eat--synchronize-scroll-windows): New function.
* eat.el (eat--synchronize-scroll)
(eat--eshell-synchronize-scroll): Take a single argument,
WINDOWS, list of windows to synchronize.  The special value
'buffer' can also be included, to synchronize the point in
buffer.
* eat.el (eat-self-input, eat-yank, eat-yank-from-kill-ring):
Pass the return value of 'eat--synchronize-scroll-windows' to
the function in 'eat--synchronize-scroll-function'.
* eat.el (eat--process-output-queue)
(eat--adjust-process-window-size, eat--eshell-output-filter)
Call 'eat--synchronize-scroll-windows' before doing anything,
save the result, and pass it as the first argument to the
function in 'eat--synchronize-scroll-function'.
* eat.el (eat--trace-replay-eval): Pass the return value of
'get-buffer-window-list' to 'eat--synchronize-scroll'.
2022-12-12 14:00:57 +06:00
Akib Azmain Turja
f76c27cd93
Don't intercept background processes in Eshell
* eat.el (eat--eshell-adjust-make-process-args): Don't do any
change to the environment if 'eshell-current-subjob-p' is
non-nil.
2022-12-12 10:26:39 +06:00
Akib Azmain Turja
6756e72d88
; Release version 0.2.2
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2022-12-11 19:45:48 +06:00
Akib Azmain Turja
fffca2c06e
Check whether 'yank-transform-functions' is bound
* eat.el (eat-yank, eat-yank-from-kill-ring): Check whether
'yank-transform-functions' is bound before using it's value.
The variable is not available in Emacs 28.
2022-12-11 18:40:27 +06:00
Akib Azmain Turja
917464cf56
* eat.el (eat-eshell-emacs-mode-map): Disable undo 2022-12-11 14:44:01 +06:00
Akib Azmain Turja
aa0607e1cb
Use Eshell "emacs" mode map when process is live
* eat.el (eat-eshell-emacs-mode-map): Update docstring.
* eat.el (eat--eshell-process-running-mode): New
non-interactive minor mode.
* eat.el (eat--eshell-setup-proc-and-term): Enable
'eat--eshell-process-running-mode'.
* eat.el (eat--eshell-cleanup): Disable
'eat--eshell-process-running-mode'.
* eat.le (eat--eshell-local-mode): Don't use
'eat-eshell-emacs-mode-map' as the mode keymap.
2022-12-11 14:41:38 +06:00
Akib Azmain Turja
7891cae44b
Synchronize scrolling and point properly
* eat.el (eat--synchronize-scroll)
(eat--eshell-synchronize-scroll): Call 'set-window-point' in
addition to 'goto-char'.
2022-12-11 14:10:25 +06:00
Akib Azmain Turja
ab52caff52
; Release version 0.2.1
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2022-12-11 00:43:49 +06:00
Akib Azmain Turja
f54af22d6a
Fix invoking commands with eshell/sudo from Tramp
* eat.el (eat--eshell-adjust-make-process-args): Override
'start-file-process' on Emacs 28, used by Eshell on Emacs 28.
Don't override 'make-process' on Emacs 28, Eshell doesn't use
that on Emacs 28.  Set process filter and sentinel in
'eshell-exec-hook' instead of 'make-process' advice.
2022-12-11 00:39:08 +06:00
Akib Azmain Turja
714d9738cc
Fix Eshell working directory tracking
* eat.el (eat--eshell-local-mode): Call
'eat--eshell-update-cwd'.
* eat.el (eat-eshell-mode): Don't call
'eat--eshell-update-cwd'.
2022-12-11 00:20:05 +06:00
Akib Azmain Turja
b6caebb0ab
; Release 0.2
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update with new entries.
2022-12-10 17:43:47 +06:00
Akib Azmain Turja
51eebc562b
Fix yanking text into terminal
* eat.el (eat-yank): Use simpler, saner and better approach to get the
yanked string instead of the previous stupid, insane and buggy
approach.
* eat.el (eat-yank-pop): Remove, because it's not cancel the text
already sent to the terminal.
* eat.el (eat-yank-from-kill-ring): New function.  Behaves essentially
the same the previous (not properly working) 'eat-yank-pop'.
* eat.el (eat-semi-char-mode-map, eat-eshell-semi-char-mode-map):
Replace 'eat-yank-pop' with 'eat-yank-from-kill-ring'.
2022-12-10 15:51:04 +06:00
Akib Azmain Turja
12a5fb72b2
; * eat.el (eat--t-term): Fix 'params' docstring 2022-12-10 13:27:58 +06:00
Akib Azmain Turja
978aff9166
Implement terminal parameters
* eat.el (eat--t-term): New slot: 'params'.
* eat.el (eat-term-parameter): New function and generalized
variable.
* eat.el (eat-set-term-parameter): New function.
2022-12-10 02:14:28 +06:00
Akib Azmain Turja
f047b2d283
Fix terminal color reporting in text terminals
* eat.el (eat--t-report-foreground-color): Fix foreground color
reporting in text terminals.
* eat.el (eat--t-report-background-color): Fix background color
reporting in text terminals.
2022-12-09 20:44:08 +06:00
Akib Azmain Turja
b996bffa4b
Break combined 'setq'/'setf'/'setq-local's
When giving more than two arguments to 'setq', it becomes hard
to figure out what is assigned to what.  As the number of
argument increases, the readablity of code decreases.  This is
also true for 'setq-local'.  For 'setf', the problem is even
greater, unlike 'setq', all arguments to 'setf' look the same.

* eat.el (eat--t-reset, eat--t-write, eat--t-save-cur)
(eat--t-restore-cur, eat--t-enable-alt-disp)
(eat--t-disable-alt-disp, eat--t-change-scroll-region)
(eat--t-set-sgr-params, eat--t-manipulate-selection)
(eat--t-resize, eat--blink-start-timers, eat-blink-mode)
(eat--cursor-blink-mode, eat--set-cursor, eat-self-input)
(eat-mode, eat-exec, eat--eshell-setup-proc-and-term)
(eat--eshell-cleanup, eat--eshell-adjust-make-process-args)
(eat--eshell-local-mode, eat--eshell-exec-visual)
(eat--trace-exec, eat--trace-eshell-adjust-make-process-args)
(eat--trace-replay-eval, eat-trace-replay, eat-trace--cleanup):
Break combined 'setq'/'setf'/'setq-local's.
2022-12-08 18:04:56 +06:00
Akib Azmain Turja
2207109d24
; * eat.el (eat-term-color-.*): Fix docstring 2022-12-08 17:36:54 +06:00
Akib Azmain Turja
980265ac05
Don't 'cd' as root when using 'sudo' from Tramp
* eat.el (eat--eshell-setup-proc-and-term): Don't set
'eat--eshell-invocation-directory'.
* eat.el (eat--eshell-update-cwd): New function.
* eat.el (eat--eshell-local-mode): Call
'eat--eshell-update-cwd' when enabling the mode and add it to
'eshell-directory-change-hook' to keep track of Eshell's
working directory.
2022-12-08 17:00:12 +06:00
Akib Azmain Turja
856d429f2d
Fix prompt annotation bug trigger when shell exits
* eat.el (eat--correct-shell-prompt-mark-overlays): Make sure
'eat--terminal' is non-nil.
* eat.el (eat--sentinel): Cancel timers, correct shell prompt
annotations for the final time, reset shell prompt annotation
related local variables.
2022-12-08 15:58:20 +06:00
Akib Azmain Turja
58fd1b1196
Synchronize scrolling only when point is on cursor
* eat.el (eat--adjust-process-window-size): Synchronize
scrolling only when point is on cursor.
2022-12-07 15:38:47 +06:00
Akib Azmain Turja
ebc77efd0f
Escape control characters in trace output
* eat.el (eat--trace-log): Escape control
characters (codepoints from 0 to 31) in trace output.
2022-12-07 15:34:14 +06:00
Akib Azmain Turja
e6a7deafd0
Auto update 'eat-term-shell-integration-directory'
* eat.el: Auto update 'eat-term-shell-integration-directory' if
not modified.
2022-12-07 13:17:37 +06:00
Akib Azmain Turja
e05931d7e9
Document annotation correction delay user option
* eat.texi (Performance Tuning): Document the purpose and the
use of 'eat-shell-prompt-annotation-correction-delay' user
option.
2022-12-07 12:00:41 +06:00
Akib Azmain Turja
2ea84e0a34
Don't accept 'nil' as annotation correction delay
* eat.el (eat-shell-prompt-annotation-correction-delay): Don't
accept 'nil'.
* eat.el (eat--process-output-queue): Don't accept value 'nil'
for 'eat-shell-prompt-annotation-correction-delay'.
2022-12-07 11:17:20 +06:00
Akib Azmain Turja
a65b7bc064
Rename some symbols to reflect their purposes
* eat.el (eat-shell-prompt-annotation-delay): Rename to
'eat-shell-prompt-annotation-correction-delay'.
* eat.el (eat--update-shell-prompt-mark-overlays): Rename to
'eat--correct-shell-prompt-mark-overlays'.
* eat.el (eat--shell-prompt-annotation-update-timer): Rename to
'eat--shell-prompt-annotation-correction-timer'.
* eat.el (eat-mode, eat--process-output-queue, eat--filter):
Update references to renamed symbols.
2022-12-07 11:06:44 +06:00
Akib Azmain Turja
62a09caef1
* eat.el (eat--t-term): Fix initial value of 'cwd' 2022-12-07 00:11:29 +06:00
Akib Azmain Turja
b42687f146
Fix prompt navigation when annotation is disabled
* eat.el (eat--pre-prompt): Always set
'eat--shell-prompt-begin'.
* eat.el (eat--post-prompt): Always put special prompt end
marking text property.
2022-12-06 22:57:47 +06:00