unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Colin Walters <walters@verbum.org>
Subject: Re: Question about copy-region-as-kill
Date: 07 Apr 2002 03:46:33 -0400	[thread overview]
Message-ID: <1018165593.4269.27.camel@space-ghost> (raw)
In-Reply-To: <87bscwc84q.fsf@tc-1-100.kawasaki.gol.ne.jp>

[ No need to CC me, by the way; I read this list ]

On Sun, 2002-04-07 at 01:53, Miles Bader wrote:

> I don't think the concept of a `primary purpose' is all that useful,
> since it's rather objective; the original reason may be different that
> current thinking, and one person's view may differ from another's.

Fair enough.

> >From my point of view, the _most_ important thing about overlays is that
> they are distinct objects that are distinct from the text, and interact
> with text properties and other overlays.

Indeed.  But extents provide these same advantages.  And it should not
be difficult to write a text properties API on top of an extents
mechanism.  So extents give you the best of all possible worlds, AFAICS.

Since I have the feeling that we are at this point arguing by repeated
assertion, let me paste here the description of the problem I ran into
using overlays for ibuffer, when RMS originally asked me why I thought
overlays had a poor interface:

> [ RMS asks why the overlay interface is bad ]

I don't like it because it forces me to use a completely different API
depending on whether or not I want the properties to be specific to the
buffer or not, despite the fact that I want the properties to actually
be associated with the text, not a specific region of the buffer.

As an example, when you define an ibuffer column, you can optionally
specify properties along with the text.  For example:

(define-ibuffer-column mode (:inline t
                             :props
                             ('mouse-face 'highlight
                              'keymap ibuffer-mode-name-map
                              'help-echo "mouse-2: filter by this mode"))
  (format "%s" mode-name))

This macroexpands to code that does:

(propertize (format "%s" mode-name) 'mouse-face 'highlight ...)

And then the ibuffer display function calls that bit of code, which
simply inserts the text, and it will have those associated properties. 
However, I *do* want those properties to be specific to the ibuffer
buffer!

To achieve both effects, I could make the code macroexpand to something
like

(list (format "%s" mode-name) '(mouse-face highlight ...))

And then the ibuffer display algorithm could save the value of point,
insert the text, make an overlay between the old value of point, and
finally put the properties on that overlay.  But that's pretty ugly. 
And ugly code leads me to conclude that I have the wrong approach.

  reply	other threads:[~2002-04-07  7:46 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-03 23:23 Question about copy-region-as-kill John Wiegley
2002-04-05  6:02 ` Richard Stallman
2002-04-05 21:39   ` John Wiegley
2002-04-06  7:19     ` Eli Zaretskii
2002-04-06  8:21       ` John Wiegley
2002-04-06 10:29         ` Karl Eichwalder
2002-04-06 17:46           ` Kai Großjohann
2002-04-06 18:05             ` Alex Schroeder
2002-04-07 18:50               ` Richard Stallman
2002-04-08  1:23                 ` Miles Bader
2002-04-06 18:30             ` Karl Eichwalder
2002-04-06 23:03               ` Alan Shutko
2002-04-07  7:42                 ` Karl Eichwalder
2002-04-08 15:53                   ` Stefan Monnier
2002-04-08 21:21                     ` John Wiegley
2002-04-09  9:31                       ` Kim F. Storm
2002-04-09 11:03                         ` Eli Zaretskii
2002-04-09 10:23                           ` Miles Bader
2002-04-09 13:05                             ` Kim F. Storm
2002-04-09 13:24                               ` Miles Bader
2002-04-09 14:42                               ` Eli Zaretskii
2002-04-10 14:24                           ` Richard Stallman
2002-04-10 14:24                         ` Richard Stallman
2002-04-10 16:27                           ` Kim F. Storm
2002-04-11 14:53                             ` Richard Stallman
2002-04-11 16:27                               ` Kim F. Storm
2002-04-12 19:49                                 ` Richard Stallman
2002-04-12 10:36                               ` Francesco Potorti`
2002-04-09 15:26                       ` Per Abrahamsen
2002-04-09 21:28                         ` John Wiegley
2002-04-07  3:56               ` Tak Ota
2002-04-06 15:05         ` Andreas Schwab
2002-04-06 17:32     ` Richard Stallman
2002-04-06 20:38       ` John Wiegley
2002-04-06 23:03         ` Alex Schroeder
2002-04-07  0:12           ` Colin Walters
2002-04-07  0:56             ` Miles Bader
2002-04-07  2:53               ` John Wiegley
2002-04-07  4:44                 ` Colin Walters
2002-04-07  4:58                   ` Miles Bader
2002-04-07  5:32                     ` Colin Walters
2002-04-07  6:53                       ` Miles Bader
2002-04-07  7:46                         ` Colin Walters [this message]
2002-04-07  8:18                           ` Alex Schroeder
2002-04-07 12:20                           ` Miles Bader
2002-04-08  3:09                             ` Colin Walters
2002-04-08  6:18                               ` Miles Bader
2002-04-09 22:04                                 ` Colin Walters
2002-04-10 20:17                                   ` Richard Stallman
2002-04-09 12:07                               ` Richard Stallman
2002-04-09 22:12                                 ` Colin Walters
2002-04-07  6:36                   ` John Wiegley
2002-04-07  6:55                     ` Colin Walters
2002-04-07 23:42                   ` Richard Stallman
2002-04-08  3:14                     ` Colin Walters
2002-04-09 12:07                       ` Richard Stallman
2002-04-09 22:06                         ` Colin Walters
2002-04-07  4:41               ` Colin Walters
2002-04-07  4:58                 ` Miles Bader
2002-04-07  5:43                   ` Colin Walters
2002-04-07 10:52         ` Kai Großjohann
2002-04-06 17:43     ` Kai Großjohann

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=1018165593.4269.27.camel@space-ghost \
    --to=walters@verbum.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).