From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Patch for emacs/basic.texi Date: Wed, 16 Sep 2020 16:59:14 +0000 (UTC) Message-ID: References: <87h7rymedg.fsf@gmail.com> <87zh5q8b70.fsf@igel.home> <8lm0yho8m684it.fsf@iki.fi> <87363hg21r.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13941"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andreas Schwab , Richard Stallman , Thibaut Verron , emacs-devel To: =?iso-8859-1?B?S+l2aW4gTGUgR291Z3VlYw==?= , Antoine Kalmbach Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 16 19:02:18 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIaoz-0003WZ-RY for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Sep 2020 19:02:17 +0200 Original-Received: from localhost ([::1]:59866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIaoy-0002r0-Q4 for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Sep 2020 13:02:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIamJ-0001Ei-49 for emacs-devel@gnu.org; Wed, 16 Sep 2020 12:59:31 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:48782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIamE-0005r8-Uh; Wed, 16 Sep 2020 12:59:30 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08GGj6ER043546; Wed, 16 Sep 2020 16:59:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=qWdfn4qjHWZZZvCmW/PhyMCohUAljcBaKNYk+GzbpEY=; b=BEeCUlX5fzZBAhyRb6UYbeHQYu5n0LEjTXgTVdvfdLhJL6iVPRDJh1Snk4uuZP/PXEep kzpSJUawe7wruGsfMp3sNWZ7F5HSVc2M1aIlRvS35WCulz8xelXFu7TVe3QoocQRRa15 yZGxDB6LMIlKCgOrSxf8fQIYHhxS2gpU4pA0LFoFy7ayCUXx0g/cHH08BSd18YTYGugZ yWaZPCckRwyF91LGRUiv5GSL8nb3l7GZhHfpNqGVvTPolj75NpW8Es+UhLUjqtC60aYJ 6EoK1c9AlK6G+B7V1D7EOV07caU14n8CFmUgkCjLfCAXJ4z1bU04pm8+uO53o1i3pS7g VQ== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 33gp9mca7k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Sep 2020 16:59:20 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08GGeGsw055683; Wed, 16 Sep 2020 16:59:20 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 33khpkqxxt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2020 16:59:20 +0000 Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08GGxGWb032512; Wed, 16 Sep 2020 16:59:16 GMT In-Reply-To: <87363hg21r.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5044.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9746 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009160119 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9746 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 clxscore=1011 lowpriorityscore=0 phishscore=0 spamscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009160119 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/16 12:59:22 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:255915 Archived-At: > > Isn't `C-x u` also a default keybinding? Although it requires two > > keypresses, that should work on all keyboard layouts. >=20 > It is a default binding, but it's more cumbersome for "undo bursts" > (repeating "undo" a bunch of times). >=20 > (It's one of those bindings, along with with "C-x o", that I wish came > with a "C-x z"-like transient map.) It's trivial to create a repeating command, so you can use `C-x u u u u ...'. Either of the definitions below for this (`undo-repeat') works. The second one is not specific to any key binding - use it with any prefix key, not just `C-x u'. Then use this binding: (global-set-key [remap undo] 'undo-repeat) 1. (defun undo-repeat (arg) "Same as `undo', but repeatable even on a prefix key. E.g., if bound to `C-x u' then you can use `C-x u u u...' to repeat." (interactive "*P") (undo arg) (set-transient-map (let ((map (make-sparse-keymap))) (define-key map "u" 'undo-repeat) map))) 2. (defun repeat-command (command) "Repeat COMMAND." (require 'repeat) ; Define its vars before we let-bind them. (let ((repeat-previous-repeated-command command) (repeat-message-function #'ignore) (last-repeatable-command 'repeat)) (repeat nil))) (defun undo-repeat (arg) "Same as `undo', but repeatable even on a prefix key. E.g., if bound to `C-x u' then you can use `C-x u u u...' to repeat." (interactive "*P") (repeat-command 'undo)) Similarly, for `C-x o' (`other-window'): (defun other-window-repeat () "Same as `other-window', but repeatable even on a prefix key. E.g., if bound to `C-x o' then you can use `C-x o o o...' to repeat." (interactive) (repeat-command 'other-window)) (global-set-key [remap other-window] 'other-window-repeat) I do this all over the place, where it makes sense.