From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "John W. Eaton" Newsgroups: gmane.emacs.bugs Subject: %-Comments in Emacs Octave-Mode Date: Fri, 24 Oct 2003 12:54:07 -0500 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <16281.26431.103647.908189@devzero.bogus.domain> References: <20031024134043.78714d06.christoph.dalitz@hs-niederrhein.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1067018116 32136 80.91.224.253 (24 Oct 2003 17:55:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2003 17:55:16 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, Octave Mailing List Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 24 19:55:11 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AD69W-00064p-00 for ; Fri, 24 Oct 2003 19:55:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AD69M-00030I-H8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Oct 2003 13:55:00 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AD69H-0002tv-BE for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2003 13:54:55 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AD68Z-0001Ux-5n for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2003 13:54:42 -0400 Original-Received: from [128.104.177.141] (helo=bevo.che.wisc.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AD68Y-0001UP-Ng for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2003 13:54:10 -0400 Original-Received: from devzero.bogus.domain (12-221-108-64.client.insightBB.com [12.221.108.64]) by bevo.che.wisc.edu (8.12.6/8.12.6/Debian-7) with ESMTP id h9OHs7fV012597; Fri, 24 Oct 2003 12:54:08 -0500 Original-Received: from devzero.bogus.domain (jwe@localhost [127.0.0.1]) by devzero.bogus.domain (8.12.9/8.12.9/Debian-5) with ESMTP id h9OHs7jF022860; Fri, 24 Oct 2003 13:54:07 -0400 Original-Received: (from jwe@localhost) by devzero.bogus.domain (8.12.9/8.12.9/Debian-5) id h9OHs7pl022856; Fri, 24 Oct 2003 12:54:07 -0500 Original-To: Christoph Dalitz In-Reply-To: <20031024134043.78714d06.christoph.dalitz@hs-niederrhein.de> X-Mailer: VM 7.17 under Emacs 21.2.1 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6023 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6023 On 24-Oct-2003, Christoph Dalitz wrote: | just observed that the Emacs octave-mode does not recognize lines | beginning wiht % as comment lines. | | Does someone know how to teach emacs this additional comment sign? | I guess I have to add some special octave-mode-hook, but what | should this hook contain? Please try the following patch. The problem that the deleted comment refers to has apparently been fixed, so indenting and font locking both appear to work properly now for things like sprintf ("%s" "some string") even when % is considered a comment character. Thanks, jwe ChangeLog: 2003-10-24 John W. Eaton * emacs/octave-mod.el (octave-mode-syntax-table): Allow % to be a comment character. Index: emacs/octave-mod.el =================================================================== RCS file: /usr/local/cvsroot/octave/emacs/octave-mod.el,v retrieving revision 1.26 diff -u -r1.26 octave-mod.el --- emacs/octave-mod.el 30 Jul 2003 19:15:31 -0000 1.26 +++ emacs/octave-mod.el 24 Oct 2003 17:47:09 -0000 @@ -292,15 +292,6 @@ ["Lookup Octave Index" octave-help t]) "Menu for Octave mode.") -;; XXX FIXME XXX -- the syntax mode for `%' is punctuation instead of -;; begin-comment because if it is begin-comment, then typing M-; -;; (octave-indent-for-comment) on lines like -;; -;; sprintf ("%d", foobar); -;; -;; causes them to be improperly indented (the `%' is moved over to the -;; comment-column). - (defvar octave-mode-syntax-table nil "Syntax table in use in octave-mode buffers.") (if octave-mode-syntax-table @@ -323,7 +314,7 @@ (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?. "w" table) (modify-syntax-entry ?_ "w" table) - (modify-syntax-entry ?\% "." table) ; see above + (modify-syntax-entry ?\% "<" table) (modify-syntax-entry ?\# "<" table) (modify-syntax-entry ?\n ">" table) (setq octave-mode-syntax-table table)))