Gnus development mailing list
 help / color / mirror / Atom feed
* September Gnus 0.60 is released
@ 1996-03-28  6:25 Lars Magne Ingebrigtsen
  1996-03-28 10:49 ` Magnus Hammerin
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-03-28  6:25 UTC (permalink / raw)


Bug fixes.

Get it from <URL:http://www.ifi.uio.no/~larsi/sgnus.tar.gz> or 
"ftp.ifi.uio.no:/pub/emacs/gnus/".

ChangeLog since last release:

Thu Mar 28 06:12:28 1996  Lars Magne Ingebrigtsen  <larsi@aegir.ifi.uio.no>

	* message.el (message-send-mail): Remove Gcc header.
	(message-setup): Would insert default headers in the body.

Wed Mar 27 11:25:41 1996  Jack Vinson  <jvinson@cheux.ecs.umass.edu>

	* message.el:  Lots of small typos corrected.
	(message-goto-signature): Added missing function.
	(message-mode): Updated the description.
	(message-send): Corrected format for first y-or-n-p.
	(message-forward): Added description.

Thu Mar 28 05:31:48 1996  Lars Magne Ingebrigtsen  <larsi@aegir.ifi.uio.no>

	* message.el (message-send-mail): Make sure point is in the right
	buffer. 
	(message-send-mail): Would remove Bcc headers.
	(message-insert-courtesy-copy): Would bug out in non-news
	buffers. 
	(message-send-news): Don't remove Gcc headers from the message
	buffer. 
	(message-ignored-mail-headers): New variable. 

Thu Mar 28 05:30:02 1996  Lars Magne Ingebrigtsen  <larsi@larsi@ifi.uio.no>

	* gnus-xmas.el (gnus-xmas-copy-article-buffer): Return the proper
	value. 

	* message.el (message-mode-map): Would make XEmacs barf.

Thu Mar 28 03:49:32 1996  Lars Magne Ingebrigtsen  <larsi@hler.ifi.uio.no>

	* gnus.el (gnus-group-make-group): Wouldn't allow usage of virtual
	server names.

	* message.el (message-cite-hook): New variable.

Thu Mar 28 03:48:54 1996  Kai Grossjohann  <grossjoh@dusty.informatik.uni-dortmund.de>

	* message.el (message-yank-original): Run `message-cite-hook'.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28  6:25 September Gnus 0.60 is released Lars Magne Ingebrigtsen
@ 1996-03-28 10:49 ` Magnus Hammerin
  1996-03-28 11:28   ` Kai Grossjohann
  0 siblings, 1 reply; 21+ messages in thread
From: Magnus Hammerin @ 1996-03-28 10:49 UTC (permalink / raw)
  Cc: ding

I had some problems when replying to mails. This is probably XEmacs
related (with zmacs-region). The included patch fixes it.

Another thing I noticed is that it does not seem to be possible to
change the "From: " line anymore. I used gnus-user-full-name before but
I can't find anything similar in message.el. Of course I can manually
insert a From: line in the message, but it would be great if it could be
automized.

SuperCite was not very easy to set up either, I had to set
(setq message-indent-citation-function nil)
(setq message-citation-line-function nil)

to get it to work, I don't know if there are any easier way to do this,
but it works.

-Magnus.

PS. This is sgnus-0.60 and XEmacs-19.13 DS.

--- message.el-orig     Thu Mar 28 07:25:01 1996
+++ message.el  Thu Mar 28 10:59:59 1996
@@ -860,7 +860,7 @@
       ;; It is cleaner to avoid activation, even though the command
       ;; loop would deactivate the mark because we inserted text.
       (goto-char (prog1 (mark t)
-                  (set-marker (mark-marker) (point) (current-buffer))))
+                  (set-marker (mark-marker t) (point) (current-buffer))))
       (unless (bolp)
        (insert ?\n))
       (unless modified


--- gnus-msg.el-orig    Thu Mar 28 07:24:54 1996
+++ gnus-msg.el Thu Mar 28 11:21:38 1996
@@ -225,7 +225,7 @@
        (message-yank-original)
        (setq beg (or beg (mark t))))
       (when articles (insert "\n")))
