Commit graph

192 commits

Author SHA1 Message Date
Akib Azmain Turja
918aaa3593
; eat.el (eat-default-shell,eat-tramp-shells): Fix 2024-02-04 10:45:45 +06:00
Akib Azmain Turja
77bc6d7acc
Allow customizing the default shell
* eat.el (eat-default-shell-function, eat-shell)
(eat-tramp-shells): New user option.
* eat.el (eat-default-shell): New function.
* eat.el (eat--1, eat): Call the function specified in
'eat-default-shell-function' to get the default shell.
* eat.texi (Changing Shell): New chapter.
2024-01-04 12:00:46 +06:00
Akib Azmain Turja
2708a00ecb
* eat.el (eat-line-mode-map): Bind 'xterm-paste' 2024-01-01 21:37:10 +06:00
Akib Azmain Turja
c91451f2d1
; Release version 0.9.4
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2023-12-15 22:27:53 +06:00
Akib Azmain Turja
8fe46079df
Don't let automatic scrolling mess up the display
* eat.el (eat-mode, eat--eshell-local-mode): Set both
'scroll-margin' and 'hscroll-margin' to zero.
2023-12-15 22:24:52 +06:00
Akib Azmain Turja
440b816f8e
Don't queue input
* eat.el (eat--pending-input-chunks)
(eat--defer-input-processing, eat--process-input-queue-timer):
Remove.
All references updated.
* eat.el (eat--send-input): Send the input immediately.
* eat.el (eat--process-input-queue): Remove.
* eat.el (eat--eshell-process-output-queue)
(eat--process-output-queue): Loop while output queue isn't
empty, set 'eat--output-queue-first-chunk-time' to 't' in the
loop.
* eat.el (eat--filter, eat--eshell-filter): Don't start a timer
if 'eat--output-queue-first-chunk-time' is 't'.
2023-10-26 13:58:24 +06:00
Akib Azmain Turja
c890bb240b
; Release version 0.9.3
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2023-10-19 00:14:16 +06:00
Akib Azmain Turja
ab479f9c27
Fix input processing & auto line mode
* eat.el (eat--process-input-queue): Set
'eat--process-input-queue-timer' to 'nil'.
* eat.el (eat--auto-line-mode-pending-toggles): New variable.
* eat.el (eat--line-mode-enter-auto-1): Don't take any
argument.
* eat.el (eat--line-mode-exit-auto-1): Don't take any argument.
Don't call 'eat-line-mode'.
* eat.el (eat--line-mode-enter-auto, eat--line-mode-exit-auto):
Queue the toggle in 'eat--auto-line-mode-pending-toggles'
instead of starting a timer.
* eat.el (eat--line-mode-do-toggles): New function.
* eat.el (eat--process-output-queue): Let-bind
'eat--auto-line-mode-pending-toggles' to nil.  Call
'eat--line-mode-do-toggles'.
2023-10-17 19:50:30 +06:00
Akib Azmain Turja
187e18a24a
Fix compiler warnings
* eat.el: Wrap all 'emacs-major-version' checks with
'eval-when-compile'.
* eat.el (eat--process-input-queue): Don't use obsolete
generalized variable 'buffer-local-value'.
2023-10-17 12:08:02 +06:00
Akib Azmain Turja
e0fa65c225
Don't let 'eat--process-input-queue' to recurse
* eat.el (eat--defer-input-processing): New variable.
* eat.el (eat-mode, eat--eshell-local-mode): Make
'eat--defer-input-processing' buffer-local.
* eat.el (eat--process-input-queue): If
'eat--defer-input-processing' is non-nil, do nothing, otherwise
bind it to non-nil while sending input.
2023-10-17 11:30:50 +06:00
Akib Azmain Turja
d9af04ef82
Don't mess up terminal when switching to line mode
* eat.el (eat--line-mode-enter-auto-1)
(eat--line-mode-exit-auto-1): New function.
* eat.el (eat--line-mode-enter-auto, eat--line-mode-exit-auto):
Do everything after the output is processed.
2023-10-17 11:27:31 +06:00
Akib Azmain Turja
1d7a1ea0b5
Don't flicker due to screen line breaking
* eat.el (eat--eshell-synchronize-scroll)
(eat--synchronize-scroll): Use 'recenter' instead of
'set-window-start' to synchronize scrolling.
2023-10-10 20:10:12 +06:00
Akib Azmain Turja
9d0f612004
Fix side-effect in 'eat--set-term-sixel-params'
* eat.el (eat--set-term-sixel-params): Fix unintended
side-effect.
2023-10-10 00:42:51 +06:00
Akib Azmain Turja
c071e9e5e3
; Release version 0.9.2
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2023-10-10 00:25:12 +06:00
Akib Azmain Turja
3294a118a7
Fix 'eat--set-term-sixel-params' on text display
* eat.el (eat--set-term-sixel-params): Don't error on text
display.
2023-10-10 00:22:19 +06:00
Akib Azmain Turja
5fd39f8bf0
Fix 'eat--eshell-set-input-process' advice
* eat.el (eat--eshell-set-input-process): Take any number of
arguments and ignore them.
2023-10-09 14:03:22 +06:00
Akib Azmain Turja
186cf61945
Make motion commands work properly
* eat.el (eat--line-mode): Set 'front-sticky' and
'rear-nonsticky' text properties to 't' when enabling mode, and
revert them when disabling.
* eat.el (eat--process-output-queue): Don't add 'front-sticky'
and 'rear-nonsticky' text properties if not in line mode.
* eat.el (eat--sentinel): Don't remove 'front-sticky' and
'rear-nonsticky' text properties, they shouldn't be in the
buffer.
2023-10-09 13:35:48 +06:00
Akib Azmain Turja
db63d46739
; Release version 0.9.1
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2023-10-09 00:25:02 +06:00
Akib Azmain Turja
e2fefa6edd
Remove internal text properties when killing text
* eat.el (eat-term-filter-string): Remove 'read-only',
'rear-nonsticky', 'front-sticky' and 'field' text properties.
* eat.el (eat--filter-buffer-substring): Remove
'eat--t-char-width', 'eat--t-sixel-bitmap-size' and
'eat--t-sixel-bitmap' text properties.
2023-10-09 00:11:29 +06:00
Akib Azmain Turja
38ba9a99b0
; Release version 0.9
* eat.el:
* eat.texi:
Bump version.
* ChangeLog: Update.
2023-10-08 12:58:34 +06:00
Akib Azmain Turja
e95a0d2553
; * eat.el: Depend on Emacs 26.1 2023-10-08 12:47:39 +06:00
Akib Azmain Turja
8f61c12ba5
Fix garbage image after the end of Sixel image
* eat.el (eat--t-sixel-init): Increase Sixel buffer size.
2023-10-07 22:16:58 +06:00
Akib Azmain Turja
957fdb4a8f
Support Emacs 26.1
* eat.el: Depend on Emacs 26.1.
* eat.el (eat--t-handle-output, eat--handle-uic)
(eat--eshell-handle-uic): Don't use '(not CHAR)' form in 'rx'
forms.
* eat.el (eat--eshell-process-output-queue): Use
'combine-change-calls' if available.
* README.org: Update to reflect support for Emacs 26.
2023-10-07 20:48:53 +06:00
Akib Azmain Turja
5b965543a0
Modify eshell-variable-aliases-list buffer-locally
* eat.el (eat-eshell-mode): Don't modify
'eshell-variable-aliases-list'.
* eat.el (eat--eshell-local-mode): Modify
'eshell-variable-aliases-list'.
2023-10-07 16:15:13 +06:00
Akib Azmain Turja
0e1af38de9
Support Emacs 27.1
* eat.el: Depend on Emacs 27.1.  Require 'compat' and 'term'.
* eat.el (eat-term-color-*): Inherit 'term-color-*' in Emacs
27.
* eat.el (eat--t-sixel-render-bitmap): Call 'mapconcat' with
three arguments.
* eat.el (eat-yank-from-kill-ring): Signal error in Emacs 27.
* eat.el (eat--eshell-setup-proc-and-term): Don't error if
process mark is invalid.
* eat.el (eat-eshell-mode): Properly revert
'eshell-variable-aliases-list' when disabling the mode.
* eat.el (eat--trace-exec)
(eat--trace-eshell-adjust-make-process-args): Make sure
'lisp-data-mode' is defined before calling.
2023-10-07 15:12:52 +06:00
Akib Azmain Turja
aef8dae61b
Enable shell command completion by default
* eat.el (eat-mode): Use shell mode's completion facilities.
2023-10-06 15:19:58 +06:00
Akib Azmain Turja
85866fdc78
Don't put overlay on prompt while history Isearch
* eat.el (eat--line-history-isearch-message-overlay)
(eat--line-history-isearch-message): Remove.
* eat.el (eat--line-history-isearch-setup)
(eat--line-history-isearch-end): Don't modify
'isearch-message-function'.
* eat.el (eat-mode): Don't make 'isearch-message-function' and
'eat--line-history-isearch-message-overlay' buffer-local.
2023-10-04 17:52:05 +06:00
Akib Azmain Turja
5b3e27a10d
Put the cursor below Sixel image after showing it
* eat.el (eat--t-sixel-cleanup): Make sure the cursor is below
the image.
2023-10-04 17:32:42 +06:00
Akib Azmain Turja
8b3a38c1d5
Apply scaling and ascept ratio on Sixel properly
* eat.el (eat--set-term-sixel-params): Make sure both numbers
of char-dimension is non-zero.
2023-10-03 23:39:22 +06:00
Akib Azmain Turja
94fb36161a
Use terminal parameters to set callback functions
Also make sure the terminal passed as arguments to API
functions is live.

