Re: [O] Visualizing org files

2018-09-09 Thread Samuel Wales
https://github.com/novoid

[even the government of canada is on github it seems O.o
https://github.com/canada-ca ]


On 9/8/18, Eric S Fraga  wrote:
> On Friday,  7 Sep 2018 at 19:58, Samuel Wales wrote:
>> pretty unrelated, but a reminder that there is org-du | xdu or so
>> which shows subtree byte counts.
>
> Link?  I cannot find this package/code.  Thanks.
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
>


-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] Emacs mobile org

2018-09-09 Thread Kaushal Modi
On Sun, Sep 9, 2018 at 7:53 PM M. P.  wrote:

> Hello I am running emacs on a mac I have a galaxy s8 android phone. I am
> wanting to sync my phone with emacs on my computer.
> I would prefer not to use a cloud service but instead use
> something like a usb or ther to sync with.
>

So, what is the question? :)

Looking at just "Org" and "Android phone", I can suggest the Orgzly app.

It can sync notes to a directory on your phone, and you can sync that dir
to your computer via USB if you like (I like the Dropbox sync option).
-- 

Kaushal Modi


[O] Emacs mobile org

2018-09-09 Thread M. P.
Hello I am running emacs on a mac I have a galaxy s8 android phone. I am 
wanting to sync my phone with emacs on my computer.
I would prefer not to use a cloud service but instead use something 
like a usb or ther to sync with.


[O] Literate programming: Org mode and Scala

2018-09-09 Thread Andrea Giugliano
Hi everybody,

TL;DR: org mode literate programming does not work easily with the current
scala-mode, there are options to work around this: are the org-mode
maintainers still okay with scala-mode depending on ensime?


Thanks so much for org-mode: the more I use it the more I appreciate the
effort you have put into it!

I am working with Scala and I like to test out things using a literate
programming style. Apparently org-mode decided to offload the scala-mode
to the Ensime maintainers. For this reason there is no straightforward
(at least not to me) support to run code blocks on the fly.

I have opened an issue about this [0], but the Ensime/scala-mode
community does not seem active (at least this pull request did not
receive any comment yet [1]).

For those who are struggling I have created a little of code to make
easy to work with Scala and org-mode [2].

I wonder: is the org-mode community planning to make scala-mode work in
a literate way without workarounds?

Thanks,

Andrea

[0] https://github.com/ensime/emacs-scala-mode/issues/148
[1] https://github.com/ensime/emacs-scala-mode/pull/151
[2] https://github.com/ag91/EasyOrgEnsime



Re: [O] A strange problem with org-babel and SQLite

2018-09-09 Thread Robert Klein
On Wed, 5 Sep 2018 08:56:02 +0200
Robert Klein  wrote:

