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

filtering columns function modification



This message is from Peter Rayner - Greg


First apologies for sending this via the list-owner, I'm on an
extended work trip but didn't bother to change my address hence can't
send.  

I've just started filtering columns using the function
emacspeak-speak-line-apply-column-filter 
and  discovered I want something slightly different than it produces.  
At the moment I can't find  a way to silence text from a given
position to the end of the line.   My best bet was to set one of the
pairs of positions to be (n 100000) or some other large number.
However as this function stands this won't work.  I changed it locally
to do this, although I'm having trouble propagating the defsubst
through all the places which use it.  

The old and new versions are below.  Is there another way to do what I
want?  If not, is this a worthwhile change or would most people (Raman
particularly) prefer the current functionality?  

--------------------old version--------------------
(defsubst emacspeak-speak-line-apply-column-filter (line)
  (declare (special emacspeak-speak-line-column-filter))
  (let ((filter emacspeak-speak-line-column-filter)
        (l (1+ (length line)))
        (pair nil))
    (while filter 
      (setq pair (pop filter))
      (when (and (< (first pair) l)
                 (< (second pair) l))
        (put-text-property (first pair)
                           (second pair)
                           'personality 'inaudible
                           line)))
    line))
--------------------new version--------------------
(defsubst emacspeak-speak-line-apply-column-filter (line)
  (declare (special emacspeak-speak-line-column-filter))
  (let ((filter emacspeak-speak-line-column-filter)
        (l (1+ (length line)))
        (pair nil))
    (while filter 
      (setq pair (pop filter))
      (when  (<	 (first pair) l)
	(put-text-property (first pair)
			   (if (< (second pair) l) (second pair) (l))
                           'personality 'inaudible
                           line)))
    line))

-- 

Note that replies to the freesurf address will not work. 
reply to peter.rayner@csiro.au
Paris phone numbers
work: +33 01 6908 71 22; home: +33 01 46 64 83 39 


-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"