-    (set-marker (mark-marker) (point))
+    (set-marker (mark-marker t) (point))
     (goto-char beg)))
 
 (defun gnus-summary-cancel-article (n)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 10:49 ` Magnus Hammerin
@ 1996-03-28 11:28   ` Kai Grossjohann
  1996-03-28 12:36     ` Magnus Hammerin
  1996-03-29  5:26     ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 21+ messages in thread
From: Kai Grossjohann @ 1996-03-28 11:28 UTC (permalink / raw)
  Cc: Lars Magne Ingebrigtsen, ding

>>>>> On 28 Mar 1996 11:49:42 +0100, Magnus Hammerin
>>>>> <magnush@epact.se> said:

  Magnus> Another thing I noticed is that it does not seem to be
  Magnus> possible to change the "From: " line anymore. [...]

Doesn't user-full-name do this?  And user-mail-address?  And there is
message-from-style for the general layout.

  Magnus> SuperCite was not very easy to set up either, I had to set
  Magnus> (setq message-indent-citation-function nil)
  Magnus> (setq message-citation-line-function nil)
  Magnus> to get it to work, I don't know if there are any easier way
  Magnus> to do this, but it works.

That's what I did, too.  I'm sure that Supercite will someday support
SGnus or the other way round so that this will be simpler in the
future.

Lars,
what about adding a message-do-citation-stuff function to message.el
that could be put in the message-cite-hook?  This way, you could tell
people to
    (remove-hook 'message-cite-hook 'message-do-citation-stuff)
    (add-hook 'message-cite-hook 'sc-cite-original)
to use SC.  Or something?

        kai
--
There ain't no cure for the summer time blues.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 11:28   ` Kai Grossjohann
@ 1996-03-28 12:36     ` Magnus Hammerin
  1996-03-28 13:16       ` Kai Grossjohann
                         ` (2 more replies)
  1996-03-29  5:26     ` Lars Magne Ingebrigtsen
  1 sibling, 3 replies; 21+ messages in thread
From: Magnus Hammerin @ 1996-03-28 12:36 UTC (permalink / raw)
  Cc: Lars Magne Ingebrigtsen, ding

>>>>> "Kai" == Kai Grossjohann
>>>>> <grossjoh@charly.informatik.uni-dortmund.de> writes:

>>>>> On 28 Mar 1996 11:49:42 +0100, Magnus Hammerin
>>>>> <magnush@epact.se> said:

Magnus> Another thing I noticed is that it does not seem to be
Magnus> possible to change the "From: " line anymore. [...]

Kai> Doesn't user-full-name do this?  And user-mail-address?  And there is
Kai> message-from-style for the general layout.

user-full-name is a built in function that returns your full
name, ie not easily changable. user-mail-address is a variable that
contains the mailaddress, but it is not used I think, at least not to
build the complete From: it is used to build parts of it as a
backup. The function message-make-from builds the From: header and it
does not look if there is a variable set to override the default, I
would like that.

-Magnus.




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 12:36     ` Magnus Hammerin
@ 1996-03-28 13:16       ` Kai Grossjohann
  1996-03-28 14:26         ` Per Abrahamsen
  1996-03-29  2:04       ` Hallvard B Furuseth
  1996-03-29  5:27       ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 21+ messages in thread
From: Kai Grossjohann @ 1996-03-28 13:16 UTC (permalink / raw)
  Cc: ding

>>>>> On 28 Mar 1996 13:36:05 +0100, Magnus Hammerin
>>>>> <magnush@epact.se> said:

  Magnus> Another thing I noticed is that it does not seem to be
  Magnus> possible to change the "From: " line anymore. [...]

There is message-generic-domain.  Don't know if that will suffice,
though.

        kai
--
There ain't no cure for the summer time blues.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 13:16       ` Kai Grossjohann
@ 1996-03-28 14:26         ` Per Abrahamsen
  1996-03-28 23:22           ` Hallvard B Furuseth
  1996-03-29  5:31           ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 21+ messages in thread
From: Per Abrahamsen @ 1996-03-28 14:26 UTC (permalink / raw)


>>>>> "KG" == Kai Grossjohann <grossjoh@informatik.uni-dortmund.de> writes:

KG> There is message-generic-domain.  Don't know if that will suffice,
KG> though.

If we (eh... Lars) is cleaning up unnecessary valiables, I think the
standard `user-mail-address' and `mail-host-address' should suffice.


user-mail-address's value is "abraham@dina.kvl.dk"

Documentation:
*Full mailing address of this user.
This is initialized based on `mail-host-address',
after your init file is read, in case it sets `mail-host-address'.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 14:26         ` Per Abrahamsen
@ 1996-03-28 23:22           ` Hallvard B Furuseth
  1996-03-29 16:11             ` Lars Magne Ingebrigtsen
  1996-03-29  5:31           ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 21+ messages in thread
From: Hallvard B Furuseth @ 1996-03-28 23:22 UTC (permalink / raw)
  Cc: ding

> If we (eh... Lars) is cleaning up unnecessary valiables, I think the
> standard `user-mail-address' and `mail-host-address' should suffice.
> 
> user-mail-address's value is "abraham@dina.kvl.dk"
> 
> Documentation:
> *Full mailing address of this user.
> This is initialized based on `mail-host-address',
> after your init file is read, in case it sets `mail-host-address'.

I'd like a user-mail-address-hook which programs (optionally) should run
before they use user-mail-address.  This is because the "official" mail
address (as opposed to some "working" mail address) can be expensive to
compute, so it should only be computed when it's needed, not in
default.el.  user-mail-address would still be set at startup, so that
programs that don't run the hook will still work.

It gets a little hairy because the _system manager_ might provide a hook
in default.el while the _user_ provides his address in .emacs -- and if
so, the user's setting should be used.


Anyway, here is an attempt.  I introduced (user-mail-address) so
programmers won't have to say (progn (run-hooks ...) user-mail-address)
all the time.

(defvar computed-user-mail-address nil
  "The mail address which is originally computed at startup.
This can be used to check whether the user has configured his address.")

(defun user-mail-address ()
  "Call this instead of using the variable `user-mail-address' directly."
  (if (or (null user-mail-address)
	  ;; hmm -- `eq' or `equal'?  Has `eq' any disadvantages here?
	  ;; Otherwise it's preferred, because it lets the user
	  ;; explicitly set the address to the original address in
	  ;; case he likes that better than the computed version
	  ;; (and he doesn't need to know about the hook:-)
	  (eq user-mail-address computed-user-mail-addresss))
      ;; If the address has not been modified since startup, call this hook.
      ;; That way, if the system manager sets the hook in default.el but the
      ;; user sets the address in .emacs, the user's value will take
      ;; precedence.
      (run-hooks 'user-mail-address-hooks))
  user-mail-address)

Or maybe the hook should be responsible for checking that it doesn't
override the user's setting.  (I.e. the hook could check
computed-user-mail-address).  It would normally have to reset itself
after use anyway, so it's not called again.

startup.el would execute
  (or computed-user-mail-address
      (setq computed-user-mail-address (concat (user-login-name) "@"
                                               (or mail-host-address
                                                   (system-name)))))
  (or user-mail-address
      (setq user-mail-address computed-user-mail-address))


To test it before we can patch startup.el, gnus.el can use

  (and (not computed-user-mail-address)
       (equal (setq computed-user-mail-address (concat (user-login-name) "@"
						       (or mail-host-address
							   (system-name))))
	      user-mail-address)
       (setq computed-user-mail-address user-mail-address))


Regards,

Hallvard


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 12:36     ` Magnus Hammerin
  1996-03-28 13:16       ` Kai Grossjohann
@ 1996-03-29  2:04       ` Hallvard B Furuseth
  1996-03-29  5:27       ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 21+ messages in thread
From: Hallvard B Furuseth @ 1996-03-29  2:04 UTC (permalink / raw)
  Cc: grossjoh, Lars Magne Ingebrigtsen, ding

> user-full-name is a built in function that returns your full
> name, ie not easily changable.

Yes it is, though I don't know if that is intentional.
It returns the variable user-full-name, which is not read-only.
It is initialized from the $NAME environment variable if it is set.


Regards,

Hallvard


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 11:28   ` Kai Grossjohann
  1996-03-28 12:36     ` Magnus Hammerin
@ 1996-03-29  5:26     ` Lars Magne Ingebrigtsen
  1996-03-29  9:08       ` Small thinko in .message.el variable initialisation Jan Vroonhof
  1 sibling, 1 reply; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-03-29  5:26 UTC (permalink / raw)


Kai Grossjohann <grossjoh@ls6.informatik.uni-dortmund.de> writes:

> what about adding a message-do-citation-stuff function to message.el
> that could be put in the message-cite-hook?  This way, you could tell
> people to
>     (remove-hook 'message-cite-hook 'message-do-citation-stuff)
>     (add-hook 'message-cite-hook 'sc-cite-original)
> to use SC.  Or something?

I've now removed `message-cite-hook'.  `message-cite-function' is a
new variable that can be set to `sc-cite-original' to get SuperCite
action.  The default is `message-cite-original', which does the
default thaaang.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 12:36     ` Magnus Hammerin
  1996-03-28 13:16       ` Kai Grossjohann
  1996-03-29  2:04       ` Hallvard B Furuseth
@ 1996-03-29  5:27       ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-03-29  5:27 UTC (permalink / raw)


Magnus Hammerin <magnush@epact.se> writes:

> user-full-name is a built in function that returns your full
> name, ie not easily changable. 

Oh, just set the `user-full-name' variable to whatever you want.  The
`user-full-name' function is overridden by that variable.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 14:26         ` Per Abrahamsen
  1996-03-28 23:22           ` Hallvard B Furuseth
@ 1996-03-29  5:31           ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-03-29  5:31 UTC (permalink / raw)


abraham@dina.kvl.dk (Per Abrahamsen) writes:

> KG> There is message-generic-domain.  Don't know if that will suffice,
> KG> though.
> 
> If we (eh... Lars) is cleaning up unnecessary valiables, I think the
> standard `user-mail-address' and `mail-host-address' should suffice.

Yes, that `message-generic-domain' seems unnecessary.  It'll be
removed in 0.61.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Small thinko in .message.el variable initialisation.
  1996-03-29  5:26     ` Lars Magne Ingebrigtsen
@ 1996-03-29  9:08       ` Jan Vroonhof
  0 siblings, 0 replies; 21+ messages in thread
From: Jan Vroonhof @ 1996-03-29  9:08 UTC (permalink / raw)
  Cc: ding


In 5.0.15 I had gnus-local-organisation to "ETHZ Mathematik". The new
message.el has the following code:

(defvar gnus-local-organization)
(defvar message-user-organization 
  (if (boundp 'gnus-local-organization)
      gnus-local-organization t)
  "*String to be used as an Organization header.
If t, use `message-user-organization-file'.")

This is obviously intended to remain compatible with the old
gnus. However it only works if gnus-local-organisation is set in
.emacs not if its only set in .gnus. May be message.el gets loaded
before .gnus is?

Jan


-- 
Jan Vroonhof                    http://www.math.ethz.ch/~vroonhof/          
Mathematik,                                  vroonhof@math.ethz.ch
HG E16, ETH-Zentrum,                      Tel: +41-1-6325456/25154
Raemistrasse 101, CH-8092 Zuerich.              Fax: +41-1-6321085


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-28 23:22           ` Hallvard B Furuseth
@ 1996-03-29 16:11             ` Lars Magne Ingebrigtsen
  1996-03-29 16:39               ` Hallvard B Furuseth
  1996-03-29 16:58               ` Scott Blachowicz
  0 siblings, 2 replies; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-03-29 16:11 UTC (permalink / raw)


Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:

> I'd like a user-mail-address-hook which programs (optionally) should run
> before they use user-mail-address.  This is because the "official" mail
> address (as opposed to some "working" mail address) can be expensive to
> compute, so it should only be computed when it's needed, not in
> default.el.  

I thought most sites just did something like:

(setq user-mail-address (concat (user-login-name) "@our.nice.site"))

What did you have in mind that a typical `user-mail-address-hook'
would do?

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-29 16:11             ` Lars Magne Ingebrigtsen
@ 1996-03-29 16:39               ` Hallvard B Furuseth
  1996-04-01 15:46                 ` Lars Magne Ingebrigtsen
  1996-03-29 16:58               ` Scott Blachowicz
  1 sibling, 1 reply; 21+ messages in thread
From: Hallvard B Furuseth @ 1996-03-29 16:39 UTC (permalink / raw)
  Cc: ding

> Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:
> 
>> I'd like a user-mail-address-hook which programs (optionally) should run
>> before they use user-mail-address.  This is because the "official" mail
>> address (as opposed to some "working" mail address) can be expensive to
>> compute, so it should only be computed when it's needed, not in
>> default.el.  
> 
> I thought most sites just did something like:
> 
> (setq user-mail-address (concat (user-login-name) "@our.nice.site"))

That doesn't work here at UiO outside ifi.uio.
Well, this does work:
	(concat (user-login-name) "@any.ugly.uio-machine.name")
but it does not yield the user's official address.

The reason is that all of UiO (except ifi.uio) has a common user
database, but UiO has several sub-domains (for the various departments).
The *only* way to learn which sub-domain a user belongs to, is to ask
the mail system.

Example:

my-user@my-host-name:	         hbf@durin.uio.no
my-email-address:	h.b.furuseth@usit.uio.no

In outgoing mail, user@machine addresses are converted to the user's
official address, so that recipients will never see anything else than
the official address --- except in news messages.  Ouch.

> What did you have in mind that a typical `user-mail-address-hook'
> would do?

The one at UiO would set user-mail-address to the output of the shell
command

	`pk address <<user-login-name>>`


Regards,

Hallvard


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-29 16:11             ` Lars Magne Ingebrigtsen
  1996-03-29 16:39               ` Hallvard B Furuseth
@ 1996-03-29 16:58               ` Scott Blachowicz
  1996-03-29 18:12                 ` Russ Allbery
  1 sibling, 1 reply; 21+ messages in thread
From: Scott Blachowicz @ 1996-03-29 16:58 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> wrote:

> What did you have in mind that a typical `user-mail-address-hook'
> would do?

Maybe someone could construct a different user-mail-address based on the
contents of the message?  For example, if I have a message that I'm
posting to a rec.* newsgroup, chances are it's not work-related and I
might want to use my personal email address instead of my work email
address.  (???)

Scott Blachowicz  Ph: 206/283-8802x240   Mathsoft (Data Analysis Products Div)
                                         1700 Westlake Ave N #500
scott@statsci.com                        Seattle, WA USA   98109
Scott.Blachowicz@seaslug.org


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-29 16:58               ` Scott Blachowicz
@ 1996-03-29 18:12                 ` Russ Allbery
  0 siblings, 0 replies; 21+ messages in thread
From: Russ Allbery @ 1996-03-29 18:12 UTC (permalink / raw)


Scott Blachowicz <scott@statsci.com> writes:

> Maybe someone could construct a different user-mail-address based on the
> contents of the message?  For example, if I have a message that I'm
> posting to a rec.* newsgroup, chances are it's not work-related and I
> might want to use my personal email address instead of my work email
> address.  (???)

I currently do this by inserting From: lines into my messages before they
go out.  I'd love to have a user-mail-address line.  I read all news from
one account, but use three different e-mail addresses depending on the
group.

-- 
Russ Allbery (rra@cs.stanford.edu)      <URL:http://www.eyrie.org/~eagle/>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-03-29 16:39               ` Hallvard B Furuseth
@ 1996-04-01 15:46                 ` Lars Magne Ingebrigtsen
  1996-04-01 16:21                   ` Hallvard B Furuseth
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-04-01 15:46 UTC (permalink / raw)


Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:

> The reason is that all of UiO (except ifi.uio) has a common user
> database, but UiO has several sub-domains (for the various departments).
> The *only* way to learn which sub-domain a user belongs to, is to ask
> the mail system.

Right.  The `user-mail-address-hook' thing would avoid having to do
this each time an Emacs is started.  

Have you sent off a patch for this to Stallman?

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-04-01 15:46                 ` Lars Magne Ingebrigtsen
@ 1996-04-01 16:21                   ` Hallvard B Furuseth
  1996-04-02 20:01                     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 21+ messages in thread
From: Hallvard B Furuseth @ 1996-04-01 16:21 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
> Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:
> 
>> The reason is that all of UiO (except ifi.uio) has a common user
>> database, but UiO has several sub-domains (for the various departments).
>> The *only* way to learn which sub-domain a user belongs to, is to ask
>> the mail system.
> 
> Right.  The `user-mail-address-hook' thing would avoid having to do
> this each time an Emacs is started.  
> 
> Have you sent off a patch for this to Stallman?

No, I couldn't think of a "clean and obvious way" to do it, so I though
we could trash it out here on ding@ifi first.

Ding'ers, please take a look and see if you can think of a not-too-ugly
interface to this.

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*)?

Remember:
* Some packages we can't get at, don't call the (user-mail-address)
  function.

* Someone liked a hook like this to compute user-mail-address dependent
  on the current article or whatever.  That's wrong, because the
  article's computed address will linger and be used in other places as
  well (if the function doesn't call (user-mail-adress)).  So maybe we'd
  need another variable for this "local" addresses.  Here is one variant:

	(defvar user-mail-address-function nil
	  "Function which may be used to compute user-mail-address
	either temporarily or permanently.  To compute it permanently,
	it should modify `user-mail-address' and maybe reset itself to nil.")

	(defun user-mail-address ()
	  (or (and user-mail-address-function
		   (funcall user-mail-address-function))
	      (progn
		;; well, we don't really need this hook now
		;; that we have user-mail-address-function
		(run-hooks 'user-mail-address-hooks)
		user-mail-address))))


* We could solve everything by letting the user-mail-address variable
  be a sexp which should be evalled or some such hack -- except this
  wouldn't be backwards compatible.

Herez a repost of the original suggestion, if you deleted my article:

> From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
> Date: Fri, 29 Mar 1996 00:22:50 +0100
> To: abraham@dina.kvl.dk (Per Abrahamsen)
> CC: ding@ifi.uio.no
> Subject: Re: September Gnus 0.60 is released
> Message-Id: <199603282322.AAA23958@durin.uio.no>
> 
> If we (eh... Lars) is cleaning up unnecessary valiables, I think the
> standard `user-mail-address' and `mail-host-address' should suffice.
> 
> user-mail-address's value is "abraham@dina.kvl.dk"
> 
> Documentation:
> *Full mailing address of this user.
> This is initialized based on `mail-host-address',
> after your init file is read, in case it sets `mail-host-address'.

I'd like a user-mail-address-hook which programs (optionally) should run
before they use user-mail-address.  This is because the "official" mail
address (as opposed to some "working" mail address) can be expensive to
compute, so it should only be computed when it's needed, not in
default.el.  user-mail-address would still be set at startup, so that
programs that don't run the hook will still work.

It gets a little hairy because the _system manager_ might provide a hook
in default.el while the _user_ provides his address in .emacs -- and if
so, the user's setting should be used.


Anyway, here is an attempt.  I introduced (user-mail-address) so
programmers won't have to say (progn (run-hooks ...) user-mail-address)
all the time.

(defvar computed-user-mail-address nil
  "The mail address which is originally computed at startup.
This can be used to check whether the user has configured his address.")

(defun user-mail-address ()
  "Call this instead of using the variable `user-mail-address' directly."
  (if (or (null user-mail-address)
	  ;; hmm -- `eq' or `equal'?  Has `eq' any disadvantages here?
	  ;; Otherwise it's preferred, because it lets the user
	  ;; explicitly set the address to the original address in
	  ;; case he likes that better than the computed version
	  ;; (and he doesn't need to know about the hook:-)
	  (eq user-mail-address computed-user-mail-addresss))
      ;; If the address has not been modified since startup, call this hook.
      ;; That way, if the system manager sets the hook in default.el but the
      ;; user sets the address in .emacs, the user's value will take
      ;; precedence.
      (run-hooks 'user-mail-address-hooks))
  user-mail-address)

Or maybe the hook should be responsible for checking that it doesn't
override the user's setting.  (I.e. the hook could check
computed-user-mail-address).  It would normally have to reset itself
after use anyway, so it's not called again.

startup.el would execute
  (or computed-user-mail-address
      (setq computed-user-mail-address (concat (user-login-name) "@"
                                               (or mail-host-address
                                                   (system-name)))))
  (or user-mail-address
      (setq user-mail-address computed-user-mail-address))


To test it before we can patch startup.el, gnus.el can use

  (and (not computed-user-mail-address)
       (equal (setq computed-user-mail-address (concat (user-login-name) "@"
						       (or mail-host-address
							   (system-name))))
	      user-mail-address)
       (setq computed-user-mail-address user-mail-address))


Regards,

Hallvard


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-04-01 16:21                   ` Hallvard B Furuseth
@ 1996-04-02 20:01                     ` Lars Magne Ingebrigtsen
  1996-04-02 20:38                       ` Per Abrahamsen
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-04-02 20:01 UTC (permalink / raw)


Hallvard B Furuseth <h.b.furuseth@usit.uio.no> 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."


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-04-02 20:01                     ` Lars Magne Ingebrigtsen
@ 1996-04-02 20:38                       ` Per Abrahamsen
  1996-04-16 20:01                         ` Hallvard B Furuseth
  0 siblings, 1 reply; 21+ messages in thread
From: Per Abrahamsen @ 1996-04-02 20:38 UTC (permalink / raw)



Wouldn't it be easier to do something like this:

default.el:
	
	(setq mail-host-address (getenv "MAILHOST"))

/etc/login (or whatever):

	MAILHOST = `whatever`
	export MAILHOST


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: September Gnus 0.60 is released
  1996-04-02 20:38                       ` Per Abrahamsen
@ 1996-04-16 20:01                         ` Hallvard B Furuseth
  0 siblings, 0 replies; 21+ messages in thread
From: Hallvard B Furuseth @ 1996-04-16 20:01 UTC (permalink / raw)
  Cc: ding

Per Abrahamsen <abraham@dina.kvl.dk> writes:
> Wouldn't it be easier to do something like this:
> 
> default.el:
> 	
> 	(setq mail-host-address (getenv "MAILHOST"))
> 
> /etc/login (or whatever):
> 
> 	MAILHOST = `whatever`
> 	export MAILHOST

No, that only sets the domain part of the address.  The point is that
when the user has *not* set user-mail-address, the default.el at UiO
would have to call an external process to learn his official address.
This operation should be delayed until the address is actually needed.


Regards,

Hallvard


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~1996-04-16 20:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-28  6:25 September Gnus 0.60 is released Lars Magne Ingebrigtsen
1996-03-28 10:49 ` Magnus Hammerin
1996-03-28 11:28   ` Kai Grossjohann
1996-03-28 12:36     ` Magnus Hammerin
1996-03-28 13:16       ` Kai Grossjohann
1996-03-28 14:26         ` Per Abrahamsen
1996-03-28 23:22           ` Hallvard B Furuseth
1996-03-29 16:11             ` Lars Magne Ingebrigtsen
1996-03-29 16:39               ` Hallvard B Furuseth
1996-04-01 15:46                 ` Lars Magne Ingebrigtsen
1996-04-01 16:21                   ` Hallvard B Furuseth
1996-04-02 20:01                     ` Lars Magne Ingebrigtsen
1996-04-02 20:38                       ` Per Abrahamsen
1996-04-16 20:01                         ` Hallvard B Furuseth
1996-03-29 16:58               ` Scott Blachowicz
1996-03-29 18:12                 ` Russ Allbery
1996-03-29  5:31           ` Lars Magne Ingebrigtsen
1996-03-29  2:04       ` Hallvard B Furuseth
1996-03-29  5:27       ` Lars Magne Ingebrigtsen
1996-03-29  5:26     ` Lars Magne Ingebrigtsen
1996-03-29  9:08       ` Small thinko in .message.el variable initialisation Jan Vroonhof

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).