From 71507e81f74c449d732abcf0073808302552da81 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 8 Sep 2021 08:01:53 -0500 Subject: Add goto-{last|first}-row --- lisp/acdw.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lisp/acdw.el b/lisp/acdw.el index 4f91e24..cdd4110 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -104,6 +104,21 @@ FILENAME and CONFIRM are passed directly to `write-file'." (write-file filename confirm)) (switch-to-buffer buf))) +;; https://old.reddit.com/r/emacs/comments/pjwkts +(defun acdw/goto-last-row () + "Move point to last row of buffer, but save the column." + (interactive) + (let ((col (current-column))) + (goto-char (point-max)) + (move-to-column col t))) + +(defun acdw/goto-first-row () + "Move point to first row of buffer, but save the column." + (interactive) + (let ((col (current-column))) + (goto-char (point-min)) + (move-to-column col t))) + (defun dos2unix (buffer) "Replace \r\n with \n in BUFFER." (interactive "*b") -- cgit 1.4.1-21-gabe81