unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
@ 2020-11-28 21:21 Sean Devlin
  2020-11-29  8:22 ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-11-28 21:21 UTC (permalink / raw)
  To: 44933

Hi folks,

Selecting a different frame ephmerally (e.g. via `with-selected-frame`
in a timer callback) shrinks the minibuffer. This is true whether or not
the minibuffer is active.

Reproduction steps:

1. Evaluate this form in the scratch buffer:

   (run-with-timer nil 13 (lambda () (with-selected-frame
   (next-frame))))

2. Evaluate this form in the scratch buffer:

   (run-with-timer nil 11 (lambda () (window-resize (minibuffer-window)
   10)))

3. Observe that the minibuffer grows and shrinks as the timers fire.

You can run some completing read command (e.g. `M-x`) to see that the
resizing happens whether or not the minibuffer is active.

This is relevant for completing read implementations that resize the
minibuffer to display a vertical list of candidates. I noticed the
behavior while using selectrum (https://github.com/raxod502/selectrum)
while I had a subprocess running under term in another frame. Since the 
`term-emulate-terminal` function selects windows in the background  
whenever the subprocess sends output, it was causing the selectrum
minibuffer to shrink.

I'm not sure what the correct behavior is here, but this was unexpected
to me. I think that if the minibuffer is active, ephemeral frame or
window selections should not affect its size. (I'm less certain about
the inactive minibuffer case, but I think the size should stay the same
there as well.)

Thanks!

In GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
of 2020-08-12 built on builder10-14.porkrind.org
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.0

Recent messages:
Beginning of buffer [5 times]
uncompressing window.el.gz...done
Making completion list...
Type C-x 1 to delete the help window, C-M-v to scroll help.
t [2 times]
Quit [3 times]
[nil 24514 47830 650446 10 (closure (t) nil (window-resize (minibuffer-window) 10)) nil nil 0]
[nil 24514 47883 629069 11 (closure (t) nil (let (... ...) (unwind-protect ... ... ...))) nil nil 0]
End of buffer [6 times]
Beginning of buffer [8 times]

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS JSON PDUMPER

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr cl-print debug backtrace cl-extra minibuf-eldef
help-fns radix-tree help-mode emacsbug message rmc puny dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache
epa derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date subr-x seq byte-opt gv bytecomp
byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils linum misearch
multi-isearch jka-compr thingatpt find-func tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
multi-tty make-network-process emacs)

Memory information:
((conses 16 59777 30679)
(symbols 48 6538 1)
(strings 32 19388 2002)
(string-bytes 1 586736)
(vectors 16 11741)
(vector-slots 8 146822 21486)
(floats 8 40 48)
(intervals 56 896 92)
(buffers 1000 16))





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-11-28 21:21 bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer Sean Devlin
@ 2020-11-29  8:22 ` martin rudalics
  2020-11-29 15:43   ` Sean Devlin
  0 siblings, 1 reply; 14+ messages in thread
From: martin rudalics @ 2020-11-29  8:22 UTC (permalink / raw)
  To: Sean Devlin, 44933

 > Selecting a different frame ephmerally (e.g. via `with-selected-frame`
 > in a timer callback) shrinks the minibuffer. This is true whether or not
 > the minibuffer is active.
 >
 > Reproduction steps:
 >
 > 1. Evaluate this form in the scratch buffer:
 >
 >     (run-with-timer nil 13 (lambda () (with-selected-frame
 >     (next-frame))))
 >
 > 2. Evaluate this form in the scratch buffer:
 >
 >     (run-with-timer nil 11 (lambda () (window-resize (minibuffer-window)
 >     10)))
 >
 > 3. Observe that the minibuffer grows and shrinks as the timers fire.

Here I need two frames to observe 3.  With one frame the minibuffer
window grows continuously.

 > You can run some completing read command (e.g. `M-x`) to see that the
 > resizing happens whether or not the minibuffer is active.
 >
 > This is relevant for completing read implementations that resize the
 > minibuffer to display a vertical list of candidates. I noticed the
 > behavior while using selectrum (https://github.com/raxod502/selectrum)
 > while I had a subprocess running under term in another frame. Since the
 > `term-emulate-terminal` function selects windows in the background
 > whenever the subprocess sends output, it was causing the selectrum
 > minibuffer to shrink.
 >
 > I'm not sure what the correct behavior is here, but this was unexpected
 > to me. I think that if the minibuffer is active, ephemeral frame or
 > window selections should not affect its size. (I'm less certain about
 > the inactive minibuffer case, but I think the size should stay the same
 > there as well.)

To my knowledge we have no means to select a frame "ephemerally".
'with-selected-frame', 'with-selected-window' are just as "hard" as
'select-frame' and 'select-window'.  And so the only way to prevent
switching frames from shrinking the previously selected frame's
minibuffer window is to set 'resize-mini-windows' to nil.  OTOH with
'resize-mini-windows' non-nil, re-selecting the previously selected frame
when returning from a 'with-selected-frame' should size its minibuffer
window back to its contents provided it is still active.  But I'm never
sure whether all these work as advertised.

martin





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-11-29  8:22 ` martin rudalics
@ 2020-11-29 15:43   ` Sean Devlin
  2020-11-30  9:04     ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-11-29 15:43 UTC (permalink / raw)
  To: martin rudalics; +Cc: 44933

Hi Martin,

> On Nov 29, 2020, at 3:22 AM, martin rudalics <rudalics@gmx.at> wrote:
> 
> > Selecting a different frame ephmerally (e.g. via `with-selected-frame`
> > in a timer callback) shrinks the minibuffer. This is true whether or not
> > the minibuffer is active.
> >
> > Reproduction steps:
> >
> > 1. Evaluate this form in the scratch buffer:
> >
> >     (run-with-timer nil 13 (lambda () (with-selected-frame
> >     (next-frame))))
> >
> > 2. Evaluate this form in the scratch buffer:
> >
> >     (run-with-timer nil 11 (lambda () (window-resize (minibuffer-window)
> >     10)))
> >
> > 3. Observe that the minibuffer grows and shrinks as the timers fire.
> 
> Here I need two frames to observe 3.  With one frame the minibuffer
> window grows continuously.

Ah, you’re right. I had left this out of my reproduction steps. Sorry!

> 
> > You can run some completing read command (e.g. `M-x`) to see that the
> > resizing happens whether or not the minibuffer is active.
> >
> > This is relevant for completing read implementations that resize the
> > minibuffer to display a vertical list of candidates. I noticed the
> > behavior while using selectrum (https://github.com/raxod502/selectrum)
> > while I had a subprocess running under term in another frame. Since the
> > `term-emulate-terminal` function selects windows in the background
> > whenever the subprocess sends output, it was causing the selectrum
> > minibuffer to shrink.
> >
> > I'm not sure what the correct behavior is here, but this was unexpected
> > to me. I think that if the minibuffer is active, ephemeral frame or
> > window selections should not affect its size. (I'm less certain about
> > the inactive minibuffer case, but I think the size should stay the same
> > there as well.)
> 
> To my knowledge we have no means to select a frame "ephemerally".
> 'with-selected-frame', 'with-selected-window' are just as "hard" as
> 'select-frame' and 'select-window'.  And so the only way to prevent
> switching frames from shrinking the previously selected frame's
> minibuffer window is to set 'resize-mini-windows' to nil.  OTOH with
> 'resize-mini-windows' non-nil, re-selecting the previously selected frame
> when returning from a 'with-selected-frame' should size its minibuffer
> window back to its contents provided it is still active.  But I'm never
> sure whether all these work as advertised.

I see, thank you.

It looks like the default value for `resize-mini-windows` is
`grow-only`. The docs for `resize-mini-windows` suggest it is used
along with the text in the minibuffer to decide how to resize the
window. I think this may be the issue, since my minibuffer has no text
spanning multiple lines.

In my reproduction, the minibuffer window is grown manually via
`window-resize`. In the case of selectrum, the completing read
candidates are displayed via overlay. I think this means that a
resizing function that considers the buffer text only will resize
these back down to a single line.

I just tested, and binding `resize-mini-windows` to nil around the
window selection in `term-emulate-terminal` does solve my
problem. Does this seem like the right fix? I think it is surprising
that output from a term process coming in the background should resize
a minibuffer window (and especially an active one).

Also, I see that `term-emulate-terminal` is calling `select-window` to
perform its window selections. From my reading of the docs, I think it
might make sense for it to pass `mark-for-redisplay` as the `norecord`
argument. It doesn't seem like we should be modifying the buffer list
or most recently selected window in this case, but we do want to
redisplay the new output.

I think the documentation should clarify that window selection can
change window sizes as a side effect. The docs for selecting windows
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Selecting-Windows.html)
do not mention that `select-window` can change minibuffer sizes. The
docs for minibuffer windows
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Windows.html)
do mention these variables to control how minibuffer windows can be
resized automatically, but they do not say what functions might try to
do this automatic resizing.

