From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Problem advising nreverse. Date: Mon, 14 Dec 2009 18:56:11 +0100 Organization: Informatimago Message-ID: <87pr6hl9s4.fsf@galatea.local> References: <87skbg8jww.fsf@galatea.local> <87bpi1n1z7.fsf@galatea.local> <873a3dmvef.fsf@galatea.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260816048 19097 80.91.229.12 (14 Dec 2009 18:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Dec 2009 18:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 14 19:40:41 2009 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 1NKFqW-0000w4-8P for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2009 19:40:36 +0100 Original-Received: from localhost ([127.0.0.1]:51969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKFqW-00075e-7g for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2009 13:40:36 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-X-Trace: individual.net EJ7nTMZ0duMmEb8Jokm2nwGw+T6iOiTghFS0+r8co9wtlChqEt Cancel-Lock: sha1:NWUzODQxMjVjNGQ3ZmM1Y2MzMDFiMzk2MTQ5ZTQ0ODdjY2Y4OTUxMw== sha1:8pOTseBRVJsS6uNS1lBDfwTijVY= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:175566 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:70643 Archived-At: Sergei Organov writes: > You see, I wanted automatic elisp-only solution to "fixing" > ewoc-collect, but only if it indeed happens to be buggy. Manual > reloading is not an option then. Alternate approach would be to execute > simple test-case to determine if ewoc-collect is indeed buggy and then > re-define it to the correct version if so. That's what I'm going to > implement now, provided there doesn't seem to be a way to do what I want > by means of advising ewoc-collect and nreverse. I see. Perhaps you can statically characterize what version (variables emacs-version, emacs-major-version, emacs-minor-version) contains the broken ewoc, and then just redefine it in these versions, in your ~/.emacs: (require 'ewoc) (when (or (< emacs-version-major NN) (and (= emacs-version-major NN) (< emacs-version-minor MM))) (defun ewoc-collect (...) ...)) or else, if you can detect the broken version with a test: (require 'ewoc) (unless (equal 'expected-result (ewoc-collect 'test-arguments)) (defun ewoc-collect (...) ...)) (you can add a (byte-compile 'ewoc-collect) after the defun in either case if you need it fast). -- __Pascal Bourguignon__