[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: confusing info in C-u C-x =
From: |
martin rudalics |
Subject: |
Re: confusing info in C-u C-x = |
Date: |
Mon, 21 Nov 2005 09:56:45 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
You could try the following patch:
*** descr-text.el Sat Nov 5 20:44:24 2005
--- descr-text.el Mon Nov 21 08:50:36 2005
***************
*** 144,160 ****
(goto-char (point-min)))))
;;;###autoload
! (defun describe-text-properties (pos &optional output-buffer)
"Describe widgets, buttons, overlays and text properties at POS.
Interactively, describe them for the character after point.
If optional second argument OUTPUT-BUFFER is non-nil,
insert the output into that buffer, and don't initialize or clear it
! otherwise."
(interactive "d")
(if (>= pos (point-max))
(error "No character follows specified position"))
(if output-buffer
! (describe-text-properties-1 pos output-buffer)
(if (not (or (text-properties-at pos) (overlays-at pos)))
(message "This is plain text.")
(let ((buffer (current-buffer))
--- 144,162 ----
(goto-char (point-min)))))
;;;###autoload
! (defun describe-text-properties (pos &optional output-buffer overlay-bounds)
"Describe widgets, buttons, overlays and text properties at POS.
Interactively, describe them for the character after point.
If optional second argument OUTPUT-BUFFER is non-nil,
insert the output into that buffer, and don't initialize or clear it
! otherwise.
! Optional third argument OVERLAY-BOUNDS is a list of start and end
! positions of overlays as produced by `describe-char'."
(interactive "d")
(if (>= pos (point-max))
(error "No character follows specified position"))
(if output-buffer
! (describe-text-properties-1 pos output-buffer overlay-bounds)
(if (not (or (text-properties-at pos) (overlays-at pos)))
(message "This is plain text.")
(let ((buffer (current-buffer))
***************
*** 171,177 ****
(describe-text-mode)
(goto-char (point-min))))))))
! (defun describe-text-properties-1 (pos output-buffer)
(let* ((properties (text-properties-at pos))
(overlays (overlays-at pos))
(wid-field (get-char-property pos 'field))
--- 173,179 ----
(describe-text-mode)
(goto-char (point-min))))))))
! (defun describe-text-properties-1 (pos output-buffer &optional overlay-bounds)
(let* ((properties (text-properties-at pos))
(overlays (overlays-at pos))
(wid-field (get-char-property pos 'field))
***************
*** 205,212 ****
(widget-insert "There are " (format "%d" (length overlays))
" overlays here:\n"))
(dolist (overlay overlays)
! (widget-insert " From " (format "%d" (overlay-start overlay))
! " to " (format "%d" (overlay-end overlay)) "\n")
(describe-property-list (overlay-properties overlay)))
(widget-insert "\n"))
;; Text properties
--- 207,222 ----
(widget-insert "There are " (format "%d" (length overlays))
" overlays here:\n"))
(dolist (overlay overlays)
! (if overlay-bounds
! (progn
! ;; OVERLAY-BOUNDS must be a list of the bounds of all overlays
! ;; at some "original" position. The overlays at POS are one
! ;; character wide replicas of the overlays at that position.
! (widget-insert " From " (format "%d" (caar overlay-bounds))
! " to " (format "%d" (cdar overlay-bounds))
"\n")
! (setq overlay-bounds (cdr overlay-bounds)))
! (widget-insert " From " (format "%d" (overlay-start overlay))
! " to " (format "%d" (overlay-end overlay)) "\n"))
(describe-property-list (overlay-properties overlay)))
(widget-insert "\n"))
;; Text properties
***************
*** 458,463 ****
--- 468,476 ----
(multibyte-p enable-multibyte-characters)
(overlays (mapcar #'(lambda (o) (overlay-properties o))
(overlays-at pos)))
+ (overlay-bounds ; Make list of start and end positions of overlays
+ (mapcar #'(lambda (o) (cons (overlay-start o) (overlay-end o)))
+ (nreverse (overlays-at pos))))
item-list max-width unicode)
(if (or (< char 256)
***************
*** 718,724 ****
(insert "\nSee the variable `reference-point-alist' for "
"the meaning of the rule.\n"))
! (describe-text-properties pos (current-buffer))
(describe-text-mode)))))
(defalias 'describe-char-after 'describe-char)
--- 731,737 ----
(insert "\nSee the variable `reference-point-alist' for "
"the meaning of the rule.\n"))
! (describe-text-properties pos (current-buffer) overlay-bounds)
(describe-text-mode)))))
(defalias 'describe-char-after 'describe-char)