🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
5 messages
5 total messages Started by Michael Rosen Thu, 02 Sep 1993 17:07
How to change default directory for insert-file?
#4741
Author: Michael Rosen
Date: Thu, 02 Sep 1993 17:07
17 lines
1151 bytes
When I try to insert-file the default directory is /usr/tmp and not my
home directory.  

How can I change this so that it will prompt for my home or my home/tmp
directory each time I go to insert-file?

I looked in the variables section of the man file but couldn't find
anything related to "insert."

Thanks,
Mike

--
Michael Rosen
mrosen@nyx.cs.du.edu
George Washington University Alumni (Fall '92)
Tau Epsilon Phi, Tau Theta 381
Re: How to change default directory for insert-file?
#4760
Author: Sven Guckes
Date: Mon, 06 Sep 1993 05:37
21 lines
1384 bytes
mrosen@nyx.cs.du.edu (Michael Rosen) writes:

>When I try to insert-file the default directory is
>/usr/tmp and not my home directory.

When you try to WHAT?
What do you mean by "insert-file"?

>How can I change this so that it will prompt for my home or my home/tmp
>directory each time I go to insert-file?

What's "it"?

>I looked in the variables section of the man file but couldn't find
>anything related to "insert."

Which man file?

Are you sure this is the right newsgroup?

Sven :)  [You *did* ask your sys admin, did you?]
Re: How to change default directory for insert-file?
#4765
Author: epstein
Date: Mon, 06 Sep 1993 22:57
83 lines
3994 bytes
This didn't work the first time I tried to post it (perhaps because of
the inclusion of the newsgroup nyx.help, which I've removed), so I'm
giving it another try.

In <1993Sep2.170731.17402@mnemosyne.cs.du.edu> mrosen@nyx.cs.du.edu (Michael Rosen) writes:

>When I try to insert-file the default directory is /usr/tmp and not my
>home directory.  
>
>How can I change this so that it will prompt for my home or my home/tmp
>directory each time I go to insert-file?
>
>I looked in the variables section of the man file but couldn't find
>anything related to "insert."

I assume you're talking about when you go to edit a response from
within nn.

I imagine that since the files for the response are temporary, nn uses
one of the tmp directories (in this case /usr/tmp).  Since the file
being edited is in this directory, that becomes the default directory
for your editor.  I'm not sure you can control which directory nn uses
(from within nn).

However, since this behavior is in some sense an interaction with your
editor, you may be able to control it from the editor end.  From the
terminology you use, I'm guessing you're using emacs.  I've attached
below some code for emacs that I use for something along these lines.
Basically, what it does is when it sees that an nn or mail file is
being edited (judging from the filename), it turns off backups, and
cd's to the directory where I was previously (as indicated by the PWD
environment variable, which csh is supposed to update; this obviously
won't work for all uers; the commented line is for cd'ing to my home
directory).

I also have some simple code to remove the mail header from a mail
response (i.e. if you have included the message you're responding to,
as I often do); that's not necessarily relevant here, but I'll leave
it in there.  Caveat: This code works fine for me, but I'm sure it
could be improved.


(setq find-file-hooks
      (cons '(lambda ()
               (cond ((or (string-match "^/usr/tmp/nn" (buffer-file-name))
                          (string-match "^/tmp/Re" (buffer-file-name)))
                      (setq make-backup-files nil)
                      ;(cd "~")
                      (cd (getenv "PWD"))
                      (if (not (re-search-forward "^\n" nil t))
                          (goto-char (point-max)))))
               (if (string-match "^/tmp/Re" (buffer-file-name))
                   (remove-mail-header)))
            find-file-hooks))


(defun remove-mail-header ()
  "Remove mail header from mail reply.  Header is \"killed\", so that
it can be \"yanked\"."
  (interactive)
  (cond ((looking-at ">From ")
         (remove-mail-header-aux t))
        ((looking-at "From ")
         (remove-mail-header-aux))))


;;; QUOTEDP means all lines begin with a ">"
(defun remove-mail-header-aux (&optional quoted-p)
  (let ( (end-line-string (if quoted-p
                              "^>\n"
                              "^\n"))
         (start (point))
         end )
    (re-search-forward end-line-string)
    (backward-char)
    (setq end (point))
    (kill-region start end)))

-- 
Milt Epstein
Department of Computer Science
University of Illinois
epstein@cs.uiuc.edu
Re: How to change default directory for insert-file?
#4774
Author: Milt Epstein
Date: Thu, 09 Sep 1993 13:21
18 lines
1527 bytes
In <CCyFrz.Ix2@sparc0a.cs.uiuc.edu> epstein@ta9.cs.uiuc.edu (epstein) writes:

[my post deleted, included some emacs code]

Just wanted to point out that the emacs code I posted was developed
for/with Emacs 18.59, and I have no idea whether it will work as-is
with Emacs 19.XX.  Someone responded to me saying they got an error
message, guessing that it might be because it indeed does not work
with Emacs 19.XX.  They have not installed Emacs 19.XX at my site yet,
so I have not been able to use it at all, so I have no idea whether
this code will work with it.  If someone wants to fix up this code to
work with Emacs 19.XX, that's fine with me.

-- 
Milt Epstein
Department of Computer Science
University of Illinois
epstein@cs.uiuc.edu
Re: How to change default directory for insert-file?
#4777
Author: Michael Rosen
Date: Fri, 10 Sep 1993 21:23
19 lines
1452 bytes
Yes, I was referring to emacs, thanks for figuring that out.  I forgot
completely that I was posting with a problem completely unrelated to
nn...:)

And, we are using emacs 19.17.1 at my site.  I kinda wish we still had the
old version...this one is quite annoying.  I now starts up with "loading
ange-ftp" and "garbage collecting" making the startup really slow now.

No wonder my arrow keys no longer worked, the init file I had is probably
incompatible with the new version.

Thanks,
Mike

--
Michael Rosen
mrosen@nyx.cs.du.edu
George Washington University Alumni (Fall '92)
Tau Epsilon Phi, Tau Theta 381
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads