For a long time I've been using the simple show-tabs function below. With CVS
emacs I've noticed now that the same element gets appended to global
font-lock-keywords over and over again.


1. emacs -Q&

2. M-x global-font-lock-mode

3. in scratch buffer evaluate the following 2 expressions:

(defun show-tabs () "Show tabs with a slightly changed background"
   (setq font-lock-keywords
        (append font-lock-keywords '(("[\t]+"  (0 'tab-face t))))))
(add-hook 'font-lock-mode-hook 'show-tabs)

4. in scratch buffer: C-h v font-lock-keywords

Local in buffer *scratch*; global value is 
(("[    ]+"
  (0 'tab-face t)))

5. every C-h v font-lock-keywords adds one more entry to global
   font-lock-keywords

Value:
(t
 (("[   ]+"
   (0 'tab-face t)))
 ("[    ]+"
  (0 'tab-face t)))



Moreover if I load e.g. a text file, then C-h v in that buffer will give me
something like:

Value:
(t
 (("[   ]+"
   (0 'tab-face t)))
 ("[    ]+"
  (0 'tab-face t)))

Local in buffer x.txt; global value is 
(("[    ]+"
  (0 'tab-face t))
 ("[    ]+"
  (0 'tab-face t))
 ("[    ]+"
  (0 'tab-face t))
 ("[    ]+"
  (0 'tab-face t))
 ("[    ]+"
  (0 'tab-face t)))

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             [EMAIL PROTECTED]  |
 ------------------------------------------
---
Why bother building any more nuclear warheads until we use the ones we have?


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to