diff options
| -rw-r--r-- | lisp/mouse.el | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 924bc71d837..9c9bc4921b6 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -82,9 +82,28 @@ Display cursor at that position for a second." | |||
| 82 | (unwind-protect | 82 | (unwind-protect |
| 83 | (progn (mouse-set-point event) | 83 | (progn (mouse-set-point event) |
| 84 | (push-mark nil t) | 84 | (push-mark nil t) |
| 85 | (sleep-for 1)) | 85 | (sit-for 1)) |
| 86 | (goto-char point-save)))) | 86 | (goto-char point-save)))) |
| 87 | 87 | ||
| 88 | (defun mouse-fill-paragraph (event) | ||
| 89 | "Fill the paragraph at the mouse position." | ||
| 90 | (interactive "@e") | ||
| 91 | (save-excursion | ||
| 92 | (mouse-set-point event) | ||
| 93 | (fill-paragraph))) | ||
| 94 | |||
| 95 | (defun mouse-fill-paragraph-with-prefix (event) | ||
| 96 | "Fill the paragraph at the mouse position with specified fill prefix. | ||
| 97 | Click at the end of the fill prefix that you want; | ||
| 98 | The text before the mouse position, on the same line, is used as the prefix." | ||
| 99 | (interactive "@e") | ||
| 100 | (save-excursion | ||
| 101 | (mouse-set-point event) | ||
| 102 | (let ((fill-prefix (buffer-substring (save-excursion (beginning-of-line) | ||
| 103 | (point)) | ||
| 104 | (point)))) | ||
| 105 | (fill-paragraph)))) | ||
| 106 | |||
| 88 | (defun mouse-scroll (event) | 107 | (defun mouse-scroll (event) |
| 89 | "Scroll point to the mouse position." | 108 | "Scroll point to the mouse position." |
| 90 | (interactive "@e") | 109 | (interactive "@e") |