[comp.editors] Misbehavior in Jove

wongpw@isl.Stanford.EDU (Ping Wah Wong) (06/11/88)

I just found a problem in the case-word-capitalize, case-word-lower
and case-word-upper commands of Jove. Basically, if the cursor is in the
middle of a word, e.g., middle, the command case-word-capitalize would
                           ^
                           |
                      cursor position

result in midDle, rather than Middle. Does someone has a solution to
this?



----------------------------
Ping Wah Wong      ARPA: wongpw@isl.stanford.edu

jpayne%breakpoint@Sun.COM (Jonathan Payne) (06/12/88)

In article <212@isl.stanford.edu> wongpw@isl.Stanford.EDU (Ping Wah Wong) writes:
>I just found a problem in the case-word-capitalize, case-word-lower
>and case-word-upper commands of Jove. Basically, if the cursor is in the
>middle of a word, e.g., middle, the command case-word-capitalize would
>result in midDle, rather than Middle. Does someone has a solution to
>this?


That is the way JOVE is spozed to behave.  It's the way any of the real
emacs editors do it.  You could do ESC - ESC C, which means capitalize
the previous word, which actually does the current word if you're not
already at the beginning of it.  It makes sense, really!  Oh, "ESC -" is
the same as "ESC - 1", just in case that wasn't obvious.

sft@ihlpa.ATT.COM (Scott Thompson) (06/13/88)

From article <212@isl.stanford.edu>, by wongpw@isl.Stanford.EDU (Ping Wah Wong):
> middle of a word, e.g., middle, the command case-word-capitalize would
>                            ^
>                            |
>                       cursor position

This is not a bug.  Every version of emacs I have ever used, performs
this function in the exact same way.  Maybe a macro to find the begining
of the current word before capitalization is what you really want?

-- 
--
  Scott Thompson (IHP 2A-428), AT&T Bell Labs, Naperville, Il. 60566

       VOICE: (312)-416-4236     UUCP: ...!ihnp4!ihlpa!sft

kent@xanth.cs.odu.edu (Kent Paul Dolan) (06/15/88)

In article <8181@ihlpa.ATT.COM> sft@ihlpa.ATT.COM (Scott Thompson) writes:
>From article <212@isl.stanford.edu>, by wongpw@isl.Stanford.EDU (Ping Wah Wong):
>> middle of a word, e.g., middle, the command case-word-capitalize would
>>                            ^
>>                            |
>>                       cursor position
>
>This is not a bug.  Every version of emacs I have ever used, performs
>this function in the exact same way.  Maybe a macro to find the begining
>of the current word before capitalization is what you really want?
>
>-- 
>--
>  Scott Thompson (IHP 2A-428), AT&T Bell Labs, Naperville, Il. 60566
>
>       VOICE: (312)-416-4236     UUCP: ...!ihnp4!ihlpa!sft


Hmmm.  I've seen two notes now claiming this isn't a bug.  OK.  Let's
call it a horrid human factors design flaw instead, then.  The one
time in 1000 I need to capitalize some middle letter of a word I can
type space, escape-C backspace.  Instead, the 999 times in 1000, I
have to add extra command characters, or spend extra attention
navigating to the beginning of a word, to do the capitalization or
lowercasing.  Ick.  Especially since the usual case is that I'm part
way through touch typing the word when my brain catches up with my
fingers and says: "Capitalize it, dummy!"

Emacsi are so often tailored, I have no idea whether this was in the
original code, but the version of Gosling Emacs we were running before
this site switched to GNUemacs did capitalize the beginning from in or
at the end of the word, and one of our local gurus built this into a
compatibility package for those of us who like backspace instead of
delete and a few other features of Gosling's version worth keeping, so
it still works here the way I like it (Thanks, Kyle).

While we're speaking of design flaws, why in the world does ^N insert
newlines at the end of a file, when the return key is available for
that job?  (Kyle overrode that one, too.)  It sure is nice to be able
to use ^N, which I can touch type, rather than Escape->, which I have
to look for, to find the end of a file when I'm near the bottom.

