[comp.emacs] Need help with emacs screen management!

DAVIS@ohstpy.mps.ohio-state.edu (John E. Davis ) (01/01/90)

  After quickly coming to the realization that vi is really just
a full screen line editor I switched to emacs. I am happy with emacs
for the most part but a few things do irritate me. Perhaps these problems
are easily overcome with the proper statements in the .emacs file. They 
are:

     1. I have a pc at home with procomm emulating a vt100 at 1200 baud.
        At this baud rate I hate the way the screen updates are handled.
        On our Vax 8650 the EVE (TPU) editor does a MUCH better job than emacs.
        This is probably because the EVE editor sends the appropriate
        control codes to the vt100. Is there a way to get emacs to send
        codes for better scrolling, etc?
        
     2. I read in the emacs documentation that the mark commands are usually
        used in the wrong manner by amatures like me. How should they be used.
        Can I have several places marked at once? I can do this with EVE. 

     3. When I mark a region for pasting/cutting etc. I like it to be
        highlighted. How can I do this in emacs?
        
     4. At 1200 baud the isearch feature is rediculous. search is a better
        alternative. How can I repeat the search without keying in the
        whole string again?
        
I know that most of my complaints stem from the advantage/disadvantage of
the device independent nature of emacs. Is there an alternative to vi that
uses ANSI/VT100 escape sequences for unix/sun3/sun4 systems?

Thanks in advance,
John E. Davis

tale@cs.rpi.edu (David C Lawrence) (01/02/90)

Please, when posting to comp.emacs, mention what Emacs you are using.
Based on the content of the cited article I will be answering from the
GNU vantage.

In article <7094@ohstpy.mps.ohio-state.edu> DAVIS@ohstpy.mps.ohio-state.edu
(John E. Davis ) writes:
> 1. I have a pc at home with procomm emulating a vt100 at 1200 baud.
> At this baud rate I hate the way the screen updates are handled.  On
> our Vax 8650 the EVE (TPU) editor does a MUCH better job than emacs.
> This is probably because the EVE editor sends the appropriate
> control codes to the vt100. Is there a way to get emacs to send
> codes for better scrolling, etc?

Much of GNU Emacs' display management is based on the baud rate, or
what it believes that speed to be.  Normally it is very efficient
about screen updates but it can make the wrong decisions when working
with inaccurate understanding of the terminal's capabilities or with
an unrealistic baud value.  Both of these pieces of information come
from within the system.  The termcap library provides the needed
information about the terminal type in Unix systems; I don't know
where the information might be found on your system.

As far as baud is concerned, it is quite possible that Emacs is
chosing to redraw the entire display rather than go through costly
calculations to find the most efficient manner of getting the same
results.  I am currently on a 2400 baud line to one system, from which
I have connected to turing.  That connexion is over a local network;
stty reports that my baud rate is 38400.  This is the value that is
picked up by Emacs.  Once again, I don't know how you can change it on
your system if this is indeed one of the sources of your problem.

> 2. I read in the emacs documentation that the mark commands are
> usually used in the wrong manner by amatures like me.  How should
> they be used.  Can I have several places marked at once? I can do
> this with EVE.

Use the register commands, typically bound in the C-x map to r, x, g,
/ and j.  Apropos on "register" for different functions you could
examine.  They don't work precisely like marks do, but having multiple
markers in a buffer slows Emacs down because they need to be updated
with every change in the buffer.

I really don't know much about the regular GNU Emacs manual, but I
suspect that the comment you read was directed at Emacs Lisp
programmers who are inclined to make the user's mark for their own
purposes. 

> 3. When I mark a region for pasting/cutting etc. I like it to be
> highlighted. How can I do this in emacs?

You can't with vanilla GNU Emacs.  Such functionality will be
available in the future but for now you either need to do without it
or get hold of some patches recently sent out that will do it for GNU
since version 18.5(2?).  Current GNU version is 18.55.  I can't
provide any more information about these patches, but surely someone
here can give you a pointer to them.

