From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: fundamental-mode-hook Date: Thu, 08 Feb 2007 02:13:57 +0100 Message-ID: <45CA7955.1020602@gmail.com> References: <45CA70FA.6020002@gmail.com> <877iutvu8v.fsf@floss.red-bean.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1170897288 20010 80.91.229.12 (8 Feb 2007 01:14:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Feb 2007 01:14:48 +0000 (UTC) Cc: Emacs Devel To: kfogel@red-bean.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 08 02:14:37 2007 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 1HExrw-0002R0-QJ for ged-emacs-devel@m.gmane.org; Thu, 08 Feb 2007 02:14:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HExrw-00071s-6h for ged-emacs-devel@m.gmane.org; Wed, 07 Feb 2007 20:14:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HExrk-00071K-5r for emacs-devel@gnu.org; Wed, 07 Feb 2007 20:14:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HExrg-000717-2C for emacs-devel@gnu.org; Wed, 07 Feb 2007 20:14:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HExrf-000714-TG for emacs-devel@gnu.org; Wed, 07 Feb 2007 20:14:19 -0500 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HExrZ-00059A-Ak for emacs-devel@gnu.org; Wed, 07 Feb 2007 20:14:13 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:60121 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HExrL-00071F-8Z; Thu, 08 Feb 2007 02:14:00 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 In-Reply-To: <877iutvu8v.fsf@floss.red-bean.com> X-Antivirus: avast! (VPS 000711-3, 2007-02-07), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HExrL-00071F-8Z. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1HExrL-00071F-8Z 3a73264841396060dbbaeed4a8a3611b X-detected-kernel: Linux 2.6? (barebone, rare!) 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:66100 Archived-At: Karl Fogel wrote: > "Lennart Borgman (gmail)" writes: >> The elisp manual >> >> (info "(elisp) Major Mode Conventions") >> >> says that >> >> Each major mode should have a normal "mode hook" named >> `MODENAME-mode-hook'. >> >> fundamental-mode does not have such a hook. > > Do you have a use in mind for such a hook, or is the inconsistency > just bugging you? (Not a facetious question, I'm honestly trying to > figure out if the situation is a problem or not.) > > In simple.el, fundamental-mode's definition is pretty tiny: > > (defun fundamental-mode () > "Major mode not specialized for anything in particular. > Other major modes are defined by comparison with this one." > (interactive) > (kill-all-local-variables) > (unless delay-mode-hooks > (run-hooks 'after-change-major-mode-hook))) > > Hmm, for one thing, I'm not sure why it doesn't just say > > (delay-mode-hooks 'after-change-major-mode-hook) > > instead of checking the variable delay-mode-hooks manually. Aside > from that, it would be pretty easy to stick a run-hooks call in there, > but would it really help anyone do anything they couldn't do before? I am not sure what to answer at the moment. I just found this inconsistency when I tried to check if a function was a major mode function. I tested to see if the hook variable existed (probably not the best way, but that is what I did). I then remembered that there are no hook for new buffers. Are they not set up in fundamental-mode? BTW, there are more major modes missing this hook: Info-mode, xml-mode is what I have noticed so far.