unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51312: 29.0.50; Indenting vectors with leading spaces errors out
@ 2021-10-21  3:03 Lars Ingebrigtsen
  2021-10-21  4:59 ` bug#51312: [External] : " Drew Adams
  2021-10-21  9:06 ` martin rudalics
  0 siblings, 2 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-21  3:03 UTC (permalink / raw)
  To: 51312


Trying to use the newish space-after-parenthesis syntax errors out when
you hit tab on the second line:

[ :foo :zot
      :bar]

forward-sexp: Scan error: "Containing expression ends prematurely", 1, 1



In GNU Emacs 29.0.50 (build 39, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2021-10-20 built on elva
Repository revision: 62591c164cd6d0b0555e11b160ffa81bd3bb010f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux bookworm/sid

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51312: [External] : bug#51312: 29.0.50; Indenting vectors with leading spaces errors out
  2021-10-21  3:03 bug#51312: 29.0.50; Indenting vectors with leading spaces errors out Lars Ingebrigtsen
@ 2021-10-21  4:59 ` Drew Adams
  2021-10-21  9:06 ` martin rudalics
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2021-10-21  4:59 UTC (permalink / raw)
  To: Lars Ingebrigtsen, 51312@debbugs.gnu.org

> Trying to use the newish space-after-parenthesis syntax...

Newish?  Or "some time back", as you said in emacs-devel?

Where is that convention documented?  Is it in
(elisp) Coding Conventions perhaps?  I don't have
Emacs 28, and I don't see it there in 27.2.

The only thing about parens I see in that node is
this, which really was established some time back:

 "Don't make a habit of putting close-parentheses
  on lines by themselves; Lisp programmers find
  this disconcerting."

FWIW, I'd guess that Lisp programmers might find
your newish convention disconcerting.  Is there
a community of them that use it, or is it just a
newish eureka someone had?

If the aim is just to work around poor indentation
then I'd say it's the wrong solution for that.

If the aim is just to indicate that the sexp isn't
evaluated (it's "data") then the quote or backquote
does that, no?  Doesn't seem very lispy, to me.

Just one somewhat disconcerted Lisp programmer.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51312: 29.0.50; Indenting vectors with leading spaces errors out
  2021-10-21  3:03 bug#51312: 29.0.50; Indenting vectors with leading spaces errors out Lars Ingebrigtsen
  2021-10-21  4:59 ` bug#51312: [External] : " Drew Adams
@ 2021-10-21  9:06 ` martin rudalics
  2021-10-21 13:09   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: martin rudalics @ 2021-10-21  9:06 UTC (permalink / raw)
  To: Lars Ingebrigtsen, 51312

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

 > Trying to use the newish space-after-parenthesis syntax errors out when
 > you hit tab on the second line:
 >
 > [ :foo :zot
 >        :bar]
 >
 > forward-sexp: Scan error: "Containing expression ends prematurely", 1, 1

Can you try the attached patch?

Thanks, martin

[-- Attachment #2: lisp-mode.el.diff --]
[-- Type: text/x-patch, Size: 1078 bytes --]

--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1078,10 +1078,11 @@ calculate-lisp-indent
 		       ;; Handle prefix characters and whitespace
 		       ;; following an open paren.  (Bug#1012)
                        (backward-prefix-chars)
-                       (while (not (or (looking-back "^[ \t]*\\|([ \t]+"
-                                                      (line-beginning-position))
-                                       (and containing-sexp
-                                            (>= (1+ containing-sexp) (point)))))
+                       (while (not (save-excursion
+                                     (skip-chars-backward " \t")
+                                     (or (= (point) (line-beginning-position))
+                                         (and containing-sexp
+                                              (= (point) (1+ containing-sexp))))))
                          (forward-sexp -1)
                          (backward-prefix-chars))
                        (setq calculate-lisp-indent-last-sexp (point)))

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51312: 29.0.50; Indenting vectors with leading spaces errors out
  2021-10-21  9:06 ` martin rudalics
@ 2021-10-21 13:09   ` Lars Ingebrigtsen
  2021-10-22  9:05     ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-21 13:09 UTC (permalink / raw)
  To: martin rudalics; +Cc: 51312

martin rudalics <rudalics@gmx.at> writes:

> Can you try the attached patch?

Thanks; that fixes the problem.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#51312: 29.0.50; Indenting vectors with leading spaces errors out
  2021-10-21 13:09   ` Lars Ingebrigtsen
@ 2021-10-22  9:05     ` martin rudalics
  0 siblings, 0 replies; 5+ messages in thread
From: martin rudalics @ 2021-10-22  9:05 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51312

close 51312 28.1
quit

 >> Can you try the attached patch?
 >
 > Thanks; that fixes the problem.

Installed.  Bug closed.

martin





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-22  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21  3:03 bug#51312: 29.0.50; Indenting vectors with leading spaces errors out Lars Ingebrigtsen
2021-10-21  4:59 ` bug#51312: [External] : " Drew Adams
2021-10-21  9:06 ` martin rudalics
2021-10-21 13:09   ` Lars Ingebrigtsen
2021-10-22  9:05     ` martin rudalics

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).