zsh-users
 help / color / mirror / code / Atom feed
* INTERACTIVE_COMMENTS - why?
@ 2011-08-24 12:02 Frank Terbeck
  2011-08-24 12:44 ` Mikael Magnusson
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2011-08-24 12:02 UTC (permalink / raw)
  To: zsh-users

Hey list!

I've been wondering why the option `interactive_comments' is there at
all. I thought, that maybe comments would clash with some corner cases
of `extended_glob', like when you have a file called "a  b" and try a
glob "a\ #b".  But that is not the case.

Since I couldn't find a technical reason for it, it might be there for
emulating the behaviour of another shell. My guess would be csh or tcsh,
which behave like that, too AFAIK.

Can someone confirm that suspicion or did I miss a technical issue that
can be avoided by having `interactive_comments' unset?

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


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

* Re: INTERACTIVE_COMMENTS - why?
  2011-08-24 12:02 INTERACTIVE_COMMENTS - why? Frank Terbeck
@ 2011-08-24 12:44 ` Mikael Magnusson
  2011-08-24 13:17   ` Frank Terbeck
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Magnusson @ 2011-08-24 12:44 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: zsh-users

On 24 August 2011 14:02, Frank Terbeck <ft@bewatermyfriend.org> wrote:
> Hey list!
>
> I've been wondering why the option `interactive_comments' is there at
> all. I thought, that maybe comments would clash with some corner cases
> of `extended_glob', like when you have a file called "a  b" and try a
> glob "a\ #b".  But that is not the case.
>
> Since I couldn't find a technical reason for it, it might be there for
> emulating the behaviour of another shell. My guess would be csh or tcsh,
> which behave like that, too AFAIK.
>
> Can someone confirm that suspicion or did I miss a technical issue that
> can be avoided by having `interactive_comments' unset?

% setopt noextendedglob
% touch #foo
% ls #foo
#foo

?

-- 
Mikael Magnusson


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

* Re: INTERACTIVE_COMMENTS - why?
  2011-08-24 12:44 ` Mikael Magnusson
@ 2011-08-24 13:17   ` Frank Terbeck
  2011-08-24 15:00     ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2011-08-24 13:17 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh-users

Mikael Magnusson wrote:
> On 24 August 2011 14:02, Frank Terbeck <ft@bewatermyfriend.org> wrote:
[...]
>> Can someone confirm that suspicion or did I miss a technical issue that
>> can be avoided by having `interactive_comments' unset?
>
> % setopt noextendedglob
> % touch #foo
> % ls #foo
> #foo

Fair enough. But then again, who wouldn't set `extended_glob'? ;)

Still: The choice of having it unset by default might still be for
emulating csh behaviour.  Or maybe not. If someone can remember why it's
off by default, I'd be glad to hear about it.

Regards, Frank


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

* Re: INTERACTIVE_COMMENTS - why?
  2011-08-24 13:17   ` Frank Terbeck
@ 2011-08-24 15:00     ` Bart Schaefer
  2011-08-24 17:05       ` Frank Terbeck
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2011-08-24 15:00 UTC (permalink / raw)
  To: zsh-users

On Aug 24,  3:17pm, Frank Terbeck wrote:
}
} Fair enough. But then again, who wouldn't set `extended_glob'? ;)

I don't.  I have a little "eglob" function that I use as a prefix to
the command line when I want extended globbing.  (Obviously I spend
too much of my time cleaning out backup files that have "#" and "~"
in their names.)

} Still: The choice of having it unset by default might still be for
} emulating csh behaviour. Or maybe not. If someone can remember why
} it's off by default, I'd be glad to hear about it.

It's almost certainly related to csh.  Zsh was first invented as a
shell to bring Bourne shell parsing regularity and scripting features
to users (university students in a BSD Unix environment) who had been
introduced to Unix via csh.  Anything that would overtly confuse a
csh-er who was typing a simple one-liner at the prompt was avoided.


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

* Re: INTERACTIVE_COMMENTS - why?
  2011-08-24 15:00     ` Bart Schaefer
@ 2011-08-24 17:05       ` Frank Terbeck
  2011-08-29 15:17         ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2011-08-24 17:05 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer wrote:
> On Aug 24,  3:17pm, Frank Terbeck wrote:
> } Fair enough. But then again, who wouldn't set `extended_glob'? ;)
>
> I don't.  I have a little "eglob" function that I use as a prefix to
> the command line when I want extended globbing.  (Obviously I spend
> too much of my time cleaning out backup files that have "#" and "~"
> in their names.)

Hm. I wonder how you're doing that. I've ended up with the following:

alias eglob='noalias eglob'
function eglob() {
    emulate -L zsh
    setopt extended_glob
    ${~"${argv[@]}"};
}

Are you doing something similar or is there a neat trick to do that
differently?

> } Still: The choice of having it unset by default might still be for
> } emulating csh behaviour. Or maybe not. If someone can remember why
> } it's off by default, I'd be glad to hear about it.
>
> It's almost certainly related to csh.  Zsh was first invented as a
> shell to bring Bourne shell parsing regularity and scripting features
> to users (university students in a BSD Unix environment) who had been
> introduced to Unix via csh.  Anything that would overtly confuse a
> csh-er who was typing a simple one-liner at the prompt was avoided.

Okay. Thanks for clearing that up.

Regards, Frank


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

* Re: INTERACTIVE_COMMENTS - why?
  2011-08-24 17:05       ` Frank Terbeck
@ 2011-08-29 15:17         ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2011-08-29 15:17 UTC (permalink / raw)
  To: zsh-users

On Aug 24,  7:05pm, Frank Terbeck wrote:
} Subject: Re: INTERACTIVE_COMMENTS - why?
}
} Bart Schaefer wrote:
} > I have a little "eglob" function that I use as a prefix
} 
} Hm. I wonder how you're doing that. I've ended up with the following:
} 
} alias eglob='noalias eglob'
} function eglob() {
}     emulate -L zsh
}     setopt extended_glob
}     ${~"${argv[@]}"};
} }
} 
} Are you doing something similar or is there a neat trick to do that
} differently?

Essentially the same, except I know my zsh options won't mess it up
so I don't bother with "emulate", and I avoid re-globbing the name
of the command:

    eglob () {
	setopt localoptions extendedglob
	local c=$1
	shift
	$c $~*
    }


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

end of thread, other threads:[~2011-08-29 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 12:02 INTERACTIVE_COMMENTS - why? Frank Terbeck
2011-08-24 12:44 ` Mikael Magnusson
2011-08-24 13:17   ` Frank Terbeck
2011-08-24 15:00     ` Bart Schaefer
2011-08-24 17:05       ` Frank Terbeck
2011-08-29 15:17         ` Bart Schaefer

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