From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.devel Subject: kill-region in 24.4 shouldn't require BEG and END Date: Sat, 15 Nov 2014 06:55:38 +0000 Message-ID: <12187.7121310265$1416036364@news.gmane.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416036364 9339 80.91.229.3 (15 Nov 2014 07:26:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2014 07:26:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 15 08:25:57 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XpXk3-0001vk-QB for ged-emacs-devel@m.gmane.org; Sat, 15 Nov 2014 08:25:55 +0100 Original-Received: from localhost ([::1]:39326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpXk3-00046q-6L for ged-emacs-devel@m.gmane.org; Sat, 15 Nov 2014 02:25:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpXS2-0001t1-Ug for emacs-devel@gnu.org; Sat, 15 Nov 2014 02:07:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpXRs-0000U2-QC for emacs-devel@gnu.org; Sat, 15 Nov 2014 02:07:18 -0500 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:37207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpXRs-0000Tx-Js for emacs-devel@gnu.org; Sat, 15 Nov 2014 02:07:08 -0500 Original-Received: from mfilter8-d.gandi.net (mfilter8-d.gandi.net [217.70.178.137]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id E2434A80B6 for ; Sat, 15 Nov 2014 08:07:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter8-d.gandi.net Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter8-d.gandi.net (mfilter8-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id q-hu4RD-ZYzB for ; Sat, 15 Nov 2014 08:07:06 +0100 (CET) X-Originating-IP: 73.169.42.166 Original-Received: from localhost (c-73-169-42-166.hsd1.co.comcast.net [73.169.42.166]) (Authenticated sender: kelly@prtime.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id ACA65A80B9 for ; Sat, 15 Nov 2014 08:07:04 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4b98:c:538::195 X-Mailman-Approved-At: Sat, 15 Nov 2014 02:25:30 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177140 Archived-At: If the REGION argument is non-nil, then BEG and END shouldn't be required= , since they're unused (except in one place where they aren't needed). So= the test =E2=8C=9Cunless (and beg end)=E2=8C=9D in kill-region should be =E2=8C=9Cunless (or region (and beg end))=E2=8C=9D and the docstring should point out that if REGION is non-nil, then BEG an= d END are unused and might as well be nil. The one place in kill-region where BEG and END are unnecessarily used if = REGION is non-nil is the line =E2=8C=9C(kill-append string (< end beg))=E2=8C=9D which should be something like =E2=8C=9C(kill-append string (if region (< (point) (mark)) (< end beg)))=E2=8C=9D and similarly for copy-region-as-kill. Without these changes, both kill-region and its docstring are confusing. Also, it would be clearer to have different names for the region between = the cursor (er. point) and mark vs. a region between two specified positi= ons; maybe call the latter a =E2=80=9Frange=E2=80=9D, and have a cut-rang= e function that takes BEG and END and have a cut-region function that tak= es no arguments, have both call kill-region, rename the latter to =E2=80=9F= cut-range-or-region=E2=80=9D, and provide =E2=80=9Fkill-region=E2=80=9D a= s an alias to the latter and mark it as deprecated, but I guess we'd have= to wait 20 years before that alias could be safely removed. To go along = with that, rename the kill-ring to =E2=80=9Fclip-ring=E2=80=9D (not =E2=80= =9Fcut-ring=E2=80=9D since it holds not just cut things, but also copied = things) to be memorable as a ring of clippings since everybody knows what= a clipboard is, and rename all the associated functions. But Emacs just wouldn't be the same if it didn't let us kill things anymo= re. Maybe the traditional, weaponized version is better after all.