Here is a little mode I use under GNU Emacs to debug which text
properties are present at a given point in a buffer. It pops up a
separate frame to show the properties, and updates itself automatically.
;;; view-tp.el --- view text properties under point in a separate frame
;; Copyright (C) 2004,2005 Free Software Foundation, Inc.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; Simple minor mode to look at text properties under point; useful
;; for debugging packages which use text properties/overlays. To use,
;; put in your load path, (require 'view-tp), and issue M-x
;; view-tp-mode RET to toggle on or off.
(defvar view-tp-mode-timer nil)
(defvar view-tp-mode-buffer-name "*view-tp*")
;; (setq special-display-buffer-names nil)
`(,view-tp-mode-buffer-name (width . 34) (font . "fixed")))
"Minor mode to view attributes about char at point in a separate frame."
:lighter " Viewtp" :global t
(display-buffer (get-buffer-create view-tp-mode-buffer-name))
(set-buffer (get-buffer-create view-tp-mode-buffer-name))
(setq truncate-lines t)
(run-with-idle-timer 0.05 t 'view-tp-update)))
(defun view-tp-update ()
(let ((txt nil)
(b (get-buffer-create view-tp-mode-buffer-name))
(when (not (eq currb b))
(setq buffer-read-only nil)
(setq pt (point))
(insert (format "Point: %d\n" pt))
(describe-text-properties (point) b)
(setq buffer-read-only t))))
Gnu-emacs-sources mailing list
[hidden email] http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources