From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Kamphausen Newsgroups: gmane.emacs.help Subject: Re: Error with fill-paragraph in my own major mode Date: Thu, 31 Jan 2008 09:36:59 +0100 Organization: Church of Emacs Message-ID: <85hcgutmqc.fsf@usenet.my.skamphausen.de> 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 1201772098 30718 80.91.229.12 (31 Jan 2008 09:34:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2008 09:34:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 31 10:35:18 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 1JKVpG-0002qo-1n for geh-help-gnu-emacs@m.gmane.org; Thu, 31 Jan 2008 10:35:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKVoo-000363-Ie for geh-help-gnu-emacs@m.gmane.org; Thu, 31 Jan 2008 04:34:50 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-X-Trace: news.albasani.net gOVBDyp1+8EHjAudmRjJQ5fRSZCvXI21sFIgjPohBHr7FA+VqlPGOQX/DFEDcXCp0UYp8UjnX2FhiY2ha0SWbmz+vQu+Fc0Of1QfEZTPg4FMJyfsUuLP4nsd7UP0KuaU Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Thu, 31 Jan 2008 08:37:00 +0000 (UTC) X-User-ID: Rv5/b4gmCzyBidCD9syCYPhtuxI19ozBA24L0JXJb+Y= Cancel-Lock: sha1:bGesaIdWxJvWY0CQzovZ2heK8Lc= sha1:LS4mSs1EU9SirsDPnsA1QmP5M7s= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-NNTP-Posting-Host: NH7PagXJI8qY6jT581F7J/kC5rG3MVPIYrM4eCeMr6Y= Original-Xref: shelby.stanford.edu gnu.emacs.help:155734 X-Mailman-Approved-At: Thu, 31 Jan 2008 04:30:20 -0500 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:51116 Archived-At: Hi Stefan, Stefan Monnier writes: >> 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 "". thanks. I now have (setq comment-start "@#: " comment-end "" comment-start-skip "@#: +") and that seems to work. I will have to further test it, though. The new setting was 'inspired' by the one in texinfo-mode so I will read some more of that code. Nevertheless I must admit that I don't really grok that code in fill.el. What is that (concat "\0" commark "a") good for? Anyway, thanks once more for your time. Regards, Stefan -- Stefan Kamphausen --- http://www.skamphausen.de a blessed +42 regexp of confusion (weapon in hand) You hit. The format string crumbles and turns to dust.