Loading ...
Sorry, an error occurred while loading the content.

cwd

Expand Messages
  • Schofield, Bryan (GE Trans)
    Is there a way to find the current working directory for a buffer that hasn t had a file associated with it yet? I know if I had a filename I could get the
    Message 1 of 14 , May 25, 2005
    • 0 Attachment
      Is there a way to find the current working directory for a buffer that hasn't had a file associated with it yet? I know if I had a filename I could get the directory, but in my case I don't. I've scoured the documentation and source and haven't found anything that gets me cwd. Have I missed something?

      Thanks
      bryan
    • Thomas Hundt
      It s wherever you start the program in! In Windows, this is specified in the shortcut ( Start In ). If you try to open a file using find-file, it will start
      Message 2 of 14 , May 25, 2005
      • 0 Attachment
        It's wherever you start the program in! In Windows, this is specified
        in the shortcut ("Start In"). If you try to open a file using
        find-file, it will start at that location. (I always set the CWD
        location in the shortcut to C:\ for this reason.)

        -Th


        Schofield, Bryan (GE Trans) wrote:

        > Is there a way to find the current working directory for a buffer
        > that hasn't had a file associated with it yet? I know if I had a
        > filename I could get the directory, but in my case I don't. I've
        > scoured the documentation and source and haven't found anything that
        > gets me cwd. Have I missed something?
      • Schofield, Bryan (GE Trans)
        aw shucks, I was hoping it would change directories based on the current buffer like Emacs.
        Message 3 of 14 , May 26, 2005
        • 0 Attachment
          aw shucks, I was hoping it would change directories based on the current buffer like Emacs.


          > -----Original Message-----
          > From: jasspa@yahoogroups.com
          > [mailto:jasspa@yahoogroups.com]On Behalf Of
          > Thomas Hundt
          > Sent: Wednesday, May 25, 2005 8:07 PM
          > To: jasspa@yahoogroups.com
          > Subject: Re: [jasspa] cwd
          >
          >
          > It's wherever you start the program in! In Windows, this is
          > specified
          > in the shortcut ("Start In"). If you try to open a file using
          > find-file, it will start at that location. (I always set the CWD
          > location in the shortcut to C:\ for this reason.)
          >
          > -Th
          >
          >
          > Schofield, Bryan (GE Trans) wrote:
          >
          > > Is there a way to find the current working directory for a buffer
          > > that hasn't had a file associated with it yet? I know if I had a
          > > filename I could get the directory, but in my case I don't. I've
          > > scoured the documentation and source and haven't found anything that
          > > gets me cwd. Have I missed something?
          >
          >
          >
          > ______________________________________________________________
          > ____________
          >
          > This is an unmoderated list. JASSPA is not responsible for
          > the content of
          > any material posted to this list.
          >
          > To unsubscribe, send a mail message to
          >
          > mailto:jasspa-unsubscribe@yahoogroups.com
          >
          > or visit http://groups.yahoo.com/group/jasspa and
          > modify your account settings manually.
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
        • first last
          Just press C-x C-w and it will show you where it is going to save (the CWD), then C-g to cancel. ... aw shucks, I was hoping it would change directories based
          Message 4 of 14 , May 26, 2005
          • 0 Attachment
            Just press C-x C-w and it will show you where it is going to save (the
            CWD), then C-g to cancel.




            --- "Schofield, Bryan (GE Trans)" <Bryan.Schofield@...> wrote:


            ---------------------------------
            aw shucks, I was hoping it would change directories based on the
            current buffer like Emacs.


            > -----Original Message-----
            > From: jasspa@yahoogroups.com
            > [mailto:jasspa@yahoogroups.com]On Behalf Of
            > Thomas Hundt
            > Sent: Wednesday, May 25, 2005 8:07 PM
            > To: jasspa@yahoogroups.com
            > Subject: Re: [jasspa] cwd
            >
            >
            > It's wherever you start the program in! In Windows, this is
            > specified
            > in the shortcut ("Start In"). If you try to open a file using
            > find-file, it will start at that location. (I always set the CWD
            > location in the shortcut to C:\ for this reason.)
            >
            > -Th
            >
            >
            > Schofield, Bryan (GE Trans) wrote:
            >
            > > Is there a way to find the current working directory for a buffer
            > > that hasn't had a file associated with it yet? I know if I had a
            > > filename I could get the directory, but in my case I don't. I've
            > > scoured the documentation and source and haven't found anything
            that
            > > gets me cwd. Have I missed something?
            >
            >
            >
            > ______________________________________________________________
            > ____________
            >
            > This is an unmoderated list. JASSPA is not responsible for
            > the content of
            > any material posted to this list.
            >
            > To unsubscribe, send a mail message to
            >
            > mailto:jasspa-unsubscribe@yahoogroups.com
            >
            > or visit http://groups.yahoo.com/group/jasspa and
            > modify your account settings manually.
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >


            __________________________________________________________________________

            This is an unmoderated list. JASSPA is not responsible for the content
            of
            any material posted to this list.

            To unsubscribe, send a mail message to

            mailto:jasspa-unsubscribe@yahoogroups.com

            or visit http://groups.yahoo.com/group/jasspa and
            modify your account settings manually.






            ---------------------------------
            Yahoo! Groups Links

            To visit your group on the web, go to:
            http://groups.yahoo.com/group/jasspa/

            To unsubscribe from this group, send an email to:
            jasspa-unsubscribe@yahoogroups.com

            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.







            ___________________________________________________________
            Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
          • Schofield, Bryan (GE Trans)
            I need to do this from in a macro :-(
            Message 5 of 14 , May 26, 2005
            • 0 Attachment
              I need to do this from in a macro :-(

              > -----Original Message-----
              > From: jasspa@yahoogroups.com
              > [mailto:jasspa@yahoogroups.com]On Behalf Of
              > first last
              > Sent: Thursday, May 26, 2005 9:37 AM
              > To: jasspa@yahoogroups.com
              > Subject: RE: [jasspa] cwd
              >
              >
              > Just press C-x C-w and it will show you where it is going to save (the
              > CWD), then C-g to cancel.
              >
              >
              >
              >
              > --- "Schofield, Bryan (GE Trans)"
              > <Bryan.Schofield@...> wrote:
              >
              >
              > ---------------------------------
              > aw shucks, I was hoping it would change directories based on the
              > current buffer like Emacs.
              >
              >
              > > -----Original Message-----
              > > From: jasspa@yahoogroups.com
              > > [mailto:jasspa@yahoogroups.com]On Behalf Of
              > > Thomas Hundt
              > > Sent: Wednesday, May 25, 2005 8:07 PM
              > > To: jasspa@yahoogroups.com
              > > Subject: Re: [jasspa] cwd
              > >
              > >
              > > It's wherever you start the program in! In Windows, this is
              > > specified
              > > in the shortcut ("Start In"). If you try to open a file using
              > > find-file, it will start at that location. (I always set the CWD
              > > location in the shortcut to C:\ for this reason.)
              > >
              > > -Th
              > >
              > >
              > > Schofield, Bryan (GE Trans) wrote:
              > >
              > > > Is there a way to find the current working directory for a buffer
              > > > that hasn't had a file associated with it yet? I know if I had a
              > > > filename I could get the directory, but in my case I don't. I've
              > > > scoured the documentation and source and haven't found anything
              > that
              > > > gets me cwd. Have I missed something?
              > >
              > >
              > >
              > > ______________________________________________________________
              > > ____________
              > >
              > > This is an unmoderated list. JASSPA is not responsible for
              > > the content of
              > > any material posted to this list.
              > >
              > > To unsubscribe, send a mail message to
              > >
              > > mailto:jasspa-unsubscribe@yahoogroups.com
              > >
              > > or visit http://groups.yahoo.com/group/jasspa and
              > > modify your account settings manually.
              > >
              > >
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              >
              >
              > ______________________________________________________________
              > ____________
              >
              > This is an unmoderated list. JASSPA is not responsible for the content
              > of
              > any material posted to this list.
              >
              > To unsubscribe, send a mail message to
              >
              > mailto:jasspa-unsubscribe@yahoogroups.com
              >
              > or visit http://groups.yahoo.com/group/jasspa and
              > modify your account settings manually.
              >
              >
              >
              >
              >
              >
              > ---------------------------------
              > Yahoo! Groups Links
              >
              > To visit your group on the web, go to:
              > http://groups.yahoo.com/group/jasspa/
              >
              > To unsubscribe from this group, send an email to:
              > jasspa-unsubscribe@yahoogroups.com
              >
              > Your use of Yahoo! Groups is subject to the Yahoo! Terms
              > of Service.
              >
              >
              >
              >
              >
              >
              >
              > ___________________________________________________________
              > Yahoo! Messenger - NEW crystal clear PC to PC calling
              > worldwide with voicemail http://uk.messenger.yahoo.com
              >
              >
              > ______________________________________________________________
              > ____________
              >
              > This is an unmoderated list. JASSPA is not responsible for
              > the content of
              > any material posted to this list.
              >
              > To unsubscribe, send a mail message to
              >
              > mailto:jasspa-unsubscribe@yahoogroups.com
              >
              > or visit http://groups.yahoo.com/group/jasspa and
              > modify your account settings manually.
              >
              >
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
              >
            • Thomas Hundt
              Dumb question: Why do you want to change the directory without doing anything else? (Like, if you are trying to open a file, why not concatenate the dir with
              Message 6 of 14 , May 26, 2005
              • 0 Attachment
                Dumb question: Why do you want to change the directory without doing
                anything else?
                (Like, if you are trying to open a file, why not concatenate the dir
                with the filename and just open it?)
                What is it you REALLY want to do?

                -Th


                Schofield, Bryan (GE Trans) wrote:
                > I need to do this from in a macro :-(

                >>aw shucks, I was hoping it would change directories based on the
                >>current buffer like Emacs.

                >>>It's wherever you start the program in! In Windows, this is
                >>>specified
                >>>in the shortcut ("Start In"). If you try to open a file using
                >>>find-file, it will start at that location. (I always set the CWD
                >>>location in the shortcut to C:\ for this reason.)

                >>>>Is there a way to find the current working directory for a buffer
                >>>>that hasn't had a file associated with it yet?
              • Schofield, Bryan (GE Trans)
                I do not like the extra step of having to remember to write-file the first time I want to save a new buffer. So I wrote the macro write-or-save-file, which
                Message 7 of 14 , May 26, 2005
                • 0 Attachment
                  I do not like the extra step of having to remember to "write-file" the first time I want to save a new buffer. So I wrote the macro write-or-save-file, which will do the appropriate action. When writing a new file, it prompts the user to enter a file name, using filename autocompletion and specifying an initial value. The initial value being buffer name. However, what I'd really like to do is augment the buffer name with the current directory so that it's absolutely clear where the file will be written. Furhtermore, it's highly likely I don't remember what directory in which I started the editor. The product I work on is just under 2 million lines of C++ spread over 50 directories. I might of fired the editor up in any number of them two days ago and I may be editing files from other directories.

                  My macro works fine, and I <tab> in the message line to just to make sure I'm saving the file where I really want, but it would nice if I got:

                  New file: /an/absolute/path/to/my/new.file

                  instead of

                  New file: new.file <tab>

                  -- bryan


                  > -----Original Message-----
                  > From: jasspa@yahoogroups.com
                  > [mailto:jasspa@yahoogroups.com]On Behalf Of
                  > Thomas Hundt
                  > Sent: Thursday, May 26, 2005 11:40 AM
                  > To: jasspa@yahoogroups.com
                  > Subject: Re: [jasspa] cwd
                  >
                  >
                  > Dumb question: Why do you want to change the directory without doing
                  > anything else?
                  > (Like, if you are trying to open a file, why not concatenate the dir
                  > with the filename and just open it?)
                  > What is it you REALLY want to do?
                  >
                  > -Th
                  >
                  >
                  > Schofield, Bryan (GE Trans) wrote:
                  > > I need to do this from in a macro :-(
                  >
                  > >>aw shucks, I was hoping it would change directories based on the
                  > >>current buffer like Emacs.
                  >
                  > >>>It's wherever you start the program in! In Windows, this is
                  > >>>specified
                  > >>>in the shortcut ("Start In"). If you try to open a file using
                  > >>>find-file, it will start at that location. (I always set the CWD
                  > >>>location in the shortcut to C:\ for this reason.)
                  >
                  > >>>>Is there a way to find the current working directory for a buffer
                  > >>>>that hasn't had a file associated with it yet?
                  >
                  >
                  > ______________________________________________________________
                  > ____________
                  >
                  > This is an unmoderated list. JASSPA is not responsible for
                  > the content of
                  > any material posted to this list.
                  >
                  > To unsubscribe, send a mail message to
                  >
                  > mailto:jasspa-unsubscribe@yahoogroups.com
                  >
                  > or visit http://groups.yahoo.com/group/jasspa and
                  > modify your account settings manually.
                  >
                  >
                  >
                  > Yahoo! Groups Links
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                • Thomas Hundt
                  Oh so you re opening new BUFFERS instead of new FILES when you are making changes. Meaning, the step of figuring out the filename comes when you save, instead
                  Message 8 of 14 , May 26, 2005
                  • 0 Attachment
                    Oh so you're opening new BUFFERS instead of new FILES when you are
                    making changes. Meaning, the step of figuring out the filename comes
                    when you save, instead of when you begin editing the file. If you
                    opened new files when editing, it might be less confusing. (Note that
                    it still doesn't actually create the file on disk until you save it.)
                    Find-file at least gives you the path the way you want it. You still
                    have to type a new buffer name, one way or the other.

                    I guess the question is, why are you creating new buffers, and how are
                    you creating them. Cutting and pasting? A macro? Something else?

                    -Th


                    Schofield, Bryan (GE Trans) wrote:
                    > I do not like the extra step of having to remember to "write-file"
                    > the first time I want to save a new buffer. So I wrote the macro
                    > write-or-save-file, which will do the appropriate action. When
                    > writing a new file, it prompts the user to enter a file name, using
                    > filename autocompletion and specifying an initial value. The initial
                    > value being buffer name. However, what I'd really like to do is
                    > augment the buffer name with the current directory so that it's
                    > absolutely clear where the file will be written. Furhtermore, it's
                    > highly likely I don't remember what directory in which I started the
                    > editor. The product I work on is just under 2 million lines of C++
                    > spread over 50 directories. I might of fired the editor up in any
                    > number of them two days ago and I may be editing files from other
                    > directories.

                    > My macro works fine, and I <tab> in the message line to just to make
                    > sure I'm saving the file where I really want, but it would nice if I
                    > got:

                    > New file: /an/absolute/path/to/my/new.file
                    >
                    > instead of
                    >
                    > New file: new.file <tab>
                    >
                    > -- bryan
                    >
                    >
                    >
                    >> -----Original Message----- From: jasspa@yahoogroups.com
                    >> [mailto:jasspa@yahoogroups.com]On Behalf Of Thomas Hundt Sent:
                    >> Thursday, May 26, 2005 11:40 AM To: jasspa@yahoogroups.com Subject:
                    >> Re: [jasspa] cwd
                    >>
                    >>
                    >> Dumb question: Why do you want to change the directory without
                    >> doing anything else? (Like, if you are trying to open a file, why
                    >> not concatenate the dir with the filename and just open it?) What
                    >> is it you REALLY want to do?
                    >>
                    >> -Th
                    >>
                    >>
                    >> Schofield, Bryan (GE Trans) wrote:
                    >>
                    >>> I need to do this from in a macro :-(
                    >>
                    >>>> aw shucks, I was hoping it would change directories based on
                    >>>> the current buffer like Emacs.
                    >>
                    >>>>> It's wherever you start the program in! In Windows, this is
                    >>>>> specified in the shortcut ("Start In"). If you try to open
                    >>>>> a file using find-file, it will start at that location. (I
                    >>>>> always set the CWD location in the shortcut to C:\ for this
                    >>>>> reason.)
                    >>
                    >>>>>> Is there a way to find the current working directory for a
                    >>>>>> buffer that hasn't had a file associated with it yet?
                    >>
                    >>
                  • Schofield, Bryan (GE Trans)
                    instead of doing something like me newfile I m doing something like me C-x b newfile (create a new buffer called newfile ) edit newfile buffer C-x C-s
                    Message 9 of 14 , May 26, 2005
                    • 0 Attachment
                      instead of doing something like "me newfile"
                      I'm doing something like "me"
                      C-x b newfile (create a new buffer called "newfile")
                      edit newfile buffer
                      C-x C-s (save buffer "newfile". Ack! can't save, must C-x C-w to write-file)

                      I'm just creating a new file from within an existing me session. Sometimes I just need a new file ;-)



                      > -----Original Message-----
                      > From: jasspa@yahoogroups.com
                      > [mailto:jasspa@yahoogroups.com]On Behalf Of
                      > Thomas Hundt
                      > Sent: Thursday, May 26, 2005 12:19 PM
                      > To: jasspa@yahoogroups.com
                      > Subject: Re: [jasspa] cwd
                      >
                      >
                      > Oh so you're opening new BUFFERS instead of new FILES when you are
                      > making changes. Meaning, the step of figuring out the filename comes
                      > when you save, instead of when you begin editing the file. If you
                      > opened new files when editing, it might be less confusing.
                      > (Note that
                      > it still doesn't actually create the file on disk until you save it.)
                      > Find-file at least gives you the path the way you want it. You still
                      > have to type a new buffer name, one way or the other.
                      >
                      > I guess the question is, why are you creating new buffers,
                      > and how are
                      > you creating them. Cutting and pasting? A macro? Something else?
                      >
                      > -Th
                      >
                      >
                      > Schofield, Bryan (GE Trans) wrote:
                      > > I do not like the extra step of having to remember to "write-file"
                      > > the first time I want to save a new buffer. So I wrote the macro
                      > > write-or-save-file, which will do the appropriate action. When
                      > > writing a new file, it prompts the user to enter a file name, using
                      > > filename autocompletion and specifying an initial value.
                      > The initial
                      > > value being buffer name. However, what I'd really like to do is
                      > > augment the buffer name with the current directory so that it's
                      > > absolutely clear where the file will be written. Furhtermore, it's
                      > > highly likely I don't remember what directory in which I
                      > started the
                      > > editor. The product I work on is just under 2 million lines of C++
                      > > spread over 50 directories. I might of fired the editor up in any
                      > > number of them two days ago and I may be editing files from other
                      > > directories.
                      >
                      > > My macro works fine, and I <tab> in the message line to just to make
                      > > sure I'm saving the file where I really want, but it would nice if I
                      > > got:
                      >
                      > > New file: /an/absolute/path/to/my/new.file
                      > >
                      > > instead of
                      > >
                      > > New file: new.file <tab>
                      > >
                      > > -- bryan
                      > >
                      > >
                      > >
                      > >> -----Original Message----- From: jasspa@yahoogroups.com
                      > >> [mailto:jasspa@yahoogroups.com]On Behalf Of Thomas Hundt Sent:
                      > >> Thursday, May 26, 2005 11:40 AM To: jasspa@yahoogroups.com Subject:
                      > >> Re: [jasspa] cwd
                      > >>
                      > >>
                      > >> Dumb question: Why do you want to change the directory without
                      > >> doing anything else? (Like, if you are trying to open a file, why
                      > >> not concatenate the dir with the filename and just open it?) What
                      > >> is it you REALLY want to do?
                      > >>
                      > >> -Th
                      > >>
                      > >>
                      > >> Schofield, Bryan (GE Trans) wrote:
                      > >>
                      > >>> I need to do this from in a macro :-(
                      > >>
                      > >>>> aw shucks, I was hoping it would change directories based on
                      > >>>> the current buffer like Emacs.
                      > >>
                      > >>>>> It's wherever you start the program in! In Windows, this is
                      > >>>>> specified in the shortcut ("Start In"). If you try to open
                      > >>>>> a file using find-file, it will start at that location. (I
                      > >>>>> always set the CWD location in the shortcut to C:\ for this
                      > >>>>> reason.)
                      > >>
                      > >>>>>> Is there a way to find the current working directory for a
                      > >>>>>> buffer that hasn't had a file associated with it yet?
                      > >>
                      > >>
                      >
                      >
                      > ______________________________________________________________
                      > ____________
                      >
                      > This is an unmoderated list. JASSPA is not responsible for
                      > the content of
                      > any material posted to this list.
                      >
                      > To unsubscribe, send a mail message to
                      >
                      > mailto:jasspa-unsubscribe@yahoogroups.com
                      >
                      > or visit http://groups.yahoo.com/group/jasspa and
                      > modify your account settings manually.
                      >
                      >
                      >
                      > Yahoo! Groups Links
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                    • Thomas Hundt
                      Yeah I see what you mean. My point is, instead of doing C-x b newfile, try C-x C-f... That way you can use C-x C-s later and you haven t done any more
                      Message 10 of 14 , May 26, 2005
                      • 0 Attachment
                        Yeah I see what you mean. My point is, instead of doing C-x b newfile,
                        try C-x C-f... That way you can use C-x C-s later and you haven't done
                        any more typing.

                        (Plus, you can use save-buffers-and-exit to quit quickly. And I think
                        it might allow it to create temporary backups in case the thing crashes.
                        Not sure about this last.)

                        -Th



                        Schofield, Bryan (GE Trans) wrote:
                        > instead of doing something like "me newfile"
                        > I'm doing something like "me"
                        > C-x b newfile (create a new buffer called "newfile")
                        > edit newfile buffer
                        > C-x C-s (save buffer "newfile". Ack! can't save, must C-x C-w to write-file)
                        >
                        > I'm just creating a new file from within an existing me session. Sometimes I just need a new file ;-)


                        >>Oh so you're opening new BUFFERS instead of new FILES when you are
                        >>making changes. Meaning, the step of figuring out the filename comes
                        >>when you save, instead of when you begin editing the file. If you
                        >>opened new files when editing, it might be less confusing.
                      • Schofield, Bryan (GE Trans)
                        Ah good suggestion, honestly, I ve doing C-x b for so long, it didn t occur to me. Thanks.
                        Message 11 of 14 , May 26, 2005
                        • 0 Attachment
                          Ah good suggestion, honestly, I've doing C-x b for so long, it didn't occur to me. Thanks.


                          > -----Original Message-----
                          > From: jasspa@yahoogroups.com
                          > [mailto:jasspa@yahoogroups.com]On Behalf Of
                          > Thomas Hundt
                          > Sent: Thursday, May 26, 2005 12:50 PM
                          > To: jasspa@yahoogroups.com
                          > Subject: Re: [jasspa] cwd
                          >
                          >
                          > Yeah I see what you mean. My point is, instead of doing C-x
                          > b newfile,
                          > try C-x C-f... That way you can use C-x C-s later and you
                          > haven't done
                          > any more typing.
                          >
                          > (Plus, you can use save-buffers-and-exit to quit quickly.
                          > And I think
                          > it might allow it to create temporary backups in case the
                          > thing crashes.
                          > Not sure about this last.)
                          >
                          > -Th
                          >
                          >
                          >
                          > Schofield, Bryan (GE Trans) wrote:
                          > > instead of doing something like "me newfile"
                          > > I'm doing something like "me"
                          > > C-x b newfile (create a new buffer called "newfile")
                          > > edit newfile buffer
                          > > C-x C-s (save buffer "newfile". Ack! can't save, must C-x
                          > C-w to write-file)
                          > >
                          > > I'm just creating a new file from within an existing me
                          > session. Sometimes I just need a new file ;-)
                          >
                          >
                          > >>Oh so you're opening new BUFFERS instead of new FILES when you are
                          > >>making changes. Meaning, the step of figuring out the
                          > filename comes
                          > >>when you save, instead of when you begin editing the file. If you
                          > >>opened new files when editing, it might be less confusing.
                          >
                          >
                          > ______________________________________________________________
                          > ____________
                          >
                          > This is an unmoderated list. JASSPA is not responsible for
                          > the content of
                          > any material posted to this list.
                          >
                          > To unsubscribe, send a mail message to
                          >
                          > mailto:jasspa-unsubscribe@yahoogroups.com
                          >
                          > or visit http://groups.yahoo.com/group/jasspa and
                          > modify your account settings manually.
                          >
                          >
                          >
                          > Yahoo! Groups Links
                          >
                          >
                          >
                          >
                          >
                          >
                          >
                        • Schofield, Bryan (GE Trans)
                          doh... I could have saved my self a lot of trouble if I d understood the docs a little better. @ml61 New File $buffer-bname Gives me exactly what I want. It
                          Message 12 of 14 , May 27, 2005
                          • 0 Attachment
                            doh... I could have saved my self a lot of trouble if I'd understood the docs a little better.

                            @ml61 "New File" $buffer-bname

                            Gives me exactly what I want. It provides the initial value $buffer-bname, then performs absolute filename auto-completion with it. Giving me:

                            New File: /an/absolute/path/to/my/new.file

                            Silly me.


                            > -----Original Message-----
                            > From: jasspa@yahoogroups.com
                            > [mailto:jasspa@yahoogroups.com]On Behalf Of
                            > Schofield, Bryan (GE Trans)
                            > Sent: Thursday, May 26, 2005 12:04 PM
                            > To: jasspa@yahoogroups.com
                            > Subject: RE: [jasspa] cwd
                            >
                            >
                            > I do not like the extra step of having to remember to
                            > "write-file" the first time I want to save a new buffer. So I
                            > wrote the macro write-or-save-file, which will do the
                            > appropriate action. When writing a new file, it prompts the
                            > user to enter a file name, using filename autocompletion and
                            > specifying an initial value. The initial value being buffer
                            > name. However, what I'd really like to do is augment the
                            > buffer name with the current directory so that it's
                            > absolutely clear where the file will be written. Furhtermore,
                            > it's highly likely I don't remember what directory in which I
                            > started the editor. The product I work on is just under 2
                            > million lines of C++ spread over 50 directories. I might of
                            > fired the editor up in any number of them two days ago and I
                            > may be editing files from other directories.
                            >
                            > My macro works fine, and I <tab> in the message line to just
                            > to make sure I'm saving the file where I really want, but it
                            > would nice if I got:
                            >
                            > New file: /an/absolute/path/to/my/new.file
                            >
                            > instead of
                            >
                            > New file: new.file <tab>
                            >
                            > -- bryan
                            >
                            >
                            > > -----Original Message-----
                            > > From: jasspa@yahoogroups.com
                            > > [mailto:jasspa@yahoogroups.com]On Behalf Of
                            > > Thomas Hundt
                            > > Sent: Thursday, May 26, 2005 11:40 AM
                            > > To: jasspa@yahoogroups.com
                            > > Subject: Re: [jasspa] cwd
                            > >
                            > >
                            > > Dumb question: Why do you want to change the directory
                            > without doing
                            > > anything else?
                            > > (Like, if you are trying to open a file, why not
                            > concatenate the dir
                            > > with the filename and just open it?)
                            > > What is it you REALLY want to do?
                            > >
                            > > -Th
                            > >
                            > >
                            > > Schofield, Bryan (GE Trans) wrote:
                            > > > I need to do this from in a macro :-(
                            > >
                            > > >>aw shucks, I was hoping it would change directories based on the
                            > > >>current buffer like Emacs.
                            > >
                            > > >>>It's wherever you start the program in! In Windows, this is
                            > > >>>specified
                            > > >>>in the shortcut ("Start In"). If you try to open a file using
                            > > >>>find-file, it will start at that location. (I always
                            > set the CWD
                            > > >>>location in the shortcut to C:\ for this reason.)
                            > >
                            > > >>>>Is there a way to find the current working directory
                            > for a buffer
                            > > >>>>that hasn't had a file associated with it yet?
                            > >
                            > >
                            > > ______________________________________________________________
                            > > ____________
                            > >
                            > > This is an unmoderated list. JASSPA is not responsible for
                            > > the content of
                            > > any material posted to this list.
                            > >
                            > > To unsubscribe, send a mail message to
                            > >
                            > > mailto:jasspa-unsubscribe@yahoogroups.com
                            > >
                            > > or visit http://groups.yahoo.com/group/jasspa and
                            > > modify your account settings manually.
                            > >
                            > >
                            > >
                            > > Yahoo! Groups Links
                            > >
                            > >
                            > >
                            > >
                            > >
                            > >
                            > >
                            >
                            >
                            > ______________________________________________________________
                            > ____________
                            >
                            > This is an unmoderated list. JASSPA is not responsible for
                            > the content of
                            > any material posted to this list.
                            >
                            > To unsubscribe, send a mail message to
                            >
                            > mailto:jasspa-unsubscribe@yahoogroups.com
                            >
                            > or visit http://groups.yahoo.com/group/jasspa and
                            > modify your account settings manually.
                            >
                            >
                            >
                            > Yahoo! Groups Links
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                          • Steven Phillips
                            ... This is correct which is a major advantage - one thing I ve been contemplating is auto-saving buffers which have no file name (and the buffer name does not
                            Message 13 of 14 , May 28, 2005
                            • 0 Attachment
                              > Yeah I see what you mean. My point is, instead of doing C-x b newfile,
                              > try C-x C-f... That way you can use C-x C-s later and you haven't done
                              > any more typing.

                              > (Plus, you can use save-buffers-and-exit to quit quickly. And I think
                              > it might allow it to create temporary backups in case the thing crashes.
                              > Not sure about this last.)

                              This is correct which is a major advantage - one thing I've been contemplating
                              is auto-saving buffers which have no file name (and the buffer name does not
                              start with a '*'), as I keep losing work. But where to? Have a new environment
                              variable pointing to the location?

                              If others think this would be useful I'll add it when I can,

                              Steve
                            • Thomas Hundt
                              How about putting them in the MEBACKUPPATH dir in a fake volume like BUFFERS . (At the moment, under this dir, there are volume names like C .) Maybe
                              Message 14 of 14 , May 30, 2005
                              • 0 Attachment
                                How about putting them in the MEBACKUPPATH dir in a fake "volume" like
                                "BUFFERS". (At the moment, under this dir, there are volume names like
                                "C".) Maybe have an ME variable that can disable it. (I don't think a
                                system environment variable is needed.)

                                If someone doesn't want this functionality, they can flip an ME variable
                                or not enable backups.

                                Alternately, use /tmp and whatever system functions give you a unique
                                filename (or use PID + timestamp)?

                                -Th


                                > one thing I've been contemplating
                                > is auto-saving buffers which have no file name (and the buffer name does not
                                > start with a '*'), as I keep losing work. But where to? Have a new environment
                                > variable pointing to the location?
                                > If others think this would be useful I'll add it when I can,
                                > Steve
                              Your message has been successfully submitted and would be delivered to recipients shortly.