Common Lisp parenthesis

66 views
Skip to first unread message

Chris Banda

unread,
Jun 28, 2021, 7:04:45 AM6/28/21
to plan9port-dev
Hello;
Does anyone have a script to auto match lisp parenthesis in acme?

Colin Hyatt Bortner

unread,
Jun 28, 2021, 11:00:25 AM6/28/21
to Chris Banda, plan9port-dev

Hi Chris,

Not sure what behavior you want, but if you double-click on the character just after the opening paren of an expression -- for example on the "l" in "(let ...)" -- acme will expand the selection to the closing paren, correctly enclosing any nested expressions.

Similarly, if you double click on the closing paren of an expression, it will expand the selection to the opening paren (i.e. to the left).

This behavior is mentioned obliquely in the acme(1) man page, referring to the double-click behaviour of sam(1). It’s implemented by textdoubleclick() in $PLAN9/src/cmd/acme/text.c if you want to look at the logic.

Also works for brackets, newlines, etc.

C


On 28 Jun 2021, at 8:30, Chris Banda wrote:

Hello;
Does anyone have a script to auto match lisp parenthesis in acme?

--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plan9port-dev/74be10aa-d907-4d49-a838-2a6a59e2cbcbn%40googlegroups.com.

Ethan Gardener

unread,
Jun 28, 2021, 11:17:03 AM6/28/21
to 'Shoce' via plan9port-dev
On Mon, Jun 28, 2021, at 7:30 AM, Chris Banda wrote:
Hello;
Does anyone have a script to auto match lisp parenthesis in acme?

I got into the habit of typing both opening and closing parentheses, then entering the contents afterward. I also used the double-click behaviour described by Colin. These little tricks worked well for me, I was happier with them than the color-blink or cursor-jump behaviours other editors had at the time, but to be fair, I never wrote a lot of Lisp with Acme. (I had no need for Sawfish and the associated Rep interpreter when I started using Plan 9 full-time.) I still type parens braces & brackets ahead of their contents when writing in other languages; even English.

Ethan Gardener

unread,
Jun 28, 2021, 11:29:08 AM6/28/21
to Nick A, 'Shoce' via plan9port-dev
On Mon, Jun 28, 2021, at 4:21 PM, Nick A wrote:
I never understood that whole cursor-jump thing where the editor completes the parans for you, and then jumps your cursor AFTER the terminating paren.. and then you have to move back one character to enter stuff. 

I never liked editors doing stuff for me at all. :) (Autoindent is the only exception.) I experienced the behaviour you describe once, and probably never used that editor again, lol! The cursor-jump I meant was just for the purpose of highlighting the matching parenthesis. That wasn't quite so bad, but it still hurt my eyes a bit.

Nick A

unread,
Jun 28, 2021, 12:09:43 PM6/28/21
to eek...@fastmail.fm, 'Shoce' via plan9port-dev
I never understood that whole cursor-jump thing where the editor completes the parans for you, and then jumps your cursor AFTER the terminating paren.. and then you have to move back one character to enter stuff. 

--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages