all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Federico Tedin <federicotedin@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 134ba45: Allow two mouse functions to work with Rectangle Mark mode
Date: Sat, 20 Oct 2018 17:21:25 -0400	[thread overview]
Message-ID: <jwvpnw4s4mq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAA8GjPm2o3w-+hfpgDdFDnM3PuUnRum2DmT8gxh-jwUaYNKDzA@mail.gmail.com> (Federico Tedin's message of "Sat, 20 Oct 2018 17:21:08 -0300")

> I thought you were actually referring to another problem. Consider the
> following example, where a buffer contains the text (spaces added for
> clarity):
>
>  a
>  b b
>  c c c
>  d d d d
>
> ...and the user selects the following rectangular region:
>
> [a      ]
> [b b    ]
> [c c c  ]
> [d d d d]
>
> In this case, the first overlay will actually only contain "a", so
> subtracting (current-column) in its end and start will yield 1. This
> makes sense, as evaluating (car (region-bounds)) yields (1 . 2).

Ah, right, that's yet another problem, indeed.

> Something I also realized is that the variables 'region-width' and
> 'region-height' are 1) rectangular region-specific

Sorry for not mentioning it earlier.

> and 2) are only used when checking if the region is being dragged into
> itself (setq drag-but-neglibible ...).

I don't understand enough of the "dragged into itself" test to know what
should be done here.  I think part of the issue is that for rectangular
regions, the "insert-for-yank" will actually not just insert, so we
can't just test "is insertion-point inside region-bounds?" (which could
be easily implemented in a generic way).  But at the same time, why
should we disallow dragging the rectangle to a place that overlaps its
original location?

> Maybe their definition could be moved to
> that specific part of the code (and only define them when the region
> is rectangular).

If that can be done, that sounds good.

> I believe the only parts of the code that is rectangle-specific are:
>
> 1) Checking if the drag is negligible
> 2) Inserting the text in the new position
> 3) Re-activating the region after a successful or failed drag

insert-for-yank takes care of (2), doesn't it?


        Stefan



  parent reply	other threads:[~2018-10-20 21:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181017063829.3775.67018@vcs0.savannah.gnu.org>
     [not found] ` <20181017063831.03DCB2044D@vcs0.savannah.gnu.org>
2018-10-17 15:47   ` [Emacs-diffs] master 134ba45: Allow two mouse functions to work with Rectangle Mark mode Stefan Monnier
2018-10-17 16:17     ` Drew Adams
2018-10-19 15:24       ` Stefan Monnier
2018-10-20  3:21         ` Federico Tedin
2018-10-20  3:48           ` Stefan Monnier
2018-10-20 20:21             ` Federico Tedin
2018-10-20 20:56               ` Federico Tedin
2018-10-20 21:21               ` Stefan Monnier [this message]
2018-10-21  8:22                 ` martin rudalics
2018-10-22 13:04                   ` Federico Tedin
2018-10-25 23:24                     ` Federico Tedin
2018-10-26 17:25                       ` Stefan Monnier
2018-10-26 22:07                         ` Federico Tedin
2018-10-28  0:30                           ` Stefan Monnier
2018-10-29 23:40                             ` Federico Tedin
2018-10-30 12:52                               ` Stefan Monnier
2019-01-07 17:40                               ` Stefan Monnier
2019-01-26 21:58                                 ` Federico Tedin
2019-01-28  9:12                                   ` Stefan Monnier
2019-01-29  4:02                                     ` Federico Tedin
2019-01-29  9:28                                       ` Stefan Monnier
2019-01-30  3:39                                         ` Federico Tedin

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=jwvpnw4s4mq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=federicotedin@gmail.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.