Closed jschaf closed 7 years ago
I get the same number of matches with both regexps. I'm not sure why the original regex doesn't match underscores. I think you're probably okay without the underscores. It seems like an uncommon use-case to alias a private or internal functions. I'm happy to add the underscore if you want. Lemme know.
$ functions | grep '^[^'$'\t'' _-].\+ () {$' | wc -l
314
$ functions | grep '^[a-zA-Z].\+ () {$' | wc -l
314
$ functions | grep '^[a-zA-Z_].\+ () {$' | wc -l
1352
I think we can go ahead and stay aware, if later someone finds good reason.
Thanks for your help! 🙇
I would like an underscore. I heavily use underscores and feel it would be wrong to not support functions just because they have an underscore, regardless of whether or not it is at the start.
From the phone.
Hi! underscores are still supported within the function's name, but currently just not as the first character.
Do you use functions with leading underscore?
Nope I am good then.
On Sun, Nov 27, 2016, 21:01 Uwe Dauernheim notifications@github.com wrote:
Hi! underscores are still supported within the function's name, but currently just not as the first character.
Do you use functions with leading underscore?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/djui/alias-tips/pull/30#issuecomment-263128393, or mute the thread https://github.com/notifications/unsubscribe-auth/ADH7SUSrC8qdf6dHr3XjESmwIhXq9lgzks5rCaJJgaJpZM4K80QH .
👍 great. Let me know when you see other reasons to bring back a more accurate implementation, and I will adjust it.
Additionally, this prevents
_alias_tips__preexec
from getting called twice which saves about 100ms on startup. I'm not sure why it has this effect, but I suspect it has something to do with quoting and the dollar sign in the original regex.Here's the zprof info from config before this commit: