Skip to main content
Removed 'invisible vs. :invisible note
Source Link
kuzzooroo
  • 321
  • 1
  • 7

OK, here's a simple demonstration of @Lindydancer's technique, which in this case turns the whole buffer invisible. I had to use 'invisible instead of :invisible.

(defun my-mode () "my-mode" (interactive)
  (kill-all-local-variables)
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults  '(my-mode-font-lock-keywords t)))

(defvar my-mode-font-lock-keywords nil 
  "Keywords/Regexp for fontlocking of my-mode")

(setq my-mode-font-lock-keywords
      (list
       '(".*" 0
         (progn (add-text-properties (match-beginning 0) 
                                     (match-end 0) 
                                     '(invisible t))
                'bold))))

(add-to-list 'font-lock-extra-managed-props 'invisible)

OK, here's a simple demonstration of @Lindydancer's technique, which in this case turns the whole buffer invisible. I had to use 'invisible instead of :invisible.

(defun my-mode () "my-mode" (interactive)
  (kill-all-local-variables)
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults  '(my-mode-font-lock-keywords t)))

(defvar my-mode-font-lock-keywords nil 
  "Keywords/Regexp for fontlocking of my-mode")

(setq my-mode-font-lock-keywords
      (list
       '(".*" 0
         (progn (add-text-properties (match-beginning 0) 
                                     (match-end 0) 
                                     '(invisible t))
                'bold))))

(add-to-list 'font-lock-extra-managed-props 'invisible)

OK, here's a simple demonstration of @Lindydancer's technique, which in this case turns the whole buffer invisible.

(defun my-mode () "my-mode" (interactive)
  (kill-all-local-variables)
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults  '(my-mode-font-lock-keywords t)))

(defvar my-mode-font-lock-keywords nil 
  "Keywords/Regexp for fontlocking of my-mode")

(setq my-mode-font-lock-keywords
      (list
       '(".*" 0
         (progn (add-text-properties (match-beginning 0) 
                                     (match-end 0) 
                                     '(invisible t))
                'bold))))

(add-to-list 'font-lock-extra-managed-props 'invisible)
Source Link
kuzzooroo
  • 321
  • 1
  • 7

OK, here's a simple demonstration of @Lindydancer's technique, which in this case turns the whole buffer invisible. I had to use 'invisible instead of :invisible.

(defun my-mode () "my-mode" (interactive)
  (kill-all-local-variables)
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults  '(my-mode-font-lock-keywords t)))

(defvar my-mode-font-lock-keywords nil 
  "Keywords/Regexp for fontlocking of my-mode")

(setq my-mode-font-lock-keywords
      (list
       '(".*" 0
         (progn (add-text-properties (match-beginning 0) 
                                     (match-end 0) 
                                     '(invisible t))
                'bold))))

(add-to-list 'font-lock-extra-managed-props 'invisible)