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 11:29:42 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1367811022 20800 80.91.229.3 (6 May 2013 03:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 May 2013 03:30:22 +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 05:30:19 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 1UZC80-0001cT-Lk for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 May 2013 05:30:16 +0200 Original-Received: from localhost ([::1]:55489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZC80-0000EM-6M for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 May 2013 23:30:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZC7v-0000EG-Ra for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 23:30:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZC7u-00088H-UZ for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 23:30:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZC7u-000885-RX for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 23:30:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UZC8m-00084X-90 for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 23:31:04 -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 03:31:03 +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.136781105430969 (code B ref 14332); Mon, 06 May 2013 03:31:03 +0000 Original-Received: (at 14332) by debbugs.gnu.org; 6 May 2013 03:30:54 +0000 Original-Received: from localhost ([127.0.0.1]:59273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZC8b-00083L-Mj for submit@debbugs.gnu.org; Sun, 05 May 2013 23:30:54 -0400 Original-Received: from mail-pd0-f182.google.com ([209.85.192.182]:52842) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZC8X-00082e-Jd for 14332@debbugs.gnu.org; Sun, 05 May 2013 23:30:50 -0400 Original-Received: by mail-pd0-f182.google.com with SMTP id 3so1772594pdj.27 for <14332@debbugs.gnu.org>; Sun, 05 May 2013 20:29:53 -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=H8mBm2SbLKpXXZPJMKs/p5DA4Wa1qfixrVLq1Eby418=; b=Y+GSVpv1UKK+XPORW1yfs7R5mqnB181lzJjdzpHD9RyFphYpYidzRRv2Zn/hQncC0C C9rc2b57/cHQwTBSK2rQJi/8V3FdbWPjNyVAkMKYEaUy8ouvSzlfnOmIPP3AN+YzJ48N NFE6bnsbe8yMTcTcDl1EoLzu89RoBEkmde6oOonEbmXe3EoypOxmm/xdkFrv6A/06sS1 qmNbtIpL/LjGyiUkUng+4+/gYXN1PZeJg60aNYM3AjjfoM+YUhpM8pXCZKlC1M1lYGiH dMtPN8hXPUu7yUNwxFlbFz85B8M12XJLd5KcupvLttsHGLBLQ/qHHm4AC8WIfLfrtRLd Kv5w== X-Received: by 10.68.211.73 with SMTP id na9mr24107699pbc.90.1367810993788; Sun, 05 May 2013 20:29:53 -0700 (PDT) Original-Received: from Zeuss-MacBook.local (li511-224.members.linode.com. [66.175.216.224]) by mx.google.com with ESMTPSA id br2sm21930851pbc.46.2013.05.05.20.29.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 05 May 2013 20:29:52 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= In-Reply-To: (Stefan Monnier's message of "Sun, 05 May 2013 21:04:14 -0400") 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:74001 Archived-At: --=-=-= Content-Type: text/plain On 2013-05-06 09:04 +0800, Stefan Monnier wrote: > Then your best bet is probably to put in the mode's syntax-table the > syntax corresponding to the most common use of \ (either as an escape > char in strings or as an operator), and then use syntax-propertize to > put the other syntax on the other case (where you can check (nth > 3 (syntax-ppss (math-beginning 0))) to see if you're within a string). What I would like is to have \ mean "." unless it is in double-quoted strings where it should be "\\". I have the following non-working patch. Ideas? diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 2e848600..d5a1af2b 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -137,6 +137,8 @@ (defun octave-syntax-propertize-function (start end) (goto-char start) (octave-syntax-propertize-sqs end) (funcall (syntax-propertize-rules + ("\\\\" (0 (when (eq (nth 3 (syntax-ppss (match-beginning 0))) ?\") + "\\"))) ;; Try to distinguish the string-quotes from the transpose-quotes. ("\\(?:^\\|[[({,; ]\\)\\('\\)" (1 (prog1 "\"'" (octave-syntax-propertize-sqs end))))) @@ -242,7 +244,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) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=oct_ind.m Content-Description: oct_ind.m ## -*-Octave-*- "abc\"abc" if (true) a = (1 \(2-3)); else a = 0; endif --=-=-=--