[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 134ba45: Allow two mouse functions to work with

From: Federico Tedin
Subject: Re: [Emacs-diffs] master 134ba45: Allow two mouse functions to work with Rectangle Mark mode
Date: Fri, 26 Oct 2018 19:07:31 -0300

> Thanks, installed (after changing text-property-any with
> text-property-not-all so we also detect non-t non-nil values as meaning
> "read-only").


> AFAICT the next step is to introduce a function `reactivate-mark`.
> This function will need to know what kind of mark was earlier activated,
> so we will need to store the "kind of mark" somewhere.
> I guess the easiest is to introduce a new var
> `reactivate-mark-function` (so reactivate-mark doesn't need to do much
> more than funcall it).
> Then we'll want to change a few places in Elisp to set/reset this var.

Could we store the region "type" instead of a function instead? For
example, 'normal for normal regions, 'rectangle for rectangular
regions, etc. The reason I propose this is because, at least in
mouse-drag-and-drop-region, more than one parts of the function depend
on the region type:

- Checking if the drag is negligible
- Re-activating the region after the drag operation

By implementing `reactivate-mark-function` alone, the problem of not
knowing the region type would still remain. If we store the region
type instead, then the value could be read directly, and
`reactivate-mark` could be implemented as:

(defun reactivate-mark ()
  (pcase region-type
    ('normal ...)
    ('rectangle ...)

Would that make sense? Other functions depending on the region type could
be implemented in a similar fashion.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]