From: jpw@shootybangbang.com (John Paul Wallington)
Subject: suggested new command `picture-mouse-set-point'
Date: Wed, 23 Oct 2002 19:04:41 +0100 [thread overview]
Message-ID: <E184Ps1-0006W3-00@bundalo.shootybangbang.com> (raw)
Here is a patch providing a mouse command to set point to the position
clicked on in `picture-mode' making whitespace if necessary, as
suggested by Kai and others. It seems okay, but isn't great.
Is it worth installing as is? Can anyone suggest improvements?
--- /build-emacs/emacs/lisp/textmodes/picture.el.~1.40.~ Mon Jul 1 08:47:22 2002
+++ /build-emacs/emacs/lisp/textmodes/picture.el Wed Oct 23 18:56:22 2002
@@ -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
@@ -226,6 +226,18 @@
(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)))))
+
\f
;; 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)
--
John Paul Wallington
next reply other threads:[~2002-10-23 18:04 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-23 18:04 John Paul Wallington [this message]
2002-10-24 0:31 ` suggested new command `picture-mouse-set-point' Kim F. Storm
2002-10-24 9:18 ` John Paul Wallington
2002-10-24 21:42 ` Kim F. Storm
2002-10-24 23:18 ` John Paul Wallington
2002-10-24 23:37 ` Stefan Monnier
2002-10-25 1:42 ` John Paul Wallington
2002-10-25 14:19 ` Stefan Monnier
2002-10-25 22:50 ` Kevin Ryde
2002-10-25 22:57 ` John Paul Wallington
2002-10-25 9:16 ` Kim F. Storm
2002-10-25 14:11 ` Stefan Monnier
2002-10-26 12:34 ` Kai Großjohann
2002-10-26 20:14 ` Richard Stallman
2002-10-28 15:20 ` Juanma Barranquero
2002-10-28 18:26 ` Eli Zaretskii
2002-10-29 7:23 ` Juanma Barranquero
2002-10-29 19:38 ` Eli Zaretskii
2002-10-29 3:01 ` Richard Stallman
2002-10-28 15:31 ` Juanma Barranquero
2002-10-29 3:02 ` Richard Stallman
2002-10-29 17:59 ` Juanma Barranquero
2002-10-30 11:55 ` Kim F. Storm
2002-10-30 12:47 ` Juanma Barranquero
2002-10-30 17:18 ` Richard Stallman
2002-10-30 17:51 ` Juanma Barranquero
2002-11-04 11:13 ` Juanma Barranquero
2002-11-04 15:02 ` Juanma Barranquero
2002-11-05 5:13 ` Richard Stallman
2002-10-26 20:13 ` Richard Stallman
2002-10-25 5:35 ` Richard Stallman
2002-10-25 9:49 ` Kim F. Storm
2002-10-26 20:15 ` Richard Stallman
2002-10-24 16:55 ` Richard Stallman
2002-10-24 23:21 ` John Paul Wallington
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E184Ps1-0006W3-00@bundalo.shootybangbang.com \
--to=jpw@shootybangbang.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.