From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26509 invoked by alias); 14 Dec 2017 06:46:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42120 Received: (qmail 25235 invoked by uid 1010); 14 Dec 2017 06:46:46 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.214.46):SA:0(-1.9/5.0):. Processed in 10.239249 secs); 14 Dec 2017 06:46:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=vf0AXfMv/4E9RqQtGELZLrcFMZ0vyR0ljLyugFv/24o=; b=TEkZTFWgzl/hSVMtJnMTYUykffWFTUhqtkrzef7CVhrpl9vCyupGJM95sBNRO5rZqs WQxoI9bU96Gt5hHXMc4O73bZZVapPiJeVZ4Hl598PwBULTanj5xSdKaLZZK5eWA531EF W1wz3TXvzpUGXsqAQc10Xgm6cy0/+cVd++hq6dsPyqEd1WPYr/z7iRTQz+0TktWqL8hF L2gvIChT8j+z9UH9ec+sRjmBZE5ezhty8gGvyfdJJ/cc2/8I+ydJm0cPEnSmFdx/7J9w Rbt9DM4WelNiilTlC7E+a+b4uXKoMZJHkeK1xmHpAy0u9J/ePbmLKfeZwFKet1p6/yWD SRcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=vf0AXfMv/4E9RqQtGELZLrcFMZ0vyR0ljLyugFv/24o=; b=QBzUuw+XuhmpHQczuDGtdJBetrPEXTuGcEspehGm2oxUli0QFo3LqC1yZ6p423f1vG f3rzh+qImfqU2kjB5/qpE10HDOxFQ5Ea8lfZa3/TywgdOldhzXfwLoA60BCaCfpDzVnE KkbyEj2aMTHYHbMLESF2tN2psXmAMIacC9BmaxrNgVosjFTvsfqdvyJz1f3m6P0Ooo8c gHSdVhOQBAH9OW8ldvqfIA1Gxmf/mTENo3QFpXpSqncWWscu3T5mQYEsTlwCvlvZnXBx eYUD8n0IGsIlTpCnr/mMohU9Z0FQW8yGdowH3B7ORU19s6GkCwiikwHvJpMKGSp3YIqP BUQw== X-Gm-Message-State: AKGB3mI2mHDFY6ZHEGhemrOmt1u0NPMwgeJndl3L5rDPoRaXO3D9npIW BeGdt2Uzypv28jPwvXXhc8HeZ2tu6YA= X-Google-Smtp-Source: ACJfBosWtlLE1jJzQTBHS+5ks71TI3I23tr6GydUFS9WpdqW3zALfavIMLCu51e/Ui3A6LVGJdt22Q== X-Received: by 10.107.46.169 with SMTP id u41mr6237366iou.303.1513233990979; Wed, 13 Dec 2017 22:46:30 -0800 (PST) From: dana Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [BUG] Strange auto-load behaviour when function name contains hyphen Message-Id: <990A7EB2-C4BA-4E3D-99B3-7DA40846CBD1@dana.is> Date: Thu, 14 Dec 2017 00:46:29 -0600 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3273) Hey again. :/ The documentation states that function files intended for zsh-style = auto-loading are allowed to contain a 'simple definition' (`foo() { ... }`) if that's = the only thing in the file. This seems to work fine... except when the = function name contains a hyphen. Illustration: % fpath=3D( . $fpath ) % print -r 'foo_bar() print foo_bar' > foo_bar % autoload -Uz foo_bar % foo_bar foo_bar % print -r 'foo-bar() print foo-bar' > foo-bar % autoload -Uz foo-bar % foo-bar # No output =E2=80=94 function is only defined now % foo-bar # Second call actually executes the function foo-bar In the foo-bar case, stripkshdef() doesn't strip the definition out = because the Eprog->strs value for the function contains weird characters (and thus = fails the strcmp() against the expected name). Specifically, it seems the strs = value contains \x9b in place of the hyphens. Not sure what the significance of that is; that's about as far as i = could follow it, unfortunately. dana