From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.bugs Subject: bug#1103: 23.0.60; which-func misses functions Date: Tue, 07 Oct 2008 12:48:48 +0200 Message-ID: <48EB3E90.9010709@gmail.com> References: <48EA8A9D.8020103@gmail.com> Reply-To: "Lennart Borgman \(gmail\)" , 1103@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030106020300080800040407" X-Trace: ger.gmane.org 1223377850 9606 80.91.229.12 (7 Oct 2008 11:10:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2008 11:10:50 +0000 (UTC) To: 1103@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 07 13:11:46 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KnATG-00024o-Jm for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Oct 2008 13:11:18 +0200 Original-Received: from localhost ([127.0.0.1]:49626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnASC-00046S-LY for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Oct 2008 07:10:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnAS8-00046B-4D for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 07:10:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnAS4-00045j-80 for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 07:10:07 -0400 Original-Received: from [199.232.76.173] (port=54703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnAS4-00045f-2C for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 07:10:04 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60109) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KnAS3-0001Rv-9t for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 07:10:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97B9vVa031259; Tue, 7 Oct 2008 04:09:57 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m97At3k6026908; Tue, 7 Oct 2008 03:55:03 -0700 X-Loop: don@donarmstrong.com Resent-From: "Lennart Borgman (gmail)" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 07 Oct 2008 10:55:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1103 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1103-submit@emacsbugs.donarmstrong.com id=B1103.122337656825659 (code B ref 1103); Tue, 07 Oct 2008 10:55:03 +0000 Original-Received: (at 1103) by emacsbugs.donarmstrong.com; 7 Oct 2008 10:49:28 +0000 Original-Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97AnOtX025652 for <1103@emacsbugs.donarmstrong.com>; Tue, 7 Oct 2008 03:49:25 -0700 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:65227 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KnA7p-0006t9-87 for 1103@emacsbugs.donarmstrong.com; Tue, 07 Oct 2008 12:49:21 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <48EA8A9D.8020103@gmail.com> X-Enigmail-Version: 0.95.7 X-Antivirus: avast! (VPS 081006-0, 2008-10-06), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KnA7p-0006t9-87. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1KnA7p-0006t9-87 40ed6cc06b529f0d553b382590eefc3a X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 07 Oct 2008 07:10:07 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21203 Archived-At: This is a multi-part message in MIME format. --------------030106020300080800040407 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lennart Borgman (gmail) wrote: > Instead of displaying the last function in an elisp file it may display > the name of a variable that is above the function. I do not know if the > patch below is the right way to fix it. Here is a new patch which I think is correct. --------------030106020300080800040407 Content-Type: text/plain; name="which-func.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="which-func.diff" Index: which-func.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/which-func.el,v retrieving revision 1.25 diff -u -r1.25 which-func.el --- which-func.el 30 Sep 2008 03:42:47 -0000 1.25 +++ which-func.el 7 Oct 2008 10:45:56 -0000 @@ -287,11 +287,12 @@ (boundp 'imenu--index-alist) imenu--index-alist) (let ((alist imenu--index-alist) (minoffset (point-max)) - offset pair mark imstack namestack) + offset pair mark imstack namestack + skip-sub) ;; Elements of alist are either ("name" . marker), or ;; ("submenu" ("name" . marker) ... ). The list can be ;; arbitrarily nested. - (while (or alist imstack) + (while (or alist imstack skip-sub) (if alist (progn (setq pair (car-safe alist) @@ -302,9 +303,12 @@ ((imenu--subalist-p pair) (setq imstack (cons alist imstack) namestack (cons (car pair) namestack) - alist (cdr pair))) + alist (cdr pair) + skip-sub nil + )) ((number-or-marker-p (setq mark (cdr pair))) + (unless skip-sub (if (>= (setq offset (- (point) mark)) 0) (if (< offset minoffset) ; find the closest item (setq minoffset offset @@ -312,12 +316,15 @@ which-func-imenu-joiner-function (reverse (cons (car pair) namestack))))) ;; Entries in order, so can skip all those after point. - (setq alist nil - imstack nil))))) + ;;(setq alist nil imstack nil) + (setq skip-sub t) + ) + )))) (setq alist (car imstack) namestack (cdr namestack) - imstack (cdr imstack)))))) + imstack (cdr imstack) + skip-sub nil))))) ;; Try using add-log support. (when (and (null name) (boundp 'add-log-current-defun-function) --------------030106020300080800040407--