[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error with fill-paragraph in my own major mode
From: |
Stefan Monnier |
Subject: |
Re: Error with fill-paragraph in my own major mode |
Date: |
Wed, 30 Jan 2008 16:49:37 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
> Today it has been brought to my attention that there is an error when
> one tries to fill a paragraph (M-q) using that major mode in Gnu Emacs
> 22. Back then I wrote that mode in XEmacs, today I seem to be a Gnu
> Emacs user so I'd like to fix that issue.
> Hitting M-q leads to an error
> Args out of range: "", -1, 0
> Using debug-on-error and edebug I could track that error down to the
> following code in function fill-comment-paragraph in fill.el:
> (if (string-match comment-start-skip (concat "\0" commark "a"))
> (concat "[ \t]*" (regexp-quote commark)
> ;; Make sure we only match comments that
> ;; use the exact same comment marker.
> "[^" (substring commark -1) "]")
> ^^^^^^^^^^^^^^^^^^^^^^
The problem is the setting of comment-start-skip.
This regexp should match a "comment-start marker" (plus some optional
whitespace), where you set it to "".
Stefan