Version française
Home     About     Download     Resources     Contact us    
Browse thread
Browsing docs & caml.el.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierpaolo Bernardi <bernardp@c...>
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