unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14381: 24.3; smie-auto-fill infinite loop
@ 2013-05-10 13:06 Leo Liu
  2013-05-12  3:29 ` Leo Liu
  2013-05-23 17:45 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Leo Liu @ 2013-05-10 13:06 UTC (permalink / raw)
  To: 14381

[-- Attachment #1: Type: text/plain, Size: 2704 bytes --]

1. emacs -q
2. open the attached bug.m file
3. move to the end of second line
4. M-: (smie-auto-fill)

Should enter an infinite loop.

Debugger entered--Lisp error: (quit)
  syntax-ppss()
  smie-indent-comment-inside()
  run-hook-with-args-until-success(smie-indent-comment-inside)
  smie-indent-calculate()
  (let* ((newcol (smie-indent-calculate)) (newgain (- curcol newcol))) (when (> newgain gain) (setq gain newgain) (setq bsf (point))))
  (while (<= (setq curcol (current-column)) fc) (let* ((newcol (smie-indent-calculate)) (newgain (- curcol newcol))) (when (> newgain gain) (setq gain newgain) (setq bsf (point)))) (smie-indent-forward-token))
  (let ((bsf (point)) (gain 0) curcol) (while (<= (setq curcol (current-column)) fc) (let* ((newcol (smie-indent-calculate)) (newgain (- curcol newcol))) (when (> newgain gain) (setq gain newgain) (setq bsf (point)))) (smie-indent-forward-token)) (when (> gain 0) (goto-char bsf) (newline-and-indent)))
  (save-excursion (beginning-of-line) (smie-indent-forward-token) (let ((bsf (point)) (gain 0) curcol) (while (<= (setq curcol (current-column)) fc) (let* ((newcol (smie-indent-calculate)) (newgain (- curcol newcol))) (when (> newgain gain) (setq gain newgain) (setq bsf (point)))) (smie-indent-forward-token)) (when (> gain 0) (goto-char bsf) (newline-and-indent))))
  (cond ((not (or (nth 8 (save-excursion (syntax-ppss (line-beginning-position)))) (nth 8 (syntax-ppss)))) (save-excursion (beginning-of-line) (smie-indent-forward-token) (let ((bsf (point)) (gain 0) curcol) (while (<= (setq curcol (current-column)) fc) (let* ((newcol ...) (newgain ...)) (when (> newgain gain) (setq gain newgain) (setq bsf ...))) (smie-indent-forward-token)) (when (> gain 0) (goto-char bsf) (newline-and-indent))))) (t (do-auto-fill)))
  (while (and fc (> (current-column) fc)) (cond ((not (or (nth 8 (save-excursion (syntax-ppss ...))) (nth 8 (syntax-ppss)))) (save-excursion (beginning-of-line) (smie-indent-forward-token) (let ((bsf (point)) (gain 0) curcol) (while (<= (setq curcol ...) fc) (let* (... ...) (when ... ... ...)) (smie-indent-forward-token)) (when (> gain 0) (goto-char bsf) (newline-and-indent))))) (t (do-auto-fill))))
  (let ((fc (current-fill-column))) (while (and fc (> (current-column) fc)) (cond ((not (or (nth 8 (save-excursion ...)) (nth 8 (syntax-ppss)))) (save-excursion (beginning-of-line) (smie-indent-forward-token) (let ((bsf ...) (gain 0) curcol) (while (<= ... fc) (let* ... ...) (smie-indent-forward-token)) (when (> gain 0) (goto-char bsf) (newline-and-indent))))) (t (do-auto-fill)))))
  smie-auto-fill()
  eval((smie-auto-fill) nil)
  eval-expression((smie-auto-fill) nil)
  call-interactively(eval-expression nil nil)



[-- Attachment #2: bug.m --]
[-- Type: text/plain, Size: 101 bytes --]

## -*-Octave-*-
printf ("aaaa dddd dddd dddd dddd dddd dddd dddd dddd dddd dddd dddd dddd #i", abcd)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14381: 24.3; smie-auto-fill infinite loop
  2013-05-10 13:06 bug#14381: 24.3; smie-auto-fill infinite loop Leo Liu
@ 2013-05-12  3:29 ` Leo Liu
  2013-05-13 15:43   ` Stefan Monnier
  2013-05-23 17:45 ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Liu @ 2013-05-12  3:29 UTC (permalink / raw)
  To: 14381

Hi Stefan,

On 2013-05-10 21:06 +0800, Leo Liu wrote:
> Should enter an infinite loop.

I would like to simplify and fix octave's fill-paragraph and auto-fill
feature. Could you help fix or direct me how to fix this bug and
bug#14303?

Thanks,
Leo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14381: 24.3; smie-auto-fill infinite loop
  2013-05-12  3:29 ` Leo Liu
@ 2013-05-13 15:43   ` Stefan Monnier
  2013-05-17 23:16     ` Leo Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-05-13 15:43 UTC (permalink / raw)
  To: Leo Liu; +Cc: 14381

>> Should enter an infinite loop.
> I would like to simplify and fix octave's fill-paragraph and auto-fill
> feature.

Very good idea (when I moved octave to SMIE, I wanted to do that as
well, but ended up leaving it for later).

> Could you help fix or direct me how to fix this bug and bug#14303?

I think to fix/simplify them well, you'll need to touch some of the
generic code.  For bug#14303, the first ting to do is to read the code
of comment-search-backward.

If I were you, I'd start with octave-auto-fill, trying to replace it
with something that hooks elsewhere, such as in fill-nobreak-predicate
and in comment-line-break-function.

For octave-fill-paragraph, I'm not sure what should be done there, but
the functionality looks like it could be useful in many
programming modes.  So maybe it should be moved to prog-mode.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14381: 24.3; smie-auto-fill infinite loop
  2013-05-13 15:43   ` Stefan Monnier
@ 2013-05-17 23:16     ` Leo Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Leo Liu @ 2013-05-17 23:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 14381

On 2013-05-13 23:43 +0800, Stefan Monnier wrote:
> If I were you, I'd start with octave-auto-fill, trying to replace it
> with something that hooks elsewhere, such as in fill-nobreak-predicate
> and in comment-line-break-function.

Yes, this was exactly what I tried i.e. set comment-line-break-function
to a octave-specific function but found this hangs due to this bug. smie
sets normal-auto-fill-function to smie-auto-fill.

Leo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14381: 24.3; smie-auto-fill infinite loop
  2013-05-10 13:06 bug#14381: 24.3; smie-auto-fill infinite loop Leo Liu
  2013-05-12  3:29 ` Leo Liu
@ 2013-05-23 17:45 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2013-05-23 17:45 UTC (permalink / raw)
  To: Leo Liu; +Cc: 14381

> 4. M-: (smie-auto-fill)
> Should enter an infinite loop.

I believe it's fixed now.


        Stefan "who has the impression you're not familiar with Edebug"





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-23 17:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-10 13:06 bug#14381: 24.3; smie-auto-fill infinite loop Leo Liu
2013-05-12  3:29 ` Leo Liu
2013-05-13 15:43   ` Stefan Monnier
2013-05-17 23:16     ` Leo Liu
2013-05-23 17:45 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).