emacs-devel
[Top][All Lists]
Advanced

[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: Sat, 26 Jan 2019 18:58:05 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

>> If we implemented the `reactivate-mark-function` variable instead (and
>> the function `reactivate-mark`), would it be OK to have code like this?
>>
>> (pcase reactivate-mark-function
>>   ('normal-reactivate-mark-function ...)
>>   ('rectangle-reactivate-mark-function ...))
>
> It would be evidence that the design isn't very good: a function should
> be treated as a black box with which the only thing you can do is to
> call it.

Yes, that is true. Starting from the example code you sent earlier,
would this make more sense? I added (activate-mark) as I
imagine that a call to `reactivate-mark' would always be preceded by a
call to `activate-mark' anyways:

(cl-defmethod reactivate-mark ((marktype (eql t)))
 (activate-mark))

(cl-defmethod reactivate-mark ((marktype (eql rectangle)))
 ;; Rectangular mark
 (activate-mark)
 (rectangle-mark-mode))

Then, in mouse.el the following could be added:

(cl-defmethod drag-negligible-p ((marktype (eql t)))
 ...)

(cl-defmethod drag-negligible-p ((marktype (eql rectangle)))
 ...)

Other questions I have are:
- Where would `marktype' be defined?
- When activating an alternate region mode (e.g. rectangle-region-mode),
would the previous mark type be stored and then set back, or would it
simply go back to the default? (t)


- Federico



reply via email to

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