From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 SD9ZOBk0amIlNgEAbAwnHQ (envelope-from ) for ; Thu, 28 Apr 2022 08:28:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6IpPOBk0amJDRgAA9RJhRA (envelope-from ) for ; Thu, 28 Apr 2022 08:28:41 +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 793C32F6B1 for ; Thu, 28 Apr 2022 08:28:41 +0200 (CEST) Received: from localhost ([::1]:54960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njxdn-0005TH-IN for larch@yhetil.org; Thu, 28 Apr 2022 02:28:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njxb4-0005RU-At for emacs-orgmode@gnu.org; Thu, 28 Apr 2022 02:26:02 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:36458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njxaz-00014a-J6 for emacs-orgmode@gnu.org; Thu, 28 Apr 2022 02:25:47 -0400 Received: by mail-pl1-x62f.google.com with SMTP id q8so3499449plx.3 for ; Wed, 27 Apr 2022 23:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=6FVrevtVM6NhfLtGGNLnlo0qNaAEAocoQn1InPmlZ7g=; b=Z6TJcoo7F4ZlBHW5AEldcDrTdToV7DtTiyPr0NYMexhKcH7S3xyQwk4VuIS28wqeuv aonFUOAlsqX1hXptk2Yknt+iBoVWvrZ7ruM9IXGnGrlQQbcQMhzxRgMXExoF/F1O4rV8 krfI1FJMFu6mXyJ+xB2Ij28bpRqcfwqqOg9GdBYaFTPWIy4Y1/4qDgp06AAwI7pqZWBa BPBowe0TkKJI2azgkO7cegL7SfyrAbrG0VeC+Bs5acEhk0M5UMD6kcRkKYj+JPjLTAnx LDtwClXJXTKBt2iTFx1iey2wyvmhdusPM7V+tZ6YXdnFWnp1ieqVVR+dr6inPnkiyMJP m4xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=6FVrevtVM6NhfLtGGNLnlo0qNaAEAocoQn1InPmlZ7g=; b=twSM/UG2VVxPIw/OSXMfYFJOw/YN3NSlLGheXPPrIx3FmKwC+VhqGxJVHz6p28SaYr 7ZMXmRrg/Nt4qIGkdtnFrhvU/0MklE0hLK1QJ006WXVXdlf5ri1G3gdsgZvnk+XQvJ2Z MEqyH66jkbr8pvpaZpI2SvnU5LOqA12xtRbNSpvvMxZmtpEJdl/8YbakM1jACSvBlavU lhaBaYgBN/aYCM0IiXsyCtQLz9xUHM/IdHQTI/PAubnCdCrYwZNCSN72euldOW2S3oTs StFxFKdYErUgLOsH77WagqkCvWkEc7tk3Jdie9bi2AHkGU1eaxT13A5y7vfOWXkUbprx kpKw== X-Gm-Message-State: AOAM532Zn9VZdCe5XcfTW0VQRRS14y2dP0dXX9sp1+r/XZyF3EH7Hnwf qG3isS8xAXlxEn0tH/4Dxr9D37JmPSI= X-Google-Smtp-Source: ABdhPJwwZwgB/b8QExmS72F8WgheteKfju9kkmw6nImxnqVlZnzmRlLTrIFPA6cXelxQKud3PEiblA== X-Received: by 2002:a17:902:dacd:b0:15c:eedb:f004 with SMTP id q13-20020a170902dacd00b0015ceedbf004mr24580421plx.94.1651127138814; Wed, 27 Apr 2022 23:25:38 -0700 (PDT) Received: from dingbat (220-235-29-41.dyn.iinet.net.au. [220.235.29.41]) by smtp.gmail.com with ESMTPSA id p10-20020a62b80a000000b0050d6ef96407sm5207217pfe.95.2022.04.27.23.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 23:25:38 -0700 (PDT) References: <87czh1g4cn.fsf@ericabrahamsen.net> User-agent: mu4e 1.7.13; emacs 28.1.50 From: Tim Cross To: Eric Abrahamsen Subject: Re: Bug in orgalist mode's advice on indent-according-to-mode Date: Thu, 28 Apr 2022 16:06:11 +1000 In-reply-to: <87czh1g4cn.fsf@ericabrahamsen.net> Message-ID: <87sfpxohb5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Cc: emacs-orgmode@gnu.org 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=1651127321; 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=6FVrevtVM6NhfLtGGNLnlo0qNaAEAocoQn1InPmlZ7g=; b=M1Ty/UzNfNa0kRdNdNggKO6vIazyFlf0kXvWfe/7Mkfq1VVqNcP3YpN/9+nxCJtk4zyTxW 5ms5HCJarPpznfy0dmZuZ0hvCoF7pQQTCdECXhWawjthVx0xoCP/jM6MuDlfP3QA92kzZ9 7sJyGMObmjxxnaxKeUng8JVv8/iH/qZ9Gh1z8KioaOSpTLYvTGiC9Je1fJH7V41apG2THk /+oEsSDvH4Jz6KrquKq2mivJo+qAK5am0H47b8lXBuFHNdmS3PPSQrb1pSbBWeLYa7dgCK BesoR8X3mgrhvpNroRotfR76mT0caTm6Rc4dJ5Yxo1EzW5XQ0iyDNrDK+EBwvA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651127321; a=rsa-sha256; cv=none; b=KFyifqxf9QJCkzpUNOH/MKtSHqpU/ZEpyau0jIoPsTasG4Z1GvixnEGARrIVrVww6TyPnc axqYzNdLfzn5sUTq43byJsMTl1b3wmi35JlnpPGYn1nkV8u8SyGZtQd7WXzMD6441n+axI ihoih2mXgx7sukmjKD+5OiMIdTIreJTrS3VnTnlvrrC/osHH7BwyPYymtV7L7aLzYQQTOp R+Xda7o+Dj/vNFn90G9c7KEJjXDrnmyXB9N9CjmMH3B4WBa9q+s8y7iYaUKe1n4elz+4bG K2bHOajCrf0yNGc+zmeXNBv8Ib7R3ja6vIhdI6QuHz0dF5FuCo6rNSepnr6UNQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z6TJcoo7; dmarc=pass (policy=none) header.from=gmail.com; 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: -5.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z6TJcoo7; dmarc=pass (policy=none) header.from=gmail.com; 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: 793C32F6B1 X-Spam-Score: -5.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: Umeyj15o1CIj 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.