all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Politz <politza@hochschule-trier.de>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: Thoughts on the buffer positions in the byte compiler's warning messages.
Date: Fri, 14 Oct 2016 00:58:49 +0200	[thread overview]
Message-ID: <87eg3jrh3q.fsf@hochschule-trier.de> (raw)
In-Reply-To: <20160918173851.GB3576@acm.fritz.box> (Alan Mackenzie's message of "Sun, 18 Sep 2016 17:38:51 +0000")

Alan Mackenzie <acm@muc.de> writes:

> What's needed is to construct a hash table whose key is a cons cell in
> the form which the reader has just built[...]

Edebug already does something similar.

(defun read-with-offsets (&optional buffer position)
  (unless buffer (setq buffer (current-buffer)))
  (setq buffer (get-buffer buffer))
  (unless position
    (setq position (with-current-buffer buffer (point))))

  (let (edebug-offsets
        edebug-offsets-stack
        edebug-current-offset)
    (with-current-buffer buffer
      (save-excursion
        (goto-char position)
        (cons
         (edebug-read-storing-offsets (current-buffer))
         edebug-offsets)))))

-ap



  reply	other threads:[~2016-10-13 22:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18 15:23 Thoughts on the buffer positions in the byte compiler's warning messages Alan Mackenzie
2016-09-18 17:38 ` Alan Mackenzie
2016-10-13 22:58   ` Andreas Politz [this message]
2016-09-18 18:21 ` Helmut Eller

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=87eg3jrh3q.fsf@hochschule-trier.de \
    --to=politza@hochschule-trier.de \
    --cc=acm@muc.de \
    --cc=emacs-devel@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 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.