From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#14332: 24.3; Octave indentation bug Date: Mon, 06 May 2013 16:26:13 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1367828838 10295 80.91.229.3 (6 May 2013 08:27:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 May 2013 08:27:18 +0000 (UTC) Cc: 14332@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 06 10:27:17 2013 Return-path: Envelope-to: geb-bug-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 1UZGlO-0004yr-9p for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 May 2013 10:27:14 +0200 Original-Received: from localhost ([::1]:57951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZGlN-0002h3-Fp for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 May 2013 04:27:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZGlI-0002ed-Eo for bug-gnu-emacs@gnu.org; Mon, 06 May 2013 04:27:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZGlG-0005ZQ-SX for bug-gnu-emacs@gnu.org; Mon, 06 May 2013 04:27:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZGlG-0005ZK-PG for bug-gnu-emacs@gnu.org; Mon, 06 May 2013 04:27:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UZGmA-00040O-9g for bug-gnu-emacs@gnu.org; Mon, 06 May 2013 04:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 May 2013 08:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14332 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14332-submit@debbugs.gnu.org id=B14332.136782883815185 (code B ref 14332); Mon, 06 May 2013 08:28:02 +0000 Original-Received: (at 14332) by debbugs.gnu.org; 6 May 2013 08:27:18 +0000 Original-Received: from localhost ([127.0.0.1]:59451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZGlR-0003wo-If for submit@debbugs.gnu.org; Mon, 06 May 2013 04:27:18 -0400 Original-Received: from mail-pb0-f48.google.com ([209.85.160.48]:49359) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZGlP-0003wc-7n for 14332@debbugs.gnu.org; Mon, 06 May 2013 04:27:16 -0400 Original-Received: by mail-pb0-f48.google.com with SMTP id ma3so1858363pbc.7 for <14332@debbugs.gnu.org>; Mon, 06 May 2013 01:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:face:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=aYIFT0AWzZKxW9TA5o7ajL4AFBP0t4c3HXlgiSduowc=; b=vC1eZMQo43Zziskk06+8NgVxKWNtW2wLl9+tMsjo9dxvX7+DzRhVrJMZymxVGmfCPe pkkfXvJ+YK8Sb+GF0wAmj0gcby7NK8TgyuFCcRWS1j63XeaV0Ax6VYwkJX/4H9UK43sC rcgfVhDFnpD0tgkrIHH89IezO5XTUAnMaUDC7GodVyEPD2P9tvHdAIiJ9HOxTU7O5RoX iUH5yXzA7LO9YhF/JaVYCh22gfLoMIBHR32aUfMcI586jEpYoebR6qixKtvXhf6Fr+O3 pzgJYS2xOZiWC8IlrOysUma2hFdvIB0I/WK+zB8C4Nn4PHXeu1gbXOBJBHDEsL7wddZi qYbg== X-Received: by 10.68.132.101 with SMTP id ot5mr1550079pbb.11.1367828778670; Mon, 06 May 2013 01:26:18 -0700 (PDT) Original-Received: from Zeuss-MacBook.local (li511-224.members.linode.com. [66.175.216.224]) by mx.google.com with ESMTPSA id aj2sm23034788pbc.1.2013.05.06.01.26.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 May 2013 01:26:18 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7 4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC /ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf X0cAAAAASUVORK5CYII= In-Reply-To: (Leo Liu's message of "Mon, 06 May 2013 11:29:42 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74009 Archived-At: On 2013-05-06 11:29 +0800, Leo Liu wrote: > What I would like is to have \ mean "." unless it is in double-quoted > strings where it should be "\\". This patch seems working. This is the first time I am using the syntax-table property. Stefan, do you see any problem with the patch? diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 2e848600..66fda302 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -134,6 +134,12 @@ (defvar octave-font-lock-keywords "Additional Octave expressions to highlight.") (defun octave-syntax-propertize-function (start end) + (funcall (syntax-propertize-rules + ("\\\\" (0 (when (eq (nth 3 (save-excursion + (syntax-ppss (match-beginning 0)))) + ?\") + (string-to-syntax "\\"))))) + start end) (goto-char start) (octave-syntax-propertize-sqs end) (funcall (syntax-propertize-rules @@ -242,7 +248,7 @@ (defvar octave-mode-syntax-table (modify-syntax-entry ?& "." table) (modify-syntax-entry ?| "." table) (modify-syntax-entry ?! "." table) - (modify-syntax-entry ?\\ "\\" table) + (modify-syntax-entry ?\\ "." table) (modify-syntax-entry ?\' "." table) ;; Was "w" for abbrevs, but now that it's not necessary any more, (modify-syntax-entry ?\` "." table)