[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46327: 28.0.50; octave-mode: transpose-quotes taken as string-quotes
From: |
Juang Dse |
Subject: |
bug#46327: 28.0.50; octave-mode: transpose-quotes taken as string-quotes |
Date: |
Sun, 7 Feb 2021 15:04:56 +0100 |
indeed, the ' character is the transpose operator (like in matlab),
and that patch makes emacs essentially useless for octave. Without it,
everything looks fine as I just verified.
Note that the ' character as a string occurs only in pairs, which is
(hopefully) unambiguous.
On Sun, Feb 7, 2021 at 2:06 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Juang Dse <juangdse@gmail.com> writes:
>
> > octave-mode takes the transpose sign (') for a string quote, and
> > indents incorrectly.
> >
> > This can be seen by the two lines
> > ---------------
> > x = [2 2]'
> > disp(x)
> > ---------------
> > and using indent-for-tab-command (TAB) for the 2nd line.
>
> This is due to the following patch:
>
> commit 9e68413c7f0a7f71e1cee923ace7282d14c2e686
> Author: Noam Postavsky <npostavs@users.sourceforge.net>
> AuthorDate: Mon Aug 24 17:33:49 2020 +0200
>
> Fix inferior octave single-quote font lock
>
> * lisp/progmodes/octave.el (octave-mode-syntax-table): Fix
> fontification of single quotes in inferior octave mode (bug#25517).
>
> It looks like the problem is that octave-mode-syntax-table sets single
> quotes as punctuation even though GNU Octave's manual says single quotes
> are string syntax [1].
>
> [1]:
> https://www.gnu.org/software/octave/doc/interpreter/String-Objects.html
>
> And, indeed, that link says:
>
> "A character string in Octave consists of a sequence of characters
> enclosed in either double-quote or single-quote marks."
>
> But the ' character is also a transposition operator? I don't know
> Octave at all -- this seems like a rather ambiguous syntax?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no