Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Proposal for better indentation for SQL strings?

Open
#282 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
emacs, php, sql
Domain
tooling

Research direction

The issue provides no file or test entry point, so start by reproducing the PHP-mode behavior with the SQL string examples shown. Trace how pressing RET indents multiline strings and determine whether keyword-based alignment is feasible; done means SELECT, FROM, and WHERE receive the requested indentation.

Written by the indexing model from the issue text.

Description

Would it be possible to indent on specific keywords of SQL strings in PHP-mode? For example, when I'm typing a SQL string, and press RET on line 2:

public function FooBar() {
       $sSql = 'SELECT foo, bar 
FROM footable 
WHERE foo = 1' 
}

I would like to see have the indentation in PHP-mode like this:

public function FooBar() {
      $sSql = 'SELECT foo, bar
                 FROM footable 
                WHERE foo = 1'
}

Is that even possible?

Dominant language
Emacs Lisp
Stars
602
Forks
117
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emacs-php/php-mode

All issues in emacs-php/php-mode

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.