From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: can a command specify overwrite selection behavior? Date: Sat, 25 Dec 2010 18:20:12 -0800 (PST) Organization: http://groups.google.com Message-ID: <1988bbc5-096b-4db5-b519-6622b11f5311@v17g2000prc.googlegroups.com> References: <33ac6984-0a0c-4db8-8ea1-50ec5c271a25@x18g2000pro.googlegroups.com><05a87fbb-31a7-40c3-a890-6c7aacaefac3@t5g2000prd.googlegroups.com><92235e12-464c-41d9-9a49-33598c157113@i25g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1293339155 13821 80.91.229.12 (26 Dec 2010 04:52:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Dec 2010 04:52:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 26 05:52:31 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PWiat-0007eK-DN for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Dec 2010 05:52:31 +0100 Original-Received: from localhost ([127.0.0.1]:38523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWias-00016D-MM for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Dec 2010 23:52:30 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!v17g2000prc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-NNTP-Posting-Host: 76.126.112.84 Original-X-Trace: posting.google.com 1293330031 17015 127.0.0.1 (26 Dec 2010 02:20:31 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 26 Dec 2010 02:20:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v17g2000prc.googlegroups.com; posting-host=76.126.112.84; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:183658 X-Mailman-Approved-At: Sat, 25 Dec 2010 23:52:10 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77893 Archived-At: > > Hope this helps, Ilya > > Hope it helped you. =A0I have my doubts that it helped anyone else. lol. funny. I see a flamewar brewing, and am getting into the fray here by participating. I think both Drew and Llya or even me adds good points in the discussion. The way i see this is a bug is in the sense that the purpose of delete- selection property seems to be thwarted by specific way how emacs works. Namely, the final effect is that it makes a distinction on whether the command is invoked by M-x or by a hotkey. so, i tend to see this is not a desired behavior (call it =93bug=94 or =93feature=94 or =93design=94 or whatnot). but overall i guess this is trivial? It would be fruitful if someone do a survey on how many functions actually use the delete-selection property, or if some emacs oldbie can tell us that property's history. Am guessing, these days, if elisp programer want the behavior of deleting existing text selection in commands they write, a reliable and easy and explicit way is simply to put in the code =A0 (when (region-active-p) =A0 =A0 (delete-region (region-beginning) (region-end) ) =A0 =A0 ) instead of relying on delete-region property. I think elisp function property is rather esoteric (e.g. it is not a feature in most langs, and i don't think it is that much widely known or used in elisp) I think i learned about it when diddling with cua-mode around 2007. The fact i learned it i think introduced more trouble, because otherwise i'd put the explicit code above and i wouldn't have posted this or the bug report. (does anyone know a list of all built-in lisp properties? (havn't spend any effort to search the manual...)) i think a good question is: from a core emacs developer's point of view (such as Richard Stallman, or perhaps Drew Adamns and Llya Z. who designed the system or know the core system well), would you advice to actually make use of the delete-selection proprety or just use the explicit code above? Xah