unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to set outline-level in the first line?
@ 2007-05-06 11:40 Heinz Tuechler
  2007-05-11  0:38 ` Heinz Tuechler
  0 siblings, 1 reply; 6+ messages in thread
From: Heinz Tuechler @ 2007-05-06 11:40 UTC (permalink / raw)
  To: help-gnu-emacs

Dear All,

To adapt outline-minor-mode to the comment form I use in R, I tried to
adjust the outline-regexp and the outline-level.

The outline-level should be:
(setq outline-level (defun outline-level ()
  "adjust outline-level to R-comments"	 
		      (interactive)
		      (cond ((looking-at "#\\{5\\} ") 1)
			    ((looking-at "#### ") 2)
			    ((looking-at "### ") 3)
			    ((looking-at "## ") 4)  
			    (t 1000))))

I tried to do this in the first line by something like 
outline-level: (defun outline-level () (interactive) (cond ((looking-at
"##### ") 1)((looking-at "#### ") 2)((looking-at "### ") 3)((looking-at "##
") 4)  (t 1000)))
but I did not find the right way.

Only if I use eval: (setq outline-level ... it does what I want.

So finally my first line looks as follows:
-*- mode: text; mode:outline-minor; outline-regexp:"#\\{2,5\\} "; eval:
(setq outline-level (defun outline-level () (interactive) (cond
((looking-at "##### ") 1)((looking-at "#### ") 2)((looking-at "### ")
3)((looking-at "## ") 4)  (t 1000)))) -*-

What I would like to know is, how to set the outline-level without "eval:"?

version information:
GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600) of 2004-03-10 on NYAUMO

Thanks,
Heinz

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-09 23:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.505.1178840842.32220.help-gnu-emacs@gnu.org>
2007-05-11  5:08 ` How to set outline-level in the first line? Stefan Monnier
2007-05-11  9:18   ` Heinz Tuechler
2007-05-20 13:07   ` Johan Bockgård
2007-06-09 23:58     ` Stefan Monnier
2007-05-06 11:40 Heinz Tuechler
2007-05-11  0:38 ` Heinz Tuechler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).