;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:40:32 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/eshell/em-smart.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`em-smart.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\305\306\307\310\311\312\313&	\207" [provide em-smart custom-declare-group eshell-smart nil "This module combines the facility of normal, modern shells with\nsome of the edit/review concepts inherent in the design of Plan 9's\n9term.  See the docs for more details.\n\nMost likely you will have to turn this option on and play around with\nit to get a real sense of how it works." :tag "Smart display of output" :link (info-link "(eshell)Smart display of output") :group eshell-module] 10)
#@59 *A list of functions to call when loading `eshell-smart'.
(custom-declare-variable 'eshell-smart-load-hook ''(eshell-smart-initialize) '(#$ . -1152) :type 'hook :group 'eshell-smart)
#@56 *A hook that gets run when `eshell-smart' is unloaded.
(custom-declare-variable 'eshell-smart-unload-hook '(list #'(lambda nil (remove-hook 'window-configuration-change-hook 'eshell-refresh-windows))) '(#$ . -1341) :type 'hook :group 'eshell-smart)
#@480 *If t, always review commands.
Reviewing means keeping point on the text of the command that was just
invoked, to allow corrections to be made easily.

If set to nil, quick commands won't be reviewed.  A quick command is a
command that produces no output, and exits successfully.

If set to `not-even-short-output', then the definition of "quick
command" is extended to include commands that produce output, iff
that output can be presented in its entirely in the Eshell window.
(custom-declare-variable 'eshell-review-quick-commands 'nil '(#$ . -1597) :type '(choice (const :tag "No" nil) (const :tag "Yes" t) (const :tag "Not even short output" not-even-short-output)) :group 'eshell-smart)
#@70 *A list of commands which cause Eshell to jump to the end of buffer.
(custom-declare-variable 'eshell-smart-display-navigate-list ''(insert-parentheses mouse-yank-at-click mouse-yank-secondary yank-pop yank-rectangle yank) '(#$ . -2296) :type '(repeat function) :group 'eshell-smart)
#@827 *If non-nil, space will go to end of buffer when point-max is visible.
That is, if a command is running and the user presses SPACE at a time
when the end of the buffer is visible, point will go to the end of the
buffer and smart-display will be turned off (that is, subsequently
pressing backspace will not cause the buffer to scroll down).

This feature is provided to make it very easy to watch the output of a
long-running command, such as make, where it's more desirable to see
the output go by than to review it afterward.

Setting this variable to nil means that space and backspace will
always have a consistent behavior, which is to move back and forth
through displayed output.  But it also means that enabling output
tracking requires the user to manually move point to the end of the
buffer using \[end-of-buffer].
(custom-declare-variable 'eshell-smart-space-goes-to-end 't '(#$ . -2587) :type 'boolean :group 'eshell-smart)
#@113 *This variable indicates where point should jump to after a command.
The options are `begin', `after' or `end'.
(custom-declare-variable 'eshell-where-to-jump ''begin '(#$ . -3531) :type '(radio (const :tag "Beginning of command" begin) (const :tag "After command word" after) (const :tag "End of command" end)) :group 'eshell-smart)
(byte-code "\301B\304\301!\204\f \305\302B\304\302!\204 \305\303B\304\303!\204$ \305\305\207" [current-load-list eshell-smart-displayed eshell-smart-command-done eshell-currently-handling-window boundp nil] 2)
#@29 Setup Eshell smart display.
(defalias 'eshell-smart-initialize #[nil "?\205h \302\303!\304L\210\302\305!\304L\210\302\306!\307L\210\310\311!\210\312\311\313\304\307$\210\312\314\315\"\210\310\316!\210\312\316\315\307\211$\210\310\317!\210\310\320!\210\312\320\321\304\307$\210\310\322!\210\312\322\323\304\307$\210\302\324!\210\310\325!\210\312\325\326\307\211$\210	\307=?\205h \312\325\327\304\307$\207" [eshell-non-interactive-p eshell-review-quick-commands make-local-variable eshell-scroll-to-bottom-on-output nil eshell-scroll-to-bottom-on-input eshell-scroll-show-maximum-output t make-local-hook window-scroll-functions add-hook eshell-smart-scroll-window window-configuration-change-hook eshell-refresh-windows eshell-output-filter-functions pre-command-hook after-change-functions eshell-disable-after-change eshell-input-filter-functions eshell-smart-display-setup eshell-smart-command-done eshell-post-command-hook #[nil "\301\211\207" [eshell-smart-command-done t] 2] eshell-smart-maybe-jump-to-end] 5 (#$ . 4091)])
#@45 Scroll the given Eshell window accordingly.
(defalias 'eshell-smart-scroll-window #[(wind start) "?\205 \304\211\305 \306\216\307!\210\310 ,\207" [eshell-currently-handling-window inhibit-point-motion-hooks save-selected-window-window wind t selected-window ((byte-code "\301!\203\n \302!\210\301\207" [save-selected-window-window window-live-p select-window] 2)) select-window eshell-smart-redisplay] 2 (#$ . 5127)])
#@37 Refresh all visible Eshell buffers.
(defalias 'eshell-refresh-windows #[(&optional frame) "\303\304\305\306	#\210\205 \303\307\310\311\217))\207" [affected frame window-scroll-functions nil walk-windows #[(wind) "r\304!q\210	\205 \305\306\307 \"\210\310\211))\207" [wind eshell-mode window-scroll-functions affected window-buffer nil eshell-smart-scroll-window window-start t] 3] 0 #1=#:G97287 (byte-code "\300\301\211\"\207" [sit-for 0] 3) ((error))] 4 (#$ . 5559)])
#@66 Set the point to somewhere in the beginning of the last command.
(defalias 'eshell-smart-display-setup #[nil "\304=\203\f 	b\210\2027 \305=\203& \306	\307\"b\210`\n\310ZU\2037 \311u\210\2027 \312=\2033 \nSb\210\2027 \313\314!\210\311\315\316\317\311\320$\210\321 \207" [eshell-where-to-jump eshell-last-input-start eshell-last-input-end eshell-smart-command-done begin after next-single-property-change arg-end 2 nil end error "Invalid value for `eshell-where-to-jump'" add-hook pre-command-hook eshell-smart-display-move t eshell-refresh-windows] 5 (#$ . 6042)])
#@62 Disable smart display mode if the buffer changes in any way.
(defalias 'eshell-disable-after-change #[(b e l) "\205 \301\302\303\304#\210\305\211\207" [eshell-smart-command-done remove-hook pre-command-hook eshell-smart-display-move t nil] 4 (#$ . 6616)])
#@154 Jump to the end of the input buffer.
This is done whenever a command exits sucessfully and both the command
and the end of the buffer are still visible.
(defalias 'eshell-smart-maybe-jump-to-end #[nil "\305U\205) 	\306=\203 \307d!\205) \307\n!\202 \310\f\"\305U\205) db\210\311\312\313\314#\207" [eshell-last-command-status eshell-review-quick-commands eshell-last-input-start eshell-last-input-end eshell-last-output-end 0 not-even-short-output pos-visible-in-window-p count-lines remove-hook pre-command-hook eshell-smart-display-move t] 4 (#$ . 6882)])
#@46 Display as much output as possible, smartly.
(defalias 'eshell-smart-redisplay #[nil "m\203 \212\304\305!\210\306\307\310\217)\207`\311	>\203+ `\nY\203+ `W\203+ \312\313 \314 \315#\210\316d!\205K \212db\210\304\305!\210\316!?\205J b\210\312\313 \314 \315#))\207" [top-point pre-command-hook eshell-last-input-start eshell-last-input-end recenter -1 #1=#:G97288 (byte-code "\300\301\211\"\207" [sit-for 0] 3) ((error)) eshell-smart-display-move set-window-start selected-window line-beginning-position t pos-visible-in-window-p] 4 (#$ . 7448)])
#@47 Like `end-of-buffer', but do not push a mark.
(defalias 'eshell-smart-goto-end #[nil "db\207" [] 1 (#$ . 8003) nil])
#@59 Handle self-inserting or movement commands intelligently.
(defalias 'eshell-smart-display-move #[nil "\306	\204 `\nV\203 `W\204 `\fY\203 \307\202\243 \310=\203Q \311=\203I \203D \203D \312d!\204? \313\202\243 \314\202\243 \313\202\243 \307db\210\202\243 \315=\203\205 \316`\nW\203e \317 \210\202\243 \312\n!\203v \320\321\322\217\210\317 \210\202\243 \323 \210\312!\203\243 \317 \210\202\243 >\204\236 \324=\203\243 `\nY\203\236 `W\204\243 \307db\210\205\254 \325\326\327\307#)\207" [clear current-prefix-arg eshell-last-input-start eshell-last-input-end eshell-last-output-end this-command nil t self-insert-command 32 pos-visible-in-window-p scroll-up eshell-smart-goto-end delete-backward-char ignore eshell-show-output #1=#:G97289 (scroll-down) ((error)) scroll-down eshell-send-input remove-hook pre-command-hook eshell-smart-display-move last-command-char eshell-smart-space-goes-to-end eshell-current-command eshell-smart-display-navigate-list] 4 (#$ . 8126)])
