From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OEQYES0yeWIE8QAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 17:24:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QHE5EC0yeWLW6QAAG6o9tA (envelope-from ) for ; Mon, 09 May 2022 17:24:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B89FB91B4 for ; Mon, 9 May 2022 17:24:28 +0200 (CEST) Received: from localhost ([::1]:37636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no5FL-00070S-CI for larch@yhetil.org; Mon, 09 May 2022 11:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no5AA-0002o7-ET for emacs-orgmode@gnu.org; Mon, 09 May 2022 11:19:06 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:35090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no5A8-00056y-Rr for emacs-orgmode@gnu.org; Mon, 09 May 2022 11:19:06 -0400 Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 8E6CAFA034; Mon, 9 May 2022 15:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1652109537; bh=/U3/CMuCk0QRccbekuwqu2p6SdcuuoPXaegZQdBb07s=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=sIO8K0SN6h2Xz/Zb5txU2iaOroBkXuocLZTyRLeWt+enkqZnSQNGIKAe4UaIiaqne n4pKOoxAHXs8GYQVugnBgFjUSmD7fVJw8ErWwnaRby6sBbYcCz8MN7pGMyMazscsl8 /6tBVG6cHCQ3l31iIFAc9bL8F+rGdXH6lMvAw5xE= From: Eric Abrahamsen To: emacs-orgmode@gnu.org Cc: Nicolas Goaziou Subject: Re: Bug in orgalist mode's advice on indent-according-to-mode References: <87czh1g4cn.fsf@ericabrahamsen.net> <87sfpxohb5.fsf@gmail.com> <878rrpfc8i.fsf@ericabrahamsen.net> Date: Mon, 09 May 2022 08:18:56 -0700 In-Reply-To: <878rrpfc8i.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 28 Apr 2022 08:39:57 -0700") Message-ID: <87tu9yspi7.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652109868; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/U3/CMuCk0QRccbekuwqu2p6SdcuuoPXaegZQdBb07s=; b=AzFJK24VqgjVCDXzr5b3rr9X3Hq41tGiwY2i7uvMKYuZJOBz50O5g8eSwlB7Ci+Shn2COr Y67J2SIm8oDyz7vDmVjFIwcD9eyd4Q9/avb6ILWd4xtZkCxgU4VqKKAWSZbc7jkRyLj1Xa APB2uUtXCyVl/d/eCkmiQFMHzSu0nSm/ym6SX2YJSaVE5y9oxIn6jFsh3LybfV1JMNBcv8 R1jI8KANl2FERdFvrU6TsHuhphDfyT5mHBniL4BELm9rEnE+BXZTyQpGr7H5xNg40+UyuN ZCJ1pzqJ5Ftjyx3HXgQYVjtI76UQDUqPs2JT7sjujmDOiVeiMlnk2VCBCVataA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652109868; a=rsa-sha256; cv=none; b=i5JlEFCNKqHLZ+1aVjnwkMXtu/NW4hZANeU4sY1X+UmJO8VOU87JCVyGak0/Lb7qd03siy aYuWTZOoqX8z1uOXFn1USZIux2lZ3d6nmgyXSwB7rSi8RlTtmuZ2WSgdMKr0eO+NcZ0dJM GpnsMUnl3uNXiuSwvf4jit1sQ8x5algdyOA0LUErdHyv85j/vM2w9SkAs7crzTSXGKDHEy M3Yy6P4Dks9PhBwbrlz2gKichjD2nxVeVf9DoizEmcEthIQPSM0RKpodL83Sx7ZNX33xH0 i8SwrMq5PkURMw8qBlRbMJK3GBGSBW2cEKJUYCFlz/klafAanfPx/k+409O8QQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ericabrahamsen.net header.s=mail header.b=sIO8K0SN; dmarc=pass (policy=none) header.from=ericabrahamsen.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.20 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ericabrahamsen.net header.s=mail header.b=sIO8K0SN; dmarc=pass (policy=none) header.from=ericabrahamsen.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B89FB91B4 X-Spam-Score: -6.20 X-Migadu-Scanner: scn1.migadu.com X-TUID: gwVP5eyq7hzd Eric Abrahamsen writes: > Tim Cross writes: > >> Eric Abrahamsen writes: >> >>> In Emacs commit f596f0db82c0b1ff3fe8e8f1d8b07d2fe7504ab6, from Nov 2021, >>> the function `indent-according-to-mode' was given an optional >>> inhibit-widen argument. That argument being passed causes orgalist's >>> advice to fail, as the lambda doesn't accept any additional arguments. >>> One way to fix it would be like that: >>> >>> (unless (advice-member-p 'orgalist-fix-bug:31361 'indent-according-to-mode) >>> (advice-add 'indent-according-to-mode >>> :around (lambda (old &optional inhibit-widen) >>> "Workaround bug#31361." >>> (or (orgalist--indent-line) >>> (let ((indent-line-function >>> (advice--cd*r indent-line-function))) >>> (funcall old inhibit-widen)))) >>> '((name . orgalist-fix-bug:31361))))) >>> >>> Or I suppose a more future-proof approach might be to use a &rest and >>> then `apply' instead of `funcall'. >>> >> >> A better solution would probably be to fix this without using >> add-advice. While advice can be a useful escape hatch, it really is best >> avoided, especially given that it doesn't always play nice with lexical >> binding. I note this one is also calling an undocumented internal >> function. > > In principle I quite agree! But orgalist is basically built on top of > add-function/advice-add, so I didn't think that was an option. And > also assumed that, given what Orgalist is trying to do, there isn't a > cleaner solution right now. What do you think, Nicolas? Can I patch this to use &rest and `apply'?