Commits

Anonymous committed a33cdb4

*** empty log message ***

  • Participants
  • Parent commits 9d99f6d

Comments (0)

Files changed (13)

+2007-07-04 Till Tantau <tantau@users.sourceforge.net>
+
+	- Fixed missing guards in optional arguments. (like \item[{hi[]}])
+
 2007-03-20 Till Tantau <tantau@users.sourceforge.net>
 
-	CVS:
 	- Fixed superfluous entry in FILES
 	- Added "open" option in multimedia.sty.
 	- Fixed sound player problem.

base/beamerbaseboxes.sty

 \RequirePackage{keyval}
 
 \def\beamerboxesdeclarecolorscheme#1#2#3{% scheme name, upper color, lower color
-  \setbeamercolor{@scheme upper #1}{fg=white,bg=#2}
-  \setbeamercolor{@scheme lower #1}{bg=#3}
+  \setbeamercolor{@scheme upper #1}{fg=white,bg={#2}}
+  \setbeamercolor{@scheme lower #1}{bg={#3}}
 }
 
 \define@key{beamerboxes}{scheme}{\def\bmb@upper{@scheme upper #1}\def\bmb@lower{@scheme lower #1}}

base/beamerbasecompatibility.sty

 \newcommand{\ExampleInline}[1]{{\usebeamercolor[fg]{example text}\translate{Example}: \ignorespaces#1}}
 \def\usenavigationsymbolstemplate{\setbeamertemplate{navigation symbols}}
 \def\insertnavigationsymbols{\usebeamertemplate***{navigation symbols}}
-\def\beamersetaveragebackground#1{\setbeamercolor{normal text}{bg=#1}}
+\def\beamersetaveragebackground#1{\setbeamercolor{normal text}{bg={#1}}}
 \def\useminislidetemplate#1#2#3#4#5{%
   \setbeamertemplate{mini frame}{#1}%
   \setbeamertemplate{mini frame in current subsection}{#2}%
   \setbeamersize{sidebar width #1=#2}
   \setbeamertemplate{sidebar #1}{#3}
 }
-\newcommand\beamertemplatesidebarcolor[2][left]{\setbeamercolor{sidebar #1}{bg=#2}}
+\newcommand\beamertemplatesidebarcolor[2][left]{\setbeamercolor{sidebar #1}{bg={#2}}}
 \def\beamertemplaterightsidebarlogonavigation{\setbeamertemplate{sidebar right}[default]
   \setbeamersize{sidebar width right=0pt}}
 \newcommand{\beamertemplatesidebarverticalshading}[3][left]{%
-  \setbeamertemplate{sidebar canvas #1}[vertical shading][top=#3,bottom=#2]}
+  \setbeamertemplate{sidebar canvas #1}[vertical shading][top={#3},bottom={#2}]}
 \newcommand{\beamertemplatesidebarhorizontalshading}[3][left]{%
-  \setbeamertemplate{sidebar canvas #1}[vertical shading][right=#3,left=#2]}
+  \setbeamertemplate{sidebar canvas #1}[vertical shading][right={#3},left={#2}]}
 \define@key{beamer@margin}{descriptionwidth}{%
   \beamer@descriptionwidth=#1\relax%
 }
   \def\beamersetrightmargin#1{\setbeamersize{text margin right=#1}}
   \long\def\useframetemplate#1#2{\setbeamertemplate{frame begin}{#1}\setbeamertemplate{frame end}{#2}}
   \def\usebackgroundtemplate{\setbeamertemplate{background canvas}}
-  \def\beamertemplatesolidbackgroundcolor#1{\setbeamercolor{normal text}{bg=#1}}
+  \def\beamertemplatesolidbackgroundcolor#1{\setbeamercolor{normal text}{bg={#1}}}
   \long\def\useblocktemplate#1#2{%
     \setbeamertemplate{block begin}{#1}%
     \setbeamertemplate{block end}{#2}}
   \long\def\useexampleblocktemplate#1#2{%
     \setbeamertemplate{block example begin}{#1}%
     \setbeamertemplate{block example end}{#2}}
-  \newcommand{\beamertemplategridbackground}[1][]{\setbeamertemplate{background}[grid][step=#1]}
-  \newcommand{\beamertemplateshadingbackground}[2]{\setbeamertemplate{background canvas}[vertical shading][bottom=#1,top=#2]}
+  \newcommand{\beamertemplategridbackground}[1][]{\setbeamertemplate{background}[grid][step={#1}]}
+  \newcommand{\beamertemplateshadingbackground}[2]{\setbeamertemplate{background canvas}[vertical shading][bottom={#1},top={#2}]}
   \newcommand\usealerttemplate[2]{\setbeamertemplate{alerted text begin}{#1}\setbeamertemplate{alerted text end}{#2}}
   \newcommand\usestructuretemplate[2]{\setbeamertemplate{structure begin}{#1}\setbeamertemplate{structure end}{#2}}
   \newcommand{\beamertemplatebookbibitems}{\setbeamertemplate{bibliography item}[book]}

base/beamerbaseframe.sty

 \def\beamer@doframeinput{\@ifnextchar<{\beamer@frameinput}{\beamer@frameinput<*>}}
 \def\beamer@frameinput<#1>{\@ifnextchar[{\beamer@@frameinput<#1>}{\beamer@@frameinput<#1>[]}}
 \def\beamer@@frameinput<#1>[{\@ifnextchar<{\beamer@@@@frameinput<#1>[}{\beamer@@@frameinput<#1>[<*>][}}
-\def\beamer@@@@frameinput<#1>[#2]{\@ifnextchar[{\beamer@@@frameinput<#1>[#2]}{\beamer@@@frameinput<#1>[#2][]}}
+\def\beamer@@@@frameinput<#1>[#2]{\@ifnextchar[{\beamer@@@frameinput<#1>[{#2}]}{\beamer@@@frameinput<#1>[{#2}][]}}
 \def\beamer@@@frameinput<#1>[#2][#3]{%
   \global\advance\c@framenumber by-1\relax%
-  \edef\beamer@temp{\noexpand\frame<#1>[#2][#3,fragile=false]%
+  \edef\beamer@temp{\noexpand\frame<#1>[#2][{#3,fragile=false}]%
     {\begingroup\noexpand\input{\beamer@verbfilename}\endgroup}}%
   \beamer@temp%
   \ifx\beamer@frameenvironmentsubst\beamer@frametext%
 \mode
 <all>
 {
-  \renewcommand<>{\pagebreak}[1][4]{\only#2{\beameroriginal\pagebreak[#1]}}
-  \renewcommand<>{\nopagebreak}[1][4]{\only#2{\beameroriginal\nopagebreak[#1]}}
+  \renewcommand<>{\pagebreak}[1][4]{\only#2{\beameroriginal\pagebreak[{#1}]}}
+  \renewcommand<>{\nopagebreak}[1][4]{\only#2{\beameroriginal\nopagebreak[{#1}]}}
   \def\framebreak{\pagebreak<presentation>}
   \def\noframebreak{\nopagebreak<presentation>}
 }
 \def\againframe{\@ifnextchar<{\beamer@againframe}{\beamer@againframe<*>}}
 \def\beamer@againframe<#1>{\@ifnextchar[{\beamer@@againframe<#1>}{\beamer@@againframe<#1>[]}}
 \def\beamer@@againframe<#1>[{\@ifnextchar<{\beamer@@@@againframe<#1>[}{\beamer@@@againframe<#1>[<*>][}}
-\def\beamer@@@@againframe<#1>[#2]{\@ifnextchar[{\beamer@@@againframe<#1>[#2]}{\beamer@@@againframe<#1>[#2][]}}
+\def\beamer@@@@againframe<#1>[#2]{\@ifnextchar[{\beamer@@@againframe<#1>[{#2}]}{\beamer@@@againframe<#1>[{#2}][]}}
 \def\beamer@@@againframe<#1>[#2][#3]#4{%
   \@ifundefined{beamer@again@#4}%
   {\ClassError{beamer}{No frame has been designated to resume under
       the name "#4"}{}}%
   {%
-  \def\beamer@temp{\frame<#1>[#2][#3,relabel=#4]}%
+  \def\beamer@temp{\frame<#1>[#2][{#3,relabel=#4}]}%
   \expandafter\let\expandafter\beamer@templet\csname beamer@again@#4\endcsname%
   \expandafter\beamer@temp\beamer@templet}%
 }
   \def\againframe{\@ifnextchar<{\beamer@againframe}{\beamer@againframe<>}}
   \def\beamer@againframe<#1>{\@ifnextchar[{\beamer@@againframe<#1>}{\beamer@@againframe<#1>[]}}
   \def\beamer@@againframe<#1>[{\@ifnextchar<{\beamer@@@@againframe<#1>[}{\beamer@@againframe<#1>[<*>][}}
-  \def\beamer@@@@againframe<#1>[#2]{\@ifnextchar[{\beamer@@@againframe<#1>[#2]}{\beamer@@@againframe<#1>[#2][]}}
+  \def\beamer@@@@againframe<#1>[#2]{\@ifnextchar[{\beamer@@@againframe<#1>[{#2}]}{\beamer@@@againframe<#1>[{#2}][]}}
   \def\beamer@@@againframe<#1>[#2][#3]#4{} % do nothing
 }
 

base/beamerbaseframesize.sty

 
 
 \define@key{beamerframe}{allowdisplaybreaks}[4]{%
-  \def\beamer@displaybreak{\allowdisplaybreaks[#1]}}
+  \def\beamer@displaybreak{\allowdisplaybreaks[{#1}]}}
 \define@key{beamerframe}{allowframebreaks}[0.95]{%
   \def\beamer@autobreakfactor{#1}\beamer@autobreaktrue}
 \define@key{beamerframe}{squeeze}[]{%

base/beamerbasemisc.sty

 
 \def\headcommand#1{\global\advance\beamer@totalheads by1\relax%
   \expandafter\gdef\csname @@head\the\beamer@totalheads\endcsname{#1}}
-\def\dohead{\beamer@headcounter=0\loop\ifnum\beamer@headcounter<\beamer@totalheads%
+\def\dohead{\beamer@headcounter=0\relax\loop\ifnum\beamer@headcounter<\beamer@totalheads%
   \advance\beamer@headcounter by1\relax%
   \csname @@head\the\beamer@headcounter\endcsname\repeat}
 
 \def\beamer@startpageofappendix{}
 \def\inserttotalframenumber{1}
 
-\def\partentry#1#2{\beamer@sectioncount=0}
+\def\partentry#1#2{\beamer@sectioncount=0\relax}
 \def\beamer@initsectionentry#1#2#3#4#5{\advance\beamer@sectioncount by1\relax%
   \ifnum\beamer@sectionmax<\beamer@sectioncount\beamer@sectionmax=\beamer@sectioncount\fi}
 \def\beamer@initslideentry#1#2#3#4#5#6{\ifnum\beamer@subsectionmax<#2\relax\beamer@subsectionmax=#2\fi}
 {
   \ifx\includegraphics\@undefined
   \else
-    \renewcommand<>\includegraphics[2][]{\only#3{\beameroriginal\includegraphics[#1]{#2}}\ignorespaces}
+    \renewcommand<>\includegraphics[2][]{\only#3{\beameroriginal\includegraphics[{#1}]{#2}}\ignorespaces}
   \fi
 
   \ifx\pgfuseimage\@undefined
   \else
     \renewcommand<>\pgfuseimage[1]{\only#2{\beameroriginal\pgfuseimage{#1}}\ignorespaces}
-    \renewcommand<>\pgfimage[2][]{\only#3{\beameroriginal\pgfimage[#1]{#2}}\ignorespaces}
+    \renewcommand<>\pgfimage[2][]{\only#3{\beameroriginal\pgfimage[{#1}]{#2}}\ignorespaces}
   \fi
 }
 

base/beamerbasemodes.sty

   \ifx\jobnamebeamerversion\@empty%
   \ClassError{beamer}{Invoke macro "setjobnamebeamerversion" first}{}%
   \else%
-  \edef\beamer@args{[#1,page=\csname beamer@slide#2\endcsname]{\jobnamebeamerversion}}
+  \edef\beamer@args{[{#1,page=\csname beamer@slide#2\endcsname}]{\jobnamebeamerversion}}
   \expandafter\pgfimage\beamer@args%
   \fi}
 

base/beamerbaseoptions.sty

   \setkeys{\@currname}{#1}}
 
 \def\DeclareOptionBeamer#1{\@ifnextchar[{\beamer@dokv{#1}}{\beamer@dokv{#1}[]}}
-\long\def\beamer@dokv#1[#2]#3{\define@key{\@currname}{#1}[#2]{#3}}
+\long\def\beamer@dokv#1[#2]#3{\define@key{\@currname}{#1}[{#2}]{#3}}
 
 
 \def\beamer@filterclassoptions{

base/beamerbaseoverlay.sty

   \beamer@prechecka{#3}}
 \long\def\beamer@prechecka#1{\@ifnextchar<{\beamer@preget{#1}}{\beamer@precheckb{#1}}}
 \long\def\beamer@preget#1<#2>{\def\beamer@ospec{<#2>}\beamer@precheckb{#1}}
-\long\def\beamer@precheckb#1{\@ifnextchar[{\beamer@pregetb}{\beamer@pregetb[#1]}}
+\long\def\beamer@precheckb#1{\@ifnextchar[{\beamer@pregetb}{\beamer@pregetb[{#1}]}}
 \long\def\beamer@pregetb[#1]{%
   \expandafter\long\expandafter\def\expandafter\beamer@todo\expandafter{\beamer@todo{#1}}%
   \advance\beamer@argscount by-1\relax%
   \beamer@parseargs}
 
 \def\beamer@parseargs{%
-  \ifnum\beamer@argscount=0%
+  \ifnum\beamer@argscount=0\relax%
     \let\next=\beamer@finalargscheck%
   \else%
     \let\next=\beamer@lookforarg%
 \def\beamer@colorhook{}
 \def\beamer@pgfextension{}
 
-\beamer@coveringdepth=0
+\beamer@coveringdepth=0\relax
 
 
 \mode
 
 \let\beamer@origitem=\item
 \def\beamer@callorigitem{\@ifnextchar[\beamer@@callorigitem{\beamer@origitem\kern0pt\ignorespaces}}
-\def\beamer@@callorigitem[#1]{\beamer@origitem[#1]\kern0pt\ignorespaces}
+\def\beamer@@callorigitem[#1]{\beamer@origitem[{#1}]\kern0pt\ignorespaces}
 
 \def\item{%
   \@ifnextchar\relax\beamer@origitem{%
     \next%
   }}
 \def\beamer@defaultparse{\expandafter\beamer@parseitem\beamer@defaultospec}
-\long\def\beamer@itemcheckopta[#1]{\@ifnextchar<{\beamer@itemreverse[#1]}{%
+\long\def\beamer@itemcheckopta[#1]{\@ifnextchar<{\beamer@itemreverse[{#1}]}{%
     \ifx\beamer@defaultospec\beamer@emptyospec%
       \let\next=\beamer@callorigitem%
     \else%
       \let\next=\beamer@defaultparse%
     \fi%
-    \next[#1]}}
-\long\def\beamer@itemreverse[#1]<#2>{\beamer@parseitem<#2>[#1]}
+    \next[{#1}]}}
+\long\def\beamer@itemreverse[#1]<#2>{\beamer@parseitem<#2>[{#1}]}
 
 \def\beamer@parseitem<#1>{%
   \gdef\beamer@closeitem{\end{actionenv}}%
 
 
 \newcount\beamer@trivlistdepth
-\beamer@trivlistdepth=0
+\beamer@trivlistdepth=0\relax
   
 \let\beamer@orig@trivlist=\@trivlist
 \def\@trivlist{%
     \def\item{\@ifnextchar<\beamer@@item\beamer@item}
     \def\beamer@@item<#1>{\beamer@item}
     \def\beamer@item{\@ifnextchar[\beamer@@@item\beamer@origitem}
-    \def\beamer@@@item[#1]{\@ifnextchar<{\beamer@@@@item[#1]}{\beamer@origitem[#1]}}
-    \def\beamer@@@@item[#1]<#2>{\beamer@origitem[#1]}
+    \def\beamer@@@item[#1]{\@ifnextchar<{\beamer@@@@item[{#1}]}{\beamer@origitem[{#1}]}}
+    \def\beamer@@@@item[#1]<#2>{\beamer@origitem[{#1}]}
   }
 }
 
 \mode
 <all>
 {
-  \newcommand<>{\transblindshorizontal}[1][]{\only#2{\beamer@dotrans[#1]{Blinds /Dm /H}}}
-  \newcommand<>{\transblindsvertical}[1][]{\only#2{\beamer@dotrans[#1]{Blinds /Dm /V}}}
-  \newcommand<>{\transboxin}[1][]{\only#2{\beamer@dotrans[#1]{Box /M /I}}}
-  \newcommand<>{\transboxout}[1][]{\only#2{\beamer@dotrans[#1]{Box /M /O}}}
-  \newcommand<>{\transcover}[1][]{\only#2{\beamer@dotrans[#1]{Cover}}}
-  \newcommand<>{\transdissolve}[1][]{\only#2{\beamer@dotrans[#1]{Dissolve}}}
-  \newcommand<>{\transfade}[1][]{\only#2{\beamer@dotrans[#1]{Fade}}}
-  \newcommand<>{\transglitter}[1][]{\only#2{\beamer@dotrans[#1]{Glitter}}}
-  \newcommand<>{\transpush}[1][]{\only#2{\beamer@dotrans[#1]{Push}}}
-  \newcommand<>{\transsplitverticalin}[1][]{\only#2{\beamer@dotrans[#1]{Split /Dm /V /M /I}}}
-  \newcommand<>{\transsplitverticalout}[1][]{\only#2{\beamer@dotrans[#1]{Split /Dm /V /M /O}}}
-  \newcommand<>{\transsplithorizontalin}[1][]{\only#2{\beamer@dotrans[#1]{Split /Dm /H /M /I}}}
-  \newcommand<>{\transsplithorizontalout}[1][]{\only#2{\beamer@dotrans[#1]{Split /Dm /H /M /O}}}
-  \newcommand<>{\transuncover}[1][]{\only#2{\beamer@dotrans[#1]{Uncover}}}
-  \newcommand<>{\transwipe}[1][]{\only#2{\beamer@dotrans[#1]{Wipe}}}
+  \newcommand<>{\transblindshorizontal}[1][]{\only#2{\beamer@dotrans[{#1}]{Blinds /Dm /H}}}
+  \newcommand<>{\transblindsvertical}[1][]{\only#2{\beamer@dotrans[{#1}]{Blinds /Dm /V}}}
+  \newcommand<>{\transboxin}[1][]{\only#2{\beamer@dotrans[{#1}]{Box /M /I}}}
+  \newcommand<>{\transboxout}[1][]{\only#2{\beamer@dotrans[{#1}]{Box /M /O}}}
+  \newcommand<>{\transcover}[1][]{\only#2{\beamer@dotrans[{#1}]{Cover}}}
+  \newcommand<>{\transdissolve}[1][]{\only#2{\beamer@dotrans[{#1}]{Dissolve}}}
+  \newcommand<>{\transfade}[1][]{\only#2{\beamer@dotrans[{#1}]{Fade}}}
+  \newcommand<>{\transglitter}[1][]{\only#2{\beamer@dotrans[{#1}]{Glitter}}}
+  \newcommand<>{\transpush}[1][]{\only#2{\beamer@dotrans[{#1}]{Push}}}
+  \newcommand<>{\transsplitverticalin}[1][]{\only#2{\beamer@dotrans[{#1}]{Split /Dm /V /M /I}}}
+  \newcommand<>{\transsplitverticalout}[1][]{\only#2{\beamer@dotrans[{#1}]{Split /Dm /V /M /O}}}
+  \newcommand<>{\transsplithorizontalin}[1][]{\only#2{\beamer@dotrans[{#1}]{Split /Dm /H /M /I}}}
+  \newcommand<>{\transsplithorizontalout}[1][]{\only#2{\beamer@dotrans[{#1}]{Split /Dm /H /M /O}}}
+  \newcommand<>{\transuncover}[1][]{\only#2{\beamer@dotrans[{#1}]{Uncover}}}
+  \newcommand<>{\transwipe}[1][]{\only#2{\beamer@dotrans[{#1}]{Wipe}}}
 }
 
-\newcommand<>{\transduration}[1]{\only#2{\hypersetup{pdfpageduration=#1}}}
+\newcommand<>{\transduration}[1]{\only#2{\hypersetup{pdfpageduration={#1}}}}
 
 \mode
 <article>
 \def\animatevalue<#1-#2>#3#4#5{%
   \only<#1-#2>{}% enforce these frames
   \ifnum\beamer@slideinframe<#1\relax%
-    #3=#4%
+    #3=#4\relax%
   \else%
     \ifnum\beamer@slideinframe<#2\relax%
       #3=#4\relax%
       \multiply#3 by\beamer@animationtempa%
       \advance#3 by#4%
     \else
-      #3=#5%
+      #3=#5\relax%
     \fi%
   \fi%  
 }
 <article>
 {
   \def\animate<#1>{}
-  \def\animatevalue<#1-#2>#3#4#5{#3=#4}
+  \def\animatevalue<#1-#2>#3#4#5{#3=#4\relax}
 }
 
 

base/beamerbasesection.sty

 \newcommand<>{\section}{\alt#1{\@ifnextchar[\beamer@section\beamer@@section}{\beamer@secgobble}}
 
 \def\beamer@@section{\@ifnextchar*\beamer@@ssection\beamer@@@section}
-\long\def\beamer@@ssection*#1{\beamer@section[#1]{}}
-\long\def\beamer@@@section#1{\beamer@section[#1]{#1}}
+\long\def\beamer@@ssection*#1{\beamer@section[{#1}]{}}
+\long\def\beamer@@@section#1{\beamer@section[{#1}]{#1}}
 \long\def\beamer@section[#1]#2{%
   \beamer@savemode%
   \mode<all>%
 
 \def\beamer@@subsection{\@ifnextchar*\beamer@@ssubsection\beamer@@@subsection}
 \long\def\beamer@@ssubsection*#1{%
-  \beamer@ifempty{#1}{\beamer@untitledsubsection}{\beamer@subsection[#1]{}}}
-\def\beamer@@@subsection#1{\beamer@subsection[#1]{#1}}
+  \beamer@ifempty{#1}{\beamer@untitledsubsection}{\beamer@subsection[{#1}]{}}}
+\def\beamer@@@subsection#1{\beamer@subsection[{#1}]{#1}}
 \def\beamer@subsection[#1]#2{%
   \beamer@savemode%
   \mode<all>%
 \newcommand<>{\subsubsection}{\alt#1{\@ifnextchar[\beamer@subsubsection\beamer@@subsubsection}{\beamer@secgobble}}
 
 \def\beamer@@subsubsection{\@ifnextchar*\beamer@@ssubsubsection\beamer@@@subsubsection}
-\long\def\beamer@@ssubsubsection*#1{\beamer@subsubsection[#1]{}}
-\def\beamer@@@subsubsection#1{\beamer@subsubsection[#1]{#1}}
+\long\def\beamer@@ssubsubsection*#1{\beamer@subsubsection[{#1}]{}}
+\def\beamer@@@subsubsection#1{\beamer@subsubsection[{#1}]{#1}}
 \def\beamer@subsubsection[#1]#2{%
   \beamer@savemode%
   \mode<all>%

base/beamerbasetemplates.sty

   {\def\beamer@@oar{#1}}\beamer@defbeamertemplate}
 \def\beamer@defbeamertemplate{\@ifstar{\beamer@sbttrue\beamer@sbtoo}{\beamer@sbtfalse\beamer@sbtoo}}
 \def\beamer@sbtoo#1#2{\@ifnextchar[{\beamer@sbto{#1}{#2}}{\beamer@sbto{#1}{#2}[0]}}
-\def\beamer@sbto#1#2[#3]{\@ifnextchar[{\beamer@@sbto{#1}{#2}[#3]}{\def\beamer@sbtotemp{}\beamer@@@sbto{#1}{#2}[#3]}}
-\long\def\beamer@@sbto#1#2[#3][#4]{\long\def\beamer@sbtotemp{[#4]}\beamer@@@sbto{#1}{#2}[#3]}
+\def\beamer@sbto#1#2[#3]{\@ifnextchar[{\beamer@@sbto{#1}{#2}[{#3}]}{\def\beamer@sbtotemp{}\beamer@@@sbto{#1}{#2}[{#3}]}}
+\long\def\beamer@@sbto#1#2[#3][#4]{\long\def\beamer@sbtotemp{[{#4}]}\beamer@@@sbto{#1}{#2}[{#3}]}
 \long\def\beamer@@@sbto#1#2[#3]#4{%
-  \beamer@sbttoks={\beamer@@@@sbto{#1}{#2}[#3]{#4}}%
+  \beamer@sbttoks={\beamer@@@@sbto{#1}{#2}[{#3}]{#4}}%
   \@ifnextchar[{\the\beamer@sbttoks}{\the\beamer@sbttoks[action]{}}%
 }
 \long\def\beamer@@@@sbto#1#2[#3]#4[#5]#6{%
-  \edef\beamer@@sbtoarg{\expandafter\noexpand\csname beamer@@tmpop@#1@#2\endcsname[#3]}%
+  \edef\beamer@@sbtoarg{\expandafter\noexpand\csname beamer@@tmpop@#1@#2\endcsname[{#3}]}%
   \expandafter\expandafter\expandafter\newcommand\expandafter\beamer@@sbtoarg\beamer@sbtotemp{%
     \expandafter\long\expandafter\def\csname beamer@@tmpl@#1\endcsname{#4}#6}%
   \let\beamer@@next=\beamer@resetsbtoarg%
   \expandafter\mode\beamer@@oar{\let\beamer@@next=\relax}%
   \beamer@@next%
-  \ifbeamer@sbt\setbeamertemplate{#1}[#2]\relax\relax\relax\relax\relax\relax\relax\relax\relax\fi% 
+  \ifbeamer@sbt\setbeamertemplate{#1}[{#2}]\relax\relax\relax\relax\relax\relax\relax\relax\relax\fi% 
 }
 \def\beamer@resetsbtoarg{%
   \expandafter\expandafter\expandafter\renewcommand\expandafter\beamer@@sbtoarg\beamer@sbtotemp{}
 
 
 \def\defbeamertemplateparent#1{\@ifnextchar[{\beamer@sbtoparo{#1}}{\beamer@sbtoparo{#1}[*]}}
-\def\beamer@sbtoparo#1[#2]#3{\@ifnextchar[{\beamer@sbtopar{#1}[#2]{#3}}{\beamer@sbtopar{#1}[#2]{#3}[0]}}
+\def\beamer@sbtoparo#1[#2]#3{\@ifnextchar[{\beamer@sbtopar{#1}[{#2}]{#3}}{\beamer@sbtopar{#1}[{#2}]{#3}[0]}}
 \def\beamer@sbtopar#1[#2]#3[#4]{\@ifnextchar[
-  {\beamer@@sbtopar{#1}[#2]{#3}[#4]}
-  {\def\beamer@sbtotemp{}\beamer@@@sbtopar{#1}[#2]{#3}[#4]}}
-\long\def\beamer@@sbtopar#1[#2]#3[#4][#5]{\long\def\beamer@sbtotemp{[#5]}\beamer@@@sbtopar{#1}[#2]{#3}[#4]}
+  {\beamer@@sbtopar{#1}[{#2}]{#3}[{#4}]}
+  {\def\beamer@sbtotemp{}\beamer@@@sbtopar{#1}[{#2}]{#3}[{#4}]}}
+\long\def\beamer@@sbtopar#1[#2]#3[#4][#5]{\long\def\beamer@sbtotemp{[{#5}]}\beamer@@@sbtopar{#1}[{#2}]{#3}[{#4}]}
 \long\def\beamer@@@sbtopar#1[#2]#3[#4]#5{%
   \expandafter\def\csname beamer@@tmpgrp@#1\endcsname{#3}%
-  \edef\beamer@@sbtoarg{\noexpand\newcommand\expandafter\noexpand\csname beamer@@tmpop@#1@#2\endcsname[#4]}%
+  \edef\beamer@@sbtoarg{\noexpand\newcommand\expandafter\noexpand\csname beamer@@tmpop@#1@#2\endcsname[{#4}]}%
   \expandafter\beamer@@sbtoarg\beamer@sbtotemp{%
     \def\beamer@sbtlist{#3}%
     \@for\beamer@templ:=\beamer@sbtlist\do

base/beamerbasethemes.sty

   \def\beamer@calltheme#1#2#3{%
     \def\beamer@themelist{#2}
     \@for\beamer@themename:=\beamer@themelist\do
-    {\usepackage[#1]{#3\beamer@themename}}}
+    {\usepackage[{#1}]{#3\beamer@themename}}}
   
   \newcommand\usetheme[2][]{\beamer@calltheme{#1}{#2}{beamertheme}}
   \newcommand\usecolortheme[2][]{\beamer@calltheme{#1}{#2}{beamercolortheme}}

base/beamerbasetheorems.sty

     \RequirePackage{amsthm}
 
     \renewenvironment<>{proof}[1][\proofname]
-    {\begin{actionenv}#2\begin{originalproof}[#1]}{\end{originalproof}\end{actionenv}}
+    {\begin{actionenv}#2\begin{originalproof}[{#1}]}{\end{originalproof}\end{actionenv}}
 
     % Make new theorem overlay-specification-aware
     \let\beamer@origthm=\@thm
     \def\@thm#1#2#3{\def\beamer@store{{#1}{#2}{#3}}\beamer@readspec}
     \newcommand<>\beamer@readspec[1][]{\def\beamer@storeaction{\begin{actionenv}#2}%
-      \expandafter\beamer@origthm\beamer@store[#1]}
+      \expandafter\beamer@origthm\beamer@store[{#1}]}
 
     \let\beamer@origbegintheorem=\@begintheorem
     \def\@begintheorem{\beamer@storeaction\beamer@origbegintheorem}