0

I've defined the following :

(eval-after-load 'clojure-mode
  '(font-lock-add-keywords
    'clojure-mode `(("\\(#\\){"
                     (0 (progn (compose-region (match-beginning 1)
                                               (match-end 1)
                                               "∈")
                               nil))))))

Now I want to change it to :

(eval-after-load 'clojure-mode
  '(font-lock-add-keywords
    'clojure-mode `(("\\(#\\){"
                     (0 (progn (compose-region (match-beginning 1)
                                               (match-end 1)
                                               "Ø")
                               nil))))))

If I just eval this expression, the clojure-mode buffer will not change, the "∈" is displayed and not change to "Ø", even if I run fundamental-mode and clojure-mode again.

How Can I fix this?

Drew
  • 75,699
  • 9
  • 109
  • 225
cmal
  • 775
  • 3
  • 14
  • After evaluating the expression re-load the library `closure-mode` with `M-x load-library`. – Tobias Jun 11 '18 at 14:37
  • Thanks, but I've tried `(load "clojure-mode")` and `(load-library "clojure-mode")`, neither works. I've also tried to switch to `fundamental-mode` and back to `clojure-mode` again, not worked. @Tobias – cmal Jun 12 '18 at 04:05
  • Sorry, what I forgot to mention: 1st) You need to remove the old keywords with `font-lock-remove-keywords` and the same args as for `font-lock-add-keywords`. 2nd) Run `font-lock-fontify-buffer` afterwards. – Tobias Jun 12 '18 at 07:01
  • Thanks @Tobias Is this right? : 1. `font-lock-remove-keywords` , 2. run `eval-after-load ... font-lock-add-keywords`, 3. run `(load-library 'clojure-mode)`, 4. run `font-lock-fontify-buffer`. I do these thing in the order 1,2,3,4. but nothing changed. :( (I've also tried to change the order of 3 and 4, and tried to add `font-lock-remove-keyword`, but neither works.) – cmal Jun 12 '18 at 07:42

0 Answers0