emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Q on Text Properties popup menu - shouldn't it use the pointerpositi


From: Drew Adams
Subject: RE: Q on Text Properties popup menu - shouldn't it use the pointerposition, not the cursor position?
Date: Fri, 24 Jun 2005 09:48:42 -0700

    The Describe Properties item runs describe-text-properties,
    which always references (the character after) point, never a
    region. Since it references a single position, to me the best
    position to use is the mouse-pointer position (when run from
    the mouse popup menu). If the mouse pointer does not point to a
    character, then an error message should say "No character here"
    or some such.

To be clearer, this is the kind of behavior I would propose for Text
Properties > Describe Properties:

(defun describe-props-at-mouse (event)
  "Describe text properties of character under the mouse pointer"
  (interactive "e")
  (save-excursion
    (set-buffer (window-buffer (posn-window (event-end event))))
    (goto-char (posn-point (event-end event)))
    (describe-text-properties (point))))

The error you get if you point to something other than a character is this:
"No character follows specified position".





reply via email to

[Prev in Thread] Current Thread [Next in Thread]