From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: Sv: Suggestion: two new commands: beginning-of-list and end-of-list Date: Tue, 10 Sep 2024 15:10:26 +0000 Message-ID: References: <86le00ve01.fsf@gnu.org> <86jzfjvj98.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_AS8PR02MB10107A5DFA8AD0445297A8F1D969A2AS8PR02MB10107eu_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17166"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 10 17:42:14 2024 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 1so30P-0004If-Db for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Sep 2024 17:42:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so2zf-0000Hk-0Q; Tue, 10 Sep 2024 11:41:27 -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 1so2Vp-0004UG-RO for emacs-devel@gnu.org; Tue, 10 Sep 2024 11:10:37 -0400 Original-Received: from mail-am7eur03olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2e0e::800] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1so2Vm-0005TX-C6; Tue, 10 Sep 2024 11:10:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iKb9A/UgEE4cEWwHGjLyS7ld8AXPv8IKtxYqeYtsh/KP3Cb2wbOnsFUzmvpknT/6eN5RwE0lSwZ1iI+V0/HE+fdOaXutLXOGh6ebUSQ3UlWCrZytik0297/C+/WdzgXwY1Mpl8v6uTD88HjBau2C7rvYLcyHjkFhcLUb+FEVxeJ2GNYrLbjxkoKmoyZ2qhSiq8uEyPsZi1nBpOb2u/al3Nm//64q56mVQzYTUOphxz2v15ZO0XOptTZnSS/Vuj31FvWO0fS1d3OxAmA19gqTHNhb4SpBH6Iq4UCBKIGjhoSLGTxNy6mIbQOct6hWcFgKLG/yVY7zAMHSeRzmGhsoRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PaByheU9z+kg3+6R6K1EKKT+j2EwSU0Yb0feomMC1YE=; b=qjef0KDM6yeboH9vADRfiKn6VOnLrQjFLNWdKNjXg0zrKoJCBxX1vX0m05b96/ZV0dea0vXyI02WIyWMt/8EV6oMsm6nSUNCKpmvIK9uvxSbDkak0ZOWjc9DwJp8j/s/Kacc/T2lFl21KFXDe+ZQYfNZ1fkl9Jd7xHxLXLQ8JXQ4caXtsY/R3P+pgz/yC2mKMnOsSQvuLijj3b4eAXn99zBfX6ESuBtQVd7KFmIxm/FAmo1+S7C/JxbhonxFBhK22hYyv2OsPnIZVKZALI+CYNXsrPTRP6WgK3AnVmUd6rAQVzs/jQ696z3JVUA1dW30YfysoYAYHTGuMKG5IDgGcQ== 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=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PaByheU9z+kg3+6R6K1EKKT+j2EwSU0Yb0feomMC1YE=; b=ied9rNhxoOFuxGjQa5Z0e/HGwIvQfEXuoZeWbFk0mcmhSiXYc4rNMdgrU4DJmaMw/Z68XdkKRIAroVAbIc9FAJHbXHOMNO0pSZ5JMljoCEgTBp7j3Tilqcu3NuYJQ8xJl5pdAKyuGk07jUYF7aOAAEoLWB2HmTv76NOU8BhyBRZuNnGjZULYlOeXwOtixYdRimof/QrW8/O+DK06O4WamW6TQzOS0/BpuW/ShxV9UrKnrk7RGOijrHr3yEsL/EYj3q61TqAzqwgcto+an4+41i96evfQsf7ESoIdjc8lW1Gc8RbiB6d5du39yMmbCIWxwJvE+MueJgrCN0SQXsKUsA== Original-Received: from AS8PR02MB10107.eurprd02.prod.outlook.com (2603:10a6:20b:633::7) by DBAPR02MB6488.eurprd02.prod.outlook.com (2603:10a6:10:17d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.24; Tue, 10 Sep 2024 15:10:26 +0000 Original-Received: from AS8PR02MB10107.eurprd02.prod.outlook.com ([fe80::80fe:77a2:35b:dfc]) by AS8PR02MB10107.eurprd02.prod.outlook.com ([fe80::80fe:77a2:35b:dfc%6]) with mapi id 15.20.7918.024; Tue, 10 Sep 2024 15:10:26 +0000 Thread-Topic: Suggestion: two new commands: beginning-of-list and end-of-list Thread-Index: AQHbAuVbbKZnfmVNp0+ByPzyKH0mArJP0m93gAAHORSAAQovbIAAPWl7 In-Reply-To: <86jzfjvj98.fsf@gnu.org> Accept-Language: sv-SE, en-US Content-Language: sv-SE x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [wDl6A2uVtiNPnOr5YrnR/LQizLF2hSe6] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8PR02MB10107:EE_|DBAPR02MB6488:EE_ x-ms-office365-filtering-correlation-id: 390cc1bf-4216-4f9d-5156-08dcd1aab38f x-microsoft-antispam: BCL:0; ARA:14566002|15080799006|15030799003|8060799006|19110799003|461199028|440099028|3412199025|102099032; x-microsoft-antispam-message-info: LndKbxMdzVGq+X63l8nTJI2ZHPyHrXiHvWAy5NuKCXEnLvC4vvGAcamGIC46xaLFqfKLMbPWdX87bPxnRVoNVOGdVtJoPDG/kQc9p1Je8qrF60lDClnzy/W2tjb9NtMOaPjxs9dRuM2RiigifxHKPHs6k3K/EA5lSk9ws2q1RDajcyB9DjIaNWe9Sh0wu1dsy6c/AFG1pvdGVtwOCUK9fh0kzGcJzTOjeZjFzm7TeEDsnk5Lt6Q2z07RXHp+Ea9AgTo8BQpuUVAfL5PVP55R1AlmexDakUaloDOYvtRz1HNt4ZJoVL3N8EJ42i/PhS4qo5PxdUTqMNDgO+0oP6S02HmgTfxuT8IesrBF7I7fx5b6HlpQI3G3nmb3jr1MGu5nmIfi9+UaLRa01rIFjvdKqPOPOfODWHXKs443BV4FfvFAdMGBPSI842EfgFaLgOzcrAS1iPYgYiur4bl2LUF1lv0mLG77itfZQlVrpnYrGwOj27Oe/A8VhqnwzMHxqOmSQdhX7vTp9yOYhwd/8cyqi9b63ueyb//opVDzb+oKoVa94kcLv9L71xaYtWXCRdLp4sTrk8CHabaFmJKNYJ0YAJui1NgLVqnqEhK/wF4CNkR6RRqCmLJgmOPlAvmhfE+CT0G5YtW83QKCyqkjIlstMf6+/mJ7Slkf7z9xrsoVjJnkhImJIkmc2FXxmLVHI4GS75rWvInfBy1k/t2RpA0qbA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?gq7Mw661uRjU0S5HG1nByU5kt+Z6DQBm2ZzKeNpTwskOsoq8h5BQirsmkJ?= =?iso-8859-1?Q?b2wcrz3bgqeIQh6Gs3IsdMQ+pXEJsWBX4geTF+KAZsz2+/72zT76pq0204?= =?iso-8859-1?Q?bvPdYupSzqe5DIBM5GrkZVKArhx+ooOQ6rHi/AIfpbS1N6TTm/955c3tWN?= =?iso-8859-1?Q?7Ywlc9zcxmtRTd3mKA6OQiBJ3Qg/FyIaF64kwAT6PauzU3z3WekZIpZNS1?= =?iso-8859-1?Q?9UbU+aZbHaOX7d3SKQCc24FvXlzs0t7ZRcMzeoSAyLirInSFvsODosGMHe?= =?iso-8859-1?Q?AKm2Oo7fSASTn4HnkwnT9SPteTVCeOIeCeRL4kgAeKsYxfU1496RXcw3D9?= =?iso-8859-1?Q?OSHj4Cz2lgymNr2KauHCq0xLt66S/PeQUL5nZ7RNqwNI4qB4XxqyGyq1Jb?= =?iso-8859-1?Q?2KwFeIKvNvGsmchkSqQEHq0cM6729QVCv9Os/oLObBC+gzg4cPJnyYgzdg?= =?iso-8859-1?Q?azSKjeogfOnGWjXk2Qxgt33DwMjNjbNmHNLueNU6kQKJS7oo6bSpSCb4C9?= =?iso-8859-1?Q?lz+uWXlPDmZirhu2a+pih8WZmM3LBxcVdHmSHf9C+c1VumIka7rEyLdjn5?= =?iso-8859-1?Q?Ans7QyNVC36Nzcaqa+5MXsNUf+bC0KZXe6sqirNv/khxglr03apSPpW11d?= =?iso-8859-1?Q? X-OriginatorOrg: sct-15-20-7828-19-msonline-outlook-12d23.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR02MB10107.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 390cc1bf-4216-4f9d-5156-08dcd1aab38f X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Sep 2024 15:10:26.6845 (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: DBAPR02MB6488 Received-SPF: pass client-ip=2a01:111:f403:2e0e::800; envelope-from=arthur.miller@live.com; helo=EUR03-AM7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 10 Sep 2024 11:41:25 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323528 Archived-At: --_000_AS8PR02MB10107A5DFA8AD0445297A8F1D969A2AS8PR02MB10107eu_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >> >I think we do have it: C-M-u, backward-up-list. What's more, it works >> >not only in Lisp. I use it all the time. >> >> Yes you have. It works slightly differently when you are in a string, an= d it >> places cursor before the opening parenthesis, not after. > >Right. But I think what it does is very useful, since it can be >invoked repeatedly, each time moving up one level. We are in agreement about backward-up-list being useful, that was never in question. >> >So I wonder why we need another function that does basically the same. >> >> I think it makes sense to keep backward-up-list as it is, since it handl= es >> literal strings as it does. But the behaviour is controlled via special = vars >> esape-strings and no-syntax-crossing. If we want similar command as >> beginning-of-string, we have to wrap it and let-bind those variables to >> change how it works. > >Yes, but is that a problem? Everyone who would like to customize it has to write their own. That is why I say it is convenience. I didn't say it is revolutionary, or that it replaces something else. But you skip to press C-f after backward-up-list. As a note, it will work about the same in C code as backward-up-list. I haven't tested extensively, just a bit. It uses same primitives as backward-up-list, so it is not surprising. There are less useful things, even easier to wrap up than this, but ship with Emacs for user convenience. >> I am not sure, what is a symmetric function to move cursor to the end of= list? > >The converse of C-M-u is C-M-d, but it doesn't move to the end of a >list, it moves _inside_ one level. Down-list? I don't think it is close to the end-of-list. In some situations you would clearly prefer down-list in others end-of-list. I don't think they compete. >> But as said in the previous mail: this function is *already* in Emacs, s= o it is >> already taking the memory in the process. It is just not used more than >> once, and have *potential* to be used more. In other words, I suggest th= ese >> two functions as a convenience, not because it is impossible to do somet= hing >> similar via some combination of other commands and variables. > >It is IME confusing to have two similar functions that do _almost_ the >same job. I understand your point, but I am not sure it is confusing. I think the name is quite different. There is also a symmetri with other functions, there are several beginning-of-* and end-of-* functions in lisp.el. If someone is new, it might be easier to discover beginning-of-list and understand what it doew, than backward-up-list and realize they can use it for the same purpose if they just click a bit more. The most important argument is that the function is included, I have basically just renamed it. As mentioned, people are speaking about Lispy and Yuri mentions Smartparens by the same author. Obviously other people do find something similar to this convenient. Paredit does not have something directly same (or I have missed it). ________________________________ Fr=E5n: Eli Zaretskii Skickat: den 10 september 2024 13:30 Till: arthur miller Kopia: emacs-devel@gnu.org =C4mne: Re: Suggestion: two new commands: beginning-of-list and end-of-list > From: arthur miller > CC: "emacs-devel@gnu.org" > Date: Mon, 9 Sep 2024 19:41:12 +0000 > msip_labels: > > >I think we do have it: C-M-u, backward-up-list. What's more, it works > >not only in Lisp. I use it all the time. > > Yes you have. It works slightly differently when you are in a string, and= it > places cursor before the opening parenthesis, not after. Right. But I think what it does is very useful, since it can be invoked repeatedly, each time moving up one level. > >So I wonder why we need another function that does basically the same. > > I think it makes sense to keep backward-up-list as it is, since it handle= s > literal strings as it does. But the behaviour is controlled via special v= ars > esape-strings and no-syntax-crossing. If we want similar command as > beginning-of-string, we have to wrap it and let-bind those variables to > change how it works. Yes, but is that a problem? > I am not sure, what is a symmetric function to move cursor to the end of = list? The converse of C-M-u is C-M-d, but it doesn't move to the end of a list, it moves _inside_ one level. > But as said in the previous mail: this function is *already* in Emacs, so= it is > already taking the memory in the process. It is just not used more than > once, and have *potential* to be used more. In other words, I suggest the= se > two functions as a convenience, not because it is impossible to do someth= ing > similar via some combination of other commands and variables. It is IME confusing to have two similar functions that do _almost_ the same job. What do others think about this? > By the way, why did all occasions of the word "expression" ended up surro= neded > with underscores in the online archive? No idea. --_000_AS8PR02MB10107A5DFA8AD0445297A8F1D969A2AS8PR02MB10107eu_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>> >I think we do have it: C-M-u, backward-up-list.  What's m= ore, it works
>> >not only in Lisp.  I use it all the time.
>>
>> Yes you have. It works slightly differently when you are in a stri= ng, and it
>> places cursor before the opening parenthesis, not after.
>
>Right.  But I think what it does is very useful, since it can be
>invoked repeatedly, each time moving up one level.

