bmag / emacs-purpose

Manage Windows and Buffers According to Purposes
GNU General Public License v3.0
496 stars 23 forks source link

Error when displaying buffer: Symbol's function defnition is void: closure #150

Closed Zulu-Inuoe closed 5 years ago

Zulu-Inuoe commented 5 years ago

When using emacs-purpose combined with sly and trying to go-to-reference I get an error when I select an xref entry.

I've tracked the error down to purpose-display--action-to-sequence, which is meant to normalize a display action into a list of functions. eg.

(purpose-display--action-to-sequence '(display-buffer-same-window . nil))
;; =>
(display-buffer-same-window)

(purpose-display--action-to-sequence '((display-buffer-same-window display-buffer-reuse-window) . nil))
;; =>
(display-buffer-same-window display-buffer-reuse-window)

this works fine for named functions, but it's perfectly legal to have closures and lambdas in that form too:

(purpose-display--action-to-sequence (cons (lambda (buffer alist)) nil))
;; =>
(lambda (buffer alist))
;; Should be 
((lambda (buffer alist)))

Submitting a PR to fix this