all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "John W. Eaton" <jwe@bevo.che.wisc.edu>
Cc: bug-gnu-emacs@gnu.org,
	Octave Mailing List <help-octave@bevo.che.wisc.edu>
Subject: %-Comments in Emacs Octave-Mode
Date: Fri, 24 Oct 2003 12:54:07 -0500	[thread overview]
Message-ID: <16281.26431.103647.908189@devzero.bogus.domain> (raw)
In-Reply-To: <20031024134043.78714d06.christoph.dalitz@hs-niederrhein.de>

On 24-Oct-2003, Christoph Dalitz <christoph.dalitz@hs-niederrhein.de> 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  <jwe@bevo.che.wisc.edu>

	* 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)))

       reply	other threads:[~2003-10-24 17:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031024134043.78714d06.christoph.dalitz@hs-niederrhein.de>
2003-10-24 17:54 ` John W. Eaton [this message]
2003-10-27 20:53   ` %-Comments in Emacs Octave-Mode Christoph Dalitz
2003-10-27 21:12     ` John W. Eaton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16281.26431.103647.908189@devzero.bogus.domain \
    --to=jwe@bevo.che.wisc.edu \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=help-octave@bevo.che.wisc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.