"Chong Yidong" <[EMAIL PROTECTED]> writes:

>>> I like the idea, but returning a value from a hook is rather
>>> inconvenient -- if there are multiple functions on the hook, which
>>> value should you use eventually?
>>
>>> Perhaps before-kill-functions should get START, END and STRING
>>> as arguments where STRING is the result of buffer-substring.
>>
>>> Each hook could then modify that string as they please.
>
> Sorry, I'm probably missing something, but I don't understand how this
> would work. Since each function would only be modifying their own local
> STRING variable, not the one that will actually be killed... 

It doesn't have to modify the variable `string', but its string value, e.g.

(defun x (s)
  (aset s 1 ?-))
(let ((s "abc"))
  (x s)
  s)
=> "a-c"

-- 
Kim F. Storm <[EMAIL PROTECTED]> http://www.cua.dk



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to