From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier " Newsgroups: gmane.emacs.help Subject: Re: Journal package for Emacs? Date: 09 Sep 2002 10:49:53 -0400 Organization: Yale University Sender: help-gnu-emacs-admin@gnu.org Message-ID: <5ln0qrtdym.fsf@rum.cs.yale.edu> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1031583975 3531 127.0.0.1 (9 Sep 2002 15:06:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Sep 2002 15:06:15 +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 17oQ7A-0000um-00 for ; Mon, 09 Sep 2002 17:06:13 +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 17oQ7F-0001Ca-00; Mon, 09 Sep 2002 11:06:17 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.ycc.yale.edu!rum.cs.yale.edu!rum.cs.yale.edu Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-NNTP-Posting-Host: rum.cs.yale.edu User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 9 Sep 2002 10:49:53 -0400, rum.cs.yale.edu Original-Xref: nntp.stanford.edu gnu.emacs.help:104625 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:1182 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1182 >>>>> "David" == David Forrest writes: > Is this good elisp? Hmm... I'm sorry to say I've seen better: > (defun my-journal-hook () > "Go to the bottom and insert a timestamp on journal files > Identified with the is-journal local variable thus: > -*- is-journal : t -*- " The first line of a docstring should stand on its own (i.e. end with a period, basically) so that it makes sense when displayed by M-x apropos. > (if (local-variable-p 'is-journal) What for exactly ? `local-variable-p' should basically never be used, except for very unusual circumstances. > (progn (end-of-buffer) ( insert-current-time)) (if a (progn b c)) can be advantageously replaced with (when a b c). > )) This is a clear mark of bad Lisp. > ;where insert-current-time is: If you indent this, it'll jump to column 40. Use `;;' instead. Stefan