From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Best (or common) pratices on package development workflow Date: Fri, 2 Jun 2023 07:51:24 +0800 Message-ID: References: Reply-To: Ruijie Yu Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29834"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Lic. Federico G. Stilman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 02 01:52:54 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4s6A-0007ZH-FW for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Jun 2023 01:52:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4s58-0007W2-P9; Thu, 01 Jun 2023 19:51:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4s57-0007Vr-Jf for emacs-devel@gnu.org; Thu, 01 Jun 2023 19:51:49 -0400 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4s55-0003KD-T1 for emacs-devel@gnu.org; Thu, 01 Jun 2023 19:51:49 -0400 Original-Received: from smtpclient.apple ( [112.97.49.77]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 28c889e8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 1 Jun 2023 23:51:44 +0000 (UTC) In-Reply-To: X-Mailer: iPhone Mail (20F66) Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306535 Archived-At: On Jun 2, 2023, at 07:12, Lic. Federico G. Stilman wrot= e: >=20 > =EF=BB=BFHi all, >=20 > 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. >=20 > I am currently writing a simple Emacs package consisting of one .el file. >=20 > I have a couple of defcustom declarations that initialize some > variables with a default value. And this is the source of my question. >=20 > 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: >=20 > (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 v= ariable). See the docstring of C-M-x for details.=20 When for some reason I don=E2=80=99t feel like doing that, I would use eithe= r makunbound or fmakunbound to clear its symbol value or symbol function, th= en load the file again via M-x eval-buffer or the like.=20 > and after that, reload the library with something like >=20 > (load-library "my-package") >=20 > If not, the customization framework doesn't account for the change on > the default value of the custom variables. >=20 > 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? >=20 > 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. >=20 > 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. >=20 > Thank you all, >=20 > Federico >=20