The Lumber Room

"Consign them to dust and damp by way of preserving them"

Symbol’s function definition is void: outline-font-lock-level

with one comment

Using Emacs and todoo-mode (the todoo library / todoo.el).
I got the message

Symbol’s function definition is void: outline-font-lock-level

whenever I tried to insert a new sub-item (using C-c M-i which is bound to todoo-insert-sub-item) in my TODO file. Searching Google gave someone’s old diary, from which (although it’s in Japanese ;-)) I found that it’s related to Debian bug 244681: emacs-goodies-el: todoo.el doesn’t work at XEmacs21. I’m using GNU Emacs 22.0.92.1 and not XEmacs, though.

Update: Before you try the “fixes” below (and in the comment), try just downloading the latest version from Debian. It appears that this got reported as bug 447760, and got fixed.

Anyway, the fix (I haven’t learnt Emacs lisp, so this may be far from the “best” way to do it):

  1. Open the todoo.el file (M-x find-library RET todoo RET) and find the todoo-insert-sub-item function. (Better, use C-h f todoo-insert-sub-item RET and follow the link.)
  2. Replace (outline-font-lock-level) with a value, like 3 or something. You might also want to do the same in the other place that (outline-font-lock-level) is used — in the function todoo-indent-line
  3. Another solution, if you don’t want to / can’t edit the file (no permissions, for example), might be to define the function (outline-font-lock-level) — put (defun outline-font-lock-level nil 3) somewhere.

    Another solution might be to redefine the function entirely. This requires knowledge that I don’t have, but, for example, making some local transformations, I replaced it with this:

    (defun todoo-insert-sub-item ()
      "Insert a new todoo-sub-item."
      (interactive)
      (goto-char (- (todoo-item-end) 1))
      (insert (concat (make-string todoo-indent-column ? )
                      todoo-sub-item-marker " \n"))
      (backward-char))

    The space after the ? is important.

Written by S

Sun, 2007-02-04 at 20:14:31

One Response

Subscribe to comments with RSS.

  1. ;; i believe this crude hack recovers the old behaviour of todoo-mode; YMMV.

    (defun outline-font-lock-level ()
    “Makeshift function supplying broken dependencies of `todoo.el’ in GNU Emacs 22.1.1.”
    (interactive)
    (let ((level (position (plist-get (text-properties-at (point)) ‘face) ‘(todoo-item-header-face todoo-sub-item-header-face todoo-item-assigned-header-face))))
    (cond (level (+ 2 level))
    (t
    (save-excursion
    (outline-previous-visible-heading 1)
    (unless (> (point) 1)
    (error “In outline prologue “))
    (outline-font-lock-level))))))

    emacs-dwim

    Thu, 2007-07-19 at 14:11:34


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s