Another question to this jde-which-func.el code (see below).
My byte-compiler says:
Compiling file
d:/Programme/Tools/Editor/emacs-20-5/site-lisp/single-file-packages/jde-which-func.el
at Thu Aug 17 08:00:15 2000
** The following functions are not known to be defined:
disable-async-timeout, add-async-timeout
My Emacs (GNU NTEmacs 20.5.1) doesn�t know these function. Where to get it?
Klaus
P.S.
Sorry for sending two different mails for one problem!
> >;;; jde-which-func.el --- Print current function in mode line
> >
> >;; Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
> >
> >;; Author: Alex Rezinsky <[EMAIL PROTECTED]>
> >;; Adapted for JDE by Stephane Nicolas <[EMAIL PROTECTED]>
> >;; Keywords: mode-line, imenu, tools
> >
> >;; This file is part of GNU Emacs.
> >
> >;; GNU Emacs is free software; you can redistribute it and/or modify
> >;; it under the terms of the GNU General Public License as
> published by
> >;; the Free Software Foundation; either version 2, or (at
> your option)
> >;; any later version.
> >
> >;; GNU Emacs is distributed in the hope that it will be useful,
> >;; but WITHOUT ANY WARRANTY; without even the implied warranty of
> >;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> >;; GNU General Public License for more details.
> >
> >;; You should have received a copy of the GNU General Public License
> >;; along with GNU Emacs; see the file COPYING. If not, write to the
> >;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
> >;; Boston, MA 02111-1307, USA.
> >
> >;;; Commentary:
> >
> >;; This package prints name of function where your current point is
> >;; located in mode line. It assumes that you work with imenu package
> >;; and imenu--index-alist is up to date.
> >
> >;; KNOWN BUGS
> >;; ----------
> >;; Really this package shows not "function where the current point is
> >;; located now", but "nearest function which defined above
> the current
> >;; point". So if your current point is located after end of function
> >;; FOO but before begin of function BAR, FOO will be
> displayed in mode
> >;; line.
> >
> >;; TODO LIST
> >;; ---------
> >;; 1. Dependence on imenu package should be removed. Separate
> >;; function determination mechanism should be used to
> determine the end
> >;; of a function as well as the beginning of a function.
> >;; 2. This package should be realized with the help of overlay
> >;; properties instead of imenu--index-alist variable.
> >
> >;;; History:
> >
> >;; THANKS TO
> >;; ---------
> >;; Per Abrahamsen <[EMAIL PROTECTED]>
> >;; Some ideas (inserting in mode-line, using of
> post-command hook
> >;; and toggling this mode) have been borrowed from
> his package
> >;; column.el
> >;; Peter Eisenhauer <[EMAIL PROTECTED]>
> >;; Bug fixing in case nested indexes.
> >;; Terry Tateyama <[EMAIL PROTECTED]>
> >;; Suggestion to use find-file-hooks for first imenu
> >;; index building.
> >
> >;;; Code:
> >
> >;; Variables for customization
> >;; ---------------------------
> >;;
> >(defvar jde-which-func-unknown "???"
> > "String to display in the mode line when current function
> is unknown.")
> >
> >(defgroup jde-which-func nil
> > "Mode to display the current function name in the modeline."
> > :group 'tools
> > :version "20.3")
> >
> >(defcustom jde-which-func-modes
> > '(emacs-lisp-mode c-mode c++-mode perl-mode makefile-mode sh-mode
> > fortran-mode jde-mode)
> > "List of major modes for which Which Function mode should be used.
> >For other modes it is disabled. If this is equal to t,
> >then Which Function mode is enabled in any major mode that
> supports it."
> > :group 'jde-which-func
> > :type '(choice (const :tag "All modes" t)
> > (repeat (symbol :tag "Major mode"))))
> >
> >(defcustom jde-which-func-non-auto-modes nil
> > "List of major modes where Which Function mode is inactive
> till Imenu is
> used.
> >This means that Which Function mode won't really do anything
> >until you use Imenu, in these modes. Note that files
> >larger than `jde-which-func-maxout' behave in this way too;
> >Which Function mode doesn't do anything until you use Imenu."
> > :group 'jde-which-func
> > :type '(repeat (symbol :tag "Major mode")))
> >
> >(defcustom jde-which-func-maxout 100000
> > "Don't automatically compute the Imenu menu if buffer is
> this big or
> bigger.
> >Zero means compute the Imenu menu regardless of size."
> > :group 'jde-which-func
> > :type 'integer)
> >
> >(defcustom jde-which-func-format '(" [" jde-which-func-current "]")
> > "Format for displaying the function in the mode line."
> > :group 'jde-which-func
> > :type 'sexp)
> >
> >;;;###autoload
> >(defcustom jde-which-func-mode-global nil
> > "*Toggle `jde-which-func-mode' globally.
> >Setting this variable directly does not take effect;
> >use either \\[customize] or the function `jde-which-func-mode'."
> > :set #'(lambda (symbol value)
> > (jde-which-func-mode (if value 1 0)))
> > :initialize 'custom-initialize-default
> > :type 'boolean
> > :group 'jde-which-func
> > :require 'jde-which-func)
> >
> >;;;###autoload
> >(defcustom jde-which-func-time-out 2
> > "Timeout during which `jde-which-func-current' is
> displayed in mode-line."
> > :type 'integer
> > :group 'jde-which-func
> > :require 'jde-which-func)
> >
> >;;; Code, nothing to customize below here
> >;;; -------------------------------------
> >;;;
> >(require 'imenu)
> >
> >(defvar jde-which-func-current jde-which-func-unknown)
> >(defvar jde-which-func-previous jde-which-func-unknown)
> >(make-variable-buffer-local 'jde-which-func-current)
> >(make-variable-buffer-local 'jde-which-func-previous)
> >
> >(defvar jde-which-func-old-mode-line-format nil)
> >(defvar jde-which-func-mode-timer nil)
> >
> >(defvar jde-which-func-mode nil
> > "Non-nil means display current function name in mode line.
> >This makes a difference only if `jde-which-func-mode-global'
> is non-nil")
> >(make-variable-buffer-local 'jde-which-func-mode)
> >(put 'jde-which-func-mode 'permanent-local t)
> >
> >(add-hook 'find-file-hooks 'jde-which-func-ff-hook t)
> >
> >(defun jde-which-func-ff-hook ()
> > "File find hook for Which Function mode.
> >It creates the Imenu index for the buffer, if necessary."
> > (if (or (eq jde-which-func-modes t) (member major-mode
> jde-which-func-modes))
> > (setq jde-which-func-mode jde-which-func-mode-global)
> > (setq jde-which-func-mode nil))
> >
> > (condition-case nil
> > (if (and jde-which-func-mode
> > (not (member major-mode jde-which-func-non-auto-modes))
> > (or (< buffer-saved-size jde-which-func-maxout)
> > (= jde-which-func-maxout 0)))
> > (setq imenu--index-alist
> > (save-excursion (funcall imenu-create-index-function))))
> > (error
> > (setq jde-which-func-mode nil))))
> >
> >(defun jde-which-func-restore-mode-line (arg)
> > (if jde-which-func-old-mode-line-format
> > (setq mode-line-format jde-which-func-old-mode-line-format))
> > (force-mode-line-update)
> >)
> >
> >(defun jde-which-func-update ()
> > ;; Update the string containing the current function.
> > (if jde-which-func-mode-timer
> > (disable-async-timeout jde-which-func-mode-timer))
> > (condition-case info
> > (progn
> > (if (not (setq jde-which-func-current (jde-which-function)))
> > (setq jde-which-func-current jde-which-func-unknown))
> > (if (not (string= jde-which-func-current
> jde-which-func-previous))
> > (progn
> > (setq mode-line-format 'jde-which-func-format)
> > (force-mode-line-update)
> > (setq jde-which-func-previous jde-which-func-current)))
> > (setq jde-which-func-mode-timer (add-async-timeout
> jde-which-func-time-out 'jde-which-func-restore-mode-line nil)))
> > (error
> > (debug)
> > (remove-hook 'post-command-hook 'jde-which-func-update)
> > (jde-which-func-mode -1) ; Function mode off
> > (message "Error in jde-which-func-update: %s" info))))
> >
> >;; This is the name people would normally expect.
> >;;;###autoload
> >(defalias 'jde-which-function-mode 'jde-which-func-mode)
> >
> >;;;###autoload
> >(defun jde-which-func-mode (&optional arg)
> > "Toggle Which Function mode, globally.
> >When Which Function mode is enabled, the current function name is
> >continuously displayed in the mode line, in certain major modes.
> >
> >With prefix arg, turn Which Function mode on iff arg is positive,
> >and off otherwise."
> > (interactive "P")
> > (if (or (and (null arg) jde-which-func-mode-global)
> > (<= (prefix-numeric-value arg) 0))
> > ;; Turn it off
> > (if jde-which-func-mode-global
> > (progn
> > (remove-hook 'post-command-hook 'jde-which-func-update)
> > (setq jde-which-func-mode-global nil)
> > (setq jde-which-func-mode nil)
> > (jde-which-func-restore-mode-line nil)
> > (force-mode-line-update)))
> > ;;Turn it on
> > (if jde-which-func-mode-global
> > ()
> > (setq jde-which-func-old-mode-line-format mode-line-format)
> > (add-hook 'post-command-hook 'jde-which-func-update)
> > (setq jde-which-func-mode-global t)
> > (setq jde-which-func-mode
> > (or (eq jde-which-func-modes t)
> > (member major-mode jde-which-func-modes))))))
> >
> >(defun jde-which-function-rec (o name min)
> > (cond
> > ((null o)
> > (list name min))
> > ((stringp o)
> > (list (concat name "." o ) min))
> > ((listp o)
> > (if (and (cdr o)
> > (number-or-marker-p (cdr o)))
> > (if (and (> (point) (cdr pair))
> > (or (null min) (< (- (point) (cdr o)) min)))
> > (list (car o) (- (point) (cdr o))))
> >
> > (progn
> > (let ((pair (car-safe o))
> > (rest (cdr-safe o))
> > (temp nil)
> > (class-name nil))
> >
> > (if (stringp pair)
> > (setq class-name pair))
> >
> > (while (or rest pair)
> > (setq temp (jde-which-function-rec pair name min))
> > (if (and
> > (number-or-marker-p (nth 1 temp))
> > (or (null min) (< (nth 1 temp) min)))
> > (progn
> > (setq name (nth 0 temp))
> > (setq min (nth 1 temp))
> > ))
> > (setq pair (car rest))
> > (setq rest (cdr rest)))
> >
> > (if class-name
> > (setq name (concat class-name " : " name)))
> >
> > (list name min)))))))
> >
> >(defun jde-which-function ()
> > "Return current function name based on point.
> >If `imenu--index-alist' does not exist, or is empty or if point
> >is located before first function, returns nil."
> > (and
> > (boundp 'imenu--index-alist)
> > imenu--index-alist
> > (car (jde-which-function-rec imenu--index-alist nil nil))))
> >
> >(provide 'jde-which-func)
> >
> >;; jde-which-func.el ends here
> >
> >