From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: imenu question (or an alternative) Date: Tue, 13 May 2014 20:52:48 +0000 Message-ID: <155DEC68569B714B86C2C7075F5EDA9892AB4F22@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1400014399 16294 80.91.229.3 (13 May 2014 20:53:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 May 2014 20:53:19 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 13 22:53:11 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WkJhG-0008It-RD for geh-help-gnu-emacs@m.gmane.org; Tue, 13 May 2014 22:53:10 +0200 Original-Received: from localhost ([::1]:47842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkJhG-0004aY-IK for geh-help-gnu-emacs@m.gmane.org; Tue, 13 May 2014 16:53:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkJh1-0004Yq-0j for help-gnu-emacs@gnu.org; Tue, 13 May 2014 16:53:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkJgu-0005so-S7 for help-gnu-emacs@gnu.org; Tue, 13 May 2014 16:52:54 -0400 Original-Received: from webmail.shubertorg.com ([207.246.209.200]:20393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkJgu-0005sg-Oa for help-gnu-emacs@gnu.org; Tue, 13 May 2014 16:52:48 -0400 Original-Received: from dakiya1.pegasus.local ([172.16.208.201]) by DAKIYA1.pegasus.local ([172.16.208.201]) with mapi id 14.01.0438.000; Tue, 13 May 2014 16:52:48 -0400 Thread-Topic: imenu question (or an alternative) Thread-Index: Ac9u7UvzpSShMJ+CQsmFrdNo2iFOtA== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.246.209.200 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97633 Archived-At: I've written a small mode for editing files containing lists of certain for= mats. I use which-function-mode (i.e. imenu) to index the lists. Such lists might have a "preferred" entry depending on what directory it's = in. The mode starts by putting the point on the "preferred" entry. This is = nice, but then the imenu index starts only at that entry which makes the wh= ole which-function/imenu combination less useful than it might be. Here's the mode's current definition with the go-to-issue code at the very = end. FYI without those two lines, the Issues menu gets populated correctly. (define-derived-mode issues-mode text-mode "issues" "Major mode for files that might contain issues." :keymap 'issues-mode-map (make-local-variable 'beginning-of-defun-function) (make-local-variable 'end-of-defun-function) (setq beginning-of-defun-function 'iss-beginning-of-issue) (setq end-of-defun-function 'iss-end-of-issue) (setq imenu-create-index-function 'iss-mode-create-index) (setq imenu-sort-function 'imenu--sort-by-position) (unless which-function-mode (require 'which-func) (which-function-mode)) (imenu-add-to-menubar "Issues") (let ((issue (iss-get-issue-for-directory))) (imenu issue))) Is there a magic incantation that I don't know to make this do the right th= ing? (Is there an appropriate alternative to which-function/imenu? Thanks. ,Douglas Douglas Lewan Shubert Ticketing (201) 489-8600 ext 224 LISP: The most intelligent way to misuse a computer.