all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: cl-lib warnings
Date: Tue, 27 Dec 2022 14:43:30 +1100	[thread overview]
Message-ID: <86ilhxh4ai.fsf@gmail.com> (raw)
In-Reply-To: <CALDnm53WG-B4j2XpkeVM3_Y5gPO1m48vWpZgbZ4VLNHBtcLmsw@mail.gmail.com>


João Távora <joaotavora@gmail.com> writes:

> On Mon, Dec 26, 2022 at 11:49 PM Milan Glacier <news@milanglacier.com> wrote:
>
>  >I'm afraid mode options will make this even more
>  >complicated.  And what's with that defvar?
>
>  use-package is really a magic. But nobody uses a blank `(use-package
>  foo)`, usually a simple and pracctical use-package call would be
>  something like this:
>
>       (use-package foo
>       :config (setq foo-1 nil)
>       :init (setq foo-2 nil)
>       :hook ((python-mode emacs-lisp-mode) . foo-mode))
>
>  which specifies the code to be evaluated before foo is loaded (:init
>  part), the code to be evaluated after foo is loaded (:config part), and
>  the hook related to this package, which expands to:
>
> My expansion of that same form is larger and harder to read, 
> with condition-case and variables and stuff.  But it would seem 
> that the fluff overhead is constant, which is good.
>
> So I get your point: with enough practice, it's easy to see the
> primitives in use.
>  
>  (I personally am not a fan of use-package, I don't think it brings any
>  thing new. Often I need to expand it to see if its behavior is expected,
>  then why shouldn't I just write plain setq, add-hook stuffs directly?)
>
> Exactly. 
>

I am a fan of use-package. I've been using it for years. I really don't
follow the reasoning of the argument against it on the basis that it
brings nothing new in the sense you can achieve the same result using
existing facilities. This could be argued about many things, especially
when it comes to code and programming. Many 'new' things are really just
further abstractions or alternative abstractions for
features/functionality which already exists. By definition, anything
achieved via a macro could also be done just by using 'existing
primitives'.

I also find the suggestion use package is not good because when you
expand the macro, it will be harder to read than if you had simply
implemented the code directly using existing primitives. This is true of
many macros and I think completely misses the point. In the many years
I've been using use-package, there has been exactly one instance where I
needed to expand the macro to understand what it was doing. Actually, I
didn't need to do it, I did it more out of interest.

What I like about use-package is it has made my init file more concise
and easier to manage and while I could achieve exactly the same outcome
writing a lot of additional elisp myself, I appreciate the fact I don't
have to and I can spend more time focusing on my real work. This is
especially true because much of that additional elisp I would be forced
to write if I didn't have use-package is very much 'boiler plate' code -
boring utility code to add hooks, update mode, interpreter, filename
magic, package installation, key bindings, setq etc. Essentially, I find
use-package does exactly what a useful macros does - it adds some sugar
which helps me avoid having to write boring repetitive code of low interest. 

I am completely neutral regarding the inclusion of use-package into
Emacs core. It is a relatively small package and having it there is
convenient.  However, having to install it from ELPA was trivial and
convenient as well. Having it as part of Emacs core has made no
significant difference for me - perhaps my init file is now 2 lines
smaller. I do admit not really understanding the need many seem to have
regarding getting stuff into 'core'. 



  reply	other threads:[~2022-12-27  3:43 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 20:12 bug#60102: Move gv-expander of substring to cl-lib Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-16  6:56 ` Eli Zaretskii
2022-12-16 14:14   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 20:00     ` Stefan Kangas
2023-09-04 20:43       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-16  7:22 ` Juri Linkov
2022-12-20 18:42   ` cl-lib warnings (was: bug#60102: Move gv-expander of substring to cl-lib) Stefan Monnier
2022-12-21  8:37     ` cl-lib warnings Juri Linkov
2022-12-21 12:45       ` Eli Zaretskii
2022-12-21 12:57         ` João Távora
2022-12-21 13:47           ` Eli Zaretskii
2022-12-21 14:04             ` João Távora
2022-12-21 14:20               ` Eli Zaretskii
2022-12-21 14:35                 ` João Távora
2022-12-21 14:50                 ` Juanma Barranquero
2022-12-21 14:55                   ` João Távora
2022-12-21 14:57                     ` Juanma Barranquero
2022-12-21 15:08                       ` João Távora
2022-12-26  3:13                         ` Milan Glacier
2022-12-26 15:10                           ` João Távora
2022-12-26 23:48                             ` Milan Glacier
2022-12-27  0:05                               ` João Távora
2022-12-27  3:43                                 ` Tim Cross [this message]
2022-12-27 10:16                                   ` Lynn Winebarger
2022-12-27 13:00                                 ` Stefan Kangas
2022-12-21 17:14                   ` Eli Zaretskii
2022-12-21 22:33                     ` Juanma Barranquero
2022-12-22  7:13                       ` Eli Zaretskii
2022-12-22  7:23                         ` Juanma Barranquero
2022-12-22  8:53                           ` Eli Zaretskii
2022-12-22 22:24                         ` Yuan Fu
2022-12-22 23:56                           ` Stefan Monnier
2022-12-23  7:30                           ` Eli Zaretskii
2022-12-23 23:42                             ` Yuan Fu
2022-12-24  0:24                               ` Juanma Barranquero
2022-12-24 14:08                                 ` Stefan Monnier
2022-12-24 14:39                                   ` Juanma Barranquero
2022-12-24 19:13                                     ` Tomas Hlavaty
2022-12-24  0:26                               ` João Távora
2022-12-24 10:33                                 ` Philip Kaludercic
2022-12-24 11:01                                   ` João Távora
2022-12-26  0:11                                     ` cl-loop and plists vs alists Philip Kaludercic
2022-12-26  0:35                                       ` João Távora
2022-12-26 21:06                                         ` Bob Rogers
2022-12-24 22:59                                 ` cl-lib warnings Sean Whitton
2022-12-25  1:21                                   ` Stefan Monnier
2022-12-25  2:39                                     ` package-initialize was " T.V Raman
2022-12-25  4:11                                       ` T.V Raman
2022-12-26  0:01                                       ` Stefan Monnier
2022-12-26  2:18                                         ` T.V Raman
2022-12-25  7:02                                     ` tomas
2022-12-25  9:55                                       ` João Távora
2022-12-25 11:33                                         ` tomas
2022-12-26  4:47                                     ` Sean Whitton
2022-12-24  6:40                               ` Eli Zaretskii
2022-12-24 13:01                                 ` Dmitry Gutov
2023-01-06  5:40                   ` Sean Whitton
2023-01-06  7:34                     ` Eli Zaretskii
2023-01-06 17:58                       ` Sean Whitton
2023-01-06 18:14                         ` Eli Zaretskii
2023-01-06 19:03                           ` Sean Whitton
2023-01-06 19:45                             ` Eli Zaretskii
2022-12-21 14:15             ` Eli Zaretskii
2022-12-21 17:53         ` Stefan Monnier
2022-12-24 22:55           ` Sean Whitton
2022-12-25  7:05             ` tomas
2022-12-25  8:29           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ilhxh4ai.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.