> 4. At 1200 baud the isearch feature is rediculous. search is a
> better alternative. How can I repeat the search without keying in
> the whole string again?

First check out search-slow-speed.  It might make you like isearch a
whole lot more.  Some versions of Emacs allow the previous search to
be repeated by offering a zero length string as the pattern to search-
forward.  I don't think this is offered in GNU Emacs, though (default
configuration) hitting C-s after starting isearch will fill in the
text of the last isearch that exited normally.

Dave
-- 
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

jr@bbn.com (John Robinson) (01/03/90)

In article <TVG?~|@rpi.edu>, tale@cs (David C Lawrence) writes:
>Please, when posting to comp.emacs, mention what Emacs you are using.
>Based on the content of the cited article I will be answering from the
>GNU vantage.

Hear hear!  Same comment even if you are sending to info-gnu-emacs, or
unix-emacs.

>Much of GNU Emacs' display management is based on the baud rate, or
>what it believes that speed to be.  Normally it is very efficient
>about screen updates but it can make the wrong decisions when working
>with inaccurate understanding of the terminal's capabilities or with
>an unrealistic baud value.

I noticed an improvement (at least for my home Concept AVT) in the
screen management when moving from 18.53 to 18.55.  If the original
poster (John E. Davis) was using an older version, upgrading might
help.

>As far as baud is concerned, ... I don't know how you can change it on
>your system if this is indeed one of the sources of your problem.

For unix systems, the usual way is with the stty command.  E.g. `stty
1200'.  This can be fatal if you are coming over a hard-wired port and
can't change you terminal to the new speed, but when there is a
network protocol of some sort in between, the baud rate is meaningless
as far as the wiring is concerned, but it does have meaning to emacs
as David said; hence changing it won't hurt and then emacs will know
the right speed.

>Use the register commands, typically bound in the C-x map to r, x, g,
>/ and j.  Apropos on "register" for different functions you could
>examine.  They don't work precisely like marks do, but having multiple
>markers in a buffer slows Emacs down because they need to be updated
>with every change in the buffer.

In GNU Emacs, marks are saved on a ring (stack with limited depth that
wraps back around).  You can go back to earlier ones with a prefix
argument to the set-mark command, i.e. (with standard bindings) ^U^@.

>I really don't know much about the regular GNU Emacs manual, but I
>suspect that the comment you read was directed at Emacs Lisp
>programmers who are inclined to make the user's mark for their own
>purposes. 

The comment is in the function documentation for "set-mark-command",
the binding of ^@.  It points to the documentation of "set-mark", q.v.
(that is, type ^H f set-mark RET).  The marks are supposed to be for
the user; emacs lisp code you write should use variables to remember
positions in a buffer.

>	   I don't think this is offered in GNU Emacs, though (default
>configuration) hitting C-s after starting isearch will fill in the
>text of the last isearch that exited normally.

In other words, you can think of "repeat-previous-successful-isearch"
as being bound to ^S^S.  Similar remark for ^R^R.
--
/jr, nee John Robinson     Life did not take over the globe by combat,
jr@bbn.com or bbn!jr          but by networking -- Lynn Margulis

charles@hpcvca.CV.HP.COM (Charles Brown) (01/03/90)

>> 4. At 1200 baud the isearch feature is rediculous. search is a
>> better alternative. How can I repeat the search without keying in
>> the whole string again?

> First check out search-slow-speed.  It might make you like isearch a
> whole lot more.  Some versions of Emacs allow the previous search to
> be repeated by offering a zero length string as the pattern to search-
> forward.  I don't think this is offered in GNU Emacs, though (default
> configuration) hitting C-s after starting isearch will fill in the
> text of the last isearch that exited normally.

> Dave

I got frustrated enough with this to do something about it.  I will
post search.el, a set of routines which provide full editing of the
non-incremental search string.
--
	Charles Brown	charles@cv.hp.com or charles%hpcvca@hplabs.hp.com
			or hplabs!hpcvca!charles or "Hey you!"
	Not representing my employer.
	"The guy sure looks like plant food to me." Little Shop of Horrors