From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5880 Path: main.gmane.org!not-for-mail From: Mark Borges Newsgroups: gmane.emacs.gnus.general Subject: Re: .signature vs message.el Date: 09 Apr 1996 13:12:43 -0600 Sender: mdb@cdc.noaa.gov Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035146420 1685 80.91.224.250 (20 Oct 2002 20:40:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:40:20 +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 MAA02594 for ; Tue, 9 Apr 1996 12:57:03 -0700 Original-Received: from cdc.noaa.gov (manager.Colorado.EDU [128.138.218.210]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Tue, 9 Apr 1996 21:13:40 +0200 Original-Received: from roberts by cdc.noaa.gov (SMI-8.6/SMI-SVR4) id NAA21566; Tue, 9 Apr 1996 13:13:34 -0600 Original-Received: by roberts (SMI-8.6) id NAA00463; Tue, 9 Apr 1996 13:12:44 -0600 Original-To: ding@ifi.uio.no In-Reply-To: Mark Borges's message of 09 Apr 1996 00:12:52 -0600 Original-Lines: 49 X-Mailer: September Gnus v0.68/XEmacs 19.14 Xref: main.gmane.org gmane.emacs.gnus.general:5880 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5880 >> 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-