HowTo: Upgrade org-mode installation from the command-line

2024-05-03 Thread Samuel Wales
never mind.  package-initilalize if called in .emacs once will not repeat
or warn despite being not needed there normally.  at least in 27.



-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


RE: HowTo: Upgrade org-mode installation from the command-line

2024-05-03 Thread Ihor Radchenko
"Cook, Malcolm"  writes:

>>May you prepare a patch modifying doc/org-manual.org with your suggestions?
>>See https://orgmode.org/worg/org-contribute.html
>
> Glad to try.  How's this?

Thanks!
Applied, onto main, with modifications.
I merged your new section into previous section explaining how to
install Org mode using package.el. I compressed the explanations to be
more in flow with the previous section and removed bash-specific code,
leaving an one-liner that has more chances to work with arbitrary
shells. I also added a TINYCHANGE cookie as you do not seem to have FSF
copyright assignment.

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=09520a056

You are also listed as one of Org mode contributors now.
https://git.sr.ht/~bzg/worg/commit/d1d32137

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: HowTo: Upgrade org-mode installation from the command-line

2024-05-02 Thread Samuel Wales
On Sunday, April 28, 2024, Ihor Radchenko  wrote:

> > Note: For the upgraded version to be loaded by emacs, you mush place
> > `package-initialize` early in your init.el.  Failure to do so will
> > result in the old system version to be loaded, as can be seen:
>
> This is only true when running emacs -Q or emacs -q.
> For normal emacs invocation, since Emacs 27, by default, Emacs calls
> (package-initialize) automatically on startup.
>
> strangely in my 27, help on package-initialize does not say explicitly
whether it is called automatically.

it says "If ‘package-initialize’ is called twice during Emacs startup,
signal a warning, since this is a bad idea except in highly
advanced use cases.  To suppress the warning, remove the
superfluous call to ‘package-initialize’ from your init-file.  If
you have code which must run before ‘package-initialize’, put
that code in the early init-file."

i ran package-initialize in my .emacs and checked c-h e and did not find a
warning.  however, without running it, it still seems to have been run.



-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com


RE: HowTo: Upgrade org-mode installation from the command-line

2024-05-02 Thread Cook, Malcolm
>"Cook, Malcolm"  writes:
>
>> The section on org-mode 
>> [[https://orgmode.org/org.html#Installation][Installation]] entitled "Using 
>> Emacs packaging
>> system" might be improved with the following advice:
>
>Thanks!
>
>> Note: For the upgraded version to be loaded by emacs, you mush place
>> `package-initialize` early in your init.el. Failure to do so will
>> result in the old system version to be loaded, as can be seen:
>
>This is only true when running emacs -Q or emacs -q.
>For normal emacs invocation, since Emacs 27, by default, Emacs calls
>(package-initialize) automatically on startup.
>
>> Note further that if the above upgrade command was done in an emacs
>> shell buffer, you will need to restart emacs to pick up the updated
>> package. Failing to do so will result in `meta-x org-version`
>> reporting the old version:
>>
>> #+begin_src src
>> Org mode version 9.6.15 (release_9.6.15 @ 
>> /usr/local/share/emacs/30.0.50/lisp/org/)
>> #+end_src
>>
>> but after restart with my init.el file it reports:
>>
>> #+begin_src src
>> Org mode version 9.6.27 ( @ 
>> /home/mec/.dotfiles/emacs/.emacs.d/elpa/org-9.6.27/)
>> #+end_src
>
>Examples are probably a bit too much for the manual.
>It should be sufficient to ask to restart existing Emacs sessions, if
>any.
>
>May you prepare a patch modifying doc/org-manual.org with your suggestions?
>See https://orgmode.org/worg/org-contribute.html

Glad to try.  How's this?




0001-doc-command-line-upgrade.patch
Description: 0001-doc-command-line-upgrade.patch


Re: HowTo: Upgrade org-mode installation from the command-line

2024-04-28 Thread Ihor Radchenko
"Cook, Malcolm"  writes:

> The section on org-mode 
> [[https://orgmode.org/org.html#Installation][Installation]] entitled "Using 
> Emacs packaging
> system" might be improved with the following advice:

Thanks!

> Note: For the upgraded version to be loaded by emacs, you mush place
> `package-initialize` early in your init.el.  Failure to do so will
> result in the old system version to be loaded, as can be seen:

This is only true when running emacs -Q or emacs -q.
For normal emacs invocation, since Emacs 27, by default, Emacs calls
(package-initialize) automatically on startup.

> Note further that if the above upgrade command was done in an emacs
> shell buffer, you will need to restart emacs to pick up the updated
> package.  Failing to do so will result in `meta-x org-version`
> reporting the old version:
>
> #+begin_src src
> Org mode version 9.6.15 (release_9.6.15 @ 
> /usr/local/share/emacs/30.0.50/lisp/org/)
> #+end_src
>
> but after restart with my init.el file it reports:
>
> #+begin_src src
> Org mode version 9.6.27 ( @ 
> /home/mec/.dotfiles/emacs/.emacs.d/elpa/org-9.6.27/)
> #+end_src

Examples are probably a bit too much for the manual.
It should be sufficient to ask to restart existing Emacs sessions, if
any.

May you prepare a patch modifying doc/org-manual.org with your suggestions?
See https://orgmode.org/worg/org-contribute.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



HowTo: Upgrade org-mode installation from the command-line

2024-04-26 Thread Cook, Malcolm
The section on org-mode 
[[https://orgmode.org/org.html#Installation][Installation]] entitled "Using 
Emacs packaging
system" might be improved with the following advice:

** Upgrade org-mode installation from the command-line

The Emacs packaging system can be used to upgrade an org-mode
installation from linux command-line by running emacs in batch mode:

#+begin_src sh
EMACS=emacs # /usr/local/bin/emacs
EMACSQBE=${EMACS} -Q -batch -eval
${EMACSQBE} "(progn (require 'package) (package-initialize) 
(package-refresh-contents) (package-upgrade 'org))"
#+end_src

This approach has the advantage of isolating the upgrade process for
any other running emacs session, ensuring that version conflicts can
not arise.

Note: For the upgraded version to be loaded by emacs, you mush place
`package-initialize` early in your init.el.  Failure to do so will
result in the old system version to be loaded, as can be seen:

#+begin_src sh :results output
${EMACSQBE} "(progn   (print (org-version 'org)))"
${EMACSQBE} "(progn  (package-initialize) (print (org-version 'org)))"
#+end_src

#+RESULTS:
: 
: "9.6.15"
: 
: "9.6.27"


Note further that if the above upgrade command was done in an emacs
shell buffer, you will need to restart emacs to pick up the updated
package.  Failing to do so will result in `meta-x org-version`
reporting the old version:

#+begin_src src
Org mode version 9.6.15 (release_9.6.15 @ 
/usr/local/share/emacs/30.0.50/lisp/org/)
#+end_src

but after restart with my init.el file it reports:

#+begin_src src
Org mode version 9.6.27 ( @ /home/mec/.dotfiles/emacs/.emacs.d/elpa/org-9.6.27/)
#+end_src