GNU bug report logs - #35143
26.1; ada-mode 6.1.0 moves point twice after begin RET

Previous Next

Packages: emacs, ada-mode;

Reported by: Ludovic Brenta <ludovic <at> ludovic-brenta.org>

Date: Thu, 4 Apr 2019 15:09:02 UTC

Severity: minor

Found in version 26.1

Done: Stephen Leake <stephen_leake <at> stephe-leake.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35143 in the body.
You can then email your comments to 35143 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to ada-mode-users <at> nongnu.org, bug-gnu-emacs <at> gnu.org:
bug#35143; Package emacs, ada-mode. (Thu, 04 Apr 2019 15:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Brenta <ludovic <at> ludovic-brenta.org>:
New bug report received and forwarded. Copy sent to ada-mode-users <at> nongnu.org, bug-gnu-emacs <at> gnu.org. (Thu, 04 Apr 2019 15:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; ada-mode 6.1.0 moves point twice after begin RET
Date: Thu, 04 Apr 2019 17:08:29 +0200
X-Debbugs-CC: ada-mode-users <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35143; Package emacs, ada-mode. (Thu, 04 Apr 2019 15:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 35143 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
To: 35143 <at> debbugs.gnu.org
Subject: bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
Date: Thu, 04 Apr 2019 17:11:22 +0200
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35143; Package emacs, ada-mode. (Fri, 24 May 2019 16:58:01 GMT) Full text and rfc822 format available.

Message #11 received at 35143 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
Cc: 35143 <at> debbugs.gnu.org, ada-mode-users <at> nongnu.org
Subject: Re: bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
Date: Fri, 24 May 2019 08:56:47 -0800
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35143; Package emacs, ada-mode. (Fri, 24 May 2019 17:12:03 GMT) Full text and rfc822 format available.

Message #14 received at 35143 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
Cc: 35143 <at> debbugs.gnu.org, ada-mode-users <at> nongnu.org
Subject: Re: bug#35143: 26.1; ada-mode 6.1.0 moves point twice after begin RET
Date: Fri, 24 May 2019 08:52:38 -0800
Fixed in development branch.
-- 
-- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35143; Package emacs, ada-mode. (Sun, 18 Aug 2019 16:54:01 GMT) Full text and rfc822 format available.

Message #17 received at 35143 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: 35143 <at> debbugs.gnu.org
Subject: Fixed in ada-mode 6.1.0
Date: Sun, 18 Aug 2019 09:53:32 -0700
Fixed in ada-mode 6.1.0
-- 
-- Stephe




Reply sent to Stephen Leake <stephen_leake <at> stephe-leake.org>:
You have taken responsibility. (Sun, 18 Aug 2019 16:55:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Brenta <ludovic <at> ludovic-brenta.org>:
bug acknowledged by developer. (Sun, 18 Aug 2019 16:55:02 GMT) Full text and rfc822 format available.

Message #22 received at 35143-close <at> debbugs.gnu.org (full text, mbox):

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: 35143-close <at> debbugs.gnu.org
Subject: close
Date: Sun, 18 Aug 2019 09:54:04 -0700
-- 
-- Stephe




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.