From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#2224: [PATCH] add-log.el: Modularize add-log-current-defun, new types supported Date: Thu, 12 Apr 2012 14:11:47 -0400 Message-ID: References: <87bptf5upl.fsf@jondo.cante.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334254377 32342 80.91.229.3 (12 Apr 2012 18:12:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Apr 2012 18:12:57 +0000 (UTC) Cc: 2224@debbugs.gnu.org, Jari Aalto To: Lars Magne Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 12 20:12:56 2012 Return-path: Envelope-to: geb-bug-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 1SIOVs-00016S-7W for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Apr 2012 20:12:56 +0200 Original-Received: from localhost ([::1]:49251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIOVr-0003qd-Iq for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Apr 2012 14:12:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIOVo-0003qL-2l for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2012 14:12:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIOVm-0007kf-9m for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2012 14:12:51 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIOVm-0007kb-69 for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2012 14:12:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SIOWx-00051z-3Y for bug-gnu-emacs@gnu.org; Thu, 12 Apr 2012 14:14:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Apr 2012 18:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 2224 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 2224-submit@debbugs.gnu.org id=B2224.133425439219255 (code B ref 2224); Thu, 12 Apr 2012 18:14:02 +0000 Original-Received: (at 2224) by debbugs.gnu.org; 12 Apr 2012 18:13:12 +0000 Original-Received: from localhost ([127.0.0.1]:54661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIOW6-00050V-2e for submit@debbugs.gnu.org; Thu, 12 Apr 2012 14:13:11 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:35837) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIOW2-00050L-5i for 2224@debbugs.gnu.org; Thu, 12 Apr 2012 14:13:07 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q3CIBmDF021511; Thu, 12 Apr 2012 14:11:48 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 0172EB4066; Thu, 12 Apr 2012 14:11:47 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Thu, 12 Apr 2012 18:03:36 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4190=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4190> : streams <746293> : uri <1098481> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58910 Archived-At: >>>> (add-log-current-defun-type-javascript-like): New function. >>>> (add-log-current-defun-type-shell-bourne-like): New function. >>>> (add-log-current-defun-type-makefile-like): New function. >>>> (add-log-current-defun-type-text-asciidoc-like): New function. >>>> (add-log-current-defun-type-default): New function. > [...] >> Having them be separate functions is indeed very good. But most of them >> shouldn't be in add-log.el: they should be in their respective >> major-mode instead. > You mean just define `add-log-current-defun-type-javascript' in js.el, > and stuff? Doesn't that seem kinda... I don't know. Error-prone? I thought you were going to say "Obvious?". Think about it: why should add-log support be different than say, font-lock, outline, imenu, younameit? Oh and BTW, this same function can/should be used for which-func-mode. Of course in js.el it shouldn't be called `add-log-current-defun-type-javascript' but `js--current-defun-name' or something like that. > Because add-log (in the patch) has a major cond up there that will call > the functions unconditionally if there's a match with the mode (and > other things), so there's potential for things getting out of sync if > people are using different versions of (say) js.el that doesn't define > the function in question... We had the same problem when we moved the font-lock defs away from font-lock.el. Yes, it's a problem. No, it's not insurmountable. Stefan