zsh-users
 help / color / mirror / code / Atom feed
* Augmenting a Sticky Emulation Mode
@ 2013-04-26 21:40 Russell Harmon
  2013-04-27  1:01 ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: Russell Harmon @ 2013-04-26 21:40 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Is it possible to augment a sticky emulation mode with additional options?
Specifically, I'd like the something like the following to return zero:
emulate -R sh -c 'setopt kshglob; function foo() {; setopt; }'; foo | grep
kshglob
--
Russell Harmon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-26 21:40 Augmenting a Sticky Emulation Mode Russell Harmon
@ 2013-04-27  1:01 ` Bart Schaefer
  2013-04-29  5:25   ` Russell Harmon
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Schaefer @ 2013-04-27  1:01 UTC (permalink / raw)
  To: zsh-users

On Apr 26,  2:40pm, Russell Harmon wrote:
}
} Is it possible to augment a sticky emulation mode with additional options?

Yes, but it requires version 5.0.x.

} Specifically, I'd like the something like the following to return zero:
} emulate -R sh -c 'setopt kshglob; function foo() {; setopt; }'; foo | grep kshglob

emulate -R sh -o kshglob -c 'foo() {; setopt; }'; foo | grep kshglob


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-27  1:01 ` Bart Schaefer
@ 2013-04-29  5:25   ` Russell Harmon
  2013-04-29  5:44     ` Russell Harmon
  0 siblings, 1 reply; 9+ messages in thread
From: Russell Harmon @ 2013-04-29  5:25 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Works great, thanks.

I notice however that the following crashes zsh: emulate -R sh -o
braceexpand -c 'foo() {; setopt; }'
(specifically, setting braceexpand this way causes the crash)

--
Russell Harmon


On Fri, Apr 26, 2013 at 6:01 PM, Bart Schaefer <schaefer@brasslantern.com>wrote:

> On Apr 26,  2:40pm, Russell Harmon wrote:
> }
> } Is it possible to augment a sticky emulation mode with additional
> options?
>
> Yes, but it requires version 5.0.x.
>
> } Specifically, I'd like the something like the following to return zero:
> } emulate -R sh -c 'setopt kshglob; function foo() {; setopt; }'; foo |
> grep kshglob
>
> emulate -R sh -o kshglob -c 'foo() {; setopt; }'; foo | grep kshglob
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-29  5:25   ` Russell Harmon
@ 2013-04-29  5:44     ` Russell Harmon
  2013-04-29  6:25       ` Bart Schaefer
  2013-04-29  8:47       ` Peter Stephenson
  0 siblings, 2 replies; 9+ messages in thread
From: Russell Harmon @ 2013-04-29  5:44 UTC (permalink / raw)
  To: Russell Harmon; +Cc: Bart Schaefer, zsh-users

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

I'm also a little confused here.

emulate -R sh -o noshglob -c 'foo() {; setopt; }'; foo
enables MAIL_WARNING while
emulate -R sh -o shglob -c 'foo() {; setopt; }'; foo
fails to enable shglob

--
Russell Harmon


On Sun, Apr 28, 2013 at 10:25 PM, Russell Harmon <russ@eatnumber1.com>wrote:

> Works great, thanks.
>
> I notice however that the following crashes zsh: emulate -R sh -o
> braceexpand -c 'foo() {; setopt; }'
> (specifically, setting braceexpand this way causes the crash)
>
> --
> Russell Harmon
>
>
> On Fri, Apr 26, 2013 at 6:01 PM, Bart Schaefer <schaefer@brasslantern.com>wrote:
>
>> On Apr 26,  2:40pm, Russell Harmon wrote:
>> }
>> } Is it possible to augment a sticky emulation mode with additional
>> options?
>>
>> Yes, but it requires version 5.0.x.
>>
>> } Specifically, I'd like the something like the following to return zero:
>> } emulate -R sh -c 'setopt kshglob; function foo() {; setopt; }'; foo |
>> grep kshglob
>>
>> emulate -R sh -o kshglob -c 'foo() {; setopt; }'; foo | grep kshglob
>>
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-29  5:44     ` Russell Harmon
@ 2013-04-29  6:25       ` Bart Schaefer
  2013-04-29  6:43         ` Russell Harmon
  2013-04-29  8:47       ` Peter Stephenson
  1 sibling, 1 reply; 9+ messages in thread
From: Bart Schaefer @ 2013-04-29  6:25 UTC (permalink / raw)
  To: Russell Harmon; +Cc: zsh-users

On Apr 28, 10:44pm, Russell Harmon wrote:
} 
} I'm also a little confused here.
} 
} emulate -R sh -o noshglob -c 'foo() {; setopt; }'; foo
} enables MAIL_WARNING while
} emulate -R sh -o shglob -c 'foo() {; setopt; }'; foo
} fails to enable shglob

This and the crash you reported make me think you have a bad compile;
at least some of of your modules have the wrong mapping for symbolic
constants that represent options.  If you built zsh yourself, I
suggest a clean compile; if it's a system package, please report the
error to the package maintainer ASAP.

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-29  6:25       ` Bart Schaefer
@ 2013-04-29  6:43         ` Russell Harmon
  0 siblings, 0 replies; 9+ messages in thread
From: Russell Harmon @ 2013-04-29  6:43 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

It must be an issue with homebrew's zsh then. I've reported it at
https://github.com/mxcl/homebrew/issues/19499

Thanks again.

--
Russell Harmon


On Sun, Apr 28, 2013 at 11:25 PM, Bart Schaefer
<schaefer@brasslantern.com>wrote:

> On Apr 28, 10:44pm, Russell Harmon wrote:
> }
> } I'm also a little confused here.
> }
> } emulate -R sh -o noshglob -c 'foo() {; setopt; }'; foo
> } enables MAIL_WARNING while
> } emulate -R sh -o shglob -c 'foo() {; setopt; }'; foo
> } fails to enable shglob
>
> This and the crash you reported make me think you have a bad compile;
> at least some of of your modules have the wrong mapping for symbolic
> constants that represent options.  If you built zsh yourself, I
> suggest a clean compile; if it's a system package, please report the
> error to the package maintainer ASAP.
>
> --
> Barton E. Schaefer
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-29  5:44     ` Russell Harmon
  2013-04-29  6:25       ` Bart Schaefer
@ 2013-04-29  8:47       ` Peter Stephenson
  2013-04-29  8:51         ` Russell Harmon
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Stephenson @ 2013-04-29  8:47 UTC (permalink / raw)
  To: Russell Harmon, zsh-users

On Sun, 28 Apr 2013 22:44:17 -0700
Russell Harmon <russ@eatnumber1.com> wrote:
> I'm also a little confused here.
> 
> emulate -R sh -o noshglob -c 'foo() {; setopt; }'; foo
> enables MAIL_WARNING while
> emulate -R sh -o shglob -c 'foo() {; setopt; }'; foo
> fails to enable shglob

Something *is* a bit wacky here, maybe not what you're seeing...
You need the zsh/parameter module loaded, which it probably will be for
completion.

% emulate -R sh -o noshglob -c 'foo() { print ${options[shglob]}; }'; foo
on
% emulate -R sh +o shglob -c 'foo() { print ${options[shglob]}; }'; foo
off

I can't think of any good reason why they should be different, though
maybe it'll occur to me if I look deeper.

pws


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-29  8:47       ` Peter Stephenson
@ 2013-04-29  8:51         ` Russell Harmon
  2013-04-29 17:59           ` Russell Harmon
  0 siblings, 1 reply; 9+ messages in thread
From: Russell Harmon @ 2013-04-29  8:51 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

Now this is interesting:

% emulate -R sh -o noshglob -c 'foo() { print ${options[shglob]}; }'; foo
on
% emulate -R sh +o shglob -c 'foo() { print ${options[shglob]}; }'; foo
off
% emulate -R sh -o noshglob -c 'foo() { setopt; }'; foo | grep shglob; echo
$?
1
% emulate -R sh -o noshglob -c 'foo() { setopt; }'; foo
interactive
login
mailwarning
monitor
shinstdin
zle
% emulate -R sh -o shglob -c 'foo() { setopt; }'; foo
interactive
login
monitor
shinstdin
zle
% emulate -R sh +o shglob -c 'foo() { setopt; }'; foo
interactive
login
monitor
noshglob
shinstdin
zle



--
Russell Harmon


On Mon, Apr 29, 2013 at 1:47 AM, Peter Stephenson
<p.stephenson@samsung.com>wrote:

> On Sun, 28 Apr 2013 22:44:17 -0700
> Russell Harmon <russ@eatnumber1.com> wrote:
> > I'm also a little confused here.
> >
> > emulate -R sh -o noshglob -c 'foo() {; setopt; }'; foo
> > enables MAIL_WARNING while
> > emulate -R sh -o shglob -c 'foo() {; setopt; }'; foo
> > fails to enable shglob
>
> Something *is* a bit wacky here, maybe not what you're seeing...
> You need the zsh/parameter module loaded, which it probably will be for
> completion.
>
> % emulate -R sh -o noshglob -c 'foo() { print ${options[shglob]}; }'; foo
> on
> % emulate -R sh +o shglob -c 'foo() { print ${options[shglob]}; }'; foo
> off
>
> I can't think of any good reason why they should be different, though
> maybe it'll occur to me if I look deeper.
>
> pws
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Augmenting a Sticky Emulation Mode
  2013-04-29  8:51         ` Russell Harmon
@ 2013-04-29 17:59           ` Russell Harmon
  0 siblings, 0 replies; 9+ messages in thread
