diff options
| author | John Paul Wallington | 2002-10-26 22:40:40 +0000 |
|---|---|---|
| committer | John Paul Wallington | 2002-10-26 22:40:40 +0000 |
| commit | 15693bc3acb9e46f217401488b96b87f7e96fdb3 (patch) | |
| tree | 52d4dd6f14add773656015fde08c103a4090472c /lisp | |
| parent | 4f01718584e0f704ee6129547f700af3f56efa7d (diff) | |
| download | emacs-15693bc3acb9e46f217401488b96b87f7e96fdb3.tar.gz emacs-15693bc3acb9e46f217401488b96b87f7e96fdb3.zip | |
* textmodes/picture.el (picture-mouse-set-point): New command.
(picture-mode-map): Bind it.
(picture-motion-reverse): Doc fix.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/textmodes/picture.el | 17 |
2 files changed, 21 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 84368bbfc02..26a05c06a61 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,6 +3,12 @@ | |||
| 3 | * pcvs.el (cvs-checkout): Use read-directory-name. | 3 | * pcvs.el (cvs-checkout): Use read-directory-name. |
| 4 | (cvs-query-directory): Likewise. | 4 | (cvs-query-directory): Likewise. |
| 5 | 5 | ||
| 6 | 2002-10-26 John Paul Wallington <jpw@shootybangbang.com> | ||
| 7 | |||
| 8 | * textmodes/picture.el (picture-mouse-set-point): New command. | ||
| 9 | (picture-mode-map): Bind it. | ||
| 10 | (picture-motion-reverse): Doc fix. | ||
| 11 | |||
| 6 | 2002-10-25 Stefan Monnier <monnier@cs.yale.edu> | 12 | 2002-10-25 Stefan Monnier <monnier@cs.yale.edu> |
| 7 | 13 | ||
| 8 | * textmodes/outline.el (outline-next-heading): Make sure the match-data | 14 | * textmodes/outline.el (outline-next-heading): Make sure the match-data |
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index e3a5a89f079..031341e75e0 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model | 1 | ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1994 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1994, 2002 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: K. Shane Hartman | 5 | ;; Author: K. Shane Hartman |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -222,10 +222,22 @@ Do \\[command-apropos] picture-movement to see commands which control motion." | |||
| 222 | "Move point in direction opposite of current picture motion in Picture mode. | 222 | "Move point in direction opposite of current picture motion in Picture mode. |
| 223 | With ARG do it that many times. Useful for delineating rectangles in | 223 | With ARG do it that many times. Useful for delineating rectangles in |
| 224 | conjunction with diagonal picture motion. | 224 | conjunction with diagonal picture motion. |
| 225 | Do \\[command-apropos] `picture-movement' to see commands which control motion." | 225 | Do \\[command-apropos] picture-movement to see commands which control motion." |
| 226 | (interactive "p") | 226 | (interactive "p") |
| 227 | (picture-motion (- arg))) | 227 | (picture-motion (- arg))) |
| 228 | 228 | ||
| 229 | (defun picture-mouse-set-point (event) | ||
| 230 | "Move point to the position clicked on, making whitespace if necessary." | ||
| 231 | (interactive "e") | ||
| 232 | (let* ((pos (posn-col-row (event-start event))) | ||
| 233 | (x (car pos)) | ||
| 234 | (y (cdr pos)) | ||
| 235 | (current-row (count-lines (window-start) (line-beginning-position)))) | ||
| 236 | (unless (equal x (current-column)) | ||
| 237 | (picture-forward-column (- x (current-column)))) | ||
| 238 | (unless (equal y current-row) | ||
| 239 | (picture-move-down (- y current-row))))) | ||
| 240 | |||
| 229 | 241 | ||
| 230 | ;; Picture insertion and deletion. | 242 | ;; Picture insertion and deletion. |
| 231 | 243 | ||
| @@ -602,6 +614,7 @@ Leaves the region surrounding the rectangle." | |||
| 602 | (picture-substitute 'previous-line 'picture-move-up) | 614 | (picture-substitute 'previous-line 'picture-move-up) |
| 603 | (picture-substitute 'beginning-of-line 'picture-beginning-of-line) | 615 | (picture-substitute 'beginning-of-line 'picture-beginning-of-line) |
| 604 | (picture-substitute 'end-of-line 'picture-end-of-line) | 616 | (picture-substitute 'end-of-line 'picture-end-of-line) |
| 617 | (picture-substitute 'mouse-set-point 'picture-mouse-set-point) | ||
| 605 | 618 | ||
| 606 | (define-key picture-mode-map "\C-c\C-d" 'delete-char) | 619 | (define-key picture-mode-map "\C-c\C-d" 'delete-char) |
| 607 | (define-key picture-mode-map "\e\t" 'picture-toggle-tab-state) | 620 | (define-key picture-mode-map "\e\t" 'picture-toggle-tab-state) |