Finally, I wonder if `with-selected-window` (which
`term-emulate-terminal` does not currently use) should bind
`resize-mini-windows`. The docs say it is "the preferred way to
temporarily work with" a selected window, so it does seem like
automatic resizing is not in the spirit of the function. On the other
hand, I don't know all the existing use cases; maybe this would break
things.

Thanks!

> 
> martin






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-11-29 15:43   ` Sean Devlin
@ 2020-11-30  9:04     ` martin rudalics
  2020-11-30 19:32       ` Sean Devlin
  0 siblings, 1 reply; 14+ messages in thread
From: martin rudalics @ 2020-11-30  9:04 UTC (permalink / raw)
  To: Sean Devlin; +Cc: 44933

 > In my reproduction, the minibuffer window is grown manually via
 > `window-resize`.

With 'resize-mini-windows' non-nil this usually has no visible effect
because any such manual resizing is immediately undone by the automatic
resizing scheme.

 > In the case of selectrum, the completing read
 > candidates are displayed via overlay. I think this means that a
 > resizing function that considers the buffer text only will resize
 > these back down to a single line.

The routine that determines the window size (resize_mini_window in
xdisp.c) should consider overlays as well (if they are in the right
buffer).  Anything else would be a bug.

 > I just tested, and binding `resize-mini-windows` to nil around the
 > window selection in `term-emulate-terminal` does solve my
 > problem. Does this seem like the right fix? I think it is surprising
 > that output from a term process coming in the background should resize
 > a minibuffer window (and especially an active one).

If you look into the code of do_switch_frame (in frame.c) you will be
able to spot

   if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
     resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);

which means that currently even redisplay itself may resize the mini
window every time it constructs a mode line or frame title.  I can only
offer two advices: (1) Avoid 'with-selected-window/frame' in timers and
(2) make sure no redisplay happen _within_ such a form.

 > Also, I see that `term-emulate-terminal` is calling `select-window` to
 > perform its window selections. From my reading of the docs, I think it
 > might make sense for it to pass `mark-for-redisplay` as the `norecord`
 > argument. It doesn't seem like we should be modifying the buffer list
 > or most recently selected window in this case, but we do want to
 > redisplay the new output.

I would have to understand the semantics of 'term-emulate-terminal' to
answer that.  Hopefully, someone else can chime in here.

 > I think the documentation should clarify that window selection can
 > change window sizes as a side effect. The docs for selecting windows
 > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Selecting-Windows.html)
 > do not mention that `select-window` can change minibuffer sizes. The
 > docs for minibuffer windows
 > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Windows.html)
 > do mention these variables to control how minibuffer windows can be
 > resized automatically, but they do not say what functions might try to
 > do this automatic resizing.

With the recently added 'minibuffer-follows-selected-frame' we now have
an additional source of complications to consider.  Maybe you could, as
soon as the implementation of the latter has consolidated, play with the
various values of 'resize-mini-windows' and suggest suitable fixes for
the documentations of 'select-window' and 'select-frame'.

Alternatively, we could consider skipping the

     resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);

above for temporary window/frame selections (and at least for redisplay
as I currently do here) but the consequences of such a step are not
easily fathomable.

 > Finally, I wonder if `with-selected-window` (which
 > `term-emulate-terminal` does not currently use) should bind
 > `resize-mini-windows`.

... with the consequences I mentioned in the sentence before ...

 > The docs say it is "the preferred way to
 > temporarily work with" a selected window, so it does seem like
 > automatic resizing is not in the spirit of the function. On the other
 > hand, I don't know all the existing use cases; maybe this would break
 > things.

Right.

martin





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-11-30  9:04     ` martin rudalics
@ 2020-11-30 19:32       ` Sean Devlin
  2020-12-01  9:33         ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-11-30 19:32 UTC (permalink / raw)
  To: martin rudalics; +Cc: 44933

Hi Martin,

> On Nov 30, 2020, at 4:04 AM, martin rudalics <rudalics@gmx.at> wrote:
> 
> > In my reproduction, the minibuffer window is grown manually via
> > `window-resize`.
> 
> With 'resize-mini-windows' non-nil this usually has no visible effect
> because any such manual resizing is immediately undone by the automatic
> resizing scheme.

I’m not sure I understand. Are you saying a program should not be able to grow the minibuffer window this way? Or just that it will be undone by the next resizing event? (Of course, this is a toy example, so I have no opinion on what the correct behavior should be. I’m just wondering.)

> 
> > In the case of selectrum, the completing read
> > candidates are displayed via overlay. I think this means that a
> > resizing function that considers the buffer text only will resize
> > these back down to a single line.
> 
> The routine that determines the window size (resize_mini_window in
> xdisp.c) should consider overlays as well (if they are in the right
> buffer).  Anything else would be a bug.

I’ve been playing with this a bit (on a recent Emacs 28.0.50), and I’m not sure I understand the current behavior.

For example, I have three frames open and I ran this code in the scratch buffer:

(with-current-buffer (window-buffer (minibuffer-window))
  (remove-overlays)
  (erase-buffer)
  (insert "this is some text")
  (let ((ov (make-overlay (point) (point) nil t t)))
    (overlay-put ov 'after-string "\none\ntwo\nthree")))

After moving the point, all I can see is the first line in the minibuffer: “this is some text”. This is true across all three frames.

If I select the other frames by clicking on them, the frame that just lost focus will now show all four lines (i.e. including the overlay). The minibuffer windows on the other frames will stay at one line until I select them by clicking and then select some other frame.

On the other hand, if I select frames by calling `other-frame` via a key binding, the behavior is slightly different: the minibuffer window on a frame expands to four lines as that frame loses focus, and the minibuffer window on the newly selected frame contracts back down to one line.

Are all of these behaviors expected and correct? (Again, I have no opinion; I’m just trying to understand how things are meant to work.)

> 
> > I just tested, and binding `resize-mini-windows` to nil around the
> > window selection in `term-emulate-terminal` does solve my
> > problem. Does this seem like the right fix? I think it is surprising
> > that output from a term process coming in the background should resize
> > a minibuffer window (and especially an active one).
> 
> If you look into the code of do_switch_frame (in frame.c) you will be
> able to spot
> 
>  if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
>    resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
> 
> which means that currently even redisplay itself may resize the mini
> window every time it constructs a mode line or frame title.  I can only
> offer two advices: (1) Avoid 'with-selected-window/frame' in timers and
> (2) make sure no redisplay happen _within_ such a form.

Interesting. I think this partially explains the behaviors I’m seeing above.

To be clear, `term-emulate-terminal` is a process filter. I’m not sure if that’s exactly like a timer under the hood, but it does run without user interaction.

> 
> > Also, I see that `term-emulate-terminal` is calling `select-window` to
> > perform its window selections. From my reading of the docs, I think it
> > might make sense for it to pass `mark-for-redisplay` as the `norecord`
> > argument. It doesn't seem like we should be modifying the buffer list
> > or most recently selected window in this case, but we do want to
> > redisplay the new output.
> 
> I would have to understand the semantics of 'term-emulate-terminal' to
> answer that.  Hopefully, someone else can chime in here.

I can give a little information here, though someone else will surely know more.

This function is the process filter for a term process, so it handles new output from the process. After doing so, it iterates over all the windows to see if any contain the process buffer. For any that are, it selects those windows and scrolls those windows appropriately.

> 
> > I think the documentation should clarify that window selection can
> > change window sizes as a side effect. The docs for selecting windows
> > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Selecting-Windows.html)
> > do not mention that `select-window` can change minibuffer sizes. The
> > docs for minibuffer windows
> > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Windows.html)
> > do mention these variables to control how minibuffer windows can be
> > resized automatically, but they do not say what functions might try to
> > do this automatic resizing.
> 
> With the recently added 'minibuffer-follows-selected-frame' we now have
> an additional source of complications to consider.  Maybe you could, as
> soon as the implementation of the latter has consolidated, play with the
> various values of 'resize-mini-windows' and suggest suitable fixes for
> the documentations of 'select-window' and 'select-frame'.

Sure, I can do that. Is there a timeline for this or some place I can follow development progress?

From testing the current implementation, it seems selectrum has a similar issue here: when I switch to a new frame, the minibuffer does follow, but the list of candidates is hidden until I enter a new input.

> 
> Alternatively, we could consider skipping the
> 
>    resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
> 
> above for temporary window/frame selections (and at least for redisplay
> as I currently do here) but the consequences of such a step are not
> easily fathomable.
> 
> > Finally, I wonder if `with-selected-window` (which
> > `term-emulate-terminal` does not currently use) should bind
> > `resize-mini-windows`.
> 
> ... with the consequences I mentioned in the sentence before ...
> 
> > The docs say it is "the preferred way to
> > temporarily work with" a selected window, so it does seem like
> > automatic resizing is not in the spirit of the function. On the other
> > hand, I don't know all the existing use cases; maybe this would break
> > things.
> 
> Right.
> 
> martin






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-11-30 19:32       ` Sean Devlin
@ 2020-12-01  9:33         ` martin rudalics
  2020-12-01 20:32           ` Sean Devlin
  0 siblings, 1 reply; 14+ messages in thread
