* Indentation of LISP code
@ 2007-02-27 21:16 A Soare
2007-02-27 22:25 ` Miles Bader
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: A Soare @ 2007-02-27 21:16 UTC (permalink / raw)
To: Emacs Dev [emacs-devel]
Because it was proved that the indentation in lisp mode must be rewritten ( project for after the release ) I would like to ask your opinion about this situation:
Do you prefer that the line
( defun ( x &optional a b c d)
after applying an indent-function
stay in the same form, or to be rendered so:
(defun (x &optional a b c d)
I would like to know your opinions about.
Thank you.
Alin Soare
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-02-27 21:16 A Soare
@ 2007-02-27 22:25 ` Miles Bader
2007-02-27 22:31 ` Stuart D. Herring
2007-02-28 7:27 ` Richard Stallman
2 siblings, 0 replies; 14+ messages in thread
From: Miles Bader @ 2007-02-27 22:25 UTC (permalink / raw)
To: alinsoar; +Cc: Emacs Dev [emacs-devel]
A Soare <alinsoar@voila.fr> writes:
> ( defun ( x &optional a b c d)
> after applying an indent-function
> stay in the same form, or to be rendered so:
> (defun (x &optional a b c d)
Removing whitespace around parentheses doesn't sound like indentation to
me...
-miles
--
Quidquid latine dictum sit, altum viditur.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-02-27 21:16 A Soare
2007-02-27 22:25 ` Miles Bader
@ 2007-02-27 22:31 ` Stuart D. Herring
2007-02-28 7:27 ` Richard Stallman
2 siblings, 0 replies; 14+ messages in thread
From: Stuart D. Herring @ 2007-02-27 22:31 UTC (permalink / raw)
To: alinsoar; +Cc: emacs-devel
> Do you prefer that the line
>
> ( defun ( x &optional a b c d)
>
> after applying an indent-function
>
> stay in the same form, or to be rendered so:
>
> (defun (x &optional a b c d)
Indentation never changes whitespace within a line except (sometimes) to
adjust the space between the end of the real code and any comment on the
line. I can't see a reason that we would want to change that, and only
for Lisp.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
@ 2007-02-27 23:16 A Soare
2007-02-27 23:31 ` Miles Bader
0 siblings, 1 reply; 14+ messages in thread
From: A Soare @ 2007-02-27 23:16 UTC (permalink / raw)
To: Emacs Dev [emacs-devel]
> Removing whitespace around parentheses doesn't sound like indentation to
> me...
In this moment some spaces are added sometimes
();test
Indent it using TAB then select and indent it with C-M-\
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-02-27 23:16 A Soare
@ 2007-02-27 23:31 ` Miles Bader
0 siblings, 0 replies; 14+ messages in thread
From: Miles Bader @ 2007-02-27 23:31 UTC (permalink / raw)
To: alinsoar; +Cc: Emacs Dev [emacs-devel]
A Soare <alinsoar@voila.fr> writes:
>> Removing whitespace around parentheses doesn't sound like indentation to
>> me...
>
> In this moment some spaces are added sometimes
>
> ();test
That is indentation: it indents both the code and the comment, each of
which has a fixed column that it should start in.
-miles
--
o The existentialist, not having a pillow, goes everywhere with the book by
Sullivan, _I am going to spit on your graves_.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-02-27 21:16 A Soare
2007-02-27 22:25 ` Miles Bader
2007-02-27 22:31 ` Stuart D. Herring
@ 2007-02-28 7:27 ` Richard Stallman
2 siblings, 0 replies; 14+ messages in thread
From: Richard Stallman @ 2007-02-28 7:27 UTC (permalink / raw)
To: alinsoar; +Cc: emacs-devel
Do you prefer that the line
( defun ( x &optional a b c d)
after applying an indent-function
stay in the same form,
Yes.
or to be rendered so:
(defun (x &optional a b c d)
Definitely not. Indentation commands should not alter whitespace
within the code. They should change the indentation of code and
comments, but not internal whitespace.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
@ 2007-04-05 15:10 A Soare
2007-04-05 15:45 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: A Soare @ 2007-04-05 15:10 UTC (permalink / raw)
To: Emacs Dev [emacs-devel]
In this moment one ignores the indentation of commented lines with ;;; like this one:
;;; this is a commented line.
However:
(defun lisp-indent-region (start end)
"Indent every line whose first char is between START and END inclusive."
(save-excursion
(asa;;;a <=<= THIS LINE IS NOT IGNORED, IT IS TREATED AS DOUBLE COMMENTED
))
)
(USE INDENT REGION TO INDENT)
In future (after the release) this indentation should be ignored too or treated as double commented ;;?
alin soare.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-04-05 15:10 Indentation of LISP code A Soare
@ 2007-04-05 15:45 ` Stefan Monnier
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2007-04-05 15:45 UTC (permalink / raw)
To: alinsoar; +Cc: Emacs Dev [emacs-devel]
> In this moment one ignores the indentation of commented lines with ;;;
> like this one: ;;; this is a commented line.
> However:
> (defun lisp-indent-region (start end)
> "Indent every line whose first char is between START and END inclusive."
> (save-excursion
> (asa;;;a <=<= THIS LINE IS NOT IGNORED, IT IS TREATED AS DOUBLE COMMENTED
> ))
> )
> (USE INDENT REGION TO INDENT)
> In future (after the release) this indentation should be ignored too or
> treated as double commented ;;?
I don't understand the problem. The only difference I can see is that
a space gets added before ";;;". Lisp's indent-region does both re-indent
the code and the comments, so it's completely expected behavior.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
@ 2007-04-05 16:01 A Soare
2007-04-05 17:42 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: A Soare @ 2007-04-05 16:01 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Emacs Dev [emacs-devel]
> I don't understand the problem. The only difference I can see is that
> a space gets added before ";;;". Lisp's indent-region does both re-indent
> the code and the comments, so it's completely expected behavior.
Put instead ;;; just 2 comments then just 1.
You will see that using ;;; is the same case as with ;;.
When we put ;;; the indent of the comment must not change, so
(nil);;; this is a comm
must not change.
A Soare.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-04-05 16:01 A Soare
@ 2007-04-05 17:42 ` Stefan Monnier
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2007-04-05 17:42 UTC (permalink / raw)
To: alinsoar; +Cc: Emacs Dev [emacs-devel]
> When we put ;;; the indent of the comment must not change.
And who said so?
AFAIK, the only rule about ";;;" is that they should be "indented" to
column 0, which in the present case is impossible.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
@ 2007-04-06 8:20 A Soare
2007-04-06 9:02 ` Thien-Thi Nguyen
2007-04-06 15:12 ` Stefan Monnier
0 siblings, 2 replies; 14+ messages in thread
From: A Soare @ 2007-04-06 8:20 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Emacs Dev [emacs-devel]
> > When we put ;;; the indent of the comment must not change.
>
> And who said so?
> AFAIK, the only rule about ";;;" is that they should be "indented" to
> column 0, which in the present case is impossible.
Hoops ! I do not know. Will somebody explain me how do you want these comments to show in future? (example and explanations with all line commented and also ;;; comment at the end of the line).
Thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-04-06 8:20 A Soare
@ 2007-04-06 9:02 ` Thien-Thi Nguyen
2007-04-06 15:12 ` Stefan Monnier
1 sibling, 0 replies; 14+ messages in thread
From: Thien-Thi Nguyen @ 2007-04-06 9:02 UTC (permalink / raw)
To: alinsoar; +Cc: Emacs Dev [emacs-devel]
() A Soare <alinsoar@voila.fr>
() Fri, 6 Apr 2007 10:20:28 +0200 (CEST)
> AFAIK, the only rule about ";;;" is that they should be "indented"
> to column 0, which in the present case is impossible.
Will somebody explain me how do you want these comments to show in
future? (example and explanations with all line commented and also
;;; comment at the end of the line).
perhaps this will suffice: (info "(elisp)Comment Tips")
thi
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
@ 2007-04-06 9:24 A Soare
0 siblings, 0 replies; 14+ messages in thread
From: A Soare @ 2007-04-06 9:24 UTC (permalink / raw)
To: Thien-Thi Nguyen; +Cc: Emacs Dev [emacs-devel]
> > AFAIK, the only rule about ";;;" is that they should be "indented"
> > to column 0, which in the present case is impossible.
>
> Will somebody explain me how do you want these comments to show in
> future? (example and explanations with all line commented and also
> ;;; comment at the end of the line).
>
> perhaps this will suffice: (info "(elisp)Comment Tips")
Thanks. I will use the defs. from that section of elisp manual to indent.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Indentation of LISP code
2007-04-06 8:20 A Soare
2007-04-06 9:02 ` Thien-Thi Nguyen
@ 2007-04-06 15:12 ` Stefan Monnier
1 sibling, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2007-04-06 15:12 UTC (permalink / raw)
To: alinsoar; +Cc: Emacs Dev [emacs-devel]
>> > When we put ;;; the indent of the comment must not change.
>> And who said so?
>> AFAIK, the only rule about ";;;" is that they should be "indented" to
>> column 0, which in the present case is impossible.
> Hoops ! I do not know. Will somebody explain me how do you want these
> comments to show in future? (example and explanations with all line
> commented and also ;;; comment at the end of the line).
The rule when doing a rewrite generally goes as follows:
- when in doubt, preserve the old behavior.
And in most cases you also have to apply this other rules:
- even in the absence of a doubt, make sure the user can still get the
old behavior.
Oh, and here's another important one:
- any change you introduce without even thinking about it, will invariably
lead to objections.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2007-04-06 15:12 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 15:10 Indentation of LISP code A Soare
2007-04-05 15:45 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2007-04-06 9:24 A Soare
2007-04-06 8:20 A Soare
2007-04-06 9:02 ` Thien-Thi Nguyen
2007-04-06 15:12 ` Stefan Monnier
2007-04-05 16:01 A Soare
2007-04-05 17:42 ` Stefan Monnier
2007-02-27 23:16 A Soare
2007-02-27 23:31 ` Miles Bader
2007-02-27 21:16 A Soare
2007-02-27 22:25 ` Miles Bader
2007-02-27 22:31 ` Stuart D. Herring
2007-02-28 7:27 ` Richard Stallman
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).