From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#27530: patch to cut and copy secondary Date: Fri, 08 Sep 2017 08:02:08 +0900 (JST) Message-ID: <20170908.080208.755485899479344801.tkk@misasa.okayama-u.ac.jp> References: <83o9qn24py.fsf@gnu.org> <20170907.213520.1700258678806095027.tkk@misasa.okayama-u.ac.jp> <83k21az5kw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1504825419 13326 195.159.176.226 (7 Sep 2017 23:03:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Sep 2017 23:03:39 +0000 (UTC) Cc: tkk@misasa.okayama-u.ac.jp, 27530@debbugs.gnu.org To: eliz@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 08 01:03:25 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 1dq5pI-0002Gp-FN for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 01:03:12 +0200 Original-Received: from localhost ([::1]:42619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5pP-00048y-NR for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Sep 2017 19:03:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5pG-00048O-6S for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 19:03:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq5p8-0001vj-Ho for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 19:03:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq5p8-0001vF-E2 for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 19:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dq5p7-0003XE-V3 for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2017 19:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Sep 2017 23:03:01 +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.150482534013538 (code B ref 27530); Thu, 07 Sep 2017 23:03:01 +0000 Original-Received: (at 27530) by debbugs.gnu.org; 7 Sep 2017 23:02:20 +0000 Original-Received: from localhost ([127.0.0.1]:54877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq5oR-0003WI-O1 for submit@debbugs.gnu.org; Thu, 07 Sep 2017 19:02:19 -0400 Original-Received: from mxl069v65.mxlogic.net ([208.81.69.65]:21093 helo=s18p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq5oP-0003W9-Ll for 27530@debbugs.gnu.org; Thu, 07 Sep 2017 19:02:18 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o142.mxlogic.net(mxl_mta-8.5.0-1834) over TLS secured channel with ESMTP id 3ffc1b95.0.392229.00-372.782442.s18p02o142.mxlogic.net (envelope-from ); Thu, 07 Sep 2017 17:02:14 -0600 (MDT) X-MXL-Hash: 59b1cff65caa1f05-7b56ab454f622d0d9d387f106d6078d59a3a5e08 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 61a1_1177_e8952cd7_87e6_4fc6_bd20_87c6ffd4d08a; Fri, 08 Sep 2017 08:02:09 +0900 Original-Received: from localhost (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 685954C0BF5; Fri, 8 Sep 2017 08:02:09 +0900 (JST) In-Reply-To: <83k21az5kw.fsf@gnu.org> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6111=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6111> : inlines <6059> : streams <1762038> : uri <2496674> X-AnalysisOut: [v=2.2 cv=RuS1FGuK c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=2JC] X-AnalysisOut: [JgTwv5E4A:10 a=xwaEzbr6ikJ_SI3THPwA:9 a=7Zwj6sZBwVKJAoWSPK] X-AnalysisOut: [xL6X1jA+E=:19 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017090711); S=0.330(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] 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:136672 Archived-At: > If we want a function that will put region around secondary selection, > why not write such a function, and let users who want to code commands > that use this functionality do that? IOW, why do we have to come up > with a command to do something which we aren't sure is a frequent use > case? Since the secondary selection is one of overlays, to have functions that transform the region and an overlay is more general. 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. -- 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. -- 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. -- 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.