Bad-ptr / persp-mode.el

named perspectives(set of buffers/window configs) for emacs
394 stars 44 forks source link

wrong-number-of-arguments when saving perspective #119

Closed czikus closed 3 years ago

czikus commented 3 years ago

When saving a perspective, I get the following backtrace:

Debugger entered--Lisp error: (wrong-number-of-arguments (buf . buf-persps) 0)
  (signal wrong-number-of-arguments ((buf . buf-persps) 0))
  (#f(compiled-function (bcons) #<bytecode 0x155e72eec959>) nil)
  (cl-delete nil (...) :if #f(compiled-function (bcons) #<bytecode 0x155e72eec959>) :key #f(compiled-function (b) #<bytecode 0x155e74483a01>))
  (apply cl-delete nil (...) :if #f(compiled-function (bcons) #<bytecode 0x155e72eec959>) (:key #f(compiled-function (b) #<bytecode 0x155e74483a01>)))
  (cl-delete-if #f(compiled-function (bcons) #<bytecode 0x155e72eec959>) (...) :key #f(compiled-function (b) #<bytecode 0x155e74483a01>))
  (persp-save-to-file-by-names "..." #<hash-table equal 3/10 0x155e742034b5> ("test") t)

The culprit seems to be here:

          (setq bufferlist-diff
                (cl-delete-if #'(lambda (bcons)
                                  (cl-destructuring-bind (buf . buf-persps) bcons
                                    (when buf
                                      (persp--buffer-in-persps-set buf buf-persps)
                                      t)))
                              (funcall persp-buffer-list-function)
                              :key #'(lambda (b) (assq b bufferlist-pre))))))

since assq might return nil. Changing it to: (or (assq b bufferlist-pre) '(nil)) seems to be a workaround.

Bad-ptr commented 3 years ago

Must be fixed in bd3d634c30123dbddf7028210f53dcccb1371db2