[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Move the point to the end of current buffer with the whole buffer se
From: |
Hongyi Zhao |
Subject: |
Re: Move the point to the end of current buffer with the whole buffer selected. |
Date: |
Fri, 26 May 2023 15:21:50 +0800 |
On Fri, May 26, 2023 at 2:44 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Michael Heerdegen <michael_heerdegen@web.de>
> > Date: Fri, 26 May 2023 05:40:17 +0200
> >
> > Hongyi Zhao <hongyi.zhao@gmail.com> writes:
> >
> > > In order to execute `query-replace-regexp' on current buffer, it needs
> > > to move the point to the end of current buffer with the whole buffer
> > > selected.
> >
> > Does it? Doesn't moving to the beginning of the buffer (M-<) suffice?
> >
> > Anyway, there is `mark-whole-buffer' on C-x h.
>
> Or C-S-<END> (assuming you have the <END> function key on your
> keyboard).
Based on my tries, the following keystroke sequence does the trick:
C-x h
C-S-<END>
On the other hand, `C-h k C-S-<END> RET` reveals the following:
``` begin quote
C-<end> (translated from C-S-<end>) runs the command end-of-buffer
(found in global-map), which is an interactive byte-compiled Lisp
function in ‘simple.el’.
It is bound to C-<end> and M->.
It can also be invoked from the menu: Edit → Go To → Goto End of
Buffer
(end-of-buffer &optional ARG)
Move point to the end of the buffer.
With numeric arg N, put point N/10 of the way from the end.
If the buffer is narrowed, this command uses the end of the
accessible part of the buffer.
Push mark at previous position, unless either a C-u prefix
is supplied, or Transient Mark mode is enabled and the mark is active.
This function is for interactive use only;
in Lisp code use `(goto-char (point-max))' instead.
Probably introduced at or before Emacs version 22.1.
``` end quote
But based on my testing, C-<end> and M->. can only select the last
line when issued after C-x h.
Regards,
Zhao