From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: which-function-mode + visual-basic-mode? Date: Thu, 22 May 2008 21:43:19 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1211514260 10527 80.91.229.12 (23 May 2008 03:44:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 May 2008 03:44:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 23 05:44:58 2008 Return-path: Envelope-to: geh-help-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 1JzOCl-0000IX-JE for geh-help-gnu-emacs@m.gmane.org; Fri, 23 May 2008 05:44:31 +0200 Original-Received: from localhost ([127.0.0.1]:40038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzOC1-00069F-6A for geh-help-gnu-emacs@m.gmane.org; Thu, 22 May 2008 23:43:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzOBj-00067t-G9 for help-gnu-emacs@gnu.org; Thu, 22 May 2008 23:43:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzOBi-00067O-4U for help-gnu-emacs@gnu.org; Thu, 22 May 2008 23:43:27 -0400 Original-Received: from [199.232.76.173] (port=37691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzOBi-00067L-27 for help-gnu-emacs@gnu.org; Thu, 22 May 2008 23:43:26 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:50937 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JzOBh-0003KQ-VU for help-gnu-emacs@gnu.org; Thu, 22 May 2008 23:43:26 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JzOBY-0005hZ-Vb for help-gnu-emacs@gnu.org; Fri, 23 May 2008 03:43:16 +0000 Original-Received: from c-67-190-29-163.hsd1.co.comcast.net ([67.190.29.163]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 May 2008 03:43:16 +0000 Original-Received: from kevin.d.rodgers by c-67-190-29-163.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 May 2008 03:43:16 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-67-190-29-163.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54259 Archived-At: David Wolff wrote: > In article , > Kevin Rodgers wrote: >> David Wolff wrote: >>> Hi all, >>> >>> Emacs 22.2. which-function-mode does the right thing for Emacs Lisp >>> files and other modes that I don't remember off-hand, but not for >>> visual-basic-mode... nothing shows up in the mode line even after ESC-: >>> (which-function-mode 1). Any ideas? >> Hmmm, `M-x apropos RET visual-basic RET' says: >> >> No apropos matches for `visual-basic' > > Right, I found visual-basic-mode somewhere on that internet thingy. I > took a look at which-func.el but it's not very clear how it figures out > the current function -- sort of looks like imenu magic. So how does > which-func work correctly for several programming modes but not > visual-basic-mode? The first thing I see in which-func.el is that you'll need to add visual-basic-mode to which-func-modes, and perhaps to which-func-non-auto-modes. If visual-basic-mode support imenu, then you should be good to go. And if beginning-of-defun works in that mode, that might be good enough. Otherwise, you could try defining a function that returns the name of the current function in visual-basic-mode, then assign that to which-func-functions (actually, use add-hook with non-nil LOCAL arg). -- Kevin Rodgers Denver, Colorado, USA