From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Federico Tedin Newsgroups: gmane.emacs.devel 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 Message-ID: <87a7jnt72q.fsf@gmail.com> References: <20181017063829.3775.67018@vcs0.savannah.gnu.org> <20181017063831.03DCB2044D@vcs0.savannah.gnu.org> <810f1e04-1117-476d-9a7d-d57002609bf8@default> <5BCC3743.8040103@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="188890"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 26 22:59:25 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gnVz2-000mzg-QJ for ged-emacs-devel@m.gmane.org; Sat, 26 Jan 2019 22:59:24 +0100 Original-Received: from localhost ([127.0.0.1]:36058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnVz1-0006Qa-Qf for ged-emacs-devel@m.gmane.org; Sat, 26 Jan 2019 16:59:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnVy6-0006PT-PZ for emacs-devel@gnu.org; Sat, 26 Jan 2019 16:58:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnVy6-0006Xy-1q for emacs-devel@gnu.org; Sat, 26 Jan 2019 16:58:26 -0500 Original-Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:33888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnVy5-0006S5-33 for emacs-devel@gnu.org; Sat, 26 Jan 2019 16:58:25 -0500 Original-Received: by mail-qk1-x732.google.com with SMTP id q8so7465943qke.1 for ; Sat, 26 Jan 2019 13:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=d5mqrZRvC3r6pb3FFG7x27in5RLidjSwym4cxm3uMbE=; b=kc5mXM2p3m4dS1VBx97hwe6SqYSYRa7VPLm0j0MtpyA0/FwX0WYZnGxsE2ph6Ya2+a n9QF+P019rOe0biQiodm/3h4ElsLM3yE3Sy0MtscZgCVQm4If2s2zPNPOMByAJXtfTFf ZJ/gtgbLUwFW4rVOxBMgkQMy5N+dOaCIjmhPJyAojKNUYk1F7jICzFNlJMezTB8cfzfn 1aypt/NVzEog+LVCrk3k/0vjhh3/SUjiufZ8rdD09d0z/CS4bDzRy02xuuFDcgtD5mGT YiFsU9eFBpqvRX92uyBHMnrOeoE5HSyqGWgoGLzOJPLAtKBpZYXrPargPhEpu8imMKoL hQPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=d5mqrZRvC3r6pb3FFG7x27in5RLidjSwym4cxm3uMbE=; b=VXEDa3TnXk91xa4Zulp9IhgDHgGNJi1Ea4zN/2Od2QtzvW66Q9JAPxrr+QNaJ9bOzF y3Ap6uhnvZrfwWpkQVoS8BJ3WlYmnB2cFljOiARVgUsK8m4aquW92Afb+djkMt6etO4I xO73Q3yemsK5I3L0hXfG+Bo3x0CaejO0ijMUnFXBDgdLLTgsjVQ9XlHXJluXoFLXAyB7 W/rd/eIUC8frNmwTDmzyjkGtZUkKIIcQ4Ysc7oTNZ69QCjQI9B6C3P6vJjDIk+sic1y7 PffDPI6NMuKdqSb7SmF67deHVbGwHOe18/4u/ciAHj9UcrcMnxbW+fgfuPW7vv2dkoh9 wfsA== X-Gm-Message-State: AJcUukdell6cvXk8Y59V4G1gx6Uf73Vxa/UgKJU20ZKjYJ4dksdkb50q L9ilZuqSaIKlowOyEwoIp7/2hqkQ X-Google-Smtp-Source: ALg8bN7yH8YRHj2Fp5RrBKQAWTLbZDRaZBQ4wNWtqfP+iZU/8yBc9/qF8AQdjVpe3cwKd/9fqwDHAw== X-Received: by 2002:a37:c304:: with SMTP id a4mr14580905qkj.269.1548539888999; Sat, 26 Jan 2019 13:58:08 -0800 (PST) Original-Received: from hideo ([181.167.176.220]) by smtp.gmail.com with ESMTPSA id u50sm98984685qta.23.2019.01.26.13.58.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 13:58:08 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Mon, 07 Jan 2019 12:40:54 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232710 Archived-At: >> 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