* lisp/mouse.el (mouse-on-link-p): Undo scroll-bar fix.
Fixes: debbugs:13979
+2013-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (posn-point, posn-string): Fix it here instead (bug#13979).
+ * mouse.el (mouse-on-link-p): Undo scroll-bar fix.
+
2013-03-20 Paul Eggert <eggert@cs.ucla.edu>
Suppress unnecessary non-ASCII chatter during build process.
* whitespace.el (whitespace-font-lock, whitespace-font-lock-mode):
Remove vars.
- (whitespace-color-on, whitespace-color-off): Use
- `font-lock-fontify-buffer' (Bug#13817).
+ (whitespace-color-on, whitespace-color-off):
+ Use `font-lock-fontify-buffer' (Bug#13817).
2013-03-19 Stefan Monnier <monnier@iro.umontreal.ca>
buffer's first char. Use `with-selected-window' instead of
`save-window-excursion' with `select-window'.
(doc-view-document->bitmap): Check the current doc-view overlay's
- display property instead the char property of the buffer's first
- char.
+ display property instead the char property of the buffer's first char.
2013-03-18 Paul Eggert <eggert@cs.ucla.edu>
- Otherwise, the mouse-1 event is translated into a mouse-2 event
at the same position."
(let ((action
- (and (not (memq 'vertical-scroll-bar pos))
- (or (not (consp pos))
+ (and (or (not (consp pos))
mouse-1-click-in-non-selected-windows
(eq (selected-window) (posn-window pos)))
(or (mouse-posn-property pos 'follow-link)
(nth 1 position))))
(and (symbolp area) area)))
-(defsubst posn-point (position)
+(defun posn-point (position)
"Return the buffer location in POSITION.
POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions.
+Returns nil if POSITION does not correspond to any buffer location (e.g.
+a click on a scroll bar)."
(or (nth 5 position)
- (if (consp (nth 1 position))
- (car (nth 1 position))
- (nth 1 position))))
+ (let ((pt (nth 1 position)))
+ (or (car-safe pt)
+ ;; Apparently this can also be `vertical-scroll-bar' (bug#13979).
+ (if (integerp pt) pt)))))
(defun posn-set-point (position)
"Move point to POSITION.
and `event-end' functions."
(nth 3 position))
-(defsubst posn-string (position)
+(defun posn-string (position)
"Return the string object of POSITION.
Value is a cons (STRING . STRING-POS), or nil if not a string.
POSITION should be a list of the form returned by the `event-start'
and `event-end' functions."
- (nth 4 position))
+ (let ((x (nth 4 position)))
+ ;; Apparently this can also be `handle' or `below-handle' (bug#13979).
+ (when (consp x) x)))
(defsubst posn-image (position)
"Return the image object of POSITION.