nxml-mode QnA

Emacs nxml-mode

1. Reporting bugs in nxml-mode for emacs
2. How to find the nxml-mode key bindings?
3. nxml-mode slow on validation
4. Error count in nxml-mode
5. High error count
6. mode hook
7. Empty vs no namespace
8. ANY DTD entry into Relax-ng
9. Change key binding
10. repeated error message
11. Adding additional Unicode blocks for Unicode entry
12. PSGML compatibility
13. applyFollowingRules in schemaLocation
14. XML file indentation
15. Element names in Chinese
16. Adding to mode-map
17. paragraph fill width
18. how I can disable MULE-UCS?
19. BOM and nxml
20. Is it possible to reload the schema?
21. Key bindings
22. Adding to key-bindings
23. Locate schema
24. Encoding type
25. Jing error 'oneOrMore contains group'

1.

Reporting bugs in nxml-mode for emacs

James Clark

It would really help if you could be more explicit. Ideally, I would like a small example describing

- what the buffer was before the problem (using -!- for point)
- what command you gave
- what the buffer was after the command
- what you wanted the buffer to be after the command

2.

How to find the nxml-mode key bindings?

Joe Casadonte


> I was once using nxml and some keycombo gave me a list of the 
> keybindings in a buffer below the document I had opened.
> I have never been able to find it again.

[ C-h k C-h m ]

C-h m runs the command describe-mode which is an interactive compiled Lisp function in `help'. (describe-mode)

Display documentation of current major mode and minor modes. The major mode description comes first, followed by the minor modes, each on a separate page.

For this to work correctly for a minor mode, the mode's indicator variable (listed in `minor-mode-alist') must also be a function whose documentation describes the minor mode.

Alan Salewski adds

C-h b runs the command describe-bindings which is an interactive compiled Lisp function in `help'. (describe-bindings &optional PREFIX BUFFER)

Show a list of all defined keys, and their definitions. We put that list in a buffer, and display the buffer.

The optional argument PREFIX, if non-nil, should be a key sequence; then we display only bindings that start with that prefix. The optional argument BUFFER specifies which buffer's bindings to display (default, the current buffer).

3.

nxml-mode slow on validation

James Clark


> I've been using nxml-mode in earnest today, editing a DocBook
> document  and I'm finding
> the validation pauses quite irritating.

Can you explain a little more? When are you seeing pauses? You should be able to just keep right on typing and ignore the fact that it's doing constant validation, since the validation gets suspended as soon as you start typing. It shouldn't be getting in your way. Customization might help:

- reduce rng-validate-chunk-size to, say, 4000
- increase rng-validate-quick-delay to, say, 1
- increase rng-validate-delay to, say, 2

4.

Error count in nxml-mode

James Clark

> when you start off with plain
> text and intend to add markup, everything is flagged as an error
> (correctly). This makes emacs run rather slowly; I think you already
> said the overlay mechanism you have to use is inefficient.

It should only be slow if you have thousands of distinct errors; if you have a huge chunk of plain text that you intend to add markup to, that should only be one or two errors. To see how many errors there are, do


M-: rng-error-count RET

5.

High error count

James Clark

> I read a text file of 1736 lines into emacs, did M-x nxml-mode, and it
> reports 8929 errors. 

The problem is that it was treating the whole thing as part of the prolog. So long as you put a start-tag at the beginning of the document, you won't get the slownewss. Anyway, I've fixed it to use a different algorithm for deciding where the prolog ends and the instance begins in an ill-formed document.

6.

mode hook

James Clark


> It would be good to have a hook which was run when a new file is
> created, which could be used to insert a default skeleton document, and
> switch to an appropriate schema.

You can use nxml-mode-hook for that. It's run every time nxml-mode is enabled, including for new files, so you just have to check whether you've got a new file. Try something like this:

(add-hook 'nxml-mode-hook
	  (lambda ()
	    (when (not (and (buffer-file-name)
			    (file-exists-p (buffer-file-name))))
	      (message "A new nXML file")))
	  t)

7.

Empty vs no namespace

David Rosenborg


>I'm using the RELAX NG schema for RELAXNG to develop a
>RelaxNG code generator for Eiffel language. Because
>I'm new to this field, I don't understand the except
>part of common-atts well.
>
><except>
>  <nsName/>
>  <nsName ns=3D""/>
></except>
>
>What is the difference between <nsName/> and <nsName
>ns=""/> ? Does <nsName/> match any name WITH a prefix
>like prefix:name, and <nsName = ns=""/> means name
>WITHOUT prefix specified? Then this except clause
>excludes any name, doesn't it?
>

There is an example of this in the <card> example in the tutorial: relaxng.org

<nsName/> matches any name in the namespace specified by the inherited attribute ns. In your case this attribute has the value "http://relaxng.org/ns/structure/1.0".

<nsName ns=""> Same semantics as before, but here the ns attribute is specified locally so this matches any name not being in a namespace. In the case of attributes this means any attribute without a prefix.

So what

 <attribute><anyName><except><nsName/><nsName 
ns="""/></except></anyName></attribute>

really means in your case is "any attribute with a prefix where the prefix is not declared to the RELAX NG namespace uri".

8.

ANY DTD entry into Relax-ng

John Cowan


> I had a DTD 

>     <!ELEMENT x ANY>
>     <!ATTLIST x id ID #IMPLIED>

> that I wanted to convert to relax ng, trang produced

>     x = element x { attlist.x, any }
>     attlist.x &= attribute id { xsd:ID }?
>     start = x
>     any =
>       (element * {
>          attribute * { text }*,
>          any
>        }
>        | text)*
> Am I confused or is Jing?

The fault is with Trang, and yet it's hard to see how it could do any better without taking an entirely different approach.

The semantics of ANY in a DTD are essentially (#PCDATA|FOO|BAR|BAZ|...)*, where FOO, BAR, BAZ, ... are the declared elements in the DTD. It does not mean that "any XML" is permissible here, but that's how Trang translates it.

Consequently, the declaration of the element named "x" as having an "id" attribute of type ID conflicts with the implicit declaration of "x" (as part of the element wildcard) as having an "id" attribute (as part of the attribute wildcard) of type text. Normally, this wouldn't matter, but the semantics of type ID are global, and RNG requires that ID-declared attributes be consistent throughout the document.

Here is an RNC schema that should do what you want:

     x = element x { attlist.x & not-x* & x* & text}
     attlist.x &= attribute id { xsd:ID }?
     start = x
     not-x = element (* - x) { attribute * {text}* & not-x* & x* & text }

9.

Change key binding

James Clark



> How can I change the key binding for the 'nxml-complete' 
> function ?  

There is an explanation in the node "Local Keymaps" in the Emacs manual (do `g RET Local Keymaps RET' after entering the Emacs manual).

