I'd appreciate some advice for a codeless language module (CLM) I've created. I've read the fine manual <http://www.barebones.com/support/develop/clm.html> as closely as I can, but I'm out of my depth.
My problem is that I can't get spellcheck and smart quotes to work outside of comments. Within comments, they are fine. Background is that in my work as an editor I need to work on plain text files – stories written by tech journalists – containing many long URLs, HTML-like tags and other distractions. Unfortunately it's not possible to standard on a single set of markup conventions, such as Markdown. So I created a simple CLM to detect the various kinds of markup and show them in a single pale grey colour. The main text appears in black, so it's easy to skip over the grey markup. The easiest way I found to do this – well, really the only way I could understand – was to define comments in my new "language" using a regex that matches URLs, angle brackets and so on. That's done with the "Comment Pattern" key. I've not attempted any other syntax colouring. Since this is free text, there are essentially no keywords, so everything has to be done via grep. It works well, but as I said, spell checking and typographers' quotes work only inside my "comments" – i.e. URLs and so on – and not in the main text. This is the reverse of what I'd like: spellcheck in the main text is essential, while being able to ignore spelling in URLs would be pretty handy. Any help would be much appreciated. Since the code is short, I've included it below. I don't really understand the function of <key>Identifier and Keyword Character Class</key>; leaving it out seemed to make no difference, though I gather from the CLM guide that it's supposed to be essential. Thanks in advance Charles <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <!-- BBEdit Text grey URLs Codeless Language Module Use with plain text files to show URLs, HTML tags and other markers in a different colour from the main text Charles Butcher Version 0.1, 2017-08-23 --> <dict> <key>BBEditDocumentType</key> <string>CodelessLanguageModule</string> <key>BBLMLanguageDisplayName</key> <string>Text grey URLs</string> <key>BBLMLanguageCode</key> <string>GURL</string> <key>BBLMSuffixMap</key> <array> <dict> <key>BBLMLanguageSuffix</key> <string>.txt</string> </dict> </array> <key>BBLMPreferredFilenameExtension</key> <string>.txt</string> <key>BBLMColorsSyntax</key> <true/> <key>BBLMIsCaseSensitive</key> <false/> <key>BBLMCanSpellCheckCodeRuns</key> <true/> <key>Language Features</key> <dict> <key>Identifier and Keyword Character Class</key> <string>!$%&*+.,;/()<;=>?^~0-9A-Z_a-z@:-</string> <key>Comment Pattern</key> <string>(?x: (https?://|mailto:)(\S+)(?=\s) | (?# URIs) (<.+?>) | (?# HTML tags) (\.{4,})$ | (?# dotted line; 3 dots is OK) (\*{3,})(.+)(\*{3,}) | (?# text between multiple asterisks) (\[)(.+?)(\]) | (?# text between square brackets) (\#|\*|_) (?# Markdown hashes, asterisks, underscores) ) </string> </dict> </dict> </plist> -- This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
