From: uzibalqa <uzibalqa@proton.me>
To: Platon Pronko <platon7pronko@gmail.com>
Cc: uzibalqa via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Re: Debugger entered--Lisp error: (excessive-lisp-nesting)
Date: Thu, 08 Jun 2023 11:51:30 +0000 [thread overview]
Message-ID: <nFVQYFE9Zkg1vmr6tqiZ9OysaLAzpz5SAOvhSnO2pgWEphyFjcZh0JSWV7trhLl7-JiBhKJnDpYCEKBAg9lzLFy8m5gieHof_D-yCm33Xfc=@proton.me> (raw)
In-Reply-To: <5be8d927-9c6a-f6f9-3b06-7ac2d0f68045@gmail.com>
------- Original Message -------
On Thursday, June 8th, 2023 at 8:50 PM, Platon Pronko <platon7pronko@gmail.com> wrote:
> On 2023-06-08 15:07, uzibalqa wrote:
>
> > I am getting the following debugger information but have been unable to locate the problem.
> >
> > What can I do ?
> >
> > 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-mode)) ((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-modes (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-woutline) (tematika-activate-woutline) (message "Tematika Activated")) (tematika-activate-woutline) (message "Tematika Deactivated")) (run-hooks 'tematika-minor-mode-hook (if tematika-minor-mode 'tematika-minor-mode-on-hook 'tematika-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-woutline) (tematika-activate-woutline) (message "Tematika Activated")) (tematika-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-modes (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-woutline) (tematika-activate-woutline) (message "Tematika Activated")) (tematika-activate-woutline) (message "Tematika Deactivated")) (run-hooks 'tematika-minor-mode-hook (if tematika-minor-mode 'tematika-minor-mode-on-hook 'tematika-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)
>
>
> Looks like you are reaching the recursion limit. Looking at the debugger trace it seems that (tematika-minor-mode) invokes (tematika-minor-mode), which causes infinite recursion. - Platon Pronko
Absolutely right. Have written a minor mode that provides some customisations to outline-minor-mode.
Would like that when tematika-minor-mode is activated, outline-minor-mode gets enabled automatically.
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 activated.
Would you be so kind to show me how I can enable outline-minor-mode when the 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")) )
next prev parent reply other threads:[~2023-06-08 11:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 7:07 Debugger entered--Lisp error: (excessive-lisp-nesting) uzibalqa
2023-06-08 8:50 ` Platon Pronko
2023-06-08 11:51 ` uzibalqa [this message]
2023-06-09 6:38 ` Platon Pronko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='nFVQYFE9Zkg1vmr6tqiZ9OysaLAzpz5SAOvhSnO2pgWEphyFjcZh0JSWV7trhLl7-JiBhKJnDpYCEKBAg9lzLFy8m5gieHof_D-yCm33Xfc=@proton.me' \
--to=uzibalqa@proton.me \
--cc=help-gnu-emacs@gnu.org \
--cc=platon7pronko@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).