From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Last use of defadvice in Emacs Date: Thu, 7 Apr 2022 18:49:25 -0700 Message-ID: <25167.38053.15113.49802@retriever.mtv.corp.google.com> References: <834k35ctd4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, raman@google.com, acm@muc.de, bug-cc-mode@gnu.org, emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 08 03:51:42 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncdmo-0006Oe-Ay for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Apr 2022 03:51:42 +0200 Original-Received: from localhost ([::1]:49270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncdmm-0008Bn-TO for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Apr 2022 21:51:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncdkp-00072p-Ap for emacs-devel@gnu.org; Thu, 07 Apr 2022 21:49:39 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:45878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncdkl-0008MF-MR for emacs-devel@gnu.org; Thu, 07 Apr 2022 21:49:38 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id k13so1423163plk.12 for ; Thu, 07 Apr 2022 18:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=from:mime-version:content-transfer-encoding:message-id:date:to:cc :subject:in-reply-to:references; bh=gT5tDAESPDT5004PM5h9gBEMAxw98jcas7QgNCis5bM=; b=UIgJ9LQ3bT8uAZ6TZFkfSmI/8/7YzAAKmCxJ83erWIPGSqiMB/u5lps93aOfluq15+ 0BEnf26BmmE/gXqIk/bTU8Rl5UP4McEl9hzny4Y7pYvctCMjNzSqmtatZSq85hdB4a0S HxnB0r8OjQAUUcX/VpKw7fxnTHaVvw8NZBC0KpeasDWWA7eIqG84GeKxzo5yHyaOyfYs WtMdWGZcoNbpcDIO1qFJcqSaft4QmdAKt52qbHMCFo0VH6wDHlqxby7hpyI2oTLKrgNp uSer9hC3gnT5CkeH+FnpAZZJtcFzvG56dwlDfLz/ww0XLB7RlNWyqIeo+cNgwIydKLea C2bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:content-transfer-encoding :message-id:date:to:cc:subject:in-reply-to:references; bh=gT5tDAESPDT5004PM5h9gBEMAxw98jcas7QgNCis5bM=; b=i8BdwMit0NYQemLqBIl+ZHPw0r8giWWqtHmxt0T4LdOiESnAOcSRHOHUDDBCnpJOhg f2ZbSZNYTODHIxLJ9AcBkVLEwjJO0ouKV3d2iCFo0/+xkYP+f4pxxnrsmJi3rh07NqrK pC/LjNIeUqXnngVDXTfABRBsU+nx2Sz3spp1xxi63fXBh5bC2YrGo6KVnSGJAmiCXQRG 0R9itTWBALCn9+sI5s4+nDQ3YBEUpho4oorAcze1UxZ4WoPgngMYfmqgRQAPTOmJXOE3 UlwwKQF/oGhS+NoPA9VYetHvoYVQ2cOMndsMvWwniLD3ZeXGozTv+OuIOD6u1/NREO4m yksg== X-Gm-Message-State: AOAM5322+ttP7OLe8AUHQ/diVailM1IqFvm7oI4/ycByN3aFHjzMeWQj DH1TgRz2zh2QJjIpKYZMBTgAWogQI5EVOQ== X-Google-Smtp-Source: ABdhPJw08/I0453eHK9KB9jxy8EcSchfuxqMUjbSPrPn26ab4W4ttxF7m68+qX7f8VtbCC+4wp6C7A== X-Received: by 2002:a17:90b:4d85:b0:1c7:3933:d810 with SMTP id oj5-20020a17090b4d8500b001c73933d810mr19131625pjb.129.1649382572263; Thu, 07 Apr 2022 18:49:32 -0700 (PDT) Original-Received: from retriever.mtv.corp.google.com ([2620:0:1000:1510:9c70:8542:23a6:df90]) by smtp.gmail.com with ESMTPSA id y3-20020a056a00190300b004fa2411bb92sm25332868pfi.93.2022.04.07.18.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 18:49:31 -0700 (PDT) In-Reply-To: X-Mailer: VM 8.1.1 under 29.0.50 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=raman@google.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287912 Archived-At: Stefan, Thank you very much for this. Couple of items: 1. ad-get-arg vs ad-get-argument: I've always used ad-get-arg -- however for the last few years I've notied that ad-get-arg is getting harder and harder to discover; for the last few years, emacs always completes ad-get-arg to ad-get-argument. I personally find ad-get-arg to be more idiomatic and easier to use. 2. Re ad-return-value -- I've almost never had to explicitly set ad-return-value -- in around and after advice, I have always returned ad-return-value and have never hit issues --- perhaps because I've always wrappered my advice body in a let form -- not sure. What kind of breakages happen when returning ad-return-value vs explicitly setting ad-return-value at the end of the advice body=3F 3. I've avoided the complexity around preactivation vs activation etc by always saying (... pre act comp) in all my advice forms and also making sure to name all my advices (in my case emacspeak) so one can tell where the advice came from. =20 --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =E2=99=89 Id: kg:/m/0285kf1 =F0=9F=A6=AE -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