From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: custom-set-variables fails to set variable Date: Sat, 12 Nov 2005 23:19:52 +0200 Organization: JURTA Message-ID: <87br0p609r.fsf@jurta.org> References: <11859.1131656026@olgas.newt.com> <87lkzwxduk.fsf@olgas.newt.com> <200511110043.jAB0hhc17895@raven.dms.auburn.edu> <200511120405.jAC45Tl25795@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1131831067 11259 80.91.229.2 (12 Nov 2005 21:31:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 Nov 2005 21:31:07 +0000 (UTC) Cc: p.galbraith@globetrotter.net, emacs-devel@gnu.org, rms@gnu.org, wohler@newt.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 12 22:31:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eb2wZ-0008EI-LT for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2005 22:29:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eb2wZ-0005g6-5B for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2005 16:29:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eb2vs-0005TW-RC for emacs-devel@gnu.org; Sat, 12 Nov 2005 16:29:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eb2vs-0005TF-08 for emacs-devel@gnu.org; Sat, 12 Nov 2005 16:29:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eb2vr-0005T8-QB for emacs-devel@gnu.org; Sat, 12 Nov 2005 16:29:07 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Eb2vq-0003ZS-SR; Sat, 12 Nov 2005 16:29:07 -0500 Original-Received: from mail.neti.ee (80-235-43-37-dsl.mus.estpak.ee [80.235.43.37]) by Relayhost1.neti.ee (Postfix) with ESMTP id 80BA21BC2; Sat, 12 Nov 2005 23:29:02 +0200 (EET) Original-To: Luc Teirlinck In-Reply-To: <200511120405.jAC45Tl25795@raven.dms.auburn.edu> (Luc Teirlinck's message of "Fri, 11 Nov 2005 22:05:29 -0600 (CST)") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:45845 Archived-At: > Remember that all of this came about because the mode's docstring > contains: > > Entry to this mode calls the value of `lisp-mode-hook' > if that value is non-nil. > > And `C-h v' on lisp-mode-hook did not work. Please note also that even when `C-h v' works correctly on a hook variable (like it works now), an attempt to follow the link to the source code (i.e. typing RET on the file name link in the Help buffer) fails. That is because `find-function-search-for-symbol' tries to find a definition of the variable whose name contains the suffix "-hook", but it is defined in the macro without the suffix "-hook" (e.g. `mh-letter-mode-hook' is defined as `define-derived-mode mh-letter-mode'). It is possible to specify the name of the definition explicitly by setting the symbol's property `definition-name'. `define-global-minor-mode' already does this, so `define-derived-mode' could do the same. This means putting a line like (if (not (boundp ',map)) (put ',map 'definition-name ',child)) before every `defvar' in the body of `define-derived-mode'. Checking the boundness is necessary for the case when the variable is already defined before evaluating the body of `define-derived-mode'. There are four variables defvar'ed currently in `define-derived-mode': `-hook', `-map', `-syntax-table' and `-abbrev-table'. The condition above works for the first three variables, but not for `-abbrev-table' which requires special treatment for the case when an abbrev table is defined in ~/.abbrev_defs. -- Juri Linkov http://www.jurta.org/emacs/