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

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

Re: function call location


From: akrl
Subject: Re: function call location
Date: Tue, 22 May 2018 16:08:08 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix)

akrl <akrl@sdf.org> writes:
 
> Hi all,
> How can I get the location of a function call in emacs lisp?
> I would like to record (for a certain number of function I can
> instrument) every function call and its location into the source.
>
> Bests
>
>   akrl

Hi,
just to be more clear, say we have:

(defun f1 ()
  (message
   (concat "f1 called at line " (int-to-string(line-number-at-pos)))))

(defun f2 ()
  (message
   (concat "f2 called at line  "(int-to-string(line-number-at-pos)))))

(progn
  (f1)
  (f2))

As output I have:

f1 called at line 11
f2 called at line 11

But I would like to to get:

f1 called at line 10
f2 called at line 11

Bests

  akrl

-- 
akrl@sdf.org
SDF Public Access UNIX System - https://sdf.org


reply via email to

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