unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Paul W. Rankin" via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Troubleshooting window-toggle-side-windows command with olivetti
Date: Sun, 24 Sep 2023 16:53:44 +1000	[thread overview]
Message-ID: <89a804939082c1c6a1e8aa6f5d839144@purelymail.com> (raw)

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



             reply	other threads:[~2023-09-24  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24  6:53 Paul W. Rankin via Users list for the GNU Emacs text editor [this message]
2023-09-24 12:58 ` Troubleshooting window-toggle-side-windows command with olivetti Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89a804939082c1c6a1e8aa6f5d839144@purelymail.com \
    --to=help-gnu-emacs@gnu.org \
    --cc=hello@paulwrankin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).