Macaulay2 / M2-emacs

Macaulay2 emacs files
GNU General Public License v3.0
5 stars 3 forks source link

Filenames with spaces aren't clickable #48

Closed d-torrance closed 5 months ago

d-torrance commented 10 months ago

For example, consider the file foo bar.m2 which contains a division by zero error:

image

I think I introduced this bug in #39.

mahrud commented 9 months ago

Not space related, but recently, typing code on any function with options messes up the syntax highlighting for me:

i17 : code method

o17 = /home/mahrud/Projects/M2/M2/M2/Macaulay2/m2/option.m2:15:19-17:33: --source code:
        (opts,f) -> args -> (
             -- Common code for functions created with >> to process options and arguments.
             uncurry(f, override (opts,args))
             )
        )
      | symbol  class            value                                                    location of symbol
      | ------  -----            -----                                                    ------------------                                             
      | f       FunctionClosure  -*Function[/home/mahrud/Projects/M2/M2/M2/Macaulay2/m2.  /home/mahrud/Projects/M2/M2/M2/Macaulay2/m2/option.m2:15:8-15:9
      | opts    OptionTable      OptionTable{Binary => false                         }    /home/mahrud/Projects/M2/M2/M2/Macaulay2/m2/option.m2:15:3-15:7
      |                                      Dispatch => {Thing, Thing, Thing, Thing}     
      |                                      Options => null                              
      |                                      TypicalValue => Thing                        

As you can see, after a point everything is grayed out. The issue starts here:

      | f       FunctionClosure  -*Function[/home/mahrud/Projects/M2/M2/M2/Macaulay2/m2.  /home/mahrud/Projects/M2/M2/M2/Macaulay2/m2/option.m2:15:8-15:9

For some reason the value column is truncated, leaving the *- part out and messing up the syntax highlighting. I don't remember this happening before, so I suspect this may be inadvertently introduced by you or after FilePosition changes by @pzinn.

We could change the truncation, replace part of the filename with ..., or even just print a random *- at some point, but I thought one of you might have a better suggestion.

mahrud commented 9 months ago

Here's a much smaller example of this happening:

i13 : H = Ext(M,k);
stdio:2:9:(3):[7]: error: no method found for applying ring to:
     argument   :  -*Function[../../m2/ext.m2:106:4. (of class FunctionClosure)

i14 : *-  C-c C-c^C -- everything is grayed

i14 :