emacs-devel
[Top][All Lists]
Advanced

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

Re: require-hard-newlines to use newline


From: Kim F. Storm
Subject: Re: require-hard-newlines to use newline
Date: Fri, 11 Mar 2005 23:29:24 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Chong Yidong" <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

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