GNU bug report logs - #51340
27.2; Bad indentation and fontification of advice functions

Previous Next

Package: emacs;

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

Date: Fri, 22 Oct 2021 21:54:01 UTC

Severity: wishlist

Tags: notabug

Found in version 27.2

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 51340 in the body.
You can then email your comments to 51340 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#51340; Package emacs. (Fri, 22 Oct 2021 21:54:01 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. (Fri, 22 Oct 2021 21:54:01 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" <bug-gnu-emacs <at> gnu.org>
Subject: 27.2; Bad indentation and fontification of advice functions
Date: Fri, 22 Oct 2021 21:53:01 +0000
1. Please consider indenting functions such as `advice-add' and
   `add-function' properly.  They should probably be indented the way
   function definitions (defuns) are.  So far, they're indented with no
   attention to what they're for or what their content is (e.g. use of
   keywords).

2. Please consider fontifying functions such as `advice-add', the same
   as functions such as `add-function': `fontlock-keyword-face'.

In GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
 of 2021-03-26 built on CIRROCUMULUS
Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19042
System Description: Microsoft Windows 10 Pro (v10.0.2009.19042.1237)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51340; Package emacs. (Sat, 23 Oct 2021 00:16:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 51340 <at> debbugs.gnu.org
Subject: Re: bug#51340: 27.2;
 Bad indentation and fontification of advice functions
Date: Fri, 22 Oct 2021 17:15:52 -0700
Drew Adams <drew.adams <at> oracle.com> writes:

> 1. Please consider indenting functions such as `advice-add' and
>    `add-function' properly.  They should probably be indented the way
>    function definitions (defuns) are.  So far, they're indented with no
>    attention to what they're for or what their content is (e.g. use of
>    keywords).

Do you have an example of the current indentation, and the one you would
like to see?  Thanks.

> 2. Please consider fontifying functions such as `advice-add', the same
>    as functions such as `add-function': `fontlock-keyword-face'.

Sounds good to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51340; Package emacs. (Sat, 23 Oct 2021 16:09:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: "51340 <at> debbugs.gnu.org" <51340 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#51340: 27.2; Bad indentation and
 fontification of advice functions
Date: Sat, 23 Oct 2021 16:08:35 +0000
> > 1. Please consider indenting functions such as `advice-add' and
> >    `add-function' properly.  They should probably be indented the way
> >    function definitions (defuns) are.  So far, they're indented with
> >    no attention to what they're for or what their content is (e.g.
> >    use of keywords).
> 
> Do you have an example of the current indentation, and the one you
> would like to see?  Thanks.

I don't really care much.  Mainly wanted to draw some
attention to the (minor) "problem", which could use
some love.

(advice-add 
 'foobar-mode :around 'my-foobar-around-advice)

(advice-add 'foobar-mode 
            :around 'my-foobar-around-advice)

(advice-add 'foobar-mode :around
 'my-foobar-around-advice)

(add-function :before-until (local 'something)
              #'some-function)

(add-function where isearch-filter-predicate pred
              (append (and (or name  ...)
                           `((name . ...)))
                      (and ...
                           (or ...)
                           (let ((foo  ...))
                             (unless (or ...)
                               (setq foo  ))
                             (and ...)))))

Maybe just indent as we do for `defun'.  Regardless
of where the first line is ended, just indent 1 char.

(defun foo
 () "jjj" (xyz))

(defun foo ()
 "jjj" (xyz))

(defun foo () "jjj"
 (xyz))

But as I say, I don't have any particular idea about
what the indentation should be, other than that what
we have now seems a bit odd, and wastes horizontal
space when you have a bunch of code (e.g. the last
add-function example above).

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 24 Oct 2021 12:48:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51340; Package emacs. (Sun, 24 Oct 2021 18:31:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "51340 <at> debbugs.gnu.org" <51340 <at> debbugs.gnu.org>,
 Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#51340: 27.2; Bad indentation and fontification of advice
 functions
Date: Sun, 24 Oct 2021 20:29:45 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> I don't really care much.  Mainly wanted to draw some
> attention to the (minor) "problem", which could use
> some love.
>
> (advice-add 
>  'foobar-mode :around 'my-foobar-around-advice)
>
> (advice-add 'foobar-mode 
>             :around 'my-foobar-around-advice)
>
> (advice-add 'foobar-mode :around
>  'my-foobar-around-advice)
>
> (add-function :before-until (local 'something)
>               #'some-function)
>
> (add-function where isearch-filter-predicate pred
>               (append (and (or name  ...)
>                            `((name . ...)))
>                       (and ...
>                            (or ...)
>                            (let ((foo  ...))
>                              (unless (or ...)
>                                (setq foo  ))
>                              (and ...)))))

The second, fourth and fifth indentations are the same -- and are the
ones that make the most sense.  And happily, that's the way this indents
today, so I don't think there's anything here to fix, so I'm closing
this bug report.

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




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 24 Oct 2021 18:31:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 51340 <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. (Sun, 24 Oct 2021 18:31: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. (Mon, 22 Nov 2021 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 213 days ago.

Previous Next


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