aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-02-23 11:17:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-02-23 11:17:16 -0800
commit519518a70a7cab03672f897e366c188a68b5c63f (patch)
treeb813f9cc240a83cd21bf4a447208f0fafe00b117
parentc7a28e464f3eddd21013b2f3c362ec3025e70822 (diff)
downloadcdlog-519518a70a7cab03672f897e366c188a68b5c63f.tar.gz
cdlog-519518a70a7cab03672f897e366c188a68b5c63f.tar.bz2
cdlog-519518a70a7cab03672f897e366c188a68b5c63f.zip
Revert "Implement autocs mode."
This reverts commit efcc4b981d2a10ac3b10522c596f8bf9ddff6ff9.
-rw-r--r--README.md10
-rw-r--r--cdlog.sh17
2 files changed, 0 insertions, 27 deletions
diff --git a/README.md b/README.md
index 64214e2..248ff71 100644
--- a/README.md
+++ b/README.md
@@ -87,16 +87,6 @@ When one or more persisted session are present, `cdlog`'s initialization
mentions this, suggesting that the `cdr` command may be used to recover
to one of the sessions.
-## `autocs` mode
-
-The variable `cdlog_autocs`, whose default value is `y` (enabled)
-controls `autocs` mode. In `autocs` mode, whenever the
-`cd`/`cdlog.chdir` command successfully changes to a new directory,
-and that directory already occurs in the FIFO, then the previous
-current directory is placed into the FIFO, overwriting that entry.
-Effectively, the original current directory is swapped with the
-FIFO entry as if using the `cs <n>` command.
-
## How is this better?
* It's not hard-coded C code inside the shell; it consists of a small amount of
diff --git a/cdlog.sh b/cdlog.sh
index e1a6181..b712b2e 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -3,9 +3,6 @@
# Globals
declare -A cdlog_alias # cd aliases
-# Configuration variables
-cdlog_autocs=${cdlog_autocs-y} # cd behaves like cs if match
-
# Update after FIFO change.
cdlog.update()
{
@@ -168,19 +165,6 @@ cdlog.chdir()
# only if we successfully change to a different
# directory do the following
- if [ $cdlog_autocs ] ; then
- local d=("" "$c1" "$c2" "$c3" "$c4" "$c5" "$c6" "$c7" "$c8" "$c9")
- unset d[0]
-
- for ((i = 1; i <= 9; i++)); do
- if [ "${d[$i]}" = "$PWD" ] ; then
- d[$i]=$cur
- cdlog.args "${d[@]}"
- return 0
- fi
- done
- fi
-
c9=$c8; c8=$c7; c7=$c6
c6=$c5; c5=$c4; c4=$c3
c3=$c2; c2=$c1
@@ -287,7 +271,6 @@ cdlog.mcd()
local res=1
local i
local d=("" "$c1" "$c2" "$c3" "$c4" "$c5" "$c6" "$c7" "$c8" "$c9")
- local cdlog_autocs= # override to off; mcd doesn't do autocs
if [ $# -gt 0 ] && [ "$1" = -s ] ; then
swap=y