From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: Line numbers and debugging verbosity
Date: Mon, 9 Apr 2018 08:51:25 -0700 [thread overview]
Message-ID: <fdb46a1b-df75-41f3-cd80-95697c2aaeb1@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7bxavbSX=Zuc+xRXDVnkVh=M90T5hu8Wz=_c5rVTdZV7w@mail.gmail.com>
On 08/04/18 10:19 PM, Bart Schaefer wrote:
> functions -T test1
Not working yet, but I know what to research, so it will work shorty.
Anyway, the idea is not a full debug, just some helpful indication where
a message comes from. I can't stand it when I see some message and have
no idea who is sending it to me, thereottabealaw!
> warningmsg() {
> print -n "${funcfiletrace[1]}: " && magline "$*"
> }
Marvellous. Perfect, right out of the box, no need for any alias at
all. Why don't they know about this on the internet? There's many
queries about line numbers, but the answer is always the alias.
> Just put a similar test in the definition of "warningmsg" e.g.
>
> warningmsg() {
> (( $dbg )) &&
> print -nr - "${funcfiletrace[1]}: " && magline "$*"
> }
>
> Now you don't have to modify the function, you just assign dbg=1 or dbg=0.
Sure, *once* we're back with functions, it's easy. Once any need for
an alias to capture the line numbers is gone, all problems vanish.
Ironically, last night I figured out how to make it work with aliases
too, but the above is vastly better anyway. It's pleasing to know that
the extra strictness of '5.5 has not really robbed me of any
functionality, just stopped me from doing things a way that I know
perfectly well is bogus.
prev parent reply other threads:[~2018-04-09 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 5:19 Bart Schaefer
2018-04-09 15:51 ` Ray Andrews [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fdb46a1b-df75-41f3-cd80-95697c2aaeb1@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).