emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Certain numbers of special forms cause changing behaviour on function ca


From: Wilfred Hughes
Subject: Certain numbers of special forms cause changing behaviour on function calls in --batch
Date: Sun, 26 Jun 2016 17:39:39 +0100

Hi all

I've bumped into an issue where the behaviour of Emacs changes
depending on the number of special forms.

    (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))))))))

In the above code, running it interactively in Emacs with M-x
eval-buffer gives: 'point is: 10'. This is correct.

However, running it in --batch gives:

$ emacs -batch -l ~/projects/pyimport/nasty.el
point is: 20

This is incorrect: for some reason move-end-of-line is behaving
differently here. Removing any of the extra special forms (e.g. the
redundant lets) fixes it.

I can reproduce this on 24.5, but not on HEAD. However,
move-end-of-line has not changed between 24.5 and HEAD.

Is/was this a bug in the elisp interpreter?

Wilfred



reply via email to

[Prev in Thread] Current Thread [Next in Thread]