changeset 106505:7287842d7e07

Drop some properties to avoid surprises. * htmlfontify.el (hfy-ignored-properties): New defcustom. (hfy-fontify-buffer): Use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 09 Dec 2009 05:56:53 +0000
parents bcfd4263df7b
children c43a4817b264
files lisp/ChangeLog lisp/htmlfontify.el
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Dec 09 02:32:27 2009 +0000
+++ b/lisp/ChangeLog	Wed Dec 09 05:56:53 2009 +0000
@@ -1,3 +1,9 @@
+2009-12-09  Vivek Dasmohapatra  <vivek@etla.org>
+
+	Drop some properties to avoid surprises.
+	* htmlfontify.el (hfy-ignored-properties): New defcustom.
+	(hfy-fontify-buffer): Use it.
+
 2009-12-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	Minor cleanup.
--- a/lisp/htmlfontify.el	Wed Dec 09 02:32:27 2009 +0000
+++ b/lisp/htmlfontify.el	Wed Dec 09 05:56:53 2009 +0000
@@ -377,6 +377,18 @@
   :tag   "shell-file-name"
   :type  '(file))
 
+(defcustom hfy-ignored-properties '(read-only 
+                                    intangible
+                                    modification-hooks
+                                    insert-in-front-hooks
+                                    insert-behind-hooks
+                                    point-entered
+                                    point-left)
+  "Properties to omit when copying a fontified buffer for html transformation."
+  :group 'htmlfontify
+  :tag   "ignored-properties"
+  :type '(repeat symbol))
+
 (defun hfy-which-etags ()
   "Return a string  indicating which flavour of etags we are using."
   (let ((v (shell-command-to-string (concat hfy-etags-bin " --version"))))
@@ -1622,6 +1634,8 @@
       (delete-overlay rovl))
     (copy-to-buffer html-buffer (point-min) (point-max))
     (set-buffer     html-buffer)
+    ;; rip out props that could interfere with our htmlisation of the buffer:
+    (remove-text-properties (point-min) (point-max) hfy-ignored-properties)
     ;; Apply overlay invisible spec
     (setq orig-ovls
           (sort orig-ovls