>> 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.
>
> Fair enough.

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... Unless it's
something like

  [in kill-region]:
  (let ((string (delete-and-extract-region beg end)))
    (run-hook-with-args 'before-kill-functions beg end #'string)
    ...

Then the hook function would have to set the string by

  (defun foo-function (symbol)
    (set symbol "replacement string"))

But that would be ridiculously arcane.



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

Reply via email to