From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: questions about blink-cursor-mode Date: Thu, 19 Nov 2009 00:31:42 +0100 Message-ID: References: <59E57B2EDA3D465DA20C720A327090CC@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1258588981 30012 80.91.229.12 (19 Nov 2009 00:03:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 00:03:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 01:02:54 2009 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 1NAuU9-0003P5-Jv for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 01:02:53 +0100 Original-Received: from localhost ([127.0.0.1]:33756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAuU9-0007RX-86 for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2009 19:02:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAuU1-0007LY-3j for emacs-devel@gnu.org; Wed, 18 Nov 2009 19:02:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAuTv-000780-Vr for emacs-devel@gnu.org; Wed, 18 Nov 2009 19:02:44 -0500 Original-Received: from [199.232.76.173] (port=47508 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAuTv-00077T-HR for emacs-devel@gnu.org; Wed, 18 Nov 2009 19:02:39 -0500 Original-Received: from mail-bw0-f215.google.com ([209.85.218.215]:39070) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAu0K-0001W7-P5 for emacs-devel@gnu.org; Wed, 18 Nov 2009 18:32:05 -0500 Original-Received: by bwz7 with SMTP id 7so1921019bwz.26 for ; Wed, 18 Nov 2009 15:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=uba8ru0M8jwfLdZD3xSOyrLh2K29lVAEkUy+tSQRsCs=; b=rpUsN7dZMS4inmMTTd+mLpmwfphZ3dW0Ca0A0EtNJ5znTFHXX+soy51c2MHGlDjDeW dR9VwFfcrArba3edFK9QsHk0zzE95Fu41FVdlX2Zfyvfz6faAYsBAfarfYR/s5kjj+yx +qkjJYdtLqMCdNJbPtxnMKhZxr9OylWfhQb6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Oyxp+nMXPdpM0txtlPl/FTKX3FMQOH5ColBQJ5+5vPcbM5D41lJHVqKDnZRIWaLRH0 e+1T2gCJEn5UkdfmoJyUV3HajNUyNTHhZPGFsou/801P6VyIP+6BrYcgioXdnR6sN5Np HjLs3srKuw/NuI3F76DnjPR/P44S2lIzA2a8Y= Original-Received: by 10.204.34.201 with SMTP id m9mr7277057bkd.77.1258587122159; Wed, 18 Nov 2009 15:32:02 -0800 (PST) In-Reply-To: <59E57B2EDA3D465DA20C720A327090CC@us.oracle.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:117220 Archived-At: On Wed, Nov 18, 2009 at 19:59, Drew Adams wrote: > blink-cursor-mode is defined using `define-minor-mode', and the doc for that > says that "It finishes by running the mode hook variable `MODE-hook'." But there > doesn't seem to be any variable `blink-cursor-mode-hook'. How can that be? Why > is that? If there were such a hook, I could presumably use it to update my > variable that reflects the user's preference. The code for `define-minor-mode' does this: (let* (... (hook (intern (concat mode-name "-hook"))) (hook-on (intern (concat mode-name "-on-hook"))) (hook-off (intern (concat mode-name "-off-hook"))) ...) ... ,@body ;; The on/off hooks are here for backward compatibility only. (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) ... so the hook is run even if the symbol is not defvared. Some packages declare the hook variable, some don't. (Yes, I agree it would be better to always declare them, if only to add the standard "This is a normal hook blah blah" docstring.) Juanma