GNU bug report logs - #21090
25.0.50; `condition-case-no-debug': Please fix indentation & highlighting

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 18 Jul 2015 20:08:01 UTC

Severity: minor

Tags: wontfix

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.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 21090 in the body.
You can then email your comments to 21090 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 bug-gnu-emacs <at> gnu.org:
bug#21090; Package emacs. (Sat, 18 Jul 2015 20:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 18 Jul 2015 20:08:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; `condition-case-no-debug': Please fix indentation &
 highlighting
Date: Sat, 18 Jul 2015 13:07:01 -0700 (PDT)
In Emacs 23 you introduced `condition-case-no-debug'.  In Emacs 24.1 you
immediately turned around and deprecated it - to improve the name.
Hindsight is 20x20, but such things happen.

What should not happen is that when you make such a replacement,
especially for a simple renaming, you break the behavior of the alias
that is deprecated.

You should at least let the alias act the same as the newly named
replacement (and in the case of just a renaming, act the same as it did
before).  Especially for a macro, you should reinstate the highlighting
and, especially, the indentation, so one can use recent Emacs on code
that must work also with Emacs 23.

This macro is one case in point.  Please restore at least the
indentation, and preferably the font-lock highlighting as well.

And then please search for other such renamings of things that had
indentation declarations and were font-locked, and fix them too.

Thx.


In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm <at> gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21090; Package emacs. (Mon, 20 Jul 2015 00:20:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 21090 <at> debbugs.gnu.org
Subject: Re: bug#21090: 25.0.50;
 `condition-case-no-debug': Please fix indentation & highlighting
Date: Sun, 19 Jul 2015 20:19:00 -0400
Thanks for the rant, but do you have a recipe to reproduce this
hypothetical problem, starting from "emacs -Q"?


        Stefan


>>>>> "Drew" == Drew Adams <drew.adams <at> oracle.com> writes:

> In Emacs 23 you introduced `condition-case-no-debug'.  In Emacs 24.1 you
> immediately turned around and deprecated it - to improve the name.
> Hindsight is 20x20, but such things happen.

> What should not happen is that when you make such a replacement,
> especially for a simple renaming, you break the behavior of the alias
> that is deprecated.

> You should at least let the alias act the same as the newly named
> replacement (and in the case of just a renaming, act the same as it did
> before).  Especially for a macro, you should reinstate the highlighting
> and, especially, the indentation, so one can use recent Emacs on code
> that must work also with Emacs 23.

> This macro is one case in point.  Please restore at least the
> indentation, and preferably the font-lock highlighting as well.

> And then please search for other such renamings of things that had
> indentation declarations and were font-locked, and fix them too.

> Thx.


> In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
>  of 2014-10-20 on LEG570
> Bzr revision: 118168 rgm <at> gnu.org-20141020195941-icp42t8ttcnud09g
> Windowing system distributor `Microsoft Corp.', version 6.1.7601
> Configured using:
>  `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21090; Package emacs. (Mon, 20 Jul 2015 15:02:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 21090 <at> debbugs.gnu.org
Subject: RE: bug#21090: 25.0.50; `condition-case-no-debug': Please fix
 indentation & highlighting
Date: Mon, 20 Jul 2015 08:01:13 -0700 (PDT)
> do you have a recipe to reproduce this..., starting from "emacs -Q"?

Dunno whether you want to consider this a bug, as it involves
`common-lisp-indent-function'.  Perhaps you will consider it a
feature.

Anyway, the behavior changed to the current behavior in Emacs 24.1.
Before that, there was no such problem with indentation.

1. emacs -Q

2. Put this in a file foo.el, then kill the foo.el buffer or restart Emacs:

----------------8<-----------------
(defun foo ()
  ""
  (interactive)
  (condition-case-no-debug foo
      (save-excursion (goto-char 44))
    (error (error "%s" (error-message-string foo)))))
----------------8<-----------------

3. Evaluate this, then visit file foo.el.

(defun lisp-indentation-hack ()
  (unless (load-history-filename-element (load-history-regexp "cl-indent"))
    (load "cl-indent" nil t))
  (set (make-local-variable 'lisp-indent-function)
       'common-lisp-indent-function))

(add-hook 'emacs-lisp-mode-hook 'lisp-indentation-hack)

4. Put point at beginning of the `(defun....)' in foo.el, and hit `C-M-q'.

Result:

(defun foo ()
  ""
  (interactive)
  (condition-case-no-debug foo
                           (save-excursion (goto-char 44))
                           (error (error "%s" (error-message-string foo)))))

Prior to Emacs 24.1, there is no change in indentation.  Starting with
24.1, the `save-excursion' and `error' sexps are aligned with `foo'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21090; Package emacs. (Mon, 20 Jul 2015 22:56:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 21090 <at> debbugs.gnu.org
Subject: Re: bug#21090: 25.0.50;
 `condition-case-no-debug': Please fix indentation & highlighting
Date: Mon, 20 Jul 2015 18:54:57 -0400
> Dunno whether you want to consider this a bug, as it involves
> `common-lisp-indent-function'.  Perhaps you will consider it a feature.

Sounds like a bug in common-lisp-indent-function which should use
`function-get' rather than `get'.
What about the highlighting problem?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21090; Package emacs. (Mon, 20 Jul 2015 23:31:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 21090 <at> debbugs.gnu.org
Subject: RE: bug#21090: 25.0.50; `condition-case-no-debug': Please fix
 indentation & highlighting
Date: Mon, 20 Jul 2015 16:30:32 -0700 (PDT)
> Sounds like a bug in common-lisp-indent-function which should use
> `function-get' rather than `get'.
> What about the highlighting problem?

I was completely wrong about the highlighting.  I guess I was looking
at Emacs 23 at that time - it does not highlight it.  I was checking
the change in behavior, and probably got my windows mixed up.  Sorry.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21090; Package emacs. (Sat, 30 Apr 2016 21:25:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 21090 <at> debbugs.gnu.org
Subject: Re: bug#21090: 25.0.50;
 `condition-case-no-debug': Please fix indentation & highlighting
Date: Sat, 30 Apr 2016 23:24:51 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> (defun lisp-indentation-hack ()
>   (unless (load-history-filename-element (load-history-regexp "cl-indent"))
>     (load "cl-indent" nil t))
>   (set (make-local-variable 'lisp-indent-function)
>        'common-lisp-indent-function))
>
> (add-hook 'emacs-lisp-mode-hook 'lisp-indentation-hack)
>
> 4. Put point at beginning of the `(defun....)' in foo.el, and hit `C-M-q'.
>
> Result:
>
> (defun foo ()
>   ""
>   (interactive)
>   (condition-case-no-debug foo
>                            (save-excursion (goto-char 44))
>                            (error (error "%s" (error-message-string foo)))))
>
> Prior to Emacs 24.1, there is no change in indentation.  Starting with
> 24.1, the `save-excursion' and `error' sexps are aligned with `foo'.

So this bug report is that if you indent Emacs Lisp code with the Common
Lisp indentation function, then it doesn't do the right thing?

I don't think this is a bug.  Closing.

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




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 30 Apr 2016 21:26:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 21090 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 30 Apr 2016 21:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 May 2016 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 21 days ago.

Previous Next


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