From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.help Subject: Re: indenting SQL in php_mode Date: Sun, 7 Dec 2008 21:57:24 -0800 Message-ID: <3AB997B9-DB98-4394-B3B6-0D7BDF0580A1@digg.com> References: <87iqpvojkw.fsf@stars.fthieme.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1228715883 16361 80.91.229.12 (8 Dec 2008 05:58:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2008 05:58:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Frank Thieme Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 08 06:59:06 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L9Z97-0006CO-39 for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Dec 2008 06:59:05 +0100 Original-Received: from localhost ([127.0.0.1]:41408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9Z7w-0001XS-96 for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Dec 2008 00:57:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9Z7Z-0001WD-8S for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 00:57:29 -0500 Original-Received: from [199.232.76.173] (port=35724 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9Z7Y-0001VV-AU for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 00:57:28 -0500 Original-Received: from mail.digg.com ([64.191.203.36]:57856) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L9Z7X-0005xw-TK for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 00:57:28 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id 3FFA7A85037; Sun, 7 Dec 2008 21:57:26 -0800 (PST) X-Virus-Scanned: amavisd-new at X-Spam-Score: 2.442 Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6jkGj496D8jq; Sun, 7 Dec 2008 21:57:25 -0800 (PST) Original-Received: from [192.168.1.100] (adsl-69-105-73-141.dsl.pltn13.pacbell.net [69.105.73.141]) by mail.digg.com (Postfix) with ESMTP id 84BD4A85034; Sun, 7 Dec 2008 21:57:25 -0800 (PST) In-Reply-To: <87iqpvojkw.fsf@stars.fthieme.lan> X-Mailer: Apple Mail (2.929.2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:60443 Archived-At: On Dec 7, 2008, at 11:45 AM, Frank Thieme wrote: > Hi! > > After years I'm back on Emacs. At the moment I'm writing a PHP/Mysql > project and wonder how I can get some indentation on the SQL > statements > within PHP code. > > When I write function calls like > > foo($bar, > $foobar); > > I can indent pressing key. But when I do same for SQL just > nothing > happens: > > $query = "SELECT foo > FROM bar > WHERE foobar" > > I have to manually indent... > > any hints? > There's no easy solution, unfortunately. I think the only thing you can do is et up MMM or MuMaMo so those regions are sql-mode instead of php-mode, and use sql-indent.el. I've never had the patience to get either of those working, so I just align it by hand in the source, or edit the query in a *SQL* buffer, then dump it into the source in a here document. - Ian