From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.devel Subject: Re: terminal escapes in Info files? Date: Wed, 29 Oct 2003 13:20:25 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200310281746.h9SHk2915693@f7.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1067430479 23875 80.91.224.253 (29 Oct 2003 12:27:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2003 12:27:59 +0000 (UTC) Cc: eliz@elta.co.il, dirt@gtk.org, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Oct 29 13:27:56 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AEpQa-0000H7-00 for ; Wed, 29 Oct 2003 13:27:56 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AEpQa-00080V-00 for ; Wed, 29 Oct 2003 13:27:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AEpNd-00028o-9O for emacs-devel@quimby.gnus.org; Wed, 29 Oct 2003 07:24:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AEpM0-000233-GD for emacs-devel@gnu.org; Wed, 29 Oct 2003 07:23:12 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AEpLS-0001ww-0e for emacs-devel@gnu.org; Wed, 29 Oct 2003 07:23:09 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.24) id 1AEpJv-0001jp-54 for emacs-devel@gnu.org; Wed, 29 Oct 2003 07:21:03 -0500 Original-Received: (qmail 6484 invoked by uid 65534); 29 Oct 2003 12:21:00 -0000 Original-Received: from dialin-145-254-193-001.arcor-ip.net (EHLO HERMES) (145.254.193.1) by mail.gmx.net (mp023) with SMTP; 29 Oct 2003 13:21:00 +0100 X-Authenticated: #1497658 Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "28 Oct 2003 13:08:37 -0500") X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6; Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17541 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17541 Stefan Monnier writes: >> Because, believe it or not, some people still use it, > > Of course I use it everyday. > >> there's a lot of history there, and just eradicating Info and replacing it >> with HTML would not go over well. > > But by switching to something like enriched-mode, we're heading straight > down that path and it isn't hard to see that sooner or later we'd want > more than enriched-mode and ... > > 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) ? [...] Just my 0.02 EUR: The HTML for C-h i would not need to be “real” HTML, just something which would look like HTML to a browser. What I mean is: It could be like the text/enriched format (whitespace being significant, so that you get a nice plain text when you just strip the markup), but with tags borrowed from HTML:

Defining Functions

We usually give a name to a function when it is first created. This is called "defining a function", and it is done with the `defun' special form.

- Special Form: defun name argument-list body-forms `defun' is the usual way to define new Lisp functions. It defines the symbol NAME as a function that looks like this:

     
          (lambda ARGUMENT-LIST . BODY-FORMS)
[...]
          (defun capitalize-backwards ()
            "Upcase the last letter of a word."
            (interactive)
            (backward-word 1)
            (forward-word 1)
            (backward-char 1)
            (capitalize-word 1))
[...] In that case it should be simple to use either format.el or `write-region-annotate-functions' to strip the markup and put faces or other text properties on the text. Proof of concept (works with the example above): (defconst info-translations '((face (Info-title-1-face "h1") (variable-pitch "p") (bold "b")) (nil (nil "code")) (nil (nil "pre")))) (defun info-next-annotation () (let ((found nil)) (while (and (not found) (search-forward "<" nil t)) (backward-char 1) (cond ((looking-at "") (setq found (list (match-beginning 0) (match-end 0) (match-string 1) nil))) ((looking-at "<\\([[:alnum:]]+\\)\\(?:.*?\\)>") (setq found (list (match-beginning 0) (match-end 0) (match-string 1) t))) ((looking-at "" nil t) (skip-chars-forward "\n") (delete-region beg (point))))) (t (forward-char 1)))) found)) (defun info-deannotate-region (beg end) (interactive "r") (format-deannotate-region beg end info-translations 'info-next-annotation)) Oliver -- Oliver Scholz 8 Brumaire an 212 de la Révolution Taunusstr. 25 Liberté, Egalité, Fraternité! 60329 Frankfurt a. M. http://www.jungdemokratenhessen.de Tel. (069) 97 40 99 42 http://www.jdjl.org