Code Monkey home page Code Monkey logo

rnc-mode's People

Contributors

treerex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vladimiralexiev

rnc-mode's Issues

setup for flycheck

Flycheck is a replacement for flymake. Would be good to include this setup:

;; flycheck is a replacement of flymake & smart-compile
;; https://www.masteringemacs.org/article/spotlight-flycheck-a-flymake-replacement

(require 'flycheck)
(flycheck-define-checker rnc-jing
  "RNC syntax checker using jing.
Home: https://github.com/relaxng/jing-trang (was https://jing-trang.googlecode.com).
Binary: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jing-trang/jing-20091111.zip.
Manual: https://relaxng.org/jclark/jing.html"
  :command ("java"
            "-Xss8M" ; increase stack size to 8M, else get
            ;; Exception in thread "main" java.lang.StackOverflowError
            ;; at com.thaiopensource.relaxng.pattern.BinaryPattern.checkRecursion(BinaryPattern.java:16)
            "-jar" "c:/prog/jing-20091111/bin/jing.jar"
            "-c" ; RelaxNG Compact
            "-i" ; else any xsd:ID element returns error
            ;; `a "data" or "value" pattern with non-null ID-type must occur as the child of an "attribute" pattern`,
            ;; see http://blog.jclark.com/2009/01/relax-ng-and-xmlid.html 
            source)
  :error-patterns
  ((error line-start (file-name) ":" line ":" column ": " (or "error" "fatal") ": " (message) line-end)
   (error "fatal" ":" (message) line-end)
   (info line-start (file-name) ":" line ":" column ": " (message) line-end))
  :modes rnc-mode)
(add-to-list 'flycheck-checkers 'rnc-jing)

And then disable flymake, see next issue

wrong indentation

Consider this fragment (incomplete):

Vocabulary =
  element Vocabulary {
    element Subject {(
      element Ancestors {(
        element Preferred_Ancestor_Branch {
          element Ancestor {
            element Immediate {ParentType},
            element Other {ParentType}*}}
      & element Non-Preferred_Ancestor_Branches {
        element Non-Preferred_Ancestor_Branch {
          element Ancestor {
            element Immediate {ParentType},
            element Other {ParentType}*}}+}?),
        [ a:defaultValue = "300000000" ]
        attribute Broad_Parent_ID {VP_Subject_ID}?}
    & element Associative_Relationships {
      element Associative_Relationship {
        element Description {xsd:string}?
      & element AR_Date {
        element Display_Date {xsd:string}
      & element Start_Date {Geog_Date}
      & element End_Date {Geog_Date}}?
      & element Historic_Flag {associative_rels_historic_flag}?
      & element Relationship_Type {ar_code}
      & element Related_Subject_ID {
        element VP_Subject_ID {VP_Subject_ID}
      | element Contrib_Subject_ID {xsd:string}}}*}?
    & element Descriptive_Notes {
      element Descriptive_Note {
        element Note_Text {xsd:string}
      & element Note_Language {language_code}
      & element Note_Sources {
        element Note_Source {
          element Source {SourceType}
        & element Page {xsd:string}?}+}}*}?

I think the indentation is wrong. It puts these two at the same level, but the second is nested:

      & element AR_Date {
      & element Start_Date {Geog_Date}

I'd prefer if the words "element/attribute" are aligned properly, and the punctuation &|(< is ignored (visually it doesn't have a lot of weight. But even if that's not possible and it aligns the punctuation, it should indent consistently,

need rnc-jing-java-options to avoid stack overflow

On deeply nested "matroska" rnc schemas, I get this error from jing:
Exception in thread "main" java.lang.StackOverflowError
at com.thaiopensource.relaxng.pattern.BinaryPattern.checkRecursion(BinaryPattern.java:16)

We need a new option rnc-jing-java-options. Setting it to "-Xss8M" avoids the problem

rnc-configure-flymake should respect rnc-enable-flymake

If you use flycheck (#9) then you should disable flymake:

(setq rnc-enable-flymake nil ; now do it with flycheck

However, rnc-configure-flymake doesn't respect this option and is called unconditionally.
Until this is fixed, one can use the following:

(defadvice rnc-configure-flymake (around rnc-enable-flymake activate)
  "Don't run rnc-configure-flymake unless rnc-enable-flymake is set.
Else the function produces a distracting error message"
  (if rnc-enable-flymake ad-do-it))

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.