Package: erlang / 1:21.2.6+dfsg-1

emacs.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Patch by Balint Reczey <balint@balintreczey.hu> fixes backquote
syntax (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494823).
Also, it fixes manpage name regexp matching only 3erl manpages in
section 3.

--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -511,8 +511,8 @@
 (defvar erlang-man-dirs
   '(("Man - Commands" "/man/man1" t)
     ("Man - Modules" "/man/man3" t)
-    ("Man - Files" "/man/man4" t)
-    ("Man - Applications" "/man/man6" t))
+    ("Man - Files" "/man/man5" t)
+    ("Man - Applications" "/man/man7" t))
   "The man directories displayed in the Erlang menu.
 
 Each item in the list should be a list with three elements, the first
@@ -1970,7 +1970,7 @@
 
 (defun erlang-man-make-menu-item (file)
   "Create a menu item containing the name of the man page."
-  (and (string-match ".+/\\([^/]+\\)\\.\\([124-9]\\|3\\(erl\\)?\\)\\(\\.gz\\)?$" file)
+  (and (string-match ".+/\\([^/]+\\)\\.\\([124-9]\\|3\\(erl\\)\\)\\(\\.gz\\)?$" file)
        (let ((page (substring file (match-beginning 1) (match-end 1))))
          (list (capitalize page)
                (list 'lambda '()
@@ -1981,7 +1981,7 @@
 
 (defun erlang-man-get-files (dir)
   "Return files in directory DIR."
-  (directory-files dir t ".+\\.\\([124-9]\\|3\\(erl\\)?\\)\\(\\.gz\\)?\\'"))
+  (directory-files dir t ".+\\.\\([124-9]\\|3\\(erl\\)\\)\\(\\.gz\\)?\\'"))
 
 
 (defun erlang-man-module (&optional module)
@@ -2003,7 +2003,7 @@
     (error "No Erlang module name given"))
   (let ((dir-list erlang-man-dirs)
         (pat (concat "/" (regexp-quote module)
-                     "\\.\\([124-9]\\|3\\(erl\\)?\\)\\(\\.gz\\)?$"))
+                     "\\.\\(3\\(erl\\)\\)\\(\\.gz\\)?$"))
         (file nil)
         file-list)
     (while (and dir-list (null file))
@@ -2130,7 +2130,7 @@
                 (message "Could not find function `%s'" func)))))))
 
 (defvar erlang-man-file-regexp
-  "\\(.*\\)/man[^/]*/\\([^.]+\\)\\.\\([124-9]\\|3\\(erl\\)?\\)\\(\\.gz\\)?$")
+  "\\(.*\\)/man[^/]*/\\([^.]+\\)\\.\\([124-9]\\|3\\(erl\\)\\)\\(\\.gz\\)?$")
 
 (defun erlang-man-display (file)
   "Display FILE as a `man' file.
@@ -2142,7 +2142,7 @@
       (let ((process-environment (copy-sequence process-environment)))
         (if (string-match erlang-man-file-regexp file)
             (let ((dir (substring file (match-beginning 1) (match-end 1)))
-                  (page (substring file (match-beginning 2) (match-end 2))))
+                  (page (concat (substring file (match-beginning 2) (match-end 2)) "(" (substring file (match-beginning 3) (match-end 3)) ")")))
               (setenv "MANPATH" dir)
               (manual-entry page))
           (error "Can't find man page for %s\n" file)))))