emacs-devel
[Top][All Lists]
Advanced

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

Re: Thoughts on the buffer positions in the byte compiler's warning mess


From: Andreas Politz
Subject: Re: Thoughts on the buffer positions in the byte compiler's warning messages.
Date: Fri, 14 Oct 2016 00:58:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Alan Mackenzie <address@hidden> 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 via email to

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