Add this to your .emacs:

(add-hook
  'nxml-mode-hook
  (lambda ()
    (define-key nxml-mode-map "\C-c\C-c" 'nxml-complete)))

Steinar Bang comments on this,

Personally I've stopped adding anonymous functions to hooks, because it's easier to call remove-hook on named functions.

Ie. I would have done the above as

(defun nxml-custom-keybindings ()
    (define-key nxml-mode-map "\C-c\C-c" 'nxml-complete))

(add-hook 'nxml-mode-hook 'nxml-custom-keybindings)

10.

repeated error message

James Clark


> Internal nXML mode error in nxml-fontify (Wrong type argument:
number-or-marker-
> p, nil), degrading [4 times]

> The last message repeats on any operation that I try and perform.  This
error persists 
> even after I have closed the xml file.

> What can I do to fix this problem?

Try doing

M-x set-variable RET debug-on-error RET t RET
M-x set-variable RET debug-on-signal RET t RET

This should give a backtrace the next time the error happens, which may show where the real problem lies.

Perhaps turning off syntax highlighting will work around this problem temporarily. Try doing

M-x set-variable RET nxml-syntax-highlight-flag RET nil RET

11.

Adding additional Unicode blocks for Unicode entry

James Clark


> How do I select additional Unicode blocks,
> Documentation says,
> "You can customize `nxml-enabled-unicode-blocks' to control what Unicode blocks
> are used for completing names."

> Is a block a single pdf document at unicode.org, e.g. 2800 is the braille
> 'block'?

To add the braille block, just do

 M-x customize-variable RET nxml-enabled-unicode-blocks RET

and then click the "Braille Patterns" check box and follow the instructions.

12.

PSGML compatibility

James Clark


> Is C-M-u bound to "up-element" in nxml, like in psgml? (the actual
> command name is sgml-backward-up-element)

It's bound to nxml-backward-up-element. However, it allows an argument, just like the standard binding for C-M-u (backward-up-list). With an argument of -1, it's equivalent to nxml-up-element, which moves forward.


> If not, my fingers would need retraining if transferring to nxml.

It has not been a design goal for nxml to minimize retraining for PSGML users. I have tried to do the best design I can, taking PSGML as one (of several) inputs. One problem is that some of the PSGML bindings are not compatible with the Emacs conventions documented in the Emacs Lisp manual.

If in the future it turns out that there are lots of PSGML users trying to switch to nxml-mode, who are inhibited by incompatible and missing key bindings, then that can be addressed by adding an psgml-compatibility option.

13.

applyFollowingRules in schemaLocation

James Clark


>can you clarify what applyFollowingRules means?
> Does it mean "apply the rules in this file only after applying all
> rules of the type identified? Is it scoped at all?

The input to the schema location process is a list of schema locating files. Parsing a schema locating file gives you a list of rules (you need to resolve relative URIs at this stage). Take the list of rules from parsing each schema locating file and append them to give you one big list. Now process <include> rules by replacing each <include> rule by the rules you get from parsing the referenced schema locating file.

You can now eliminate applyFollowingRules rules from the list as follows. Replace a rule X that has the form <applyFollowingRules ruleType="T"/> by a copy (preserving order) of all the rules of type T that follow X in the list. (An implementation can in fact optimize this so it only makes a single pass over the list of rules.)


> How do typeIdProcessingInstruction and typeIdBase work?

There's a commented-out description of them in nxml-mode.xml.

14.

XML file indentation

Michael Smith


> I would like to know how to set this
> so whenever I open a XML document the nxml-child-indent will be
> 8 instead of 2. 

I think the recommended way is using the "customize-group" interface. If you type "M-x customize-group" and then type "nxml", you'll get a form that lets you change all user-customizable options for nxml. Scroll down there until you find the child-indent option, change the value there, then click the State button and choose "Save for Future Sessions".

I think you can also set it directly in your .emacs file by adding

  (setq nxml-child-indent 8)	    

15.

Element names in Chinese

James Clark


>Does string-match handle
>Unicode characters? rng-c-ncname-re is defined as "\\w+", and is handled
>by string-match. 
>
>I would think that the only characters allowed in names for use with
>nxml are those matched by \w. 

\w matches anything that has syntax class 'w' in the current syntax table, which can include non-ASCII characters as well as ASCII characters.

The problem is simply that your example schema is in UTF-8 and Emacs 21 supports Unicode characters only in the ranges 0000-33ff and e000-ffff, and thus does not support Chinese (or Japanese or Korean) encoded in UTF-8. If you look at the schema in Emacs, you won't see any Chinese characters, but rather a bunch of 8-bit control characters (this is Emacs' way of ensuring that it does not damage UTF-8 files containing characters that it does not support).

If you want to use nxml-mode with Chinese element names, then both the XML file and the schema need to use an encoding for Chinese that Emacs does support (e.g. Big5). \w will match Chinese "word constituent" characters from non-Unicode character sets (that's why nxml uses \w rather than a list of Unicode characters). You would need to put


   # -*- coding: big5 -*-

at the beginning of the .rnc file to ensure that nxml correctly recognizes the encoding.

16.

Adding to mode-map

Michael Smith


> I was trying to override one of the nxml key mappings from my .emacs 
> file with a line like this

>   (define-key nxml-mode-map "?eh" 'my-function-name)

> and upon Emacs startup I get the error message "Symbol's value as 
> variable is void: nxml-mode-map", so I guess nxml-mode-map is out of 
> scope from my .emacs file. What would be the best way to override an 
> nxml keystroke definition?

Not sure if the following is the best way, but I think it works.

  (defun nxml-mode-additional-keys ()
    "Key bindings to add to `nxml-mode'."
    (define-key nxml-mode-map "\eh" 'my-function-name)
    )

  (add-hook 'nxml-mode-hook 'nxml-mode-additional-keys)

17.

paragraph fill width

Michael Smith

How to set [emacs-nxml-mode] paragraph fill width?

To set it per-buffer, do 'C-u 80 C-x f' (replace 80 with whatever width you want). To set it globally, put this in your .emacs


  (setq-default fill-column 80)


    
  

18.

how I can disable MULE-UCS?

Michael Smith



> I am using nxml-mode on GNU-Emacs 21.3.1, and it is complaining about 
> MULE-UCS.  Can someone tell me how I can disable MULE-UCS?

I think maybe this:

  M-x unload-feature un-define

Or in your .emacs:

  (unload-feature un-define)

19.

BOM and nxml

David Tolpin


> The current CVS version of Emacs, at least, supports BOM for UTF-16, 
> but not for UTF-8 AFAIK.

> BOM support is really something that belongs at coding-system level, 
> not something that should be a special case for modes like nxml.

Is it hard to do in nxml? UTF-8 can have BOM, ability to handle BOM in UTF-8 is crucial since Windows editors create files with BOM in UTF-8 by default, and nxml simply rejects to use files with BOM.

Well, I'm immune; I do not have Windows on either of my computers; but it has been a very unpleasant failure in front of an audience to show that, unlike XML Schema, Relax NG can be authored in any editor, even Notepad.

Only to find out that after being authored in Notepad, it cannot be used in Emacs.

20.

Is it possible to reload the schema?

Oliver Steele


 > My normal usage mode is to load and .xml file and have it associated 
 > with a schema (.rnc file.) I find that often I need to go and edit 
 > .rnc file and thus make changes to my schema. I notice that the 
 > schema changes do not take effect unless one kills the .xml buffer 
 > and reloads it. Is there a key binding to quick re-read the schema file?

I've been using the following.

(define-key nxml-mode-map "\C-c\C-r" 'rng-reload-schema)

(defun rng-reload-schema ()
  (interactive)
  (let ((schema-filename rng-current-schema-file-name))
    (when schema-filename
      (setq rng-current-schema (rng-load-schema schema-filename))
      (run-hooks 'rng-schema-change-hook)
      (message "Reloaded schema %s" schema-filename))
    (unless schema-filename
      (rng-set-schema-and-validate))))

(defun rng-apply-find-schema-file (fn)
  (let ((schema-filename rng-current-schema-file-name))
    (unless schema-filename
      (error "This file is not associated with a schema file."))
    (funcall fn schema-filename)))

(defun rng-find-schema-file ()
  (interactive)
  (rng-apply-find-schema-file 'find-file))

(defun rng-find-schema-file-other-window ()
  (interactive)
  (rng-apply-find-schema-file 'find-file-other-window))

21.

Key bindings

Mike Smith


> I'm using the nxml-mode.info file to find out how to use this package, 
> but the article on this Web page mentions some features that are not 
> discussed in the info file:

>     xmlhack.com

You can get short descriptions of all key binding by doing:

  M-x describe-bindings RET

22.

Adding to key-bindings

drkm , Carsten Bormann

 C-c C-m, split element
>  Here's my ugly hack.
> The fun part about a proper implementation of this function would be 
> to decide where to put what whitespace based on context; I just punted.

> (defun cabo:nxml-split-element ()
>    (interactive "*")
>    (nxml-finish-element)
>    (insert "\n<" (xmltok-start-tag-qname) ">")
>    (nxml-indent-line))

> (define-key nxml-mode-map "\C-c\C-m" 'cabo:nxml-split-element)

I think you have to put the modification of the keymap in a hook, because its value is by default `nil'. If `nxml-mode()' was not already called, at least once, `nxml-mode-map' is still `nil', which is an error to pass to `define-key()'.

    (add-hook 'nxml-mode-hook (lambda ()
                                (define-key nxml-mode-map
                                            "\C-c\C-m"
                                            'cabo:nxml-split-element)))

I think it would be better to initialize correctly the keymap in FILE:nxml-mode.el, with something like this :

    (defvar nxml-mode-map
      (let ((map (make-sparse-keymap)))
        (define-key map "\M-\C-u"  'nxml-backward-up-element)
        (define-key map "\M-\C-d"  'nxml-down-element)
        (define-key map "\M-\C-n"  'nxml-forward-element)
        (define-key map "\M-\C-p"  'nxml-backward-element)
        (define-key map "\M-{"     'nxml-backward-paragraph)
        (define-key map "\M-}"     'nxml-forward-paragraph)
        (define-key map "\M-h"     'nxml-mark-paragraph)
        (define-key map "\C-c\C-f" 'nxml-finish-element)
        (define-key map "\C-c\C-b" 'nxml-balanced-close-start-tag-block)
        (define-key map "\C-c\C-i" 'nxml-balanced-close-start-tag-inline)
        (define-key map "\C-c\C-x" 'nxml-insert-xml-declaration)
        (define-key map "\C-c\C-d" 'nxml-dynamic-markup-word)
        (define-key map "\C-c\C-u" 'nxml-insert-named-char)
        (define-key map "/"        'nxml-electric-slash)
        (define-key map [C-return] 'nxml-complete) 
        (when nxml-bind-meta-tab-to-complete-flag
          (define-key map "\M-\t"  'nxml-complete))
        map)
      "Keymap used by NXML Mode.")

which lets you to write :

    (require 'nxml-mode)
    (define-key nxml-mode-map "\C-c\C-m" 'cabo:nxml-split-element)

Furthemore, the keymap is constructed every time `nxml-mode()' is called in the present form, but only once, at load, with the above solution.

Bob DuCharme adds

(defun nxml-beginning-of-element ()
  "Jump to point after start-tag."
  (interactive)
  (nxml-backward-up-element)
  (forward-sexp)
)
(global-set-key [?\C-c (home)] 'nxml-beginning-of-element)
 

(defun nxml-end-of-element ()
  "Jump to point before end-tag."
  (interactive)
  (nxml-up-element)
  (backward-sexp)
)
(global-set-key [?\C-c (end)] 'nxml-end-of-element)
 
; Split element: 
; From 2004-05-17 e-mail to nxml-list
(defun cabo:nxml-split-element ()
   (interactive "*")
   (nxml-finish-element)
   (insert "\n<" (xmltok-start-tag-qname) ">")
   (nxml-indent-line))
 
  (define-key nxml-mode-map "\C-c\C-m" 'cabo:nxml-split-element)

23.

Locate schema

James


> I am trying to solve the following problem: I have an XML document in 
> a version control system.  I want multiple people to edit the 
> document, but I cannot guarantee that the schema will be in the same 
> place in each editor's local environment. 

I think you can (ab)use transformURI to do this. Although the fromPattern and toPattern attributes are allowed to use wildcards, they don't have to, and regardless of whether you use wildcards a transformURI rule is considered to match only if it yields a URI that exists. Thus you can simply use multiple transformURI rules one for each alternative.

24.

Encoding type

James


> I was working on a document that begins

>    <?xml version='1.0' encoding='ascii'?>

> , only to discover that nXML regards this as an "unsupported 
> encoding", rendering the document invalid.

The preferred MIME name for ASCII is 'us-ascii', which is the name nXML supports.

> I admit to not understanding why ascii should be unsupported if UTF-8 
> is OK, nor understanding what encodings a parser is supposed, or 
> required, to support according to the XML specification. So let me 
> skip this, assuming that there is a real reason for it, and just ask 
> the bottom-line question: is there anything I can do in my .emacs to 
> get nXML to accept 'ascii' as a valid encoding?

Adding something like

 (coding-system-put 'us-ascii 'mime-charset 'ascii)

after loading rng-auto.el might work, but I would recommend changing your file to use 'us-ascii'.

25.

Jing error 'oneOrMore contains group'

John Cowan et al



> I have developed a grammar by reading the RelaxNG tutorial, but when I
> attempt to validate it using Jing (within OxygenXML) I get a brief error
> message I cannot understand: E "oneOrMore" contains "group" contains
> "attribute"

> namespace rng = "http://relaxng.org/ns/structure/1.0"
> datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

> start = element ConfigRoot  { ConfigGroup* }

> NamedElementAttributes =
>    attribute name { text },
>    attribute platform { text }?

> StringValue = element StringValue { xsd:string }
> IntValue = element IntValue { xsd:integer }
> FloatValue = element FloatValue { xsd:float }
> BooleanValue = element BooleanValue { xsd:boolean }
> PrimitiveValue = (StringValue | IntValue | FloatValue | BooleanValue)

> Map = element Map { (MapEntry)* }
> MapEntry = element MapEntry { PrimitiveValue }
> Array = element Array { (PrimitiveValue)* }

> ConfigValue =  ( PrimitiveValue | Map | Array ), NamedElementAttributes

> ConfigGroupEntry = (ConfigGroup |  ConfigValue)

> ConfigGroup =  element ConfigGroup {
>    ConfigGroupEntry*,
>    NamedElementAttributes
> }

You bumped up against one of the few restrictions of RELAX NG: you can't have an iteration (either + or *, they produce the same message) that contains a sequence (or interleave, same thing in this case) of attributes.

What you have written is tantamount to requesting an attribute sequence like attribute foo, attribute bar, attribute foo, attribute bar .... be allowed. This makes no sense, given that there can only be one attribute of a given name in a given element.

Fortunately, the problem is easily cured by removing the first reference to NamedElementAttribute.

> When I use the inbuilt Trang tool, I can successfully convert the compact
> grammar to XML form, but a conversion on to XML Schema results in a message
> like "Choice between attributes and children cannot be presented;
> approximating", but no schema object is produced.

You can't expect correct results when applying Trang to a schema that Jing rejects. The corrected version does convert to a plausible XSD schema.


> Any general advice on how to "debug" a RelexNG grammar would also be
> appreciated.

Try to avoid creating sequences/interleaves that contain both attributes and data. They tend to be problematic.

Bob Foster goes into a deeper explanation

> I have developed a grammar by reading the RelaxNG tutorial, but when I 
> attempt to validate it using Jing (within OxygenXML) I get an brief 
> error message I cannot understand: E "oneOrMore" contains "group" 
> contains "attribute"

ConfigGroupEntry* where ConfigGroupEntry has as an alternative ConfigValue, a group that contains a group, NamedElementAttributes, that contains two attributes.

The "oneOrMore" reference is because * (zeroOrMore) is defined in RELAX NG as +? (optional oneOrMore).

NamedElementAttributes is obviously redundant as it is used, so a simple fix would be to take it out of ConfigValue.

> When I use the inbuilt Trang tool, I can successfully convert the 
> compact grammar to XML form, but a conversion on to XML Schema results 
> in a message like "Choice between attributes and children cannot be 
> presented; approximating", but no schema object is produced.

Trang can't convert everything, esp. an invalid schema, and even if it did the conversion could not be faithful where there is a choice between an attribute and an element. XML Schema can't describe this.

> There doesn't seem to be any reference or further explanation for 
> parsing errors. I have spent several hours on this and will have to 
> abandon the use of RelaxNG unless I can obtain a speedy resolution.

Don't give up. Granted the error messages from jing can be pretty cryptic, but in this case you had all the info you needed, you just didn't understand it. OTOH, if you had spent the same several hours trying to write an XML Schema with no previous knowledge of that language, I wager you wouldn't be anywhere near as far along as you are. ;-}

> My grammar is shown below, including a leading * indicating the line the 
> validator fails on. Note that it relates to the only case of recursion 
> in the grammar- a ConfigGroup can contain nested ConfigGroups within 
> it.  Is anyone able to offer some explanation as to what these problems 
> mean? Any general advice on how to "debug" a RelexNG grammar would also 
> be appreciated.

First, a grammar isn't thoroughly checked until you try to validate with it, because some grammars are perfectly ok as fragments but not acceptable for validation. So exercise the grammar on simple test cases to make sure it is fully checked and gives you the result you wanted.

Second, compact syntax error messages from jing come in two flavors: "syntax error," for which the only cure is to stare at the location identified and consult the syntax until you see the error, and substantive error messages, like the one you describe, that usually refer to constraints described in RELAX NG (non-compact) Oasis. In this case, you could have found the restriction by searching the restriction section for "attribute".

MURATA Makoto takes up the spec references

> If you check the RELAX NG specification, you'll find, in section 
>7.1.2, a prohibition of the path:
>
>oneOrMore//group//attribute

Consider an illegal pattern

(element * {text}, attribute * {text})*

This means that the number of attributes and that of elements are equal.

Next, consider another illegal pattern

(attribute a:* {text}, attribute b:* {text})*

This means that the number of attributes in the namespace for the prefix a is the same as the number of attributes in the namespace for the prefix b.

To implement such patterns, we cannot use abstract machines having *finite* states, since we need one state for each natural number. Then, Bali and Miaou (which I should have finished long time ago) will become impossible.

Jing constructs patterns (which are "states") lazily. Thus, the above patterns can be implemented actually. However, there are some malicious patterns which cause (an earlier version of) Jing to explode, because so many patterns have to be created during evaluation.