> Hi Cecil,
> 
> On Mon, 3 Sep 2018 03:23:17 +0200
> Cecil Westerhof  wrote:
> 
> > It has to do with the data. With the following I can reproduce it:
> > #+BEGIN_SRC sqlite :db ~/testingOrgBabel.sqlite :colnames yes
> > DROP TABLE IF EXISTS quotes
> > ;
> > CREATE TABLE "quotes" (
> > quoteID TEXT   PRIMARY KEY,
> > quote   TEXT NOT NULL  UNIQUE,
> > lastUsedTEXT,
> > totalUsed   INT  DEFAULT 'unused'
> > )
> > ;
> > INSERT INTO quotes
> > (quoteID, quote)
> > VALUES
> > ("1230FCF5-B25D-4087-88A4-41DF3AC353DA", '[
> >   "Limitations live only in our minds.
> > But if we use our imaginations,
> > our possibilities become limitless.
> > 
> > - Jamie Paolinett",
> >   "Hoe gebruik jij je verbeelding om
> > je mogelijkheden te vergroten?"
> > ]'),
> > (2, "Second record.")
> > ;
> > SELECT *
> > FROM   quotes
> > ;
> > #+END_SRC
> > 
> > When I put a JSON field in the quote field the parsing goes wrong.
> > 
> >   
> 
> umm, yes.  Actually what seems to happen is that emacs tries to
> evaluate the JSON part as emacs lisp code, in this case an array.  In
> detail, I think, this happens:
> 
> 
> - org-babel-execute:sqlite (ob-sqlite, line 60)
>   calls (for converting the results)
> 
> - org-babel-sqlite-table-or-scalar (ob-sqlite, line 133),
>   which apparently thinks the result looks like a “trivial table” and
>   calls
> 
> - org-babel-read (ob-core.el, line 2912),
>   which detects the JSON string (begins with a "[ ) as lisp and tries
>   to evaluate the lisp form.  The call to “read” in line 2927 then
>   fails, because there is no closing ]  (only the contents on one cell
>   is sent to org-babel-read; note, there are no multi-line cells in
> org tables).
> 
> 
> Line numbers are from Org release_9.1.14-1-g4931fc.
> 
> 
> 
> 
> That's no solution of course. To resolve this,
> 
> - is there a reason to evaluate table cell contents as lisp code?
> 
> If no,
> 
> - don't use org-babel-read (in org-babel-sqlite-table-or-scalar)
> - or compare “(org-babel-result-cond...)” code with other ob-*.el
>   (ob-sql.el?) and rewrite.
> 
> If yes,
> 
> - is there a way to check if a string is correct lisp code before
>   calling “read”?
> 
> 
> 
> In the “yes” case, there's still the issue of JSON being possibly
> detected as “correct” lisp code (e.g. ["alfa"]).
> 
> 
> In your case, if you haven't invested too much in the dependency on
> JSON, you might want to redesign the database, e.g. 
> 
> 
> CREATE TABLE "quotes" (
> quoteID TEXT   PRIMARY KEY,
> quote_enTEXT NOT NULL  UNIQUE,
>   quote_nlTEXT NOT NULL  UNIQUE,
> lastUsedTEXT,
> totalUsed   INT  DEFAULT 'unused'
> );
> 
> 
> 
> 
> Best regards
> Robert

Hi Cecil,

could you try to put the following code in your .emacs _after_
“org-babel-do-load-languages” for ob-sqlite?

(defun org-babel-read (cell  inhibit-lisp-eval)
  "Convert the string value of CELL to a number if appropriate.
Otherwise if cell looks like lisp (meaning it starts with a
\"(\", \"\\='\", \"\\=`\" or a \"[\") then read it as lisp,
otherwise return it unmodified as a string.  Optional argument
NO-LISP-EVAL inhibits lisp evaluation for situations in which is
it not appropriate."
  (if (and (stringp cell) (not (equal cell "")))
  (or (org-babel-number-p cell)
  (if (and (not inhibit-lisp-eval)
   (or (member (substring cell 0 1) '("(" "'" "`" "["))
   (string= cell "*this*")))
  (eval (read cell))
(if (and (not inhibit-lisp-eval)
 (string= (substring cell 0 1) "\""))
(read cell)
  (progn (set-text-properties 0 (length cell) nil cell)
cell cell))


(This should work for Emacs 25.x)


Best regards
Robert



[O] Fix for ob-sqlite tests

2018-09-09 Thread Robert Klein
Hi,

the tests for sqlite don't work because

1. the executable is sqlite3, not sqlite anymore for current software
(and obsqlite uses “sqlite3”, too)

2. the test doesn't have ob-sqlite loaded.


Please advice, if the “(require 'obsqlite)” is offensive.


Patch is attached.



Best regards
Robert
>From c48a90b94bc7f0a86c7dd3b4747c893e64ec2e31 Mon Sep 17 00:00:00 2001
From: Robert Klein 
Date: Sun, 9 Sep 2018 14:27:20 +0200
Subject: [PATCH] Fix tests for sqlite

- sqlite executable used by ob-sqlite is 'sqlite3'
- require ob-sqlite for test
---
 testing/lisp/test-ob-sqlite.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testing/lisp/test-ob-sqlite.el b/testing/lisp/test-ob-sqlite.el
index f73251534..0cf68fabc 100644
--- a/testing/lisp/test-ob-sqlite.el
+++ b/testing/lisp/test-ob-sqlite.el
@@ -19,7 +19,8 @@
 ;; along with this program.  If not, see .
 
 ;;; Code:
-(org-test-for-executable "sqlite")
+(org-test-for-executable "sqlite3")
+(require 'ob-sqlite)
 (unless (featurep 'ob-sqlite)
   (signal 'missing-test-dependency "Support for sqlite code blocks"))
 
-- 
2.16.2