From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 10:32:33 2010 Received: (at submit) by debbugs.gnu.org; 21 May 2010 14:32:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFTH6-0001wJ-9i for submit@debbugs.gnu.org; Fri, 21 May 2010 10:32:33 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFTH2-0001wD-G6 for submit@debbugs.gnu.org; Fri, 21 May 2010 10:32:29 -0400 Received: from lists.gnu.org ([199.232.76.165]:42901) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OFTGx-0003po-KB for submit@debbugs.gnu.org; Fri, 21 May 2010 10:32:23 -0400 Received: from [140.186.70.92] (port=48796 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFTGv-0008Ib-C6 for bug-gnu-emacs@gnu.org; Fri, 21 May 2010 10:32:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFTGs-0002m1-U8 for bug-gnu-emacs@gnu.org; Fri, 21 May 2010 10:32:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49566) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFTGs-0002lW-Lo for bug-gnu-emacs@gnu.org; Fri, 21 May 2010 10:32:18 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4LEWG98032548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 May 2010 10:32:16 -0400 Received: from localhost (beach.nrt.redhat.com [10.64.200.71]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4LEWFY8032517 for ; Fri, 21 May 2010 10:32:16 -0400 Date: Fri, 21 May 2010 23:30:28 +0900 (JST) Message-Id: <20100521.233028.544549952346250291.yamato@redhat.com> To: bug-gnu-emacs@gnu.org Subject: Running htmlfontify in batch mode From: Masatake YAMATO Organization: Red Hat Japan, Inc. Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.8 (------) 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 * 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: From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 27 14:25:56 2010 Received: (at 6239-done) by debbugs.gnu.org; 27 Jun 2010 18:25:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSwYG-0006tJ-Lh for submit@debbugs.gnu.org; Sun, 27 Jun 2010 14:25:56 -0400 Received: from pantheon-po16.its.yale.edu ([130.132.50.72]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSwYF-0006tE-DR for 6239-done@debbugs.gnu.org; Sun, 27 Jun 2010 14:25:55 -0400 Received: from furry (dhcp128036163046.central.yale.edu [128.36.163.46]) (authenticated bits=0) by pantheon-po16.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o5RIPo9H016424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 27 Jun 2010 14:25:51 -0400 Received: by furry (Postfix, from userid 1000) id EEC0916EC25; Sun, 27 Jun 2010 20:25:50 +0200 (CEST) From: Chong Yidong To: Masatake YAMATO Subject: Re: Running htmlfontify in batch mode Date: Sun, 27 Jun 2010 14:25:50 -0400 Message-ID: <87fx08xrgx.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6239-done Cc: 6239-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) > htmlfontify.el tries to modify data in pure storage. Thanks, I've checked in your patch. From unknown Fri Jun 20 07:17:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 26 Jul 2010 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator