GNU bug report logs - #6239
Running htmlfontify in batch mode

Previous Next

Package: emacs;

Reported by: Masatake YAMATO <yamato <at> redhat.com>

Date: Fri, 21 May 2010 14:33:03 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#6239: closed (Running htmlfontify in batch mode)
Date: Sun, 27 Jun 2010 18:26:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 27 Jun 2010 14:25:50 -0400
with message-id <87fx08xrgx.fsf <at> stupidchicken.com>
and subject line Re: Running htmlfontify in batch mode
has caused the GNU bug report #6239,
regarding Running htmlfontify in batch mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
6239: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6239
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Masatake YAMATO <yamato <at> redhat.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Running htmlfontify in batch mode
Date: Fri, 21 May 2010 23:30:28 +0900 (JST)
This is a bug report with a patch which fixes the bug. 
Please, include the patch to the official emacs tree if appreciated.


I'm trying to convert a source code to a html file with
htmlfontify.el. I'd like to do it in a batch job.

With the following script(CONVERTER) and command line I expect
I can convert a source code file into html format:

---------------------------------------------------------------
#!/home/yamato/var/emacs/src/emacs --script
; CONVERTER
(defun print-to-stderr (str)
  (mapcar 'external-debugging-output str))

(let ((input (car argv))
      (output (cadr argv)))
  (unless input
    (print-to-stderr "*** No INPUT is given\n")
    (kill-emacs 1)
    )
  (unless output
    (print-to-stderr "*** No OUTPUT is given\n")
    (kill-emacs 1)
    )
  (unless (file-readable-p input)
    (print-to-stderr (format "*** Cannot read %s\n" 
			     input))
    (kill-exit 1)
    )
  (unless (file-writable-p output)
    (print-to-stderr (format "*** Cannot write %s\n" 
			     output))
    (kill-emacs 1)
    )
  (let ((srcdir (or (file-name-directory input) "./"))
	(dstdir output)
	(file (file-name-nondirectory input)))
    (require 'htmlfontify)

    (htmlfontify-load-rgb-file)
    (let ((hfy-display-class '((type . x-toolkit)
			       (class . color)
			       (background . light))))
      (hfy-copy-and-fontify-file srcdir dstdir file))))
---------------------------------------------------------------

$ ./CONVERTER  emacs/src/epaths.h /tmp/

But, the command line is failed because htmlfontify.el tries to
modify data in pure storage.

With following patch it works as I expected.

2010-05-21  Masatake YAMATO  <yamato <at> redhat.com>

	* htmlfontify.el (hfy-face-attr-for-class): Use `append'
	instead of  `nconc'.

=== modified file 'lisp/htmlfontify.el'
*** lisp/htmlfontify.el	2010-04-24 02:36:43 +0000
--- lisp/htmlfontify.el	2010-05-21 14:18:31 +0000
***************
*** 926,932 ****
                 new-spec)))))
      (if (or (memq :inherit face-spec) (eq 'default face))
          face-spec
!       (nconc face-spec (list :inherit 'default))) ))
  
  ;; construct an assoc of (css-tag-name . css-tag-value) pairs
  ;; from a face or assoc of face attributes:
--- 926,936 ----
                 new-spec)))))
      (if (or (memq :inherit face-spec) (eq 'default face))
          face-spec
!       ;; We cannot use `nconc' here.
!       ;; As far as I inspected, (get face 'face-defface-spec) in
!       ;; `hfy-combined-face-spec' returns data at pure storage
!       ;; if noninteractive.
!       (append face-spec (list :inherit 'default))) ))
  
  ;; construct an assoc of (css-tag-name . css-tag-value) pairs
  ;; from a face or assoc of face attributes:



[Message part 3 (message/rfc822, inline)]
From: Chong Yidong <cyd <at> stupidchicken.com>
To: Masatake YAMATO <yamato <at> redhat.com>
Cc: 6239-done <at> debbugs.gnu.org
Subject: Re: Running htmlfontify in batch mode
Date: Sun, 27 Jun 2010 14:25:50 -0400
> htmlfontify.el tries to modify data in pure storage.

Thanks, I've checked in your patch.


This bug report was last modified 14 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.