emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange behavior of emacs-lisp-mode with outline-minor-mode


From: Zhang Wei
Subject: Strange behavior of emacs-lisp-mode with outline-minor-mode
Date: Wed, 01 Mar 2006 01:08:40 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

If we turn on outline-minor-mode in emacs-lisp-mode, and press
`C-c @ C-q', only three dots there, nothing left!

Accoding to the doc of `C-c @ C-q' runs the command
`hide-sublevels', it should hide everything but the top levels
levels of headers, in whole buffer.

The value of outline-regexp of emacs-lisp-mode is 

";;;\\(;* [^    \n]\\|###autoload\\)\\|("

That means every line start with a "(" or ";;; x" will be
considered as top level headers. When we run `hide-sublevels',
these lines shouled be left.

This bug could be fixed by the following patch:

--8<---------------cut here---------------start------------->8---
--- orig/lisp/emacs-lisp/lisp-mode.el
+++ mod/lisp/emacs-lisp/lisp-mode.el
@@ -251,9 +251,11 @@
 (defun lisp-outline-level ()
   "Lisp mode `outline-level' function."
   (let ((len (- (match-end 0) (match-beginning 0))))
-    (if (looking-at "(\\|;;;###autoload")
+    (if (looking-at ";;;###autoload")
        1000
-      len)))
+      (if (looking-at "(") 
+         1
+       (- len 4)))))
 
 (defvar lisp-mode-shared-map
   (let ((map (make-sparse-keymap)))
--8<---------------cut here---------------end--------------->8---




reply via email to

[Prev in Thread] Current Thread [Next in Thread]