From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#66394: 29.1; Make register-read-with-preview more useful Date: Mon, 23 Oct 2023 05:14:07 +0000 Message-ID: <87msw99a95.fsf@posteo.net> References: <87il7ib6cu.fsf@posteo.net> <87sf67qqmp.fsf@web.de> <875y3386ep.fsf@posteo.net> <87a5sddh14.fsf@web.de> <8734y5vnj7.fsf@posteo.net> <87bkcslr18.fsf@web.de> <87y1fwtyrl.fsf@posteo.net> <87y1fut1wp.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22579"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66394@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 07:30:47 2023 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 1qunWZ-0005iX-HH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 07:30:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qunWO-0004j9-Cb; Mon, 23 Oct 2023 01:30:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qunWL-0004it-4y for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 01:30:33 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qunWK-0006E6-Se for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 01:30:32 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qunWn-0005Oi-KS for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 01:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Oct 2023 05:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66394 X-GNU-PR-Package: emacs Original-Received: via spool by 66394-submit@debbugs.gnu.org id=B66394.169803904620725 (code B ref 66394); Mon, 23 Oct 2023 05:31:01 +0000 Original-Received: (at 66394) by debbugs.gnu.org; 23 Oct 2023 05:30:46 +0000 Original-Received: from localhost ([127.0.0.1]:48841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qunWY-0005OD-Eg for submit@debbugs.gnu.org; Mon, 23 Oct 2023 01:30:46 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:56619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qunWU-0005Nv-9w for 66394@debbugs.gnu.org; Mon, 23 Oct 2023 01:30:45 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D2EEF240027 for <66394@debbugs.gnu.org>; Mon, 23 Oct 2023 07:30:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698039006; bh=0QfLB3IJhPq2HB5yZhBq4kRftTeNAKUZQt4zUkfxC5Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=eWZHGlbM6JiZXARLJAKghokMWU4CSWVptMxOl7dncNCH10mJsvTc5YyCqbD6nO45c mcWtZ8CPzUsx5MwE0e7BtGZ2h/xsPwKKDRvZWOFw5Ry57L/o5QBa2uyLtlV7tkFe2V AR3+lWZCdYtSWBSyuTGhlf4c+nSvDc5kSw+LARsIPI7guFrVSgV5pxkF/53H5/ffw0 XZDiXQC5pOW/WWVNUyF/2/WjKHwYsbB7GdHvKK8ohJKWNxT3qk66UkTvPm6piHgoML r0gRULzh/Tdw8MdAPcirp2mfI/y8y2bdcR00jTBA0TpCluxY74ZveCkFPYogOQi2VE piVREnKXY0pHg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SDP0F5WYPz9rxM; Mon, 23 Oct 2023 07:30:05 +0200 (CEST) In-reply-to: <87y1fut1wp.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273005 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Michael Heerdegen writes: > Thierry Volpiatto writes: > >> > For jumping? Why is this useful? >> >> Well, actually with original behavior you can jump to a register >> recorded as a string, which returns an error of course because the >> register is meant to use with insert. Now the situation is better >> because the candidates are filtered but you can still jump to an >> unwanted place, read-from-minibuffer lets you the time to see where you >> are going. > > Ah - ok. Then that's definitely useful. Haven't yet tried the complete > code, but I had a look at the link you posted. > > It would not be good to carve the current register type system > into stone. Instead of your `register-type' function I would prefer > something extensible, for the case of new register types being added > (even a normal user might want to do this). So, when one wants to add a > new register type, it is necessary that one is able to declare, in some > way, whether registers of this type should be included or not for > `insert-register' (and maybe also `jump-to-register'). > > Instead of a detour via type names a better way seems to be adding new > predicate methods that accept one argument, a register, and should > return non-nil when the argument register can be inserted, or jumped to. Not sure to understand what you envisage here, but if you do something like this you have to make the types used for the two register commands configurable as well. Actually we have insert-register that accept '(string number) types and jump-to-register that accept '(window frame marker) types and this is hardcoded. I guess you want to make register-type a generic function and add several method that fit the types we actually have and if one wants to add a new type he just have to write a new defmethod and add the new type to the methods suitable for insert or jump. > I can try to modify your patch accordingly if you are interested. Yes but I think this should go into another commit on top of my patch to avoid having a "too big patch". Thanks. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmU2BNYTHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk7w8C/44172MjI8dPJ2Up4OxxPvztomcZhpb J8RT02cl7vW+4L/NXzEsF+g1Hivxr4HcfosiNjG5KmGMhEqGQx27w8UdpUIzsIvl aAsAI4b2JgiHGbwfN5qvIGlieNnKbLuha3awe6tn2hQApLC3f4zQGqd5SPSjwJCt OQV01nzEOPMFLt6fRdzn395wf8JqKaneLKQYcW/p14eSnAWSu4WPEtxtWqRQ4inX Nsqki/GqR5OVrWhSAzMb+rtaWtKdnHX48JpSaRpItEdqJgMTSp+vCrnrLUDslPJM l89IV3g7gKZ/Sdbsl7QCML6jwgXMGzz+P4i01QpbpTyISIbDOdeINg7b1FEluY7S GPwxBjPpMsVq1AZx4uIaafeIFGW0D4h3OAoqSsq7z93jJx5seOC24K+qDox+zyMn EgSmuTPXuChKlWDp3MnvbG/RvlKNrKYq0m/s7wS2FdiiaKO668qIXKvTBcpFsvc2 5exnfRwN2SS8GaP6T+NlSbEI5nFYN+MulTo= =4nAl -----END PGP SIGNATURE----- --=-=-=--