From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?R=C3=A9mi_Vanicat?= Newsgroups: gmane.emacs.help Subject: Re: Crappyness of Emacs Version 24.5.1 defadvice Date: Wed, 29 Jun 2016 15:54:07 +0200 Message-ID: <874m8c14ow.dlv@debian.org> References: <51b6ce57-51f6-43b9-9ad0-20540a877dca@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1467209763 2577 80.91.229.3 (29 Jun 2016 14:16:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jun 2016 14:16:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 29 16:15:54 2016 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 1bIGHM-0002LJ-48 for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jun 2016 16:15:48 +0200 Original-Received: from localhost ([::1]:44073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIGHL-0002Bo-11 for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jun 2016 10:15:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIGGs-0002A7-C3 for help-gnu-emacs@gnu.org; Wed, 29 Jun 2016 10:15:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIGGp-0003YD-4f for help-gnu-emacs@gnu.org; Wed, 29 Jun 2016 10:15:18 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIGGo-0003XL-Tx for help-gnu-emacs@gnu.org; Wed, 29 Jun 2016 10:15:15 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bIGGe-0001qD-JT for help-gnu-emacs@gnu.org; Wed, 29 Jun 2016 16:15:04 +0200 Original-Received: from cub33-2-78-240-208-104.fbx.proxad.net ([78.240.208.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jun 2016 16:15:04 +0200 Original-Received: from vanicat by cub33-2-78-240-208-104.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jun 2016 16:15:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cub33-2-78-240-208-104.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:zNTQ/hOYmxNiGJ0DO4rhTdA78xM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:110657 Archived-At: Davin Pearson writes: > On Wednesday, June 29, 2016 at 2:22:01 AM UTC+12, Drew Adams wrote: >> > > The old behavior is preferable so I know which file the advice >> > > is coming from. >> > >> > Could someone tell me how to get the old behavior back? >> >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14734 >> ("REGRESSION: defadvice broken wrt doc strings (C-h f)") >> >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14070 >> ("incorrect doc from `C-h f' when use `defadvice' with `before'") >> >> This post by Stefan provides the rationale behind the new advice >> system. (You might want to read the rest of the thread too.) >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16402#31 >> ("Document nadvice.el stuff in Elisp manual before Emacs 24.4") > > I tried the following code but it doesn't work. > > (advice-add 'describe-mode > :around > #'(lambda () (delete-other-windows) ad-do-it) > ) > (defun my-describe-mode-before-advice (oldfun &optional buffer) "my documentation" (delete-other-windows) (apply oldfun buffer)) (advice-add 'describe-mode :around #'my-describe-mode-before-advice) Or better with a before advice: (defun my-describe-mode-before-advice (&optional buffer) "my documentation" (delete-other-windows)) (advice-add 'describe-mode :before #'my-desccribe-mode-before-advice) -- RĂ©mi Vanicat