help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rendering buffer to HTML from command line script


From: Thien-Thi Nguyen
Subject: Re: Rendering buffer to HTML from command line script
Date: Fri, 05 Aug 2016 21:10:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() Stéphane Travostino <stephane.travostino@gmail.com>
() Sat, 20 Feb 2016 17:20:29 +0000

   For example: (defface 'foo (((min-colors 88) (class color) etc.))

   If I modify the theme to disable these terminal requirements
   options, htmlfontify renders correctly.

Did you try to set a terminal that has fulfills those
requirements?  You can use ‘toe -a’:

 $ toe -a
 dumb            80-column dumb tty
 pcansi          ibm-pc terminal programs claiming to be ansi
 ansi            ansi/pc-term compatible with color
 rxvt-unicode    rxvt-unicode terminal (X Window System)
 rxvt            rxvt terminal emulator (X Window System)
 [...]

to find a name, such as ‘foo’ and then:

 $ TERM=foo emacs -q -Q --batch \
      -eval '(message "%s" (getenv "TERM"))'
 foo

The basic technique lies in the ‘TERM=foo’ portion of the
command, prior to the executable name (in this case, "emacs").
This sets the environment variable ‘TERM’ only for that process.
Maybe Emacs will consult the env var and DTRT for your
application.

Another (better) idea, from browsing ‘emacs --help’, is to use:

--color, --color=MODE     override color mode for character terminals;
                            MODE defaults to `auto', and
                            can also be `never', `always',
                            or a mode name like `ansi8'

which, being explicitly documented as character terminal
support, should have a higher probability of success.

-- 
Thien-Thi Nguyen -----------------------------------------------
  (if you're human and you know it) read my lisp:
    (defun responsep (type via)
      (case type
        (technical (eq 'mailing-list via))
        ...))
---------------------------------------------- GPG key: 4C807502

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]