From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?St=C3=A9phane_Travostino?= Newsgroups: gmane.emacs.help Subject: Rendering buffer to HTML from command line script Date: Sat, 20 Feb 2016 17:20:29 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1456006078 14365 80.91.229.3 (20 Feb 2016 22:07:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2016 22:07:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 20 23:07:54 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aXFgv-0004Bh-RV for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Feb 2016 23:07:53 +0100 Original-Received: from localhost ([::1]:35947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXFgv-0004Ag-9J for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Feb 2016 17:07:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXBDT-0003dx-Gw for help-gnu-emacs@gnu.org; Sat, 20 Feb 2016 12:21:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXBDS-0003jF-Jq for help-gnu-emacs@gnu.org; Sat, 20 Feb 2016 12:21:11 -0500 Original-Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:34778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXBDS-0003id-CH for help-gnu-emacs@gnu.org; Sat, 20 Feb 2016 12:21:10 -0500 Original-Received: by mail-wm0-x230.google.com with SMTP id b205so105758845wmb.1 for ; Sat, 20 Feb 2016 09:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=fl8mX1N8jNmJQW6c6M9gIfOW4XuhMtx4bNr3V4kQN1E=; b=GnuxKfwl3YbdVFyab/GcAtcEMF6TGeto5C6tzw3EJ8Ovk4EDf5Gs3XiM1AYUNHGvjs 9FeHrn+nzRCZWHSaQC17mXNHox0lyNEHj8xr5z1NXXF36MzxY4dDv6MKAvGy6kvpVX51 cQqxe29RqY983OSDQJgEzPCLPQayzdi2cWRRhf6Z2nqZAbTLFuYcJizTKiwHWdBTIOGi 3ekMpfIaKi/V0ySmF5xXGv5Ac4YN4JhxdWvUojXomgZDJ4t191UztgYZP8HYUOVozfXE 8lTYqrUhtDx1aWmWZYpWXkshS3q0jXYZ/jVo63Qo7EdDmTNnV2W5dtAGU0yqwpNap3D7 OLDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=fl8mX1N8jNmJQW6c6M9gIfOW4XuhMtx4bNr3V4kQN1E=; b=Biiq2ZaUFGmkVJkKdmZ+GMR+bgcW+JK1dHl8/MJIyrFbrT0tq1DnXCSDJleP5pzJAK MrfinAyREbTVeKvr+eadoG7tIaBdxJMfApKc7+LGPxm5wrDG3i5RHQNClzx3lJps0THz NtIxWR8ORyfxfKfLDWRQLkwqJExMFiAK7XZ93Wo0Ty5Vrr74DJfGRh/t5CQaiOmHlLx3 EbfhFWiImcerCFc0oMUBcI+ov9z0JwzGN5BTwOvIVpL482tG+IN370gYRyEA2Hs6AUri TzHd78frm7N4sfEyfU8P2aD8RGnW7e+s4mLPtpYVQ1iIfCPUquvSpIB6xW+7H8Wgi2ET 1ovQ== X-Gm-Message-State: AG10YOTIE0/vJvhib9qnihE8qrfKiLqvUbajpM2ITWcebfNp0nIddkOUOjuI1e9DRUgZRQ1ygwtCJ2Tj9osFrw== X-Received: by 10.194.61.169 with SMTP id q9mr19031640wjr.77.1455988868707; Sat, 20 Feb 2016 09:21:08 -0800 (PST) Original-Received: by 10.28.25.135 with HTTP; Sat, 20 Feb 2016 09:20:29 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::230 X-Mailman-Approved-At: Sat, 20 Feb 2016 17:07:38 -0500 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109227 Archived-At: Hello, I'm trying to create a command line Emacs script that, by specifying a file and a theme, renders the file to HTML using the theme colours. For example: emacs --script render-theme.el some-theme.el test.c > test.c.html I'm using htmlfontify to render the buffer to HTML, and works great when called from X, but I get a black and white output when called from the terminal _with most themes_. The problem is that themes specify the minimum terminal requirements to enable a specific face, i.e. minimum amount of colours supported by the terminal, window-system, etc. ( http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html ) For example: (defface 'foo (((min-colors 88) (class color) etc.)) If I modify the theme to disable these terminal requirements options, htmlfontify renders correctly. That's probably a long shot, but is it possible to either force a particular terminal configuration from command line, or force-enable all theme faces? For example, (display-color-cells) in X returns 16777216, while I get 0 when executed from the script; that's probably part of the problem. Why am I doing this: I want to create an Emacs theme browser web application which creates a preview of any theme against a few different file formats, and I want an headless Emacs to create the HTML preview. Thanks. Stephane.