unofficial mirror of emacs-devel@gnu.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

* Re: C-x home/end to select buffer before/after point?
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Davis Herring @ 2007-09-24 17:42 UTC (permalink / raw)
  To: Drew Adams; +Cc: Emacs-Devel

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

M-< C-x C-x

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

M-> C-x C-x

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

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

* RE: C-x home/end to select buffer before/after point?
  2007-09-24 17:42 ` Davis Herring
@ 2007-09-24 18:41   ` Drew Adams
  2007-09-24 19:10     ` Davis Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2007-09-24 18:41 UTC (permalink / raw)
  To: Emacs-Devel

> > (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))
> 
> M-< C-x C-x
> 
> > (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))
> 
> M-> C-x C-x

Of course. And? The point was to be able to bind it to a single key.

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

* RE: C-x home/end to select buffer before/after point?
  2007-09-24 18:41   ` Drew Adams
@ 2007-09-24 19:10     ` Davis Herring
  2007-09-24 21:08       ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Davis Herring @ 2007-09-24 19:10 UTC (permalink / raw)
  To: Drew Adams; +Cc: Emacs-Devel

>> M-< C-x C-x
>> M-> C-x C-x
>
> Of course. And? The point was to be able to bind it to a single key.

Oh.  Sorry; that point didn't come across (to me) in your message.  The
operations seem clearer to me separated, but I don't object to the
functions' existence.  I don't think they're worth default keys in the
global map, though.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

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

* RE: C-x home/end to select buffer before/after point?
  2007-09-24 19:10     ` Davis Herring
@ 2007-09-24 21:08       ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2007-09-24 21:08 UTC (permalink / raw)
  To: herring; +Cc: Emacs-Devel

> >> M-< C-x C-x
> >> M-> C-x C-x
> >
> > Of course. And? The point was to be able to bind it to a single key.
>
> Oh.  Sorry; that point didn't come across (to me) in your message.  The
> operations seem clearer to me separated, but I don't object to the
> functions' existence.

"it" being either of those, not both together. I suggested `C-home' for one
and `C-end' for the other. I did not suggest one binding for both.

> I don't think they're worth default keys in the global map, though.

As you said, you don't use transient-mark mode. And transient-mark mode is
not (yet) the default behavior.

^ 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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).