From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OdPIICfrdGFFEwEAgWs5BA (envelope-from ) for ; Sun, 24 Oct 2021 07:12:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UKruGyfrdGH8KAAA1q6Kng (envelope-from ) for ; Sun, 24 Oct 2021 05:12:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 31A80292FB for ; Sun, 24 Oct 2021 07:12:06 +0200 (CEST) Received: from localhost ([::1]:54662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meVng-00066k-Ti for larch@yhetil.org; Sun, 24 Oct 2021 01:12:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meVn3-00065a-FY for emacs-orgmode@gnu.org; Sun, 24 Oct 2021 01:11:25 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:42875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meVn1-0004Am-IO for emacs-orgmode@gnu.org; Sun, 24 Oct 2021 01:11:25 -0400 Received: by mail-pl1-x629.google.com with SMTP id v16so239849ple.9 for ; Sat, 23 Oct 2021 22:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=S1H/GL+dpzLhwprpZUqKUa5yk0iTMXz1NMNxGPz1CFc=; b=R3RWmU8VBALMj/MH93g8K0HPtFni3PlEDvmMRAdeA5inQpXUlVP+BDlaJIGPnyXscs 7d/2P3O5kTDJKOyWJkbI/jhPCi3waUJ6cNF3xLgkztrUcQiF7YgOkSVG6REuri8vq7B1 kyF2s6XdIdGB7LAuloebGYHlE+9xtjukqweU4TNONzW+a0k7WZD6YdIteQINvy0AVFjd XSVzjrXpKIvzzjYQ0i7TY2ZaqNPt4WUoTLE0XO9VQvPWeIDqx5pWV+/ufMCpoxi4jnox ZLzB/ZzM2t9ymQ8nSJVgsc9QGdeCqlkWvw+xIEYjIF6F9jIf0iWqvE4CyfbXzMFjTzoA iRkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=S1H/GL+dpzLhwprpZUqKUa5yk0iTMXz1NMNxGPz1CFc=; b=HPwu1vUMxEO3DVdpLlMHxY+2lfS6FuUn/+sypkP8OqB/M7hRfjmWdpSJvT1QkZ5paC lPmCfQr+H3nom1S1FvydhoweLmvg124HwstRw7fafKW2Ue3pL2BgZ08Uupw49Yg84qVG wTPPCh6EEAJflj7XpSnc87s3AgdcZLW4/Kl4nhypiZamw4amkIF7vGeBgYbwTxg6QvSC FszOnibPNMFtiKWSwBebEiuX2XvkH8Ef6YAzbaawPXPn5PCsLJAbrx7MXiq22PgoQBKJ wK3TuDbnRW7Jys6oxvt2563T3X4SWzN7hMMmBEerXYGZeYL0ADvKP7Lzb8IGo5ibzbMq I+EQ== X-Gm-Message-State: AOAM531zly/1eOUpzeDVOHjP1FvSFkZAbHSzn1HyN7NfWbZ1d4wstI6T fADYolD0UTJyWP61c96MNyM= X-Google-Smtp-Source: ABdhPJzIDEJ+HMMU9pSvTEV4/ZvCbTK9XirrycL3yTfaeBvRbl+BS1LI/v8WRA/JCWlmodIZt7pcjw== X-Received: by 2002:a17:90a:5642:: with SMTP id d2mr26054539pji.200.1635052282101; Sat, 23 Oct 2021 22:11:22 -0700 (PDT) Received: from localhost ([103.125.234.210]) by smtp.gmail.com with ESMTPSA id z1sm15166647pfh.150.2021.10.23.22.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Oct 2021 22:11:21 -0700 (PDT) From: Ihor Radchenko To: Tim Cross Subject: [PATCH] Re: Fwd: errors when using org-agenda In-Reply-To: References: <733d6598-0efd-519d-ba13-08d127256b87@gmail.com> <3dd9032d-c18e-47ec-a26d-a3c2f1e3cbf7@gmail.com> <1366768.1634984772@apollo2.minshall.org> Date: Sun, 24 Oct 2021 13:12:47 +0800 Message-ID: <87lf2jdn00.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=yantar92@gmail.com; helo=mail-pl1-x629.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Minshall , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635052326; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=S1H/GL+dpzLhwprpZUqKUa5yk0iTMXz1NMNxGPz1CFc=; b=OUaIYAI0ki+MV9xXlyKgiu52YRyI6jZqG3M7hjkf7Q6Um3ewYzyl7YJdra07pH6CStLiox SV4KOlQ6WvQqJdeO1Fug8f7ZmHmYSmwOND9wONDrikWi6M/9Ht70ggecasEMTrpUlufWHL hk8e99rwTbN013duiA8cHKsY/3YHoga164NwdyA01kp5FDVRgxz0jk93wRg/m25Qi5tanX THH37+p2MoTvY4ENjyQn4WUB4Ca4lWiWxOLKwH28aoTDVxnigllPi5w4GLNjV6RwVnhnwS n4a2Ewij5nsbUes++DVhUHYlXVZd7J/xi17k2ujujrRkS7dmfK/GY0OmbvhQSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635052326; a=rsa-sha256; cv=none; b=ZVX+hugGvbslegovG+k1sdXtdzGtswlfoIXycIhUzTI6T3qdy9AYkwqjwmpG5hdP+nENta lGusQHxtM0cexgpU2+zgTvxMRa4zwr1M9kPSfMsE48R93DylHnpz4JC0EXzpGZMe4jVz9E GCtI4ScqtauKqXIWioEbOXChk/5QVRFDHmbV7fd4k7p2yzRVdOe/bRHl4/6BlzKN4iLkGt MhNmxBLrVJLV7l0QOEDBHM357m/ygVOTJlHGrOMMbgmCCmLofj8JQEezkAwAmkYb/fMSmL pa8bFUv+6ocp3Y0azbFxN8KyrhR3HEk6N4yEdX0R1k4f4NQxoyM7K4vkrAFXuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=R3RWmU8V; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=R3RWmU8V; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 31A80292FB X-Spam-Score: -2.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: UhJdTsvdTXTW --=-=-= Content-Type: text/plain Tim Cross writes: > What would really be needed is some way to check when org is going to be > compiled that no existing org functionality is loaded. Doubt this can be > easily done within org itself because of a chicken and egg problem - you > would have to load org to run the code to check if org is loaded. I attached a tentative patch checking if org is loaded. It is not ideal, but it can capture some scenarios. The patch will not work if older org.el is loaded before newer version of Org. Though we may put extra checks in other lisp files. WDYT? Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org.el-Check-for-mixed-installation.patch >From 2e987d60e47da0a7da8ded32bc5c2cc6bf11db04 Mon Sep 17 00:00:00 2001 Message-Id: <2e987d60e47da0a7da8ded32bc5c2cc6bf11db04.1635052126.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sun, 24 Oct 2021 13:06:47 +0800 Subject: [PATCH] org.el: Check for mixed installation * lisp/org.el (org-check-mixed-installation): New macro checking all the loaded org libraries to be from the same directory and to have the same extension (no mixing of .el and .elc). (org-mode): Call `org-check-mixed-installation' before and after `org-mode' loading. --- lisp/org.el | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 90c645625..0d009ccb5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -90,6 +90,55 @@ (or (eq this-command 'eval-buffer) (message "You need to run \"make\" or \"make autoloads\" from Org lisp directory") (sit-for 3)))) +(defmacro org-check-mixed-installation () + "Detect mixed installation." + `(let* ((org-feature-list '( ob-C ob-R ob-awk ob-clojure ob-comint + ob-core ob-css ob-ditaa ob-dot ob-emacs-lisp + ob-eshell ob-eval ob-exp ob-forth ob-fortran + ob-gnuplot ob-groovy ob-haskell ob-java + ob-js ob-julia ob-latex ob-lilypond + ob-lisp ob-lob ob-lua ob-makefile + ob-matlab ob-maxima ob-ocaml ob-octave + ob-org ob-perl ob-plantuml ob-processing + ob-python ob-ref ob-ruby ob-sass ob-scheme + ob-screen ob-sed ob-shell ob-sql ob-sqlite + ob-table ob-tangle ob oc-basic oc-biblatex + oc-bibtex oc-csl oc-natbib oc ol-bbdb ol-bibtex + ol-docview ol-doi ol-eshell ol-eww ol-gnus + ol-info ol-irc ol-man ol-mhe ol-rmail + ol-w3m ol org-agenda org-archive org-attach-git + org-attach org-capture org-clock org-colview + ;; org-compat + org-crypt org-ctags org-datetree + org-duration org-element org-entities + org-faces org-feed org-footnote org-goto + org-habit org-id org-indent org-inlinetask + org-install org-keys org-lint org-list + org-macro org-macs org-mobile org-mouse + org-num org-pcomplete org-persist org-plot + org-protocol org-refile org-src org-table + org-tempo org-timer org ox-ascii ox-beamer + ox-html ox-icalendar ox-koma-letter ox-latex + ox-man ox-md ox-odt ox-org ox-publish + ox-texinfo ox)) + (loaded-features (seq-filter + (lambda (f) (memq (alist-get 'provide f) + org-feature-list)) + load-history)) + (loaded-files (mapcar #'car loaded-features))) + (unless (and (= 1 (length (cl-remove-duplicates + (mapcar (lambda (path) (file-name-directory path)) + loaded-files) + :test #'equal))) + (= 1 (length (cl-remove-duplicates + (mapcar (lambda (path) (file-name-extension path)) + loaded-files) + :test #'equal)))) + (warn "Mixed Org mode installation detected. +Please make sure that you deleted old Org files after upgrade and do +not load Org/external packages depending on Org before setting the +correct `load-path' in your init.el.")))) + (eval-and-compile (require 'org-macs)) (require 'org-compat) (require 'org-keys) @@ -4840,6 +4889,7 @@ (define-derived-mode org-mode outline-mode "Org" The following commands are available: \\{org-mode-map}" + (org-check-mixed-installation) (org-load-modules-maybe) (org-install-agenda-files-menu) (when org-link-descriptive (add-to-invisibility-spec '(org-link))) @@ -4978,8 +5028,9 @@ (define-derived-mode org-mode outline-mode "Org" (set-face-foreground 'org-hide foreground))) ;; Set face extension as requested. (org--set-faces-extend '(org-block-begin-line org-block-end-line) - org-fontify-whole-block-delimiter-line) - (org--set-faces-extend org-level-faces org-fontify-whole-heading-line)) + org-fontify-whole-block-delimiter-line) + (org--set-faces-extend org-level-faces org-fontify-whole-heading-line) + (org-check-mixed-installation)) ;; Update `customize-package-emacs-version-alist' (add-to-list 'customize-package-emacs-version-alist -- 2.32.0 --=-=-=--