From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#3447: suggest minibuffer M-< go to start of text Date: Wed, 13 Nov 2019 00:04:39 +0200 Message-ID: <87sgmshhu0.fsf@mail.linkov.net> References: <873aajttak.fsf@blah.blah> <87d0fidwfl.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="154899"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 3447@debbugs.gnu.org, Kevin Ryde To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 12 23:07:56 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iUeKI-000e7S-7o for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2019 23:07:54 +0100 Original-Received: from localhost ([::1]:39890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUeKG-00067J-3K for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2019 17:07:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37788) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUeIV-00053I-Su for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 17:06:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUeIU-00079r-KN for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 17:06:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUeIU-00079V-46 for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 17:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iUeIT-0005fH-TP for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 17:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Nov 2019 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 3447-submit@debbugs.gnu.org id=B3447.157359634421747 (code B ref 3447); Tue, 12 Nov 2019 22:06:01 +0000 Original-Received: (at 3447) by debbugs.gnu.org; 12 Nov 2019 22:05:44 +0000 Original-Received: from localhost ([127.0.0.1]:58536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUeIB-0005eg-Ef for submit@debbugs.gnu.org; Tue, 12 Nov 2019 17:05:43 -0500 Original-Received: from black.elm.relay.mailchannels.net ([23.83.212.19]:26299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUeI9-0005eT-51; Tue, 12 Nov 2019 17:05:41 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AAFBE2C1F69; Tue, 12 Nov 2019 22:05:39 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a74.g.dreamhost.com (100-96-8-64.trex.outbound.svc.cluster.local [100.96.8.64]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 1D0F82C1E7F; Tue, 12 Nov 2019 22:05:39 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a74.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Tue, 12 Nov 2019 22:05:39 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Stupid-Troubled: 65b4fec61e674804_1573596339404_606760840 X-MC-Loop-Signature: 1573596339403:1614571377 X-MC-Ingress-Time: 1573596339403 Original-Received: from pdx1-sub0-mail-a74.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a74.g.dreamhost.com (Postfix) with ESMTP id 8A1967FFC2; Tue, 12 Nov 2019 14:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=S1eR1rKdqjx0KCjpkQiVeZdb5/o=; b= bht4KnSTnuRGlQZf/ZMgHKB24uiFPNfQsSB5lig61JFg+j/opAu/t8sK8A8dCYyq Bo30tJqEvOMaV0i85aNvcA7CqsmUipqYU44aOFHzZ/kbP5SOI+E+KxQB2dO9btCh 2YJ+P9PixrzUv7RhflXnlfVGWh1/leiqfuWsdI6zavo= Original-Received: from mail.jurta.org (m91-129-102-1.cust.tele2.ee [91.129.102.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a74.g.dreamhost.com (Postfix) with ESMTPSA id 25FB07FFBA; Tue, 12 Nov 2019 14:05:31 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a74 In-Reply-To: <87d0fidwfl.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 30 Sep 2019 10:23:42 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171472 Archived-At: --=-=-= Content-Type: text/plain 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 . 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 , there is no reason not to do the same for 'M-<' and . 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=minibuffer-remap-beginning-of-buffer.patch 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 --=-=-=--