--
----------------------------------------------------------------------
Apollo III Communications (Buffalo's First ISP) Larry James
716-896-0738 Office 716-896-0766 Fax Consultant/Programmer
http://www.apollo3.com/~ljames lja...@apollo3.com Buffalo, New York
LJ> Is there a command line option that will load a file in emacs for
LJ> viewing only.
You can always use the "--eval" option:
emacs --eval '(find-file-read-only "my-file.suf")'
or, using `view-mode' if you prefer:
emacs --eval '(view-file "my-file.suf")'
--
Emilio C. Lopes <mailto:Emilio...@Physik.TU-Muenchen.DE>
Here's how to define a new command line option to do the same thing:
(setq command-switch-alist
(cons '("--read-only" . find-file-read-only-command-line-arg) ; "-R"
command-switch-alist))
(defun find-file-read-only-command-line-arg (switch)
"Visit next command line argument (after SWITCH) as a read-only file."
;; (prog1 (car x) (setq x (cdr x))) == (pop x):
(find-file-read-only (prog1 (car command-line-args-left)
(setq command-line-args-left
(cdr command-line-args-left)))))
--
Kevin Rodgers <kev...@ihs.com> Lead Software Engineer
Information Handling Services Electronic Systems Development
15 Inverness Way East, M/S A201 GO BUFFS!
Englewood CO 80112-5776 USA 1+ (303) 397-2807[voice]/-2244[fax]