Article View: gnu.emacs.bug
Article #99503philosophical bugs in emacs
From: slehar
Date: Tue, 04 Sep 1990 21:57
Date: Tue, 04 Sep 1990 21:57
380 lines
19229 bytes
19229 bytes
I have been a heavy user of emacs for a number of years now, and have
finally achieved moderate proficiency even in some of the many obscure
modes. I have a great deal of admiration for the Free Software
Foundation and its ideals, and I deeply appreciate their contribution
of emacs to the user community. Emacs has made my life with unix much
more bearable, particularly because it was available on the wide range
of machines with which I have come in contact in recent years.
I don't forget however the difficult learning curve I experienced with
my first exposure to emacs. I had experience with several editors on
several operating systems at the time, so my complaints are not those
of a neophyte. Summing up over those years, I can now say that emacs
is very sophisticated and powerful for the experienced user. For the
beginner however it is so formidable that many who try it give up in
disgust before they have a chance to learn the better features of it.
I have been compiling a list of complaints of emacs features, and it
occured to me that it would only be fair to send it to you guys even
if you can't do anything about it. I am sure that you yourselves
would have done things differently if you had to do it all over again,
and in context, I believe that emacs stands out as one of the great
pieces of software in computer history. I have tried, in my
complaints, to be constructive, suggesting other ways it could have
been done rather than just bitching.
Anyway, for whatever its worth, here's the list.
EMACS COMPLAINTS
================
The basic movement commands are difficult to master because they
involve control characters, and the keys are widely separated on the
keyboard, so for instance if you want to repeat the sequence "up
left delete up left delete..." you must use both hands in a complex
sequence of motions. A better choice would be to have basic motion
commands grouped together on the keyboard, like i,k,j,m etc. and a
logical representation, such as j=backward-char and k=forward-char,
and h=backward-word and l=forward-word.
Many operations are not reversible, in that when an operation is
done, then undone, you are not in the same state as you were
initially. For instance if you do a M-d (delete word forward)
followed by a C-y (yank) or C-_ (undo) your cursor is now on the
other side of the deleted word. All commands should have a
complementary command that returns you exactly to the original
state.
The meta- key is used very extensively in emacs although it is not
even a standard key on most keyboards, and the alternative use of
ESC is very clumsy, and forces emacs users to learn two sets of
motions for common operations on different keyboards. It also
happens to be one of the keys that are always in a different
position on different keyboards. Its not clear how this problem
could be overcome.
C-h is a logical key for help mode, but unfortunately it is also
defined as delete, or is it back space?. These two troublesome keys
are constantly switched around on different keyboards and cause
endless inconvenience. All too often, on a strange keyboard, I
strike back-space (or delete, you know, the wrong one) and get into
help mode. Until keyboard manufacturers get their keys
standardized, both of these keys should be mapped to
delete-backward-char.
The big jump commands C-v and M-v only go to within a page of the
beginning or end of the buffer, necessitating a switch to smaller
jump commands C-n and C-p to get all the way. A big jump near the
end should bring you all the way to the end.
The big jump commands C-v and M-v always jump one page ahead of the
cursor, so that when you stop jumping, you then must move the cursor
again to center it on the page, or jump a page beyond where you want
to go and then center with C-l. Either way you do more work than
necessary. These jump commands should always place the cursor in
the middle of the page.
The delete word command M-d picks the strangest criteria for
determining separation between 'words'. For instance, when deleting
the last word at the end of a sentence the space and period remain.
If you then do another M-d that deletes the period, the following
space, AND the first word of the next sentence! It would be much
more rational to use white space as word separator. In a c program
the problem is even worse, as it is almost impossible to predict how
far the delete will jump. The commands M-f and M-b exhibit the same
problem. The word jump commands should jump to the next white space
in text mode, and to the next ; or } in c-mode. There should be a
convention that a word is associated with the space before it (or,
alternatively the space after it) so that all word handling commands
such as delete-word delete both the word and its space. Search
commands would position the cursor convently for a single stroke
word deletion.
The search command C-s causes endless trouble by putting emacs into
a different mode, which causes confusion by redefining the keys.
The common operation of searching for a word and then deleting it is
made much more difficult as it requires an ESC to exit the search
mode, followed by the delete, followed by C-s C-s to search for the
next occurence. All too often I hit delete before ESC, which
deletes a character in the mini-buffer, thus changing the search
string and throwing me back somewhere else. There should be a
bare-bones simple search command that searches only for the next
occurence of a completely defined string, allowing immediate use of
the normal commands like delete.
Searching forward with C-s places the cursor after the string,
whereas searching backwards with C-r places it before the string,
requiring different commands for dealing with the string. This
makes it difficult to predict instinctively where you will wind up
after the search.
The combination of the commands C-x . (set-fill-prefix) and M-q
(fill-paragraph) provide a convenient approximation to real word
wrap in a word processor. There is however a philosophical
dichotomy in the way it recognizes adjacent paragraphs. Say for
instance you set fill prefix to two spaces, like this paragraph, and
one of the lines 'hangs out' to the left margin. M-q will not
recognize this line as part of the paragraph, and therefore will not
wrap it back into the fill prefix. If however you have a heading
line at the top of the paragraph with no fill prefix, followed by a
paragraph with a two-space prefix, a M-q on this paragraph will
append the paragraph onto the end of the heading line. In other
words in this case it will accept the title line as part of the
paragraph even though it has a different fill prefix! This
combination of sometimes including and sometimes excluding lines of
different fill prefix is maximally inconvenient. If it always
accepted adjacent lines as part of the paragraph, you could clean up
and justify the most ragged paragraphs with one keystroke, without
having to force the lines to conform first to the fill prefix. You
would only have to ensure that there is vertical white space between
paragraphs (which is already a restriction). If it always rejected
adjacent lines with different fill prefix, you would not have to
worry about non-indented title lines.
There is no way to undo a movement command. Often an accidental
keystroke throws you off into the text somewhere, which always
requires a tedious sequence of keystrokes to return to where you
came from. A 'movement-undo' command would be convenient.
There is no function to produce double-spacing in text mode.
The delete-line command C-k behaves differently for regular lines
than for lines consisting of only a <CR>. This is especially
troublesome when you delete a line without a <CR>, as at the end of
file. Line processing would be much facilitated if there were a
real "delete line" command that deleted the whole line including
<CR> with a single keystroke.
There is no marker for the end of file, so that extraneous <CR>
characters are invisible. Alternatively, deleting a line at the end
of file produces tediously unexpected results, as noted above.
The undo command is very useful. If however you have many undo's to
perform, you run into a problem when you exceed the limit of stored
undo information. If you give it one too many undo commands, it
starts undoing the undo's themselves! You are now in a nasty
position where you did not achieve all the undo's you wanted to
originally, and worse still, some of the undo's that you have
achieved have themselves been undone. You now have two unpleasant
options- either you undo through the whole sequence until you get
back to the original condition (this means many undo's, and you'd
better recognize when you get back to the initial condition) or just
recover the file and lose all your edits before the undo sequence.
It would be much friendlier to inform the user when the undo
information has been exhausted, and to give him the option of
forgetting about ALL the undo's, or to keep the ones that have been
performed up to that point.
The macro facility in emacs is one of the most powerful and useful
features, especially C-x ( ... C-x ) where you can interactively
define the macro while even you are testing it. The only pity is
that you can only have one macro at a time. Often times you would
like to define a couple of macros and use them alternately. I know
that you can name them and call them that way, but the overhead of
creating the macro, naming it, and calling it by name is so great as
to make it impractical for many quick editing tasks. It would be
nice if the first macro defined automatically became macro-zero. If
you give a command argument as in "M-3 C-x (" that it would define
macro-three instead of macro-zero. Now, to execute the macro,
without argument it would always execute macro-zero, whereas with
argument it would execute the appropriate macro, as in "M-3 C-x e"
to execute macro-three.
The help facility and info tree are wonderful features, as is the
emacs tutorial. The problem with the former two is that you almost
have to know the answer to your question before you can begin to
look it up. Watch a new user of emacs struggling with it and you
will know exactly what I mean. The problem with the latter is that
it is too time consuming- I don't know of any emacs user who has
been through the whole thing, and I myself could only stand an hour
of it. The thing that is missing is a quick, easy summary of only
the essential functions that an ordinary user needs to know just to
get started. It is important in such a summary to keep it short and
simple enough that someone can learn it quickly and print it out to
have it at hand when he needs it. The basic functions are movement,
cutting and pasting, reading and writing files, and a few other
basic things. I supply as an example the help facility I wrote for
our people at BU.
EMACS BASIC SUMMARY
===================
in emacs parlance, C- means [ctrl] and M- means [meta], so that C-n
means hold down the [ctrl] key while striking n. If you have no [meta]
key, use [esc], where M-w means strike (and release) [esc], then
strike w.
For every emacs command there is always a M-x version and often a C-x
or C-<key> version. The M-x version is the full command name, and the
C-x version (if it exists) is a keyboard macro for the same command.
For example "M-x forward-char" is equivalent to "C-f". You can define
your own keyboard macros for any command. If a M-x command requires a
numerical argument, supply the argument first with M-<number>, then
the command. For example to indent a region with two spaces, mark the
region (beginning with C-2 then move to end) and type "M-2 M-x
indent-region". When typing a M-x command, you can type the first few
characters and [tab] for automatic command completion.
MOVEMENT COMMANDS
=================
C-f forward char (Try the arrow keys, they may work too)
C-b back char
C-n next line
C-p previous line
M-] next paragraph
M-[ previous paragraph
C-v next page
M-v previous page
C-< beginning of buffer
C-> end of buffer
C-l center page
MARK CUT PASTE
==============
C-2 mark beginning of region, then move to end
C-w cut region
M-w copy region (like C-w but leaves original)
C-y paste (yank) last deleted section
C-k cut line (you can do C-k C-k C-k ... and one C-y to restore)
SEARCH & REPLACE
================
C-s <string> search forward for string, quit with [esc]
C-r <string> search reverse for string, quit with [esc]
M-% <s1> [ret] <s2> search for all occurences of <s1> and replace with
<s2> with confirmation:- [spc] = ok, replace this
one, [delete] = skip this one, try the next, [esc]
= quit the search & replace.
QUIT EMACS
==========
C-x C-s save buffer (often these two are done in this order)
C-x C-c exit emacs
C-z suspend emacs, go back to unix. Resume with "fg".
Be careful when suspending, this leaves a running copy of
emacs 'hanging around' using up space. Do not start a new
emacs until you have killed the old one properly.
READING & WRITING FILES
=======================
C-x C-f <file> find <file> and open a new buffer for it (use C-x b)
C-x i <file> insert <file> in this buffer at cursor location
BUFFER OPERATIONS (emacs windows)
=================================
C-x b <buf> switch to buffer <buf> ([ret]=default, [tab]=prompt)
C-x 1 close all buffers except the one youre in
C-x 2 split screen to two buffers (then do C-x b <buf>)
EMACS HELP FACILITIES
=====================
C-h C-h C-h complete emacs help.
C-h a <subj> help apropos <subj>, like "C-h a buffer" tells about buffers
C-h i info tree- browse through the emacs information tree.
C-h m help mode. This is useful in all fancy modes such as rmail,
gnus, info, etc. Gives brief summary of commands
UNDO AND ABORT
==============
C-_ undo last command (C-_ C-_ C-_ = undo last 3 commands)
C-g abort this command (sometimes you need C-g C-g C-g)
TEXT PROCESSING
===============
M-x auto-fill-mode toggle auto-fill mode (wrap-around)
M-q justify paragraph
M-1 M-q right justify paragraph (actually any number will do for 1)
M-g justify region
C-x . set fill prefix- example if you want the whole paragraph
indented with 2 spaces, type 2 spaces, then C-x . then type
in the rest of the paragraph. M-q will now indent this
paragraph with 2 spaces. (non-indented lines will be counted
as a different paragraph)
C-x f set right margin (with numeric argument or 'here') default=70
C-q C-l insert form-feed
C-x ] go to next page
C-x [ go to prev page
C-x C-p mark page (then C-w to cut) formfeed is at end of page.
C-x l count lines in this page. Format= total (above+below)
M-<num> C-x $ hide all lines indented more than <num> spaces (overview)
DEFINING KEYBOARD MACROS
========================
C-x ( start keyboard macro def. then type any sequence of commands
C-x ) end keyboard macro def.
C-x e execute last defined keyboard macro
M-x name-last-kbd-macro <name> assign a name to the last defined
keyboard macro (abbrev. name[tab])
M-x global-set-key <key> <command> define a key to represent a command
(abbrev. global-s[tab])
MORE ADVANCED TRICKS
====================
c-u c-[spc] jump back to last mark
m-x compile compile your program & keep track of the errors
c-x ` find the next error
Esc C-l go to line number
TAG TABLES allows you to tag a group of related files so that you
can perform operations such as search & replace on all
the files without having to edit them individually.
For full information check info tags
truncation you can make long lines truncate instead of continue
on the next line by setting the variable
truncate-lines to t. This is done by the command "Esc
Esc" (evaluate expression) and then type the
expression (setq truncate-lines t) in the command
minibuffer. You can then scroll left and right to see
them with C-x > and C-x <
PROBLEMS
========
common problems encountered with emacs
can't save files check that your disk quota is not exceeded.
INIT FILE (~/.emacs)
====================
emacs reads the init file to set all your defaults. The following are
some useful things you may want to include in your init file, just
copy them in if you like the sound of them. The comments are already
in lisp syntax for you.
;;;; make [tab] insert a [tab] in c-mode ;;;;
(setq c-tab-always-indent nil)
;;;; make search case sensitive ;;;;
(setq-default case-fold-search nil)
;;;; make text-mode the default for new buffers ;;;;
(setq default-major-mode 'text-mode)
;;;; turn on auto-fill automatically in text mode ;;;;
(setq text-mode-hook
'(lambda () (auto-fill-mode 1)))
;;;; set arrow keys for x-terms ;;;;
(progn
(setq SS3-map (make-keymap))
(define-key SS3-map "A" 'previous-line) ; up arrow
(define-key SS3-map "B" 'next-line) ; down arrow
(define-key SS3-map "C" 'forward-char) ; right arrow
(define-key SS3-map "D" 'backward-char) ; left arrow
(define-key global-map "\eO" SS3-map)
)
;;;; gnus stuff- you need this to run gnus ;;;;
(autoload 'gnus "gnus" "GNU Emacs NNTP-based news reader" 1)
(autoload 'gnus-post-news "gnus" "Post an article." t)
(setq gnus-nntp-server "bu-it")
(setq gnus-your-domain "bu.edu")
(setq gnus-your-organization "Boston University Center for Adaptive Systems")
(setq gnus-auto-select-next 'quietly)
(global-set-key "\C-x4g" 'gnus)
Technical Details
Message-ID:
<9009042157.AA26746@cochlea.bu.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!BUCASB.BU.EDU!sleharShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,ad6f12f51d80670c,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-09-04 14:57:37 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!BUCASB.BU.EDU!slehar From: slehar@BUCASB.BU.EDU Newsgroups: gnu.emacs.bug Subject: philosophical bugs in emacs Message-ID: <9009042157.AA26746@cochlea.bu.edu> Date: 4 Sep 90 21:57:37 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 380 Posted: Tue Sep 4 22:57:37 1990