comparison lisp/facemenu.el @ 11081:b651fb9a8216

(list-text-properties-at): New fn. (facemenu-menu): Add it to menu.
author Boris Goldowsky <boris@gnu.org>
date Tue, 21 Mar 1995 21:47:23 +0000
parents 48bfa8e29f36
children c968d4c026b7
comparison
equal deleted inserted replaced
11080:c18a37a30781 11081:b651fb9a8216
185 185
186 (defvar facemenu-menu 186 (defvar facemenu-menu
187 (let ((map (make-sparse-keymap "Face"))) 187 (let ((map (make-sparse-keymap "Face")))
188 (define-key map [dc] (cons "Display Colors" 'list-colors-display)) 188 (define-key map [dc] (cons "Display Colors" 'list-colors-display))
189 (define-key map [df] (cons "Display Faces" 'list-faces-display)) 189 (define-key map [df] (cons "Display Faces" 'list-faces-display))
190 (define-key map [rm] (cons "Remove Props" 'facemenu-remove-all)) 190 (define-key map [dp] (cons "List Properties" 'list-text-properties-at))
191 (define-key map [rm] (cons "Remove Properties" 'facemenu-remove-all))
191 (define-key map [s1] (list "-----------------")) 192 (define-key map [s1] (list "-----------------"))
192 (define-key map [in] (cons "Indentation" 'facemenu-indentation-menu)) 193 (define-key map [in] (cons "Indentation" 'facemenu-indentation-menu))
193 (define-key map [ju] (cons "Justification" 'facemenu-justification-menu)) 194 (define-key map [ju] (cons "Justification" 'facemenu-justification-menu))
194 (define-key map [s2] (list "-----------------")) 195 (define-key map [s2] (list "-----------------"))
195 (define-key map [sp] (cons "Special Props" 'facemenu-special-menu)) 196 (define-key map [sp] (cons "Special Props" 'facemenu-special-menu))
333 (interactive "*r") ; error if buffer is read-only despite the next line. 334 (interactive "*r") ; error if buffer is read-only despite the next line.
334 (let ((inhibit-read-only t)) 335 (let ((inhibit-read-only t))
335 (remove-text-properties 336 (remove-text-properties
336 start end '(face nil invisible nil intangible nil 337 start end '(face nil invisible nil intangible nil
337 read-only nil category nil)))) 338 read-only nil category nil))))
339
340 ;;;###autoload
341 (defun list-text-properties-at (p)
342 "Pop up a buffer listing text-properties at LOCATION."
343 (interactive "d")
344 (let ((props (text-properties-at p)))
345 (if (null props)
346 (message "None")
347 (with-output-to-temp-buffer "*Text Properties*"
348 (princ (format "Text properties at %d:\n\n" p))
349 (while props
350 (princ (format "%-20s %S\n"
351 (car props) (car (cdr props))))
352 (setq props (cdr (cdr props))))))))
338 353
339 ;;;###autoload 354 ;;;###autoload
340 (defun facemenu-read-color (prompt) 355 (defun facemenu-read-color (prompt)
341 "Read a color using the minibuffer." 356 "Read a color using the minibuffer."
342 (let ((col (completing-read (or "Color: ") 357 (let ((col (completing-read (or "Color: ")