bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33870: 27.0.50; xref-goto-xref not configurable


From: Drew Adams
Subject: bug#33870: 27.0.50; xref-goto-xref not configurable
Date: Tue, 29 Jan 2019 13:46:29 -0800 (PST)

> > So using (direction . (DIR . WIN)) would be OK?
> 
> And what to do when the future will require adding a third arg?
> This is why better to avoid dotted pairs, and use a list like
> (direction DIR WIN)

(Caveat: I haven't been following this thread.)

But YES to what Juri wrote there.  This is a
(minor) pet peeve of mine.  I like dotted pairs
for some things, but this is a standard gotcha.

Sometimes doing this might represent premature
optimization.  Sometimes it might come from
focusing too closely on the initial use case
(e.g. the only use case, to start with).  But
it happens - to all of us, no doubt.

(You could later hack the definition to also
allow something else in place of (DIR . WIN),
but that kind of thing becomes ugly, especially
if abused more than once.)

Example:

Whoever designed the Lisp representation of a
noncontiguous region trapped us the same way.
By using a dotted pair of scalar values, that
design pretty much precludes adding other info
besides the start and end limits to a region
segment.

The zones of `zones.el' are similar to the
segments of a noncontiguous region, but
instead of just (BEGIN . END) a zone has the
form (LIMIT1 LIMIT2 . EXTRA).

I provided from the outset for the possibility
of including EXTRA stuff, even though at that
time I had no special use in mind for it.
Later I was very thankful I had included it.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]