From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 3f86ef1b for ; Mon, 29 Jul 2019 00:05:43 +0000 (UTC) Received: (qmail 13872 invoked by alias); 28 Jul 2019 11:02:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24099 Received: (qmail 8715 invoked by uid 1010); 28 Jul 2019 11:02:40 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25517. spamassassin: 3.4.2. Clear:RC:0(209.85.217.44):SA:0(-2.0/5.0):. Processed in 1.37373 secs); 28 Jul 2019 11:02:40 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.44 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9HMnm1OZNyOltomJBa7f2HUKf1EG8RMIdChp8PpoX7c=; b=t722YuqA2LBlgnORETzPRFyuENysevEtFA/zZKpS+Du0rB/C4fAx7bQCTzDoVULvxX LBAq+uIXdLsUYka3VqvFIVNGdqP7kQPaKUwlDr/NDLXn+oomZl0EHkiA8T885/kh0j2R EEsPeIEsaR/VuQO8WEBNoKGa8/oZBsonKoddK/xYsJX8iRPXZUgs0l3ifqxvuY8fCkb9 u9i57+j1hv8guV2/K6ctrTJIhb8VImPcxYd0H2UkSNiVxNjgowiUz2u4ges221QynNie WLhiy6LxN+yXgvpYnXa0FGu1seRPb5ZZsW9rHzx/XCuhQRfIBsynfMmquFtDuaafYBsU iPXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9HMnm1OZNyOltomJBa7f2HUKf1EG8RMIdChp8PpoX7c=; b=MR7NhrJH4xuQtj6QJn7SKY/gkFbLowMr5Q0uVKOZWFsNd9nfdwtopX8IaiIIXsJxd7 2eOmlTSXO9GF+fOdWgLrpgxhmvljy+Nkcq1Cn9VV/bN0uXS1aBysC40gvvFjFIlwk4Qp QPubdi1+Z7+k30Z1eoCD8wvVuHsOZHiMhS58ueZ18Vk+wSEanCSSNpa8UjSxzDc8HZF9 NBh79Yr6546ZUDsN5K6Qq5q0ShS6TWCqE9Wd4FM5DfilyZkS6TW3VAHX8uVGsC0M1Fmu WfTvOAy4h+Gc/W6pvD5GsbwYoC391CJbIqQvlIVsSGFb88Nn8agFAcBGsciyt0cd8VP0 qd+w== X-Gm-Message-State: APjAAAXPSJefMA9Z4Ua56Aw1Y9EJH6bUUbxAZoE1riO0CQTrOeVq9xrO mWj4RRdBHsX0w5/C0s0ddycuGVEr2WiuZloZL7c= X-Google-Smtp-Source: APXvYqyqenq8dk0DEc/x+h+Zn5yElKbekFsGB//p/2E+8sextJepRHSIaPrKkhFMB+FjJoQQckA6GuHEIULDDVVEjwI= X-Received: by 2002:a67:8e0a:: with SMTP id q10mr41419950vsd.215.1564311724939; Sun, 28 Jul 2019 04:02:04 -0700 (PDT) MIME-Version: 1.0 References: <20180604083801eucas1p258b13dadf37a66e8a59e8714462d0577~06DN1ECXq0206402064eucas1p26@eucas1p2.samsung.com> <20180604095044eucas1p2ae6dd78f9518e91e6171d15d3717f924~07CtDwS5C1968619686eucas1p2k@eucas1p2.samsung.com> <7026.1528128511@thecus> In-Reply-To: From: Sebastian Gniazdowski Date: Sun, 28 Jul 2019 13:01:53 +0200 Message-ID: Subject: Re: Extending zed To: Oliver Kiddle Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =C5=9BOn Tue, 5 Jun 2018 at 16:40, Sebastian Gniazdowski wrote: > > On 4 June 2018 at 18:08, Oliver Kiddle wrote: > > -i vi-cmd-mode). I followed the naming of the __zed_pg_up widgets in > > naming this __zed_init but I'm not especially fond of this =E2=80=93 it= looks > > like a completion function. > > It hurts me a little too. For my plugin functions, I use "-", i.e. > "-zed_pg_up", but didn't propose this as it is somewhat controversial > =E2=80=93 requires to use "--" when handling the function, e.g. when pass= ing > to `autoload -- -zed_pg_up`. A proposal for a function naming scheme. The prefix and then its descriptio= n: - . (dot) - for normal yet private functions, i.e. functions that shouldn't interfere with command-line completion, i.e. shouldn't be completed when user enters e.g. "$ z", - + - for IO functions, e.g.: +myprj_print_msg or +myprj-print-msg - @ - for API-like functions, i.e. functions that are used across projects, that are exposed for use by some code with another ogigin, .e.g @myprj-register-hook - / - for debug-like functions, e.g. /myprj-dbg-print. The slash makes the function impossible to be autoloaded, but the assumption is that the debug functions shouldn't need this, at least not that it cannot be resigned from, - : - for a handler- or callback-, etc like functions; so e.g. add-zsh-hook precmd :my-precmd-handler So an example condensed code would look like this: .prjid_register_hooks() { integer ret add-zsh-hook precmd :prjid-precmd-handler; ret+=3D$? /prjid-dmsg "Installed precmd hook with result: $ret" @otherprj-notice-hook precmd-hook :prjid-precmd-handler; ret+=3D$? +prjid-print "Initialization complete (errors: $ret)" } --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org