unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode
@ 2021-10-05  9:55 Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-10-05 21:39 ` Stefan Kangas
  2021-10-06 19:45 ` bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 9+ messages in thread
From: Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-10-05  9:55 UTC (permalink / raw)
  To: 51029


*** Steps to reproduce:

1. emacs -Q
2. Optionally: (require 'ibuffer)
3. (setq ibuffer-default-shrink-to-minimum-size t)
4. M-x ibuffer


*** Result:

*Messages*

Updating buffer list...
Formats have changed, recompiling...done
Updating buffer list...done
ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode


*Backtrace*

Debugger entered--Lisp error: (void-variable ibuffer-auto-mode)
  buffer-local-value(ibuffer-auto-mode #<buffer *Ibuffer*>)
  ibuffer-shrink-to-fit()
  ibuffer-update(nil)
  ibuffer(nil)
  funcall-interactively(ibuffer nil)
  call-interactively(ibuffer record nil)
  command-execute(ibuffer record)
  execute-extended-command(nil "ibuffer" #("ibu" 0 2 (fontified t) 2 3 (fontified nil)))
  funcall-interactively(execute-extended-command nil "ibuffer" #("ibu" 0 2 (fontified t) 2 3 (fontified nil)))
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)


In GNU Emacs 28.0.60 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G9216))
 of 2021-10-01
Repository revision: 5ee5a90213f6a6cac31fc849af6bf152756292e3
Repository branch: emacs-28
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.6





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

* bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode
  2021-10-05  9:55 bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-10-05 21:39 ` Stefan Kangas
  2021-10-06 19:45 ` bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Kangas @ 2021-10-05 21:39 UTC (permalink / raw)
  To: Y. E.; +Cc: 51029

close 51029 28.1
thanks

Y. E. <yet@ego.team> writes:

> *** Steps to reproduce:
>
> 1. emacs -Q
> 2. Optionally: (require 'ibuffer)
> 3. (setq ibuffer-default-shrink-to-minimum-size t)
> 4. M-x ibuffer

Thank you for the very clear and easily reproducible bug report!

I have now fixed this on the emacs-28 branch (commit ead5c5cc51).
This fix will be a part of the upcoming Emacs 28.1.

Please verify that this fix works for you, but for now I'm closing this
bug report.  If you see anything that is wrong, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.  You could also just report a new bug.





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

* bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer
  2021-10-05  9:55 bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-10-05 21:39 ` Stefan Kangas
@ 2021-10-06 19:45 ` Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-10-06 23:00   ` Stefan Kangas
  1 sibling, 1 reply; 9+ messages in thread
From: Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-10-06 19:45 UTC (permalink / raw)
  To: 51029; +Cc: Stefan Kangas


This is a follow-up to Bug#51029.
It seems there's more to fix.

Steps to reproduce:

1. emacs -Q
2. (setq ibuffer-default-shrink-to-minimum-size t)
3. M-x ibuffer-other-window
4. *Ibuffer* isn't shrinked

[Because ibuffer-auto-mode is not bound and hence fit-window-to-buffer
is not called.]

Thank you.






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

* bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer
  2021-10-06 19:45 ` bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-10-06 23:00   ` Stefan Kangas
  2021-10-07  9:07     ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2021-10-06 23:00 UTC (permalink / raw)
  To: Y. E., 51029

reopen 51029
thanks

Y. E. <yet@ego.team> writes:

> This is a follow-up to Bug#51029.
> It seems there's more to fix.
>
> Steps to reproduce:
>
> 1. emacs -Q
> 2. (setq ibuffer-default-shrink-to-minimum-size t)
> 3. M-x ibuffer-other-window
> 4. *Ibuffer* isn't shrinked
>
> [Because ibuffer-auto-mode is not bound and hence fit-window-to-buffer
> is not called.]

Thanks for following up on this.  So the fix I installed avoided the
backtrace, but it didn't lead to the behavior you want, i.e. the one
promised by `ibuffer-default-shrink-to-minimum-size'.

From reading the code it seems here that the intention is that
`ibuffer-default-shrink-to-minimum-size' should only work when
`ibuffer-auto-mode' is also enabled?  But that is not documented, is it?

Does anyone know how any of this is actually supposed to work?





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

* bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer
  2021-10-06 23:00   ` Stefan Kangas
@ 2021-10-07  9:07     ` martin rudalics
  2021-10-07 14:48       ` Stefan Kangas
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2021-10-07  9:07 UTC (permalink / raw)
  To: Stefan Kangas, Y. E., 51029

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

 >> 1. emacs -Q
 >> 2. (setq ibuffer-default-shrink-to-minimum-size t)
 >> 3. M-x ibuffer-other-window
 >> 4. *Ibuffer* isn't shrinked
 >>
 >> [Because ibuffer-auto-mode is not bound and hence fit-window-to-buffer
 >> is not called.]
 >
 > Thanks for following up on this.  So the fix I installed avoided the
 > backtrace, but it didn't lead to the behavior you want, i.e. the one
 > promised by `ibuffer-default-shrink-to-minimum-size'.
 >
 >>From reading the code it seems here that the intention is that
 > `ibuffer-default-shrink-to-minimum-size' should only work when
 > `ibuffer-auto-mode' is also enabled?  But that is not documented, is it?
 >
 > Does anyone know how any of this is actually supposed to work?

I suppose the attached would fix it.

martin

[-- Attachment #2: ibuffer.el.diff --]
[-- Type: text/x-patch, Size: 645 bytes --]

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 046595a4d9..e5095455c2 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1079,8 +1079,8 @@ ibuffer-shrink-to-fit
   ;; Make sure that redisplay is performed, otherwise there can be a
   ;; bad interaction with code in the window-scroll-functions hook
   (redisplay t)
-  (when (and (boundp 'ibuffer-auto-mode) ; ibuf-ext.el might not be loaded yet
-             (buffer-local-value 'ibuffer-auto-mode (window-buffer)))
+  (when (with-current-buffer (window-buffer)
+          (eq major-mode 'ibuffer-mode))
     (fit-window-to-buffer
      nil (and owin
               (/ (frame-height)

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

* bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer
  2021-10-07  9:07     ` martin rudalics
@ 2021-10-07 14:48       ` Stefan Kangas
  2021-10-09  8:25         ` Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2021-10-07 14:48 UTC (permalink / raw)
  To: martin rudalics, Y. E., 51029

tags 51029 + patch
thanks

martin rudalics <rudalics@gmx.at> writes:

>  > Does anyone know how any of this is actually supposed to work?
>
> I suppose the attached would fix it.

Thanks.

Y. E., could you please check if this patch fixes the issue for you?





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

* bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer
  2021-10-07 14:48       ` Stefan Kangas
@ 2021-10-09  8:25         ` Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-10-11 14:32           ` bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode Stefan Kangas
  0 siblings, 1 reply; 9+ messages in thread
From: Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-10-09  8:25 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: rudalics, yet, 51029


> > I suppose the attached would fix it.

> Y. E., could you please check if this patch fixes the issue for you?

Yes, the patch works fine for me, thank you.






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

* bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode
  2021-10-09  8:25         ` Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-10-11 14:32           ` Stefan Kangas
  2021-10-11 17:06             ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2021-10-11 14:32 UTC (permalink / raw)
  To: Y. E.; +Cc: 51029

Y. E. <yet@ego.team> writes:

>> > I suppose the attached would fix it.
>
>> Y. E., could you please check if this patch fixes the issue for you?
>
> Yes, the patch works fine for me, thank you.

Martin, could you install the patch on emacs-28 or master according to
what you think is best?  Thanks.





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

* bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode
  2021-10-11 14:32           ` bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode Stefan Kangas
@ 2021-10-11 17:06             ` martin rudalics
  0 siblings, 0 replies; 9+ messages in thread
From: martin rudalics @ 2021-10-11 17:06 UTC (permalink / raw)
  To: Stefan Kangas, Y. E.; +Cc: 51029

close 51029 28.1
quit

 > Martin, could you install the patch on emacs-28 or master according to
 > what you think is best?  Thanks.

Installed on the release branch to avoid a regression wrt Emacs 27.
Closing this bug, hopefully.

martin





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

end of thread, other threads:[~2021-10-11 17:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  9:55 bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-05 21:39 ` Stefan Kangas
2021-10-06 19:45 ` bug#51029: 28.0.60; Follow-up to Bug#51029: ibuffer-shrink-to-fit does not call fit-window-to-buffer Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-06 23:00   ` Stefan Kangas
2021-10-07  9:07     ` martin rudalics
2021-10-07 14:48       ` Stefan Kangas
2021-10-09  8:25         ` Y. E. via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-11 14:32           ` bug#51029: 28.0.60; ibuffer-shrink-to-fit: Symbol’s value as variable is void: ibuffer-auto-mode Stefan Kangas
2021-10-11 17:06             ` 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).