From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: What primitive has moved point? Date: Fri, 06 Nov 2009 10:36:05 -0500 Message-ID: References: <20091106114853.GA1917@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257521790 15430 80.91.229.12 (6 Nov 2009 15:36:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2009 15:36:30 +0000 (UTC) Cc: Richard Stallman , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 06 16:36:23 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N6QrO-00074o-Hn for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2009 16:36:22 +0100 Original-Received: from localhost ([127.0.0.1]:49977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6QrN-0006sb-NU for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2009 10:36:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6QrG-0006sN-5E for emacs-devel@gnu.org; Fri, 06 Nov 2009 10:36:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6QrA-0006qr-NQ for emacs-devel@gnu.org; Fri, 06 Nov 2009 10:36:12 -0500 Original-Received: from [199.232.76.173] (port=52023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6QrA-0006qo-Iy for emacs-devel@gnu.org; Fri, 06 Nov 2009 10:36:08 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:20936 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6Qr9-00077I-8u; Fri, 06 Nov 2009 10:36:07 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8EALfQ80pMCqkr/2dsb2JhbACBTdwbhD0EiQg X-IronPort-AV: E=Sophos;i="4.44,694,1249272000"; d="scan'208";a="48808196" Original-Received: from 76-10-169-43.dsl.teksavvy.com (HELO pastel.home) ([76.10.169.43]) by ironport2-out.pppoe.ca with ESMTP; 06 Nov 2009 10:36:06 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id A14BD7F0F; Fri, 6 Nov 2009 10:36:05 -0500 (EST) In-Reply-To: <20091106114853.GA1917@muc.de> (Alan Mackenzie's message of "Fri, 6 Nov 2009 11:48:53 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116688 Archived-At: > After point has been moved, how can I determine exactly which primitive > did the moving? Down this path lies madness. > (possibly by the use of point-entered/left text properties), ...more madness. > However, if the user gets to brace B with forward-line (e.g., with C-p) > I want to leave point well alone. I think your "feature" will be a misfeature, but if you really really want to implement it, the sanest way is probably to consider not the primitive used, but the direction of the movement: remember point in pre-command-hook, and compare in post-command-hook. Otherwise: wrap all the relevant primitives (via defadvice, for example) and make them do what you want. Stefan