\documentclass{beamer}
\def\efr{\end{frame}}
\begin{document}
\begin{frame}
Test
\efr
% \end{frame}
\end{document}
Why this document fails
$ pdflatex main.tex
Runaway argument?
\let \AtEndDocument \@firstofone \@enddocumenthook \@checkend {docume\ETC.
! File ended while scanning use of \beamer@collect@@body.
<inserted text>
\par
I want to define shortcuts \bfr and \efr for a frame.
beamerframes using verbatim mode, your definition leads to a state where\end{frame}is never seen. Don't do it, there's no real gain of it ! – Feb 11 '17 at 16:28\end{frame}. – samcarter_is_at_topanswers.xyz Feb 11 '17 at 16:38\end{frame}and you will save your life ;-) – Feb 11 '17 at 16:40\begin{frame} \end{frame}costs you too much time, rather look into a good tex editor, which provides shortcuts or auto-complete. – samcarter_is_at_topanswers.xyz Feb 11 '17 at 16:42\long\def\bfr#1\efr{\begin{frame}#1\end{frame}}but then forget about severalbeamerfeatures. As others have already pointed out, where's the advantage in obscuring the markup? – egreg Feb 11 '17 at 16:48macro-hammer :) I first vtc with another duplicate, but I think this ones fits better - and apparently the gold hammer only works once. – samcarter_is_at_topanswers.xyz Feb 11 '17 at 16:58