unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* scroll-left *Disabled Command* buffer is too short
@ 2007-07-03 11:05 Stephen Berman
  2007-07-03 12:57 ` martin rudalics
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2007-07-03 11:05 UTC (permalink / raw)
  To: bug-gnu-emacs

1. emacs -Q
2. C-x <
3. Now I see this in the lower window:

   You have typed C-x <, invoking disabled command scroll-left.
   It is disabled because new users often find it confusing.
   Here's the first part of its description:
   
      Scroll selected window display ARG columns left.
      Default for ARG is window width minus 2.
      Value is the total amount of leftward horizontal scrolling in
      effect after the change.
      If SET_MINIMUM is non-nil, the new scroll amount becomes the
      lower bound for automatic scrolling, i.e. automatic scrolling
      will not scroll a window to a column less than the value returned
      by this function.  This happens in an interactive call.
   
   Do you want to use this command anyway?
   
   You can now type
   y   to try it and enable it (no questions if you use it again).
   n   to cancel--don't try the command, and it remains disabled.
   SPC to try the command just this once, but leave it disabled.
   
Note that the last line of this buffer:

   !   to try it, and enable all disabled commands for this session only.

is not visible.  And since, after displaying this message,
disabled-command-function awaits user input, there is no way within
Emacs to see that last line before responding.  (It is, however,
possible to see it by using the window manager to increase the height
of the Emacs frame, if the monitor allows it.  But this wouldn't help
if you're running Emacs in a tty with sufficiently few screen lines.)

In GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6) of
2007-06-02 on escher as well as in the current CVS trunk. 

Steve Berman

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 11:05 scroll-left *Disabled Command* buffer is too short Stephen Berman
@ 2007-07-03 12:57 ` martin rudalics
  2007-07-03 14:18   ` Stephen Berman
  0 siblings, 1 reply; 10+ messages in thread
From: martin rudalics @ 2007-07-03 12:57 UTC (permalink / raw)
  To: Stephen Berman; +Cc: bug-gnu-emacs

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

> Note that the last line of this buffer:
> 
>    !   to try it, and enable all disabled commands for this session only.
> 
> is not visible.  And since, after displaying this message,
> disabled-command-function awaits user input, there is no way within
> Emacs to see that last line before responding.  (It is, however,
> possible to see it by using the window manager to increase the height
> of the Emacs frame, if the monitor allows it.  But this wouldn't help
> if you're running Emacs in a tty with sufficiently few screen lines.)

Could you please try the attached patch?

[-- Attachment #2: novice.patch --]
[-- Type: text/plain, Size: 870 bytes --]

*** novice.el	Tue Jan 23 06:40:06 2007
--- novice.el	Tue Jul  3 14:55:20 2007
***************
*** 88,95 ****
  SPC to try the command just this once, but leave it disabled.
  !   to try it, and enable all disabled commands for this session only.")
         (save-excursion
! 	(set-buffer standard-output)
! 	(help-mode)))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
         (while (progn (setq char (read-event))
--- 88,96 ----
  SPC to try the command just this once, but leave it disabled.
  !   to try it, and enable all disabled commands for this session only.")
         (save-excursion
! 	 (set-buffer standard-output)
! 	 (help-mode))
!        (fit-window-to-buffer))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
         (while (progn (setq char (read-event))

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 12:57 ` martin rudalics
@ 2007-07-03 14:18   ` Stephen Berman
  2007-07-03 14:42     ` martin rudalics
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2007-07-03 14:18 UTC (permalink / raw)
  To: bug-gnu-emacs

On Tue, 03 Jul 2007 14:57:27 +0200 martin rudalics <rudalics@gmx.at> wrote:

>> Note that the last line of this buffer:
>>
>>    !   to try it, and enable all disabled commands for this session only.
>>
>> is not visible.  And since, after displaying this message,
>> disabled-command-function awaits user input, there is no way within
>> Emacs to see that last line before responding.  (It is, however,
>> possible to see it by using the window manager to increase the height
>> of the Emacs frame, if the monitor allows it.  But this wouldn't help
>> if you're running Emacs in a tty with sufficiently few screen lines.)
>
> Could you please try the attached patch?

Thiat patch doesn't make the last line visible; instead, it expands the
height of the minibuffer.  However, I played around with the idea and
the following does the job, though the window is actually much higher
than it needs to be.

*** novice.el	2007-01-21 23:44:40.000000000 +0100
--- novice.el	2007-07-03 16:04:45.000000000 +0200
***************
*** 92,97 ****
--- 92,98 ----
  	(help-mode)))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
