[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: suggested new command `picture-mouse-set-point'
From: |
Kim F. Storm |
Subject: |
Re: suggested new command `picture-mouse-set-point' |
Date: |
24 Oct 2002 02:31:07 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
address@hidden (John Paul Wallington) writes:
> 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. 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)))
--
Kim F. Storm <address@hidden> http://www.cua.dk
- suggested new command `picture-mouse-set-point', John Paul Wallington, 2002/10/23
- Re: suggested new command `picture-mouse-set-point',
Kim F. Storm <=
- Re: suggested new command `picture-mouse-set-point', John Paul Wallington, 2002/10/24
- Re: suggested new command `picture-mouse-set-point', Kim F. Storm, 2002/10/24
- Re: suggested new command `picture-mouse-set-point', John Paul Wallington, 2002/10/24
- Re: suggested new command `picture-mouse-set-point', Stefan Monnier, 2002/10/24
- Re: suggested new command `picture-mouse-set-point', John Paul Wallington, 2002/10/24
- Re: suggested new command `picture-mouse-set-point', Stefan Monnier, 2002/10/25
- Re: suggested new command `picture-mouse-set-point', John Paul Wallington, 2002/10/25
- Re: suggested new command `picture-mouse-set-point', Kevin Ryde, 2002/10/25
- Re: suggested new command `picture-mouse-set-point', Kim F. Storm, 2002/10/25
- Re: suggested new command `picture-mouse-set-point', Stefan Monnier, 2002/10/25