Org-mode mailing list
 help / color / mirror / Atom feed
From: Nico Sonack <>
Subject: [PATCH] Customizify org-babel-fortran-compiler
Date: Mon, 28 Jun 2021 12:21:11 +0200 (CEST)
Message-ID: <> (raw)

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

Hey there,

I've been using org-mode for quite a while already and am pretty
happy with it!

Today I noticed a minor oddity, that occured when I tried to run some
Fortran code with org-babel: it failed with the compiler not being
found. Looking at the custom variables of the org-babel group, I was
unable to find a compiler option for Fortran. Thus, I quickly patched
the ob-fortran.el and turned the defvar of
`org-babel-fortran-compiler' into a defcustom such that it is a little
more consistent with the rest of the org-babel languages.

The patch is attached to this mail. Please let me know if I should
correct anything.


Sent from hades / FreeBSD 13.0-RELEASE

Please remember:
Do NOT send me Microsoft Office documents. I shall refrain from opening

Nico Sonack <>

[-- Attachment #2: proposed patch --]
[-- Type: text/plain, Size: 1264 bytes --]

From bdfee720197d94465dfe40776a3f0a249b7ddcb5 Mon Sep 17 00:00:00 2001
From: Nico Sonack <>
Date: Mon, 28 Jun 2021 11:07:10 +0200
Subject: [PATCH] lisp/ob-fortran.el: Make org-babel-fortran-compiler a custom

* lisp/ob-fortran.el (org-babel-fortran-compiler): defvar -> defcustom
so that the fortran compiler is customizable like almost all org-babel

Sometimes the compiler isn't `gfortran` (but e.g. `gfortran10`
etc.). Accomodate for that like we do with all other org-babel
language integrations.
 lisp/ob-fortran.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-fortran.el b/lisp/ob-fortran.el
index 99afa0d96..bb2e5d2a3 100644
--- a/lisp/ob-fortran.el
+++ b/lisp/ob-fortran.el
@@ -40,9 +40,11 @@
 (defvar org-babel-default-header-args:fortran '())
-(defvar org-babel-fortran-compiler "gfortran"
+(defcustom org-babel-fortran-compiler "gfortran"
   "fortran command used to compile a fortran source code file into an
-  executable.")
+  executable."
+  :group 'org-babel
+  :type  'string)
 (defun org-babel-execute:fortran (body params)
   "This function should only be called by `org-babel-execute:fortran'."

             reply	other threads:[~2021-06-28 10:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 10:21 Nico Sonack [this message]
2021-07-01 14:40 ` Timothy
2021-07-01 21:22   ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2021-06-28  9:34 Nico Sonack
2021-07-01 14:45 ` Timothy

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:

  List information:

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

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ \
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone