From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Comment lines and matching parentheses Date: Thu, 18 Mar 2010 23:43:49 +0100 Organization: Informatimago Message-ID: <874okdw8re.fsf@galatea.lan.informatimago.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272995623 28415 80.91.229.12 (4 May 2010 17:53:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 17:53:43 +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 04 19:53:42 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O9MJM-00038A-4m for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 19:53:41 +0200 Original-Received: from localhost ([127.0.0.1]:37985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9MIz-0008FX-6c for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 13:53:13 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-X-Trace: individual.net 7wFxW0Fz1SGYLlPVPX+GwwBKtN9Ub+FdZGwZtUibud/MiRyJ41 Cancel-Lock: sha1:ODQyMGFkMjU3NDYxMDJmMDlmODViN2M4YTY5OGFhMGEwNzgyNjliNw== sha1:JXkT6ktcMCAuzRPlkBJI1zdymjY= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) Original-Xref: usenet.stanford.edu gnu.emacs.help:177504 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:73007 Archived-At: dnquark writes: > What determines whether or not parentheses that are part of comments > are included when performing paren matching?.. For instance, in C > mode, both > // ( > // ) > and > foo //( > bar //) > are reported as mismatched parentheses. Similar behavior is observed > in lisp mode. > > Is there a way to make emacs ignore all parentheses that are parts of > comments?.. This behavior sometimes breaks hs-minor-mode's ability to > fold code in buffers. In lisp-mode (or emacs-lisp-mode), parentheses in comments are not identified as parentheses to be matched. The following check-parens correctly: ( ;; ( ;; )) ) And similarly in c-mode (and derived such as c++-mode): { ( // ( // )) ) } check-parens correctly too. So I don't observe what you're saying. Here I use emacs-version "22.3.1", but I never noticed the bad behavior your describe in any emacs version from 18 to 23, as long as the correct mode is applied to the buffer. Now, I don't use hs-minor-mode. Perhaps this is the problem. Perhaps check-parens and other parenthesis balancing code cannot deal with parentheses that are hidden by hs-minor-mode? -- __Pascal Bourguignon__