From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/6082 Path: main.gmane.org!not-for-mail From: Hallvard B Furuseth Newsgroups: gmane.emacs.gnus.general Subject: Re: multiple .signatures possible Date: Tue, 30 Apr 1996 14:08:14 +0200 (MET DST) Message-ID: <199604301208.OAA03190@bombur2.uio.no> References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035146591 2484 80.91.224.250 (20 Oct 2002 20:43:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:43:11 +0000 (UTC) Cc: ding@ifi.uio.no 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 FAA18669 for ; Tue, 30 Apr 1996 05:58:28 -0700 Original-Received: from goggins.uio.no (6089@goggins.uio.no [129.240.201.2]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id ; Tue, 30 Apr 1996 14:08:44 +0200 Original-Received: from ulrik.uio.no by goggins.uio.no with local-SMTP (PP) id <29743-0@goggins.uio.no>; Tue, 30 Apr 1996 14:08:15 +0200 Original-Received: by bombur2.uio.no ; Tue, 30 Apr 1996 14:08:14 +0200 (MET DST) Original-To: Uwe Sigurd Valentin Kubosch In-reply-to: Xref: main.gmane.org gmane.emacs.gnus.general:6082 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:6082 > I often write for different organizations and would like the > .signature to replect this. Sometimes I represent my University, > and sometimes just myself, or my firm, or... My old (emacs-18) implementation is enclosed. There are lots of similar functions. > I sometimes get complaints that my .signature is a bit large, At least remove the spaces at the end of each line, so it's not ugly as well for people without MIME support. See below. Also, you might refrain from sending messages as MIME quoted-printable just because there are lines with space at the end. Encode 8-bit messages and maybe messages where space-at-end-of-line are significant, nothing else. > donV > --=20 > Uwe S.V. Kubosch Milron Data Crusaders Productions = > =20 > Stavikbakken 3 Johan Svensens vei 2a Stasjonsveien 56 = > =20 > N-1472 Fjellhamar N-1472 Fjellhamar N-2010 Str=F8mmen = > =20 > Norway Norway Norway = > =20 > Phone:+47 67 90 11 95 Phone:+47 67 90 95 24 Phone:+47 63 80 33 24 = > =20 > Phone:+47 92 20 60 46 Phone:+47 63 80 00 53 (ISDN) > Phone:+47 92 20 60 63 = > =20 > Web: Fax :+47 63 80 00 54 (ISDN) > Crusaders: BBS :+47 22 10 46 46 = > =20 Also, you might consider which information you relly need in the .sig. For example, do people who receive e-mail (and thus can send e-mail back) really need your snail-mail address? Personally I do have a .sig with my snail-mail address, but I almost never use it. Regards, Hallvard ;; Extend mail-signature to prompt for ~/.signature.* file ;;; Usage: ;;; ;;; Make ~/.signature.* files with your signatures and insert this in ~/.emacs: ;;; ;;; (autoload 'hbf-mail-signature "~hbf/elisp/hbf-signature" nil t) ;;; (autoload 'set-signature-file "~hbf/elisp/hbf-signature" nil t) ;;; (setq mail-setup-hook '(lambda () ;;; (fset 'mail-signature 'hbf-mail-signature))) ;;; (setq news-setup-hook '(lambda () ;;; (fset 'news-reply-signature 'set-signature-file))) ;;; ;;; Now ^C^W in postnews will prompt for signature file, ;;; and with prefix arg it will prompt for signature file in mail. ;;; ;;; Use completion to see your choices. The HELP char (usually ^H) ;;; displays the signature currently selected in the minibuffer, ;;; ^H in an empty minibuffer shows your current .signature. (provide 'hbf-signature) (defun set-signature-file (sfile) "Make ~/.signature into a (sym)link to SFILE." (interactive (list (hbf-signature-fileprompt "Set signature to: "))) (if sfile (let* ((default-directory (expand-file-name "~/")) (signature (expand-file-name "~/.signature"))) (setq sfile (expand-file-name sfile)) (or (file-readable-p sfile) (signal 'file-error (list "Could not read file" sfile))) (if (not (fboundp 'make-symbolic-link)) (add-name-to-file sfile signature (or (not (eq (file-nlinks signature) 1)) 1)) (if (equal default-directory (file-name-directory sfile)) (setq sfile (file-name-nondirectory sfile) default-directory ".")) (if (file-symlink-p signature) (delete-file signature)) (make-symbolic-link sfile signature))))) (defun hbf-mail-signature (&optional sfile) "Sign letter with contents of ~/.signature file. With prefix arg, prompt for ~/.signature.* filename extension and make ~/.signature a (sym)link to that file." (interactive (if current-prefix-arg (list (hbf-signature-fileprompt "Signature: ")))) (and sfile (not (string-match "\\(^\\|/\\).signature$" sfile)) (set-signature-file sfile)) (save-excursion (goto-char (point-max)) (insert-file-contents "~/.signature") (skip-chars-backward "\n") (let ((e (+ (point) 3))) (skip-chars-forward "\n") ; At least 2 newlines before signature. (while (< (point) e) (insert ?\n))))) (defun hbf-signature-fileprompt (prompt &optional autohelp) (let ((minibuffer-completion-table (mapcar '(lambda (s) (list (substring s 11))) (directory-files "~" nil "^\\.signature\\.[^#~]*$"))) (minibuffer-completion-predicate nil) (minibuffer-completion-confirm nil) (minibuffer-help-form '(hbf-signature-help))) (cond (minibuffer-completion-table (and autohelp (eq unread-command-char -1) (setq unread-command-char help-char)) (let ((sig (read-from-minibuffer prompt nil minibuffer-local-must-match-map))) (if (not (equal sig "")) (concat "~/.signature." sig))))))) (defun hbf-signature-help () (let* ((f (expand-file-name (concat "~/.signature" (if (> (buffer-size) 0) ".") (buffer-string)))) (attr (file-attributes f))) (if attr (with-output-to-temp-buffer "*Help*" (save-excursion (set-buffer "*Help*") (insert "Signature file: " (file-name-nondirectory f)) (cond ((stringp (car attr)) ; File is a symbolic link? (insert " --> " (car attr))) ((> (nth 1 attr) 1) ; File has several names? (insert (format " (%d links)" (nth 1 attr))))) (insert "\n--\n") (insert-file-contents f) (goto-char (point-max)) (if (bolp) (delete-char -1)) (goto-char (point-min)))) (format "No such file: ~/%s" (file-name-nondirectory f)))))