[Top][All Lists]

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

Re: require-hard-newlines to use newline

From: Chong Yidong
Subject: Re: require-hard-newlines to use newline
Date: Fri, 11 Mar 2005 21:40:51 -0500 (EST)
User-agent: SquirrelMail/1.4.3a

>> Sorry, I'm probably missing something, but I don't understand how this
>> would work.
> Simple: it wouldn't use run-hook* (or maybe it would introduce a new
> run-hook-filter).

Not using a hook seems to be simpler than writing a new run-hook-filter
function.  How about the following?  It seems to be a bit overengineered,
but that's the only way to meet the various objections.

(defvar kill-filters nil
  "List of functions for converting a string before it is killed.
These are called by `kill-region' and `copy-region-as-kill' to
convert a buffer substring before putting it into the kill ring
and passing it to `interprogram-cut-function'.

Each function must accept three arguments: STRING, BEG, and END.
STRING is the string to be converted, and BEG and END are the
position arguments given to `kill-region' or
`copy-region-as-kill'.  Each function must return a string.

The buffer substring between BEG and END is passed as STRING to
the first function in the list, and the return value of each
function is passed as STRING to the next.  The final return value
is used as the killed string.

If this variable is nil, no filtering is performed.")

reply via email to

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