From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: questions about blink-cursor-mode Date: Wed, 18 Nov 2009 15:39:41 -0800 Message-ID: <5F1590E419004FC3988A3EB1CDFF52EB@us.oracle.com> References: <59E57B2EDA3D465DA20C720A327090CC@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258587702 26613 80.91.229.12 (18 Nov 2009 23:41:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 23:41:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Juanma Barranquero'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 00:41:35 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 1NAu9R-00035T-20 for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 00:41:29 +0100 Original-Received: from localhost ([127.0.0.1]:34921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAu9Q-0000d5-J9 for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2009 18:41:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAu9M-0000cq-O8 for emacs-devel@gnu.org; Wed, 18 Nov 2009 18:41:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAu9I-0000cA-0v for emacs-devel@gnu.org; Wed, 18 Nov 2009 18:41:24 -0500 Original-Received: from [199.232.76.173] (port=48477 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAu9H-0000c7-TQ for emacs-devel@gnu.org; Wed, 18 Nov 2009 18:41:19 -0500 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:53782) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NAu9H-0002pQ-Fl for emacs-devel@gnu.org; Wed, 18 Nov 2009 18:41:19 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nAINepcM026786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Nov 2009 23:40:52 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nAIFxa0E030085; Wed, 18 Nov 2009 23:42:59 GMT Original-Received: from abhmt004.oracle.com by acsmt357.oracle.com with ESMTP id 448976401258587577; Wed, 18 Nov 2009 17:39:37 -0600 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 18 Nov 2009 15:39:37 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acpop1Wxi7EOvfZ5Si+GmnU+q90WcwAAG93A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt356.oracle.com [141.146.40.156] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4B048616.0001:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:117219 Archived-At: > > 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? > > 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.) Thanks, Juanma. Now that I see that explanation, I recall that I knew this at one time - but I guess I forgot it. Note that not only is it not declared (e.g. defvar), it is also not bound, which is why `C-h v' doesn't recognize it. I still have the other questions I posed. In sum, what's the right (or a good) way to do what I need?