Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elisp-format-region might run into an infinite loop #3

Open
ghost opened this issue Dec 3, 2018 · 3 comments
Open

elisp-format-region might run into an infinite loop #3

ghost opened this issue Dec 3, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 3, 2018

Hi there,

thank you very much for this package.

I encountered a small bug a few days ago. Formatting the code in the attached file will send elisp-format into an infinite loop (more precisely, the while loop in elisp-format-region never terminates). The occurence of the bug seems to depend on the value of elisp-format-column, which is 100 for me.

test.txt

@Yuki-Inoue
Copy link
Owner

Sorry late reply. Recently, I don't write elisp codes...

If someone can make PR, then I can verify, and accept.

@lihao2333
Copy link

I find the same bug.
When I run elisp-format-buffer in following buffer,

;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.

(use-package treemacs 
	:config (progn 
						(setq treemacs-goto-tag-strategy 'refetch-index
									treemacs-header-scroll-indicators '(nil . "asd"))))
(setq elisp-format-debug-mode t)
(setq elisp-format-column 100)

the formating seems not terminates.

This is the message output:


Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.

@lihao2333
Copy link

I find the same bug. When I run elisp-format-buffer in following buffer,

;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.

(use-package treemacs 
	:config (progn 
						(setq treemacs-goto-tag-strategy 'refetch-index
									treemacs-header-scroll-indicators '(nil . "asd"))))
(setq elisp-format-debug-mode t)
(setq elisp-format-column 100)

the formating seems not terminates.

This is the message output:


Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.
8
Format string at 8 completed.

It seems that some format process could not reduce the current-column so that the while loop never terminates.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants