unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: terminal escapes in Info files?
@ 2003-10-28 17:46 Karl Berry
  2003-10-28 18:08 ` Stefan Monnier
  0 siblings, 1 reply; 69+ messages in thread
From: Karl Berry @ 2003-10-28 17:46 UTC (permalink / raw)
  Cc: eliz, emacs-devel, rms, dirt

    Sorry, I thought the question was how to improve the `info' program
    and the `M-x info' command.

Yes, sure.  What are you saying?

If you're proposing that, say, info become an alias for lynx and
M-x info become an alias for w3-whatever, well, fine, but that doesn't
really address the issue.

    Why do people want to improve the Info format, exactly?

Because, believe it or not, some people still use it, there's a lot of
history there, and just eradicating Info and replacing it with HTML
would not go over well.

    Eliz>features such as index search that are not
    available in HTML

Well, since we're hypothetically talking about M-x info, I could imagine
it reading the HTML from a Texinfo document and knowing about the index, etc.

    yet doesn't support colors, bold/italics, and
    other text attributes that existing text-mode terminals can display.

<font color="red">
<b>
...
(Whether Emacs is capable of using any of that stuff on a text terminal,
I don't know.)

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: terminal escapes in Info files?
@ 2003-10-28 20:09 Karl Berry
  2003-10-29 12:52 ` Oliver Scholz
  2003-10-29 19:02 ` Richard Stallman
  0 siblings, 2 replies; 69+ messages in thread
From: Karl Berry @ 2003-10-28 20:09 UTC (permalink / raw)
  Cc: eliz, emacs-devel, dirt

rms: I am actually coming to believe that using the raw terminal escape
sequences is as clean as anything else in this particular limited
context.  We specifically want to support what terminals can support.
Aren't the ANSI escape sequences as reasonable a way of specifying that
as anything?

I don't see any particular advantage to writing ^H^[bold^H^] (or <bold>
or whatever) instead of ^[[3m, and the implementation in both info and
M-x info gets much more complex if we introduce a layer of indirection,
which all it really amounts to.

This discussion is telling me that we may want a better output format in
general than Info, but any significant/large extensions are hard to mark
and turn Info into something other than what it was designed to be:
output on a terminal.  So, as far as improving Info itself goes in the
short term, this seems as good as anything.

What do you think?

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: terminal escapes in Info files?
@ 2003-10-28 20:06 Karl Berry
  2003-10-28 21:23 ` Stefan Monnier
  2003-10-28 23:41 ` Miles Bader
  0 siblings, 2 replies; 69+ messages in thread
From: Karl Berry @ 2003-10-28 20:06 UTC (permalink / raw)
  Cc: eliz, emacs-devel, rms, dirt

    But by switching to something like enriched-mode, 

After a bit thought, I think we can't "switch" to enriched mode,
exactly, because of the compatibility problem.  We could write enriched
text as a new output format, and maybe in five years or so make it the
default.

    I guess the question is: how much work would it require to take
    the subset of HTML generated by makeinfo and render it (both
    in M-x info and in the info program) ?

As for the info program goes, it would be tantamount to writing a new
program.  I guess some of the screen display stuff could be reused.  But
in any case, I definitely wouldn't bother doing this.  Instead, I'd just
tell people to use lynx or emacs-w3 or whatever.  I've never really seen
the point of standalone info in the first place, as I've mentioned before.
But some people like it, so fine.

Also, makeinfo's html output is very very far from ideal.  (texi2html
does a better job, sadly.)  So it wouldn't be a good design to implement
only the html being output now.  I suspect it would end up needing to be
close to a full-fledged html interpreter, for the same reasons that you
surmise enriched text would eventually not be enough.

    why enhance the Info format rather than change the readers (to use
    the HTML output of makeinfo rather than the Info output) ?

1) Because that is a huge change with many ramifications.
2) Because anyone who wants to can already do that.  If you or anyone
   want to write or improve HTML readers for makeinfo's html output, great. 
   That can be done independently of changing existing Info files.
3) [the main point] Because Info is terminal-based.  Therefore, it makes
   sense to add capabilities to Info format which can be expressed on
   terminals -- namely, standard terminal escape sequences.  This is
   where we came in.

Inventing an entirely new output format, or using html as you suggest,
may well be a worthwhile goal, but it is very long term and will take a
lot of effort.

By contrast, getting the principal two existing Info readers to
understand ANSI escape sequences is very little work by comparison, has
no compatibility issues, and could immediately improve the info-browsing
experience.

One more msg coming up ...

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: terminal escapes in Info files?
@ 2003-10-28 20:06 Karl Berry
  0 siblings, 0 replies; 69+ messages in thread
From: Karl Berry @ 2003-10-28 20:06 UTC (permalink / raw)
  Cc: eliz, emacs-devel, dirt

    >From what I can tell they include indices just fine, 

Eli is talking about the i command (which a lot of people like).  You
can't type i into a general html browser and expect to get completion on
index entries.

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: terminal escapes in Info files?
@ 2003-10-28 16:51 Karl Berry
  2003-10-28 16:59 ` Stefan Monnier
  0 siblings, 1 reply; 69+ messages in thread
From: Karl Berry @ 2003-10-28 16:51 UTC (permalink / raw)
  Cc: eliz, emacs-devel, rms, dirt

    Why not HTML ?  There's already an HTML backend in makeinfo, so no
    change is needed there.  

HTML is possible, but people who want that can already use it, right?
The question is how or whether to improve Info format.

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: terminal escapes in Info files?
@ 2003-10-28 16:50 Karl Berry
  0 siblings, 0 replies; 69+ messages in thread
From: Karl Berry @ 2003-10-28 16:50 UTC (permalink / raw)
  Cc: eliz, emacs-devel, rms, dirt

    Of course, a direction I'd even prefer is some way to make it possible to
    use the TeXinfo file(s) directly

The problem with this approach is that then Emacs has to know about
every change to the Texinfo source language.  That does not seem like a
good idea.  New commands could not be added to Texinfo without impacting
Info readers, in that case.  rms intentionally designed Texinfo so that
this would not happen.

In the present situation, info readers generally don't have to know or
care what the source commands are and when they change.  I've added
probably 20+ commands without impacting any reader and without any
compatibility issues.  (Occasionally there are commands that do have
compatibility issues, such as @anchor and the new @image support, but
these have been the exception.)

If I'm missing something here, please let me know ...

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: terminal escapes in Info files?
@ 2003-10-28  1:26 Karl Berry
  2003-10-28 10:51 ` Alper Ersoy
  2003-10-29 19:02 ` Richard Stallman
  0 siblings, 2 replies; 69+ messages in thread
From: Karl Berry @ 2003-10-28  1:26 UTC (permalink / raw)
  Cc: emacs-devel, rms, dirt

    > if we want to add font markup to info fmt, let's not use something as
    > ugly as terminal escape squences.  please design something clean!

Since Info is inherently limited to what can be displayed on a terminal,
it seems like ANSI escape sequences are as reasonable specification of
the capabilities as anything else?  Easy to implement, too.  Admittedly
the ESC [ blah blah sequences are ugly, though.

    How about using what Enriched-Text mode uses in Emacs?  See
    etc/enriched.doc in the Emacs distro.

That is indeed a lot cleaner (also quite a bit more verbose :).  Thanks
for mentioning it, I wasn't aware of it.

It seems using this would imply a new non-backward-compatible output
format, though, since every literal < needs to be escaped in enriched
format, and existing info readers don't know how to do that.

Using the ugly terminal escape sequences, on the other hand, is
backward-compatible because I'm sure that no real document has literal
terminal escape sequences (Texinfo hasn't had @ctrl for years ...).

Hmm.  As always, it seems there is no easy answer.

Thanks,
k

^ permalink raw reply	[flat|nested] 69+ messages in thread
* terminal escapes in Info files?
@ 2003-10-26 12:20 Karl Berry
  2003-10-26 12:40 ` Simon Josefsson
  2003-10-27  7:02 ` Richard Stallman
  0 siblings, 2 replies; 69+ messages in thread
From: Karl Berry @ 2003-10-26 12:20 UTC (permalink / raw)
  Cc: dirt

Dear Emacs developers,

Alper Ersoy (GTK developer, cc'd here) suggested to me that we enhance
Info format by allowing terminal escapes.  For example, @strong{this is
bold} in the Texinfo source could then end up getting displayed in
standout mode.

I can imagine two ways to implement this:
1) write ANSI terminal escape codes directly in the Info file.  (Even on
non-ANSI terminals, if there are any left, these could be translated to
appropriate termcap sequence.)

2) use the mechanism we created for @image to write a generic command in
the Info file, something like
      ^H^[display bold^H^]this is bold^H^[end display^H^]

In either case, the escapes would only be enabled with an option to
makeinfo for now, to provide for a phase-in period.

So here are my questions:
- what do you-all think of the idea in general?

- is one of (1) or (2) significantly easier to implement in Emacs?
  (2) is already implemented in standalone Info, via the --raw-escapes
  option, but this is not a determining factor in my mind.
  
  I know that Emacs's terminal-mode will interpret terminal escapes, but
  I don't know how easily that (or any other such support) can be
  integrated into info read.

- would anyone like to volunteer to implement this for Emacs :)?
  Neither Alper nor I can do it.  We can handle the makeinfo/standalone
  info changes, of course.

Thanks,
karl


P.S. Here are some references, FWIW:

- A list of escapes:
  http://www.isthe.com/chongo/tech/comp/ansi_escapes.html

- Documentation on using escapes in bash prompts:
  http://www.linux.org/docs/ldp/howto/Bash-Prompt-HOWTO/c341.html

- ANSI support in various terminals:
  http://search.cpan.org/~rra/ANSIColor-1.07/ANSIColor.pm#NOTES

^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2003-11-03 12:19 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-28 17:46 terminal escapes in Info files? Karl Berry
2003-10-28 18:08 ` Stefan Monnier
2003-10-29 12:20   ` Oliver Scholz
2003-10-29 14:21     ` Eli Zaretskii
2003-10-29 16:24       ` Oliver Scholz
2003-10-29 17:29         ` Robert J. Chassell
2003-10-29 18:09           ` Stefan Monnier
2003-10-30  1:13             ` Robert J. Chassell
2003-10-30  6:10               ` Stephen J. Turnbull
2003-10-30 22:06                 ` Robert J. Chassell
2003-11-03 12:19                   ` Stephen J. Turnbull
2003-10-30 16:36               ` Stefan Monnier
2003-10-29 18:40           ` Oliver Scholz
2003-10-29 19:09             ` Oliver Scholz
2003-10-29 20:02               ` Luc Teirlinck
2003-10-29 20:47                 ` Oliver Scholz
2003-10-29 22:58                   ` Luc Teirlinck
2003-10-30  2:37                   ` Robert J. Chassell
2003-10-30  2:55                   ` Robert J. Chassell
2003-10-29 17:45         ` Eli Zaretskii
2003-10-29 18:00         ` Reiner Steib
2003-10-29 18:43           ` Oliver Scholz
2003-10-30  4:19     ` Richard Stallman
2003-10-30  6:11       ` Eli Zaretskii
2003-10-31  0:07         ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2003-10-28 20:09 Karl Berry
2003-10-29 12:52 ` Oliver Scholz
2003-10-29 14:14   ` Eli Zaretskii
2003-10-29 14:31     ` Andreas Schwab
2003-10-29 17:51       ` Alper Ersoy
2003-10-29 18:53         ` Alper Ersoy
2003-10-29 18:11       ` Eli Zaretskii
2003-10-29 21:08         ` Andreas Schwab
2003-10-29 21:18           ` Alper Ersoy
2003-10-29 21:40           ` Eli Zaretskii
2003-10-29 15:28     ` Oliver Scholz
2003-10-31  2:29     ` Thien-Thi Nguyen
2003-10-29 19:02 ` Richard Stallman
2003-10-28 20:06 Karl Berry
2003-10-28 21:23 ` Stefan Monnier
2003-10-28 23:41 ` Miles Bader
2003-10-28 20:06 Karl Berry
2003-10-28 16:51 Karl Berry
2003-10-28 16:59 ` Stefan Monnier
2003-10-28 17:16   ` Eli Zaretskii
2003-10-28 17:56     ` Stefan Monnier
2003-10-28 20:34       ` Eli Zaretskii
2003-10-28 16:50 Karl Berry
2003-10-28  1:26 Karl Berry
2003-10-28 10:51 ` Alper Ersoy
2003-10-28 13:48   ` Oliver Scholz
2003-10-30 10:42     ` Alper Ersoy
2003-10-28 16:19   ` Stefan Monnier
2003-10-29 19:02     ` Richard Stallman
2003-10-29 19:47       ` David Kastrup
2003-10-29 21:43         ` Eli Zaretskii
2003-10-29 22:39           ` David Kastrup
2003-10-30  6:03             ` Eli Zaretskii
2003-10-30 18:00         ` Richard Stallman
2003-10-29 19:01   ` Richard Stallman
2003-10-29 19:45     ` Alper Ersoy
2003-10-29 19:42       ` Eli Zaretskii
2003-10-30 18:00       ` Richard Stallman
2003-10-29 19:02 ` Richard Stallman
2003-10-26 12:20 Karl Berry
2003-10-26 12:40 ` Simon Josefsson
2003-10-26 15:40   ` Alex Schroeder
2003-10-27  7:02 ` Richard Stallman
2003-10-27 19:29   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).