The Modernization of Emacs: terminology buffer and keybinding

Robert Uhl eadmund42 at NOSPAMgmail.com
Sun Jun 24 21:42:20 EDT 2007


Twisted <twisted0n3 at gmail.com> writes:
>
>> > Really? None of [navigating a folder window analogue] happens if
>> > you just do the straightforward file-open command, which should
>> > obviously at least provide a navigable directory tree, but
>> > definitely does not.
>>
>> The first does.  Really, it does.  Fire up emacs (which you've never
>> done before) and type C-x C-f.
>
> Whoa, Nellie. I seem to recall we were discussing the file-open
> command.  That was something else, like C-x C-o or something. More
> apples-and- oranges?

Fortunately, emacs has a facility to tell exactly what's bound to a key
sequence.  C-h k (or f1 k, if you prefer)followed by that sequence will
display what's bound to it, and the documentation for that function.

C-h k C-x C-o yields:

  C-x C-o runs the command delete-blank-lines

C-h k C-x o yields:

  C-x o runs the command other-window

C-h k C-x C-f yields:

  C-x C-f runs the command find-file

So you can see how cool emacs is, here's the entire output for C-x C-f,
demonstrating how the editor documents itself:

  C-x C-f runs the command find-file
    which is an interactive compiled Lisp function in `files.el'.
  It is bound to <open>, C-x C-f, <menu-bar> <file> <new-file>.
  (find-file filename &optional wildcards)
  
  Edit file filename.
  Switch to a buffer visiting file filename,
  creating one if none already exists.
  Interactively, the default if you just type RET is the current directory,
  but the visited file name is available through the minibuffer history:
  type M-n to pull it into the minibuffer.
  
  Interactively, or if wildcards is non-nil in a call from Lisp,
  expand wildcards (if any) and visit multiple files.  You can
  suppress wildcard expansion by setting `find-file-wildcards' to nil.
  
  To visit a file without any kind of conversion and without
  automatically choosing a major mode, use M-x find-file-literally.

>> You will be presented with a prompt
>> something like 'Find file: ~/'; hit tab once; you'll see the message
>> '[Complete, but not unique]'; hit tab again and you will be presented a
>> list of all files in that directory.
>
> Sounds clunky anyway. I don't need a bunch of keypresses to do the
> equivalent in an Explorer-based file-open dialog in a native Windows
> app. Just a double-click.

Generally, you need to scroll, too, as the Windows file widget doesn't
display a lot of files at once.

> Of course, there's an even faster Windows way, if you don't mind not
> seeing lists of possible items:
> Alt, f, o
> Startofname-down-/-Subd-down-/

How is this different from C-x C-f Startofname-tab-Subd-tab?  Except
emacs saves you type slashes...

>> If you like 'em, though, just select File:Visit New File.  It gives
>> you a platform-default (gtk+, for me) file selector.
>
> Now we're talking about a graphical port instead of stock emacs
> again. :P

That _is_ stock emacs, I assure you.

>> Fortunately, folks brighter than you & I have imagined a nice way for
>> us.  It pops up a new Emacs window (pane, if you prefer the
>> terminology) showing a list of all filenames.  You could continue
>> typing, or just click on a filename in the window, or hit return
>> while the cursor is on a filename in that window.
>
> Back to discussing a graphical port again.

It's not a port--it's emacs.  And save for the click all of the above
works in both a GUI and a console.  It's nice working the same way in
multiple places.

> Besides the apples and oranges issue, this amounts to implementing a
> dodgy imitation of a file open dialog anyway.  Why bother with such an
> imitation when you can use a natively-GUI editor written for your
> platform and get access to the real thing?

Because it's nice having the same interface no matter what.  Because
GUIs come and GUIs go (remember CDE?  OpenView?), but emacs will always
be there.  Because it's nice being able to fire up emacs and not care
what platform one is running on.

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
prepBut nI vrbLike adjHungarian! qWhat's artThe adjBig nProblem?
                                                  -- Alec Flett



More information about the Python-list mailing list