unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 57813@debbugs.gnu.org
Subject: bug#57813: Icon images are non-functional
Date: Sun, 18 Sep 2022 21:46:07 +0300	[thread overview]
Message-ID: <86mtawil7s.fsf@mail.linkov.net> (raw)
In-Reply-To: <83tu55z2vf.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 18 Sep 2022 08:08:04 +0300")

>> Here is a preliminary patch, but using buffer-local left-margin-width
>> exhibits strange behavior: margins don't always appear immediately
>> after switching the buffer.
>
> Margins are specific to a window, not to a buffer.  See the
> description of set-window-margins in the ELisp manual, and the
> accompanying description of set-window-buffer there.

 -- Function: set-window-buffer window buffer-or-name &optional
          keep-margins
     ...
     By default, this function resets WINDOW’s position, display
     margins, fringe widths, and scroll bar settings, based on the local
     variables in the specified buffer.  However, if the optional
     argument KEEP-MARGINS is non-‘nil’, it leaves WINDOW’s display
     margins, fringes and scroll bar settings alone.

KEEP-MARGINS is nil by default, so buffer-local 'left-margin-width'
should work as described:

 -- Variable: left-margin-width
     This variable specifies the width of the left margin, in character
     cell (a.k.a. “column”) units.  It is buffer-local in all buffers.
     A value of ‘nil’ means no left marginal area.

And indeed, 'left-margin-width' works fine.  The only problem is
with 'C-h n' that doesn't show margins immediately, only after
switching to another buffer and back.  Then afterwards buffer-local
margins are kept in etc/NEWS as well.  It can be fixed by:

diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index 88e8948060..9b99740290 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -80,6 +80,7 @@ emacs-news--mode-common
               outline-minor-mode-cycle t
               outline-minor-mode-highlight 'append)
   (outline-minor-mode)
+  (set-window-buffer nil (current-buffer))
   (emacs-etc--hide-local-variables))





  reply	other threads:[~2022-09-18 18:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 19:40 bug#57813: Icon images are non-functional Juri Linkov
2022-09-15 16:30 ` Juri Linkov
2022-09-15 16:36   ` Juri Linkov
2022-09-15 16:53     ` Eli Zaretskii
2022-09-15 17:35       ` Juri Linkov
2022-09-15 18:32         ` Eli Zaretskii
2022-09-15 19:46           ` Juri Linkov
2022-09-16 16:16             ` Juri Linkov
2022-09-15 19:53   ` Juri Linkov
2022-09-16  5:29     ` Eli Zaretskii
2022-09-16  7:09       ` Juri Linkov
2022-09-17 19:37         ` Juri Linkov
2022-09-18  5:08           ` Eli Zaretskii
2022-09-18 18:46             ` Juri Linkov [this message]
2022-09-18  5:17           ` Eli Zaretskii
2022-09-18 19:06             ` Juri Linkov
2022-09-19 12:12               ` Eli Zaretskii
2022-09-19 19:37                 ` Juri Linkov
2022-09-20 11:31                   ` Eli Zaretskii
2022-09-20 16:12                     ` Juri Linkov
2022-09-23 15:48     ` Juri Linkov
2022-09-23 16:26       ` Lars Ingebrigtsen
2022-09-24 17:17         ` Juri Linkov
2022-10-12 14:42           ` Max Brieiev
2022-10-12 18:55             ` Juri Linkov
2022-10-23 16:55               ` Juri Linkov
2022-10-13  7:51 ` Juri Linkov
2022-10-18 18:14   ` Juri Linkov
2022-10-18 18:35     ` Juri Linkov
2022-10-19  6:44       ` Juri Linkov
2022-10-22 18:38         ` Juri Linkov

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=86mtawil7s.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=57813@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.
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).