From: A Soare <alinsoar@voila.fr>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Indentation of constants in LISP
Date: Fri, 2 Feb 2007 17:17:43 +0100 (CET) [thread overview]
Message-ID: <23847250.4061170433063829.JavaMail.www@wwinf4103> (raw)
[-- Attachment #1: Type: text/plain, Size: 855 bytes --]
Hello.
There is no rule in this moment to align the constant symbols in
lisp, emacs lisp, lisp-interaction modes. For example:
'( :stipple nil
:background "LightBlue"
:foreground "Black"
:inverse-video nil
(f p q r :name nil
:server nil
In case that the first symbol of the current line is a constant,
the indentation will be:
'( :stipple nil
:background "LightBlue"
:foreground "Black"
:inverse-video nil
(f p q r :name nil
:server nil
etc.
It's not an exhaustive treatment, because there is not an
exhaustive definition of this kind of alignement.
I attached here the file diff which represents the output from
cvs -d:pserver:anonymous@cvs.gnu.org:/sources/emacs diff emacs/lisp/emacs-lisp/lisp-mode.el
and, in case that the code is accepted, a change log entry.
A Soare
[-- Attachment #2: /diff --]
[-- Type: application/octet-stream, Size: 1185 bytes --]
Index: emacs/lisp/emacs-lisp/lisp-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/lisp-mode.el,v
retrieving revision 1.196
diff -r1.196 lisp-mode.el
909a910,927
> ((save-excursion
> (goto-char indent-point)
> (skip-chars-forward " \t")
> (and (looking-at ":")
> (thing-at-point 'symbol)))
> ;; Align a constant symbol under a constant symbol
> ;; Not used keywordp in order not to intern it
> (let ((desired-indent
> (save-excursion
> (goto-char (1+ containing-sexp))
> (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
> (point))))
> (goto-char calculate-lisp-indent-last-sexp)
> (while (> (point) desired-indent)
> (cond ((equal (elt (thing-at-point 'symbol) 0) ?:)
> (setq desired-indent (point)))
> (t (backward-sexp 1))))
> (current-column)))
[-- Attachment #3: /change-log --]
[-- Type: application/octet-stream, Size: 172 bytes --]
2007-02-02 Alin C. Soare <alinsoar@voila.fr> (tiny change)
* lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent):
Added indentation for the constant symbols of Lisp
[-- Attachment #4: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next reply other threads:[~2007-02-02 16:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-02 16:17 A Soare [this message]
2007-02-03 11:19 ` Indentation of constants in LISP Richard Stallman
2007-02-20 13:29 ` Johan Bockgård
2007-02-21 0:44 ` Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2007-02-04 11:37 A Soare
2007-02-04 13:28 A Soare
2007-02-05 0:23 ` Richard Stallman
2007-02-05 1:28 ` Stefan Monnier
2007-02-05 7:41 A Soare
2007-02-05 19:06 ` Stefan Monnier
2007-02-05 9:51 A Soare
2007-02-05 14:33 A Soare
2007-02-20 14:14 A Soare
2007-02-20 18:04 ` Stuart D. Herring
2007-02-20 14:26 A Soare
2007-02-21 22:55 ` Richard Stallman
2007-02-20 15:28 A Soare
2007-02-20 18:23 A Soare
2007-02-20 19:17 A Soare
2007-02-21 8:38 ` Richard Stallman
2007-02-21 8:32 A Soare
2007-02-21 10:41 A Soare
2007-02-22 17:21 ` Richard Stallman
2007-02-21 22:33 A Soare
2007-02-22 2:24 A Soare
2007-02-22 17:20 ` Richard Stallman
2007-02-22 2:53 A Soare
2007-02-22 13:29 A Soare
2007-02-23 15:58 A Soare
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23847250.4061170433063829.JavaMail.www@wwinf4103 \
--to=alinsoar@voila.fr \
--cc=emacs-devel@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).