From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [BUG] (error "Lisp nesting exceeds `max-lisp-eval-depth'") Date: Tue, 12 Feb 2013 10:07:53 +0100 Message-ID: <867gmdj3x2.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, Since the last pull I made, I can't expand anymore BBDB aliases in Gnus... because of Org! --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Lisp nesting exceeds `max-lisp-eval-depth'") yas--all-parents(text-mode) (lambda (mode) (yas--all-parents mode))(text-mode) mapcar((lambda (mode) (yas--all-parents mode)) (text-mode message-mode)) cl-mapcar((lambda (mode) (yas--all-parents mode)) (text-mode message-mode)) apply(cl-mapcar (lambda (mode) (yas--all-parents mode)) (text-mode message-mode) nil) mapcan((lambda (mode) (yas--all-parents mode)) (text-mode message-mode)) (append modes-to-activate (mapcan (function (lambda (mode) (yas--all-parents mode))) modes-to-activate)) (remove-duplicates (append modes-to-activate (mapcan (function (lambda (mode) (yas--all-parents mode))) modes-to-activate))) (let ((modes-to-activate (list major-mode)) (mode major-mode)) (while (setq mode (get mode (quote derived-mode-parent))) (setq modes-to-activate (cons mode modes-to-activate))) (progn (let ((--dolist-tail-- (yas-extra-modes)) mode) (while --dolist-tail-- (setq mode (car --dolist-tail--)) (setq modes-to-activate (cons mode modes-to-activate)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (remove-duplicates (append modes-to-activate (mapcan (function (lambda (mode) (yas--all-parents mode))) modes-to-activate)))) yas--modes-to-activate() (mapcar (function (lambda (mode-name) (gethash mode-name yas--tables))) (yas--modes-to-activate)) (remove nil (mapcar (function (lambda (mode-name) (gethash mode-name yas--tables))) (yas--modes-to-activate))) yas--get-snippet-tables() (mapcan (function (lambda (table) (yas--fetch table (buffer-substring-no-properties start end)))) (yas--get-snippet-tables)) (setq templates (mapcan (function (lambda (table) (yas--fetch table (buffer-substring-no-properties start end)))) (yas--get-snippet-tables))) (while (and (not done) syntaxes) (setq syntax (car syntaxes)) (setq syntaxes (cdr syntaxes)) (save-excursion (skip-syntax-backward syntax) (setq start (point))) (setq templates (mapcan (function (lambda (table) (yas--fetch table (buffer-substring-no-properties start end)))) (yas--get-snippet-tables))) (if templates (setq done t) (setq start end))) (let ((start (point)) (end (point)) (syntaxes yas-key-syntaxes) syntax done templates) (while (and (not done) syntaxes) (setq syntax (car syntaxes)) (setq syntaxes (cdr syntaxes)) (save-excursion (skip-syntax-backward syntax) (setq start (point))) (setq templates (mapcan (function (lambda (table) (yas--fetch table (buffer-substring-no-properties start end)))) (yas--get-snippet-tables))) (if templates (setq done t) (setq start end))) (list templates start end)) yas--current-key() (if field (save-restriction (narrow-to-region (yas--field-start field) (yas--field-end field)) (yas--current-key)) (yas--current-key)) (setq templates-and-pos (if field (save-restriction (narrow-to-region (yas--field-start field) (yas--field-end field)) (yas--current-key)) (yas--current-key))) (if (and yas-expand-only-for-last-commands (not (member last-command yas-expand-only-for-last-commands))) nil (setq templates-and-pos (if field (save-restriction (narrow-to-region (yas--field-start field) (yas--field-end field)) (yas--current-key)) (yas--current-key)))) (let (templates-and-pos) (if (and yas-expand-only-for-last-commands (not (member last-command yas-expand-only-for-last-commands))) nil (setq templates-and-pos (if field (save-restriction (narrow-to-region (yas--field-start field) (yas--field-end field)) (yas--current-key)) (yas--current-key)))) (if (and templates-and-pos (first templates-and-pos)) (yas--expand-or-prompt-for-template (first templates-and-pos) (second templates-and-pos) (car (cdr (cdr templates-and-pos)))) (yas--fallback (quote trigger-key)))) yas-expand() call-interactively(yas-expand) (if (keymapp binding) (set-temporary-overlay-map binding) (call-interactively (or binding (quote orgstruct-error)))) (let ((binding (let ((orgstruct-mode)) (key-binding " ")))) (if (keymapp binding) (set-temporary-overlay-map binding) (call-interactively (or binding (quote orgstruct-error))))) (if (let* ((org-heading-regexp (concat "^" orgstruct-heading-prefix-regexp "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$")) (org-outline-regexp (concat orgstruct-heading-prefix-regexp "\\*+ ")) (org-outline-regexp-bol (concat "^" org-outline-regexp)) (outline-regexp org-outline-regexp) (outline-heading-end-regexp "\n") (outline-level (quote outline-level)) (outline-heading-alist)) (when (org-context-p (quote headline) (quote item) nil) (org-run-like-in-org-mode (quote org-cycle)) t)) nil (let ((binding (let ((orgstruct-mode)) (key-binding " ")))) (if (keymapp binding) (set-temporary-overlay-map binding) (call-interactively (or binding (quote orgstruct-error)))))) (unless (let* ((org-heading-regexp (concat "^" orgstruct-heading-prefix-regexp "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$")) (org-outline-regexp (concat orgstruct-heading-prefix-regexp "\\*+ ")) (org-outline-regexp-bol (concat "^" org-outline-regexp)) (outline-regexp org-outline-regexp) (outline-heading-end-regexp "\n") (outline-level (quote outline-level)) (outline-heading-alist)) (when (org-context-p (quote headline) (quote item) nil) (org-run-like-in-org-mode (quote org-cycle)) t)) (let ((binding (let ((orgstruct-mode)) (key-binding " ")))) (if (keymapp binding) (set-temporary-overlay-map binding) (call-interactively (or binding (quote orgstruct-error)))))) orgstruct-hijacker-org-cycle(1) call-interactively(orgstruct-hijacker-org-cycle) (let* ((beyond-yasnippet (yas--keybinding-beyond-yasnippet))) (yas--message 4 "Falling back to %s" beyond-yasnippet) (progn (or (or (null beyond-yasnippet) (commandp beyond-yasnippet)) (signal (quote cl-assertion-failed) (list (quote (or (null beyond-yasnippet) (commandp beyond-yasnippet)))))) nil) (setq this-original-command beyond-yasnippet) (call-interactively beyond-yasnippet)) (cond ((eq yas-fallback-behavior (quote return-nil)) nil) ((eq yas-fallback-behavior (quote call-other-command)) (let* ((beyond-yasnippet (yas--keybinding-beyond-yasnippet))) (yas--message 4 "Falling back to %s" beyond-yasnippet) (progn (or (or (null beyond-yasnippet) (commandp beyond-yasnippet)) (signal (quote cl-assertion-failed) (list (quote ...)))) nil) (setq this-original-command beyond-yasnippet) (call-interactively beyond-yasnippet))) ((and (listp yas-fallback-behavior) (cdr yas-fallback-behavior) (eq (quote apply) (car yas-fallback-behavior))) (if (cddr yas-fallback-behavior) (apply (cadr yas-fallback-behavior) (cddr yas-fallback-behavior)) (if (commandp (cadr yas-fallback-behavior)) (progn (setq this-command (cadr yas-fallback-behavior)) (call-interactively (cadr yas-fallback-be havior)))))) (t nil)) yas--fallback(trigger-key) (if (and templates-and-pos (first templates-and-pos)) (yas--expand-or-prompt-for-template (first templates-and-pos) (second templates-and-pos) (car (cdr (cdr templates-and-pos)))) (yas--fallback (quote trigger-key))) (let (templates-and-pos) (if (and yas-expand-only-for-last-commands (not (member last-command yas-expand-only-for-last-commands))) nil (setq templates-and-pos (if field (save-restriction (narrow-to-region (yas--field-start field) (yas--field-end field)) (yas--current-key)) (yas--current-key)))) (if (and templates-and-pos (first templates-and-pos)) (yas--expand-or-prompt-for-template (first templates-and-pos) (second templates-and-pos) (car (cdr (cdr templates-and-pos)))) (yas--fallback (quote trigger-key)))) yas-expand() call-interactively(yas-expand) [... many repeated blocks ...] call-interactively(yas-expand) (let (orgtbl-mode) (call-interactively (or (key-binding [(tab)]) (key-binding " ") (quote orgtbl-error)))) (if (org-at-table-p) (call-interactively (quote orgtbl-tab)) (let (orgtbl-mode) (call-interactively (or (key-binding [(tab)]) (key-binding " ") (quote orgtbl-error))))) orgtbl-hijacker-command-102(1) call-interactively(orgtbl-hijacker-command-102 nil nil) --8<---------------cut here---------------end--------------->8--- Note that Org is plugged into Message mode: --8<---------------cut here---------------start------------->8--- (defun my/message-mode-hook () (local-set-key (kbd "") 'mail-abbrev-complete-alias) (turn-on-auto-fill) (turn-on-orgtbl) (turn-on-orgstruct++) (when (try-require 'org-footnote) (set (make-local-variable 'org-footnote-auto-label) 'plain) (set (make-local-variable 'org-footnote-tag-for-non-org-mode-files) nil))) (add-hook 'message-mode-hook 'my/message-mode-hook) --8<---------------cut here---------------end--------------->8--- Hence, the link between Org and BBDB expansion... I've bisected, and found out that: --8<---------------cut here---------------start------------->8--- a3f6570fffcfc1b1880b646cfabdf2a6f8187956 is the first bad commit commit a3f6570fffcfc1b1880b646cfabdf2a6f8187956 Author: Christopher Schmidt Date: Sun Feb 10 18:46:57 2013 +0100 Allow a custom headline prefix in orgstruct-mode. * lisp/org.el (org-cycle-global-status) (org-cycle-subtree-status): Set state property. (org-heading-components): Use org-heading-regexp in orgstruct-mode. (orgstruct-heading-prefix-regexp, orgstruct-setup-hook): New options. (orgstruct-initialized): New variable. (orgstruct-mode): Simplify implementation. (orgstruct-setup): Simplify implementation. Translate keys to their most general equivalent. (orgstruct-make-binding): Generate index on the fly. Discard alternative keys. Bind variables according to orgstruct-heading-prefix-regexp. (org-get-local-variables): Honour state property. (org-run-like-in-org-mode): Do not override variables with non-default values. (org-forward-heading-same-level): Do not skip to headlines on another level. Handle negative prefix argument correctly. (org-backward-heading-same-level): Use org-forward-heading-same-level. --8<---------------cut here---------------end--------------->8--- Effectively, when checking out commit ba38de1 (last good commit), everything works again like expected. Best regards, Seb -- Sebastien Vauban