summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 6b5c0b1c0f1..1a7da113c12 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -182,7 +182,7 @@
(make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments t)
(make-local-variable 'outline-regexp)
- (setq outline-regexp ";;;;* [^ \t\n]\\|(")
+ (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
(make-local-variable 'outline-level)
(setq outline-level 'lisp-outline-level)
(make-local-variable 'comment-start)
@@ -212,11 +212,10 @@
(defun lisp-outline-level ()
"Lisp mode `outline-level' function."
- (if (looking-at "(\\|;;;###autoload")
- 1000
- (looking-at outline-regexp)
- (- (match-end 0) (match-beginning 0))))
-
+ (let ((len (- (match-end 0) (match-beginning 0))))
+ (if (looking-at "(\\|;;;###autoload")
+ 1000
+ len)))
(defvar lisp-mode-shared-map
(let ((map (make-sparse-keymap)))