emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Cook, Malcolm" <MEC@stowers.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: RE: HowTo: Upgrade org-mode installation from the command-line
Date: Thu, 2 May 2024 20:46:58 +0000	[thread overview]
Message-ID: <DS7PR20MB467109F806AFE964CFCA466FBE182@DS7PR20MB4671.namprd20.prod.outlook.com> (raw)
In-Reply-To: <874jblk4z9.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

>"Cook, Malcolm" <mailto:MEC@stowers.org> 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?



[-- Attachment #2: 0001-doc-command-line-upgrade.patch --]
[-- Type: application/octet-stream, Size: 1361 bytes --]

From 02d85bf632e808a54bbd6d06516d484a40587e7c Mon Sep 17 00:00:00 2001
From: "Cook, Malcolm" <MEC@stowers.org>
Date: Thu, 2 May 2024 15:43:05 -0500
Subject: [PATCH] doc-command-line-upgrade

---
 doc/org-manual.org | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index d66d95a22..365017d3b 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -119,6 +119,23 @@ You need to do this in a session where no =.org= file has been
 visited, i.e., where no Org built-in function have been loaded.
 Otherwise autoload Org functions will mess up the installation.
 #+end_quote
+*** Upgrading installed org-mode using Emacs packaging system from the command-line
+:PROPERTIES:
+:CUSTOM_ID: notoc
+:END:
+
+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 # you may prefer to be more specific - e.g. /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 from
+a running emacs session, ensuring that version conflicts can not
+arise.
 
 *** Using Org's git repository
 :PROPERTIES:
-- 
2.39.3


  reply	other threads:[~2024-05-02 20:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 19:50 HowTo: Upgrade org-mode installation from the command-line Cook, Malcolm
2024-04-28 13:10 ` Ihor Radchenko
2024-05-02 20:46   ` Cook, Malcolm [this message]
2024-05-03 12:28     ` Ihor Radchenko
2024-05-03  5:37   ` Samuel Wales
2024-05-04  1:14     ` Samuel Wales

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DS7PR20MB467109F806AFE964CFCA466FBE182@DS7PR20MB4671.namprd20.prod.outlook.com \
    --to=mec@stowers.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).