it's true that #usepackage is macro , now builtin with #emacs
but if you treat it as domain , you can write a macro to extract all keywords it has and expands to standard use-package x config for may packages customised with it , kinda sorta domain specific macros , you won't be changin runtime behaviour so long as
- your original logic is not stateful
- it's indeed a side-effectful imperative action and not a static declaration.
side note
- one can also write
- helpers, returning closures capturing command strings and buffers.
- encapsulate the common rt behavior with higher order function in lisp for DRY pattern
- inject shared pre-flight checks (like verifying current project existence) ensures uniform runtime safety without code repetition

It can be something like 1/2

The only documentation I can find about using the `:custom` keyword with use-package is "The :custom keyword allows customization of package custom variables."

I have no idea how to read that.

1. Can I do (recent-mode t)?
2. If I am to set a config option like dired-dwim-target to t do I write that: (dired-dwim-target t) or (setq dired-dwim-target t)?

#Emacs #UsePackage

#irreal and @bbatsov about #Emacs startup time: https://irreal.org/blog/?p=12903

I, too, am totally convinced that it really doesn't matter if it is one or sixty seconds.

However, if your bootup time is much longer than mine (15-30s once a week) then you most probably have room for improvement (if you want). Consistent use of #usepackage with dependencies and "defer" did help on my side.

My config has 7724 lines of #elisp (19851 including #orgmode comments): https://github.com/novoid/dot-emacs/blob/master/config.org

Emacs Startup Time | Irreal

#usepackage is glorified
```
(progn
;; do stuff
)
```

If you describe how to install with #elpaca , #straight , #doomemacs and #nix-flake. Then you can go the extra mile to show the #usepackage method too, just because it's really nice to be helpful to those who don't share your special ecosystem.
Not all are fluent in #elisp.

This sounds a little more angry than intended, please use your standard internet forum filter glasses. 🕶️

#emacs

I've been using Emacs 29 for a few days and am starting to love it:
- the startup time feels hugely smaller than with Emacs 28;
- reading the NEWS file (`C-h N') made me discover the fantastic “use-package” library (a “framework” allowing one to use declarative style to organize and optimize the Emacs initialization file).

“use-package” library on GitHub: https://github.com/jwiegley/use-package

Its user manual: https://elpa.gnu.org/packages//doc/use-package.html#Basic-Concepts

#Emacs #usepackage

GitHub - jwiegley/use-package: A use-package declaration for simplifying your .emacs

A use-package declaration for simplifying your .emacs - jwiegley/use-package

GitHub

I use emacs as my editor and have it configured to delete all trailing whitespace in a file, including any trailing newlines at the end, before saving it. The configuration snippet that I have in my emacs configuration file to do this is

(add-hook 'before-save-hook 'delete-trailing-whitespace)

While this is very convenient and works as expected, it becomes a hindrance in specific cases – the Jinja2 templating language deletes a single trailing newline, thereby leaving the rendered templates without a newline at the end.

One way to work around this behaviour is to add 2 trailing newlines in the jinja2 template files. But unfortunately, due to my emacs configuration that deletes all trailing whitespace, this doesn’t work. So I started reading the documentation for the delete-trailing-whitespace function and found out about the delete-trailing-newlines variable (default: t). This variable controls whether the trailing newline characters at the end of a file are deleted or not. So I wanted to try overriding the delete-trailing-newlines variable to be false in jinja2-mode, that I use for editing Jinja2 templates.

With some help from the excellent folks in the #emacs IRC channel on Libera Chat, I was able to come up with the following configuration, that works as expected.

(use-package jinja2-mode :pin nongnu :hook (jinja2-mode . (lambda () (setq-local delete-trailing-lines nil))) :mode "\\.j2\\'")

Note that I use the excellent use-package macro to install the jinja2-mode and configure it appropriately. If you don’t use use-package, this can be done using the add-hook function.

#emacs #jinja2 #trailing-newlines #trailing-whitespace #use-package

https://www.lguruprasad.in/blog/2023/06/12/automatically-delete-the-trailing-whitespace-on-save-in-emacs-while-excluding-the-trailing-newlines/

GNU Emacs - GNU Project

It was fun when rewriting my #Emacs configuration with #SetupEl (https://git.sr.ht/~pkal/setup), which offered a much easier way to define custom keywords, compared with other configuration managers( #UsePackage, #Leaf) 🥹
~pkal/setup - A helpful configuration macro for Emacs - sourcehut git

Can I tell Emacs and/or use-package to activate a package when I launched Emacs from a directory ?

I thought about

(when (string= "~/Workspace/" default-directory)
...)

But… no haha

(for the record: I don't want to write a passphrase anytime org-mode is enabled in a buffer)

#emacs #usepackage #emacslisp

Intro til LaTeX

Vi starter med det enkleste dokumentet en kan lage i LaTeX med en tekst om en ny og spennede elektrisk bil tatt i fra Teknisk Ukeblad fra noen år tilbake.

https://aslakr.folk.ntnu.no/2008/02/intro-til-latex/