* bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting
@ 2015-07-18 20:07 Drew Adams
2015-07-20 0:19 ` Stefan Monnier
0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2015-07-18 20:07 UTC (permalink / raw
To: 21090
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@gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting
2015-07-18 20:07 bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting Drew Adams
@ 2015-07-20 0:19 ` Stefan Monnier
2015-07-20 15:01 ` Drew Adams
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-07-20 0:19 UTC (permalink / raw
To: Drew Adams; +Cc: 21090
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@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@gnu.org-20141020195941-icp42t8ttcnud09g
> Windowing system distributor `Microsoft Corp.', version 6.1.7601
> Configured using:
> `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting
2015-07-20 0:19 ` Stefan Monnier
@ 2015-07-20 15:01 ` Drew Adams
2015-07-20 22:54 ` Stefan Monnier
2016-04-30 21:24 ` Lars Ingebrigtsen
0 siblings, 2 replies; 6+ messages in thread
From: Drew Adams @ 2015-07-20 15:01 UTC (permalink / raw
To: Stefan Monnier; +Cc: 21090
> 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'.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting
2015-07-20 15:01 ` Drew Adams
@ 2015-07-20 22:54 ` Stefan Monnier
2015-07-20 23:30 ` Drew Adams
2016-04-30 21:24 ` Lars Ingebrigtsen
1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-07-20 22:54 UTC (permalink / raw
To: Drew Adams; +Cc: 21090
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting
2015-07-20 22:54 ` Stefan Monnier
@ 2015-07-20 23:30 ` Drew Adams
0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2015-07-20 23:30 UTC (permalink / raw
To: Stefan Monnier; +Cc: 21090
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting
2015-07-20 15:01 ` Drew Adams
2015-07-20 22:54 ` Stefan Monnier
@ 2016-04-30 21:24 ` Lars Ingebrigtsen
1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-30 21:24 UTC (permalink / raw
To: Drew Adams; +Cc: Stefan Monnier, 21090
Drew Adams <drew.adams@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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-04-30 21:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-18 20:07 bug#21090: 25.0.50; `condition-case-no-debug': Please fix indentation & highlighting Drew Adams
2015-07-20 0:19 ` Stefan Monnier
2015-07-20 15:01 ` Drew Adams
2015-07-20 22:54 ` Stefan Monnier
2015-07-20 23:30 ` Drew Adams
2016-04-30 21:24 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.