* Re: letting message-signature-file be a function
@ 1997-03-05 14:40 St. Suika Roberts
1997-03-06 3:53 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: St. Suika Roberts @ 1997-03-05 14:40 UTC (permalink / raw)
> It would be nice if the content of message-signature-file could be a
> function that could evaluate to the signature file name.
IWBNI the documentation also mentioned that one needs to set
message-signature-file to nil if one wants to have message-signature be
a function. It took me longer than I thought it should to figure out
that that was why I was getting double signatures when I first set
message-signature to call my sigrandomizer and insert the text instead
of changing the contents of ~/.signature (which speeded things up a
little bit).
(also it might be nice to have either an example function in the
documentation, and/or a function & variable so that one can specify just
the function to be inserted, and not worry about inserting the ^-- \n )
(defun sig ()
"call sigrnd"
(interactive)
(goto-char (point-max))
;; Insert the signature.
(unless (bolp)
(insert "\n"))
(insert "\n-- \n")
(call-process "sigrnd" nil t) ;; have this line be an if, and when one
;; has the varible set, use the specified
;; function, else use
;; message-signature-file
(goto-char (point-max))
(or (bolp) (insert "\n")))
(in case you can't tell, this is the message-signature-file insertion
function, hacked a bit, and I just coppied it out of my .emacs, so I
haven't tried the above modification)
Thanks,
Suika
--
wrobert2@mailhost.tcs.tulane.edu
"Amazing what caffeine and no sense of self-preservation can do..."
<a href="http://studentweb.tulane.edu/~wrobert2">lists</a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: letting message-signature-file be a function
1997-03-05 14:40 letting message-signature-file be a function St. Suika Roberts
@ 1997-03-06 3:53 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-03-06 3:53 UTC (permalink / raw)
"St. Suika Roberts" <wrobert2@mailhost.tcs.tulane.edu> writes:
> IWBNI the documentation also mentioned that one needs to set
> message-signature-file to nil if one wants to have message-signature be
> a function. It took me longer than I thought it should to figure out
> that that was why I was getting double signatures when I first set
> message-signature to call my sigrandomizer and insert the text instead
> of changing the contents of ~/.signature (which speeded things up a
> little bit).
The `message-signature' function is *not* supposed to insert anything
anywhere -- it should return (as a string) the signature that's to be
inserted.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@ifi.uio.no * Lars Ingebrigtsen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: letting message-signature-file be a function
1997-03-05 7:59 Steinar Bang
1997-03-05 13:40 ` Steinar Bang
@ 1997-03-06 3:52 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-03-06 3:52 UTC (permalink / raw)
Steinar Bang <sb@metis.no> writes:
> It would be nice if the content of message-signature-file could be a
> function that could evaluate to the signature file name.
I've now added this to the todo list.
> Right now I do this, by using message-signature, but then I have to
> have an additional function, like eg.
> (defun signature-get-body (sig-file-name)
> "Return the contents of sig-file-name, as a string."
> (save-excursion
> (set-buffer (get-buffer-create "*mumblefrotz*"))
> (insert-file-contents-literally sig-file-name)
> (prog1
> (buffer-string)
> (kill-buffer nil))))
You could say:
(defun sig-get-body (file)
(nnheader-temp-write t
(insert-file-contents-literally sig-file-name)))
--
(domestic pets only, the antidote for overdose, milk.)
larsi@ifi.uio.no * Lars Ingebrigtsen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: letting message-signature-file be a function
1997-03-05 7:59 Steinar Bang
@ 1997-03-05 13:40 ` Steinar Bang
1997-03-06 3:52 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 5+ messages in thread
From: Steinar Bang @ 1997-03-05 13:40 UTC (permalink / raw)
>>>>> Steinar Bang <sb@metis.no>:
> It would be nice if the content of message-signature-file could be a
> function that could evaluate to the signature file name.
> Right now I do this, by using message-signature, but then I have to
> have an additional function, like eg.
> (defun signature-get-body (sig-file-name)
> "Return the contents of sig-file-name, as a string."
> (save-excursion
> (set-buffer (get-buffer-create "*mumblefrotz*"))
> (insert-file-contents-literally sig-file-name)
> (prog1
> (buffer-string)
> (kill-buffer nil))))
> to get the body text of the signature.
BTW this is a proposal for the TODO list of qgnus.
--
===================<URL:http://www.metis.no/private/sb/>===================
Steinar Bang, NCR Norge AS, METIS ED&D, P.O.Box 1094, N-3194 Horten, Norway
Email: sb@metis.no, Phone: +47 33 03 57 16, Fax: +47 33 03 57 01
^ permalink raw reply [flat|nested] 5+ messages in thread
* letting message-signature-file be a function
@ 1997-03-05 7:59 Steinar Bang
1997-03-05 13:40 ` Steinar Bang
1997-03-06 3:52 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 5+ messages in thread
From: Steinar Bang @ 1997-03-05 7:59 UTC (permalink / raw)
It would be nice if the content of message-signature-file could be a
function that could evaluate to the signature file name.
Right now I do this, by using message-signature, but then I have to
have an additional function, like eg.
(defun signature-get-body (sig-file-name)
"Return the contents of sig-file-name, as a string."
(save-excursion
(set-buffer (get-buffer-create "*mumblefrotz*"))
(insert-file-contents-literally sig-file-name)
(prog1
(buffer-string)
(kill-buffer nil))))
to get the body text of the signature.
- Steinar
--
===================<URL:http://www.metis.no/private/sb/>===================
Steinar Bang, NCR Norge AS, METIS ED&D, P.O.Box 1094, N-3194 Horten, Norway
Email: sb@metis.no, Phone: +47 33 03 57 16, Fax: +47 33 03 57 01
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1997-03-06 3:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-05 14:40 letting message-signature-file be a function St. Suika Roberts
1997-03-06 3:53 ` Lars Magne Ingebrigtsen
-- strict thread matches above, loose matches on Subject: below --
1997-03-05 7:59 Steinar Bang
1997-03-05 13:40 ` Steinar Bang
1997-03-06 3:52 ` Lars Magne Ingebrigtsen
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).