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: Re: `comment-start' is nil Date: Wed, 12 Mar 2014 23:26:43 +0100 Message-ID: <87y50foxy4.fsf@gmail.com> References: <878usf6qu5.fsf@yun.yagibdah.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1394663168 29235 80.91.229.3 (12 Mar 2014 22:26:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2014 22:26:08 +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 Mar 12 23:26:14 2014 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 1WNrbJ-0004zg-DV for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 23:26:13 +0100 Original-Received: from localhost ([::1]:35226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNrbJ-0006nj-05 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 18:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNraz-0006d2-DD for help-gnu-emacs@gnu.org; Wed, 12 Mar 2014 18:25:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNrat-0007WC-5Q for help-gnu-emacs@gnu.org; Wed, 12 Mar 2014 18:25:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:60211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNras-0007W0-On for help-gnu-emacs@gnu.org; Wed, 12 Mar 2014 18:25:47 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WNrar-0004Xo-Dw for help-gnu-emacs@gnu.org; Wed, 12 Mar 2014 23:25:45 +0100 Original-Received: from e178061230.adsl.alicedsl.de ([85.178.61.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Mar 2014 23:25:45 +0100 Original-Received: from tjolitz by e178061230.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Mar 2014 23:25:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 50 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178061230.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:WCGI/T6jMTywQGoh71kSDjoGtss= 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:96480 Archived-At: lee writes: > Hi, > > I´m using desktop-mode to restore the previous session when starting > emacs. For some buffers that are restored this way, I´m using a mode > I´m working on. This mode employs a function to search for a regex in > particular buffers. The regex involves `comment-start'. > > Unfortunately, at the time the function is running during start-up, the > value of `comment-start' is nil. > > > (let ((end-marker (concat "^" comment-start lsl-hi-lock-patterns-end-marker))) > (message "comment-start with %s is %s" > (buffer-name) > comment-start) ...) > > > gives me messages like "comment-start with test-plane.fontify is nil". > Calling the same function later works fine because `comment-start' isn´t > nil anymore. > > Is it supposed to be like this, or is it a bug that `comment-start' is > nil? > > > I could work around it by setting `comment-start' to "# ", or by > omitting it, when it´s nil, but if it´s a bug, it should rather be > fixed ... maybe call ,----------------------------------------------------------------------- | comment-normalize-vars is a compiled Lisp function in `newcomment.el'. | | (comment-normalize-vars &optional NOERROR) | | Check and set up variables needed by other commenting functions. | All the `comment-*' commands call this function to set up various | variables, like `comment-start', to ensure that the commenting | functions work correctly. Lisp callers of any other `comment-*' | function should first call this function explicitly. `----------------------------------------------------------------------- before using comment-start? -- cheers, Thorsten