9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: wendellxe@yahoo.com, 9fans@9fans.net
Subject: Re: [9fans] Using the Acme Editor
Date: Tue, 19 Aug 2008 10:58:50 -0700	[thread overview]
Message-ID: <20080819175641.3B7301E8C54@holo.morphisms.net> (raw)
In-Reply-To: <382936.47212.qm@web57610.mail.re1.yahoo.com>

> what is the Acme way of approaching it?

> 01. Toggle on/off line wrapping
> 02. Toggle on/off EOL character display

Write shorter lines.

> 03. Display line numbers

You can go to a specific line with :n and
find out the current line with Edit =

> 04. Display ruler

If you really care, you can make a little file called ruler
that contains the text you want and then just open the
file in a window above the one you are editing.
But the Acme way is not to care what column you're on.
Just say no.

> 05. Rectangluar block selection

Someone posted a C program once that interpreted
the current selection as a rectangular block (starting
in the column where the selection began, ending
in the column where it ended, and spanning the lines
that it spans) and replaced each subline with a given
piece of text.  But again, just say no.

> 06. Search and replace with confirmation at each item

Put the cursor at the top of the file.
In the tag, type and select

	Edit .+#0/old/c/new/

and middle click it.  That will search for old, replace it
with new, and scroll the file to highlight and show the
replacement.  If you don't like that change, you middle
click Undo.  Either way, middle clicking the Edit command
will find and change the next occurrence.  So you can
just sit there middle clicking the Edit command until
you find one that you didn't mean to change, Undo,
and then go back to middle clicking Edit.  Selecting
the command in the tag keeps acme from moving the
mouse to the changed selection, so that it is easier
to repeat the command.

> 07. Automatic insertion of spaces for tabs

Just say no.  If you are forced to use spaces,
acme -a makes them a bit more bearable
by filling in the previous line's indentation
when you type Enter.

> 08. Syntax highlighting of code

Just say no.

> 09. Code folding

This is interesting but doesn't fit easily into the model.
I do wish there were a way to do this, and not just for
folding code.  But it would probably break the very deep
assumption in acme that window contents are ordinary
text streams.  Acme gets a lot of benefit from that one
decision, but this might be one of the drawbacks.

On the other hand, not having code folding means that
you have to write good code to begin with.  Code folding
might be the C++ equivalent of Emacs paren matching for Lisp:

        The various ML dialects share the same flaw in their
    syntax. They lack a simple property I call editor
    friendliness. An editor friendly language has the property
    that a simple calculation is all that is needed to locate the
    beginning of an expression when one is at the end of an
    expression.
        As you can guess, Lisp is a very editor friendly language.
    Because of this fact, an experienced Emacs user realizes
    nearly all of the benefits of structure based editing
    without suffering from its restrictions.
        --- John D. Ramsdell

        The various Lisp dialects share the same flaw in their
    syntax. They lack a simple property I call human
    friendliness. A human friendly language has the property
    that syntactic constructs are different enough from one
    another that a simple visual inspection is all that is
    needed to locate the beginning of an expression when one
    is at the end of an expression.
        As you can guess, Lisp is a very human unfriendly
    language. Because of this fact, an experienced Lisp user
    realizes that it is virtually impossible to write Lisp
    programs of any size without substantial mechanical
    assistance.
        --- Andrew Koenig

You're better off writing code that doesn't need folding
to be read.

> 10. Code clips/completion

Just say no.

> 11. Bookmarks

Make a file with things like

	/sys/src/cmd/acme/scrl.c
	/sys/src/cmd/acme/scrl.c:100
	/sys/src/cmd/acme/scrl.c:/^mousethread

and open it.

> 12. Display file diff with locked parallel windows

Personally, I'm happy with running diff -n and
right-clicking the headers to display a particular
section in context.  This is actually better than the
locked windows because at any point you can go
do something else and then come back to it.

> 13. Customize the contextual display of commands in the tag line

Just say no.

> 14. Customize the color scheme

Just say no.

> 15. Change fonts

As Erik pointed out, there is a Font command that applies
to the whole window.  Changing fonts inside the text
would break the text model.

> 16. HTML tag matching

Easy external program.

> 17. Display (in status bar?) the Unicode ID of glyph at cursor

As Erik pointed out, you can always cut and paste a character
and feed it to the "unicode" program.  You don't even need
Erik's > command.  Just type the word unicode (or "unicode -n")
in a tag somewhere, highlight the letter you want,
and then 2-1 click unicode.

> 18. Display right-to-left text

This is essentially left as an exercise to the interested user.
There are a lot of difficult issues here, and none of the
developers use right-to-left text.

> Also, regarding Acme's use as a file browser:
>
> 19. Open new directories in the same window,
> so that you don't get a desktop full of windows
> as you drill down through a directory tree.

Easy external program, but why not just type
the whole path to the directory you want, perhaps
with help from ^F?

