comparison lisp/register.el @ 48715:1e0c7ad65f05

(describe-register-1): Use window-width to truncate string in a register. Check whether the string in a register is an empty string or a sequence of white spaces.
author Richard M. Stallman <rms@gnu.org>
date Sat, 07 Dec 2002 21:29:35 +0000
parents c623c9adbefe
children e88404e8f2cf
comparison
equal deleted inserted replaced
48714:59758725d2cf 48715:1e0c7ad65f05
231 yank-excluded-properties val) 231 yank-excluded-properties val)
232 (if verbose 232 (if verbose
233 (progn 233 (progn
234 (princ "the text:\n") 234 (princ "the text:\n")
235 (princ val)) 235 (princ val))
236 (princ "text starting with\n ") 236 (cond
237 (string-match "[^ \t\n].\\{,20\\}" val) 237 ;; Extract first N characters starting with first non-whitespace.
238 (princ (match-string 0 val)))) 238 ((string-match (format "[^ \t\n].\\{,%d\\}"
239 ;; Deduct 6 for the spaces inserted below.
240 (min 20 (max 0 (- (window-width) 6))))
241 val)
242 (princ "text starting with\n ")
243 (princ (match-string 0 val)))
244 ((string-match "^[ \t\n]+$" val)
245 (princ "whitespace"))
246 (t
247 (princ "the empty string")))))
239 (t 248 (t
240 (princ "Garbage:\n") 249 (princ "Garbage:\n")
241 (if verbose (prin1 val)))))) 250 (if verbose (prin1 val))))))
242 251
243 (defun insert-register (register &optional arg) 252 (defun insert-register (register &optional arg)