all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: p.galbraith@globetrotter.net, emacs-devel@gnu.org, rms@gnu.org,
	wohler@newt.com
Subject: Re: custom-set-variables fails to set variable
Date: Sat, 12 Nov 2005 23:19:52 +0200	[thread overview]
Message-ID: <87br0p609r.fsf@jurta.org> (raw)
In-Reply-To: <200511120405.jAC45Tl25795@raven.dms.auburn.edu> (Luc Teirlinck's message of "Fri, 11 Nov 2005 22:05:29 -0600 (CST)")

> 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/

  parent reply	other threads:[~2005-11-12 21:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11859.1131656026@olgas.newt.com>
     [not found] ` <87lkzwxduk.fsf@olgas.newt.com>
     [not found]   ` <200511110043.jAB0hhc17895@raven.dms.auburn.edu>
2005-11-12  3:38     ` custom-set-variables fails to set variable Richard M. Stallman
2005-11-12  4:05       ` Luc Teirlinck
2005-11-12  4:49         ` Luc Teirlinck
2005-11-12 21:19         ` Juri Linkov [this message]
2005-11-12  4:41       ` Luc Teirlinck
2005-11-12 21:21         ` Richard M. Stallman
2005-11-12 23:36           ` Luc Teirlinck
2005-11-14  4:55             ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87br0p609r.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=p.galbraith@globetrotter.net \
    --cc=rms@gnu.org \
    --cc=wohler@newt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.