From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dwolffxx@panix.com (David Wolff) Newsgroups: gmane.emacs.help Subject: Re: which-function-mode + visual-basic-mode? Date: Wed, 11 Jun 2008 00:39:05 +0000 (UTC) Organization: Public Access Networks Corp. Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1213144888 2905 80.91.229.12 (11 Jun 2008 00:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 00:41:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 02:42:11 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 1K6EPi-0001Nj-9A for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 02:42:10 +0200 Original-Received: from localhost ([127.0.0.1]:40430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6EOu-00067E-Ul for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Jun 2008 20:41:20 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.250.MISMATCH!news-xxxfer.readnews.com!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: panix1.panix.com Original-X-Trace: reader2.panix.com 1213144745 22790 166.84.1.1 (11 Jun 2008 00:39:05 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Wed, 11 Jun 2008 00:39:05 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Original-Xref: news.stanford.edu gnu.emacs.help:159346 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:54701 Archived-At: In article , Kevin Rodgers wrote: > 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). Well, I looked at this some more, and it's looking more complicated than I have time for. I was hoping that a simple answer existed (especially since which-func is not exactly crucial). Kevin, thanks for your effort on this. -- David