rnkn / fountain-mode

Emacs major mode for screenwriting in Fountain plain-text markup
https://fountain-mode.org
GNU General Public License v3.0
391 stars 16 forks source link

Error upon upgrading: "chain of obsolete variable names contains a loop" #115

Closed zck closed 4 years ago

zck commented 4 years ago

I previously had fountain-mode installed in my Emacs, and today went to install 3.0. I ran list-packages, and hit U to mark packages for upgrading, then x to do the actions. Upon installing Fountain, I got this error:

fountain-mode.el:2042:24:Warning: ‘fountain-continued-dialog-string’ is an
    obsolete variable (as of fountain-mode-2.9.0); use
    ‘fountain-contd-dialog-string’ instead.
fountain-mode.el:2061:43:Warning: ‘fountain-continued-dialog-string’ is an
    obsolete variable (as of fountain-mode-2.9.0); use
    ‘fountain-contd-dialog-string’ instead.
fountain-mode.el:2052:15:Warning: ‘fountain-add-continued-dialog’ is an
    obsolete variable (as of fountain-mode-2.9.0); use
    ‘fountain-add-contd-dialog’ instead.
fountain-mode.el:2052:15:Error: Symbol’s chain of variable indirections contains a loop: fountain-add-continued-dialog

I believe this is the reason. In the new version (3.0.0 downloaded from Melpa; Package-Version: 20200216.1350), we have this line:

  'fountain-add-continued-dialog "3.0.0")

In the old version (2.8.5 downloaded from Melpa, Package-Version: 20200113.428), there's this:

  'fountain-add-contd-dialog "fountain-mode-2.9.0")

Reproduction with minimal code

To test it, I ran this code:

(define-obsolete-variable-alias 'zck/test2 'zck/test1)
(defcustom zck/test1 nil "")

I got the same error:

custom-initialize-reset: Symbol’s chain of variable indirections contains a loop: zck/test1

Fix

After restarting Emacs, I had the proper version of Fountain installed, with no other actions. I think it loaded the new version of Fountain, so it only had the new variable.

I don't know if there's a technical fix -- that is, assuming you want to keep the variable name, but had obsoleted it previously. It might just need a note on upgrading.

rnkn commented 4 years ago

Thanks for reporting this. I was worried this might cause a problem. I just disliked the 2.8.5 change in hindsight. Might be worth just removing the current obsolete alias, which will avoid the error at the expense of some possible confusion.

rnkn commented 4 years ago

I pushed another release. Better to avoid an upgrade error.