emacs - "cl-labels with dynamic scoping is not implemented" -
i'm trying use cl-labels in emacs package i'm writing. user has filed bug report problem i'm not observing in own emacs @ version 24.3.1, user on 24.3.2.
https://github.com/d11wtq/fiplr/issues/3
`cl-labels' dynamic scoping not implemented
i'm using cl-labels
here: https://github.com/d11wtq/fiplr/blob/f368e84410d2ee57117b2d6501c0cf42359bc252/fiplr.el#l154-l177
;; builds gigantic `find' shell command -prune, -o, -not , shit. (defun fiplr-list-files-shell-command (type path ignored-globs) "builds `find' command locate project files & directories." "path base directory recurse from." "ignored-globs alist keys 'directories , 'files." (cl-labels ((type-abbrev (assoc-type) (cl-case assoc-type ('directories "d") ('files "f"))) (name-matcher (glob) (mapconcat 'identity `("-name" ,(shell-quote-argument glob)) " ")) (grouped-name-matchers (type) (mapconcat 'identity `(,(shell-quote-argument "(") ,(mapconcat #'name-matcher (cadr (assoc type ignored-globs)) " -o ") ,(shell-quote-argument ")")) " ")) (matcher (assoc-type) (mapconcat 'identity `(,(shell-quote-argument "(") "-type" ,(type-abbrev assoc-type) ,(grouped-name-matchers assoc-type) ,(shell-quote-argument ")")) " "))) (mapconcat 'identity `("find" ,(shell-quote-argument (directory-file-name path)) ,(matcher 'directories) "-prune" "-o" "-not" ,(matcher 'files) "-type" ,(type-abbrev type) "-print") " ")))
now, reason i'm using cl-labels
allow private internal functions used, , each of functions depends on others 1 declared in cl-labels
definition.
i don't need dynamic scoping neither. there macro gives me want, or should switch longer named global functions? (which kind of suck given how irrelevant these functions other parts of code)
basically need letrec
scheme, or labels
common lisp.
edit | ended using liberal combination of (lambda () .. )
, (funcall ...)
, (let* ...)
. love know if there's more elegant solution works in emacs lisp.
your code looks fine. , there's no error 1 cite in emacs's own source code, error signaled external package. there's no "24.3.1" or "24.3.2" release. there's "24.3" release, , additional ".1" or ".2" build number, bug-reporter using same version of emacs you. happens using package has bug.
Comments
Post a Comment