Kent, the man from xanth.

jimc@iscuva.ISCS.COM (Jim Cathey) (06/16/88)

In article <5584@xanth.cs.odu.edu> kent@cs.odu.edu (Kent Paul Dolan) writes:
>lowercasing.  Ick.  Especially since the usual case is that I'm part
>way through touch typing the word when my brain catches up with my
>fingers and says: "Capitalize it, dummy!"

I have never had any problem here -- I just lean on the Meta (Alt) key and 
type BC.  Word's capitalized and I'm back where I was.  A real meta key is
sure nice!  (A pair's even better, one on each end of the spacebar.)

>While we're speaking of design flaws, why in the world does ^N insert
>newlines at the end of a file, when the return key is available for
>that job?  (Kyle overrode that one, too.)  It sure is nice to be able
>to use ^N, which I can touch type, rather than Escape->, which I have
>to look for, to find the end of a file when I'm near the bottom.

Hear hear!  I've always hated that feature, and since I'm the one who 
installed GNU Emacs here I took it out completely!  Local standards by fiat!

On an unrelated issue...  Is anyone else disgusted by the misuse of the
term 'meta' in the microemacsen?  It looks like they just did a global-
search-and-replace of Meta for ESC!  (Leading to such silliness as "...press
the Meta key to stop the search.")  I even had to do quite a bit of
hacking around to make it even recognize Meta functions (8th bit set on
characters) as commands.  It looks like all microemacs people
are IBM PC'ers, who would rather get the extended character set on Alt
as opposed to Meta functions.  Sounds backward to me!

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC Systems Corp.
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!iscuva!jimc
! II      CCCCCC !  (509) 927-5757
+----------------+
			"With excitement like this, who is needing enemas?"

casey@admin.cognet.ucla.edu (Casey Leedom) (06/17/88)

In article <5584@xanth.cs.odu.edu> kent@cs.odu.edu (Kent Paul Dolan) writes:
> 
> [Description of what happens in emacs and jove when you type
> case-word-capitalize in the middle of a word.]
> 
> Hmmm.  I've seen two notes now claiming this isn't a bug.  OK.  Let's
> call it a horrid human factors design flaw instead, then.  One time in
> 1000 I need to capitalize some middle letter of a word ...

  If you want this behavior when using jove, just define ^[c and ^[C
to do ^[-case-word-capitalize.  This can be done under jove 4.8 and later
via:

	define-macro my-case-word-capitalize ^F^[-^[xcase-word-capitalize^M
	bind-macro-to-key my-case-word-capitalize ^[c
	bind-macro-to-key my-case-word-capitalize ^[C

  Under earlier versions of jove you'll have to define the macro by typing
it once and then saving all of your macros to a file.  Not being a GNU
emacs user, I don't know how to do this there, but I'm sure it's possible.
By the way, a nicer way to do the above is:

	define-macro my-case-word-capitalize ^F^[-^[C
	bind-macro-to-key my-case-word-capitalize ^[c

This binds the new my-case-word-capitalize to ^[c (lower case c) and
leaves the standard case-word-capitalize bound to ^[C (upper case C).
It's faster, doesn't leave the "case-word-capitalize" command cluttering
up the command line, and leaves the old case-word-capitalize conveniently
available if you do find a case where you need it.

> While we're speaking of design flaws, why in the world does ^N insert
> newlines at the end of a file, when the return key is available for that
> job?

  It should be noted that this is a ``feature'' of GNU emacs.  Jove
doesn't do that and quite properly stops at the end of the buffer.  I have
absolutely no idea why GNU does this.  After all, ^F doesn't automatically
extend lines when you reach the end.  Likewise ^P and ^B don't insert
blank lines at the beginning of the buffer or a line.

  It's very frustrating since one gets it into the mode of thinking that
^N is a cursor movement command, and therefore save to use, only to
discover that under special circumstances it will cause buffer
modification.

  If Richard is listening, I'd vote to remove this ``feature''.

Casey

iverson@cory.Berkeley.EDU (Tim Iverson) (06/17/88)

In article <5584@xanth.cs.odu.edu> kent@cs.odu.edu (Kent Paul Dolan) writes:
>In article <8181@ihlpa.ATT.COM> sft@ihlpa.ATT.COM (Scott Thompson) writes:
>>From article <212@isl.stanford.edu>, by wongpw@isl.Stanford.EDU (Ping Wah Wong):
>>> middle of a word, e.g., middle, the command case-word-capitalize would
>>>                            ^
>>>                            |
>>>                       cursor position
>>
>>This is not a bug.  Every version of emacs I have ever used, performs
>>this function in the exact same way.  Maybe a macro to find the begining
>>of the current word before capitalization is what you really want?

>Hmmm.  I've seen two notes now claiming this isn't a bug.  OK.  Let's
>call it a horrid human factors design flaw instead, then.

I've used Jove for over five years and you're the first person that I've
heard complain of this - it could be that it's not a *human* factors
design issue, but a *Kent* factors design issue.  One person does not
comprise an entire race - unless perhaps he lives in a fantasy world
(hmm, "man from xanth"? :-).

At any rate, I'm glad it does start in the middle, which is the manner
in which I use this feature most often.

>While we're speaking of design flaws, why in the world does ^N insert
>newlines at the end of a file, when the return key is available for
>that job?
>Kent, the man from xanth.

It doesn't - at least not in any of the distributed versions (or the
others that I know of).  However, if you didn't set the key bindings
yourself, it is quite possible that someone has set the default binding
of ^N to "newline" instead of "next-line", especialy if someone had
already hand tailored it.


- Tim Iverson
  iverson@cory.Berkeley.EDU
  ucbvax!cory!iverson

casey@corwyn.cognet.ucla.edu (Casey Leedom) (06/17/88)

  Here's a better set of the my-case-word-XXX macros I described.  I
liked the idea well enough that I decided to start using it, but the
earlier versions I described left the cursor in funny places.  These always
leave the cursor at the end the word just like the built in versions.

define-macro my-case-word-capitalize ^F^[b^[C
define-macro my-case-word-lower ^F^[b^[L
define-macro my-case-word-upper ^F^[b^[U
bind-macro-to-key my-case-word-capitalize ^[c
bind-macro-to-key my-case-word-lower ^[l
bind-macro-to-key my-case-word-upper ^[u

Casey

jpayne%breakpoint@Sun.COM (Jonathan Payne) (06/17/88)

JOVE behaves the same way as the tops20 emacs that I had the manual for
when I first started.  At one point I just decided that for as many
commands as possible I was going to mimic as closely as possible the
original emacs.  What motivated me to do this was when I first discovered
Gosling's emacs (which admittedly became the source of good ideas for
JOVE) and I typed C-X C-F to find a file and instead it wrote all my
modified buffers and exit!  For the most part I have just assumed that
Stallman's interface is the best, since he seems to be really good at
such things.  In fact, one of the few differences that sticks in my mind
is the C-N at the end of the buffer, which in Stallman's emacs inserts a
newline (if no numeric argument is supplied).  I hated that feature from
the first day I used TORES (Text ORiented Editing System), which was sort
of a one buffer, one window, no features, emacs for the pdp11, and when I
tried to put it in JOVE (even though I hated it) I got yelled at by
everybody in the community.  So ...

As a side comment, one of the things I think that went wrong in going
from Stallman's tops20 emacs to gnu is the way buffers are used to handle
what used to be called typeout, e.g, what you get when you type '?'
during file name completion, and when you list buffers.  When I first saw
that in Gosling's I thought that was the greatest idea, and it gave me a
whole new way of looking at writing JOVE, and I went straight home and
implemented it.  But eventually I realized that I hated it and
implemented true typeout, and God what a relief it was!  Actually, now
it's an option to say whether to use buffers or not.  That way, when you
want your describe-command output to stick around, there's a way to do
it.  But how often do you want a list of buffers to stick around?

Anyway, I used to ask my computer teacher how a command should behave, and
he always said see how Stallman did it.  That's what I did with
capitalize-word or whatever it's called.  I've gotten real good at typing
ESC - ESC C to capitalize the word I missed, and so often I have to
capitalize starting from the middle of a word, for instance Postscript
... oops, I meant a capital S, as in PostScript...I think Stallman was
right.

towfigh@phoenix.Princeton.EDU (Mark Towfigh) (06/18/88)

In article <212@isl.stanford.edu> wongpw@isl.Stanford.EDU (Ping Wah Wong) writes:
>I just found a problem in the case-word-capitalize, case-word-lower
>and case-word-upper commands of Jove. Basically, if the cursor is in the
>middle of a word, e.g., middle, the command case-word-capitalize would
>                           ^
>                           |
>                      cursor position
>
>result in midDle, rather than Middle. Does someone has a solution to
>this?

In your .joverc, make a macro (note that you need to use REAL escape
characters, not '^' followed by '['):

define-macro last-word-capitalize ^[-^[C
bind-macro-to-key last-word-capitalize ^[c

This keep ESC c around for when you want to still use it.  Since I
figure you want to capitalize the word you're currently in and then
come back to where you were, this works.  If you want to wind up
after the word no matter what, then you might want to try this:

define-macro last-word-capitalize ^B^[-^[C^[f
bind-macro-to-key last-word-capitalize ^[c

I haven't tested this one. but I think it should work.

Mark
-- 
Mark Towfigh       If there's one thing I like better than a bologna
                   and whipped cream sandwich, it's honey and ketchup.
=======================================================================
UUCP/Internet:     towfigh@phoenix.princeton.edu  BITNET:  TOWFIGH@PUCC

jpayne%breakpoint@Sun.COM (Jonathan Payne) (06/18/88)

In article <3120@phoenix.Princeton.EDU> towfigh@phoenix.Princeton.EDU (Mark Towfigh) writes:
>
>In your .joverc, make a macro (note that you need to use REAL escape
>characters, not '^' followed by '['):
>

Wrong.  You can (but don't have to) use '^' followed by '['.  In fact,
when JOVE saves macros to a file, it saves control characters as two
separate characters so that ^@ and ^M and ^J can be saved correctly.
If you want a real ^ in the file you have to backslash it.

peter@sugar.UUCP (Peter da Silva) (06/18/88)

In article <1618@iscuva.ISCS.COM>, jimc@iscuva.UUCP writes:
> I have never had any problem here -- I just lean on the Meta (Alt) key and 
> type BC.  Word's capitalized and I'm back where I was.  A real meta key is
> sure nice!  (A pair's even better, one on each end of the spacebar.)

Why don't any of the Micro emacses implement REAL meta keys? Both the IBM-PC
and the Amiga have these nice ALT keys in a real convenient spot, just ready
for use as a metakey. Do the implementors really prefer hitting ESC, or have
they just forgotten that ESC is just a kludge?
-- 
-- `-_-' Peter (have you hugged your wolf today?) da Silva.
--   U   Mail to ...!uunet!sugar!peter, flames to /dev/null.
-- "A foolish consistancy is the hobgoblin of little minds".

mic@ut-emx.UUCP (Mic (... K[a-z]+) Kaczmarczik) (06/19/88)

In article <2146@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
>Why don't any of the Micro emacses implement REAL meta keys? Both the IBM-PC
>and the Amiga have these nice ALT keys in a real convenient spot, just ready
>for use as a metakey. Do the implementors really prefer hitting ESC, or have
>they just forgotten that ESC is just a kludge?

Amiga mg2a, recently posted to comp.sources.misc, has meta-key-mode,
where hitting ALT and another key sets the 8th bit of the character
code for that key.  This is interpreted by the system independent code
as a meta key. It's really nice to get all the meta functions in a
single keystroke. You can also turn this mode off when you want to
insert these characters into your buffer.

Earlier versions (1a/b) relied on the keymap to set the 8th bit when
you used the ALT key, so when Commodore changed the default keymap in
1.2, this no longer did what one might wish. My first approach was to
just use the old 1.1 keymap, but after a while someone who uses the
Dvorak keymap asked me to fix the meta key.  Check it out.

--mic--

-- 
Mic Kaczmarczik			If you drink, don't drill.
UT Austin Computation Center			-- Matt Groening
mic@emx.utexas.edu	
MIC@UTAIVC.BITNET

vkr@osupyr.mast.ohio-state.edu (Vidhyanath K. Rao) (06/20/88)

In article <2146@sugar.UUCP>, peter@sugar.UUCP (Peter da Silva) writes:
> Why don't any of the Micro emacses implement REAL meta keys? Both the IBM-PC
> and the Amiga have these nice ALT keys in a real convenient spot, just ready
> for use as a metakey. 
The version called 'mg1b' for the Amiga does use the ALT key as a meta key.
Its cousins too probably have that. But this is a complie time option and you
may have to recompile. On top of that this works only if you use the 'usa0'
keymap: '\200'|chr is considered as meta+chr. (Added inconvenience: The extra
keys on the 500/2000 are inaccesible). May be somebody can write a module for
emacs that takes the raw keycodes and converts them into what ever emacs wants.

This is still a kludge. Apparently 'alt+shift' is not done right on the Amiga.

mp1u+@andrew.cmu.edu (Michael Portuesi) (06/20/88)

peter@sugar.UUCP (Peter da Silva) writes:
> Why don't any of the Micro emacses implement REAL meta keys? Both the IBM-PC
> and the Amiga have these nice ALT keys in a real convenient spot, just ready
> for use as a metakey. Do the implementors really prefer hitting ESC, or have
> they just forgotten that ESC is just a kludge?

MG1B and MG2A have a meta-key that works perfectly.  Just define
DO_METAKEY when you compile, and use the usa0 keymap.

		--M


Michael Portuesi / Information Technology Center / Carnegie Mellon University
ARPA/UUCP: mp1u+@andrew.cmu.edu			    BITNET: rainwalker@drycas

"if you ain't ill it'll fix your car"

manis@faculty.cs.ubc.ca (Vincent Manis) (06/21/88)

In article <2146@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
>Why don't any of the Micro emacses implement REAL meta keys? Both the IBM-PC
>and the Amiga have these nice ALT keys in a real convenient spot, just ready
>for use as a metakey. Do the implementors really prefer hitting ESC, or have
>they just forgotten that ESC is just a kludge?

Unfortunately, IBM (and Atari, who copied IBM's keyboard layout) chose
to make ALT not be a real meta key. ALT does not set a "bucky bit";
rather, it generates a function key code. Not all keys may be
qualified with ALT: only the letters and digits may be so honoured.
And, finally, ALT ignores the case of letters: ALT-A is the same code
as ALT-a. 

One could of course read from the keyboard, rather than using the
brain-damaged BIOS. I believe (though I'm not sure) that one gets
key-up and key-down codes, including from the shift, ctl, and alt
keys. However, IBM in particular has a habit of making keyboards which
are incompatible with last year's model, and hiding the differences in
the BIOS. 


Vincent Manis                    | manis@cs.ubc.ca
The Invisible City of Kitezh     | manis@cs.ubc.cdn
Department of Computer Science   | manis@ubc.csnet
University of British Columbia   | uunet!ubc-cs!manis
<<NOTE NEW ADDRESS>>             |      

rfm%urth@Sun.COM (Richard McAllister) (06/22/88)

In article <2146@sugar.UUCP>, Peter da Silva asks:
>Why don't any of the Micro emacses implement REAL meta keys? Both the IBM-PC
>and the Amiga have these nice ALT keys in a real convenient spot, just ready
>for use as a metakey. 

Good idea, but until that happens a keyboard macro program (like Superkey or
Prokey on PCs, there must be equivalents for Amigas) can remap alt-x to
ESC-x and give the same effect.  It even works when dialing into a host.
Rich McAllister (rfm@sun.com)