From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!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: Fri, 26 Oct 2018 19:07:31 -0300 Message-ID: References: <20181017063829.3775.67018@vcs0.savannah.gnu.org> <20181017063831.03DCB2044D@vcs0.savannah.gnu.org> <810f1e04-1117-476d-9a7d-d57002609bf8@default> <5BCC3743.8040103@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1540591585 23609 195.159.176.226 (26 Oct 2018 22:06:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2018 22:06:25 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 27 00:06:20 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGAFF-0005z9-5e for ged-emacs-devel@m.gmane.org; Sat, 27 Oct 2018 00:06:17 +0200 Original-Received: from localhost ([::1]:34319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGAHL-00029S-H4 for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2018 18:08:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGAGg-00022J-5m for emacs-devel@gnu.org; Fri, 26 Oct 2018 18:07:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGAGf-0006bq-KL for emacs-devel@gnu.org; Fri, 26 Oct 2018 18:07:46 -0400 Original-Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:32884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGAGf-0006bb-Cb for emacs-devel@gnu.org; Fri, 26 Oct 2018 18:07:45 -0400 Original-Received: by mail-lj1-x22d.google.com with SMTP id z21-v6so2530231ljz.0 for ; Fri, 26 Oct 2018 15:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8j8vnKxFXNvqLq4jKm50gx5b2I6CT5RrTmons3vCC4c=; b=QUbJSbT0blUdvpsiYTY/oDWtNwPsnKkFSlx19SRDu6v2kfiQsf7a2kn7FJCXEoaAdL gvLP3i2ih3TfwXbLZZvuOyhAiiWkUVJkbEAYqs0Qgx/Jx5A1fJGPsUvvYSbJRbS8gcQn XFKSlwLw0IxmVRsqYesaYMmzdrwyA+jr7b6KZaH7Ye7LwmEE+Mw59ETsyeh9fFhYloHg vz0YzCFKT/DqWUdUniV3PWnQYQHzKGQ3qQGDwdeJ6z0gB9N6AJezPd4jCYJDaVGgGUKj gQGn5hZ4zjP0hKwhmHcfdcg/oJCB+g11uFS4oS2s/FdiB+MZf4H+oUdPXCt96KdxSv7s Tv6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8j8vnKxFXNvqLq4jKm50gx5b2I6CT5RrTmons3vCC4c=; b=UWJvYzXRGUBzJI7h7FyDBBi6Szi6u5DcSWfdAAE6qB1XxHOiLlbwk60MPi8DcKd7+t PnieFOENy+uXOG41L7ksuEvvZx7BxkItvopBAgAZQuagsnopT5+Yz5f9nY1pOnAnvOMb mBI4bg70BlxfF/Zj3m2cjOy5wdBgRuM0Qq7pkNn4utYw6qSvuYH17XSqYfnmg8ZaSPNy DMt7n87nkTnAZHgbiziFErXd3BwIvDu0CtwVjv7Y5iiXpkKKk7yY6cfyqS/1sHHDSmA7 gygwSOk6UT1F7RmbRVb6v1/GX3B1WWdXhEx0Sc2UeBhKkPHTXsaPvhxC+u3hnz5NauDR +URg== X-Gm-Message-State: AGRZ1gJJgtQYt+PAAOrKpm7WmD0ek50Hd1gHt4+BZwhs1YYYHs7Sv1ht qV+x0uPoXqBQJaNLmPdYPsErKbmG1H6q7Q/I9cQ= X-Google-Smtp-Source: AJdET5dCRELKiH8QeLgfFlszbINVaS7bWyI4gC7BKBn3Khv0VL5awrsrnM7a5T+DziPRidAkxK+ftEc1m6kEbdBJZsQ= X-Received: by 2002:a2e:8050:: with SMTP id p16-v6mr402395ljg.178.1540591663898; Fri, 26 Oct 2018 15:07:43 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22d 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:230726 Archived-At: > 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"). Thanks. > 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.