unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
@ 2019-04-04 15:08 Ludovic Brenta
       [not found] ` <handler.35143.B.15543905268566.ack@debbugs.gnu.org>
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ludovic Brenta @ 2019-04-04 15:08 UTC (permalink / raw)
  To: 35143; +Cc: ada-mode-users

X-Debbugs-CC: ada-mode-users@nongnu.org
Package: emacs, ada-mode
Version: 26.1
Severity: minor

Visit a file foo.adb consisting of:

procedure Foo is
begin
end Foo;

Now place point after "begin" and type RET.

ada-mode inserts a newline but also moves point an
additional line, on the "e" of "end".  A variant of
this bug is even more severe: go up one line (into the
empty line) and type:

declare RET
I : Integer; RET
begin RET

Now, point is not only moved one line down but also the
"end Foo;" is indented to the right.

-- 
Ludovic Brenta.





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

* bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
       [not found] ` <handler.35143.B.15543905268566.ack@debbugs.gnu.org>
@ 2019-04-04 15:11   ` Ludovic Brenta
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Brenta @ 2019-04-04 15:11 UTC (permalink / raw)
  To: 35143

I forgot to mention that this bug is triggered by partial
parsing only; i.e. it is visible only when the buffer-local
variable wisi-partial-parse-threshold is zero.

-- 
Ludovic Brenta.





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

* bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
  2019-04-04 15:08 bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET Ludovic Brenta
       [not found] ` <handler.35143.B.15543905268566.ack@debbugs.gnu.org>
@ 2019-05-24 16:52 ` Stephen Leake
  2019-05-24 16:56 ` Stephen Leake
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Leake @ 2019-05-24 16:52 UTC (permalink / raw)
  To: Ludovic Brenta; +Cc: 35143, ada-mode-users

Fixed in development branch.
-- 
-- Stephe





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

* bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
  2019-04-04 15:08 bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET Ludovic Brenta
       [not found] ` <handler.35143.B.15543905268566.ack@debbugs.gnu.org>
  2019-05-24 16:52 ` Stephen Leake
@ 2019-05-24 16:56 ` Stephen Leake
  2019-08-18 16:53 ` bug#35143: Fixed in ada-mode 6.1.0 Stephen Leake
  2019-08-18 16:54 ` bug#35143: close Stephen Leake
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Leake @ 2019-05-24 16:56 UTC (permalink / raw)
  To: Ludovic Brenta; +Cc: 35143, ada-mode-users

Here is the current implementation of 'ada-indent-newline-indent': using
it fixes this bug, as well as some other bad behavior.

(defun ada-indent-newline-indent ()
  "insert a newline, indent the old and new lines."
  (interactive "*")
  ;; point may be in the middle of a word, so insert newline first,
  ;; then go back and indent.
  (insert "\n")
  (unless (and (wisi-partial-parse-p (line-beginning-position) (line-end-position))
	       (save-excursion (progn (forward-char -1)(looking-back "begin\\|else" (line-beginning-position)))))
    ;; Partial parse may think 'begin' is just the start of a
    ;; statement, when it's actually part of a larger declaration. So
    ;; don't indent 'begin'. Similarly for 'else'; error recovery will
    ;; probably insert 'if then' immediately before it
    (forward-char -1)
    (funcall indent-line-function)
    (forward-char 1))
  (funcall indent-line-function))

--
-- Stephe





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

* bug#35143: Fixed in ada-mode 6.1.0
  2019-04-04 15:08 bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET Ludovic Brenta
                   ` (2 preceding siblings ...)
  2019-05-24 16:56 ` Stephen Leake
@ 2019-08-18 16:53 ` Stephen Leake
  2019-08-18 16:54 ` bug#35143: close Stephen Leake
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Leake @ 2019-08-18 16:53 UTC (permalink / raw)
  To: 35143

Fixed in ada-mode 6.1.0
-- 
-- Stephe





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

* bug#35143: close
  2019-04-04 15:08 bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET Ludovic Brenta
                   ` (3 preceding siblings ...)
  2019-08-18 16:53 ` bug#35143: Fixed in ada-mode 6.1.0 Stephen Leake
@ 2019-08-18 16:54 ` Stephen Leake
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Leake @ 2019-08-18 16:54 UTC (permalink / raw)
  To: 35143-close


-- 
-- Stephe





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

end of thread, other threads:[~2019-08-18 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-04 15:08 bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET Ludovic Brenta
     [not found] ` <handler.35143.B.15543905268566.ack@debbugs.gnu.org>
2019-04-04 15:11   ` Ludovic Brenta
2019-05-24 16:52 ` Stephen Leake
2019-05-24 16:56 ` Stephen Leake
2019-08-18 16:53 ` bug#35143: Fixed in ada-mode 6.1.0 Stephen Leake
2019-08-18 16:54 ` bug#35143: close Stephen Leake

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