unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Rosen Diankov" <rdiankov@cs.cmu.edu>
To: Kurt.Hornik@wu-wien.ac.at
Cc: Chong Yidong <cyd@stupidchicken.com>, 703@emacsbugs.donarmstrong.com
Subject: bug#703: Octave comments in emacs
Date: Wed, 20 Aug 2008 19:27:56 -0400	[thread overview]
Message-ID: <103101d70808201627r693dc69fl4ab0f32f082aa9f@mail.gmail.com> (raw)
In-Reply-To: <103101d70808201621x243bc027xee296d26d5ce5331@mail.gmail.com>

And one other question, what would it take to get the Abstract Syntax
Tree for an Octave expression through elisp? Like Kurt said, we'll
need to parse the code in order to actually differentiate between the
transposing operator ' and a string. Isn't there anything in elisp
that will allow you to do this?

I'm willing to put some time into this if someone can start me off in
the right direction.

rosen,

2008/8/20 Rosen Diankov <rdiankov@cs.cmu.edu>:
> Hi all,
>
> Coming from Matlab, I feel much more comfortable if the single quotes
> were treated like double quotes (transposing is not as important), and
> if the comments were aligned to the start of the next line (like the
> // in C++). Given that a lot of people use Octave as a free
> alternative to Matlab, I think a lot would expect the same formatting
> rules as the matlab editor.
>
> At least it would be great to expose these options to the user like
> 'octave-auto-indent' instead of having people hunt through
> octave-mod.el to get the behavior they want.
>
> Rosen,
>
> 2008/8/20 Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>:
>>>>>>> Chong Yidong writes:
>>
>>> Hi Kurt,
>>> Could you take a look at this bug report?
>>
>>> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=697
>>> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=703
>>
>>> Thanks.
>>
>> Sure.
>>
>> I am not quite sure I understand what the issue is.
>>
>> 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.
>>
>> The comment style provided by Octave mode is the same as for Lisp mode,
>> so a single comment char is aligned at the comment column.
>>
>> Best
>> -k
>>
>>> 2008/8/11 Rosen Diankov <rdiankov@cs.cmu.edu>:
>>
>>>> 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
>>>> transposing).
>>>>
>>>> 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.
>>>>
>>> ....
>>>>
>>>> In calculate-octave-indent, just delete the entire expression
>>>>
>>>> ((looking-at "\\s<\\S<")
>>>> (setq icol (list comment-column icol)))
>>>>
>>>> that forces comments to comment-column (which is 32). Was there a
>>>> reason for this?
>>
>>
>






  reply	other threads:[~2008-08-20 23:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13 22:18 bug#703: Octave comments in emacs Chong Yidong
2008-08-20 16:55 ` Kurt Hornik
2008-08-20 23:21   ` Rosen Diankov
2008-08-20 23:27     ` Rosen Diankov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-08-21 15:55 Chong Yidong
2008-08-21 18:26 ` Rosen Diankov
2008-08-12  2:36 Rosen Diankov
2008-08-12 20:07 ` Rosen Diankov
2008-08-14 20:31   ` bug#703: " Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=103101d70808201627r693dc69fl4ab0f32f082aa9f@mail.gmail.com \
    --to=rdiankov@cs.cmu.edu \
    --cc=703@emacsbugs.donarmstrong.com \
    --cc=Kurt.Hornik@wu-wien.ac.at \
    --cc=cyd@stupidchicken.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).