🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1117

Re: Learning how to administer EMACS, really: nconc

#1117
From: Fons Botman
Date: Sun, 16 Oct 1988 17:25
37 lines
1945 bytes
In article <24495@tut.cis.ohio-state.edu> karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) writes:
...
>   * Things I'd like to see: editting a remote file (ie, use rcp to get
>	   the file, edit it, and use rcp to save it), editting a
>	   compressed file (use uncompress, edit the file, recompress).
>
>Try ftp-find-file for the first.
>
>Try this bit of dangerous magic in your .emacs for the second:
>
...
>;; Establish '.Z' as a valid mode
>;; Get various common *roff sources into nroff-mode
>(setq auto-mode-alist (nconc '(
; something deleted
>                               ("\\.Z$" . z-mode)
; something deleted
>                               ("\\.ms$" . nroff-mode)
>                               ) auto-mode-alist))
>
...
>--Karl

Perhaps some of you like living on the edge :-)

On the other hand, you can make the above magic a lot less dangerous by
changing the function "nconc" into "append".  The unchanged statement is
harmless if it is executed from a file, but can be disasterous when it is
executed twice as code inside a function (e.g. in a hook function).

Try to avoid using "nconc", one hardly needs it. But if you cant fight down
the urge to do so think twice about giving it a quoted list as a first
argument, Because "nconc" will alter the quoted expression!  I admit "nconc"
saves a few cells, but you will lose it as debugging time when you
absentmindedly use the same trick inside a function.

						The Fons
Technical Details
Message-ID: <1533@draak.cs.vu.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!fons
References: <8810121439.AA03740@wind.bellcore.com> <24495@tut.cis.ohio-state.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!fons
From: fons@cs.vu.nl (Fons Botman)
Newsgroups: gnu.emacs.bug
Subject: Re: Learning how to administer EMACS, really: nconc
Message-ID: <1533@draak.cs.vu.nl>
Date: 16 Oct 88 17:25:23 GMT
References: <8810121439.AA03740@wind.bellcore.com> <24495@tut.cis.ohio-state.edu>
Reply-To: fons@cs.vu.nl (Fons Botman)
Distribution: gnu
Organization: VU Informatica, Amsterdam
Lines: 37