zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@fysh.org>
To: schaefer@candle.brasslantern.com (Bart Schaefer)
Cc: zsh-workers@sunsite.auc.dk
Subject: PATCH: emulate (Re: Prompt fun)
Date: Thu, 7 Oct 1999 11:41:01 +0100 (BST)	[thread overview]
Message-ID: <E11ZAyr-0005J7-00@crucigera.fysh.org> (raw)
In-Reply-To: <991007002842.ZM19962@candle.brasslantern.com> from Bart Schaefer at "Oct 7, 1999  0:28:42 am"

Bart Schaefer wrote:
>   emulate -L zsh
>+  setopt extendedglob

This shouldn't be causing confusion.  emulate is supposed to set all
(and only) the options that can affect the behaviour of a script.
The patch below fixes this.

The patch quoted above is still necessary; EXTENDED_GLOB is unset
by default even in zsh mode.  Would changing that break any scripts?
I suspect that it wouldn't, and would be a good idea.

-zefram

--- Src/options.c~	Thu Oct  7 11:11:26 1999
+++ Src/options.c	Thu Oct  7 11:35:11 1999
@@ -69,11 +69,11 @@
  * to avoid formatting problems.
  */
 static struct optname optns[] = {
-{NULL, "allexport",	      0,			 ALLEXPORT},
+{NULL, "allexport",	      OPT_EMULATE,		 ALLEXPORT},
 {NULL, "alwayslastprompt",    OPT_ALL,			 ALWAYSLASTPROMPT},
 {NULL, "alwaystoend",	      0,			 ALWAYSTOEND},
 {NULL, "appendhistory",	      OPT_ALL,			 APPENDHISTORY},
-{NULL, "autocd",	      0,			 AUTOCD},
+{NULL, "autocd",	      OPT_EMULATE,		 AUTOCD},
 {NULL, "autolist",	      OPT_ALL,			 AUTOLIST},
 {NULL, "automenu",	      OPT_ALL,			 AUTOMENU},
 {NULL, "autonamedirs",	      0,			 AUTONAMEDIRS},
@@ -83,17 +83,17 @@
 {NULL, "autoremoveslash",     OPT_ALL,			 AUTOREMOVESLASH},
 {NULL, "autoresume",	      0,			 AUTORESUME},
 {NULL, "badpattern",	      OPT_EMULATE|OPT_NONBOURNE, BADPATTERN},
-{NULL, "banghist",	      OPT_EMULATE|OPT_NONBOURNE, BANGHIST},
+{NULL, "banghist",	      OPT_NONBOURNE,		 BANGHIST},
 {NULL, "bareglobqual",        OPT_EMULATE|OPT_ZSH,       BAREGLOBQUAL},
 {NULL, "bashautolist",	      0,                         BASHAUTOLIST},
 {NULL, "beep",		      OPT_ALL,			 BEEP},
 {NULL, "bgnice",	      OPT_EMULATE|OPT_NONBOURNE, BGNICE},
-{NULL, "braceccl",	      0,			 BRACECCL},
+{NULL, "braceccl",	      OPT_EMULATE,		 BRACECCL},
 {NULL, "bsdecho",	      OPT_EMULATE|OPT_SH,	 BSDECHO},
-{NULL, "cdablevars",	      0,			 CDABLEVARS},
-{NULL, "chasedots",	      0,			 CHASEDOTS},
-{NULL, "chaselinks",	      0,			 CHASELINKS},
-{NULL, "clobber",	      OPT_ALL,			 CLOBBER},
+{NULL, "cdablevars",	      OPT_EMULATE,		 CDABLEVARS},
+{NULL, "chasedots",	      OPT_EMULATE,		 CHASEDOTS},
+{NULL, "chaselinks",	      OPT_EMULATE,		 CHASELINKS},
+{NULL, "clobber",	      OPT_EMULATE|OPT_ALL,	 CLOBBER},
 {NULL, "completealiases",     0,			 COMPLETEALIASES},
 {NULL, "completeinword",      0,			 COMPLETEINWORD},
 {NULL, "correct",	      0,			 CORRECT},
@@ -103,17 +103,17 @@
 {NULL, "cshjunkiequotes",     OPT_EMULATE|OPT_CSH,	 CSHJUNKIEQUOTES},
 {NULL, "cshnullglob",	      OPT_EMULATE|OPT_CSH,	 CSHNULLGLOB},
 {NULL, "equals",	      OPT_EMULATE|OPT_ZSH,	 EQUALS},
-{NULL, "errexit",	      0,			 ERREXIT},
-{NULL, "exec",		      OPT_ALL,			 EXECOPT},
-{NULL, "extendedglob",	      0,			 EXTENDEDGLOB},
-{NULL, "extendedhistory",     OPT_EMULATE|OPT_CSH,	 EXTENDEDHISTORY},
+{NULL, "errexit",	      OPT_EMULATE,		 ERREXIT},
+{NULL, "exec",		      OPT_EMULATE|OPT_ALL,		 EXECOPT},
+{NULL, "extendedglob",	      OPT_EMULATE,		 EXTENDEDGLOB},
+{NULL, "extendedhistory",     OPT_CSH,			 EXTENDEDHISTORY},
 {NULL, "flowcontrol",	      OPT_ALL,			 FLOWCONTROL},
 {NULL, "functionargzero",     OPT_EMULATE|OPT_NONBOURNE, FUNCTIONARGZERO},
-{NULL, "glob",		      OPT_ALL,			 GLOBOPT},
+{NULL, "glob",		      OPT_EMULATE|OPT_ALL,	 GLOBOPT},
 {NULL, "globalrcs",           OPT_ALL,			 GLOBALRCS},
 {NULL, "globassign",	      OPT_EMULATE|OPT_CSH,	 GLOBASSIGN},
 {NULL, "globcomplete",	      0,			 GLOBCOMPLETE},
-{NULL, "globdots",	      0,			 GLOBDOTS},
+{NULL, "globdots",	      OPT_EMULATE,		 GLOBDOTS},
 {NULL, "globsubst",	      OPT_EMULATE|OPT_NONZSH,	 GLOBSUBST},
 {NULL, "hashcmds",	      OPT_ALL,			 HASHCMDS},
 {NULL, "hashdirs",	      OPT_ALL,			 HASHDIRS},
@@ -135,7 +135,7 @@
 {NULL, "ignoreeof",	      0,			 IGNOREEOF},
 {NULL, "incappendhistory",    0,			 INCAPPENDHISTORY},
 {NULL, "interactive",	      OPT_SPECIAL,		 INTERACTIVE},
-{NULL, "interactivecomments", OPT_EMULATE|OPT_BOURNE,	 INTERACTIVECOMMENTS},
+{NULL, "interactivecomments", OPT_BOURNE,		 INTERACTIVECOMMENTS},
 {NULL, "ksharrays",	      OPT_EMULATE|OPT_BOURNE,	 KSHARRAYS},
 {NULL, "kshautoload",	      OPT_EMULATE|OPT_BOURNE,	 KSHAUTOLOAD},
 {NULL, "kshglob",             OPT_EMULATE|OPT_KSH,       KSHGLOB},
@@ -149,7 +149,7 @@
 {NULL, "localtraps",	      OPT_EMULATE|OPT_KSH,	 LOCALTRAPS},
 {NULL, "login",		      OPT_SPECIAL,		 LOGINSHELL},
 {NULL, "longlistjobs",	      0,			 LONGLISTJOBS},
-{NULL, "magicequalsubst",     0,			 MAGICEQUALSUBST},
+{NULL, "magicequalsubst",     OPT_EMULATE,		 MAGICEQUALSUBST},
 {NULL, "mailwarning",	      0,			 MAILWARNING},
 {NULL, "markdirs",	      0,			 MARKDIRS},
 {NULL, "menucomplete",	      0,			 MENUCOMPLETE},
@@ -158,23 +158,23 @@
 {NULL, "nomatch",	      OPT_EMULATE|OPT_NONBOURNE, NOMATCH},
 {NULL, "notify",	      OPT_ZSH,			 NOTIFY},
 {NULL, "nullglob",	      OPT_EMULATE,		 NULLGLOB},
-{NULL, "numericglobsort",     0,			 NUMERICGLOBSORT},
+{NULL, "numericglobsort",     OPT_EMULATE,		 NUMERICGLOBSORT},
 {NULL, "overstrike",	      0,			 OVERSTRIKE},
-{NULL, "pathdirs",	      0,			 PATHDIRS},
+{NULL, "pathdirs",	      OPT_EMULATE,		 PATHDIRS},
 {NULL, "posixbuiltins",	      OPT_EMULATE|OPT_BOURNE,	 POSIXBUILTINS},
 {NULL, "printeightbit",       0,                         PRINTEIGHTBIT},
 {NULL, "printexitvalue",      0,			 PRINTEXITVALUE},
 {NULL, "privileged",	      OPT_SPECIAL,		 PRIVILEGED},
-{NULL, "promptbang",	      OPT_EMULATE|OPT_KSH,	 PROMPTBANG},
+{NULL, "promptbang",	      OPT_KSH,			 PROMPTBANG},
 {NULL, "promptcr",	      OPT_ALL,			 PROMPTCR},
-{NULL, "promptpercent",	      OPT_EMULATE|OPT_NONBOURNE, PROMPTPERCENT},
-{NULL, "promptsubst",	      OPT_EMULATE|OPT_KSH,	 PROMPTSUBST},
-{NULL, "pushdignoredups",     0,			 PUSHDIGNOREDUPS},
-{NULL, "pushdminus",	      0,			 PUSHDMINUS},
+{NULL, "promptpercent",	      OPT_NONBOURNE,		 PROMPTPERCENT},
+{NULL, "promptsubst",	      OPT_KSH,			 PROMPTSUBST},
+{NULL, "pushdignoredups",     OPT_EMULATE,		 PUSHDIGNOREDUPS},
+{NULL, "pushdminus",	      OPT_EMULATE,		 PUSHDMINUS},
 {NULL, "pushdsilent",	      0,			 PUSHDSILENT},
-{NULL, "pushdtohome",	      0,			 PUSHDTOHOME},
-{NULL, "rcexpandparam",	      0,			 RCEXPANDPARAM},
-{NULL, "rcquotes",	      0,			 RCQUOTES},
+{NULL, "pushdtohome",	      OPT_EMULATE,		 PUSHDTOHOME},
+{NULL, "rcexpandparam",	      OPT_EMULATE,		 RCEXPANDPARAM},
+{NULL, "rcquotes",	      OPT_EMULATE,		 RCQUOTES},
 {NULL, "rcs",		      OPT_ALL,			 RCS},
 {NULL, "recexact",	      0,			 RECEXACT},
 {NULL, "restricted",	      OPT_SPECIAL,		 RESTRICTED},
@@ -185,7 +185,7 @@
 {NULL, "shglob",	      OPT_EMULATE|OPT_BOURNE,	 SHGLOB},
 {NULL, "shinstdin",	      OPT_SPECIAL,		 SHINSTDIN},
 {NULL, "shoptionletters",     OPT_EMULATE|OPT_BOURNE,	 SHOPTIONLETTERS},
-{NULL, "shortloops",	      OPT_ALL,			 SHORTLOOPS},
+{NULL, "shortloops",	      OPT_EMULATE|OPT_ALL,	 SHORTLOOPS},
 {NULL, "shwordsplit",	      OPT_EMULATE|OPT_BOURNE,	 SHWORDSPLIT},
 {NULL, "singlecommand",	      OPT_SPECIAL,		 SINGLECOMMAND},
 {NULL, "singlelinezle",	      OPT_KSH,			 SINGLELINEZLE},
END


  reply	other threads:[~1999-10-07 10:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-07  0:28 PATCH: Re: Prompt fun Bart Schaefer
1999-10-07 10:41 ` Zefram [this message]
1999-10-07 14:53   ` PATCH: emulate (Re: Prompt fun) Bart Schaefer
1999-10-07 15:11     ` Zefram
1999-10-07 15:42       ` Bart Schaefer
1999-10-07 15:50         ` Zefram
1999-10-07 17:20           ` Bart Schaefer
1999-10-07 17:29             ` Zefram
1999-10-07 18:56               ` Bart Schaefer
1999-10-08  9:58                 ` Zefram
1999-10-07 20:32               ` Reasons for not wanting EXTENDED_GLOB interactively (was Re: PATCH:...) Bruce Stephens
1999-10-08  6:15                 ` Andrej Borsenkow
1999-10-10 23:03   ` PATCH: Re: PATCH: emulate (Re: Prompt fun) Bart Schaefer
1999-10-10 23:19     ` Bart Schaefer
1999-10-11  8:20       ` Zefram
1999-10-10 23:21     ` Bart Schaefer
1999-10-11  8:17       ` Zefram

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=E11ZAyr-0005J7-00@crucigera.fysh.org \
    --to=zefram@fysh.org \
    --cc=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).