unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: 17394@debbugs.gnu.org
Subject: bug#17394: 24.4.50; enhancement request: split `next-error-function' functionality in two
Date: Thu, 5 Jun 2014 14:52:27 -0700 (PDT)	[thread overview]
Message-ID: <5f61d1ec-4647-4171-bfac-6dd780023695@default> (raw)
In-Reply-To: <87mwdrf3qh.fsf@lifelogs.com>

> DA> Enhancement request, to make the `next-error' feature, or more precisely
> DA> the buffers that offer it, more usable by other Lisp functions.
> >> ...
> DA> Essentially, I want a wrapper that provides a common interface to the
> DA> hit information that is stored in the different error buffers in
> DA> different ways.  AFAICT, there is no such feature today, but let me know
> DA> if I'm missing something obvious.  And let me know if this request is
> DA> not clear to you.
> >>
> >> This may work for some modes but not others. The `next-error' facility
> >> is opaque to the caller because each mode has to decide what makes sense
> >> in terms of locations and motion to them. So I think trying to expose
> >> more of the internals and formalize them would limit the ways in which
> >> it can be useful.
> 
> DA> I don't understand at least two things in what you wrote, Ted:
> 
> DA> * Why mode-specific determination of locations etc. is relevant to the
> DA>   request.
> ...
> DA> You can use `next-error' from anywhere.  I want to be able to gather all
> DA> `next-error' target locations and use them as completion candidates.
> 
> That's the request, as you said yourself shortly thereafter and I quoted :)

Sorry, I don't understand your reply.

> DA> * Why the request would require exposing any internals.
> 
> Because breaking `next-error-function' into two pieces (list locations
> and move to them) as you suggest requires each mode to expose what it
> considers "locations" to you and stick to that contract when the
> locations are visited externally.

See below, wrt bookmarks.  (Or think Emacs file handlers.)  There is
nothing particularly constraining about providing a Lisp representation
of (getting to) a potential target (destination/location).

> It also dictates that calling `next-error' means to move to a location,
> whereas modes and users currently are free to do other things when
> `next-error' is called.

I agree that "location" can mean pretty much anything - just as it does,
for example, for "jumping" to a bookmark "location".  That does not stop
bookmarks from recording such destinations - either extensively/explicitly,
as traditional locations, or intensively/implicitly, as handler functions.
An Emacs bookmark can do anything at all.  It needs only (a) a name and
(b) info sufficient to allow carrying out the intended effect.

Nothing in what I suggested requires `next-error' to in fact literally
"move to a location".  The requirement is for a representation of the
effect (whether we call it "location" or something else).

A representation that provides" (a) a user-recognizable component
(name/label - something you can recognize and choose) and (b) the
associated effect: something that can be used by Lisp code to bring
about the effect.

For an explicit location, (b) might be a buffer or file and a position
in it (a number or marker), and (a) might be some text at or near that
location.  But the request in no way imposes this as a limitation.
Again, think bookmarks.

[A bookmark, whose the data is recorded persistently, can be used long
after it was defined and in a context that has changed since.  Even so,
Emacs can typically find the location.  This should be even less of a
problem (and typically not a problem at all, I expect) for `next-error'
"locations".]





  reply	other threads:[~2014-06-05 21:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-03  4:30 bug#17394: 24.4.50; enhancement request: split `next-error-function' functionality in two Drew Adams
2014-05-03 21:38 ` Drew Adams
2014-05-03 21:41   ` Drew Adams
2014-06-05 14:27 ` Ted Zlatanov
2014-06-05 18:14   ` Drew Adams
2014-06-05 21:25     ` Ted Zlatanov
2014-06-05 21:52       ` Drew Adams [this message]
2022-01-25 14:28   ` Lars Ingebrigtsen
2022-01-25 16:17     ` bug#17394: [External] : " Drew Adams

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=5f61d1ec-4647-4171-bfac-6dd780023695@default \
    --to=drew.adams@oracle.com \
    --cc=17394@debbugs.gnu.org \
    --cc=tzz@lifelogs.com \
    /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).