+        (fit-window-to-buffer)
         (while (progn (setq char (read-event))
  		     (or (not (numberp char))
  			 (not (memq (downcase char)

To be honest, I do not understand why your patch failed, nor why this
one works (better).

Steve Berman

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 14:18   ` Stephen Berman
@ 2007-07-03 14:42     ` martin rudalics
  2007-07-03 15:06       ` Stephen Berman
  0 siblings, 1 reply; 10+ messages in thread
From: martin rudalics @ 2007-07-03 14:42 UTC (permalink / raw)
  To: Stephen Berman; +Cc: bug-gnu-emacs

> Thiat patch doesn't make the last line visible; instead, it expands the
> height of the minibuffer.  

Indeed.  I concentrated to make this work with split windows.

> However, I played around with the idea and
> the following does the job, though the window is actually much higher
> than it needs to be.

We could use `shrink-window-if-larger-than-buffer'.

> 
> *** novice.el	2007-01-21 23:44:40.000000000 +0100
> --- novice.el	2007-07-03 16:04:45.000000000 +0200
> ***************
> *** 92,97 ****
> --- 92,98 ----
>   	(help-mode)))
>        (message "Type y, n, ! or SPC (the space bar): ")
>        (let ((cursor-in-echo-area t))
> +        (fit-window-to-buffer)
>          (while (progn (setq char (read-event))
>   		     (or (not (numberp char))
>   			 (not (memq (downcase char)
> 
> To be honest, I do not understand why your patch failed, nor why this
> one works (better).

Your patch fails with split windows, maybe you could play around a bit more.

Anyway users should be able to scroll the window with the text because the
text might be larger than the frame.

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 14:42     ` martin rudalics
@ 2007-07-03 15:06       ` Stephen Berman
  2007-07-03 15:37         ` martin rudalics
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2007-07-03 15:06 UTC (permalink / raw)
  To: bug-gnu-emacs

On Tue, 03 Jul 2007 16:42:12 +0200 martin rudalics <rudalics@gmx.at> wrote:

> Your patch fails with split windows, maybe you could play around a bit more.

Ok, the following gives good results for single window frames and
vertically split windows (with horizontally split windows the
minibuffer still takes up half the frame height, but the entire text
of *Disabled Command* is still visible):

*** novice.el	2007-01-21 23:44:40.000000000 +0100
--- novice.el	2007-07-03 16:57:33.000000000 +0200
***************
*** 88,95 ****
  SPC to try the command just this once, but leave it disabled.
  !   to try it, and enable all disabled commands for this session only.")
         (save-excursion
! 	(set-buffer standard-output)
! 	(help-mode)))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
         (while (progn (setq char (read-event))
--- 88,96 ----
  SPC to try the command just this once, but leave it disabled.
  !   to try it, and enable all disabled commands for this session only.")
         (save-excursion
! 	 (pop-to-buffer "*Disabled Command*")
! 	 (fit-window-to-buffer)
! 	 (help-mode)))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
         (while (progn (setq char (read-event))

> Anyway users should be able to scroll the window with the text because the
> text might be larger than the frame.

True, but that requires more thinking than I have time for right now :-)

Steve Berman

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 15:06       ` Stephen Berman
@ 2007-07-03 15:37         ` martin rudalics
  2007-07-03 15:52           ` Stephen Berman
  0 siblings, 1 reply; 10+ messages in thread
From: martin rudalics @ 2007-07-03 15:37 UTC (permalink / raw)
  To: Stephen Berman; +Cc: bug-gnu-emacs

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

 > *** novice.el	2007-01-21 23:44:40.000000000 +0100
 > --- novice.el	2007-07-03 16:57:33.000000000 +0200
 > ***************
 > *** 88,95 ****
 >   SPC to try the command just this once, but leave it disabled.
 >   !   to try it, and enable all disabled commands for this session only.")
 >          (save-excursion
 > ! 	(set-buffer standard-output)
 > ! 	(help-mode)))
 >        (message "Type y, n, ! or SPC (the space bar): ")
 >        (let ((cursor-in-echo-area t))
 >          (while (progn (setq char (read-event))
 > --- 88,96 ----
 >   SPC to try the command just this once, but leave it disabled.
 >   !   to try it, and enable all disabled commands for this session only.")
 >          (save-excursion
 > ! 	 (pop-to-buffer "*Disabled Command*")
 > ! 	 (fit-window-to-buffer)
 > ! 	 (help-mode)))
 >        (message "Type y, n, ! or SPC (the space bar): ")
 >        (let ((cursor-in-echo-area t))
 >          (while (progn (setq char (read-event))

`pop-to-buffer' is drastic, I'd prefer something like the attached one
(my earlier patch was wrong because `with-output-to-temp-buffer' first
evaluates the args and then selects the window to show the buffer).

[-- Attachment #2: novice.patch --]
[-- Type: text/plain, Size: 909 bytes --]

*** novice.el	Tue Jan 23 06:40:06 2007
--- novice.el	Tue Jul  3 17:33:24 2007
***************
*** 88,95 ****
  SPC to try the command just this once, but leave it disabled.
  !   to try it, and enable all disabled commands for this session only.")
         (save-excursion
! 	(set-buffer standard-output)
! 	(help-mode)))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
         (while (progn (setq char (read-event))
--- 88,96 ----
  SPC to try the command just this once, but leave it disabled.
  !   to try it, and enable all disabled commands for this session only.")
         (save-excursion
! 	 (set-buffer standard-output)
! 	 (help-mode)))
!      (fit-window-to-buffer (get-buffer-window "*Disabled Command*"))
       (message "Type y, n, ! or SPC (the space bar): ")
       (let ((cursor-in-echo-area t))
         (while (progn (setq char (read-event))

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 15:37         ` martin rudalics
@ 2007-07-03 15:52           ` Stephen Berman
  2007-07-03 20:40             ` martin rudalics
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2007-07-03 15:52 UTC (permalink / raw)
  To: bug-gnu-emacs

On Tue, 03 Jul 2007 17:37:38 +0200 martin rudalics <rudalics@gmx.at> wrote:

> `pop-to-buffer' is drastic, I'd prefer something like the attached one
> (my earlier patch was wrong because `with-output-to-temp-buffer' first
> evaluates the args and then selects the window to show the buffer).

Yes, this is fine.

Steve Berman

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 15:52           ` Stephen Berman
@ 2007-07-03 20:40             ` martin rudalics
  2007-07-03 21:49               ` Stephen Berman
  2007-07-05  1:29               ` Richard Stallman
  0 siblings, 2 replies; 10+ messages in thread
From: martin rudalics @ 2007-07-03 20:40 UTC (permalink / raw)
  To: Stephen Berman; +Cc: bug-gnu-emacs

Just for fun: There's a minor mode called `temp-buffer-resize-mode' I
never heard about before.  In my customization buffer it says

    State: CHANGED outside Customize; operating on it here may be unreliable.

which is a plain mystery to me.  What's your mileage here?  There's also
a function called `resize-temp-buffer-window' which could do something
useful.  The manuals seem to ignore them all.

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 20:40             ` martin rudalics
@ 2007-07-03 21:49               ` Stephen Berman
  2007-07-05  1:29               ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Stephen Berman @ 2007-07-03 21:49 UTC (permalink / raw)
  To: bug-gnu-emacs

On Tue, 03 Jul 2007 22:40:33 +0200 martin rudalics <rudalics@gmx.at> wrote:

> Just for fun: There's a minor mode called `temp-buffer-resize-mode' I
> never heard about before.  In my customization buffer it says
>
>    State: CHANGED outside Customize; operating on it here may be unreliable.
>
> which is a plain mystery to me.  What's your mileage here?

Same, in fact, it's the same with emacs -Q and a grep of the sources
didn't show it being set anywhere.  I tried to use it in
disabled-command-function but couldn't get good results.

>                                                             There's also
> a function called `resize-temp-buffer-window' which could do something
> useful.

With this the *Disabled Command* buffer is completely visible;
however, it's too big, even though resize-temp-buffer-window calls
fit-window-to-buffer.  So I think your last proposed fix is the best
so far.

Steve Berman

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

* Re: scroll-left *Disabled Command* buffer is too short
  2007-07-03 20:40             ` martin rudalics
  2007-07-03 21:49               ` Stephen Berman
@ 2007-07-05  1:29               ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2007-07-05  1:29 UTC (permalink / raw)
  To: martin rudalics; +Cc: bug-gnu-emacs, Stephen.Berman

    Just for fun: There's a minor mode called `temp-buffer-resize-mode' I
    never heard about before.  In my customization buffer it says

	State: CHANGED outside Customize; operating on it here may be unreliable.

This could mean that this variable needs to be specially handled with
`custom-reevaluate-setting' in startup.el.

A couple of years ago we discovered that several custom variables needed
some sort of special handling in startup.el to prevent them from being
considered "changed outside Customize".  But we did not handle them all.
Does someone remember this?  Can someone find the list of those variables?
Now would be a good time to handle them all.

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

end of thread, other threads:[~2007-07-05  1:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 11:05 scroll-left *Disabled Command* buffer is too short Stephen Berman
2007-07-03 12:57 ` martin rudalics
2007-07-03 14:18   ` Stephen Berman
2007-07-03 14:42     ` martin rudalics
2007-07-03 15:06       ` Stephen Berman
2007-07-03 15:37         ` martin rudalics
2007-07-03 15:52           ` Stephen Berman
2007-07-03 20:40             ` martin rudalics
2007-07-03 21:49               ` Stephen Berman
2007-07-05  1:29               ` Richard Stallman

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).