* .signature vs message.el @ 1996-03-28 15:26 Robert Pluim 1996-03-28 19:34 ` Jack Vinson 0 siblings, 1 reply; 7+ messages in thread From: Robert Pluim @ 1996-03-28 15:26 UTC (permalink / raw) Hmm, message.el is very nice, but it conflicts with the way I normally do mail signatures. By default, I don't want a signature added to my outgoing mail, but I want to be able to add one using C-c C-w . If I set message-signature to nil, the first happens, but then I can't do the second. If I set it to t, then it gets added automatically every time I send a message, which I don't want either. Any suggestions? Robert PS I'm using sgnus-0.60 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: .signature vs message.el 1996-03-28 15:26 .signature vs message.el Robert Pluim @ 1996-03-28 19:34 ` Jack Vinson 1996-03-29 5:41 ` Lars Magne Ingebrigtsen 0 siblings, 1 reply; 7+ messages in thread From: Jack Vinson @ 1996-03-28 19:34 UTC (permalink / raw) >>>>> "RP" == Robert Pluim <pluim@xylint.co.uk> writes: RP> message.el is very nice, but it conflicts with the way I normally do RP> mail signatures. By default, I don't want a signature added to my RP> outgoing mail, but I want to be able to add one using C-c C-w . If I RP> set message-signature to nil, the first happens, but then I can't do RP> the second. If I set it to t, then it gets added automatically every RP> time I send a message, which I don't want either. Any suggestions? The way this is done in sendmail is a) if mail-signature is 't, then insert the contents of mail-signature-file into the *mail* buffer before the user starts composing the message. b) if mail-signature is non-nil, it must be a string that is the signature. Insert that. c) Otherwise, do nothing. This is handled by mail-setup which is now message-setup. The function mail-signature, run by C-c C-w, simply inserted the contents of the mail-signature-file into the buffer at the end of the buffer, or at the current point given a prefix argument. The problem is that Lars has changed message-setup to call message-insert-signature, rather than writing similar code twice. If this is to remain the case, we need another variable: message-auto-signature or something which we can set 't when we want message to insert our message-signature for us and 'nil when we want to do it ourselves with C-c C-w. If you want to use it now, the patch would be something like this. There may be a line number or two messed up. I did not test this, but the main change is one line in message-setup which only calls message-insert-signature if message-auto-signature is non-nil. message-signature needs to be non-nil if ANY signature is to be inserted. This makes sense; a nil message-signature indicates there is no signature to be inserted. *** ChangeLog~ Thu Mar 28 01:25:09 1996 --- ChangeLog Thu Mar 28 14:28:03 1996 *************** *** 1,3 **** --- 1,8 ---- + Thu Mar 28 14:27:54 1996 Jack Vinson <jvinson@cheux.ecs.umass.edu> + + * message.el (message-auto-signature): New Variable. + (message-setup): use it. + Thu Mar 28 06:12:28 1996 Lars Magne Ingebrigtsen <larsi@aegir.ifi.uio.no> * message.el (message-send-mail): Remove Gcc header. *** message.el~ Thu Mar 28 01:25:01 1996 --- message.el Thu Mar 28 14:26:03 1996 *************** *** 253,263 **** "*String to be inserted at the and the the message buffer. If t, the `message-signature-file' file will be inserted instead. If a function, the result from the function will be used instead. ! If a form, the result from the form will be used instead.") (defvar message-signature-file "~/.signature" "*File containing the text inserted at end of mail buffer.") (defvar message-distribution-function nil "*Function called to return a Distribution header.") --- 253,268 ---- "*String to be inserted at the and the the message buffer. If t, the `message-signature-file' file will be inserted instead. If a function, the result from the function will be used instead. ! If a form, the result from the form will be used instead. ! If nil, no signature will be inserted.") (defvar message-signature-file "~/.signature" "*File containing the text inserted at end of mail buffer.") + (defvar message-auto-signature t + "*Indicates whether Message should automatically insert a signature into + outgoing messages. See the documentation of `message-signature.'") + (defvar message-distribution-function nil "*Function called to return a Distribution header.") *************** *** 1826,1832 **** (message-generate-headers message-required-mail-headers)) (insert message-default-mail-headers)) (insert message-header-separator "\n") ! (message-insert-signature) (message-set-auto-save-file-name) (save-restriction (message-narrow-to-headers) --- 1830,1836 ---- (message-generate-headers message-required-mail-headers)) (insert message-default-mail-headers)) (insert message-header-separator "\n") ! (if message-auto-signature (message-insert-signature)) (message-set-auto-save-file-name) (save-restriction (message-narrow-to-headers) -- Jack Vinson jvinson@cheux.ecs.umass.edu "I Spit on Your Grave" -- double feature at the drive-in as seen "I Thumb Through Your Magazines" from the Qwik-E mart ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: .signature vs message.el 1996-03-28 19:34 ` Jack Vinson @ 1996-03-29 5:41 ` Lars Magne Ingebrigtsen 1996-03-29 12:00 ` Robert Pluim 1996-04-09 6:12 ` Mark Borges 0 siblings, 2 replies; 7+ messages in thread From: Lars Magne Ingebrigtsen @ 1996-03-29 5:41 UTC (permalink / raw) Jack Vinson <jvinson@cheux.ecs.umass.edu> writes: > The problem is that Lars has changed message-setup to call > message-insert-signature, rather than writing similar code twice. > > If this is to remain the case, we need another variable: > message-auto-signature or something which we can set 't when we want > message to insert our message-signature for us and 'nil when we want to do > it ourselves with C-c C-w. I've now made `C-c C-w' "force" a mail signature when called interactively. That is, if `mail-signature' is nil, then `mail-signature-file' will be inserted when you do `C-c C-w'. -- (domestic pets only, the antidote for overdose, milk.) larsi@ifi.uio.no * Lars Ingebrigtsen ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: .signature vs message.el 1996-03-29 5:41 ` Lars Magne Ingebrigtsen @ 1996-03-29 12:00 ` Robert Pluim 1996-04-09 6:12 ` Mark Borges 1 sibling, 0 replies; 7+ messages in thread From: Robert Pluim @ 1996-03-29 12:00 UTC (permalink / raw) >>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes: Lars> I've now made `C-c C-w' "force" a mail signature when called Lars> interactively. That is, if `mail-signature' is nil, then Lars> `mail-signature-file' will be inserted when you do `C-c Lars> C-w'. Brilliant! Thanks for the fix guys. Robert ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: .signature vs message.el 1996-03-29 5:41 ` Lars Magne Ingebrigtsen 1996-03-29 12:00 ` Robert Pluim @ 1996-04-09 6:12 ` Mark Borges 1996-04-09 19:12 ` Mark Borges 1996-04-09 22:08 ` d. hall 1 sibling, 2 replies; 7+ messages in thread From: Mark Borges @ 1996-04-09 6:12 UTC (permalink / raw) >> On 29 Mar 1996 05:41:52 +0000, >> Lars Magne Ingebrigtsen(lars) wrote: lars> Jack Vinson <jvinson@cheux.ecs.umass.edu> writes: >> The problem is that Lars has changed message-setup to call >> message-insert-signature, rather than writing similar code twice. >> lars> I've now made `C-c C-w' "force" a mail signature when called lars> interactively. That is, if `mail-signature' is nil, then lars> `mail-signature-file' will be inserted when you do `C-c C-w'. I'm still having some difficulty getting the effect I want since the great message.el switch. Before the switch, I had a cheesy function defined on `\C-c\C-w' in mail-mode-map that would insert the contents of "~/.sig" normally, but if given a prefix argument, would insert the contents of "~/.signature" instead. What is the cleanest way to get this behavior back? Thanks, -mb- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: .signature vs message.el 1996-04-09 6:12 ` Mark Borges @ 1996-04-09 19:12 ` Mark Borges 1996-04-09 22:08 ` d. hall 1 sibling, 0 replies; 7+ messages in thread From: Mark Borges @ 1996-04-09 19:12 UTC (permalink / raw) >> On 09 Apr 1996 00:12:52 -0600, >> Mark Borges(mb) wrote: mb> Before the switch, I had a cheesy function defined on `\C-c\C-w' mb> in mail-mode-map that would insert the contents of "~/.sig" mb> normally, but if given a prefix argument, would insert the mb> contents of "~/.signature" instead. mb> What is the cleanest way to get this behavior back? Well, this is what I came up with. Can anyone see anything cleaner? Can message-mode-map somehow inherit from mail-mode-map (or vice-versa), so I don't have to replicate code for VM? -------------------------------------------------- ; is there a better hook -- one that only runs once, after message has ; done its thing, e.g., message-init-hook? (add-hook 'message-setup-hook 'my-mail-setup) (defun my-mail-setup () (setq message-signature nil message-indent-citation-function nil message-citation-line-function nil message-cite-function 'sc-cite-original ) ; ...other stuff... (define-key mail-mode-map [(control x) n] 'abbrev-hacking-next-line) (define-key mail-mode-map [(meta >)] 'abbrev-hacking-end-of-buffer) (define-key message-mode-map [(control c) (control w)] 'mdb:signature) ; so VM can see it too (define-key mail-mode-map [(control c) (control w)] 'mdb:signature)) ;;; ******************** (defun mdb:signature (&optional long-sig) "Sign letter with contents of `mail-signature-file'. Prefix arg means use long signature." (interactive "P") (require 'message) (if long-sig (setq message-signature-file "~/.signature") (setq message-signature-file "~/.sig")) (message-insert-signature 1) ) -------------------------------------------------- -- -mb- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: .signature vs message.el 1996-04-09 6:12 ` Mark Borges 1996-04-09 19:12 ` Mark Borges @ 1996-04-09 22:08 ` d. hall 1 sibling, 0 replies; 7+ messages in thread From: d. hall @ 1996-04-09 22:08 UTC (permalink / raw) // thus on 09 Apr 1996 00:12:52 -0600, Mark virtually wrote: Mark> What is the cleanest way to get this behavior back? (setq message-signature 'my-mail-insert-signature) This is probably the cleanest way. Right now, my function replaces the current signature with another random signature (or else places one at the end of the message buffer), if I don't like the one put there initially (there is one placed there when the message buffer is first formed). Also with a prefix argument, it'll use that as a reference in the vector to gather the appropriate signature. d. -- ``It's a death row pardon... two minutes, too late'' ~ alanis morissette, ironic ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1996-04-09 22:08 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 1996-03-28 15:26 .signature vs message.el Robert Pluim 1996-03-28 19:34 ` Jack Vinson 1996-03-29 5:41 ` Lars Magne Ingebrigtsen 1996-03-29 12:00 ` Robert Pluim 1996-04-09 6:12 ` Mark Borges 1996-04-09 19:12 ` Mark Borges 1996-04-09 22:08 ` d. hall
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).