unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51340: 27.2; Bad indentation and fontification of advice functions
@ 2021-10-22 21:53 Drew Adams
  2021-10-23  0:15 ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2021-10-22 21:53 UTC (permalink / raw)
  To: 51340

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)






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

* bug#51340: 27.2; Bad indentation and fontification of advice functions
  2021-10-22 21:53 bug#51340: 27.2; Bad indentation and fontification of advice functions Drew Adams
@ 2021-10-23  0:15 ` Stefan Kangas
  2021-10-23 16:08   ` bug#51340: [External] : " Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2021-10-23  0:15 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51340

Drew Adams <drew.adams@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.





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

* bug#51340: [External] : Re: bug#51340: 27.2; Bad indentation and fontification of advice functions
  2021-10-23  0:15 ` Stefan Kangas
@ 2021-10-23 16:08   ` Drew Adams
  2021-10-24 18:29     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2021-10-23 16:08 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 51340@debbugs.gnu.org

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

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

* bug#51340: 27.2; Bad indentation and fontification of advice functions
  2021-10-23 16:08   ` bug#51340: [External] : " Drew Adams
@ 2021-10-24 18:29     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-24 18:29 UTC (permalink / raw)
  To: Drew Adams; +Cc: 51340@debbugs.gnu.org, Stefan Kangas

Drew Adams <drew.adams@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





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

end of thread, other threads:[~2021-10-24 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 21:53 bug#51340: 27.2; Bad indentation and fontification of advice functions Drew Adams
2021-10-23  0:15 ` Stefan Kangas
2021-10-23 16:08   ` bug#51340: [External] : " Drew Adams
2021-10-24 18:29     ` Lars Ingebrigtsen

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