pkg update and first config fix

org-brain not working, add org-roam
This commit is contained in:
2022-12-19 23:02:34 +01:00
parent 02b3e07185
commit 82f05baffe
885 changed files with 356098 additions and 36993 deletions

View File

@@ -1,11 +1,11 @@
;;; org-plot.el --- Support for Plotting from Org -*- lexical-binding: t; -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
;; Copyright (C) 2008-2022 Free Software Foundation, Inc.
;;
;; Author: Eric Schulte <schulte dot eric at gmail dot com>
;; Maintainer: TEC <tecosaur@gmail.com>
;; Maintainer: TEC <orgmode@tec.tecosaur.net>
;; Keywords: tables, plotting
;; Homepage: https://orgmode.org
;; URL: https://orgmode.org
;;
;; This file is part of GNU Emacs.
;;
@@ -31,6 +31,9 @@
;;; Code:
(require 'org-macs)
(org-assert-version)
(require 'cl-lib)
(require 'org)
(require 'org-table)
@@ -272,15 +275,15 @@ argument for the FUNCTION."
for k in keys collect
(cons k (funcall function (lookup k alist1) (lookup k alist2))))))
(defun org--plot/item-frequencies (values &optional normalise)
(defun org--plot/item-frequencies (values &optional normalize)
"Return an alist indicating the frequency of values in VALUES list.
When NORMALISE is non-nil, the count is divided by the number of values."
(let ((normaliser (if normalise (float (length values)) 1)))
When NORMALIZE is non-nil, the count is divided by the number of values."
(let ((normaliser (if normalize (float (length values)) 1)))
(cl-loop for (n . m) in (seq-group-by #'identity values)
collect (cons n (/ (length m) normaliser)))))
(defun org--plot/prime-factors (value)
"Return the prime decomposition of VALUE, e.g. for 12, '(3 2 2)."
"Return the prime decomposition of VALUE, e.g. for 12, (3 2 2)."
(let ((factors '(1)) (i 1))
(while (/= 1 value)
(setq i (1+ i))
@@ -291,6 +294,11 @@ When NORMALISE is non-nil, the count is divided by the number of values."
))
(cl-subseq factors 0 -1)))
(defgroup org-plot nil
"Options for plotting in Org mode."
:tag "Org Plot"
:group 'org)
(defcustom org-plot/gnuplot-script-preamble ""
"String of function to be inserted before the gnuplot plot command is run.
@@ -621,8 +629,9 @@ manner suitable for prepending to a user-specified script."
"Find any overlays for IMG-FILE in the current Org buffer, and refresh them."
(dolist (img-overlay org-inline-image-overlays)
(when (string= img-file (plist-get (cdr (overlay-get img-overlay 'display)) :file))
(when (file-exists-p img-file)
(image-refresh (overlay-get img-overlay 'display))))))
(when (and (file-exists-p img-file)
(fboundp 'image-flush))
(image-flush (overlay-get img-overlay 'display))))))
;;-----------------------------------------------------------------------------
;; facade functions
@@ -667,7 +676,8 @@ line directly before or after the table."
(num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
(nth 0 table))))
(type (assoc (plist-get params :plot-type)
org-plot/preset-plot-types)))
org-plot/preset-plot-types))
gnuplot-script)
(unless type
(user-error "Org-plot type `%s' is undefined" (plist-get params :plot-type)))
@@ -682,9 +692,10 @@ line directly before or after the table."
(looking-at "[[:space:]]*#\\+"))
(setf params (org-plot/collect-options params))))
;; Dump table to datafile
(if-let ((dump-func (plist-get type :data-dump)))
(funcall dump-func table data-file num-cols params)
(org-plot/gnuplot-to-data table data-file params))
(let ((dump-func (plist-get type :data-dump)))
(if dump-func
(funcall dump-func table data-file num-cols params)
(org-plot/gnuplot-to-data table data-file params)))
;; Check type of ind column (timestamp? text?)
(when (plist-get params :check-ind-type)
(let* ((ind (1- (plist-get params :ind)))
@@ -700,16 +711,17 @@ line directly before or after the table."
ind-column))
(plist-put params :textind t))))) ; ind holds text
;; Write script.
(setq gnuplot-script
(org-plot/gnuplot-script
table data-file num-cols params (plist-get params :script)))
(with-temp-buffer
(if (plist-get params :script) ; user script
(progn (insert
(org-plot/gnuplot-script table data-file num-cols params t))
(insert "\n")
(progn (insert gnuplot-script "\n")
(insert-file-contents (plist-get params :script))
(goto-char (point-min))
(while (re-search-forward "\\$datafile" nil t)
(replace-match data-file nil nil)))
(insert (org-plot/gnuplot-script table data-file num-cols params)))
(insert gnuplot-script))
;; Graph table.
(gnuplot-mode)
(condition-case nil