[comp.sources.bugs] 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.

kamath@reed.UUCP (Sean Kamath) (06/18/88)

In article <1618@iscuva.ISCS.COM> jimc@iscuva.ISCS.COM (Jim Cathey) writes:
>>[mention of ^N giving newlines, when could be better used.]
>
>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!

Have you folks ever heard of bind-to-key?  If you don't like ^N giving you
newlines at the end of the file, then bind it to something else!  I have
mine bound to next-line.  So type "ESC X bind-to-key end-of-file ^N" and be
done with it.  That's why Emacs is called Emacs -- editing macros.  You can
create your own macros, and bind those to keys, too.

>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.")

The meta-key is also bindable.  There is a variable called meta-key, which,
when on, allows the use of a real meta key.  But if you want, you can bind
'`' to meta, as a *lot* of macintosh users have done. . .


>! II      CCCCCC !  Jim Cathey


Sean Kamath
-- 
UUCP:  {decvax allegra ucbcad ucbvax hplabs ihnp4}!tektronix!reed!kamath
CSNET: reed!kamath@Tektronix.CSNET  ||  BITNET: reed!kamath@PSUVAX1.BITNET
ARPA:  reed!kamath@PSUVAX1.CS.PSU.EDU
US Snail: 3934 SE Boise, Portland, OR  97202-3126 (I hate 4 line .sigs!)