all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-x home/end to select buffer before/after point?
@ 2007-09-24 17:28 Drew Adams
  2007-09-24 17:42 ` Davis Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2007-09-24 17:28 UTC (permalink / raw)
  To: Emacs-Devel

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))

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-24 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-24 17:28 C-x home/end to select buffer before/after point? Drew Adams
2007-09-24 17:42 ` Davis Herring
2007-09-24 18:41   ` Drew Adams
2007-09-24 19:10     ` Davis Herring
2007-09-24 21:08       ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.