From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Building MWE DEBUG.org template file Date: Sun, 23 Feb 2020 10:48:39 -0800 Message-ID: <878sktuol4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43323) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5wJ9-0004xL-DJ for emacs-orgmode@gnu.org; Sun, 23 Feb 2020 13:48:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5wJ8-00007D-28 for emacs-orgmode@gnu.org; Sun, 23 Feb 2020 13:48:51 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:42972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5wJ7-00006k-RX for emacs-orgmode@gnu.org; Sun, 23 Feb 2020 13:48:50 -0500 Received: by mail-pg1-x536.google.com with SMTP id w21so3870398pgl.9 for ; Sun, 23 Feb 2020 10:48:49 -0800 (PST) Received: from geus3064linuxwsm (75-172-119-31.tukw.qwest.net. [75.172.119.31]) by smtp.gmail.com with ESMTPSA id x4sm9874627pff.143.2020.02.23.10.48.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Feb 2020 10:48:47 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Org-mode --=-=-= Content-Type: text/plain Hello, I'm trying to build a DEBUG.org that makes it easy to share MWEs of bugs I run across in Emacs packages. I'd like it to load the latest Org mode by default. Then for any given bug I load the needed packages, configure them, and demonstrate the bug. Right now when I run the attached file, the first time I run it everything appears to work correctly. It installs Org from melpa into a temporary elpa folder, and the output of #+BEGIN_SRC emacs-lisp :results value :noweb yes <> <> (org-version nil t) #+END_SRC is: #+RESULTS: : Org mode version 9.3.6 (9.3.6-4-gdfa7a3-elpaplus @ /home/kdm/.emacs.d/DEBUG/elpa/org-plus-contrib-20200217/) But when I load the file a second time in a clean emacs session (i.e. /usr/bin/emacs -Q ~/.emacs.d/DEBUG.org & ), then the Org version is incorrect, and I see: #+RESULTS: : Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /home/kdm/.emacs.d/DEBUG/elpa/org-plus-contrib-20200217/) Can anyone explain what I'm doing incorrectly in the attached file? Thanks, -k. --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=DEBUG.org Run this debug Org file in a clean emacs session with: /usr/bin/emacs -Q ~/.emacs.d/DEBUG.org & Initialize Emacs to reproduce this bug. Press `C-c C-c` in the Org Babel block below. #+BEGIN_SRC emacs-lisp :results value :noweb yes <> <> (org-version nil t) #+END_SRC #+RESULTS: : Org mode version 9.3.6 (9.3.6-4-gdfa7a3-elpaplus @ /home/kdm/.emacs.d/DEBUG/elpa/org-plus-contrib-20200217/) * Bug ** COMMENT Example Bug Put example code here for this bug. #+BEGIN_SRC emacs-lisp :results value (defmacro measure-time (&rest body) "Measure the time it takes to evaluate BODY." `(let ((time (current-time))) ,@body (message "%.06f" (float-time (time-since time))))) (measure-time (message "hello, world")) #+END_SRC #+RESULTS: : 0.000134 * Init ** Emacs #+NAME: init_emacs #+BEGIN_SRC emacs-lisp :results none (setq package-user-dir (expand-file-name "elpa" "~/.emacs.d/DEBUG")) (require 'package) (setq package-enable-at-startup nil) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) (package-initialize) ;; Bootstrap `use-package' (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (setq package-enable-at-startup nil) (defvar use-package-verbose t) (require 'use-package) (setq use-package-always-ensure t) ;(setq use-package-always-defer t) ;; (require 'diminish) ;; if you use :diminish ;; (require 'bind-key) #+END_SRC ** Org #+NAME: init_org #+BEGIN_SRC emacs-lisp :results none (use-package org :ensure org-plus-contrib) (setq org-confirm-babel-evaluate nil) ;; don't ask to eval code (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (shell . t))) #+END_SRC --=-=-=--