[OS X Emacs] Issue with emacs on the command line

Marc Shapiro -- at work marc.shapiro at acm.org
Thu Mar 8 11:47:25 EST 2018

Hi, I wish to use Emacs on the command line.  The file fixbbl.el contains the definition of interactive function "fixbbl" that does some complex editing.  I tested it with an interactive Emacs with no problems.

I run the following command line (on MacOS 10.13.3):
	/usr/bin/emacs -batch -q -l fixbbl.el -f fixbbl -f save-buffer main.bbl
and it responds
	(No changes need to be saved) 

Indeed, unfortunately, the file is has not been changed.   If I run interactively (i.e., without the "-batch" flag) I can see that indeed fixbbl.el has been loaded and fixbbl is defined, but has not been called; however "save-buffer" has been called, as evidenced by the response.

Any idea what is wrong, or how to debug? 

I am appending a stripped-down version of fixbbl.el and of main.bbl in case that helps.


---- fixbbl.el ----

(defun fixbbl ()
    (goto-char (point-min))
    (while (re-search-forward "\\\\urldef\\\\tempurl%
" nil t nil)
      (replace-match "\\\\showDOI{\\1}"))

----- main.bbl ----

\bibitem[\protect\citeauthoryear{Ahamad, Neiger, Burns, Kohli, and
  Hutto}{Ahamad et~al\mbox{.}}{1995}]%
\bibfield{author}{\bibinfo{person}{Mustaque Ahamad}, \bibinfo{person}{Gil
  Neiger}, \bibinfo{person}{James~E. Burns}, \bibinfo{person}{Prince Kohli},
  {and} \bibinfo{person}{Phillip~W. Hutto}.} \bibinfo{year}{1995}\natexlab{}.
\newblock \showarticletitle{Causal memory: definitions, implementation, and
\newblock \bibinfo{journal}{\emph{Distributed Computing}} \bibinfo{volume}{9},
  \bibinfo{number}{1} (\bibinfo{date}{March} \bibinfo{year}{1995}),


More information about the MacOSX-Emacs mailing list