pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
;;; ob-gnuplot.el --- Babel Functions for Gnuplot -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Eric Schulte
|
||||
;; Maintainer: Ihor Radchenko <yantar92@gmail.com>
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: https://orgmode.org
|
||||
;; URL: https://orgmode.org
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
;; - gnuplot-mode :: you can search the web for the latest active one.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'org-macs)
|
||||
(org-assert-version)
|
||||
|
||||
(require 'ob)
|
||||
(require 'org-macs)
|
||||
|
||||
@@ -94,12 +98,15 @@ code."
|
||||
(let* ((first (car val))
|
||||
(tablep (or (listp first) (symbolp first))))
|
||||
(if tablep val (mapcar 'list val)))
|
||||
(org-babel-temp-file "gnuplot-") params)
|
||||
;; Make temporary file name stable with respect to data.
|
||||
;; If we do not do it, :cache argument becomes useless.
|
||||
(org-babel-temp-stable-file (cons val params) "gnuplot-")
|
||||
params)
|
||||
(if (and (stringp val)
|
||||
(file-remote-p val) ;; check if val is a remote file
|
||||
(file-exists-p val)) ;; call to file-exists-p is slow, maybe remove it
|
||||
(let* ((local-name (concat ;; create a unique filename to avoid multiple downloads
|
||||
org-babel-temporary-directory
|
||||
(org-babel-temp-directory)
|
||||
"/gnuplot/"
|
||||
(file-remote-p val 'host)
|
||||
(org-babel-local-file-name val))))
|
||||
@@ -129,15 +136,16 @@ code."
|
||||
(title (cdr (assq :title params)))
|
||||
(lines (cdr (assq :line params)))
|
||||
(sets (cdr (assq :set params)))
|
||||
(missing (cdr (assq :missing params)))
|
||||
(x-labels (cdr (assq :xlabels params)))
|
||||
(y-labels (cdr (assq :ylabels params)))
|
||||
(timefmt (cdr (assq :timefmt params)))
|
||||
(time-ind (or (cdr (assq :timeind params))
|
||||
(when timefmt 1)))
|
||||
(directory (and (buffer-file-name)
|
||||
(file-name-directory (buffer-file-name))))
|
||||
(directory default-directory)
|
||||
(add-to-body (lambda (text) (setq body (concat text "\n" body)))))
|
||||
;; append header argument settings to body
|
||||
(when missing (funcall add-to-body (format "set datafile missing '%s'" missing)))
|
||||
(when title (funcall add-to-body (format "set title '%s'" title)))
|
||||
(when lines (mapc (lambda (el) (funcall add-to-body el)) lines))
|
||||
(when sets
|
||||
@@ -284,13 +292,17 @@ then create one. Return the initialized session. The current
|
||||
(defun org-babel-gnuplot-table-to-data (table data-file params)
|
||||
"Export TABLE to DATA-FILE in a format readable by gnuplot.
|
||||
Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
|
||||
(require 'ox-org)
|
||||
(with-temp-file data-file
|
||||
(insert (let ((org-babel-gnuplot-timestamp-fmt
|
||||
(or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S")))
|
||||
(orgtbl-to-generic
|
||||
table
|
||||
(org-combine-plists
|
||||
'(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field :raw t :backend ascii)
|
||||
'( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
|
||||
;; Two setting below are needed to make :fmt work.
|
||||
:raw t
|
||||
:backend ascii)
|
||||
params)))))
|
||||
data-file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user