unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: jpw@shootybangbang.com (John Paul Wallington)
Cc: emacs-devel@gnu.org
Subject: Re: suggested new command `picture-mouse-set-point'
Date: Thu, 24 Oct 2002 10:18:29 +0100	[thread overview]
Message-ID: <E184e8L-0006rr-00@bundalo.shootybangbang.com> (raw)
In-Reply-To: <5xn0p4znhw.fsf@kfs2.cua.dk> (storm@cua.dk)

> > 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?
> 
> I don't think this is specifically related to picture mode, as it may
> be generally useful.  

Agreed.

>Here is the code I've written to do this:
> 						       
> (defun mouse-set-point-rigidly (event)
>   "Set mouse position at window position clicked on.	   
> If window position does not correspond to a buffer position, the
> buffer is modified (unless it is a read-only buffer)."
>   (interactive "e")					      	   
>   (let* ((line (cdr (posn-col-row (event-end event))))
>          (moved (move-to-window-line line)))
>      (when (and (not buffer-read-only) (< moved line))
>        (end-of-line)
>        (insert-char ?\n (- line moved))))
>   (move-to-column (car (posn-col-row (event-end event))) (not buffer-read-only)))

Cool.  Any ideas how to better integrate it?  For example, it would
be nice if `mouse-drag-region' would call it instead of
`mouse-set-point'; presently, the cursor will "bounce".

Maybe there could be a `mouse-set-point-function' variable that would
be funcalled where `mouse-set-point' is presently called directly, or
`mouse-set-point' could call `mouse-set-point-rigidly' iff
`mouse-set-point-rigidly' variable was non-nil, or something like
that?

-- 
John Paul Wallington

  reply	other threads:[~2002-10-24  9:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-23 18:04 suggested new command `picture-mouse-set-point' John Paul Wallington
2002-10-24  0:31 ` Kim F. Storm
2002-10-24  9:18   ` John Paul Wallington [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E184e8L-0006rr-00@bundalo.shootybangbang.com \
    --to=jpw@shootybangbang.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).