unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Troubleshooting window-toggle-side-windows command with olivetti
@ 2023-09-24  6:53 Paul W. Rankin via Users list for the GNU Emacs text editor
  2023-09-24 12:58 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Paul W. Rankin via Users list for the GNU Emacs text editor @ 2023-09-24  6:53 UTC (permalink / raw)
  To: help-gnu-emacs

A package I maintain is causing an error with the command 
`window-toggle-side-windows' and I'm at a loss for answers.

The package is olivetti and it automatically balances the window margins 
to create a word processor style UI. Here is the source (509 L): 
https://github.com/rnkn/olivetti/blob/master/olivetti.el

Sorry I really hate to ask about an issue that requires loading 
third-party code but I'm kinda at a dead end...

To reproduce:

1. emacs -Q
2. M-x load-file RET path/to/olivetti.el
3. M-x olivetti-mode
4. M-: (display-buffer-in-side-window (get-buffer-create "side") '((side 
. left)))
5. M-x window-toggle-side-windows [2 times]

Results:

Error backtrace:

Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
   select-window(nil)
   window--state-put-2(t 855)
   window-state-put((((min-height . 4) (min-width . 70) 
(min-height-ignore . 3) (min-width-ignore . 62) (min-height-safe . 1) 
(min-width-safe . 4) (min-pixel-height . 60) (min-pixel-width . 560) 
(min-pixel-height-ignore . 45) (min-pixel-width-ignore . 496) 
(min-pixel-height-safe . 15) (min-pixel-width-safe . 32)) hc 
(pixel-width . 1408) (pixel-height . 855) (total-width . 176) 
(total-height . 57) (normal-height . 1.0) (normal-width . 1.0) 
(combination-limit . t) (parameters (clone-of . #<window 6>)) (leaf 
(pixel-width . 352) (pixel-height . 855) (total-width . 44) 
(total-height . 57) (normal-height . 1.0) (normal-width . 0.25) 
(parameters (clone-of . #<window 7>) (window-side . left) (window-slot . 
0)) (buffer #<buffer side> (selected) (hscroll . 0) (fringes 0 0 nil 
nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) 
(dedicated . side) (point . #<marker at 1 in side>) (start . #<marker at 
1 in side>))) (leaf (last . t) (pixel-width . 1056) (pixel-height . 855) 
(total-width . 132) (total-height . 57) (normal-height . 1.0) 
(normal-width . 0.75) (parameters (clone-of . #<window 3>)) (buffer 
#<buffer *scratch*> (selected . t) (hscroll . 0) (fringes 168 168 t nil) 
(margins 8 . 8) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) 
(dedicated) (point . #<marker at 1 in *scratch*>) (start . #<marker at 1 
in *scratch*>)))) #<window 11 on *scratch*> t)
   window-toggle-side-windows()
   funcall-interactively(window-toggle-side-windows)
   call-interactively(window-toggle-side-windows record nil)
   command-execute(window-toggle-side-windows record)
   execute-extended-command(nil "window-toggle-side-windows" nil)
   funcall-interactively(execute-extended-command nil 
"window-toggle-side-windows" nil)
   call-interactively(execute-extended-command nil nil)
   command-execute(execute-extended-command)


I've followed the debugger to `window--state-put-2' where it retrieves 
`window-state-put-list' and seems to want a live window as the car of 
that list, however when olivetti is enabled it is getting nil. I don't 
know why.

Any help would be much appreciated. I'm sure it's something dumb like I 
don't have the right hooks enabled...

Thanks,

-- 
Paul W. Rankin
https://www.paulwrankin.com



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

* Re: Troubleshooting window-toggle-side-windows command with olivetti
  2023-09-24  6:53 Troubleshooting window-toggle-side-windows command with olivetti Paul W. Rankin via Users list for the GNU Emacs text editor
@ 2023-09-24 12:58 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-09-24 12:58 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 24 Sep 2023 16:53:44 +1000
> From:  "Paul W. Rankin" via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> 1. emacs -Q
> 2. M-x load-file RET path/to/olivetti.el
> 3. M-x olivetti-mode
> 4. M-: (display-buffer-in-side-window (get-buffer-create "side") '((side 
> . left)))
> 5. M-x window-toggle-side-windows [2 times]
> 
> Results:
> 
> Error backtrace:
> 
> Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
>    select-window(nil)
>    window--state-put-2(t 855)
>    window-state-put((((min-height . 4) (min-width . 70) 
> (min-height-ignore . 3) (min-width-ignore . 62) (min-height-safe . 1) 
> (min-width-safe . 4) (min-pixel-height . 60) (min-pixel-width . 560) 
> (min-pixel-height-ignore . 45) (min-pixel-width-ignore . 496) 
> (min-pixel-height-safe . 15) (min-pixel-width-safe . 32)) hc 
> (pixel-width . 1408) (pixel-height . 855) (total-width . 176) 
> (total-height . 57) (normal-height . 1.0) (normal-width . 1.0) 
> (combination-limit . t) (parameters (clone-of . #<window 6>)) (leaf 
> (pixel-width . 352) (pixel-height . 855) (total-width . 44) 
> (total-height . 57) (normal-height . 1.0) (normal-width . 0.25) 
> (parameters (clone-of . #<window 7>) (window-side . left) (window-slot . 
> 0)) (buffer #<buffer side> (selected) (hscroll . 0) (fringes 0 0 nil 
> nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) 
> (dedicated . side) (point . #<marker at 1 in side>) (start . #<marker at 
> 1 in side>))) (leaf (last . t) (pixel-width . 1056) (pixel-height . 855) 
> (total-width . 132) (total-height . 57) (normal-height . 1.0) 
> (normal-width . 0.75) (parameters (clone-of . #<window 3>)) (buffer 
> #<buffer *scratch*> (selected . t) (hscroll . 0) (fringes 168 168 t nil) 
> (margins 8 . 8) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) 
> (dedicated) (point . #<marker at 1 in *scratch*>) (start . #<marker at 1 
> in *scratch*>)))) #<window 11 on *scratch*> t)
>    window-toggle-side-windows()
>    funcall-interactively(window-toggle-side-windows)
>    call-interactively(window-toggle-side-windows record nil)
>    command-execute(window-toggle-side-windows record)
>    execute-extended-command(nil "window-toggle-side-windows" nil)
>    funcall-interactively(execute-extended-command nil 
> "window-toggle-side-windows" nil)
>    call-interactively(execute-extended-command nil nil)
>    command-execute(execute-extended-command)
> 
> 
> I've followed the debugger to `window--state-put-2' where it retrieves 
> `window-state-put-list' and seems to want a live window as the car of 
> that list, however when olivetti is enabled it is getting nil. I don't 
> know why.

Crystal ball says this has something to do with the fact that
olivetti.el does

      (set-window-parameter window 'split-window 'olivetti-split-window)

and window-state-put calls split-window.



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

end of thread, other threads:[~2023-09-24 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-24  6:53 Troubleshooting window-toggle-side-windows command with olivetti Paul W. Rankin via Users list for the GNU Emacs text editor
2023-09-24 12:58 ` Eli Zaretskii

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