We are in agreement about backward-up-list being useful, that was never
in question.

>> >So I wonder why we need another function that does basically t= he same.
>>
>> I think it makes sense to keep backward-up-list as it is, since it= handles
>> literal strings as it does. But the behaviour is controlled via sp= ecial vars
>> esape-strings and no-syntax-crossing. If we want similar command a= s
>> beginning-of-string, we have to wrap it and let-bind those variabl= es to
>> change how it works.
>
>Yes, but is that a problem?

Everyone who would like to customize it has to write their own. That is
why I say it is convenience. I didn't say it is revolutionary, or that it
replaces something else. But you skip to press C-f after
backward-up-list. As a note, it will work about the same in C code as
backward-up-list. I haven't tested extensively, just a bit. It uses same
primitives as backward-up-list, so it is not surprising.

There are less useful things, even easier to wrap up than this, but ship
with Emacs for user convenience.

>> I am not sure, what is a symmetric function to move cursor to the = end of list?
>
>The converse of C-M-u is C-M-d, but it doesn't move to the end of a
>list, it moves _inside_ one level.

Down-list? I don't think it is close to the end-of-list. In some
situations you would clearly prefer down-list in others end-of-list. I
don't think they compete.

>> But as said in the previous mail: this function is *already* in Em= acs, so it is
>> already taking the memory in the process.  It is just not use= d more than
>> once, and have *potential* to be used more. In other words, I sugg= est these
>> two functions as a convenience, not because it is impossible to do= something
>> similar via some combination of other commands and variables.
>
>It is IME confusing to have two similar functions that do _almost_ the<= /div>
>same job.

