On Mon, Feb 19 2024, Ihor Radchenko wrote: > Leo Butler writes: > >>> What about not adding BEAMER_FRAME, but instead adding org-lint checker >>> that will detect when frame text contains the problematic \end{orgframe}? >> >> Ok, thanks for your feedback. I have modified the patch along the lines >> you suggested. It is attached. > > Thanks! > It looks like you left over some parts from the previous patch version. > >> (org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME. > > ... like this. > >> (org-beamer--frame-environments): New variable and function. The >> variable holds a list of names of frame environments found while >> formatting frames. The function generates the LaTeX code to define >> each new frame environment. >> (org-beamer-template): Add a call to `org-beamer--frame-environments' >> to insert the environment definitions into the beamer document. > > And since we only have a single alternative environment in this version > of the patch, `org-beamer--frame-environments' does not appear to be > necessary. > >> +(defcustom org-beamer-frame-environment "orgframe" >> + "Name of the beamer frame environment." >> + :group 'org-export-beamer >> + :type '(string :tag "Beamer frame")) > > It would be nice to provide a mode detailed explanation about the > purpose of this custom option. > >> +(defun org-lint-beamer-frame (ast) >> + "Check for occurrences of begin or end frame." >> + (org-with-point-at ast >> + (goto-char (point-min)) >> + (let (result) >> + (while (re-search-forward >> + (concat "\\\\\\(begin\\|end\\){" org-beamer-frame-environment "}") nil t) >> + (push (list (match-beginning 0) "Beamer frame name may cause error when exporting.") result)) >> + result))) > > ... and to link this org-lint warning to the > `org-beamer-frame-environment' docstring. Thanks for your comments. I think the attached patch addresses each of your points. It's not clear to me what you mean by "link(ing) this org-lint warning to the `org-beamer-frame-environment' docstring", but I have expanded the warning include mention of this variable. Leo