From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: can a command specify overwrite selection behavior? Date: Sat, 25 Dec 2010 09:00:59 -0800 Message-ID: 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="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1293296718 12753 80.91.229.12 (25 Dec 2010 17:05:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Dec 2010 17:05:18 +0000 (UTC) To: "'Ilya Zakharevich'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 25 18:05:14 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 1PWXYP-0005cK-1o for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Dec 2010 18:05:13 +0100 Original-Received: from localhost ([127.0.0.1]:38169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWXYN-0004eo-CM for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Dec 2010 12:05:11 -0500 Original-Received: from [140.186.70.92] (port=60821 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWXUv-0003JD-LC for help-gnu-emacs@gnu.org; Sat, 25 Dec 2010 12:01:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PWXUu-0003nB-N9 for help-gnu-emacs@gnu.org; Sat, 25 Dec 2010 12:01:37 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:26874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PWXUu-0003mt-Gr for help-gnu-emacs@gnu.org; Sat, 25 Dec 2010 12:01:36 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBPH1WQs015305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 25 Dec 2010 17:01:33 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBPFUOe0000660; Sat, 25 Dec 2010 17:01:30 GMT Original-Received: from abhmt006.oracle.com by acsmt353.oracle.com with ESMTP id 881271941293296462; Sat, 25 Dec 2010 09:01:02 -0800 Original-Received: from dradamslap1 (/10.159.223.139) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 25 Dec 2010 09:01:02 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcukQJvck/p/iqeAQgqiLcizEqTjPgAE037g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:77884 Archived-At: > Essentially, I read this as a detailed explanation of the way this bug > is triggered. If one understands the mechanism of this bug so well, > why not fix it? AFAICS, this subroutine is placed in a wrong hook; it > should be executed later... What bug? What subroutine? What hook? What should be executed later than what? This behavior is _by design_. Delete-selection mode works by your telling Emacs how you want particular commands to behave wrt an active region. In the example, Xah told it to make command `insert-date' delete the active region before it does its own thing of inserting a date. Xah did not tell it to make command `execute-extended-command' delete the active region before it does its own thing of reading and then invoking a command. Emacs is just doing what it was told to do. There are many ways to evaluate a sexp (or invoke a command). Many of them also do additional things, besides just evaluating (e.g reading, pretty-printing). Or they evaluate in different contexts (e.g. interactively or not). These differences in behavior are _by design_, not bugs.