From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Error with fill-paragraph in my own major mode Date: Wed, 30 Jan 2008 16:49:37 -0500 Organization: UseNetServer.com Message-ID: References: <85y7a7l0z3.fsf@usenet.my.skamphausen.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201732831 26753 80.91.229.12 (30 Jan 2008 22:40:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2008 22:40:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 30 23:40:52 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JKLbu-0007hj-Gk for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jan 2008 23:40:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKLbT-0007VT-Av for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jan 2008 17:40:23 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!out02a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!TEKSAVVY.COM-Free-a2kHrUvQQWlmc!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:vbVOu0X38z4bMVoi5eUBt0BJdg8= Original-X-Complaints-To: abuse@usenetserver.com Original-Lines: 24 Original-X-Trace: 9113647a0f0f26b5d3adc30468 Original-Xref: shelby.stanford.edu gnu.emacs.help:155723 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51106 Archived-At: > 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