From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ramesh Nedunchezian Newsgroups: gmane.emacs.bugs Subject: bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep' Date: Sun, 11 Apr 2021 12:18:43 +0530 Message-ID: References: <87pmz8lc17.fsf@mail.linkov.net> <9453a08f-5014-b4bc-8472-a4c2ff44c687@yandex.ru> <87o8eo38q9.fsf@mail.linkov.net> <7f1b570f-ea1b-5524-59fa-83bb5eaa9abd@yandex.ru> <87lf9p91g8.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33524"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Cc: 47566-done@debbugs.gnu.org, Dmitry Gutov , Juri Linkov To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 11 14:48:01 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lVZVR-0008aN-A6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Apr 2021 14:48:01 +0200 Original-Received: from localhost ([::1]:49738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVZVQ-0001GS-9W for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Apr 2021 08:48:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVTv0-0008DC-5O for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2021 02:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42311) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lVTuz-0004Zh-Tb for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2021 02:50:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lVTuz-0000wC-RN for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2021 02:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ramesh Nedunchezian Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Apr 2021 06:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47566 X-GNU-PR-Package: emacs Original-Received: via spool by 47566-done@debbugs.gnu.org id=D47566.16181237523543 (code D ref 47566); Sun, 11 Apr 2021 06:50:01 +0000 Original-Received: (at 47566-done) by debbugs.gnu.org; 11 Apr 2021 06:49:12 +0000 Original-Received: from localhost ([127.0.0.1]:53857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVTuB-0000v4-Ry for submit@debbugs.gnu.org; Sun, 11 Apr 2021 02:49:12 -0400 Original-Received: from mail-oln040092254072.outbound.protection.outlook.com ([40.92.254.72]:2592 helo=APC01-PU1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVTu9-0000um-H0 for 47566-done@debbugs.gnu.org; Sun, 11 Apr 2021 02:49:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iKI5GxFzjvByQYMf049R6xJGFAHXQzr9APZUFR8rwVIFTWFsgHRoOEl2pAkoXLlXA4ZJV/ysHyGs9WIwLrz0+6kWXomsoig2daRrAxO1xY9EFxsMJcCynQTjP6sYQsENK15fIqcOkDkf37jdE/lOKeaFyU54At4lyHrPjUqYjboCawv1lhtHPdcibDRtkylnRw1s4j79nPWMRH1NN0FXE9rGJ5MrhfrKaf3OYibo+mITxPi98fOFUYfdSdqO0bsx2RZalsXvUCiaOYj6o26qOnA4fdIjoQW+dx4hTcb0DM7EqBr2+ZLoTwT9+IbeHWybB6uZ4bu6R0jYr0EmvkaB3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BqNIvSprHrBeuZxF2G6499spN9nxYw12OahMQpmaeV4=; b=elZNUPsnHQOkYGTtONQWHea4gG1GR5B6yOHdTqvz3QvEyRcIOv4Z8kPJMwAD0beTDf+HjOwYnEFRuVP93T7qg3xzOsM7ua+X0j/xYX77KGuBo6NI8VlbtUEEclduPN+P8+FCUfXQzNAW/t3tzZGL10vbAiYTh82OQfc+a+lSMUb0/6j3kNHb7uFkCpBIZvJNWZE9sZt1A/voU0c4vBMBa69pUzSaRHbVTywOFC+j9caDhGQQ7TPJz4yTcYJf1GisB6Kn9LO7gFhS/3MlpVv2vbXEC69xwneoUdROs6XQ4sn0wEffyh4P18ILkNe6GWJ1MOprSvi8Q5L8reGKD10Rrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BqNIvSprHrBeuZxF2G6499spN9nxYw12OahMQpmaeV4=; b=KvkB7G5VB343p6Ee4ta81YkBQwCWfvTkmypM1phXcpQlNMGaBL/xHwQh9oxPx/NMGA4vcNzwqSfxL13VOLU26Nvqt2zp1d0uWPiW/xOt05bYwV1J2eqdHRi/obf4VV2XwJk6skrauHUQ4NwhZg9zMQ8VO2fpVBOPYTmNL62n9Qc9TjjeetlJ9TpIeWg+oAPVDGFqL9DgoPBhRZsiPHcRK7EijaANCQbptAolatqufYhfJHYH8ces7iDwbZL/GTBut1C9EcoCpfcFeyDV8d0d/fGL+CJwE98T4wqkeUebuLKZk9RkDXOU266KZ0kcnZnmwAYCIRMDFJoS58EgteLlfA== Original-Received: from TY2PR0101MB3693.apcprd01.prod.exchangelabs.com (20.180.79.144) by TYZPR01MB3854.apcprd01.prod.exchangelabs.com (20.182.177.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Sun, 11 Apr 2021 06:48:52 +0000 Original-Received: from TY2PR0101MB3693.apcprd01.prod.exchangelabs.com ([fe80::4980:4d7f:474b:de2c]) by TY2PR0101MB3693.apcprd01.prod.exchangelabs.com ([fe80::4980:4d7f:474b:de2c%3]) with mapi id 15.20.4020.022; Sun, 11 Apr 2021 06:48:52 +0000 Original-Newsgroups: gmane.emacs.bugs In-Reply-To: <87lf9p91g8.fsf@mail.linkov.net> Content-Language: en-US X-TMN: [QXFQtxR/mjE0QomgtFepciP43gefT+31cs2oy06QCdUwOI+5faIzh61GW2PVwhTD] X-ClientProxiedBy: MA1PR0101CA0055.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::17) To TY2PR0101MB3693.apcprd01.prod.exchangelabs.com (2603:1096:404:800f::16) X-Microsoft-Original-Message-ID: <3a04f0c2-0a7d-2832-a896-a7edef328c88@outlook.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from [IPv6:2401:4900:331e:970e:92f:5561:116:88b0] (2401:4900:331e:970e:92f:5561:116:88b0) by MA1PR0101CA0055.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16 via Frontend Transport; Sun, 11 Apr 2021 06:48:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b64e6902-d4ae-4bca-9ac7-08d8fcb5de82 X-MS-TrafficTypeDiagnostic: TYZPR01MB3854: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P2PbqWYk13J4tQpdlFU9I3m0+0fM+7ki/apYN/7QsLEOHNzDgaW4nVep1vcQuQ7O2Gy27iWg2PL2uk2224qFwc6gqXMksrJr7mPHSksBzmLir16iAw0CLFISqFCJvsGIPi3820O5agCYOlnxpHT1JQaIumEyYsZUhnAxhh1FYeQpAsknGvS/zFJzma5qb9GV71icSJmcVJwgbt3/sQHwfOUmRzbfe1L+Ey12dbyeFFJhslyomOlVBXfxY/3IjkXWWN3dERnWGu4Xbjeo9pIgUfpHAhglmZanuwNAslfRr0rWLfTzNliQO+USELKezLtIatCKNuI4tY7TcVqskgQ4etBnh7D3vp8JxieCXsbYVAe0650hc6cYesuUt7PspK8O4JQpKhIyXv2kG5OH3U7jEQ== X-MS-Exchange-AntiSpam-MessageData: 6wved4knKvB3qJF2Q/Q3pqzFIk90Tl2KFftHFcvFFqKl+mvAWAnvrzt6zjfVh95VqN9Nql5y2oZIZBpePpeCbI/20adjtvGYIog/XiLlUSGRT4uRg50twX2LcBWQWoY5ytf3J2KdUWzQClYB/HE1XBMKY8mgmpdJdcznNBdLNMG2lKWcSBxN6chwZAWMvek7CWmiHUP4B1r2i8pwuRl9Bw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b64e6902-d4ae-4bca-9ac7-08d8fcb5de82 X-MS-Exchange-CrossTenant-AuthSource: TY2PR0101MB3693.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2021 06:48:52.8293 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR01MB3854 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 11 Apr 2021 08:42:22 -0400 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203844 Archived-At: On 11/04/21 4:29 am, Juri Linkov wrote: >> It seems to me that repeat-mode is essentially a poor man's hydra. > > It is. It provides only the basic functionality. > Don't expect many fancy things from repeat-mode. The code below is pulled out from the existing code i.e., it doesn't add any additional layer of complexity or does anything fanciful. But it does add a bit of extensibility. This is what I was suggesting: (defvar repeat-mode-helper (defun repeat-mode-helper (map) (let (keys) (message "Coming here") (map-keymap (lambda (key _) (push key keys)) map) (let ((mess (format-message "Repeat with %s%s" (mapconcat (lambda (key) (key-description (vector key))) keys ", ") (if repeat-exit-key (format ", or exit with %s" (key-description repeat-exit-key)) "")))) (if (current-message) (message "%s [%s]" (current-message) mess) (message mess)))))) And in `repeat-post-hook', do something like ;; Messaging (unless prefix-arg (funcall (or (get rep-sym 'help) repeat-mode-helper) rep-map)) For those who don't want hints, they can use (setq repeat-mode-helper #'ignore) For those who want hints, but do /not/ want the hints hogging the echo area, they could have their own custom helper like the one above, after replacing (message mess) with (tooltip-show mess) -------------------------------- I would also appreciate if you could assess adding the exit key as a property to the repeat mode symbol.