unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 3447@debbugs.gnu.org, Kevin Ryde <user42@zip.com.au>
Subject: bug#3447: suggest minibuffer M-< go to start of text
Date: Wed, 13 Nov 2019 00:04:39 +0200	[thread overview]
Message-ID: <87sgmshhu0.fsf@mail.linkov.net> (raw)
In-Reply-To: <87d0fidwfl.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 30 Sep 2019 10:23:42 +0200")

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

reopen 3447
quit

>> (define-key minibuffer-local-map "\M-<" 'my-minibuffer-beginning-of-buffer)
>
> I think something like this would be a very good idea.  I frequently
> have long, multiline expressions in the minibuffer, and `M-<' not taking
> me to the start of the editable data is annoying.
>
> Does anybody object to making a change like this?  (It'll have to be
> modernised a bit, of course.)

This still doesn't work with <C-home>.  This can be fixed
by remapping beginning-of-buffer in the patch below.

Like 'C-a' goes to the end of the prompt exactly like <home>,
there is no reason not to do the same for 'M-<' and <C-home>.

Moreover, we don't add defcustoms for simple key bindings
because keybinding are configured with the help of define-key.

This patch should do the right thing:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minibuffer-remap-beginning-of-buffer.patch --]
[-- Type: text/x-diff, Size: 1646 bytes --]

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 6e72eb73f9..d4b3cb8297 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2240,7 +2240,7 @@ completion-help-at-point
 
 (let ((map minibuffer-local-map))
   (define-key map "\C-g" 'abort-recursive-edit)
-  (define-key map "\M-<" 'minibuffer-beginning-of-buffer)
+  (define-key map [remap beginning-of-buffer] 'minibuffer-beginning-of-buffer)
 
   (define-key map [remap recenter-top-bottom] 'minibuffer-recenter-top-bottom)
   (define-key map [remap scroll-up-command] 'minibuffer-scroll-up-command)
@@ -2546,14 +2546,6 @@ insert-default-directory
 `set-visited-file-name'."
   :type 'boolean)
 
-(defcustom minibuffer-beginning-of-buffer-movement nil
-  "Control how the `M-<' command in the minibuffer behaves.
-If non-nil, the command will go to the end of the prompt (if
-point is after the end of the prompt).  If nil, it will behave
-like the `beginning-of-buffer' command."
-  :version "27.1"
-  :type 'boolean)
-
 ;; Not always defined, but only called if next-read-file-uses-dialog-p says so.
 (declare-function x-file-dialog "xfns.c"
                   (prompt dir &optional default-filename mustmatch only-dir-p))
@@ -3674,8 +3666,7 @@ minibuffer-beginning-of-buffer
                         (prefix-numeric-value arg))
                      10)))
               ;; Go to the start of the buffer.
-              ((or (null minibuffer-beginning-of-buffer-movement)
-                   (<= (point) (minibuffer-prompt-end)))
+              ((<= (point) (minibuffer-prompt-end))
 	       (point-min))
               ;; Go to the end of the minibuffer.
               (t

  parent reply	other threads:[~2019-11-12 22:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01 23:42 bug#3447: suggest minibuffer M-< go to start of text Kevin Ryde
2019-09-30  8:23 ` Lars Ingebrigtsen
2019-09-30  8:53   ` Eli Zaretskii
2019-10-01 11:58     ` Lars Ingebrigtsen
2019-10-01 12:28       ` Eli Zaretskii
2019-10-01 13:02         ` Lars Ingebrigtsen
2019-10-01 13:24           ` Eli Zaretskii
2019-11-12 22:04   ` Juri Linkov [this message]
2019-11-13  3:25     ` Lars Ingebrigtsen
2019-11-13 21:16       ` Juri Linkov
2019-11-14 13:44         ` Eli Zaretskii
2019-11-15  7:47           ` Lars Ingebrigtsen
2019-11-15  8:43             ` Eli Zaretskii
2019-11-23 12:51               ` Lars Ingebrigtsen
2019-11-16 20:15             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgmshhu0.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=3447@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).