From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: position on changing defaults? Date: Sat, 08 Mar 2008 21:56:01 +0100 Message-ID: <87skz12avy.fsf@kfs-lx.rd.rdm> References: <200803050637.m256bXL3008361@sallyv1.ics.uci.edu> <87hcfkdhqk.fsf@stupidchicken.com> <87pru8enjx.fsf@kfs-lx.rd.rdm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205009788 24992 80.91.229.12 (8 Mar 2008 20:56:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2008 20:56:28 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 08 21:56:56 2008 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 1JY660-0003QJ-S6 for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 21:56:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JY65S-0005lL-Vq for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 15:56:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JY65O-0005kr-Hv for emacs-devel@gnu.org; Sat, 08 Mar 2008 15:56:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JY65O-0005kf-1O for emacs-devel@gnu.org; Sat, 08 Mar 2008 15:56:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JY65N-0005kc-Qh for emacs-devel@gnu.org; Sat, 08 Mar 2008 15:56:05 -0500 Original-Received: from mail-relay.sonofon.dk ([212.88.64.25]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JY65N-0004Jb-9f for emacs-devel@gnu.org; Sat, 08 Mar 2008 15:56:05 -0500 Original-Received: (qmail 26874 invoked from network); 8 Mar 2008 20:56:02 -0000 Original-Received: from unknown (HELO kfs-lx.rd.rdm.cua.dk) (213.83.150.21) by 0 with SMTP; 8 Mar 2008 20:56:02 -0000 In-Reply-To: (Stefan Monnier's message of "Thu\, 06 Mar 2008 12\:07\:13 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:91775 Archived-At: Stefan Monnier writes: >> BTW, why is using a pre- or post- command hook so bad? > > These tend to be brittle (e.g. when entering/exiting minibuffer prompts > or recursive edits) and difficult to debug. I think the need for > pre/post command-hook is often a sign of a missing > functionality elsewhere. It seems I could get by with the following hooks: pre-command-shifted-key-hook Called before executing command if transient-mark-mode is enabled and current command is invoked by a shifted key. pre-command-mark-active-hook Called before executing command if transient-mark-mode is enabled and mark is active. post-command-mark-active-hook Called after executing command if transient-mark-mode is enabled and mark is active. Called before checking value of deactivate-mark! I can probably do without the two mark-active hooks if it is ok to use activate-mark-hook and deactivate-mark-hook to add and remove functions on the general pre-command-hook and post-command-hook, but having dedicated hooks would be easier. -- Kim F. Storm http://www.cua.dk