From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Newsgroups: gmane.emacs.bugs Subject: bug#3984: Date: Fri, 20 Sep 2013 09:50:34 -0700 Message-ID: <523C7CDA.6040308@thompsonclan.org> References: <20E00C7675E64356BF2F0B2A7E0ABDB1@us.oracle.com> <5232D333.8030206@thompsonclan.org> <523359CD.2070904@thompsonclan.org> <5233670E.4030703@thompsonclan.org> <5237C9FF.1000809@thompsonclan.org> <52388FEB.6020007@thompsonclan.org> <523A37A4.5060505@thompsonclan.org> <523A49BE.3060109@thompsonclan.org> <523AB06B.9090606@thompsonclan.org> <523B4F4E.3060204@thompsonclan.org> <523B73CF.4080105@thompsonclan.org> NNTP-Posting-Host: plane.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 1379695881 30881 80.91.229.3 (20 Sep 2013 16:51:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Sep 2013 16:51:21 +0000 (UTC) Cc: 3984@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 20 18:51:24 2013 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 1VN3vN-0008R7-3Y for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2013 18:51:21 +0200 Original-Received: from localhost ([::1]:56919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN3vM-0002UM-Mq for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2013 12:51:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN3vC-0002Kx-9l for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:51:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN3v4-0006XX-FH for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:51:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN3v4-0006XT-CG for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VN3v4-0002Zu-3O for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ryan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2013 16:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 3984-submit@debbugs.gnu.org id=B3984.13796958489891 (code B ref 3984); Fri, 20 Sep 2013 16:51:02 +0000 Original-Received: (at 3984) by debbugs.gnu.org; 20 Sep 2013 16:50:48 +0000 Original-Received: from localhost ([127.0.0.1]:51548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VN3up-0002ZQ-Lt for submit@debbugs.gnu.org; Fri, 20 Sep 2013 12:50:47 -0400 Original-Received: from mail-pb0-f48.google.com ([209.85.160.48]:55555) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VN3un-0002Z8-71 for 3984@debbugs.gnu.org; Fri, 20 Sep 2013 12:50:45 -0400 Original-Received: by mail-pb0-f48.google.com with SMTP id ma3so597050pbc.7 for <3984@debbugs.gnu.org>; Fri, 20 Sep 2013 09:50:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ffmi6NMOSawFV0o3jLhnrCbzGVk74RPjc2VA34EQsR0=; b=GGnzbjuW47eOar2xdDI07ByEK7T/ifIgE7MvcZw8LZc1Z111aJTQQjfd/hw/qVRT5I TSl1a+y07KaKbyQyTyl2yilyg1naEUHug9dk+A7jP9OTddbPjq2NJwxX1ceRsfdv/R2Z 2xliJ1QGRXB29MJdg8Nk5jNP1BjUyadX3YffM3HY7n8xOs69ClQDHVwMpO8wWeptXZS8 F8p8yvlh4LyZVlx50dF7L0g02mENcAIV1aadSMCdMyvppe4JYQUV50NfymyCyaq6spbR sca70nqUM+Fg9DyW6RDF6clLuZV22sohKhKwLKaP8blOlNpuMI4JQi9hPKyPfS/jMY3P y8KQ== X-Gm-Message-State: ALoCoQlLIodHtXOqSGnsj81kQ0JCvcV96eJMB2IP4sgKWjK5PNoogfjbx7McmyEMugA+tMshqIkz X-Received: by 10.68.234.130 with SMTP id ue2mr9022526pbc.159.1379695839204; Fri, 20 Sep 2013 09:50:39 -0700 (PDT) Original-Received: from wireless-121-195.scripps.edu (wireless-121-195.scripps.edu. [137.131.121.195]) by mx.google.com with ESMTPSA id va8sm16881752pbc.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 09:50:38 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:78615 Archived-At: >> Ok, I have written a couple of tests, two of which are currently failing >> (mine are the ones with numbered suffixes 2 through 5). I am >> attaching a patch that adds these tests. ERT output is below: > Thanks. Just a few questions, before installing the patch. > >> +(defun clear-advice (symbol) >> + "Reset SYMBOL's function to its original unadvised definition." >> + (let ((func (symbol-function symbol))) >> + (while (advice--p func) >> + (setq func (advice--cdr func))) >> + (fset symbol func))) > Why do you need that? AFAICT you only use it after defining sm-test7.2, > and I don't see why that call is needed. Oh, that's actually not necessary. I put it in so I could re-run the test without restarting emacs or manually resetting the advice, and I forgot to remove it. >> +(defmacro post-restore-func (func &rest body) >> + (let ((fdef (symbol-function func))) >> + `(unwind-protect >> + (progn ,@body) >> + (fset ',func ,fdef)))) >> +(put 'post-restore-func 'lisp-indent-function >> + (get 'prog1 'lisp-indent-function)) > Since it's only used once, I don't think it's worth defining a macro for it. Probably true. I wasn't sure how much I would end up using it, and it seemed like a potentially useful macro to have lying around when testing advice that might break core functions of emacs. Anyway, I wasn't very creative with my test names or function names, and I'd be happy to submit a new patch with more informative names (as well as the above changes). Is there a naming convention for tests/functions that I should adhere to?