[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Q on byte-compiling and define-derived-mode
From: |
Drew Adams |
Subject: |
RE: Q on byte-compiling and define-derived-mode |
Date: |
Sat, 3 Jun 2006 08:49:29 -0700 |
I have a file that starts with (define-derived-mode
foo-mode...). Later in the file
Please send a precise test case.
Right. I've determined the cause: if the define-derived-mode is not at top
level, then the warning occurs. I guess this is normal after all, as its
execution depends on other code.
Anyway, here's the test case:
(defvar foo-mode-map nil "Keymap for `foo-mode'.")
(unless foo-mode-map
(let ((map (make-sparse-keymap "Foo")))
(define-key map "?" 'fooey)
(setq foo-mode-map map)))
(when t
(define-derived-mode foo-mode nil "Foo"
"Major mode for Fooness"
(setq mode-line-format nil)
(set (make-local-variable 'auto-hscroll-mode) nil)
(set (make-local-variable 'auto-window-vscroll) nil)
(set (make-local-variable 'transient-mark-mode) nil)
(setq cursor-in-non-selected-windows t)
(blink-cursor-mode 1)))
(defun foo ()
"Pure foo"
(interactive)
(foo-mode))
------------------
Compiling file throw-1.el at Sat Jun 03 08:44:50 2006
In end of data:
throw-1.el:23:1:Warning: the function `foo-mode' is not known to be defined.