From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Identifying DEFUNs in which-func-mode Date: Wed, 7 Oct 2009 03:27:44 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1254880873 18491 80.91.229.12 (7 Oct 2009 02:01:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Oct 2009 02:01:13 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 07 04:01:03 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MvLpt-0004FF-UC for ged-emacs-devel@m.gmane.org; Wed, 07 Oct 2009 04:01:03 +0200 Original-Received: from localhost ([127.0.0.1]:45637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvLps-00023g-P3 for ged-emacs-devel@m.gmane.org; Tue, 06 Oct 2009 22:01:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvLK8-0000QV-7P for emacs-devel@gnu.org; Tue, 06 Oct 2009 21:28:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvLK3-0000NE-Dg for emacs-devel@gnu.org; Tue, 06 Oct 2009 21:28:11 -0400 Original-Received: from [199.232.76.173] (port=45054 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvLK3-0000Mr-5m for emacs-devel@gnu.org; Tue, 06 Oct 2009 21:28:07 -0400 Original-Received: from mail-bw0-f220.google.com ([209.85.218.220]:64487) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvLK2-0005Wx-R7 for emacs-devel@gnu.org; Tue, 06 Oct 2009 21:28:07 -0400 Original-Received: by bwz20 with SMTP id 20so4053605bwz.42 for ; Tue, 06 Oct 2009 18:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=wSGj5sOk1mdoSBCK/QyX32xIFqTUVsDUjCN77Cmhxu0=; b=Ki9Z2/+mk4KI8htMhMMmFSS6BWAYLuWbYhYOQIU4o3JcbnXiaj6Ftx+zqeOGBNFXzW /X9DzWshldubYdFL4rwqMUSlo+PWpV5RsT7+8c4wl9i6nZp4WEKVRz+xgaQ+8hOQvBDv sjM46b114qMHy20yuk0n12twePJv5gFdDnKdQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=ZlHy+mEUOURTbd6zo7a/dvy+bMaax2ATQIcbiirS/Gb5l0rzE67fFp/6Rrxtu5tESC MPRDb6pllAqe5Zd113p5OsBffVLNawG9snD8Y3j/9BeRbO0Z4IV8H82DpXSXAopBpOCa 3ztq9aMRVO5QG3BAwJpG18yxbEyWavKx3ij80= Original-Received: by 10.239.182.149 with SMTP id q21mr197428hbg.32.1254878885490; Tue, 06 Oct 2009 18:28:05 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115942 Archived-At: IMO, defining this function somewhere (defun which-func-identify-DEFUN () (save-excursion (save-match-data (beginning-of-defun) (if (looking-at "DEFUN +(\"[^\"]+\", +\\(F[^,]+\\),") (match-string-no-properties 1) nil)))) and adding it to `which-func-functions' for C files in the Emacs tree would be useful. Alas, it can't be added through .dir-locals.el, because hooks are unsafe as directory-local variables. One (not particularly elegant) way to fix it would be to add to C mode the function and a boolean variable to set it; that variable could be safely set in .dir-locals.el. Surely others can think of better ways. But before taking the trouble, does anyone else think that it would be useful to have this in standard Emacs, or it is the intersection of Emacs developers and which-func-mode users too small? Juanma