From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: comint-carriage-motion causes severe problems. Date: Wed, 03 Jul 2002 17:11:09 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200207032111.g63LBAv25925@rum.cs.yale.edu> References: <200207020035.TAA19789@eel.dms.auburn.edu> <200207021534.g62FYao17897@rum.cs.yale.edu> <200207021618.LAA20219@eel.dms.auburn.edu> <200207032057.g63KvX604721@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1025730714 24978 127.0.0.1 (3 Jul 2002 21:11:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2002 21:11:54 +0000 (UTC) Cc: teirllm@dms.auburn.edu, monnier+gnu/emacs@rum.cs.yale.edu, miles@lsi.nec.co.jp, Kai.Grossjohann@CS.Uni-Dortmund.DE, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17PrPm-0006Ul-00 for ; Wed, 03 Jul 2002 23:11:54 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17PrVS-0003yV-00 for ; Wed, 03 Jul 2002 23:17:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PrQ9-0007D5-00; Wed, 03 Jul 2002 17:12:17 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PrP4-00072v-00; Wed, 03 Jul 2002 17:11:10 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g63LBAv25925; Wed, 3 Jul 2002 17:11:10 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5417 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5417 > I would argue for the desirability of Stefan's suggested additions to > the hook machinery. I believe they are absolutely necessary. We have > right here a very good example why. > > I think such a feature could be a good idea. Stefan, could you state > the proposed specs (don't worry about implementation at this point) > for the feature? The spec corresponding (barring bugs) to my current implementation is as follows: Among the list of functions specified in a hook, you can now have one of the form (not . FOO) which says "if you come across FOO in the rest of the list, just ignore it". I.e. if the value of a hook is (a (not . b) c b), then `run-hooks' will only run `a' and `c' but not `b'. By "value of the hook" I mean the combined local+global lists, so the above example could happen in the case where the local value of the hook variable is (a (not . b) c b) but could also happen if the local value is (a (not . b) t) and the global value is (c b). If you use remove-hook, add-hook, run-hooks, this new functionality means that calling `remove-hook' will make sure that a subsequent `run-hooks' will not run this code. Actually, there are some unclear semantics when you do things like (add-hook 'foo 'bar) (add-hook 'foo 'bar nil 'local) (remove-hook 'foo 'bar 'local) The current code removes `bar' from the local value of `foo' but leaves it in the global one. My new code does the same and only a second (remove-hook 'foo 'bar 'local) will add a (not . bar) such that the global setting is overridden. This decision was arbitrary (mostly trying to minimize the change in behavior for better compatibility). Stefan