From d380784357e531122814f74fc0bbb64258231f60 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Fri, 25 Aug 2023 10:30:25 +0800 Subject: [PATCH] emacsWithPackages: fix logic of adding EMACSNATIVELOADPATH Without this change, EMACSNATIVELOADPATH will not be added if EMACSLOADPATH is added. --- pkgs/build-support/emacs/wrapper.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/emacs/wrapper.sh b/pkgs/build-support/emacs/wrapper.sh index e8eecb8c869..c18960c06fc 100644 --- a/pkgs/build-support/emacs/wrapper.sh +++ b/pkgs/build-support/emacs/wrapper.sh @@ -4,16 +4,17 @@ IFS=: newLoadPath=() newNativeLoadPath=() -added= +addedNewLoadPath= +addedNewNativeLoadPath= if [[ -n $EMACSLOADPATH ]] then while read -rd: entry do - if [[ -z $entry && -z $added ]] + if [[ -z $entry && -z $addedNewLoadPath ]] then newLoadPath+=(@wrapperSiteLisp@) - added=1 + addedNewLoadPath=1 fi newLoadPath+=("$entry") done <<< "$EMACSLOADPATH:" @@ -26,10 +27,10 @@ if [[ -n $EMACSNATIVELOADPATH ]] then while read -rd: entry do - if [[ -z $entry && -z $added ]] + if [[ -z $entry && -z $addedNewNativeLoadPath ]] then newNativeLoadPath+=(@wrapperSiteLispNative@) - added=1 + addedNewNativeLoadPath=1 fi newNativeLoadPath+=("$entry") done <<< "$EMACSNATIVELOADPATH:"