From: Russell Harmon @ 2013-04-29 17:59 UTC (permalink / raw)
  To: Russell Harmon; +Cc: Peter Stephenson, zsh-users

[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]

I'm also seeing the same odd behavior (but not the crash) on Fedora's build
of ZSH: zsh 5.0.2 (x86_64-redhat-linux-gnu)

--
Russell Harmon


On Mon, Apr 29, 2013 at 1:51 AM, Russell Harmon <russ@eatnumber1.com> wrote:

> Now this is interesting:
>
> % emulate -R sh -o noshglob -c 'foo() { print ${options[shglob]}; }'; foo
> on
> % emulate -R sh +o shglob -c 'foo() { print ${options[shglob]}; }'; foo
> off
> % emulate -R sh -o noshglob -c 'foo() { setopt; }'; foo | grep shglob;
> echo $?
> 1
> % emulate -R sh -o noshglob -c 'foo() { setopt; }'; foo
> interactive
> login
> mailwarning
> monitor
> shinstdin
> zle
> % emulate -R sh -o shglob -c 'foo() { setopt; }'; foo
> interactive
> login
> monitor
> shinstdin
> zle
> % emulate -R sh +o shglob -c 'foo() { setopt; }'; foo
> interactive
> login
> monitor
> noshglob
> shinstdin
> zle
>
>
>
> --
> Russell Harmon
>
>
> On Mon, Apr 29, 2013 at 1:47 AM, Peter Stephenson <
> p.stephenson@samsung.com> wrote:
>
>> On Sun, 28 Apr 2013 22:44:17 -0700
>> Russell Harmon <russ@eatnumber1.com> wrote:
>> > I'm also a little confused here.
>> >
>> > emulate -R sh -o noshglob -c 'foo() {; setopt; }'; foo
>> > enables MAIL_WARNING while
>> > emulate -R sh -o shglob -c 'foo() {; setopt; }'; foo
>> > fails to enable shglob
>>
>> Something *is* a bit wacky here, maybe not what you're seeing...
>> You need the zsh/parameter module loaded, which it probably will be for
>> completion.
>>
>> % emulate -R sh -o noshglob -c 'foo() { print ${options[shglob]}; }'; foo
>> on
>> % emulate -R sh +o shglob -c 'foo() { print ${options[shglob]}; }'; foo
>> off
>>
>> I can't think of any good reason why they should be different, though
>> maybe it'll occur to me if I look deeper.
>>
>> pws
>>
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-04-29 18:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26 21:40 Augmenting a Sticky Emulation Mode Russell Harmon
2013-04-27  1:01 ` Bart Schaefer
2013-04-29  5:25   ` Russell Harmon
2013-04-29  5:44     ` Russell Harmon
2013-04-29  6:25       ` Bart Schaefer
2013-04-29  6:43         ` Russell Harmon
2013-04-29  8:47       ` Peter Stephenson
2013-04-29  8:51         ` Russell Harmon
2013-04-29 17:59           ` Russell Harmon

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).