emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Customizify org-babel-fortran-compiler
@ 2021-06-28  9:34 Nico Sonack
  2021-07-01 14:45 ` Timothy
  0 siblings, 1 reply; 5+ messages in thread
From: Nico Sonack @ 2021-06-28  9:34 UTC (permalink / raw)
  To: emacs-orgmode

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

Hey there,

I've been using org-mode for quite some time already and am pretty
happy!

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.

Nico

-- Sent from hades / FreeBSD 13.0-RELEASE

Please remember: https://useplaintext.email/#etiquette
Do NOT send me Microsoft Office documents. I shall refrain from opening
them.

Nico Sonack <nsonack@outlook.com>

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

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

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

TINYCHANGE
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'."
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] Customizify org-babel-fortran-compiler
@ 2021-06-28 10:21 Nico Sonack
  2021-07-01 14:40 ` Timothy
  0 siblings, 1 reply; 5+ messages in thread
From: Nico Sonack @ 2021-06-28 10:21 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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.

Nico

--
Sent from hades / FreeBSD 13.0-RELEASE

Please remember: https://useplaintext.email/#etiquette
Do NOT send me Microsoft Office documents. I shall refrain from opening
them.

Nico Sonack <nsonack@outlook.com>

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

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

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

TINYCHANGE
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'."
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-01 21:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-28  9:34 [PATCH] Customizify org-babel-fortran-compiler Nico Sonack
2021-07-01 14:45 ` Timothy
  -- strict thread matches above, loose matches on Subject: below --
2021-06-28 10:21 Nico Sonack
2021-07-01 14:40 ` Timothy
2021-07-01 21:22   ` Nicolas Goaziou

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).