From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#703: Octave comments in emacs Date: Thu, 21 Aug 2008 11:55:44 -0400 Message-ID: <87k5eawef3.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 703@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1219335009 30554 80.91.229.12 (21 Aug 2008 16:10:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2008 16:10:09 +0000 (UTC) Cc: Rosen Diankov , 703@emacsbugs.donarmstrong.com To: Kurt Hornik Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 21 18:11:01 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KWCk7-0002mm-Dk for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Aug 2008 18:10:35 +0200 Original-Received: from localhost ([127.0.0.1]:36525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWCj9-0002QH-VA for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Aug 2008 12:09:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWChA-0008IV-4q for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2008 12:07:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWCh8-0008H4-OI for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2008 12:07:31 -0400 Original-Received: from [199.232.76.173] (port=39612 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWCh8-0008Gt-IL for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2008 12:07:30 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59416) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWCh8-0000UB-3C for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2008 12:07:30 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7LG7Roq019673; Thu, 21 Aug 2008 09:07:27 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7LG04i7016211; Thu, 21 Aug 2008 09:00:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 21 Aug 2008 16:00:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 703 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 703-submit@emacsbugs.donarmstrong.com id=B703.121933407414418 (code B ref 703); Thu, 21 Aug 2008 16:00:04 +0000 Original-Received: (at 703) by emacsbugs.donarmstrong.com; 21 Aug 2008 15:54:34 +0000 Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7LFsR39014412 for <703@emacsbugs.donarmstrong.com>; Thu, 21 Aug 2008 08:54:28 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id D50C357E2B5; Thu, 21 Aug 2008 11:55:44 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Thu, 21 Aug 2008 12:07:31 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19605 Archived-At: Stefan Monnier wrote: > > Is there a way to assign two different syntax rules for the same > > character in emacs? Ie, one where ' is treated as a string quote > > (and suppresses the syntax elements inside the quotes), and one > > where it is treated as a suffix operator. > > Yes, there is, using the `syntax-table' property. A common way to set > this property is via the font-lock-syntactic-keywords variable. > > So all it takes is a regexp good enough to distinguish the two cases Kurt Hornik wrote: > Octave mode has never provided syntax support for single quoted > strings because there is no way (short of actually parsing the code) > of telling these apart from single quotes used for transposition. Maybe we could use a rough heuristic to handle most of the cases. A ' character that occurs before "[=(] *" is probably the beginning of a single quoted string, not a transpose operator. WDYT?