Browsing docs & caml.el.

From: Pierpaolo Bernardi (bernardp@cli.di.unipi.it)
Date: Mon Mar 08 1999 - 17:44:16 MET


Date: Mon, 8 Mar 1999 17:44:16 +0100 (MET)
Message-Id: <199903081644.RAA08386@carlotta.cli.di.unipi.it>
From: Pierpaolo Bernardi <bernardp@cli.di.unipi.it>
To: caml-list@inria.fr
Subject: Browsing docs & caml.el.

The elisp function ocaml-refman-fontificato below is what I used to
use to browse ocaml docs. In my experience, this is order of
magnitude faster than using a web browser with the html docs.

This code uses the function Man-fontify-manpage which is not
documented. It works in GNU Emacs 19.34.

(if (string-match "XEmacs" emacs-version)

    (defun sposta-il-cursore-fuori ()
      (interactive)
      (set-mouse-pixel-position (frame-root-window)
                                30 ;(- (frame-pixel-width) 50)
                                -45))

    (defun sposta-il-cursore-fuori ()
      (interactive)
      (set-mouse-position (window-frame (frame-selected-window))
                          (1+ (frame-width))
                          0))
    )

(defun find-file-read-only-other-frame-fontificato (filename)
  (interactive "fFile to view: ")
  (require 'man)
  (find-file-read-only-other-frame filename)
  (toggle-read-only)
  (Man-fontify-manpage)
  (not-modified)
  (toggle-read-only))

(defun ocaml-refman-fontificato ()
  (interactive)
  (find-file-read-only-other-frame-fontificato
   "/usr/local/lib/ocaml/Doc/ocaml-refman.prn")
  (sposta-il-cursore-fuori))

================================================================

Also, there's a little bug in caml.el. Patch follows.

*** caml.el.~1~ Sat Mar 6 01:04:05 1999
--- caml.el Sat Mar 6 01:09:26 1999
***************
*** 619,625 ****
  ;; This function switches to monobyte mode
  
  (if (not (fboundp 'char-bytes))
! (defalias forward-byte forward-char)
    (defun caml-char-bytes (ch)
      (let ((l (char-bytes ch)))
        (if (> l 1) (- l 1) l)))
--- 619,625 ----
  ;; This function switches to monobyte mode
  
  (if (not (fboundp 'char-bytes))
! (defalias 'forward-byte 'forward-char)
    (defun caml-char-bytes (ch)
      (let ((l (char-bytes ch)))
        (if (> l 1) (- l 1) l)))

================================================================

Best regards,
Pierpaolo Bernardp



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:20 MET