From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David PONCE Newsgroups: gmane.emacs.devel Subject: Minor fix to which-func-mode Date: Thu, 8 Jan 2004 09:09:15 +0100 (CET) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <26653837.1073549355046.JavaMail.www@wwinf0301> Reply-To: david.ponce@wanadoo.fr NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1073549586 4202 80.91.224.253 (8 Jan 2004 08:13:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2004 08:13:06 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jan 08 09:13:01 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeVHp-0002lZ-00 for ; Thu, 08 Jan 2004 09:13:01 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeVHp-0006Xe-00 for ; Thu, 08 Jan 2004 09:13:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeWEa-0003pk-4Z for emacs-devel@quimby.gnus.org; Thu, 08 Jan 2004 04:13:44 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AeWDO-0002nI-35 for emacs-devel@gnu.org; Thu, 08 Jan 2004 04:12:30 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AeWBi-0008T8-5Z for emacs-devel@gnu.org; Thu, 08 Jan 2004 04:11:19 -0500 Original-Received: from [193.252.22.28] (helo=mwinf0302.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeWBg-0008Ps-Uq for emacs-devel@gnu.org; Thu, 08 Jan 2004 04:10:45 -0500 Original-Received: from wwinf0301 (wwinf0301 [172.22.134.28]) by mwinf0302.wanadoo.fr (SMTP Server) with ESMTP id 0E091C000283 for ; Thu, 8 Jan 2004 09:09:15 +0100 (CET) Original-To: emacs-devel X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19092 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19092 Hi, I submit you the following patch that fixes: "cancel-timer: Invalid timer" errors when `which-func-mode' is disabled and you turn it off (from a program or via customization). Regards, David 2004-01-08 David Ponce * progmodes/which-func.el (which-function-mode): Don't cancel which-func-update-timer if not set. Index: which-func.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/progmodes/which-func.el,v retrieving revision 1.3 diff -c -r1.3 which-func.el *** which-func.el 30 Sep 2003 12:53:26 -0000 1.3 --- which-func.el 8 Jan 2004 08:01:06 -0000 *************** *** 198,204 **** (or (eq which-func-modes t) (member major-mode which-func-modes)))))) ;; Turn it off ! (cancel-timer which-func-update-timer) (setq which-func-update-timer nil) (dolist (buf (buffer-list)) (with-current-buffer buf (setq which-func-mode nil))))) --- 198,205 ---- (or (eq which-func-modes t) (member major-mode which-func-modes)))))) ;; Turn it off ! (when (timerp which-func-update-timer) ! (cancel-timer which-func-update-timer)) (setq which-func-update-timer nil) (dolist (buf (buffer-list)) (with-current-buffer buf (setq which-func-mode nil)))))