Malabarba / spinner.el

Emacs mode-line spinner for operations in progress
104 stars 21 forks source link

Adapt to changes in Emacs 26 #9

Closed ptrv closed 7 years ago

ptrv commented 7 years ago

The slots in defstruct are now checked for the correct amount of options.

See http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=eb610f270ea919107b10bb8ece200a87abac6e0e

Fixes #8

thatismatt commented 7 years ago

I believe the value for :read-only wants to be t not nil. i.e. the timer is read-only.

See my pull request: https://github.com/Malabarba/spinner.el/pull/10

ptrv commented 7 years ago

In emacs 25.1 and the current implementation I stepped through with edebug and the value was nil

thatismatt commented 7 years ago

That makes sense, which makes me think that the (original) usage was incorrect previously. i.e. the intention was for it to be read-only but adding :read-only without a non-nil value actually had no effect.

Does that make sense? What do you think?

(sorry for the double post, I accidentally used my work account)

ptrv commented 7 years ago

I still think it should not be read-only since the timer gets modified later in spinner--start-timer with timer-set-time and timer-set-function which use internally setf.

Edit:

@Malabarba Does :read-only apply to the slot or also to the object itself. If it applies only to the slot then :read-only can be t?

Malabarba commented 7 years ago

Indeed, the original usage was wrong. It should be :read-only t. IIUC, the timer object itself is modified, but the timer attribute in the spinner is not modified.

ptrv commented 7 years ago

@Malabarba Thanks for clarifying. I close this PR then.