How can I move the text cursor to any of these locations, using Lisp?
(let ((beg (progn
(skip-syntax-backward "^ " (line-beginning-position))
(point)))
(end (progn
(skip-syntax-forward "^ " (line-end-position))
(point))))
...)
I know we have goto-char
, but beg
and end
here are not exactly character positions? ;)
I just want to move the cursor to end
, for example.
(goto-char (point-max))
to go the end. See thePositions
chapter in the Emacs Lisp manual and itsMotion
subsection:C-h i g(elisp)Positions
. Also search this site forgoto-char
: there are plenty of hits.elisp
tag is not meant as a tag for questions that have a snippet of Emacs Lisp code in them (otherwise, most questions on this site have something to do with Emacs Lisp and would contain the tag, which would make it useless for searching).(goto-char end)
to go to theend
character position in your snippet.(goto-char (point-max))
goes to the end of the buffer - apologies for my misunderstanding.