Function: mail-extr-nuke-outside-range

mail-extr-nuke-outside-range is a macro defined in mail-extr.el.gz.

Signature

(mail-extr-nuke-outside-range LIST-SYMBOL BEG-SYMBOL END-SYMBOL &optional NO-REPLACE)

Documentation

Delete all elements outside BEG..END in LIST.

LIST-SYMBOL names a variable holding a list of buffer positions BEG-SYMBOL and END-SYMBOL name variables delimiting a range Each element of LIST-SYMBOL which lies outside of the range is
 deleted from the list.
Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL
 which lie outside of the range, one character at that position is
 replaced with a SPC.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/mail-extr.el.gz
(defmacro mail-extr-nuke-outside-range (list-symbol
					beg-symbol end-symbol
					&optional no-replace)
  "Delete all elements outside BEG..END in LIST.
LIST-SYMBOL names a variable holding a list of buffer positions
BEG-SYMBOL and END-SYMBOL name variables delimiting a range
Each element of LIST-SYMBOL which lies outside of the range is
 deleted from the list.
Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL
 which lie outside of the range, one character at that position is
 replaced with a SPC."
  (or (memq no-replace '(t nil))
      (error "`no-replace' must be t or nil, evaluable at macroexpand-time"))
  `(let ((temp ,list-symbol)
	   ch)
       (while temp
	 (setq ch (car temp))
	 (when (or (> ch ,end-symbol)
		   (< ch ,beg-symbol))
	   ,@(if no-replace
		   nil
	       '((mail-extr-nuke-char-at ch)))
	   (setcar temp nil))
	 (setq temp (cdr temp)))
       (setq ,list-symbol (delq nil ,list-symbol))))