* lisp/subr.el (posn-point, posn-string): Fix it here instead.

* lisp/mouse.el (mouse-on-link-p): Undo scroll-bar fix.

Fixes: debbugs:13979
This commit is contained in:
Stefan Monnier 2013-03-20 14:13:00 -04:00
parent 5f24fa51a0
commit 9a1ff1644d
3 changed files with 21 additions and 13 deletions

View file

@ -1,3 +1,8 @@
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.
@ -15,8 +20,8 @@
* 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>
@ -76,8 +81,7 @@
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>

View file

@ -759,8 +759,7 @@ click is the local or global binding of that event.
- 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)

View file

@ -1044,14 +1044,17 @@ and `event-end' functions."
(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.
@ -1124,12 +1127,14 @@ POSITION should be a list of the form returned by the `event-start'
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.