Article View: gnu.emacs.bug
Article #99439Re: philosophical bugs in emacs
From: Joseph Wells
Date: Mon, 10 Sep 1990 01:25
Date: Mon, 10 Sep 1990 01:25
122 lines
6565 bytes
6565 bytes
In article <9009042157.AA26746@cochlea.bu.edu> slehar@BUCASB.BU.EDU writes:
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.
Here is a fix for all of the kill commands that makes undo reverse them
exactly, including positioning point where it was before the operation:
*** /usr14/gnu/dist-18.55/lisp/simple.el Fri Jul 22 06:14:42 1988
--- simple.el Sun Sep 9 21:19:51 1990
***************
*** 543,547 ****
(interactive "*r")
(copy-region-as-kill beg end)
! (delete-region beg end))
(fset 'kill-ring-save 'copy-region-as-kill)
--- 543,549 ----
(interactive "*r")
(copy-region-as-kill beg end)
! (save-excursion
! (goto-char beg)
! (delete-region beg end)))
(fset 'kill-ring-save 'copy-region-as-kill)
Yank will still always leave point at the end of the yanked text by
default.
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.
I have fixed this with my "scroll-fix.el" package. This package makes the
scrolling commands completely reversible in all cases, after any number of
scrolling operations. (In other words, point and the window start point
are both restored exactly.)
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.
My scroll-fix package keeps point on the same line of the window, and
tries to keep it on the same column.
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.
Actually, it is easy to predict exactly what kill-word and
backward-kill-word will delete, but it requires some knowledge of the
syntax table for each mode.
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.
There is; read the manual regarding search-forward. In addition, you
should be using a replace or query-replace operation to delete occurrences
of a word.
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.
Actually, it is easy. If you're searching forward, you know you will end
up after what you searched for, and vice versa if you're searching
backward. And just before you terminate your search, you can always jump
to the other end of what you've found by using C-s or C-r to switch
directions.
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.
Kyle Jone's "filladapt.el" package handles this correctly.
[stuff deleted]
You would only have to ensure that there is vertical white space
between paragraphs (which is already a restriction).
This depends on the value of paragraph separate; for example in
fundamental-mode and in text-mode it is sufficient to indent the first
line of a paragraph.
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.
Such a command is unlikely to be written due to the large amount of
rewriting of other code this would require.
--
Joe Wells <jbw@bu.edu>
Technical Details
Message-ID:
<JBW.90Sep9212547@bucsf.bu.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!lll-winken!bu.edu!nntp-read!jbwReferences:
<9009042157.AA26746@cochlea.bu.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,ad6f12f51d80670c X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-09-09 18:25:47 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!lll-winken!bu.edu!nntp-read!jbw From: jbw@bucsf.bu.edu (Joseph Wells) Newsgroups: gnu.emacs.bug Subject: Re: philosophical bugs in emacs Message-ID: <JBW.90Sep9212547@bucsf.bu.edu> Date: 10 Sep 90 01:25:47 GMT References: <9009042157.AA26746@cochlea.bu.edu> Sender: news@bu.edu.bu.edu Distribution: gnu Organization: Boston University Computer Science Department Lines: 122 Posted: Mon Sep 10 02:25:47 1990 In-reply-to: slehar@BUCASB.BU.EDU's message of 4 Sep 90 21:57:37 GMT