From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: Debugger entered--Lisp error: (excessive-lisp-nesting) Date: Thu, 08 Jun 2023 11:51:30 +0000 Message-ID: References: <5be8d927-9c6a-f6f9-3b06-7ac2d0f68045@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27562"; mail-complaints-to="usenet@ciao.gmane.io" Cc: uzibalqa via Users list for the GNU Emacs text editor To: Platon Pronko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 08 13:52:23 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7EBj-0006tV-Gr for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Jun 2023 13:52:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7EBM-0000J7-VT; Thu, 08 Jun 2023 07:52:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7EBF-0000HA-P1 for help-gnu-emacs@gnu.org; Thu, 08 Jun 2023 07:51:55 -0400 Original-Received: from mail-4318.protonmail.ch ([185.70.43.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7EBC-0005oR-0Q for help-gnu-emacs@gnu.org; Thu, 08 Jun 2023 07:51:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1686225099; x=1686484299; bh=+Dxtdq6u46t1KcLAYJwghKSeCaGR31CrY8mPO1WIuuI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=LQj+wrA9DGcqFuZD90ejzKpl91rTimxH717kQkfynCG2MJbuv+0Q09/s9MGQiGc+V M9SNaO4zGvUS1s0hHNufD8irizkJKL7Y7UMy1qQdrpxISw5Jmep4QV13eZDh6mlLV4 ysICiWh/iLYiQHvE9NuClGdp8kdkzXKpd6DfhxAw1UDjYevH4a7ucXngP41yFLbYnw 5pxsjAreQhFLf8YVL+RuG6TQcc5TzR1nR+sdfE/X1R5fgzOR2Jsq6zI4R28jOkFaES oR1hnzYvi+Yz8rR5iOG1CqzbPGg4BgmURjJ96LyC4barc7+VyOz9sHqXxgYnU5LfmO xjXu//VyEy4FA== In-Reply-To: <5be8d927-9c6a-f6f9-3b06-7ac2d0f68045@gmail.com> Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.43.18; envelope-from=uzibalqa@proton.me; helo=mail-4318.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143888 Archived-At: ------- Original Message ------- On Thursday, June 8th, 2023 at 8:50 PM, Platon Pronko wrote: > On 2023-06-08 15:07, uzibalqa wrote: >=20 > > I am getting the following debugger information but have been unable to= locate the problem. > >=20 > > What can I do ? > >=20 > > Debugger entered--Lisp error: (excessive-lisp-nesting) > > (cond ((eq arg 'toggle) (not tematika-minor-mode)) ((and (numberp arg) = (< arg 1)) nil) (t t)) > > (setq tematika-minor-mode (cond ((eq arg 'toggle) (not tematika-minor-m= ode)) ((and (numberp arg) (< arg 1)) nil) (t t))) > > (let ((last-message (current-message))) (setq tematika-minor-mode (cond= ((eq arg 'toggle) (not tematika-minor-mode)) ((and (numberp arg) (< arg 1)= ) nil) (t t))) (if (boundp 'local-minor-modes) (progn (setq local-minor-mod= es (delq 'tematika-minor-mode local-minor-modes)) (if tematika-minor-mode (= progn (setq local-minor-modes (cons 'tematika-minor-mode local-minor-modes)= ))))) (if tematika-minor-mode (progn (tematika-tools) (tematika-addhooks-wo= utline) (tematika-activate-woutline) (message "Tematika Activated")) (temat= ika-activate-woutline) (message "Tematika Deactivated")) (run-hooks 'temati= ka-minor-mode-hook (if tematika-minor-mode 'tematika-minor-mode-on-hook 'te= matika-minor-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (= if (and (current-message) (not (equal last-message (current-message)))) nil= (let ((local " in current buffer")) (message "Tematika minor mode %sabled%= s" (if tematika-minor-mode "en" "dis") local)))))) > > tematika-minor-mode(0) > > tematika-activate-woutline() > > (if tematika-minor-mode (progn (tematika-tools) (tematika-addhooks-wout= line) (tematika-activate-woutline) (message "Tematika Activated")) (tematik= a-activate-woutline) (message "Tematika Deactivated")) > > (let ((last-message (current-message))) (setq tematika-minor-mode (cond= ((eq arg 'toggle) (not tematika-minor-mode)) ((and (numberp arg) (< arg 1)= ) nil) (t t))) (if (boundp 'local-minor-modes) (progn (setq local-minor-mod= es (delq 'tematika-minor-mode local-minor-modes)) (if tematika-minor-mode (= progn (setq local-minor-modes (cons 'tematika-minor-mode local-minor-modes)= ))))) (if tematika-minor-mode (progn (tematika-tools) (tematika-addhooks-wo= utline) (tematika-activate-woutline) (message "Tematika Activated")) (temat= ika-activate-woutline) (message "Tematika Deactivated")) (run-hooks 'temati= ka-minor-mode-hook (if tematika-minor-mode 'tematika-minor-mode-on-hook 'te= matika-minor-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (= if (and (current-message) (not (equal last-message (current-message)))) nil= (let ((local " in current buffer")) (message "Tematika minor mode %sabled%= s" (if tematika-minor-mode "en" "dis") local)))))) > > tematika-minor-mode(0) >=20 >=20 > Looks like you are reaching the recursion limit. Looking at the debugger = trace it seems that (tematika-minor-mode) invokes (tematika-minor-mode), wh= ich causes infinite recursion. - Platon Pronko Absolutely right. Have written a minor mode that provides some customisati= ons to outline-minor-mode. Would like that when tematika-minor-mode is activated, outline-minor-mode g= ets enabled automatically.=20 I have the following. The problem happened because I was calling (tematika= -activation) within the definition of tematika-minor-mode, as soon as tematika-minor-mode gets acti= vated. Would you be so kind to show me how I can enable outline-minor-mode when th= e user enables tematika-minor-mode so as to avoid the infinite recursion problem ? I also need a way to disable outline-minor-mode when tematika-minor-mode is= disabled. (defun tematika-activation () "Activate `tematika-minor-mode' with `outline-minor-mode' in a buffer-local way." (tematika-minor-mode (if outline-minor-mode 1 0))) ;;;###autoload (define-minor-mode tematika-minor-mode "Enhances visibility of heading levels and text emphasis." :init-value nil :lighter " Tematika" (if tematika-minor-mode ;; Enable minor mode capability (progn (tematika-tools) (tematika-hooks-outl) ;; (tematika-activation) (message "Tematika Activated")) ;; [ELSE] Revert the functionality provided by minor mode ;; (tematika-activate-woutline) (message "Tematika Deactivated")) )