I understand your point, but I am not sure it is confusing. I think the
name is quite different. There is also a symmetri with other functions,
there are several beginning-of-* and end-of-* functions in lisp.el. If
someone is new, it might be easier to discover beginning-of-list and
understand what it doew, than backward-up-list and realize they can use
it for the same purpose if they just click a bit more. The most
important argument is that the function is included, I have basically
just renamed it.

As mentioned, people are speaking about Lispy and Yuri mentions
Smartparens by the same author. Obviously other people do find something
similar to this convenient. Paredit does not have something directly
same (or I have missed it).

Fr=E5n: Eli Zaretskii <e= liz@gnu.org>
Skickat: den 10 september 2024 13:30
Till: arthur miller <arthur.miller@live.com>
Kopia: emacs-devel@gnu.org <emacs-devel@gnu.org>
=C4mne: Re: Suggestion: two new commands: beginning-of-list and end-= of-list
 
> From: arthur miller <arthur.miller@live.co= m>
> CC: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Mon, 9 Sep 2024 19:41:12 +0000
> msip_labels:
>
> >I think we do have it: C-M-u, backward-up-list.  What's more,= it works
> >not only in Lisp.  I use it all the time.
>
> Yes you have. It works slightly differently when you are in a string, = and it
> places cursor before the opening parenthesis, not after.

Right.  But I think what it does is very useful, since it can be
invoked repeatedly, each time moving up one level.

> >So I wonder why we need another function that does basically the s= ame.
>
> I think it makes sense to keep backward-up-list as it is, since it han= dles
> literal strings as it does. But the behaviour is controlled via specia= l vars
> esape-strings and no-syntax-crossing. If we want similar command as > beginning-of-string, we have to wrap it and let-bind those variables t= o
> change how it works.

Yes, but is that a problem?

> I am not sure, what is a symmetric function to move cursor to the end = of list?

The converse of C-M-u is C-M-d, but it doesn't move to the end of a
list, it moves _inside_ one level.

> But as said in the previous mail: this function is *already* in Emacs,= so it is
> already taking the memory in the process.  It is just not used mo= re than
> once, and have *potential* to be used more. In other words, I suggest = these
> two functions as a convenience, not because it is impossible to do som= ething
> similar via some combination of other commands and variables.

It is IME confusing to have two similar functions that do _almost_ the
same job.

What do others think about this?

> By the way, why did all occasions of the word "expression" e= nded up surroneded
> with underscores in the online archive?

No idea.
--_000_AS8PR02MB10107A5DFA8AD0445297A8F1D969A2AS8PR02MB10107eu_--