From: Ruijie Yu via "Emacs development discussions." <emacs-devel@gnu.org>
To: "Lic. Federico G. Stilman" <fstilman@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Best (or common) pratices on package development workflow
Date: Fri, 2 Jun 2023 07:51:24 +0800 [thread overview]
Message-ID: <D0365DEF-05AA-4AA8-8744-0A02CE969A7D@netyu.xyz> (raw)
In-Reply-To: <CAL4zx3O+_WGh5vWUzwUKWGoK1088TCVYamUERKt4J4M9xVuC0A@mail.gmail.com>
On Jun 2, 2023, at 07:12, Lic. Federico G. Stilman <fstilman@gmail.com> wrote:
>
> Hi all,
>
> First things first. I started development with Emacs Lisp a few weeks
> ago after using for more than 20 years Emacs for my daily work. So I
> am a newbie on the Emacs Lisp development side.
>
> I am currently writing a simple Emacs package consisting of one .el file.
>
> I have a couple of defcustom declarations that initialize some
> variables with a default value. And this is the source of my question.
>
> Every time I make a change to the init value of the defcustom
> declaration, I have to unload the feature provided by the package,
> with something like:
>
> (unload-feature 'my-package)
for defcustom, defun, defvar, etc, you can use C-M-x when you are inside the corresponding s-exp to evaluate it (and reset the initial value if it is a variable). See the docstring of C-M-x for details.
When for some reason I don’t feel like doing that, I would use either makunbound or fmakunbound to clear its symbol value or symbol function, then load the file again via M-x eval-buffer or the like.
> and after that, reload the library with something like
>
> (load-library "my-package")
>
> If not, the customization framework doesn't account for the change on
> the default value of the custom variables.
>
> My question is: which is the workflow you use when developing a
> package for Emacs, for easily "reloading" the package for any kind of
> changes by taken into account?
>
> Re-evaluating the entire, or loading the file, works for reloading
> functions. But - as far as I know - does not work for reloading
> defcustom initialization values.
>
> My package is for now something very simple consisting of one .el
> file. I wonder how do you manage this when a package consists of many
> .el files.
>
> Thank you all,
>
> Federico
>
next prev parent reply other threads:[~2023-06-01 23:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 23:11 Best (or common) pratices on package development workflow Lic. Federico G. Stilman
2023-06-01 23:51 ` Ruijie Yu via Emacs development discussions. [this message]
2023-06-02 1:08 ` Lic. Federico G. Stilman
2023-06-01 23:56 ` Michael Heerdegen
2023-06-02 1:09 ` Lic. Federico G. Stilman
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=D0365DEF-05AA-4AA8-8744-0A02CE969A7D@netyu.xyz \
--to=emacs-devel@gnu.org \
--cc=fstilman@gmail.com \
--cc=ruijie@netyu.xyz \
/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.