Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

julia-mode.el: triple quoted strings and @doc #11510

Closed
mauro3 opened this issue May 31, 2015 · 14 comments
Closed

julia-mode.el: triple quoted strings and @doc #11510

mauro3 opened this issue May 31, 2015 · 14 comments

Comments

@mauro3
Copy link
Contributor

mauro3 commented May 31, 2015

Triple quoted stings don't work properly in emacs mode. Now that we have the @doc documentation, I stumble over this one every other method I write. Indentation never works. Highlighting is a erratic.

Example:

@doc """
     Sets the topography related functions:
     B -- bed eleveation
     """ ->
function settopo!(pa::GlaDSPara, B, H, ub)
    ...
end

This issue seems to be known: #9025 (comment) but I wanted to bump it.

@Wilfred
Copy link
Contributor

Wilfred commented Jun 7, 2015

Thanks for filing this, I shouldn't have just left a comment in another issue. Would you mind filing a separate bug for indentation, with an example of where we do the wrong thing?

For reference, here's an example of a triple-quoted string that we currently highlight incorrectly:

@doc """
     Sets the topography related functions:
     "
     B -- bed eleveation
     """

It's unreliable though.

@yuyichao
Copy link
Contributor

yuyichao commented Jun 7, 2015

@Wilfred That triple quote mixed with single quote seems to be a problem in python-mode as well, which is why I didn't bother too much....

@yuyichao
Copy link
Contributor

yuyichao commented Jun 7, 2015

Actually what exactly is this report about? I do remember some indent problems a few month ago but this is what I'm getting now in my emacs.

@doc """
Sets the topography related functions:
B -- bed eleveation
""" ->
function settopo!(pa::GlaDSPara, B, H, ub)
    ...
end

Both this and the one in the original report looks OK for me. (My standard may be wrong so I just want to understand the problem)

IMHO, the tripple quote and single quote issue is probably a different one, as @Wilfred said.

@cortner
Copy link

cortner commented Jun 15, 2015

I definitely still have problems with triple-quoted strings; see screenshot

screen shot 2015-06-15 at 14 44 31

Then I add and remove a space after the second """ and the highlighting corrects itself.

screen shot 2015-06-15 at 14 47 40

I am using the latest version off one of the emacs package repositories (today's date)

@yuyichao
Copy link
Contributor

Ah so indent works but not highlghting? Forgot to check that.

@cortner
Copy link

cortner commented Jun 15, 2015

I think I used to have problems with indent, but haven't noticed anything since I switched back to julia-mode from ESS, but it has only been a few hours. I will report back here if I find something.

@yuyichao
Copy link
Contributor

@cortner that's the same with what I remember. Please do report back if it stops working again.

@mauro3
Copy link
Contributor Author

mauro3 commented Jun 15, 2015

Indent doesn't work for me if it is indented (haha...). For instance this I need to do by hand, every line:

function f()
    a = """
        Hello
        """
end

@yuyichao
Copy link
Contributor

I see. What I remember not working before is that the function gets an extra indent after the -> in @doc

@cortner
Copy link

cortner commented Jun 15, 2015

I don't have that problem. If I indent the first line after """ then the following lines will be indented correctly. But I think the first line not being indented is the correct behaviour (at least how I use it). E.g.

@doc doc"""some documentation for
a new function; blah blah
"""->
mynewfunction() = nothing

@mauro3
Copy link
Contributor Author

mauro3 commented Jun 15, 2015

I think my usage above is correct and it produces the correct string. See #2305

@cortner
Copy link

cortner commented Jun 15, 2015

I see.

For what it's worth, that convention seems reasonable inside a function etc, but for documentation I want the entire width of the editor window.

@mauro3
Copy link
Contributor Author

mauro3 commented Jun 15, 2015

Yes, I agree with that.

@yuyichao
Copy link
Contributor

Remaining issue moved to JuliaEditorSupport/julia-emacs#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants