Article View: gnu.emacs.vm.bug
Article #9553Re: error autosaving *VM-mail*
From: Simon Leinen
Date: Thu, 30 May 1991 10:09
Date: Thu, 30 May 1991 10:09
56 lines
2919 bytes
2919 bytes
... well, I always get these messages when I am composing a reply to
someone who has a slash in his or her full name, because VM uses the
full name as the buffer name (which is a very good idea in principle).
I'm not *very* annoyed by this, but... anyway, here are some functions
that mess around with the `buffer-name' argument to vm-mail-internal,
and the first part of my changed vm-mail-internal with a call to these
functions. I don't know which characters really may appear in
full-names that cannot be used in buffer-names, but you can customize
this by changing the constant definitions below.
Have fun,
--
Simon.
;;; UNOFFICIAL replacement for lines 464--468 of `vm-reply.el',
;;; version 5.31:
;;;
;;; Change buffer names for vm-mail buffer so that the buffer is more
;;; likely to be autosaveable.
;;;
;;; 1991-05-30 Simon Leinen (simon@liasun2.epfl.ch).
(defconst vm-unixify-alist '((?/ . ?-))
"Alist to remap characters that can't be used in buffer names on a
Unix system")
(defconst vm-vmsify-alist '((?[ . ?() (?] . ?)))
"Alist to remap characters that can't be used in buffer names on a
VMS system. I don't know anything about VMS, so this is probably
incorrect.")
(defun vm-osify-buffer-name (string)
"Encode buffer name so that it buffer can be autosaved. For Unix,
change slashes to dashes; for VMS, change brackets to parentheses."
(cond ((eq system-type 'vax-vms)
(vm-map-string string vm-vmsify-alist))
(t (vm-map-string string vm-unixify-alist))))
(defun vm-map-string (string alist)
(let ((i 0) (n (length string)) (new-string nil))
(while (< i n)
(let ((assoc (cdr (assoc (elt string i) alist))))
(if assoc
(setelt (or new-string (setq new-string (copy-sequence string)))
i assoc)))
(setq i (1+ i)))
new-string))
(defun vm-mail-internal
(&optional buffer-name to subject in-reply-to cc references newsgroups)
(switch-to-buffer (generate-new-buffer
(if buffer-name
(vm-osify-buffer-name buffer-name)
"*VM-mail*")))
(auto-save-mode auto-save-default)
(mail-mode)
;;; end of UNOFFICIAL replacement
Technical Details
Message-ID:
<SIMON.91May30120903@liasun5.epfl.ch>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!cernvax!chx400!sicsun!disuns2!disuns2.epfl.ch!simonReferences:
<9105300008.AA15128@egypt.eng.umd.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6829,6e9690682ff88336 X-Google-Attributes: gidf6829,public X-Google-ArrivalTime: 1991-05-30 11:51:04 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!cernvax!chx400!sicsun!disuns2!disuns2.epfl.ch!simon From: simon@liasun2.epfl.ch (Simon Leinen) Newsgroups: gnu.emacs.vm.bug Subject: Re: error autosaving *VM-mail* Message-ID: <SIMON.91May30120903@liasun5.epfl.ch> Date: 30 May 91 10:09:03 GMT References: <9105300008.AA15128@egypt.eng.umd.edu> Sender: news@disuns2.epfl.ch Reply-To: simon@liasun2.epfl.ch Organization: /users/simon/.organization Lines: 56 Nntp-Posting-Host: liasun5.epfl.ch In-reply-to: djm@eng.umd.edu's message of 30 May 91 00:08:02 GMT X-Md4-Signature: 3bd6c724e6da3d7e970162883147be23