[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
C-x home/end to select buffer before/after point?
From: |
Drew Adams |
Subject: |
C-x home/end to select buffer before/after point? |
Date: |
Mon, 24 Sep 2007 10:28:05 -0700 |
Any interest in these commands? They select the text preceding and following
point. I bind them to `C-x home' and `C-x end'. (I don't bother with
bindings for console mode, personally.)
I tend to write commands that act on either the whole buffer or the region,
if active, rather than acting from point forward. That is one motivation for
these commands.
(defun mark-buffer-before-point (reversep)
"Select the part of the buffer before point.
With a prefix argument, select the part after point."
(interactive "P")
(mark-buffer-after-point t))
(defun mark-buffer-after-point (reversep)
"Select the part of the buffer after point.
With a prefix argument, select the part before point."
(interactive "P")
(push-mark (if reversep (point-min) (point-max)) nil t)
(setq deactivate-mark nil))
- C-x home/end to select buffer before/after point?,
Drew Adams <=