From 519518a70a7cab03672f897e366c188a68b5c63f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 23 Feb 2024 11:17:16 -0800 Subject: Revert "Implement autocs mode." This reverts commit efcc4b981d2a10ac3b10522c596f8bf9ddff6ff9. --- README.md | 10 ---------- cdlog.sh | 17 ----------------- 2 files changed, 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 ` 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 -- cgit v1.2.3