[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Unable to get current or via use-package

From: Cook, Malcolm
Subject: RE: Unable to get current or via use-package
Date: Thu, 10 Feb 2022 15:19:19 +0000

Hi Loris,

> > I tend to use the org-mode from the package manager, but do not do it 
> > interactively from within emacs. Instead, which when I want to refresh org, 
> > I do from the command line:
> >
> > emacs -Q -batch -eval "(progn (require 'package) (package-initialize) 
> > (package-refresh-contents) (package-install 'org))"
> Is that necessary? Can't I just use the package manager to update Org
> along with any other packages? Or does the issue about not visiting and
> .org file before installing via the package manager apply to updates
> too?

AFAIK, what is necessary (though for reasons somewhat beyond my ken) is that 
org updates be installed in an environment in which no version of org has been 
loaded.  You need some approach to ensure that.  This is one such.  Agreed it 
is heavy handed, but it suffices the need.  I wish I could express the order 
dependencies in a reliable fashion with `use-package`.

It *might* be the case that execution of the following snippet early enough in 
your init file is enough for `use-package` to "get it right"(tm).  If you try 
this, let us know the outcome.

> > Also, early in my init.el, as extra level of precaution against getting the 
> > built-in org-mode, I ensure it never gets loaded:
> > (require 'cl-seq) (delete (car (cl-member "lisp/org" load-path :test 
> > #'string-match)) load-path)
> Interesting, although I would generally want at least some version of
> Org even if a more recent version is installed but somehow broken.

If you can code that logic in lisp, you can conditionally execute the provided 


But I get your point.  In my case, sometimes I want to run with a git pull from 
head of org repos rather than a package install.  At such times I wind up 
editing my init file and use the `use-package`'s :load-path and :pin directives:

   :pin manual 
   :load-path "~/.emacs.d/org-mode/lisp"
  ;; which was installed with: `cd ~/emacs.d && git clone 
https://git.savannah.gnu.org/git/emacs/org-mode.git &&   cd org-mode && make 
autoloads && make` 
  ;; and can be updated with: `cd ~/emacs.d/org-mode && git pull && make 
autoloads && make`

Point being that I have found that expressing the logic  to cover every use 
case requires me to edit my init.el and interact with the command line "out of 
band", as it were.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]