From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Journal package for Emacs? Date: Mon, 09 Sep 2002 15:25:46 -0600 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3D7D11DA.9060107@ihs.com> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1031607377 23506 127.0.0.1 (9 Sep 2002 21:36:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Sep 2002 21:36:17 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17oWCe-00066z-00 for ; Mon, 09 Sep 2002 23:36:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17oWCW-00059J-00; Mon, 09 Sep 2002 17:36:08 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: fu-berlin.de 1031606746 61592014 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: nntp.stanford.edu gnu.emacs.help:104642 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1198 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1198 David Forrest wrote: > On 9 Sep 2002, Stefan Monnier wrote: ... > Thanks, I was certain that was true, and I appreciate your response. > I now have: > > (defun my-journal-hook () > "Append time stamp to -*- is-journal: t -*- files." > (when (local-variable-p 'is-journal)) > (end-of-buffer) > (insert-current-time))) > > >>> (if (local-variable-p 'is-journal) >>> >>What for exactly ? `local-variable-p' should basically never be used, >>except for very unusual circumstances. >> > > I was looking for a function like 'defined' and am probably missing > something very basic. (when 'is-journal) is always true and stamps > everything, while (when is-journal) stamps journal files, but faults with > "Symbol's value as variable is void: is-journal" Here's the conventional way to handle that: (defvar my-journal-var nil "*Non-nil if visited file is a journal.") (make-variable-buffer-local 'my-journal-var) (defun my-journal-hook () "Append time stamp to -*- my-journal-var: t -*- files." (when is-journal) (end-of-buffer) (insert-current-time))) -- Kevin Rodgers