From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5834 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: September Gnus 0.60 is released Date: 02 Apr 1996 22:01:55 +0200 Message-ID: References: <199603282322.AAA23958@durin.uio.no> <199604011621.SAA02507@durin.uio.no> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035146379 1521 80.91.224.250 (20 Oct 2002 20:39:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:39:39 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id MAA09855 for ; Tue, 2 Apr 1996 12:39:54 -0800 Original-Received: from aegir.ifi.uio.no (4867@aegir.ifi.uio.no [129.240.94.24]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Tue, 2 Apr 1996 22:01:59 +0200 Original-Received: (from larsi@localhost) by aegir.ifi.uio.no ; Tue, 2 Apr 1996 22:01:56 +0200 Original-To: ding@ifi.uio.no Original-Lines: 43 Xref: main.gmane.org gmane.emacs.gnus.general:5834 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5834 Hallvard B Furuseth writes: > Should the hook be called: > * every time (user-mail-address) is called (i.e. a hook to the > (user-mail-addres) *function*), or > * just the first time user-mail-address is computed (i.e. a hook to the > user-mail-addres *variable*)? I think it should probably be called just the first time the address is computed. The point of this was that sometimes it can be rather much work to get to the official mail address, so doing it more than once is probably counterproductive. Now -- the `user-mail-address' has to have a default string value. The `user-mail-address' function should call the hook to alter the `user-mail-address' function *unless* it has been changed by the user. So how about doing something like this: ;; default.el (defvar user-mail-address (let ((address (concat (user-login-name) "@" (system-name)))) (put-text-property 0 1 'user-address-function 'get-official-address address) address)) (defun user-mail-address () (let ((func (get-text-property 0 1 'user-address-function user-mail-address))) (when func (funcall func))) user-mail-address) (defun get-official-address () (setq user-mail-address (whatever ...))) Kludgy as hell, but this should ensure that `get-official-address' is called once only, and that it is never called if the user sets `user-mail-address' in her .emacs file. -- "Yes. The journey through the human heart would have to wait until some other time."