diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/button.el | 10 | ||||
| -rw-r--r-- | lisp/wid-edit.el | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lisp/button.el b/lisp/button.el index c46f3d9a52b..921e84dfa68 100644 --- a/lisp/button.el +++ b/lisp/button.el | |||
| @@ -382,10 +382,12 @@ Also see `make-text-button'." | |||
| 382 | If the button at POS is a text property button, the return value | 382 | If the button at POS is a text property button, the return value |
| 383 | is a marker pointing to POS." | 383 | is a marker pointing to POS." |
| 384 | (let ((button (get-char-property pos 'button))) | 384 | (let ((button (get-char-property pos 'button))) |
| 385 | (if (or (overlayp button) (null button)) | 385 | (and button (get-char-property pos 'category) |
| 386 | button | 386 | (if (overlayp button) |
| 387 | ;; Must be a text-property button; return a marker pointing to it. | 387 | button |
| 388 | (copy-marker pos t)))) | 388 | ;; Must be a text-property button; |
| 389 | ;; return a marker pointing to it. | ||
| 390 | (copy-marker pos t))))) | ||
| 389 | 391 | ||
| 390 | (defun next-button (pos &optional count-current) | 392 | (defun next-button (pos &optional count-current) |
| 391 | "Return the next button after position POS in the current buffer. | 393 | "Return the next button after position POS in the current buffer. |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 52c0b5b74d2..b9f98cdc4c7 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -1163,8 +1163,9 @@ When not inside a field, signal an error." | |||
| 1163 | 1163 | ||
| 1164 | (defun widget-at (&optional pos) | 1164 | (defun widget-at (&optional pos) |
| 1165 | "The button or field at POS (default, point)." | 1165 | "The button or field at POS (default, point)." |
| 1166 | (or (get-char-property (or pos (point)) 'button) | 1166 | (let ((widget (or (get-char-property (or pos (point)) 'button) |
| 1167 | (widget-field-at pos))) | 1167 | (widget-field-at pos)))) |
| 1168 | (and (widgetp widget) widget))) | ||
| 1168 | 1169 | ||
| 1169 | ;;;###autoload | 1170 | ;;;###autoload |
| 1170 | (defun widget-setup () | 1171 | (defun widget-setup () |