MuMaMo with propertized text does not work sometime

Bug #1013794 reported by tkf
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nXhtml
New
Undecided
Unassigned

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 24.1.50.1 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"
  (font-lock-mode))

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

(defun test-propertized-chunk (pos max)
  (mumamo-possible-chunk-forward
   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)
     test-propertized-chunk-2)))

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

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.