From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: 'comment-search-forward' fails when 'comment-use-global-state' is nil Date: Tue, 14 May 2013 13:40:25 +0200 Message-ID: <87sj1p3i3a.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368531666 7562 80.91.229.3 (14 May 2013 11:41:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 May 2013 11:41:06 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 14 13:41:04 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UcDbM-0004v4-Pp for geh-help-gnu-emacs@m.gmane.org; Tue, 14 May 2013 13:41:04 +0200 Original-Received: from localhost ([::1]:35068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcDbM-0005Pp-Bp for geh-help-gnu-emacs@m.gmane.org; Tue, 14 May 2013 07:41:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcDb4-0005PF-2n for help-gnu-emacs@gnu.org; Tue, 14 May 2013 07:40:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcDb2-0007MI-SN for help-gnu-emacs@gnu.org; Tue, 14 May 2013 07:40:45 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcDb2-0007M7-Ie for help-gnu-emacs@gnu.org; Tue, 14 May 2013 07:40:44 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UcDay-0004fd-H7 for help-gnu-emacs@gnu.org; Tue, 14 May 2013 13:40:40 +0200 Original-Received: from e178061149.adsl.alicedsl.de ([85.178.61.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 May 2013 13:40:40 +0200 Original-Received: from tjolitz by e178061149.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 May 2013 13:40:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178061149.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:eiJc5/LMODMG6fr73xEKzzBY8+s= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90746 Archived-At: Hi List, this is a valid comment in message-mode ,------------ | > * comment `------------ and with point at the beginning of this line, ,--------------------------------------------- | M-: (comment-search-forward (line-end-position)) `--------------------------------------------- should do this ,------------------------------------------------------------------ | Find a comment start between point and LIMIT. | Moves point to inside the comment and returns the position of the | comment-starter. `------------------------------------------------------------------ This works for me in this buffer while I'm writing this email, but does not work anymore if I copy the content of this buffer to a temporary edit-buffer and set that buffer to message-mode. Some debugging revealed that the difference between the two (apparently equal) situations is that in the message buffer I write this email in, 'comment-use-global-state' is 't', while in the temporary edit-buffer in message-mode the variable's value is 'nil', and the comment line is not recognized any more by 'comment-search-forward'. Now I wonder how this difference can be explained, and how I can work around it. I did not encounter this problem with temporary edit buffers set to emacs-lisp-mode or picolisp-mode e.g., in that cases 'comment-search-forward' worked as expected. -- cheers, Thorsten