From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davin Pearson" Newsgroups: gmane.emacs.help Subject: How to get syntax information in batch mode? Date: 18 May 2006 22:58:13 -0700 Organization: http://groups.google.com Message-ID: <1148018293.918822.151520@38g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1148020870 5224 80.91.229.2 (19 May 2006 06:41:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 May 2006 06:41:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 19 08:41:06 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fgyfa-0005Ap-8y for geh-help-gnu-emacs@m.gmane.org; Fri, 19 May 2006 08:41:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgyfZ-0006RD-LO for geh-help-gnu-emacs@m.gmane.org; Fri, 19 May 2006 02:41:05 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!4.24.21.218.MISMATCH!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!38g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 202.36.179.65 Original-X-Trace: posting.google.com 1148018297 17951 127.0.0.1 (19 May 2006 05:58:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 19 May 2006 05:58:17 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.12) Gecko/20050919 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 38g2000cwa.googlegroups.com; posting-host=202.36.179.65; posting-account=Bn_6fA0AAAA1mf0ithIG_I4r1FOcs2it Original-Xref: shelby.stanford.edu gnu.emacs.help:139517 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35141 Archived-At: I have written an automatic code indentation function in ELisp and I want to be able to invoke this function from Emacs' batch mode so that it can be invoked from a Makefile, without needing to start Emacs interactively. However the function get-char-property always seems to return nil when noninteractive is set to t. Am I correct about this deduction? I use get-char-property to tell the automatic indentation function whether or not we are currently inside a string or a comment. Is there a different function for telling whether or not we are currently inside a string or a comment? If there is no such function, then could Emacs be modified so that text properties are online in batch mode? Here is an example of a function that always prints nil when invoked noninteractively. (defun test () (find-file "~/a.java") (font-lock-mode) (goto-char (point-min)) (while (< (point) (point-max)) (message "%s\n" (get-char-property (point) 'face)) (forward-char 1)))