From: martin rudalics @ 2020-12-01  9:33 UTC (permalink / raw)
  To: Sean Devlin; +Cc: 44933

 > I’m not sure I understand. Are you saying a program should not be able
 > to grow the minibuffer window this way? Or just that it will be undone
 > by the next resizing event? (Of course, this is a toy example, so I
 > have no opinion on what the correct behavior should be. I’m just
 > wondering.)

With 'resize-mini-windows' non-nil, redisplay can resize a normal
minibuffer window (the one at the bottom of a normal frame) any time
thus overriding any manual resizing done by the user.  With 'grow-only'
it cannot auto-shrink it to some value above the minimum one, so if you
make the window manually very large, redisplay can shrink it only when
the minibuffer gets empty.  Note that there is no "correct" behavior
here, everything grew out of fixing inconveniences found in daily use.

 > I’ve been playing with this a bit (on a recent Emacs 28.0.50), and I’m not sure I understand the current behavior.
 >
 > For example, I have three frames open and I ran this code in the scratch buffer:
 >
 > (with-current-buffer (window-buffer (minibuffer-window))
 >    (remove-overlays)
 >    (erase-buffer)
 >    (insert "this is some text")
 >    (let ((ov (make-overlay (point) (point) nil t t)))
 >      (overlay-put ov 'after-string "\none\ntwo\nthree")))
 >
 > After moving the point, all I can see is the first line in the minibuffer: “this is some text”. This is true across all three frames.
 >
 > If I select the other frames by clicking on them, the frame that just lost focus will now show all four lines (i.e. including the overlay). The minibuffer windows on the other frames will stay at one line until I select them by clicking and then select some other frame.
 >
 > On the other hand, if I select frames by calling `other-frame` via a key binding, the behavior is slightly different: the minibuffer window on a frame expands to four lines as that frame loses focus, and the minibuffer window on the newly selected frame contracts back down to one line.
 >
 > Are all of these behaviors expected and correct? (Again, I have no opinion; I’m just trying to understand how things are meant to work.)

Your example is a bit contrived in the sense that just inserting text
into a minibuffer that is not active is not something redisplay really
cares about.  Putting that overlay into a prompt and then switching
frames is more realistic wrt what redisplay really cares about.

 > This function is the process filter for a term process, so it handles
 > new output from the process. After doing so, it iterates over all the
 > windows to see if any contain the process buffer. For any that are, it
 > selects those windows and scrolls those windows appropriately.

I didn't read the code very attentively but let's make sure one thing:
The behavior you see happens only when there are at least two frames so
the

(setq win (next-window win nil t))

in 'term-emulate-terminal' and the subsequent

		     (select-window win)

really get executed and the latter selects a _different_ frame thus
causing the earlier mentioned

   if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
     resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);

Maybe you could instrument 'term-emulate-terminal' and 'do_switch_frame'
(debugging this is probably useless) so that they write something into a
buffer and we can see the precise interleaving of steps leading to the
behavior seen.

 >> With the recently added 'minibuffer-follows-selected-frame' we now have
 >> an additional source of complications to consider.  Maybe you could, as
 >> soon as the implementation of the latter has consolidated, play with the
 >> various values of 'resize-mini-windows' and suggest suitable fixes for
 >> the documentations of 'select-window' and 'select-frame'.
 >
 > Sure, I can do that. Is there a timeline for this or some place I can follow development progress?

You can try to follow the thread "Stop frames stealing eachothers'
minibuffers!" on emacs-devel and you will see that we all are quite
often surprised by how the various versions of Emacs handle switching
from one minibuffer window to another.

 >  From testing the current implementation, it seems selectrum has a
 > similar issue here: when I switch to a new frame, the minibuffer does
 > follow, but the list of candidates is hidden until I enter a new
 > input.

I suppose "showing the list of candidates" is part of a minibuffer
interaction and the initial prompt is shown correctly on its frame but
disappears when moving to another frame via C-x 5 o.  Right?

martin






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-01  9:33         ` martin rudalics
@ 2020-12-01 20:32           ` Sean Devlin
  2020-12-02  7:45             ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-12-01 20:32 UTC (permalink / raw)
  To: martin rudalics; +Cc: 44933

[-- Attachment #1: Type: text/plain, Size: 6125 bytes --]

Hi Martin,

> On Dec 1, 2020, at 4:33 AM, martin rudalics <rudalics@gmx.at> wrote:
> 
> > I’m not sure I understand. Are you saying a program should not be able
> > to grow the minibuffer window this way? Or just that it will be undone
> > by the next resizing event? (Of course, this is a toy example, so I
> > have no opinion on what the correct behavior should be. I’m just
> > wondering.)
> 
> With 'resize-mini-windows' non-nil, redisplay can resize a normal
> minibuffer window (the one at the bottom of a normal frame) any time
> thus overriding any manual resizing done by the user.  With 'grow-only'
> it cannot auto-shrink it to some value above the minimum one, so if you
> make the window manually very large, redisplay can shrink it only when
> the minibuffer gets empty.  Note that there is no "correct" behavior
> here, everything grew out of fixing inconveniences found in daily use.

I see, so redisplay could happen at any time, and redisplay can resize the minibuffer window (contingent on `resize-mini-windows`). I guess in the extreme case, any code could call the `redisplay` function explicitly.

> 
> > I’ve been playing with this a bit (on a recent Emacs 28.0.50), and I’m not sure I understand the current behavior.
> >
> > For example, I have three frames open and I ran this code in the scratch buffer:
> >
> > (with-current-buffer (window-buffer (minibuffer-window))
> >    (remove-overlays)
> >    (erase-buffer)
> >    (insert "this is some text")
> >    (let ((ov (make-overlay (point) (point) nil t t)))
> >      (overlay-put ov 'after-string "\none\ntwo\nthree")))
> >
> > After moving the point, all I can see is the first line in the minibuffer: “this is some text”. This is true across all three frames.
> >
> > If I select the other frames by clicking on them, the frame that just lost focus will now show all four lines (i.e. including the overlay). The minibuffer windows on the other frames will stay at one line until I select them by clicking and then select some other frame.
> >
> > On the other hand, if I select frames by calling `other-frame` via a key binding, the behavior is slightly different: the minibuffer window on a frame expands to four lines as that frame loses focus, and the minibuffer window on the newly selected frame contracts back down to one line.
> >
> > Are all of these behaviors expected and correct? (Again, I have no opinion; I’m just trying to understand how things are meant to work.)
> 
> Your example is a bit contrived in the sense that just inserting text
> into a minibuffer that is not active is not something redisplay really
> cares about.  Putting that overlay into a prompt and then switching
> frames is more realistic wrt what redisplay really cares about.

Fair point, it’s definitely a contrived example.

> 
> > This function is the process filter for a term process, so it handles
> > new output from the process. After doing so, it iterates over all the
> > windows to see if any contain the process buffer. For any that are, it
> > selects those windows and scrolls those windows appropriately.
> 
> I didn't read the code very attentively but let's make sure one thing:
> The behavior you see happens only when there are at least two frames so
> the
> 
> (setq win (next-window win nil t))
> 
> in 'term-emulate-terminal' and the subsequent
> 
> 		     (select-window win)
> 
> really get executed and the latter selects a _different_ frame thus
> causing the earlier mentioned
> 
>  if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
>    resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
> 
> Maybe you could instrument 'term-emulate-terminal' and 'do_switch_frame'
> (debugging this is probably useless) so that they write something into a
> buffer and we can see the precise interleaving of steps leading to the
> behavior seen.

Yeah, I think it does depend on having multiple frames. In the specific case where I first noticed the strange behavior, my setup was:

Frame X with a window displaying a subprocess running under term
Frame Y with a window displaying some other buffer
Frame Y is selected
Selectrum (https://github.com/raxod502/selectrum) is installed as the completing read implementation

I invoked some command that performed a completing read via selectrum (e.g. `find-file` or similar) with the list of candidates displayed vertically below the prompt. While I was sitting with that prompt, the subprocess sent some output. This induced the temporary selection of frame X via the code in term, which caused the list of completing read candidates to disappear.

Anyway, I’ll perform the instrumentation you suggest, so we can understand specifically what is happening.

> 
> >> With the recently added 'minibuffer-follows-selected-frame' we now have
> >> an additional source of complications to consider.  Maybe you could, as
> >> soon as the implementation of the latter has consolidated, play with the
> >> various values of 'resize-mini-windows' and suggest suitable fixes for
> >> the documentations of 'select-window' and 'select-frame'.
> >
> > Sure, I can do that. Is there a timeline for this or some place I can follow development progress?
> 
> You can try to follow the thread "Stop frames stealing eachothers'
> minibuffers!" on emacs-devel and you will see that we all are quite
> often surprised by how the various versions of Emacs handle switching
> from one minibuffer window to another.

Thanks, I’ll check it out.

> 
> >  From testing the current implementation, it seems selectrum has a
> > similar issue here: when I switch to a new frame, the minibuffer does
> > follow, but the list of candidates is hidden until I enter a new
> > input.
> 
> I suppose "showing the list of candidates" is part of a minibuffer
> interaction and the initial prompt is shown correctly on its frame but
> disappears when moving to another frame via C-x 5 o.  Right?

Yes, exactly. I can try to make a video of this if it would help.

Thanks!

> 
> martin
> 


[-- Attachment #2: Type: text/html, Size: 8939 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-01 20:32           ` Sean Devlin
@ 2020-12-02  7:45             ` martin rudalics
  2020-12-02  7:52               ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: martin rudalics @ 2020-12-02  7:45 UTC (permalink / raw)
  To: Sean Devlin; +Cc: 44933

 > I see, so redisplay could happen at any time, and redisplay can resize
 > the minibuffer window (contingent on `resize-mini-windows`). I guess
 > in the extreme case, any code could call the `redisplay` function
 > explicitly.

Yes.

 > Anyway, I’ll perform the instrumentation you suggest, so we can
 > understand specifically what is happening.

I forgot to say that _all_ normal mini window resizing goes through
'window--resize-root-window-vertically' in window.el.  So it will
probably suffice to instrument just that function (in an already running
Emacs only, else you have to rebuild because window.el is preloaded) and
don't have to tinker with C code at all.

martin






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-02  7:45             ` martin rudalics
@ 2020-12-02  7:52               ` martin rudalics
  2020-12-02 18:24                 ` Sean Devlin
  0 siblings, 1 reply; 14+ messages in thread
From: martin rudalics @ 2020-12-02  7:52 UTC (permalink / raw)
  To: Sean Devlin; +Cc: 44933

 > I forgot to say that _all_ normal mini window resizing goes through
 > 'window--resize-root-window-vertically' in window.el.  So it will
 > probably suffice to instrument just that function (in an already running
 > Emacs only, else you have to rebuild because window.el is preloaded) and
 > don't have to tinker with C code at all.

Imprecise again: The above covers only the automatic resizing triggered
by redisplay (which is what we are interested in).  Manual resizing the
minibuffer window is done in 'window--resize-mini-window' (also in
window.el) so if such manual resizing may happen in between you have to
instrument that as well.

martin





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-02  7:52               ` martin rudalics
@ 2020-12-02 18:24                 ` Sean Devlin
  2020-12-12 20:23                   ` Sean Devlin
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-12-02 18:24 UTC (permalink / raw)
  To: martin rudalics; +Cc: 44933

Hi Martin,

Thanks for all the helpful info!

> On Dec 2, 2020, at 2:52 AM, martin rudalics <rudalics@gmx.at> wrote:
> 
> > I forgot to say that _all_ normal mini window resizing goes through
> > 'window--resize-root-window-vertically' in window.el.  So it will
> > probably suffice to instrument just that function (in an already running
> > Emacs only, else you have to rebuild because window.el is preloaded) and
> > don't have to tinker with C code at all.
> 
> Imprecise again: The above covers only the automatic resizing triggered
> by redisplay (which is what we are interested in).  Manual resizing the
> minibuffer window is done in 'window--resize-mini-window' (also in
> window.el) so if such manual resizing may happen in between you have to
> instrument that as well.

I see, I’ll take a look at these functions. Thanks!

> 
> martin






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-02 18:24                 ` Sean Devlin
@ 2020-12-12 20:23                   ` Sean Devlin
  2020-12-13  7:26                     ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-12-12 20:23 UTC (permalink / raw)
  To: martin rudalics; +Cc: 44933

[-- Attachment #1: Type: text/plain, Size: 1945 bytes --]

Hi Martin,

Thanks for waiting on this update.

I instrumented the code in a couple key places and then exercised the bug. Attached is the log showing what happened.

Basically, I put two calls to my log function around the window selection in ’term-emulate-terminal and one inside ‘window—resize-root-window-vertically. Next, I opened a term window running a script that prints some output every few seconds. I had one frame running the script under term, and I selected a second frame and invoked some completing read command. As before, the minibuffer window shrank when the script printed some output.

You can find the start of each entry by searching for the regexp “^>>>>”. I wasn’t sure what to include in each entry, but I printed the selected frame, the selected window, that window’s buffer, and a backtrace. I can easily add more information and run the experiment again, if there’s something else you’d like to see.

Thanks!



> On Dec 2, 2020, at 1:24 PM, Sean Devlin <spd@toadstyle.org> wrote:
> 
> Hi Martin,
> 
> Thanks for all the helpful info!
> 
>> On Dec 2, 2020, at 2:52 AM, martin rudalics <rudalics@gmx.at> wrote:
>> 
>>> I forgot to say that _all_ normal mini window resizing goes through
>>> 'window--resize-root-window-vertically' in window.el.  So it will
>>> probably suffice to instrument just that function (in an already running
>>> Emacs only, else you have to rebuild because window.el is preloaded) and
>>> don't have to tinker with C code at all.
>> 
>> Imprecise again: The above covers only the automatic resizing triggered
>> by redisplay (which is what we are interested in).  Manual resizing the
>> minibuffer window is done in 'window--resize-mini-window' (also in
>> window.el) so if such manual resizing may happen in between you have to
>> instrument that as well.
> 
> I see, I’ll take a look at these functions. Thanks!
> 
>> 
>> martin


[-- Attachment #2.1: Type: text/html, Size: 1478 bytes --]

[-- Attachment #2.2: redisplay-minibuffer.log --]
[-- Type: application/octet-stream, Size: 108016 bytes --]

>>>> term-emulate-window before selection
selected frame: #<frame  *Minibuf-1* 0x7ffa290daa30>
selected window: #<window 4 on  *Minibuf-1*>
selected window buffer:  *Minibuf-1*
  backtrace()
  (let ((standard-output (get-buffer-create "*redisplay-minibuffer-log*"))) (princ (format ">>>> %s\n" msg)) (princ (format "selected frame: %s\n" (selected-frame))) (princ (format "selected window: %s\n" (selected-window))) (princ (format "selected window buffer: %s\n" (window-buffer (selected-window)))) (backtrace) (princ "\n\n\n"))
  my/redisplay-minibuffer-log("term-emulate-window before selection")
  (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1))))
  (progn (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1)))))
  (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll ...) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p ... win)))) (save-excursion (goto-char (point-max)) (recenter -1))))))
  (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1)))))
  (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll ...) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p ... win)))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win)))
  (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or ... ...)) (and (eq scroll ...) (not ...))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p ... win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not ...))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win))))
  (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (when (= funny str-length) (let (... ...) (while ... ...) (when ... ... ... ... ...))) (let ((old-column ...) (old-point ...) columns) (unless term-suppress-hard-newline (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not ...) (let ... ... ... ...)) (when term-insert-mode (let ... ... ... ...)) (put-text-property old-point (point) 'font-lock-face term-current-face)) (when (eq (term-current-column) term-width) (term-move-columns -1) (setq term-do-line-wrapping (point))) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let (...) (term-move-to-column ...))) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless (and term-kill-echo-list ...) (term-down 1 t))) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function (decode-coding-string ... locale-coding-system t))) (27 (pcase (aref str ...) (91 ...) (68 ... ...) (77 ...) (55 ... ...) (56 ...) (99 ...) (65 ...))) ((or 0 14 15 'nil) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= ... save-marker) (eq scroll t) (eq scroll ...) (and ... ...) (and ... ...)) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not ...) (recenter -1))) (when (and term-scroll-show-maximum-output (>= ... ...) (or term-scroll-snap-to-bottom ...)) (save-excursion (goto-char ...) (recenter -1))))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))
  (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string ... locale-coding-system t)) (when (= funny str-length) (let ... ... ...)) (let (... ... columns) (unless term-suppress-hard-newline ...) (insert decoded-substring) (setq term-current-column ... columns ...) (when ... ...) (when term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (when (eq ... term-width) (term-move-columns -1) (setq term-do-line-wrapping ...)) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let ... ...)) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless ... ...)) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function ...)) (27 (pcase ... ... ... ... ... ... ... ...)) ((or 0 14 15 ...) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or ... ... ... ... ...) (when term-scroll-snap-to-bottom ... ...) (goto-char ...) (if ... ...)) (when (and term-scroll-show-maximum-output ... ...) (save-excursion ... ...)))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))
  (save-current-buffer (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)))
  (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> ... ...) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let (... ... ...) (when ... ... ... ... ... ... ... ...) (pcase-exhaustive ... ... ... ... ... ... ... ... ...) (unless ... ...) (if ... ... ...)))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq ... ...) (let ... ... ... ... ... ...)) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark ...)) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))
  (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (when (= funny str-length) (let (... ...) (while ... ...) (when ... ... ... ... ...))) (let ((old-column ...) (old-point ...) columns) (unless term-suppress-hard-newline (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not ...) (let ... ... ... ...)) (when term-insert-mode (let ... ... ... ...)) (put-text-property old-point (point) 'font-lock-face term-current-face)) (when (eq (term-current-column) term-width) (term-move-columns -1) (setq term-do-line-wrapping (point))) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let (...) (term-move-to-column ...))) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless (and term-kill-echo-list ...) (term-down 1 t))) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function (decode-coding-string ... locale-coding-system t))) (27 (pcase (aref str ...) (91 ...) (68 ... ...) (77 ...) (55 ... ...) (56 ...) (99 ...) (65 ...))) ((or 0 14 15 'nil) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= ... save-marker) (eq scroll t) (eq scroll ...) (and ... ...) (and ... ...)) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not ...) (recenter -1))) (when (and term-scroll-show-maximum-output (>= ... ...) (or term-scroll-snap-to-bottom ...)) (save-excursion (goto-char ...) (recenter -1))))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))
  (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string ... locale-coding-system t)) (when (= funny str-length) (let ... ... ...)) (let (... ... columns) (unless term-suppress-hard-newline ...) (insert decoded-substring) (setq term-current-column ... columns ...) (when ... ...) (when term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (when (eq ... term-width) (term-move-columns -1) (setq term-do-line-wrapping ...)) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let ... ...)) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless ... ...)) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function ...)) (27 (pcase ... ... ... ... ... ... ... ...)) ((or 0 14 15 ...) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or ... ... ... ... ...) (when term-scroll-snap-to-bottom ... ...) (goto-char ...) (if ... ...)) (when (and term-scroll-show-maximum-output ... ...) (save-excursion ... ...)))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)))
  (save-current-buffer (set-buffer (process-buffer proc)) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) (when (get-buffer-window (current-buffer)) (redisplay)))
  (with-current-buffer (process-buffer proc) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) (when (get-buffer-window (current-buffer)) (redisplay)))
  term-emulate-terminal(#<process something> "something\15\n")
  read-from-minibuffer("Find file: " nil (keymap (9 . selectrum-insert-current-candidate) (10 . selectrum-submit-exact-input) (C-M-backspace . backward-kill-sexp) (27 keymap (115 keymap (114 . selectrum-prescient-toggle-regexp) (112 . selectrum-prescient-toggle-prefix) (108 . selectrum-prescient-toggle-literal) (105 . selectrum-prescient-toggle-initialism) (102 . selectrum-prescient-toggle-fuzzy) (97 . selectrum-prescient-toggle-anchored)) (67108991 . backward-kill-sexp)) (remap keymap (previous-matching-history-element . selectrum-select-from-history) (kill-ring-save . selectrum-kill-ring-save) (end-of-buffer . selectrum-goto-end) (beginning-of-buffer . selectrum-goto-beginning) (minibuffer-beginning-of-buffer . selectrum-goto-beginning) (scroll-up-command . selectrum-next-page) (scroll-down-command . selectrum-previous-page) (exit-minibuffer . selectrum-select-current-candidate) (next-line-or-history-element . selectrum-next-candidate) (previous-line-or-history-element . selectrum-previous-candidate) (next-line . selectrum-next-candidate) (previous-line . selectrum-previous-candidate) (minibuffer-keyboard-quit . abort-recursive-edit) (keyboard-quit . abort-recursive-edit)) keymap (remap keymap (previous-matching-history-element . selectrum-select-from-history)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (111 . embark-act) (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil file-name-history)
  selectrum-read("Find file: " #f(compiled-function (input) #<bytecode -0x186c65d337d41520>) :default-candidate "~/tmp/" :initial-input "~/tmp/" :history file-name-history :require-match nil :may-modify-candidates t :minibuffer-completion-table read-file-name-internal :minibuffer-completion-predicate file-exists-p)
  selectrum--completing-read-file-name("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil)
  apply(selectrum--completing-read-file-name ("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil))
  #f(compiled-function (&rest args) #<bytecode -0x5bf689d9cc60469>)("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil)
  completing-read("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/")
  read-file-name-default("Find file: " nil "/Users/spd/tmp/" confirm-after-completion nil nil)
  selectrum-read-file-name("Find file: " nil "/Users/spd/tmp/" confirm-after-completion nil nil)
  read-file-name("Find file: " nil "/Users/spd/tmp/" confirm-after-completion)
  find-file-read-args("Find file: " confirm-after-completion)
  byte-code("\300\301\302 \"\207" [find-file-read-args "Find file: " confirm-nonexistent-file-or-buffer] 3)
  call-interactively(find-file nil nil)
  command-execute(find-file)



>>>> window--resize-root-window-vertically
selected frame: #<frame  *Minibuf-1* 0x7ffa290daa30>
selected window: #<window 4 on  *Minibuf-1*>
selected window buffer:  *Minibuf-1*
  backtrace()
  (let ((standard-output (get-buffer-create "*redisplay-minibuffer-log*"))) (princ (format ">>>> %s\n" msg)) (princ (format "selected frame: %s\n" (selected-frame))) (princ (format "selected window: %s\n" (selected-window))) (princ (format "selected window buffer: %s\n" (window-buffer (selected-window)))) (backtrace) (princ "\n\n\n"))
  my/redisplay-minibuffer-log("window--resize-root-window-vertically")
  window--resize-root-window-vertically(#<window 3 on *redisplay-minibuffer-log*> 70 t)
  select-window(#<window 10 on *something*>)
  (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1))))
  (progn (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1)))))
  (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll ...) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p ... win)))) (save-excursion (goto-char (point-max)) (recenter -1))))))
  (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1)))))
  (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll ...) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p ... win)))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win)))
  (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or ... ...)) (and (eq scroll ...) (not ...))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p ... win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not ...))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win))))
  (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (when (= funny str-length) (let (... ...) (while ... ...) (when ... ... ... ... ...))) (let ((old-column ...) (old-point ...) columns) (unless term-suppress-hard-newline (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not ...) (let ... ... ... ...)) (when term-insert-mode (let ... ... ... ...)) (put-text-property old-point (point) 'font-lock-face term-current-face)) (when (eq (term-current-column) term-width) (term-move-columns -1) (setq term-do-line-wrapping (point))) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let (...) (term-move-to-column ...))) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless (and term-kill-echo-list ...) (term-down 1 t))) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function (decode-coding-string ... locale-coding-system t))) (27 (pcase (aref str ...) (91 ...) (68 ... ...) (77 ...) (55 ... ...) (56 ...) (99 ...) (65 ...))) ((or 0 14 15 'nil) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= ... save-marker) (eq scroll t) (eq scroll ...) (and ... ...) (and ... ...)) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not ...) (recenter -1))) (when (and term-scroll-show-maximum-output (>= ... ...) (or term-scroll-snap-to-bottom ...)) (save-excursion (goto-char ...) (recenter -1))))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))
  (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string ... locale-coding-system t)) (when (= funny str-length) (let ... ... ...)) (let (... ... columns) (unless term-suppress-hard-newline ...) (insert decoded-substring) (setq term-current-column ... columns ...) (when ... ...) (when term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (when (eq ... term-width) (term-move-columns -1) (setq term-do-line-wrapping ...)) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let ... ...)) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless ... ...)) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function ...)) (27 (pcase ... ... ... ... ... ... ... ...)) ((or 0 14 15 ...) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or ... ... ... ... ...) (when term-scroll-snap-to-bottom ... ...) (goto-char ...) (if ... ...)) (when (and term-scroll-show-maximum-output ... ...) (save-excursion ... ...)))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))
  (save-current-buffer (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)))
  (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> ... ...) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let (... ... ...) (when ... ... ... ... ... ... ... ...) (pcase-exhaustive ... ... ... ... ... ... ... ... ...) (unless ... ...) (if ... ... ...)))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq ... ...) (let ... ... ... ... ... ...)) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark ...)) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))
  (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (when (= funny str-length) (let (... ...) (while ... ...) (when ... ... ... ... ...))) (let ((old-column ...) (old-point ...) columns) (unless term-suppress-hard-newline (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not ...) (let ... ... ... ...)) (when term-insert-mode (let ... ... ... ...)) (put-text-property old-point (point) 'font-lock-face term-current-face)) (when (eq (term-current-column) term-width) (term-move-columns -1) (setq term-do-line-wrapping (point))) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let (...) (term-move-to-column ...))) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless (and term-kill-echo-list ...) (term-down 1 t))) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function (decode-coding-string ... locale-coding-system t))) (27 (pcase (aref str ...) (91 ...) (68 ... ...) (77 ...) (55 ... ...) (56 ...) (99 ...) (65 ...))) ((or 0 14 15 'nil) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= ... save-marker) (eq scroll t) (eq scroll ...) (and ... ...) (and ... ...)) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not ...) (recenter -1))) (when (and term-scroll-show-maximum-output (>= ... ...) (or term-scroll-snap-to-bottom ...)) (save-excursion (goto-char ...) (recenter -1))))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))
  (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string ... locale-coding-system t)) (when (= funny str-length) (let ... ... ...)) (let (... ... columns) (unless term-suppress-hard-newline ...) (insert decoded-substring) (setq term-current-column ... columns ...) (when ... ...) (when term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (when (eq ... term-width) (term-move-columns -1) (setq term-do-line-wrapping ...)) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let ... ...)) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless ... ...)) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function ...)) (27 (pcase ... ... ... ... ... ... ... ...)) ((or 0 14 15 ...) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or ... ... ... ... ...) (when term-scroll-snap-to-bottom ... ...) (goto-char ...) (if ... ...)) (when (and term-scroll-show-maximum-output ... ...) (save-excursion ... ...)))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)))
  (save-current-buffer (set-buffer (process-buffer proc)) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) (when (get-buffer-window (current-buffer)) (redisplay)))
  (with-current-buffer (process-buffer proc) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) (when (get-buffer-window (current-buffer)) (redisplay)))
  term-emulate-terminal(#<process something> "something\15\n")
  read-from-minibuffer("Find file: " nil (keymap (9 . selectrum-insert-current-candidate) (10 . selectrum-submit-exact-input) (C-M-backspace . backward-kill-sexp) (27 keymap (115 keymap (114 . selectrum-prescient-toggle-regexp) (112 . selectrum-prescient-toggle-prefix) (108 . selectrum-prescient-toggle-literal) (105 . selectrum-prescient-toggle-initialism) (102 . selectrum-prescient-toggle-fuzzy) (97 . selectrum-prescient-toggle-anchored)) (67108991 . backward-kill-sexp)) (remap keymap (previous-matching-history-element . selectrum-select-from-history) (kill-ring-save . selectrum-kill-ring-save) (end-of-buffer . selectrum-goto-end) (beginning-of-buffer . selectrum-goto-beginning) (minibuffer-beginning-of-buffer . selectrum-goto-beginning) (scroll-up-command . selectrum-next-page) (scroll-down-command . selectrum-previous-page) (exit-minibuffer . selectrum-select-current-candidate) (next-line-or-history-element . selectrum-next-candidate) (previous-line-or-history-element . selectrum-previous-candidate) (next-line . selectrum-next-candidate) (previous-line . selectrum-previous-candidate) (minibuffer-keyboard-quit . abort-recursive-edit) (keyboard-quit . abort-recursive-edit)) keymap (remap keymap (previous-matching-history-element . selectrum-select-from-history)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (111 . embark-act) (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil file-name-history)
  selectrum-read("Find file: " #f(compiled-function (input) #<bytecode -0x186c65d337d41520>) :default-candidate "~/tmp/" :initial-input "~/tmp/" :history file-name-history :require-match nil :may-modify-candidates t :minibuffer-completion-table read-file-name-internal :minibuffer-completion-predicate file-exists-p)
  selectrum--completing-read-file-name("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil)
  apply(selectrum--completing-read-file-name ("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil))
  #f(compiled-function (&rest args) #<bytecode -0x5bf689d9cc60469>)("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil)
  completing-read("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/")
  read-file-name-default("Find file: " nil "/Users/spd/tmp/" confirm-after-completion nil nil)
  selectrum-read-file-name("Find file: " nil "/Users/spd/tmp/" confirm-after-completion nil nil)
  read-file-name("Find file: " nil "/Users/spd/tmp/" confirm-after-completion)
  find-file-read-args("Find file: " confirm-after-completion)
  byte-code("\300\301\302 \"\207" [find-file-read-args "Find file: " confirm-nonexistent-file-or-buffer] 3)
  call-interactively(find-file nil nil)
  command-execute(find-file)



>>>> term-emulate-window after selection
selected frame: #<frame *something* 0x7ffa2b5fead8>
selected window: #<window 10 on *something*>
selected window buffer: *something*
  backtrace()
  (let ((standard-output (get-buffer-create "*redisplay-minibuffer-log*"))) (princ (format ">>>> %s\n" msg)) (princ (format "selected frame: %s\n" (selected-frame))) (princ (format "selected window: %s\n" (selected-window))) (princ (format "selected window buffer: %s\n" (window-buffer (selected-window)))) (backtrace) (princ "\n\n\n"))
  my/redisplay-minibuffer-log("term-emulate-window after selection")
  (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1))))
  (progn (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1)))))
  (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll ...) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p ... win)))) (save-excursion (goto-char (point-max)) (recenter -1))))))
  (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1)))))
  (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll ...) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not (pos-visible-in-window-p ... win)))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win)))
  (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or ... ...)) (and (eq scroll ...) (not ...))) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p ... win)) (recenter -1))) (when (and term-scroll-show-maximum-output (>= (point) (process-mark proc)) (or term-scroll-snap-to-bottom (not ...))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win))))
  (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (when (= funny str-length) (let (... ...) (while ... ...) (when ... ... ... ... ...))) (let ((old-column ...) (old-point ...) columns) (unless term-suppress-hard-newline (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not ...) (let ... ... ... ...)) (when term-insert-mode (let ... ... ... ...)) (put-text-property old-point (point) 'font-lock-face term-current-face)) (when (eq (term-current-column) term-width) (term-move-columns -1) (setq term-do-line-wrapping (point))) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let (...) (term-move-to-column ...))) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless (and term-kill-echo-list ...) (term-down 1 t))) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function (decode-coding-string ... locale-coding-system t))) (27 (pcase (aref str ...) (91 ...) (68 ... ...) (77 ...) (55 ... ...) (56 ...) (99 ...) (65 ...))) ((or 0 14 15 'nil) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= ... save-marker) (eq scroll t) (eq scroll ...) (and ... ...) (and ... ...)) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not ...) (recenter -1))) (when (and term-scroll-show-maximum-output (>= ... ...) (or term-scroll-snap-to-bottom ...)) (save-excursion (goto-char ...) (recenter -1))))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))
  (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string ... locale-coding-system t)) (when (= funny str-length) (let ... ... ...)) (let (... ... columns) (unless term-suppress-hard-newline ...) (insert decoded-substring) (setq term-current-column ... columns ...) (when ... ...) (when term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (when (eq ... term-width) (term-move-columns -1) (setq term-do-line-wrapping ...)) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let ... ...)) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless ... ...)) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function ...)) (27 (pcase ... ... ... ... ... ... ... ...)) ((or 0 14 15 ...) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or ... ... ... ... ...) (when term-scroll-snap-to-bottom ... ...) (goto-char ...) (if ... ...)) (when (and term-scroll-show-maximum-output ... ...) (save-excursion ... ...)))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))
  (save-current-buffer (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)))
  (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> ... ...) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let (... ... ...) (when ... ... ... ... ... ... ... ...) (pcase-exhaustive ... ... ... ... ... ... ... ... ...) (unless ... ...) (if ... ... ...)))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq ... ...) (let ... ... ... ... ... ...)) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark ...)) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))
  (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (when (= funny str-length) (let (... ...) (while ... ...) (when ... ... ... ... ...))) (let ((old-column ...) (old-point ...) columns) (unless term-suppress-hard-newline (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not ...) (let ... ... ... ...)) (when term-insert-mode (let ... ... ... ...)) (put-text-property old-point (point) 'font-lock-face term-current-face)) (when (eq (term-current-column) term-width) (term-move-columns -1) (setq term-do-line-wrapping (point))) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let (...) (term-move-to-column ...))) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless (and term-kill-echo-list ...) (term-down 1 t))) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function (decode-coding-string ... locale-coding-system t))) (27 (pcase (aref str ...) (91 ...) (68 ... ...) (77 ...) (55 ... ...) (56 ...) (99 ...) (65 ...))) ((or 0 14 15 'nil) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or (= ... save-marker) (eq scroll t) (eq scroll ...) (and ... ...) (and ... ...)) (when term-scroll-snap-to-bottom (goto-char term-home-marker) (recenter 0)) (goto-char (process-mark proc)) (if (not ...) (recenter -1))) (when (and term-scroll-show-maximum-output (>= ... ...) (or term-scroll-snap-to-bottom ...)) (save-excursion (goto-char ...) (recenter -1))))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))
  (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (when (> funny i) (when term-do-line-wrapping (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil)) (setq decoded-substring (decode-coding-string ... locale-coding-system t)) (when (= funny str-length) (let ... ... ...)) (let (... ... columns) (unless term-suppress-hard-newline ...) (insert decoded-substring) (setq term-current-column ... columns ...) (when ... ...) (when term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (when (eq ... term-width) (term-move-columns -1) (setq term-do-line-wrapping ...)) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and (<= ctl-end str-length) (aref str i)) (9 (let ... ...)) (13 (term-vertical-motion 0) (setq term-current-column term-start-line-column)) (10 (unless ... ...)) (8 (term-move-columns -1)) (7 (beep t)) (26 (funcall term-command-function ...)) (27 (pcase ... ... ... ... ... ... ... ...)) ((or 0 14 15 ...) nil)) (unless (eq term-do-line-wrapping (point)) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when (or ... ... ... ... ...) (when term-scroll-snap-to-bottom ... ...) (goto-char ...) (if ... ...)) (when (and term-scroll-show-maximum-output ... ...) (save-excursion ... ...)))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil)))
  (save-current-buffer (set-buffer (process-buffer proc)) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) (when (get-buffer-window (current-buffer)) (redisplay)))
  (with-current-buffer (process-buffer proc) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (save-selected-window (when (marker-buffer term-pending-delete-marker) (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) (when (/= (point) (process-mark proc)) (setq save-point (point-marker))) (setf term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) (when term-log-buffer (princ str term-log-buffer)) (when term-terminal-undecoded-bytes (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil)) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) (ctl-params-end ...) (ctl-end ...)) (when (> funny i) (when term-do-line-wrapping ... ... ...) (setq decoded-substring ...) (when ... ...) (let ... ... ... ... ... ... ...) (when ... ... ...) (setq term-current-column nil) (setq i funny)) (pcase-exhaustive (and ... ...) (9 ...) (13 ... ...) (10 ...) (8 ...) (7 ...) (26 ...) (27 ...) (... nil)) (unless (eq term-do-line-wrapping ...) (setq term-do-line-wrapping nil)) (if (term-handling-pager) (progn ... ... ... ... ...) (setq i ctl-end))))) (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) (set-marker (process-mark proc) (point)) (when (stringp decoded-substring) (term-watch-for-password-prompt decoded-substring)) (when save-point (goto-char save-point) (set-marker save-point nil)) (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil)) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (when (eq (window-buffer win) (process-buffer proc)) (let (...) (my/redisplay-minibuffer-log "term-emulate-window before selection") (select-window win) (my/redisplay-minibuffer-log "term-emulate-window after selection") (when ... ... ... ...) (when ... ...))) (not (eq win last-win)))) (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process ...))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) (when (get-buffer-window (current-buffer)) (redisplay)))
  term-emulate-terminal(#<process something> "something\15\n")
  read-from-minibuffer("Find file: " nil (keymap (9 . selectrum-insert-current-candidate) (10 . selectrum-submit-exact-input) (C-M-backspace . backward-kill-sexp) (27 keymap (115 keymap (114 . selectrum-prescient-toggle-regexp) (112 . selectrum-prescient-toggle-prefix) (108 . selectrum-prescient-toggle-literal) (105 . selectrum-prescient-toggle-initialism) (102 . selectrum-prescient-toggle-fuzzy) (97 . selectrum-prescient-toggle-anchored)) (67108991 . backward-kill-sexp)) (remap keymap (previous-matching-history-element . selectrum-select-from-history) (kill-ring-save . selectrum-kill-ring-save) (end-of-buffer . selectrum-goto-end) (beginning-of-buffer . selectrum-goto-beginning) (minibuffer-beginning-of-buffer . selectrum-goto-beginning) (scroll-up-command . selectrum-next-page) (scroll-down-command . selectrum-previous-page) (exit-minibuffer . selectrum-select-current-candidate) (next-line-or-history-element . selectrum-next-candidate) (previous-line-or-history-element . selectrum-previous-candidate) (next-line . selectrum-next-candidate) (previous-line . selectrum-previous-candidate) (minibuffer-keyboard-quit . abort-recursive-edit) (keyboard-quit . abort-recursive-edit)) keymap (remap keymap (previous-matching-history-element . selectrum-select-from-history)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (111 . embark-act) (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil file-name-history)
  selectrum-read("Find file: " #f(compiled-function (input) #<bytecode -0x186c65d337d41520>) :default-candidate "~/tmp/" :initial-input "~/tmp/" :history file-name-history :require-match nil :may-modify-candidates t :minibuffer-completion-table read-file-name-internal :minibuffer-completion-predicate file-exists-p)
  selectrum--completing-read-file-name("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil)
  apply(selectrum--completing-read-file-name ("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil))
  #f(compiled-function (&rest args) #<bytecode -0x5bf689d9cc60469>)("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/" nil)
  completing-read("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/tmp/" file-name-history "~/tmp/")
  read-file-name-default("Find file: " nil "/Users/spd/tmp/" confirm-after-completion nil nil)
  selectrum-read-file-name("Find file: " nil "/Users/spd/tmp/" confirm-after-completion nil nil)
  read-file-name("Find file: " nil "/Users/spd/tmp/" confirm-after-completion)
  find-file-read-args("Find file: " confirm-after-completion)
  byte-code("\300\301\302 \"\207" [find-file-read-args "Find file: " confirm-nonexistent-file-or-buffer] 3)
  call-interactively(find-file nil nil)
  command-execute(find-file)

[-- Attachment #2.3: Type: text/html, Size: 5910 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-12 20:23                   ` Sean Devlin
@ 2020-12-13  7:26                     ` martin rudalics
  2020-12-13 16:10                       ` Sean Devlin
  0 siblings, 1 reply; 14+ messages in thread
From: martin rudalics @ 2020-12-13  7:26 UTC (permalink / raw)
  To: Sean Devlin; +Cc: 44933

 > I instrumented the code in a couple key places and then exercised the
 > bug. Attached is the log showing what happened.

I'm afraid you forgot to attach the log.

martin





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-13  7:26                     ` martin rudalics
@ 2020-12-13 16:10                       ` Sean Devlin
  2020-12-14 15:47                         ` martin rudalics
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Devlin @ 2020-12-13 16:10 UTC (permalink / raw)
  To: martin rudalics; +Cc: 44933

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

Hmm, it seems to show up on the web site: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44933#35. Maybe it is getting filtered out somewhere due to size or file extension or something?

> On Dec 13, 2020, at 2:26 AM, martin rudalics <rudalics@gmx.at> wrote:
> 
> > I instrumented the code in a couple key places and then exercised the
> > bug. Attached is the log showing what happened.
> 
> I'm afraid you forgot to attach the log.
> 
> martin

[-- Attachment #2: Type: text/html, Size: 876 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer
  2020-12-13 16:10                       ` Sean Devlin
@ 2020-12-14 15:47                         ` martin rudalics
  0 siblings, 0 replies; 14+ messages in thread
From: martin rudalics @ 2020-12-14 15:47 UTC (permalink / raw)
  To: Sean Devlin; +Cc: 44933

 > Hmm, it seems to show up on the web site:
 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44933#35. Maybe it is
 > getting filtered out somewhere due to size or file extension or
 > something?

The attachment shows up in the source text but Thunderbird refuses to
mention or show it here.  Emacs has also problems showing it, some lines
are over 4000 characters wide.  I have no idea what makes these
backtraces behave so unbridled.  Maybe setting `backtrace-line-length'
to something like 80 would help.

Now the basic problem is that I can see only one
'window--resize-root-window-vertically' call and I'd like to see at
least the one where that minibuffer window was enlarged before.  So
please try to either set `backtrace-line-length' or do not call
'backtrace' at all when logging and in
'window--resize-root-window-vertically' just before it says

;; Return the possibly adjusted DELTA.

add a line putting into the log the values of 'delta' and 'pixel-delta'
and in 'window--resize-mini-window' just before it says

       (unless (zerop delta)

add a line putting into the log the value of 'delta'.  Maybe then we can
tell more.

BTW from

   window--resize-root-window-vertically(#<window 3 on *redisplay-minibuffer-log*> 70 t)

I conclude that the minibuffer window that gets resized is on a frame
with only one other window - the one showing *redisplay-minibuffer-log*
- right?

Thanks, martin





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-12-14 15:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-28 21:21 bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer Sean Devlin
2020-11-29  8:22 ` martin rudalics
2020-11-29 15:43   ` Sean Devlin
2020-11-30  9:04     ` martin rudalics
2020-11-30 19:32       ` Sean Devlin
2020-12-01  9:33         ` martin rudalics
2020-12-01 20:32           ` Sean Devlin
2020-12-02  7:45             ` martin rudalics
2020-12-02  7:52               ` martin rudalics
2020-12-02 18:24                 ` Sean Devlin
2020-12-12 20:23                   ` Sean Devlin
2020-12-13  7:26                     ` martin rudalics
2020-12-13 16:10                       ` Sean Devlin
2020-12-14 15:47                         ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).