# HG changeset patch # User John Paul Wallington # Date 1035672040 0 # Node ID fc643b6ab4f49b8e3eb6ab205bfd4ee9c28fd6ef # Parent d3416b0f856c30fe5ac3f30fd21795761a1f2c09 * textmodes/picture.el (picture-mouse-set-point): New command. (picture-mode-map): Bind it. (picture-motion-reverse): Doc fix. diff -r d3416b0f856c -r fc643b6ab4f4 lisp/ChangeLog --- a/lisp/ChangeLog Sat Oct 26 22:40:31 2002 +0000 +++ b/lisp/ChangeLog Sat Oct 26 22:40:40 2002 +0000 @@ -3,6 +3,12 @@ * pcvs.el (cvs-checkout): Use read-directory-name. (cvs-query-directory): Likewise. +2002-10-26 John Paul Wallington + + * textmodes/picture.el (picture-mouse-set-point): New command. + (picture-mode-map): Bind it. + (picture-motion-reverse): Doc fix. + 2002-10-25 Stefan Monnier * textmodes/outline.el (outline-next-heading): Make sure the match-data diff -r d3416b0f856c -r fc643b6ab4f4 lisp/textmodes/picture.el --- a/lisp/textmodes/picture.el Sat Oct 26 22:40:31 2002 +0000 +++ b/lisp/textmodes/picture.el Sat Oct 26 22:40:40 2002 +0000 @@ -1,6 +1,6 @@ ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model -;; Copyright (C) 1985, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1994, 2002 Free Software Foundation, Inc. ;; Author: K. Shane Hartman ;; Maintainer: FSF @@ -222,10 +222,22 @@ "Move point in direction opposite of current picture motion in Picture mode. With ARG do it that many times. Useful for delineating rectangles in conjunction with diagonal picture motion. -Do \\[command-apropos] `picture-movement' to see commands which control motion." +Do \\[command-apropos] picture-movement to see commands which control motion." (interactive "p") (picture-motion (- arg))) +(defun picture-mouse-set-point (event) + "Move point to the position clicked on, making whitespace if necessary." + (interactive "e") + (let* ((pos (posn-col-row (event-start event))) + (x (car pos)) + (y (cdr pos)) + (current-row (count-lines (window-start) (line-beginning-position)))) + (unless (equal x (current-column)) + (picture-forward-column (- x (current-column)))) + (unless (equal y current-row) + (picture-move-down (- y current-row))))) + ;; Picture insertion and deletion. @@ -602,6 +614,7 @@ (picture-substitute 'previous-line 'picture-move-up) (picture-substitute 'beginning-of-line 'picture-beginning-of-line) (picture-substitute 'end-of-line 'picture-end-of-line) + (picture-substitute 'mouse-set-point 'picture-mouse-set-point) (define-key picture-mode-map "\C-c\C-d" 'delete-char) (define-key picture-mode-map "\e\t" 'picture-toggle-tab-state)