I am trying to set the current line number to a variable in Elisp but keep getting a void-variable error!
The code is:
(setq x what-line)
I'd also like to set the total number of lines in the buffer to a variable as well, but get the same error?!
(setq x (line-number-at-pos)
y (line-number-at-pos (point-max)))
How to find out about this kind of thing? Try M-x find-function
RET what-line
RET to see the source code of what-line
. Reading simple.el
(the file in which what-line
is defined) is a good way to get familiar with elementary Elisp programming.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With