all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 29d1c72: Introduce new value t for compilation-context-lines to eliminate scrolling
Date: Thu, 29 Aug 2019 21:22:06 +0300	[thread overview]
Message-ID: <8336hjbzn5.fsf@gnu.org> (raw)
In-Reply-To: <20190827200520.GC20676@ACM> (message from Alan Mackenzie on Tue,  27 Aug 2019 20:05:20 +0000)

> Date: Tue, 27 Aug 2019 20:05:20 +0000
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > > Should I have been aware of this?
> 
> > What is "this" in this context?  The display margins or how to use
> > them with overlays?
> 
> I think, more the first of these.
> 
> > > Somehow, in the elisp manual, it seems buried under several levels
> > > of chapters, sections, and sub-sections.

The subsection describing the display margins is part of the section
which documents the 'display' properties in general, so I think it's
in a correct and logical place.

Where would you expect it to be mentioned, not to be "buried"?

> I found implementing these margins (see patch in separate post) to be
> particularly difficult.  There is no complete example of how to do this
> on the "Display Margins" elisp manual page.

Feel free to provide an example.  The simplest way, one that doesn't
use an overlay string, is just setting a display property on buffer
text, something that hardly needs an example.

> There, the word "property" is used, rather than "text property or
> overlay property", leaving me uncertain of whether I could have
> implemented this "=>" in the margin solely with overlays.

This is a subsection of a section about 'display' property, which is
only available for text in buffers and Lisp strings, not for overlays.
One should read the manual in the context of the parent sections.

> I was uncertain, right up till near when I had the thing ready,
> whether the variables implementing this need to be buffer local or
> not.

Which variables?  And why did you think they need to be buffer-local?
Text properties already localize their values enough, so there should
be no need for anything buffer-local.  That's in general, not only for
the display properties.

> Also, the setup seems wierd.  Why isn't there a direct `margin' overlay
> property, much the same way there's a `before-string' overlay property?

Because no one wrote the code to do that.  This is a display property,
so you can put it on buffer text or on a Lisp string, in particular on
a Lisp string that is before- or after-string of an overlay.

> Instead, what we have is a required "dummy" `before-string', which is
> supplanted by a `display' text property on it.  It just seems a strange
> way of implementing it.  This certainly doesn't promote easy
> understanding.  IMHO, of course.

Display properties (really, any "replacing" properties) are tricky in
implementation, you should look up the code some day.  Then you will
maybe understand why no one ever wanted to add one more such
facility.  The way of using the display properties to display in the
margins was originally implemented only for buffer text; placing it on
overlay strings had bugs until Emacs 24 or 25, I think.

In any case, the ELisp manual describes this possibility, precisely
because it is not easy to come up on one's own.  So I think we are OK
here, documentation-wise.



  reply	other threads:[~2019-08-29 18:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190825102322.19558.22771@vcs0.savannah.gnu.org>
     [not found] ` <20190825102323.5080620CD5@vcs0.savannah.gnu.org>
2019-08-25 18:39   ` [Emacs-diffs] master 29d1c72: Introduce new value t for compilation-context-lines to eliminate scrolling Stefan Monnier
2019-08-25 19:06     ` Alan Mackenzie
2019-08-25 19:37       ` Eli Zaretskii
2019-08-26 16:26         ` Alan Mackenzie
2019-08-26 16:29           ` Eli Zaretskii
2019-08-27 20:05             ` Alan Mackenzie
2019-08-29 18:22               ` Eli Zaretskii [this message]
2019-08-31 10:53                 ` Alan Mackenzie
2019-08-31 11:06                   ` Eli Zaretskii
2019-09-02 19:34                     ` Alan Mackenzie
2019-09-03  2:25                       ` Eli Zaretskii
2019-09-08  9:41                     ` Margins example in the Elisp manual. [Was: [Emacs-diffs] master 29d1c72: Introduce new value t for compilation-context-lines to eliminate scrolling] Alan Mackenzie
2019-09-08 17:06                       ` Eli Zaretskii
2019-08-27 19:36         ` [Emacs-diffs] master 29d1c72: Introduce new value t for compilation-context-lines to eliminate scrolling Alan Mackenzie
2019-08-27 19:49           ` Eli Zaretskii
2019-08-27 20:07             ` Stefan Monnier
2019-08-27 19:59           ` Stefan Monnier
2019-08-31 11:31             ` Alan Mackenzie
2019-08-31 12:07               ` martin rudalics
2019-08-31 12:45                 ` Alan Mackenzie
2019-08-25 20:54       ` Stefan Monnier
2019-08-27 19:46         ` Alan Mackenzie
2019-08-27 20:05           ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=8336hjbzn5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.