diff options
| -rw-r--r-- | lisp/register.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/register.el b/lisp/register.el index d149dee200e..ad65d4b7401 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -233,9 +233,18 @@ The Lisp value REGISTER is a character." | |||
| 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)))))) |