[emacs-w3m:13930] Re: [emacs-w3m/emacs-w3m] Doesn't work correctly with display-line-numbers-mode (Issue #117)
yamaoka <[email protected]> Mon, 24 Apr 2023 22:41:50 -0700
| Newsgroups | gmane.emacs.w3m |
|---|---|
| Message-ID | <emacs-w3m/emacs-w3m/issues/117/[email protected]> |
----==_mimepart_6447681e65a00_52f4c97c1680a9
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
> I think w3m should either subtract `line-number-display-width` from `window-width` in `w3m-display-width`
Emacs-w3m works mainly in a temporary working buffer, and displays the result in the page buffer, i.e., the buffer that
renders a web page. So, what we need to have in order to adjust the window width value would be a means to know,
in a temp buffer, the value of `line-number-display-width` measured in the page buffer.
However, it looks hard or impossible to me. I've never gotten (2 2) with trials like this:
```
(let ((cur (current-buffer))
(w3m-session-load-crashed-sessions nil)
page-buffer w1 w2)
(w3m "about:")
(sit-for 1)
(display-line-numbers-mode t)
(sit-for 1)
(setq page-buffer (current-buffer)
w1 (line-number-display-width))
(switch-to-buffer cur)
(sit-for 1)
(save-window-excursion
(set-window-buffer nil page-buffer)
(sit-for 1)
(setq w2 (line-number-display-width))
(message "Line numbers width is: %d" w2)
(sit-for 1))
(kill-buffer page-buffer)
(list w1 w2))
=> (2 0)
```
> or forcefully disable `display-line-numbers-mode` when it is enabled globally.
This might be the only thing we can do.
--
Reply to this email directly or view it on GitHub:
https://github.com/emacs-w3m/emacs-w3m/issues/117#issuecomment-1521181037
You are receiving this because you are subscribed to this thread.
Message ID: <emacs-w3m/emacs-w3m/issues/117/[email protected]>
----==_mimepart_6447681e65a00_52f4c97c1680a9
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p></p>
<blockquote>
<p dir="auto">I think w3m should either subtract <code class="notranslate">line-number-display-width</code> from <code class="notranslate">window-width</code> in <code class="notranslate">w3m-display-width</code></p>
</blockquote>
<p dir="auto">Emacs-w3m works mainly in a temporary working buffer, and displays the result in the page buffer, i.e., the buffer that<br>
renders a web page. So, what we need to have in order to adjust the window width value would be a means to know,<br>
in a temp buffer, the value of <code class="notranslate">line-number-display-width</code> measured in the page buffer.</p>
<p dir="auto">However, it looks hard or impossible to me. I've never gotten (2 2) with trials like this:</p>
<pre class="notranslate"><code class="notranslate">(let ((cur (current-buffer))
(w3m-session-load-crashed-sessions nil)
page-buffer w1 w2)
(w3m "about:")
(sit-for 1)
(display-line-numbers-mode t)
(sit-for 1)
(setq page-buffer (current-buffer)
w1 (line-number-display-width))
(switch-to-buffer cur)
(sit-for 1)
(save-window-excursion
(set-window-buffer nil page-buffer)
(sit-for 1)
(setq w2 (line-number-display-width))
(message "Line numbers width is: %d" w2)
(sit-for 1))
(kill-buffer page-buffer)
(list w1 w2))
=> (2 0)
</code></pre>
<blockquote>
<p dir="auto">or forcefully disable <code class="notranslate">display-line-numbers-mode</code> when it is enabled globally.</p>
</blockquote>
<p dir="auto">This might be the only thing we can do.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/emacs-w3m/emacs-w3m/issues/117#issuecomment-1521181037">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ALIUPN5U2YSPLT2TKB23HO3XC5PZ5ANCNFSM6AAAAAAXIBYK24">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ALIUPNY3YZDFTPGVH4VZ72TXC5PZ5A5CNFSM6AAAAAAXIBYK26WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS2VNQW2.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">
Message ID: <span><emacs-w3m/emacs-w3m/issues/117/1521181037</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/emacs-w3m/emacs-w3m/issues/117#issuecomment-1521181037",
"url": "https://github.com/emacs-w3m/emacs-w3m/issues/117#issuecomment-1521181037",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>
----==_mimepart_6447681e65a00_52f4c97c1680a9--