From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.help Subject: Re: proper use of add-function Date: Tue, 22 May 2018 19:18:09 -0400 Message-ID: References: <87efi3xppf.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527031006 9683 195.159.176.226 (22 May 2018 23:16:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 May 2018 23:16:46 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 23 01:16:42 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLGWG-0002Ph-Sj for geh-help-gnu-emacs@m.gmane.org; Wed, 23 May 2018 01:16:41 +0200 Original-Received: from localhost ([::1]:58360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLGYN-00072H-Iq for geh-help-gnu-emacs@m.gmane.org; Tue, 22 May 2018 19:18:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLGXj-00071z-WF for help-gnu-emacs@gnu.org; Tue, 22 May 2018 19:18:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLGXj-00074I-3S for help-gnu-emacs@gnu.org; Tue, 22 May 2018 19:18:11 -0400 Original-Received: from mail-ot0-x22f.google.com ([2607:f8b0:4003:c0f::22f]:40368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLGXi-00074A-UG for help-gnu-emacs@gnu.org; Tue, 22 May 2018 19:18:11 -0400 Original-Received: by mail-ot0-x22f.google.com with SMTP id n1-v6so23012517otf.7 for ; Tue, 22 May 2018 16:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZQdPIAOT9fp4kmYwMqc566wtlCVEyqrEdjlsnYoriIg=; b=mfoWNyMXwe4oaEp5lU0ssh7r29+ueB0UkZ8OrsZWvldbQ0ySbrQNTknxOWyspYgx98 Y72iRhwQiyfBK2f7PFme7QdEwLTpgaeawymMfRJ8icKJMZJ79ewAb8CzXZSk6EpanWKc TgKoxPuxpYPnUjf83yuYicLp+PUfyoUOGEIC/g5pIs9WQg989y3IS77nbanNiP4feJOS blzd7wEYyW+7L1GXScX6Rt8HcoJADfFBaxWv0aPohBc+dZHt6xPhaqhnmEGbGGjJf5Et xYhS+iOYBUuAs9x9VZhNkzEe7xmWYNOlnR7n6rQIzi5CCqFeATKomJqjzLwboFX1XCcl AKvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZQdPIAOT9fp4kmYwMqc566wtlCVEyqrEdjlsnYoriIg=; b=GAoq+wCOh15vJ4RTWXBvq8e64OaDGRmrhoFxOmHSRxbC1JySVip+YKFRqBFh0t7t78 i7s44+LcJGehq/MYN6vc1Vjihks9D9px2B8X95StVbl0uQELvq9/N9Fuij3LK6kXGsFn a5bcLQVzakh+2UfGmXiwgGdL+ieEs9n5SCF66lqpZZ3a7ONCqsCZ/vvaLs0IhxceVFIx /8D1U0WFU68x7luBColw2GL1R3KwWGFC4RvVS9AW5/blg2uSGnMBtdMDF9P5I/UNgbLk FMWYCdOfuW3n+VPbkYToBpS2Yjt5JIpPiKx7+2xSOq5tN6T4qwp3IOCsFPLFbZqOfezL H4+Q== X-Gm-Message-State: ALKqPwe3fmMxpRr0jM+xAxgViITEyRLqUWhnjduACvok3alPlLhJ0sRl llKkRLWvS5lC5soaDinlO2FiyeOx8BltNVKaKfk= X-Google-Smtp-Source: AB8JxZo8VvHFi1TuYcyAGbrTbmDaYdr8I/ZgHkly99VZd04jfRVNyESY+CF1WFT0EkeQXBNSiY4l+Plwqi3P7DEVjFs= X-Received: by 2002:a9d:4b8f:: with SMTP id k15-v6mr323577otf.248.1527031090280; Tue, 22 May 2018 16:18:10 -0700 (PDT) Original-Received: by 2002:a4a:587:0:0:0:0:0 with HTTP; Tue, 22 May 2018 16:18:09 -0700 (PDT) In-Reply-To: <87efi3xppf.fsf@ericabrahamsen.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::22f 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:116823 Archived-At: On 22 May 2018 at 18:58, Eric Abrahamsen wrote: > (add-function > :filter-args > (local 'canonically-space-region) > #'my-canonical-space-region) You're adding to the function value in the (non-existent) buffer-local variable `canonically-space-region' canonically-space-region=E2=80=99s value is #f(advice-wrapper :filter-args #f(compiled-function (&rest args) #) my-canonical-space-region) Local in buffer *scratch*; globally void You probably want advice-add instead: (advice-add 'canonically-space-region :filter-args #'my-canonical-space-region) Note: this affects canonically-space-region globally, so you have to change the implementation of my-canonical-space-region so that it's a nop except when operating in the relevant buffers.