From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27530: patch to cut and copy secondary Date: Fri, 08 Sep 2017 11:27:21 +0300 Message-ID: <83vakty4ra.fsf@gnu.org> References: <83o9qn24py.fsf@gnu.org> <20170907.213520.1700258678806095027.tkk@misasa.okayama-u.ac.jp> <83k21az5kw.fsf@gnu.org> <20170908.080208.755485899479344801.tkk@misasa.okayama-u.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1504859336 18230 195.159.176.226 (8 Sep 2017 08:28:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Sep 2017 08:28:56 +0000 (UTC) Cc: 27530@debbugs.gnu.org To: Tak Kunihiro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 08 10:28:37 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dqEe1-0002iQ-Aw for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 10:28:09 +0200 Original-Received: from localhost ([::1]:43861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqEe8-0006Vt-Bt for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 04:28:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqEdz-0006UL-2p for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 04:28:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqEdu-0004UY-B8 for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 04:28:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqEdu-0004UN-7t for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 04:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dqEdu-0008Fz-1e for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 04:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Sep 2017 08:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27530-submit@debbugs.gnu.org id=B27530.150485924931698 (code B ref 27530); Fri, 08 Sep 2017 08:28:02 +0000 Original-Received: (at 27530) by debbugs.gnu.org; 8 Sep 2017 08:27:29 +0000 Original-Received: from localhost ([127.0.0.1]:55229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqEdM-0008FC-U4 for submit@debbugs.gnu.org; Fri, 08 Sep 2017 04:27:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqEdL-0008F0-A5 for 27530@debbugs.gnu.org; Fri, 08 Sep 2017 04:27:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqEdA-0003K5-NJ for 27530@debbugs.gnu.org; Fri, 08 Sep 2017 04:27:22 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqEdA-0003Jy-KR; Fri, 08 Sep 2017 04:27:16 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3282 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dqEd9-0008Am-PV; Fri, 08 Sep 2017 04:27:16 -0400 In-reply-to: <20170908.080208.755485899479344801.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Fri, 08 Sep 2017 08:02:08 +0900 (JST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136675 Archived-At: > Date: Fri, 08 Sep 2017 08:02:08 +0900 (JST) > Cc: 27530@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp > From: Tak Kunihiro > > How about having those in lisp/subr.el? An user can still manipulate the > secondary selection. Sorry for shortage for words. > > -- Function: overlay-exchange-region overlay > This function exchanges the region and OVERLAY. > When the region is active, this sets OVERLAY from the region. > When the region is not active but OVERLAY exists, this sets the > region from OVERLAY. Does this do anything but call overlay-to-region and overlay-from-region? > -- Function: overlay-exists-p overlay > This function returns if OVERLAY exists in current buffer. > When OVERLAY exists, this returns list of start and end of > OVERLAY. This is just (memq OVERLAY (overlays-in (point-min) (point-max))) Right? > -- Function: overlay-to-region overlay > This function sets the region to text in OVERLAY. > This works when OVERLAY exists and the region does not exist in > current buffer. The OVERLAY will be deleted. I don't understand this one. I guess "text in OVERLAY" is confusing; did you mean OVERLAY's beginning and end? > -- Function: overlay-from-region overlay > This function sets OVERLAY to text in the region. > When the region does not exists, set OVERLAY to point. When > point is within OVERLAY, do nothing. In sum, I think these are too general: they talk about OVERLAY in general, whereas what you really mean is the special overlay used for secondary selection. So how about these instead: secondary-selection-exist-p secondary-selection-from-region secondary-selection-to-region ? The advantage is that the caller will not have to pass OVERLAY, which IMO is an unnecessary burden. Thanks.