I have an elisp script that behaves differently between an interactive Emacs session and running Emacs with
(defun call-fn-in-let (unused) (let (xx) (let (yy) (split-string "foo" "bar" nil)))) (with-temp-buffer (insert "foofoofoo\nbarbarbar") (let ((dd (let (aa) (let (bb) (let (cc) (progn (call-fn-in-let nil))))))) (let (ee) (save-excursion (goto-char (point-min)) (if t (progn (move-end-of-line nil) (message "point is: %s" (point))))))))
If I run
M-x eval-buffer, then
point is: 10
However, if I run Emacs from the CLI,
end-of-line behaves differently, jumping straight to end the of the file.
$ emacs -batch -l test/pyimport-test.el point is: 20 $ emacs --version GNU Emacs 24.5.1
I'm mystified why this is the case.
This is the most minimal example I can find. Even removing things like
if t or an unused let binding, changes the