;ELC ;;; compiled by jwz@thalidomide on Wed Jan 26 14:07:47 1994 ;;; from file /u/jwz/emacs19/lisp/packages/scroll-in-place.el ;;; emacs version 19.9 Lucid. ;;; bytecomp version 2.22; 22-dec-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (provide 'scroll-in-place) (defvar scroll-in-place t "\ *When this variable is true (i.e., non-nil), the standard GNU Emacs vertical scrolling commands scroll-down, scroll-up, and scroll-other-window will attempt to keep point at its current position in the window (window line and column). In other words, point stays \"in place\" within the window. When this variable is nil, the standard GNU Emacs vertical scrolling commands behave as usual. The \"in place\" equivalents, however, are still available as separate commands. This variable may be made buffer-local in order to disable (or enable) \"in place\" scrolling in particular buffers.") (defvar scroll-allow-blank-lines-past-eob nil "\ *When this variable is nil, the \"in place\" scrolling commands will avoid displaying empty lines past the end of the buffer text. In other words, just as you can't see \"dead space\" before the beginning of the buffer text, the \"in place\" scrolling commands try to avoid displaying \"dead space\" past the end of the buffer text. This helps make the most of window real estate. Note that sometimes it is necessary to display \"dead space\" in order to make a previous scrolling action reversible. When this variable is non-nil, the \"in place\" scrolling commands will always allow blank lines to be shown past the end of the buffer.") (defvar scroll-default-lines nil "\ The default number of lines to be scrolled by when a new sequence of \"in place\" scrolling commands begins. Of course, when an explicit number of lines is specified, that explicit number takes precedence. See the documentation for function scroll-window-in-place for more information. If this variable is not bound to a number, then the default number of lines is the height of the window to be scrolled minus next-screen-context-lines. This variable should not be set globally! Commands that want to specify a default scrolling distance should just bind scroll-default-lines temporarily.") (defvar scroll-command-groups nil "\ The explicitly specified \"groups\" of \"in place\" scrolling commands. This variable should be set before or immediately after the \"in place\" scrolling package is loaded, and then not changed after that. Usually, \"in place\" scrolling commands share state (e.g., the number of lines to scroll by) with any and all immediately previous \"in place\" scrolling commands. Sometimes, however, this is undesirable. In these cases the \"in place\" scrolling commands can be divided into groups. A command in a group only shares state with members of its group. Each element of scroll-command-groups is a list that contains all of the members of a unique command group. For example, if there were only one explicit group and that group contained the commands `scroll-down-one-line' and `scroll-up-one-line', then scroll-command-groups would be set to: ((scroll-down-one-line scroll-up-one-line)) Commands that are not in any explicitly specified group are added to a default group. That group is stored in the variable scroll-default-command-group. The \"in place\" scrolling functions assume that all of the scrolling command groups are nonintersecting (i.e., no command is in more than one group) and only contain \"in place\" scrolling commands.") (defvar scroll-default-command-group nil "\ The set of \"in place\" scrolling commands that are not members of any explicitly defined group of commands. This set of commands is an implicitly defined group, constructed as \"in place\" commands are invoked, and members of this group share state among themselves. See the documentation for variable scroll-command-groups for more information.") (defvar scroll-initially-displayed-lines 0 "\ The number of window lines that contained buffer text when the current sequence of \"in place\" scrolling commands started. Unless the variable scroll-in-place-allow-blank-lines-past-eob is true, the \"in place\" scrolling commands ensure that at least this many text lines are visible at all times.") (defvar scroll-previous-window nil "\ The window that was most recently scrolled by an \"in place\" scrolling command.") (defvar scroll-previous-lines 0 "\ The number of window lines that the previous \"in place\" scrolling command attempted to scroll.") (defvar scroll-goal-column 0 "\ The desired horizontal window position for point, used by the \"in place\" scrolling commands.") (defvar scroll-boundary-previous-point nil "\ The value of point before point was moved to a buffer boundary.") (defvar scroll-boundary-previous-lines 0 "\ The number of lines that point moved when it moved to a buffer boundary.") (defvar scroll-boundary-error-command nil "\ The value of this-command when an \"in place\" scrolling command signalled a buffer boundary error. This is used to decide how subsequent scrolling commands should recover from the error.") (defvar scroll-boundary-error-point nil "\ The value of point when an \"in place\" scrolling command signalled a buffer boundary error. This is used to decide how subsequent scrolling commands should recover from the error.") (defvar scroll-window-debt 0 "\ The difference between the number of lines an \"in place\" scrolling command tried to scroll a window and the number of lines that the window actually scrolled. This difference is the \"debt\" in the window's starting position. Subsequent \"in place\" scrolling commands try to make up this debt.") (defconst scroll-pos-visible-bug-p (byte-code " Ž!\"Ȫ\"\"*" [match-data old-match-data ((store-match-data old-match-data)) boundp epoch::version string-match "\\`4\\." emacs-version t "Lucid" "\\`19\\.8\\."] 3) "\ A flag, set when this version of GNU Emacs has a buggy version of the function pos-visible-in-window-p that returns nil when given (point-max) and (point-max) is on the last line of the window. Currently, this flag is set for all versions of Epoch 4 and for Lucid GNU Emacs 19.8.") (fset 'scroll-choose-window #[nil "  =\n\n!\n!)" [selected-window minibuffer-window minibuffer-scroll-window window-point next-window] 3 "\ Choose the window to be scrolled by the commands scroll-down, scroll-up, scroll-down-in-place, and scroll-up-in-place. The rules are simple. If the selected window is not the minibuffer window, then scroll the selected window. When the minibuffer window is selected, either scroll the minibuffer-scroll-window (if it exists) or scroll the next window (otherwise). The minibuffer-scroll-window is usually the window that displays completions."]) (fset 'scroll-down-in-place #[(&optional lines) " \n#" [scroll-window-in-place scroll-choose-window lines -1] 4 "\ Scroll the text of the current window downward by LINES lines, leaving point as close as possible to its current window position (window line and column). In other words, point is left \"in place\" within the window. As a special case, when the current window is the minibuffer window, this command scrolls the minibuffer-scroll-window (which is usually the list of completions) if it exists, or otherwise the next window in the canonical ordering of windows. If LINES is nil, scroll the window by the same amount it was moved by the immediately previous \"in place\" scrolling command, or by scroll-default-lines (usually almost a windowful) if the previous command was not an \"in place\" scrolling command (or when that previous command scrolled some other window, or when other circumstances prevent the previous scrolling distance from being used). If LINES is the symbol -, then the scrolling distance is determined as if LINES had been nil, and then that distance is multiplied by -1. If the window cannot be scrolled by the full distance, point is allowed to stray from its initial position so that it can move the full number of lines. If point cannot move the full number of lines, point is moved to the buffer boundary. Any immediately subsequent \"in place\" scrolling commands will try to restore point to its initial window position." "P"]) (fset 'scroll-up-in-place #[(&optional lines) " \n#" [scroll-window-in-place scroll-choose-window lines 1] 4 "\ Scroll the text of the current window upward by LINES lines, leaving point as close as possible to its current window position (window line and column). In other words, point is left \"in place\" within the window. As a special case, when the current window is the minibuffer window, this command scrolls the minibuffer-scroll-window (which is usually the list of completions) if it exists, or otherwise the next window in the canonical ordering of windows. If LINES is nil, scroll the window by the same amount it was moved by the immediately previous \"in place\" scrolling command, or by scroll-default-lines (usually almost a windowful) if the previous command was not an \"in place\" scrolling command (or when that previous command scrolled some other window, or when other circumstances prevent the previous scrolling distance from being used). If LINES is the symbol -, then the scrolling distance is determined as if LINES had been nil, and then that distance is multiplied by -1. If the window cannot be scrolled by the full distance, point is allowed to stray from its initial position so that it can move the full number of lines. If point cannot move the full number of lines, point is moved to the buffer boundary. Any immediately subsequent \"in place\" scrolling commands will try to restore point to its initial window position." "P"]) (fset 'scroll-other-window-in-place #[(&optional lines) "  =\n\n!\n! =!  #*" [selected-window minibuffer-window minibuffer-scroll-window window-point next-window other-window error "There is no other window." scroll-window-in-place lines 1] 5 "\ Scroll the text of the next window upward by LINES lines, leaving point in that window as close as possible to its current window position (window line and column). In other words, point is left \"in place\" within the window. The next window is the one below the current one, or the one at the top of the screen if the current window is at the bottom of the screen. If LINES is nil, scroll the window by the same amount it was moved by the immediately previous \"in place\" scrolling command, or by scroll-default-lines (usually almost a windowful) if the previous command was not an \"in place\" scrolling command (or when that previous command scrolled some other window, or when other circumstances prevent the previous scrolling distance from being used). If LINES is the symbol -, then the scrolling distance is determined as if LINES had been nil, and then that distance is multiplied by -1. If the window cannot be scrolled by the full distance, point is allowed to stray from its initial position so that it can move the full number of lines. If point cannot move the full number of lines, point is moved to the buffer boundary. Any immediately subsequent \"in place\" scrolling commands will try to restore point to its initial window position. If it is impossible to scroll the text of the window at all (because a buffer boundary is already visible), this command signals a buffer boundary error. The error is signalled even if point could otherwise move the full number of lines." "P"]) (byte-code "!KM!KM!KM" [fboundp original-scroll-down scroll-down original-scroll-up scroll-up original-scroll-other-window scroll-other-window] 2) (fset 'scroll-down #[(&optional lines) " \n#" [scroll-window scroll-choose-window lines -1] 4 "\ Scroll the text of the current window downward by LINES lines. As a special case, when the current window is the minibuffer window, this command scrolls the minibuffer-scroll-window (which is usually the list of completions) if it exists, or otherwise the next window in the canonical ordering of windows. When the variable scroll-in-place is true, this command works just like the command scroll-down-in-place, scrolling the current window and leaving point \"in place\" within the window. See the documentation for scroll-down-in-place for more information. When the variable scroll-in-place is nil, this command invokes the standard GNU Emacs version of scroll-down. In that case, when LINES is nil the current window is scrolled by nearly a complete windowful of text. Note that this command correctly handles cases in which scroll-in-place has a buffer-local value in the window to be scrolled. That value is honored." "P"]) (fset 'scroll-up #[(&optional lines) " \n#" [scroll-window scroll-choose-window lines 1] 4 "\ Scroll the text of the current window upward by LINES lines. As a special case, when the current window is the minibuffer window, this command scrolls the minibuffer-scroll-window (which is usually the list of completions) if it exists, or otherwise the next window in the canonical ordering of windows. When the variable scroll-in-place is true, this command works just like the command scroll-up-in-place, scrolling the current window and leaving point \"in place\" within the window. See the documentation for scroll-up-in-place for more information. When the variable scroll-in-place is nil, this command invokes the standard GNU Emacs version of scroll-up. In that case, when LINES is nil the current window is scrolled by nearly a complete windowful of text. Note that this command correctly handles cases in which scroll-in-place has a buffer-local value in the window to be scrolled. That value is honored." "P"]) (fset 'scroll-other-window #[(&optional lines) "  =\n\n!\n! ! =!q\n)  # !+" [selected-window minibuffer-window minibuffer-scroll-window window-point next-window other-window window-buffer other-window-buffer error "There is no other window." scroll-in-place scroll-window-in-place lines 1 nil scroll-previous-window original-scroll-other-window] 5 "\ Scroll the text of the next window upward by LINES lines. The next window is the one below the current one, or the one at the top of the screen if the current window is at the bottom of the screen. When the variable scroll-in-place is true, this command invokes the command scroll-other-window-in-place to scroll the next window and leave point \"in place\" within that window. See the documentation for scroll-other-window-in- place for more information. When the variable scroll-in-place is nil, this command invokes the standard GNU Emacs version of scroll-other-window. In that case, when LINES is nil the next window is scrolled by nearly a complete windowful of text. Note that this command correctly handles cases in which scroll-in-place has a buffer-local value in the window to be scrolled. That value is honored." "P"]) (fset 'scroll-window-in-place #[(window lines direction) " p! =ȪZ ! !==!= > >!!!܎!:U[UomeWdV`=:=᪁\"\" #Z]_!%&'Ȫ!b S!)*=[_`,-,dU,Se],)\" [!`\")V`ZVW`ZW۫b1[\"U`23!2Ui%\\!2 #3\"WedW8939U3\"2 #3\"8N\"2139b**.ۇ" [t inhibit-quit selected-window original-window original-buffer window-height window minibuffer-window 0 1 scroll-get-command-group this-command this-command-group windowp scroll-previous-window last-command scroll-boundary-error-point window-point scroll-boundary-error-command continue-scroll-p prefix-numeric-value lines lines-value boundp zmacs-region-stays scroll-parse-direction direction nil ((byte-code " !\nq" [select-window original-window original-buffer] 2)) select-window scroll-previous-lines scroll-boundary-previous-point - -1 scroll-default-lines next-screen-context-lines scroll-determine-goal-column scroll-goal-column scroll-window-debt scroll-allow-blank-lines-past-eob window-start vertical-motion scroll-initially-displayed-lines pos-visible-in-window-p point scroll-pos-visible-bug-p 2 set-window-start scroll-set-window-start scroll-boundary-previous-lines moved initial-point move-to-column scroll-signal-boundary-error beginning-of-buffer end-of-buffer boundary-symbol boundary-point message "%s" error-message] 5 "\ Scroll WINDOW vertically by the given number of window LINES in the given DIRECTION, leaving the window's point as close as possible to its original window position (window line and column). In other words, the window's point is left \"in place\" within the window. Note that the window to be scrolled does not have to be the selected window, and that this function does not change which window is selected. LINES specifies the number of window lines to scroll and is interpreted as if it were a raw prefix argument. If LINES is nil, the window is scrolled by the amount it was moved by the immediately previous \"in place\" scrolling command, or by scroll-default-lines (by default, almost a windowful) if the previous command was not an \"in place\" scrolling command (or when WINDOW is not the previously scrolled window, or when this-command and the previous scrolling command are not in the same group of scrolling commands (see the documentation for variable scroll-command-groups), or when other circumstances prevent the previous scrolling distance from being used). If LINES is the symbol -, then the scrolling distance is determined as if LINES had been nil, and then that distance is multiplied by -1. DIRECTION determines the direction of the scrolling motion. The values -1 and 'down indicate downward motion; the values 1 and 'up indicate upward motion. Any other value causes an error. If the window cannot be scrolled by the full distance (because the window hits the boundary of its buffer), the window's point is allowed to stray from its initial position so that it can move the full number of lines. If point cannot move the full number of lines, point is moved to the buffer boundary (unless it was already there, in which case a buffer boundary error is signalled instead). Any immediately subsequent \"in place\" scrolling commands will try to restore point to its initial window position. Unless the variable scroll-allow-blank-lines-past-eob is true, this function avoids displaying blank lines past the end of the buffer except as necessary to make a previous \"in place\" scrolling action reversible. Effectively, this means that this function will not display any more past-end-of-buffer blank lines than were visible when the current sequence of \"in place\" scrolling commands started. When the variable scroll-allow-blank-lines-past-eob is true, this function will display as many blank lines as is necessary to keep point \"in place\" in the window. Note that if WINDOW is not the selected window and it is impossible to scroll the text of WINDOW at all (because a buffer boundary is already visible), then this function signals a buffer boundary error. The error is signalled even if point could otherwise move the full number of lines."]) (fset 'scroll-window #[(window lines direction) "p \n! = q )\n#Ȏ\n\n!!U!!)+" [selected-window window-buffer window current-buffer scroll-in-place scroll-window-in-place lines direction ((byte-code " !\nq" [select-window selected-window current-buffer] 2)) nil scroll-previous-window select-window scroll-parse-direction 1 original-scroll-up original-scroll-down] 5 "\ Scroll WINDOW vertically by the given number of window LINES in the given DIRECTION. Note that the window to be scrolled does not have to be the selected window, and that this function does not change which window is selected. When the variable scroll-in-place is true, this function simply invokes the function scroll-window-in-place to scroll the window and leave point \"in place\" within that window. See the documentation for scroll-window-in-place for more information. When the variable scroll-in-place is nil, this function invokes the original version of the standard GNU Emacs command scroll-down or scroll-up, as determined by DIRECTION, to scroll the window. If DIRECTION is -1 or 'down, the original scroll-down is called; if DIRECTION is 1 or 'up, the original scroll-up is called. Any other DIRECTION is an error. LINES is interpreted as if it were a raw prefix argument. If LINES is nil, the window is scrolled by almost a complete windowful. If LINES is the symbol -, the window is scrolled by almost a complete windowful in the opposite direction. Note that this function correctly handles cases in which scroll-in-place has a buffer-local value in the WINDOW's buffer. That value is honored."]) (fset 'scroll-window-in-place-continue-sequence #[nil "=\n > @>lAh*" [last-command t scroll-boundary-error-point scroll-default-command-group scroll-command-groups nil found groups this-command] 3 "\ If the previous command was a \"scroll in place\" command, set this-command to the name of that previous command. This ensures that any running sequence of \"in place\" scrolling commands will not be broken by the current command. See the documentation for the commands scroll-down-in-place and scroll-down-in- place for more information about \"in place\" scrolling. NOTE that you don't need to call this function if the current command scrolls in place! You only need to call this function when the current command is not a \"scroll in place\" command but you still want to preserve any running sequence of \"in place\" commands. Such situations are rare. NOTE that this function sets this-command in order to trick the \"in place\" scrolling commands. If something else subsequently sets this-command, any running sequence of scrolling commands will probably be broken anyway."]) (fset 'scroll-get-command-group #[(command) " \n @>p Am @ > B*" [scroll-command-groups nil found groups command t scroll-default-command-group] 3 "\ Return the group of \"in place\" scrolling commands that contains the given COMMAND. This is the list of commands with which the given command may share state and form \"chains.\" This function is an auxiliary for the function scroll-window-in-place. Don't call this function from other code."]) (fset 'scroll-parse-direction #[(direction) "====‡D\"" [direction 1 -1 up down signal args-out-of-range] 4 "\ Return the signed unit distance for the given DIRECTION. If DIRECTION is unacceptable, signal an error."]) (fset 'scroll-determine-goal-column #[(window) " ! W !Vlȇil !Si !S" [truncate-lines truncate-partial-width-windows window-width window screen-width window-hscroll 0 track-eol 9999] 3 "\ Return the goal column for the \"in place\" vertical scrolling commands. This is the horizontal window position at which these commands try to keep point. This function is an auxiliary for the function scroll-window-in-place. Don't call this function from other code."]) (fset 'scroll-set-window-start #[(window lines &optional original-window) " !b \\\\! [!\\ =?U? `\" \\Z*" [window-start window vertical-motion lines scroll-window-debt scroll-initially-displayed-lines moved original-window 0 set-window-start t] 4 "\ Move the window-start of the given window, which must be the selected window. If the window was successfully scrolled, update the scroll-window-debt and return t. Otherwise return nil. This function is an auxiliary for the function scroll-window-in-place. Don't call this function from other code."]) (fset 'scroll-signal-boundary-error #[(initial-point lines) "b  WǪ\"" [initial-point this-command scroll-boundary-error-command scroll-boundary-error-point signal lines 0 beginning-of-buffer end-of-buffer nil] 3 "\ Move point to its initial location and signal an appropriate buffer boundary error. This function is an auxiliary for the function scroll-window-in-place. Don't call this function from other code."])