tag:blogger.com,1999:blog-3165518189103293420.post7784912978173424001..comments2024-02-17T06:32:07.282+05:30Comments on Got Emacs?: Remembering the last edited location in a filesivaramhttp://www.blogger.com/profile/11777616173976636799noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-3165518189103293420.post-19812363009857336512010-04-18T02:25:58.867+05:302010-04-18T02:25:58.867+05:30That's not really the last edited location but...That's not really the last edited location but the last position of the cursor. To be able to get back to the last edit point in a buffer is also very useful. I'm doing it like this:<br /><br />(defun goto-last-edit-point ()<br /> "Go to the last point where editing occurred."<br /> (interactive)<br /> (let ((undos buffer-undo-list))<br /> (when (listp undos)<br /> (while (and undos<br /> (let ((pos (or (cdr-safe (car undos))<br /> (car undos))))<br /> (not (and (integerp pos)<br /> (goto-char (abs pos))))))<br /> (setq undos (cdr undos))))))<br /><br />(global-set-key (kbd "C-c SPC") 'goto-last-edit-point)Anonymoushttps://www.blogger.com/profile/00921934194192652778noreply@blogger.com