Giter Site home page Giter Site logo

different styles of comment about pg HOT 6 OPEN

ElifUskuplu avatar ElifUskuplu commented on September 26, 2024
different styles of comment

from pg.

Comments (6)

Matafou avatar Matafou commented on September 26, 2024

I think this is standard in emacs. You define comment starters and enders in the syntax table. This is a bit convoluted for two-letters comment delimiters:

Look at https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Descriptors.html

You can have a look at coq-menu.el

from pg.

Matafou avatar Matafou commented on September 26, 2024

I think this should help.

from pg.

ElifUskuplu avatar ElifUskuplu commented on September 26, 2024

P.S: I edited my first entry to write my concrete syntax for comments.

@Matafou If I'm not mistaken, with modifying syntax table, we don't need to set variables like proof-script-comment-start. I mean I have

(defconst PA-mode-syntax-table-entries
  (append '(?\` "< 23b")
          '(?\n "> b")
          '(?\{ "(}1nb")
          '(?\} "){4nb")))

and

(proof-easy-config  'pa "PA"   
   ;;other configurations
   proof-script-syntax-table-entries     PA-mode-syntax-table-entries)

Comment highlighting works as I expected. When I load the commands, it seems the comment lines and blocks are captured as expected. Is there something I missed? What I mean is, does the proof-script-comment-start configuration affect other things too?

from pg.

Matafou avatar Matafou commented on September 26, 2024

It is used in the generic code of proofgeneral. In particular when PG splits a file into a sequence of commands and comments. Otherwise a comment is "glued" to the next command. I think it will work ok without, but it is better to define it. May be a matter of taste though.

PG amso sets comment-end and comment-start according to these variables (see comment-region and co).

from pg.

ElifUskuplu avatar ElifUskuplu commented on September 26, 2024

@Matafou I think when proof-script-comment-start and proof-script-comment-end are defined, a comment is "glued" to the next comand. Let me provide more configuration details

(proof-easy-config  'pa "PA"   
   ;;other configurations
   proof-script-syntax-table-entries     PA-mode-syntax-table-entries
   proof-script-comment-start            "{`"
   proof-script-comment-end              "`}"
   proof-script-command-start-regexp     "\\<\\(axiom\\|def\\)\\>"
 )

With this, next command is passing from a command to another one omitting the comments. I understand from your saying that "gluing" occurs without these two definitions. That's why I confused. Maybe, the problem is that I only defined proof-script-command-start-regexp, so next command is just passing one to another because of this. Is that correct?

PG amso sets comment-end and comment-start according to these variables (see comment-region and co).

Is there any reference for this? I would like to read it.

from pg.

Matafou avatar Matafou commented on September 26, 2024

I think the gluing behaviour becomes optional when these variables are set.

I don't know if this is documented but I just grepped "comment-start" in the generic directory and this seemed clear from comments there.

from pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.