Function: gnus-tilde-max-form

gnus-tilde-max-form is a byte-compiled function defined in gnus-spec.el.gz.

Signature

(gnus-tilde-max-form EL MAX-WIDTH)

Documentation

Return a form that limits EL to MAX-WIDTH.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-spec.el.gz
(defun gnus-tilde-max-form (el max-width)
  "Return a form that limits EL to MAX-WIDTH."
  (let ((max (abs max-width)))
    (if (symbolp el)
	`(if (> (string-width ,el) ,max)
	     ,(if (< max-width 0)
		  `(gnus-correct-substring ,el (- (string-width ,el) ,max))
		`(if (gnus-lrm-string-p ,el)
		     (concat (gnus-correct-substring ,el 0 ,max)
			     ,gnus-lrm-string)
		   (gnus-correct-substring ,el 0 ,max)))
	   ,el)
      `(let ((val (eval ,el)))
	 (if (> (string-width val) ,max)
	     ,(if (< max-width 0)
		  `(gnus-correct-substring val (- (string-width val) ,max))
		`(if (gnus-lrm-string-p val)
		     (concat (gnus-correct-substring val 0 ,max)
			     ,gnus-lrm-string)
		   (gnus-correct-substring val 0 ,max)))
	   val)))))