From: Ken Mankoff <mankoff@gmail.com>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: Building MWE DEBUG.org template file
Date: Sun, 23 Feb 2020 10:48:39 -0800 [thread overview]
Message-ID: <878sktuol4.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]
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
<<init_emacs>>
<<init_org>>
(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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: DEBUG.org --]
[-- Type: text/x-org, Size: 1826 bytes --]
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
<<init_emacs>>
<<init_org>>
(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
reply other threads:[~2020-02-23 18:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=878sktuol4.fsf@gmail.com \
--to=mankoff@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).