Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, after some more googling I am at least one step furhter : </p> <pre><code>(define-derived-mode sample-mode ...) </code></pre> <p>since the providing isn't defining the mode as I thought first.. This I found on : </p> <p><a href="http://xahlee.org/emacs/elisp_syntax_coloring.html" rel="nofollow noreferrer">http://xahlee.org/emacs/elisp_syntax_coloring.html</a></p> <p>A very very nice site for emacs-lovers.</p> <p>With the help of that : I have made a HelloWorld example myself now : It's a (as small as possible) Csharp mode. I have used <a href="http://projecteuler.net/" rel="nofollow noreferrer">Euler1</a> as example rather than HelloWorld. The files you need to know about are : </p> <ul> <li>the file the mode will be applied on <code>Euler1.cs</code></li> <li>the .emacs</li> <li>and of course the mode itself</li> </ul> <p>Since a pic is worth, at least a bunch of words : all files on 1 screen : </p> <p><img src="https://i.stack.imgur.com/zptLk.jpg" alt="alt text"></p> <p>But since this nice pic seems to disappear half the time (anyone a clue? Open in new tab always brings it on, and the url is ok) some words too :-) :</p> <ol> <li><p>The mode : cs-mode.el</p> <blockquote> <pre><code>(setq myKeywords '(("WriteLine" . font-lock-function-name-face) ("public\\|static\\|void\\|int\\|for\\|if\\|class" . font-lock-constant-face))) (define-derived-mode cs-mode fundamental-mode (setq font-lock-defaults '(myKeywords))) (provide 'cs-mode) </code></pre> </blockquote></li> <li><p>The .emacs, that makes the .cs files open in the right mode : </p></li> </ol> <blockquote> <pre><code>;; cs (require 'cs-mode) (add-to-list 'auto-mode-alist '("\\.cs\\'" . cs-mode)) </code></pre> </blockquote> <p>And thats all : the <code>cs-code</code> itself is useless her, cause it won't show the effect of coloring the key-words. To see that see the pic, or open the pic in another tab/window.</p> <p>Cheers, ph</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload