I want to make a logger that display line number of the point.
In init.el I wrote the following function:
(defun logger ()
"Print logger"
(print (concat "print(\"" (what-line) ": \")")))
When I call the function from an other buffer it always prints Line 1.
However when I do M-x what-line the correct line number is displayed.
What can I do to make the function printing the right line number?
Edit: I found that the issue was C-x p.
If I do M-x logger it works like expected.
Why have we two different behaviors ?