Russ



  parent reply	other threads:[~2008-08-19 17:58 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 15:52 Wendell xe
2008-08-19 16:01 ` ron minnich
2008-08-19 16:11 ` erik quanstrom
2008-08-19 21:23   ` Lyndon Nerenberg
2008-08-19 16:31 ` Robert Raschke
2008-08-19 21:00   ` Steve Simon
2008-08-19 17:50 ` Ramon de Vera
2008-08-19 17:58 ` Russ Cox [this message]
2008-10-22 12:37   ` Rudolf Sykora
2008-10-23 18:26     ` Rudolf Sykora
2008-10-23 20:17       ` yy
2008-10-24 17:51     ` Russ Cox
2008-10-24 18:17       ` Rudolf Sykora
2009-04-05 16:19       ` Rudolf Sykora
2008-08-19 20:22 ` Pietro Gagliardi
2008-08-19 21:24   ` Iruata Souza
2008-08-20  0:28     ` David Leimbach
2008-08-20  3:54 ` Pietro Gagliardi
2008-08-20  3:56   ` Bruce Ellis
2008-08-20  8:48   ` Eris Discordia
2008-08-20  9:21     ` matt
2008-08-19 22:00 Eris Discordia
2008-08-19 22:12 ` andrey mirtchovski
2008-08-19 23:14   ` Eris Discordia
2008-08-20  3:12   ` Skip Tavakkolian
2008-08-20  3:17     ` andrey mirtchovski
2008-08-20  8:31     ` Eris Discordia
2008-08-19 22:14 ` Francisco J Ballesteros
2008-08-19 22:26   ` Steve Simon
2008-08-19 23:27   ` Eris Discordia
2008-08-19 23:36     ` Jonathan Cast
2008-08-20  0:42       ` Eris Discordia
2008-08-20  2:08     ` a
2008-08-20  8:06       ` Eris Discordia
2008-08-20  3:26     ` Skip Tavakkolian
2008-08-20  3:31       ` Bruce Ellis
2008-08-20  8:41       ` Eris Discordia
2008-08-19 22:25 ` Pietro Gagliardi
2008-08-19 22:31   ` Pietro Gagliardi
2008-08-19 22:46     ` Federico G. Benavento
2008-08-20  0:31       ` Eris Discordia
2008-08-19 23:03     ` Benjamin Huntsman
2008-08-20  0:34       ` Eris Discordia
2008-08-20  0:58         ` Benjamin Huntsman
2008-08-19 22:34 ` erik quanstrom
2008-08-20  3:11 ` Skip Tavakkolian
2008-08-19 23:51 Eris Discordia
2008-08-20  0:30 ` Pietro Gagliardi
2008-08-20  1:31 ` Iruata Souza
2008-08-20  1:43   ` Eris Discordia
2008-08-20  2:00     ` Pietro Gagliardi
2008-08-20  7:03       ` Eris Discordia
2008-08-20  7:36         ` bb
2008-08-21  0:03     ` Dan Cross
2008-08-24  7:27 ` John Waters
2008-08-24 18:14   ` Eris Discordia
2008-08-25  5:43     ` John Waters
2008-08-20  0:10 Eris Discordia
2008-08-20  2:29 ` a
2008-08-20  8:01 ` Steve Simon
2008-08-20  0:30 Eris Discordia
2008-08-20  3:34 ` geoff
2008-08-20  3:43   ` Pietro Gagliardi
2008-08-20  3:48     ` Bruce Ellis
2008-08-20  8:42   ` Eris Discordia
2008-08-20  1:39 Eris Discordia
2008-08-20  2:08 ` Pietro Gagliardi
2008-08-20  2:13 ` Iruata Souza
2008-08-20  8:08   ` Eris Discordia
2008-08-20  5:02 ` sqweek
2008-08-20  9:15   ` Eris Discordia
2008-08-20  9:44     ` Sander van Dijk
2008-08-20  9:53     ` sqweek
2008-08-20 10:12     ` matt
2008-08-20 12:27       ` Bruce Ellis
2008-08-20 16:23     ` Iruata Souza
2008-08-20  8:10 ` Steve Simon
2008-08-20  8:04 Eris Discordia
2008-08-20  8:29 Eris Discordia
2008-08-20  8:33 Eris Discordia
2008-08-20  9:03 Eris Discordia
2008-08-20  9:34 Eris Discordia
2008-08-20 11:56 ` Robert William Fuller
2008-08-20 12:25   ` Eris Discordia
2008-08-20  9:44 Eris Discordia
2008-08-20 12:36 Eris Discordia
2008-08-20 12:56 Eris Discordia
2008-08-20 18:08 ` sqweek
2008-08-20 18:58   ` erik quanstrom
2008-08-20 19:47     ` sqweek
2008-08-20 13:01 Eris Discordia
2008-08-20 13:22 ` Sander van Dijk
2008-08-20 21:46 Eris Discordia
2008-08-20 22:41 ` Pietro Gagliardi
2008-08-20 23:15 ` Geoffrey Avila
2008-08-21  7:42 ` Uriel
2008-08-21 10:58   ` erik quanstrom
2008-08-21 13:25     ` john
2008-08-21 13:31     ` David Leimbach
2008-08-21 16:59   ` Eris Discordia
2008-08-21 17:14     ` ron minnich
2008-08-21 10:36 ` erik quanstrom
2008-08-20 23:49 Eris Discordia
2008-08-21 16:39 Eris Discordia
2008-08-21 17:11 ` ron minnich
2008-08-21 18:29   ` hiro
2008-08-21 17:20 Eris Discordia
2008-08-21 17:36 Eris Discordia
2008-08-21 20:39 ` ron minnich
2008-08-21 22:11   ` Eris Discordia
2008-08-22  2:58     ` Federico G. Benavento
2008-08-22  6:13     ` Andrew Simmons
2008-08-22  9:41       ` hiro
2008-08-24  8:20 erik quanstrom
2008-08-24 16:52 Eris Discordia
2008-08-24 17:13 Eris Discordia
2008-08-25  3:57 ` Michaelian Ennis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080819175641.3B7301E8C54@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@9fans.net \
    --cc=wendellxe@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).