From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alessandro Bertulli Newsgroups: gmane.emacs.help Subject: Re: How to develop a local fork of a package? Date: Mon, 05 Sep 2022 00:20:01 +0200 Message-ID: <87bkruhit7.fsf@gmail.com> References: <87k06kk8od.fsf@gmail.com> <87r10s8u79.fsf@dataswamp.org> <87tu5nkgf3.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19508"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.9; emacs 29.0.50 Cc: help-gnu-emacs@gnu.org To: Akib Azmain Turja Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 05 00:33:27 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1oUyBD-0004rf-99 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Sep 2022 00:33:27 +0200 Original-Received: from localhost ([::1]:42254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUyBA-0001ou-ST for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 04 Sep 2022 18:33:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUyAV-0001le-68 for help-gnu-emacs@gnu.org; Sun, 04 Sep 2022 18:32:43 -0400 Original-Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:36516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUyAT-0004S8-Ae for help-gnu-emacs@gnu.org; Sun, 04 Sep 2022 18:32:42 -0400 Original-Received: by mail-ej1-x62b.google.com with SMTP id fc24so4711393ejc.3 for ; Sun, 04 Sep 2022 15:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date; bh=Xl9MIZGZ8+9UGCSHKxyyS8tDQKlu6eeQpN1H1iDmGA0=; b=ezlwfOubjcJHnvMVxlnh5cJFY2wVRMRhUI/WPbyHUsKvzxR2pm4bQs6NIGwBXme8Xz xS4U/CJo6crJ235lKFwEDiQNtX7IQlkCWKy2YJG6BgCtGpRBYiH8F8/SghLU8bHqi+Bs vo02iNTbAXj/MsOqbI4tWKPH5Od45GMPYz5Z0gBnQSSyDlsk/SiTY5xu9UbOPdSfpt+M QyS1vMAiN3fpjzazC+X/IPLV1K2TBTxpF1GOrgEdLAeW04YorlOX7ubUOHgXw791MQCk BnfdgxeWDOrnyuPdtgu/zaYcmSNHHklImg9zVBS+djYqT/5qwgSBrMQgQhHVjXZgnQFo pIkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date; bh=Xl9MIZGZ8+9UGCSHKxyyS8tDQKlu6eeQpN1H1iDmGA0=; b=vI2i/zmbqddhZqrGb8R/W9Yh6FeExvZV4PH1sqhpNUE/YDUg14JGVL2jicKVlvIsM8 e1T6HlQ8m/4Cz7QKsUAmzNjSXnrpYQz7I9DwUwnzaNNMEpbDkXc1Lq9+Xy4iI4LEAQFn iKltOc0xUSXoCa1PSx8ewWAvQw4esGHY1O4UZT2EsuSmSyzi2jXbzBxd/m86FGtZ5mCp mEqpxSMfLdIkr45fk9aFIzbqXdnvgRuPBFgQbkf+ZM3IFe5pxnwPGKXhJczuLcUClShd bEBTVMsffi+Idrq/JfMAdSRiDQqTRnNvOPhTVc5uf5X5TriWgj1N0zI1f+GjyIzKDxRP aU6w== X-Gm-Message-State: ACgBeo3z3J/jmL6iJYgrVZp3N3s1hMHprF4P8mhztYQFLj514itkKKtb umCv2xI2PUR+z/Ld0eebu2667szeUmQ= X-Google-Smtp-Source: AA6agR5gi5rgMQF1z5E5egQqiEIkl2x4HMAoYtqDYodp+8J8ia3/YKQtQer/XU9rw/Pf0fbf8THdjA== X-Received: by 2002:a17:906:5a68:b0:73d:d354:f2c8 with SMTP id my40-20020a1709065a6800b0073dd354f2c8mr34125254ejc.509.1662330757276; Sun, 04 Sep 2022 15:32:37 -0700 (PDT) Original-Received: from commodoroII (2-235-154-9.ip228.fastwebnet.it. [2.235.154.9]) by smtp.gmail.com with ESMTPSA id lc18-20020a170906dff200b007307c4c8a5dsm4207987ejc.58.2022.09.04.15.32.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 15:32:36 -0700 (PDT) In-reply-to: <87tu5nkgf3.fsf@disroot.org> Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alessandro.bertulli96@gmail.com; helo=mail-ej1-x62b.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139241 Archived-At: Akib Azmain Turja writes: >> Alessandro Bertulli wrote: >> >>> (add-to-list 'load-path (expand-file-name "git_packages/org-ref/")) > > (expand-file-name "git_packages/org-ref/")? Relative to what? If the > directory is in your ".emacs.d", then it should be (add-to-list > 'load-path (expand-file-name "git_packages/org-ref/" > user-emacs-directory)). Yes, but if not specified the user-emacs-directory is the default, so I don't think that's a problem (will try tho, just in case). >>> (delete "/home/alessandro/.emacs.d/elpa/org-ref-20220830.1210" load-path) >>> (package-initialize) > > Why? This would break whenever package.el updates org-ref. Yes, it was just an hack to try with the current package. > And this won't ever work because that directory is not in load-path > before (package-initialize), and after (package-initialize) org-ref > will be on load-path. You're right, I didn't know the functioning of package-initialize. I'll try and let you know. > Your best option is to delete the package with M-x package-delete. Aren't there any other methods? Like, if you want to make a PR, do you uninstall the package every time? > And the "delete" call may not work. You set load-path to the return > value of "delete", for example: > > (setq load-path > (delete "/home/alessandro/.emacs.d/elpa/org-ref-20220830.1210" > load-path)) Well, it works for me actually. Also, delete uses side effects, if I wanted to use setq, I should use remove, right? >>> >>> But then, no matter which one of these I use >>> >>> (require 'org-ref) > > Unless org-ref is in load-path, this will always error. I suspect this is given by my wrong usage of package-initialize. >>> (load "~/.emacs.d/git_packages/org-ref/org-ref") > > Where is the ".el" suffix? Did you mean (load > "~/.emacs.d/git_packages/org-ref/org-ref.el")? Wait, shouldn't I omit the suffix on purpose? Looking at the docstring of load: "First try FILE with .elc appended, then try with .el". > Loading directly will probably work for single file packages, but you > should always add the package directory to load-path. Aside from the directory part, that file is the one containing the (provide 'org-ref) call. Shouldn't loading that achieve the same result of the (require 'org-ref) I normally use? Since the other code files are loaded inside it. >>> (use-package org-ref >>> :ensure nil >>> :load-path "~/.emacs.d/git_packages/org-ref/org-ref.el") > > I think the error is because you specify a file as load-path instead of > a directory. I think the load-path should be probably > "~/.emacs.d/git_packages/org-ref/". However, I have never used > :load-path keyword of use-package, so my assumptions may be wrong. If the above doesn't work, I'll try and I'll let you know. Thanks! Alessandro