From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: UI tests Date: Thu, 12 Nov 2015 14:37:25 +0000 Message-ID: <20151112143725.GC3120@acm.fritz.box> References: <87d1vpoees.fsf@russet.org.uk> <87r3k3igy1.fsf@russet.org.uk> <86io5ewbhg.fsf@stephe-leake.org> <8737wiyt75.fsf_-_@russet.org.uk> <87si4dsif4.fsf@cumego.com> <87oaf1wpkv.fsf@russet.org.uk> <876119sfa1.fsf@cumego.com> <87ziyk969x.fsf@russet.org.uk> <877flnpaw3.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1447338968 28255 80.91.229.3 (12 Nov 2015 14:36:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2015 14:36:08 +0000 (UTC) Cc: esperanto@cumego.com, stephen_leake@stephe-leake.org, Richard Stallman , emacs-devel@gnu.org To: Phillip Lord Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 12 15:35:49 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Zwsya-0002q8-77 for ged-emacs-devel@m.gmane.org; Thu, 12 Nov 2015 15:35:48 +0100 Original-Received: from localhost ([::1]:47021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwsyZ-0003fE-DM for ged-emacs-devel@m.gmane.org; Thu, 12 Nov 2015 09:35:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwsyO-0003e6-Bb for emacs-devel@gnu.org; Thu, 12 Nov 2015 09:35:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwsyI-0008Cs-Nz for emacs-devel@gnu.org; Thu, 12 Nov 2015 09:35:36 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:32036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwsyI-0008Cf-FS for emacs-devel@gnu.org; Thu, 12 Nov 2015 09:35:30 -0500 Original-Received: (qmail 79415 invoked by uid 3782); 12 Nov 2015 14:35:29 -0000 Original-Received: from acm.muc.de (p5B14648C.dip0.t-ipconnect.de [91.20.100.140]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 12 Nov 2015 15:35:27 +0100 Original-Received: (qmail 5222 invoked by uid 1000); 12 Nov 2015 14:37:25 -0000 Content-Disposition: inline In-Reply-To: <877flnpaw3.fsf@russet.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194228 Archived-At: 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).