Mercurial > emacs
comparison lisp/facemenu.el @ 14901:64c1d20f4b5f
(list-text-properties-at): Display category's properties.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 28 Mar 1996 04:40:34 +0000 |
parents | 6dfd1f4fa87c |
children | 91b8056dcd35 |
comparison
equal
deleted
inserted
replaced
14900:a51ddd17cdc4 | 14901:64c1d20f4b5f |
---|---|
406 ;;;###autoload | 406 ;;;###autoload |
407 (defun list-text-properties-at (p) | 407 (defun list-text-properties-at (p) |
408 "Pop up a buffer listing text-properties at LOCATION." | 408 "Pop up a buffer listing text-properties at LOCATION." |
409 (interactive "d") | 409 (interactive "d") |
410 (let ((props (text-properties-at p)) | 410 (let ((props (text-properties-at p)) |
411 category | |
411 str) | 412 str) |
412 (if (null props) | 413 (if (null props) |
413 (message "None") | 414 (message "None") |
414 (if (and (not (cdr (cdr props))) | 415 (if (and (not (cdr (cdr props))) |
416 (not (eq (car props) 'category)) | |
415 (< (length (setq str (format "Text property at %d: %s %S" | 417 (< (length (setq str (format "Text property at %d: %s %S" |
416 p (car props) (car (cdr props))))) | 418 p (car props) (car (cdr props))))) |
417 (frame-width))) | 419 (frame-width))) |
418 (message "%s" str) | 420 (message "%s" str) |
419 (with-output-to-temp-buffer "*Text Properties*" | 421 (with-output-to-temp-buffer "*Text Properties*" |
420 (princ (format "Text properties at %d:\n\n" p)) | 422 (princ (format "Text properties at %d:\n\n" p)) |
421 (while props | 423 (while props |
424 (if (eq (car props) 'category) | |
425 (setq category (car (cdr props)))) | |
422 (princ (format "%-20s %S\n" | 426 (princ (format "%-20s %S\n" |
423 (car props) (car (cdr props)))) | 427 (car props) (car (cdr props)))) |
424 (setq props (cdr (cdr props))))))))) | 428 (setq props (cdr (cdr props)))) |
429 (if category | |
430 (progn | |
431 (setq props (symbol-plist category)) | |
432 (princ (format "\nCategory %s:\n\n" category)) | |
433 (while props | |
434 (princ (format "%-20s %S\n" | |
435 (car props) (car (cdr props)))) | |
436 (if (eq (car props) 'category) | |
437 (setq category (car (cdr props)))) | |
438 (setq props (cdr (cdr props))))))))))) | |
425 | 439 |
426 ;;;###autoload | 440 ;;;###autoload |
427 (defun facemenu-read-color (&optional prompt) | 441 (defun facemenu-read-color (&optional prompt) |
428 "Read a color using the minibuffer." | 442 "Read a color using the minibuffer." |
429 (let ((col (completing-read (or prompt "Color: ") | 443 (let ((col (completing-read (or prompt "Color: ") |