MuMaMo with propertized text does not work sometime

Bug #1013794 reported by tkf on 2012-06-15
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

I found MuMaMo does not work when using with property based font-lock.

You can check with the following code. It will open a buffer with font-lock based mode in two chunks and emacs-lisp-mode in one chunk at the middle. When it is opened, font lock is good. However, after moving into the emacs-lisp-mode chunk and enter some characters, property based font-lock is off. I chucked it with the latest development version and Emacs and 23.3.1.

;; Usage: emacs -Q -l PATH/TO/autostart.el -l THIS-FILE.el
(require 'mumamo)

(define-derived-mode test-propertized-text-mode fundamental-mode "Prt"

(defvar test-propertized-chunk-1 nil)
(defvar test-propertized-chunk-2 nil)

(defun test-propertized-chunk (pos max)
   pos max
   (lambda (pos max)
     (if (and test-propertized-chunk-1
              (< pos test-propertized-chunk-1)
              (> max test-propertized-chunk-1))
         (list test-propertized-chunk-1 'emacs-lisp-mode nil)))
   (lambda (pos max)

(define-mumamo-multi-major-mode test-mumamo-with-propertized-text
  "MuMaMo with propertized text"
  ("MuMaMo with propertized text" test-propertized-text-mode

(with-current-buffer (get-buffer-create "*MuMaMo with propertized text*")
  (let ((inhibit-read-only t))
    (setq test-propertized-chunk-1 nil)
    (setq test-propertized-chunk-2 nil)
    (insert (propertize "Text with property"
                        'font-lock-face 'font-lock-keyword-face)
    (setq test-propertized-chunk-1 (point-marker))
  (insert "
\n(defun func-name ()
    (setq test-propertized-chunk-2 (point-marker))
    (insert (propertize "Text with property"
                        'font-lock-face 'font-lock-keyword-face)
    (pop-to-buffer (current-buffer))))

Hans Meine (hans-meine) wrote :

Same here, with ein (el-get-installed). As soon as I move point outside of cells, the Python code highlighting is removed and never comes back (save me issuing M-x font-lock-fontify-buffer).

If I click into other cells (even markdown/text mode cells), this does not happen. Only the cursor must not enter the (yellow-bg) regions between cells.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers