Support for compressed manpages when looking up documentation from Emacs

Tamas Patrovics tpatro@REDACTED
Thu Mar 3 09:22:32 CET 2005


On Debian the Erlang manpages are compressed and are put into a
separate "erl" section like this

    /usr/share/man/man3/snmp.3erl.gz

Here's a simple patch which modifies the regexps used for looking up
manpages, so that documentation lookup works with these kind of man
pages too.

I'm not a member of the list, so please CC me if you have a question.

regards,

Tamas

--- /usr/share/emacs/site-lisp/erlang/erlang.el 2004-11-25
05:48:48.000000000 +0100
+++ erlang.el   2005-03-03 09:07:44.000000000 +0100
@@ -2529,7 +2529,7 @@
 
 (defun erlang-man-get-files (dir)
   "Return files in directory DIR."
-  (directory-files dir t ".*\\.[0-9]\\'"))
+  (directory-files dir t ".*\\.[0-9]\\([a-z]+\\)?\\(\\.gz\\)?\\'"))
 
 
 (defun erlang-man-module (&optional module)
@@ -2549,7 +2549,7 @@
   (if (or (null module) (string= module ""))
       (error "No Erlang module name given"))
   (let ((dir-list erlang-man-dirs)
-       (pat (concat "\\b" (regexp-quote module) "\\.[^.]$"))
+       (pat (concat "\\b" (regexp-quote module)
"\\.[^.]\\([a-z]+\\)?\\(\\.gz\\)?$"))
        (file nil)
        file-list)
     (while (and dir-list (null file))
@@ -2690,7 +2690,7 @@
     (error nil))
   (if file
       (let ((process-environment (copy-sequence process-environment)))
-       (if (string-match "\\(.*\\)/man[^/]*/\\([^/]+\\)\\.[^.]$" file)
+       (if (string-match
"\\(.*\\)/man[^/]*/\\([^.]+\\)\\.[^.]\\([a-z]+\\)?\\(\\.gz\\)?$" file)
            (let ((dir (substring file (match-beginning 1) (match-end 1)))
                  (page (substring file (match-beginning 2) (match-end 2))))
              (if (fboundp 'setenv)



More information about the erlang-patches mailing list