* eat.el (eat--t-term): Update default value of slot 'params'.
* eat.el (eat-term-p, eat-term-live-p): New function.
* eat.el (eat--t-ensure-live-term): New macro.
* eat.el (eat--t-with-env, eat-term-parameter, eat-term-size)
(eat-term-set-parameter, eat-term-cursor-type, eat-term-end)
(eat-term-beginning, eat-term-display-cursor, eat-term-title)
(eat-term-in-alternative-display-p, eat-term-input-event)
(eat-term-send-string, eat-term-send-string-as-yank): Ensure
the terminal passed as argument is live.
* eat.el (eat-term-delete): Ensure the terminal passed as
argument is live.  Mark terminal as deleted.
* eat.el (eat-term-parameters): New function.
* eat.el (eat-term-set-parameter): Handle more special
parameters: 'input-function', 'ring-bell-function',
'grab-mouse-function', 'grab-focus-events-function',
'manipulate-selection-function', 'set-title-function' and
'set-cwd-function'.
* eat.el (eat-term-input-function, eat-term-ring-bell-function)
(eat-term-set-cursor-function, eat-term-grab-mouse-function)
(eat-term-grab-focus-events-function)
(eat-term-manipulate-selection-function)
(eat-term-set-title-function, eat-term-set-cwd-function):
Remove function.
* eat.el (eat-exec, eat--eshell-setup-proc-and-term)
(eat--trace-replay-eval): Update to use parameters.
2023-10-03 22:53:41 +06:00
Akib Azmain Turja
fac3f746cd
Support rendering Sixel with XPM images
* eat.el (eat--t-sixel-render-bitmap): Support conversion to
XPM format.
* eat.el (eat-sixel-render-formats): Add XPM to the default.
* eat.el (eat-term-set-parameter, eat--sixel-render-format):
Support XPM as an allowed format.
* eat.texi (Sixel): Update.
2023-10-03 18:51:24 +06:00
Akib Azmain Turja
f122b16488
Refactor 'eat--t-sixel-flush-line'
* eat.el (eat--t-sixel-render-bitmap): New function.
* eat.el (eat--t-sixel-flush-line): Move bitmap rendering code
to 'eat--t-sixel-render-bitmap'.
2023-10-03 14:47:12 +06:00
Akib Azmain Turja
a78301a2b7
* eat.el (eat-enable-alternative-display): Obsolete 2023-10-02 13:54:28 +06:00
Akib Azmain Turja
852168d716
Allow customizing Sixel scaling and aspect ratio
* eat.el (eat-sixel-scale, eat-sixel-aspect-ratio): New user
option.
* eat.el (eat--t-term): Remove slot 'sixel-image-height'.  New
slot 'sixel-image-extra-props'.
* eat.el (eat--t-sixel-flush-line): Give more control to the UI
on the image properties.
* eat.el (eat-term-set-parameter): Don't treat parameter
'sixel-image-height' specially.  Treat parameter
'sixel-image-extra-properties' specially.
* eat.el (eat--set-term-sixel-params): New function.
* eat.el (eat-exec, eat--eshell-setup-proc-and-term): Set Sixel
related terminal parameters with 'eat--set-term-sixel-params'.
* eat.texi (Sixel): Document 'eat-sixel-scale' and
'eat-sixel-aspect-ratio'.
2023-10-02 13:43:01 +06:00
Akib Azmain Turja
2df07e6613
Support <backtab>
* eat.el (eat-term-input-event): Handle '<tab>' and '<backtab>'
events.
* eat.el (eat-term-make-keymap): Bind '<tab>' and '<backtab>'.
* eat.ti (eat-mono): Add 'kcbt' capability.
2023-09-28 13:34:45 +06:00
Akib Azmain Turja
32bd049d68
Handle output correctly in emacs mode in Eshell
* eat.el (eat--eshell-output-filter): Inhibit read only.
2023-09-27 13:12:09 +06:00
Akib Azmain Turja
7c1dde6f1a
Add command 'eat-send-password'
* eat.el (eat-send-password): New command.
* eat.texi (Password Input): New chapter.
2023-09-24 21:41:41 +06:00
Akib Azmain Turja
1dfca821f5
Add the underlying terminal object to public API
* eat.el (eat--terminal): Rename to 'eat-terminal'.
All references changed.
2023-09-24 21:13:53 +06:00
Akib Azmain Turja
de3d7d099f
New command eat-line-load-input-history-from-file
* eat.el (eat-line-load-input-history-from-file): New command.
2023-09-23 21:57:21 +06:00
Akib Azmain Turja
fe9a128d6c
Integrate Isearch with line mode input history
* eat.el (eat-line-input-history-isearch): New user option.
* eat.el (eat-line-mode-map): Bind 'M-r' to
'eat-line-history-isearch-backward-regexp'.
* eat.el (eat-line-mode): Error if process isn't running.
* eat.el (eat--line-history-isearch-message-overlay)
(eat--saved-line-input-history-isearch): New variable.
* eat.el (eat--line-delete-input): Remove.
All callers changed.
* eat.el (eat-line-history-isearch-backward-regexp)
(eat-line-history-isearch-backward): New command.
* eat.el (eat--line-history-isearch-setup)
(eat--line-history-isearch-end, eat--line-history-isearch-wrap)
(eat--line-history-isearch-search, eat--line-goto-input)
(eat--line-history-isearch-message)
(eat--line-history-isearch-push-state)
(eat--line-history-isearch-pop-state): New function.
* eat.el (eat-mode): Make
'eat--line-history-isearch-message-overlay',
'isearch-search-fun-function', 'isearch-message-function',
'isearch-wrap-function' and 'isearch-push-state-function'
buffer-local.  Add 'eat--line-history-isearch-setup' to
'isearch-mode-hook' locally.
* eat.texi (Line Mode): Document this new feature.
2023-09-23 20:33:30 +06:00
Akib Azmain Turja
a81ccab99a
; * eat.el: Untabify 2023-09-23 16:50:20 +06:00
Akib Azmain Turja
db6c64d029
Move to the input line automatically in line mode
* eat.el (eat-line-auto-move-to-input): New user option.
* eat.el (eat--line-move-to-input): New function.
* eat.el (eat--line-mode): Add/remove 'eat--line-move-to-input'
to 'pre-command-hook' locally.
* eat.texi (Line Mode): Document 'eat-line-auto-move-to-input'.
2023-09-23 12:40:23 +06:00
Akib Azmain Turja
44e9a6f5de
Rename prompt mode to line mode and generalize it
* eat.el: Rename prompt mode to line mode, also rename related
symbols to have 'eat-line-' or 'eat--line-' prefix.
* eat.el (eat-enable-native-shell-prompt-editing): Rename to
'eat-enable-auto-line-mode'.
* eat.el (eat--line-mode-enter-auto)
(eat--line-mode-exit-auto): New function.
* eat.el (eat--post-prompt, eat--post-cont-prompt): Call
'eat--line-mode-enter-auto' to enter line mode.
* eat.el (eat--pre-cmd): Call 'eat--line-mode-exit-auto'.
* eat.el (eat--get-shell-history): Populate input ring
unconditionally.
* eat.el (eat-emacs-mode, eat-semi-char-mode, eat-char-mode):
Call 'eat--line-mode-exit' to exit line mode.
* eat.el (eat--line-mode): Move all logic to 'eat-line-mode',
'eat--line-mode-exit' and 'eat--line-mode-exit-auto'.
* eat.el (eat-line-send): Make non-interactive.  Reset input
history cycling variables.
* eat.el (eat-line-send-input): New argument NO-NEWLINE.
* eat.el (eat-mode): Don't disable undo information recording.
* eat.el (eat--process-output-queue): Disable undo information
recording while process output.
* eat.texi (Line Mode): New section in chapter 'Input Modes'.
* eat.texi (Line Mode Integration): New section in chapter
'Shell Integration'.
* eat.texi (Native Shell Prompt Editing): Remove section.
* README.org (Usage): Avoid the term "keybinding mode", use
"input mode" instead as the manual uses it.  Document line
mode.
* README.org (NonGNU ELPA): Emacs 28 has NonGNU ELPA enabled by
default, so remove unnecessary instructions.
2023-09-23 02:15:45 +06:00
Akib Azmain Turja
3f4d4a9c36
Skip comments in Bash history file
* eat.el (eat--prompt-populate-input-ring): Skip Bash history
comments.
* eat.el: Add Compat as dependency; some functions from Emacs
29 are used.
2023-09-22 15:37:37 +06:00
Akib Azmain Turja
0fe5d5cb9d
Allow customizing Sixel rendering format
* eat.el (eat-sixel-render-formats): New user option.
* eat.el (eat-eshell-fallback-if-stty-not-available): Fix
customization type.
* eat.el (eat--t-term): Rename slot 'sixel-display-method' to
'sixel-render-format'.
All callers changed.
* eat.el (eat--t-sixel-flush-line): New support render format,
'none'.
* eat.el (eat-term-set-parameter): Rename parameter
'sixel-display-method' to 'sixel-render-format'.
All callers changed.
* eat.el (eat--sixel-render-format): New function.
* eat.el (eat-exec, eat--eshell-setup-proc-and-term): Set
'sixel-render-format' according to user customization.
2023-09-18 15:08:32 +06:00
Akib Azmain Turja
b2ad1be411
Add message passing support
* eat.el (eat-message-handler-alist): New user option.
* eat.el (eat--handle-message): New function.
* eat.el (eat--handle-uic, eat--eshell-handle-uic): Handle
message passing sequence.
* eat.texi (Message Passing): New section in chapter "Shell
Integration".
* integration/bash (__eat_enable_integration): Remove the
unnecessary complex code to update PROMPT_COMMAND.
* integration/bash (_eat_msg):
* integration/zsh (_eat_msg):
New function.
2023-09-17 21:58:40 +06:00
Akib Azmain Turja
9e129f33a2
Don't enter prompt mode after exit till new prompt
* eat.el (eat--inhibit-prompt-mode): New variable.
* eat.el (eat--post-prompt, eat--post-cont-prompt): Check
'eat--inhibit-prompt-mode' before switching to prompt mode.
* eat.el (eat--before-new-prompt): New function.
* eat.el (eat--handle-uic): Support "before new prompt"
sequence.
* eat.el (eat-emacs-mode, eat-semi-char-mode, eat-char-mode):
Set 'eat--inhibit-prompt-mode' to t if prompt mode is enabled.
* eat.el (eat-mode): Make 'eat--inhibit-prompt-mode'
buffer-local.
* integration/bash (__eat_prompt_command):
* integration/zsh (__eat_precmd):
Send the "before new prompt" sequence.
2023-09-16 19:13:16 +06:00
Akib Azmain Turja
268d7c57b8
Add history reporting in Zsh integration script
* eat.el (eat--get-shell-history): New argument FORMAT, pass it
to 'eat--prompt-populate-input-ring'.
* eat.el (eat--handle-uic): Accept FORMAT argument in input
history reporting sequence and pass it to
'eat--get-shell-history'.
* eat.el (eat--prompt-populate-input-ring): New argument
FORMAT.  Support Zsh extended history file format.
* integration/bash (__eat_enable_integration): Send "bash" as
the history file format.
* integration/zsh (__eat_enable_integration): Send shell
history.
2023-09-16 18:55:31 +06:00
Akib Azmain Turja
cbce601b8d
Fix input handling in Eshell
* eat.el (eat--eshell-local-mode): Make input processing
variables buffer-local.
2023-09-16 18:29:49 +06:00
Akib Azmain Turja
3fcf128840
; * eat.el (eat-mode): Fix mode line 2023-09-15 11:30:13 +06:00