🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189003

modifying auto-mode-alist

#189003
From: Emin Gun Sirer
Date: Sat, 18 May 1991 06:13
21 lines
1449 bytes
Hello elispers,

I was trying to modify auto-mode-alist to put me in mail-mode when I write
a reply to a letter; that is, associate "^/tmp/Re" with mail-mode. I currently
do something like:
(let ((foo (assoc pattern auto-mode-alist)))
    (if foo
	(setcdr foo new-mode)
	....

However, it tells me that I "Attempt to modify read-only object" when it does
the setcdr. If I do the same thing with any associative list other than 
auto-mode-list, the program works correctly. 
Is there any way to get around this silly error ? Any help would be greatly
appreciated.

P.S. If it matters: this is SUNOS 4.1.1 on a Sparc and Ultrix V4.0 Rev 179 on a
decstation 5000.

Gun Sirer.
Technical Details
Message-ID: <1991May18.061322.28404@newross.Princeton.EDU>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!princeton!newross!dynamic.Princeton.EDU!egs
References: <1991May4.182621.2544@athena.mit.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,80ffebd709a40a03
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-05-18 03:26:25 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!princeton!newross!dynamic.Princeton.EDU!egs
From: egs@dynamic.Princeton.EDU (Emin Gun Sirer)
Newsgroups: gnu.emacs.help
Subject: modifying auto-mode-alist
Summary: it cannot be read-only
Message-ID: <1991May18.061322.28404@newross.Princeton.EDU>
Date: 18 May 91 06:13:22 GMT
References: <1991May4.182621.2544@athena.mit.edu>
Sender: news@newross.Princeton.EDU (USENET News System)
Organization: Princeton University, Dept. of Computer Science
Lines: 21