[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#697: closed (Octave comments in emacs)

From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#697: closed (Octave comments in emacs)
Date: Thu, 10 Mar 2011 07:07:01 +0000

Your message dated Thu, 10 Mar 2011 02:06:13 -0500
with message-id <address@hidden>
and subject line Re: Octave comments in emacs
has caused the GNU bug report #697,
regarding Octave comments in emacs
to be marked as done.

(If you believe you have received this mail in error, please contact

697: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=697
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Re: Octave comments in emacs Date: Mon, 11 Aug 2008 22:36:49 -0400
The % also messes up formatting when seen in strings, ie 'my value: %d'

For some reason, the octave syntax does not recognize that single
quotes are strings (it might be because the transpose character is
also ' and it is hard to differentiate between a string and the

In any case, writing the above example will treat the % as a comment.
The indenting engine will skip the closing parenthesis )... resulting
in all the rest of the indents looking like garbage.

To fix the weird positioning of single % comments and the following
problems, go tino octave-mod.el and

in octave-mode-syntax-table change
(modify-syntax-entry ?\' "." table)
(modify-syntax-entry ?\' "\"" table)

in calculate-octave-indent at the bottom change
((looking-at "\\s<\\S<")
((and (looking-at "\\s<\\S<") (not (looking-at "%")))

i use (looking-at octave-comment-char) instead since some people use #
for comments

I'm not sure what the consequences of these changes are. From the
testing I've done, emacs formatting is running more like how the
matlab editor would format. Now if someone can fix the indentation
problems with "end", we'll have perfect indenting.

rosen diankov,

2007/12/28 Olivier Lefevre <address@hidden>:
> Ah OK. I had read about % vs. %% and %%% but it hadn't registered, perhaps
> because it smelled perl-ish and thus went in one ear, out the other.
> In the brain-damaged language(s) the other gentleman was referring to,
> emacs will automatically indent the comment line according to its position
>  in the code, without need for any of that %% or %%% flummery ;-) That is
> both more natural and more practical, I think. But I can live with %%.
> Thanks again,
> -- O.L.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave

--- End Message ---
--- Begin Message --- Subject: Re: Octave comments in emacs Date: Thu, 10 Mar 2011 02:06:13 -0500 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Octave mode has undergone considerable changes in the Emacs trunk.
Please open new reports for any issues that may occur.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]