On Wed, Sep 25, 2002 at 10:38:49AM -0700, Gary W. Swearingen wrote: > Erik Trulsson <[EMAIL PROTECTED]> writes: > > > You can also specify Lisp functions to run directly from the commandline. > > > > emacs file.txt -f end-of-buffer > > > > seems to work fine. > > I couldn't get "-f end-of-buffer" to work when I developed my > monstrosity. Turns out that one must place it after the filename. > Weird. I knew GNU software allowed non-POSIX option placement, but I > didn't know it sometimes depended on it.
I guess emacs just processes most of the command-line options from left to right. I.e 'emacs -f end-of-buffer file1' would make emacs to try to place the cursor at the end of the current buffer (which doesn't exist at that time), and then load file1 into a new buffer with the cursor at the end as usual. If, OTOH, one does 'emacs file1 -f end-of-buffer' emacs will first load file1, and then move to cursor to the end of the current buffer, which is the one file1 is in. If you try 'emacs file1 -f end-of-buffer file2' you will see that the cursor will be at the end of file1, but at the beginning of file2. With 'emacs file1 -f end-of-buffer file2 -f end-of-buffer' the cursor will be at the end of both file1 and file2. -- <Insert your favourite quote here.> Erik Trulsson [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
