all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Phillip Lord <phillip.lord@russet.org.uk>
Cc: esperanto@cumego.com, stephen_leake@stephe-leake.org,
	Richard Stallman <rms@gnu.org>,
	emacs-devel@gnu.org
Subject: Re: UI tests
Date: Thu, 12 Nov 2015 14:37:25 +0000	[thread overview]
Message-ID: <20151112143725.GC3120@acm.fritz.box> (raw)
In-Reply-To: <877flnpaw3.fsf@russet.org.uk>

Hello, Phillip.

On Thu, Nov 12, 2015 at 02:09:32PM +0000, Phillip Lord wrote:

[ .... ]

> One additional problem, though, is that Emacs doesn't really have a
> concept of "headless". Things like syntax highlighting in buffers just
> work different when running in batch, because Emacs assumes it's running
> on a TTY. For example, HTML generated by htmlize comes out differently
> in batch, than from a windowed Emacs, because Emacs in batch cannot
> display colour.

I'm not sure whether or not this is relevant, but Emacs can be duped
into doing font-locking in batch mode.  Please examine the following
function (out of CC Mode's 000tests.el), and see if there's anything
in it you could use:

(defun cc-test-force-font-lock-buffer ()
  ;; Try to forcibly font lock the current buffer, even in batch mode.
  ;; We're doing really dirty things to trick font-lock into action in
  ;; batch mode in the different emacsen.
  (let ((orig-noninteractive-function
         (and (fboundp 'noninteractive)
              (symbol-function 'noninteractive)))
        (orig-noninteractive-variable
         (and (boundp 'noninteractive)
              (symbol-value 'noninteractive)))
        ;; font-lock in XEmacs 19 looks at a variable named `noninteractive'.
        (noninteractive nil))
    (unwind-protect
        (progn
          (when orig-noninteractive-function
            ;; XEmacs (at least 21.4) calls `noninteractive' to check
            ;; for batch mode, so we let it lie.
            (fset 'noninteractive (lambda () nil)))
          (font-lock-mode 1)
          (unless (or (get-text-property (point-min) 'face)
                      (next-single-property-change (point-min) 'face))
            ;; Some emacsen have already fontified the buffer above,
            ;; but others need some more coercion..
            (let (;; Avoid getting some lazy fontification package that
                  ;; might decide that nothing should be done.
                  (font-lock-fontify-buffer-function
                   'font-lock-default-fontify-buffer))
              (font-lock-fontify-buffer))))
      (when orig-noninteractive-function
        (fset 'noninteractive orig-noninteractive-function)))))


> Phil

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2015-11-12 14:37 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 17:36 Locations of Tests Phillip Lord
2015-11-04 17:53 ` John Wiegley
2015-11-04 18:14   ` Artur Malabarba
2015-11-04 18:21     ` John Wiegley
2015-11-25  9:23       ` Phillip Lord
2015-11-25  9:43         ` Artur Malabarba
2015-11-25 14:17           ` Phillip Lord
2015-11-04 19:15     ` Steinar Bang
2015-11-04 19:23       ` David Kastrup
2015-11-04 21:33         ` Phillip Lord
2015-11-04 19:07   ` Michael Albinus
2015-11-04 19:15     ` John Wiegley
2015-11-04 21:26       ` Phillip Lord
2015-11-05 13:41         ` Stephen Leake
2015-11-05 13:59           ` Artur Malabarba
2015-11-05 15:02             ` Nicolas Petton
2015-11-05 15:08               ` Artur Malabarba
2015-11-06  9:56                 ` Phillip Lord
2015-11-05 15:27           ` Juanma Barranquero
2015-11-06  9:55           ` Phillip Lord
2015-11-06 10:02 ` Makefile-help (was Re: Locations of Tests) Phillip Lord
2015-11-07  6:48   ` Stephen Leake
2015-11-07 10:55     ` Location of tests (again) (was Re: Makefile-help) Phillip Lord
2015-11-07 11:06       ` Juanma Barranquero
2015-11-07 11:22         ` Phillip Lord
2015-11-07 11:36           ` Juanma Barranquero
2015-11-07 17:46             ` Phillip Lord
2015-11-07 11:45           ` Eli Zaretskii
2015-11-07 18:09             ` Stephen Leake
2015-11-10 20:34       ` Przemysław Wojnowski
2015-11-10 20:45         ` Phillip Lord
2015-11-10 21:41           ` Przemysław Wojnowski
2015-11-10 22:27             ` John Wiegley
2015-11-11  0:28             ` bikeshedding (was Re: Location of tests (again) (was Re: Makefile-help)) Stephen Leake
2015-11-11 10:31             ` Location of tests (again) (was Re: Makefile-help) Phillip Lord
2015-11-11 17:02               ` UI tests Richard Stallman
2015-11-11 17:25                 ` John Wiegley
2015-11-12 14:09                 ` Phillip Lord
2015-11-12 14:37                   ` Alan Mackenzie [this message]
2015-11-12 16:33                   ` Eli Zaretskii
2015-11-13 21:58                   ` Richard Stallman
2015-11-15 12:14                 ` Przemysław Wojnowski
2015-11-16 19:32                   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151112143725.GC3120@acm.fritz.box \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=esperanto@cumego.com \
    --cc=phillip.lord@russet.org.uk \
    --cc=rms@gnu.org \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.