[gnu.emacs.bug] Learning how to administer EMACS

mlittman@WIND.BELLCORE.COM (Michael Littman) (10/12/88)

Hi, 			<Emacs 18.52 berkeley-unix>

	I'm old to emacs but new to having to administer it.  A few
questions: 

* How do you get emacs to load site specific files?   I found a file
	"site-load.el" which seems to want to be the right thing.
	However, emacs doesn't seem to load the file.  What could I be
	doing wrong? 

* How does one learn to program in emacs lisp?

* Is there any way to tell rnews to read remote news (stored on
	another machine)?

* 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).


Thanks for any help I might receive (the questions are in priority
order).


-MSL

karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) (10/13/88)

mlittman@WIND.BELLCORE.COM (Michael Littman) writes:
   * How do you get emacs to load site specific files?   I found a file
	   "site-load.el" which seems to want to be the right thing.
	   However, emacs doesn't seem to load the file.  What could I be
	   doing wrong? 

site-init.el is used to pre-load additional lisp files during build.
Use default.el to load other things each time Emacs is invoked.

   * How does one learn to program in emacs lisp?

By example: by reading stuff in the lisp subdir.

By reading: by getting a copy of the (technically not finished) GNU
Emacs Lisp Manual, available via FTP from Daniel Liberte at...at I
don't remember where, or via UUCP from osu-cis.

   * Is there any way to tell rnews to read remote news (stored on
	   another machine)?

The simplest and most obvious solution is to NFS-mount your news from
that other machine on your local machine, install the NNTP mini-inews
as the inews of choice on your local machine, and away you go.

Otherwise, there exist Gnews 1.9 (or [soon, I hear] 2.0) and GNUS 3.8.

   * 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:

;; Define z-mode to auto-load when visiting a ".Z" file
(autoload 'z-mode "z-mode" "\
Mode triggered by \".Z\" suffixed files, which then get automatically
uncompressed with appropriate buffer and visited file name changes.  The
buffer containing the uncompressed source is set to read-only."
          t)
;; Establish '.Z' as a valid mode
;; Get various common *roff sources into nroff-mode
(setq auto-mode-alist (nconc '(
                               ("\\.1$" . nroff-mode)
                               ("\\.2$" . nroff-mode)
                               ("\\.3$" . nroff-mode)
                               ("\\.4$" . nroff-mode)
                               ("\\.5$" . nroff-mode)
                               ("\\.6$" . nroff-mode)
                               ("\\.7$" . nroff-mode)
                               ("\\.8$" . nroff-mode)
                               ("\\.Z$" . z-mode)
                               ("\\.man$" . nroff-mode)
                               ("\\.me$" . nroff-mode)
                               ("\\.mm$" . nroff-mode)
                               ("\\.mr$" . nroff-mode)
                               ("\\.ms$" . nroff-mode)
                               ) auto-mode-alist))

where the file z-mode.el is:

(defun z-mode () "\
Temporary major mode triggered by the \".Z\" suffix on a file,
used to automatically uncompress the file when visiting.  After
running the buffer contents through \"uncompress\", the buffer
name is changed by truncating the \".Z\" (as well as the visited
file name).  Also, the buffer is marked as read-only.  Finally,
normal-mode is invoked to process the buffer for its normal mode."
  (if (and (not (null buffer-file-name))
           (string-match "^\\(.*\\)\\.Z$" buffer-file-name))
      (let ((new (substring buffer-file-name
                            (match-beginning 1) (match-end 1))))
        (setq buffer-read-only nil)
        (message "Uncompressing text...")
        (shell-command-on-region (point-min) (point-max)
                                 "uncompress" t)
        (message "Uncompressing text...done")
        (goto-char (point-min))
        (set-visited-file-name new)
        (set-buffer-modified-p nil)
        (setq buffer-read-only t)))
  (normal-mode))

--Karl