octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #8139] cd: Add Bash-like "cd -" shortcut t


From: Philipp Kutin
Subject: [Octave-patch-tracker] [patch #8139] cd: Add Bash-like "cd -" shortcut to change to last dir from input prompt.
Date: Tue, 30 Jul 2013 21:09:42 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

URL:
  <http://savannah.gnu.org/patch/?8139>

                 Summary: cd: Add Bash-like "cd -" shortcut to change to last
dir from input prompt.
                 Project: GNU Octave
            Submitted by: pkutin
            Submitted on: Tue 30 Jul 2013 09:09:41 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

* libinterp/corefcn/dirfns.cc: When issuing "cd" from the top level, save
  current working dir before the change. When doing "cd -", change to that
  one. Caveat: works in a little more contexts than just from the prompt.
  (For example, anon. function defined at top level that does "cd", script
  called from top level.)

----------

This is useful when you're working in a directory with code, but temporarily
want to load some data. You'd "cd" into that directory, but to return to the
first one, don't need to enter it on the command line (which is inconvenient,
as the completion doesn't behave properly when the partial path has more than
one component.)

The idea is to make it work *only* when issued from the input prompt. However,
the closest I found is symbol_table::at_top_level(), which presumably embodies
the "workspace" concept. So, "cd -" also changes to the last WD in e.g.
M-scripts called from the top level, which may not be desirable. (But then
again, it's unlikely to be practically relevant -- who would call their
directory "-"?)




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 30 Jul 2013 09:09:41 PM GMT  Name: cd-bashlike-dash-pk.patch  Size:
2kB   By: pkutin

<http://savannah.gnu.org/patch/download.php?file_id=28714>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8139>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]