all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nordlöw <per.nordlow@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Feature Request: Auto-jumping to source file (.el) upon elisp  error
Date: Tue, 11 Dec 2007 01:40:12 -0800 (PST)	[thread overview]
Message-ID: <812fcf3b-e3fc-44a1-a16e-af8121ca520f@b1g2000pra.googlegroups.com> (raw)
In-Reply-To: mailman.4842.1197312462.18990.help-gnu-emacs@gnu.org

On Dec 10, 7:47 pm, Andreas Röhler <andreas.roeh...@online.de> wrote:
> Am Montag, 10. Dezember 2007 15:27 schrieb Nordlöw:
>
>
>
> > On Dec 10, 1:14 pm, Stefan Kamphausen <ska...@gmx.net> wrote:
> > > Hi,
>
> > > "Nordlöw" <per.nord...@gmail.com> writes:
> > > > But the top-most function, in your case produce-an-error(), is neither
> > > > clickable nor mentioned about its file/buffer-origin in the Debugger
> > > > output. This is sad because this is what the user/developer wants to
> > > > see first in order to most easily understand the top-most (call-stack)
> > > > context of the problem.
>
> > > you are right that the function is not clickable in the backtrace if
> > > being added interactively.  It does work however, if it was written
> > > into a separate file and then loaded via (e.g.) M-x load-file.
>
> > > Does that fit your needs?
>
> > > Regards,
> > > Stefan
> > > --
> > > Stefan Kamphausen ---http://www.skamphausen.de
> > > a blessed +42 regexp of confusion (weapon in hand)
> > > You hit. The format string crumbles and turns to dust.
>
> > Okey, thanks for your answer!
>
> > Is it still possible to make Emacs automatically open top-most source
> > code context in another window?
>
> > Thanks again,
> > Nordlöw
>
> I use an adapted function `aktualisieren', which takes
> arguments as C-h f does, but then opens the source if
> available, narrowed to function mentioned. Code below.
>
> Might that be a step forward?
>
> Andreas Röhler
>
> (defun aktualisieren (function)
>   "Go to FUNCTION (a symbol), narrow to region."
>   (interactive
>    (let ((fn (save-excursion
>                (beginning-of-defun)
>                (forward-word 2)
>                (if (featurep 'xemacs)
>                    (function-at-point)
>                  (function-called-at-point))))
>          val)
>      (list (intern-soft (completing-read (if fn
>                                              (format "Describe function (default %s): " fn)
>                                            "Describe function: ")
>                                          obarray 'fboundp t nil nil (symbol-name fn))))))
>   (if (file-readable-p
>        ;; No effect, why?
>        (condition-case nil
>            (symbol-file function)
>          (error "Keine Quelldatei gefunden")))
>       (let* ((datei (symbol-file function)))
>         (cond
>          ((file-exists-p (concat (file-name-sans-extension datei) ".el"))
>           (find-file (concat (file-name-sans-extension datei) ".el")))
>          ((file-exists-p (concat (file-name-sans-extension datei) ".el.gz"))
>           (find-file (concat (file-name-sans-extension datei) ".el.gz")))
>          ((file-exists-p (concat datei ".gz"))
>           (find-file (concat datei ".gz")))
>          (t (error (concat "Keine Quelle vorhanden"))))
>         ;; 2007-06-03 a.roeh...@web.de changed section end
>         (widen)
>         (goto-char (point-min))
>         (cond
>          ((search-forward (concat "(defun " (symbol-name function)" ") nil t) ;;
> Leerzeichen, um "-" in Funktionsnamen auszuschlie��ßen
>           (progn
>             (narrow-to-region (progn (beginning-of-defun) (point))(progn
> (end-of-defun) (point)))
>             (delete-other-windows)))
>          ((progn (goto-char (point-min))
>                  (re-search-forward (concat "(defalias '" (symbol-name
> function) " '\\([^)]+\\)") nil t 1))
>           (progn
>             (message " %s" (match-string-no-properties 1))
>             (goto-char (point-min))
>             (search-forward (match-string-no-properties 1))))
>          ((progn (goto-char (point-min))
>                  (re-search-forward (concat "\(define-.+" (symbol-name function) " *$") nil
> t 1))
>           (message " %s" (match-string-no-properties 0)))
>          (t (goto-char (point-min)))))
>     (message "%s" "No file assigned, self-made function?")))
>
> ;;;;;;

Can I make this happen automatically upon error?

Automation, automation, automation...

Thanks again,
Nordlöw

      parent reply	other threads:[~2007-12-11  9:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-10  8:54 Feature Request: Auto-jumping to source file (.el) upon elisp error Nordlöw
2007-12-10  9:59 ` Stefan Kamphausen
2007-12-10 10:40   ` Nordlöw
2007-12-10 12:14     ` Stefan Kamphausen
2007-12-10 14:27       ` Nordlöw
2007-12-10 18:47         ` Andreas Röhler
2007-12-10 19:11           ` Feature Request: Auto-jumping to source file (.el) upon elisperror Drew Adams
2007-12-11  7:05             ` Andreas Röhler
     [not found]         ` <mailman.4842.1197312462.18990.help-gnu-emacs@gnu.org>
2007-12-11  9:40           ` Nordlöw [this message]

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=812fcf3b-e3fc-44a1-a16e-af8121ca520f@b1g2000pra.googlegroups.com \
    --to=per.nordlow@gmail.com \
    --cc=help-gnu-emacs@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.