diff options
| author | Stefan Monnier | 2013-03-20 14:13:00 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-03-20 14:13:00 -0400 |
| commit | 9a1ff1644d34aba9de29c0afa9cdf6f798226efc (patch) | |
| tree | cb1457a06803d7aa29d7973ec75d2c26e422c4ca | |
| parent | 5f24fa51a07664e81d4c710fe310d2c2fbea8bb5 (diff) | |
| download | emacs-9a1ff1644d34aba9de29c0afa9cdf6f798226efc.tar.gz emacs-9a1ff1644d34aba9de29c0afa9cdf6f798226efc.zip | |
* 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
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/mouse.el | 3 | ||||
| -rw-r--r-- | lisp/subr.el | 19 |
3 files changed, 21 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 392cc9ac2fa..908d10494ff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-03-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * subr.el (posn-point, posn-string): Fix it here instead (bug#13979). | ||
| 4 | * mouse.el (mouse-on-link-p): Undo scroll-bar fix. | ||
| 5 | |||
| 1 | 2013-03-20 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2013-03-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Suppress unnecessary non-ASCII chatter during build process. | 8 | Suppress unnecessary non-ASCII chatter during build process. |
| @@ -15,8 +20,8 @@ | |||
| 15 | 20 | ||
| 16 | * whitespace.el (whitespace-font-lock, whitespace-font-lock-mode): | 21 | * whitespace.el (whitespace-font-lock, whitespace-font-lock-mode): |
| 17 | Remove vars. | 22 | Remove vars. |
| 18 | (whitespace-color-on, whitespace-color-off): Use | 23 | (whitespace-color-on, whitespace-color-off): |
| 19 | `font-lock-fontify-buffer' (Bug#13817). | 24 | Use `font-lock-fontify-buffer' (Bug#13817). |
| 20 | 25 | ||
| 21 | 2013-03-19 Stefan Monnier <monnier@iro.umontreal.ca> | 26 | 2013-03-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 22 | 27 | ||
| @@ -76,8 +81,7 @@ | |||
| 76 | buffer's first char. Use `with-selected-window' instead of | 81 | buffer's first char. Use `with-selected-window' instead of |
| 77 | `save-window-excursion' with `select-window'. | 82 | `save-window-excursion' with `select-window'. |
| 78 | (doc-view-document->bitmap): Check the current doc-view overlay's | 83 | (doc-view-document->bitmap): Check the current doc-view overlay's |
| 79 | display property instead the char property of the buffer's first | 84 | display property instead the char property of the buffer's first char. |
| 80 | char. | ||
| 81 | 85 | ||
| 82 | 2013-03-18 Paul Eggert <eggert@cs.ucla.edu> | 86 | 2013-03-18 Paul Eggert <eggert@cs.ucla.edu> |
| 83 | 87 | ||
diff --git a/lisp/mouse.el b/lisp/mouse.el index 333a1cef703..0367cad87b8 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -759,8 +759,7 @@ click is the local or global binding of that event. | |||
| 759 | - Otherwise, the mouse-1 event is translated into a mouse-2 event | 759 | - Otherwise, the mouse-1 event is translated into a mouse-2 event |
| 760 | at the same position." | 760 | at the same position." |
| 761 | (let ((action | 761 | (let ((action |
| 762 | (and (not (memq 'vertical-scroll-bar pos)) | 762 | (and (or (not (consp pos)) |
| 763 | (or (not (consp pos)) | ||
| 764 | mouse-1-click-in-non-selected-windows | 763 | mouse-1-click-in-non-selected-windows |
| 765 | (eq (selected-window) (posn-window pos))) | 764 | (eq (selected-window) (posn-window pos))) |
| 766 | (or (mouse-posn-property pos 'follow-link) | 765 | (or (mouse-posn-property pos 'follow-link) |
diff --git a/lisp/subr.el b/lisp/subr.el index 9a7b94208fe..4eb46ec2b01 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1044,14 +1044,17 @@ and `event-end' functions." | |||
| 1044 | (nth 1 position)))) | 1044 | (nth 1 position)))) |
| 1045 | (and (symbolp area) area))) | 1045 | (and (symbolp area) area))) |
| 1046 | 1046 | ||
| 1047 | (defsubst posn-point (position) | 1047 | (defun posn-point (position) |
| 1048 | "Return the buffer location in POSITION. | 1048 | "Return the buffer location in POSITION. |
| 1049 | POSITION should be a list of the form returned by the `event-start' | 1049 | POSITION should be a list of the form returned by the `event-start' |
| 1050 | and `event-end' functions." | 1050 | and `event-end' functions. |
| 1051 | Returns nil if POSITION does not correspond to any buffer location (e.g. | ||
| 1052 | a click on a scroll bar)." | ||
| 1051 | (or (nth 5 position) | 1053 | (or (nth 5 position) |
| 1052 | (if (consp (nth 1 position)) | 1054 | (let ((pt (nth 1 position))) |
| 1053 | (car (nth 1 position)) | 1055 | (or (car-safe pt) |
| 1054 | (nth 1 position)))) | 1056 | ;; Apparently this can also be `vertical-scroll-bar' (bug#13979). |
| 1057 | (if (integerp pt) pt))))) | ||
| 1055 | 1058 | ||
| 1056 | (defun posn-set-point (position) | 1059 | (defun posn-set-point (position) |
| 1057 | "Move point to POSITION. | 1060 | "Move point to POSITION. |
| @@ -1124,12 +1127,14 @@ POSITION should be a list of the form returned by the `event-start' | |||
| 1124 | and `event-end' functions." | 1127 | and `event-end' functions." |
| 1125 | (nth 3 position)) | 1128 | (nth 3 position)) |
| 1126 | 1129 | ||
| 1127 | (defsubst posn-string (position) | 1130 | (defun posn-string (position) |
| 1128 | "Return the string object of POSITION. | 1131 | "Return the string object of POSITION. |
| 1129 | Value is a cons (STRING . STRING-POS), or nil if not a string. | 1132 | Value is a cons (STRING . STRING-POS), or nil if not a string. |
| 1130 | POSITION should be a list of the form returned by the `event-start' | 1133 | POSITION should be a list of the form returned by the `event-start' |
| 1131 | and `event-end' functions." | 1134 | and `event-end' functions." |
| 1132 | (nth 4 position)) | 1135 | (let ((x (nth 4 position))) |
| 1136 | ;; Apparently this can also be `handle' or `below-handle' (bug#13979). | ||
| 1137 | (when (consp x) x))) | ||
| 1133 | 1138 | ||
| 1134 | (defsubst posn-image (position) | 1139 | (defsubst posn-image (position) |
| 1135 | "Return the image object of POSITION. | 1140 | "Return the image object of POSITION. |