php-auto-yasnippets icon indicating copy to clipboard operation
php-auto-yasnippets copied to clipboard

yas--all-parents: Lisp nesting exceeds `max-lisp-eval-depth'

Open drzraf opened this issue 11 years ago • 3 comments

When loading php-auto-yasnippets with my normal .emacs I get the above errors

  • "backtrace1" below if using M-x yas/create-php-snippet (I get wrong-type-argument stringp nil)
  • "backtrace2" below if using the keybinding (\C-C \C-Y)

But when running : $ emacs -nw -D -Q --debug-init a.php (load-file ~/.emacs.d/php-mode.el) (load-file ~/.emacs.d/dropdown-list.el) (load-file ~/.emacs.d/yasnippet.el) (load-file ~/.emacs.d/php-auto-yasnippets.el) M-: (setq php-auto-yasnippet-php-program "/tmp/Create-PHP-YASnippet.php") M-: (define-key php-mode-map (kbd "C-c C-y") 'yas/create-php-snippet)

Then going on implode and for the example, putting my cursor after the "i" then M-x yas/create-php-snippet:

  • the status bar says : You can run the command yas/create-php-snippet' with C-c C-y`
  • a newline (nothing else) is inserted between the "i" and the "m"

My hypothesis is that it's not impossible that 2 bugs live here, one about the snippet builder itself (backtrace1) and another one about the interactive/non-interactive function call and empty argument (or something related).

  • backtrace 1 (using M-x yas/create-php-snippet)
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("[ \f    \n
]+" nil 0)
  split-string(nil)
  (let* ((input-chunks (split-string input)) (function-or-method-name (first input-chunks)) (class-name (or (second input-chunks) "")) (args (list php-executable nil (current-buffer) nil php-auto-yasnippet-php-program))) (setq command-args (list function-or-method-name class-name)) (progn (let ((--dolist-tail-- php-auto-yasnippet-required-files) elt) (while --dolist-tail-- (setq elt (car --dolist-tail--)) (setq command-args (cons elt command-args)) (setq command-args (cons "--require-once" command-args)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq elt nil) command-args)) (setq args (append args command-args)) (apply (quote call-process) args))
  (progn (let* ((input-chunks (split-string input)) (function-or-method-name (first input-chunks)) (class-name (or (second input-chunks) "")) (args (list php-executable nil (current-buffer) nil php-auto-yasnippet-php-program))) (setq command-args (list function-or-method-name class-name)) (progn (let ((--dolist-tail-- php-auto-yasnippet-required-files) elt) (while --dolist-tail-- (setq elt (car --dolist-tail--)) (setq command-args (cons elt command-args)) (setq command-args (cons "--require-once" command-args)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq elt nil) command-args)) (setq args (append args command-args)) (apply (quote call-process) args)))
  (unwind-protect (progn (let* ((input-chunks (split-string input)) (function-or-method-name (first input-chunks)) (class-name (or (second input-chunks) "")) (args (list php-executable nil (current-buffer) nil php-auto-yasnippet-php-program))) (setq command-args (list function-or-method-name class-name)) (progn (let ((--dolist-tail-- php-auto-yasnippet-required-files) elt) (while --dolist-tail-- (setq elt (car --dolist-tail--)) (setq command-args (cons elt command-args)) (setq command-args (cons "--require-once" command-args)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq elt nil) command-args)) (setq args (append args command-args)) (apply (quote call-process) args))) (set-match-data save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let* ((input-chunks (split-string input)) (function-or-method-name (first input-chunks)) (class-name (or (second input-chunks) "")) (args (list php-executable nil (current-buffer) nil php-auto-yasnippet-php-program))) (setq command-args (list function-or-method-name class-name)) (progn (let ((--dolist-tail-- php-auto-yasnippet-required-files) elt) (while --dolist-tail-- (setq elt ...) (setq command-args ...) (setq command-args ...) (setq --dolist-tail-- ...)) (setq elt nil) command-args)) (setq args (append args command-args)) (apply (quote call-process) args))) (set-match-data save-match-data-internal (quote evaporate))))
  payas/create-template(nil)
  (let ((exit-code (payas/create-template input))) (if (/= exit-code 0) (payas/report-error exit-code input)) (yas-define-snippets (quote php-mode) (list (yas--parse-template))))
  (progn (let ((exit-code (payas/create-template input))) (if (/= exit-code 0) (payas/report-error exit-code input)) (yas-define-snippets (quote php-mode) (list (yas--parse-template)))))
  (unwind-protect (progn (let ((exit-code (payas/create-template input))) (if (/= exit-code 0) (payas/report-error exit-code input)) (yas-define-snippets (quote php-mode) (list (yas--parse-template))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((exit-code (payas/create-template input))) (if (/= exit-code 0) (payas/report-error exit-code input)) (yas-define-snippets (quote php-mode) (list (yas--parse-template))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((exit-code (payas/create-template input))) (if (/= exit-code 0) (payas/report-error exit-code input)) (yas-define-snippets (quote php-mode) (list (yas--parse-template))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (if (yas--get-template-by-uuid (quote php-mode) input) nil (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((exit-code ...)) (if (/= exit-code 0) (payas/report-error exit-code input)) (yas-define-snippets (quote php-mode) (list ...)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  payas/define-template(nil)
  (if class (payas/define-template (concat function " " class)) (payas/define-template function))
  (let ((function (thing-at-point (quote symbol))) (class (if prefix (read-from-minibuffer "Class: ")))) (if class (payas/define-template (concat function " " class)) (payas/define-template function)) (setq php-auto-yasnippet-executing t) (yas-expand))
  yas/create-php-snippet(nil)
  call-interactively(yas/create-php-snippet record nil)
  command-execute(yas/create-php-snippet record)
  execute-extended-command(nil "yas/create-php-snippet")
  call-interactively(execute-extended-command nil nil)
  • backtrace 2 (using \C-C \C-Y) : http://bpaste.net/show/175005/

drzraf avatar Feb 03 '14 12:02 drzraf

Thanks for the detailed bug information. That will help a lot for fixing this.

ejmr avatar Feb 03 '14 18:02 ejmr

Same thing occur if you are at the end of string? implode_ <- cursor

amcorreia avatar Mar 24 '14 01:03 amcorreia

http://bpaste.net/show/193029/

drzraf avatar Mar 24 '14 14:03 drzraf