help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proper use of add-function


From: Eric Abrahamsen
Subject: proper use of add-function
Date: Tue, 22 May 2018 15:58:36 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

And another very basic question:

I can't get `add-function' to do its thing. I want to add a :filter-args
function to #'canonically-space-region, and because this is a minor
mode, I want it set locally. I've tried everything I can think of, but
either get no results (my advice function isn't called) or an error
saying that it wants a symbol, but I gave it a lambda. If I give it a
symbol, nothing happens.

(add-function
   :filter-args
   (local 'canonically-space-region)
   #'my-canonical-space-region)

(defun my-canonical-space-region (bounds)
  ;; etc
  (list (car bounds) (nth 1 bounds)))

What's wrong with this?

Thanks,
Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]