Re: `with` as a list.

2020-05-31 Thread Kyle Meyer
Mario Frasca writes:

> On 31/05/2020 19:19, Kyle Meyer wrote:
>> You've been sending a diff,
>> presumably from the point you branched off of to the tip of your branch.
>> In that case, you're already presenting each iteration you've sent as
>> one change; it just lacks a commit message.
>
> right, that's indeed what I did, and this is also what I thought, so no 
> need to rebase, squash or whatever, as long as I make sure that the diff 
> I'm sending you is about this single issue, and let's agree on the 
> commit message, because after all I'm adding a function to a software I 
> don't really know.

The way to add the commit message to the patch you're sending is to
create a commit in your repository with the commit message and then
convert that commit to a patch with `git format-patch'.  When you send
the patch, the commit message can then be reviewed along with the code
change.

The contributing page that I linked to before
() has some information on
the expected commit message format and on using format-patch.



Re: [PATCH] ob-sql: Respect database param when using dbconnection

2020-05-31 Thread Kyle Meyer
Daniel Kraus writes:

> I use ob-sql with the :dbconnection param so I don't have my username and 
> password in my org file.
> But often I don't want to use the default database from the dbconnection 
> alist but
> rather specify it explicitly with :database.
> Attached is a patch that fixes this.

Thanks for the patch.

> Subject: [PATCH] ob-sql: Respect database param when using dbconnection
>
> ---
>  lisp/ob-sql.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)


Would you mind formatting your commit message as described at
?  It'd also be good to
have an ORG-NEWS entry for this, I think.

> diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
> index 7c359b988..d7a8bf0a0 100644
> --- a/lisp/ob-sql.el
> +++ b/lisp/ob-sql.el
> @@ -191,7 +191,8 @@ then look for the parameter into the corresponding 
> connection
>  defined in `sql-connection-alist`, otherwise look into PARAMS.
>  Look `sql-connection-alist` (part of SQL mode) for how to define
>  database connections."
> -  (if (assq :dbconnection params)
> +  (if (and (assq :dbconnection params)
> +(not (and (assq :database params) (eq name :database
>(let* ((dbconnection (cdr (assq :dbconnection params)))
>   (name-mapping '((:dbhost . sql-server)
>   (:dbport . sql-port)

>From what I can gather from your description, this looks reasonable.
I'm not an ob-sql user, so perhaps I missing something, but would it
make sense for any connection parameter to take precedence if explicitly
given in the source block header (i.e. something like the patch below)?
[+cc Stefano, who added the :dbconneciton feature.]


diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 7c359b988..e7186938f 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -191,17 +191,17 @@ (defun org-babel-find-db-connection-param (params name)
 defined in `sql-connection-alist`, otherwise look into PARAMS.
 Look `sql-connection-alist` (part of SQL mode) for how to define
 database connections."
-  (if (assq :dbconnection params)
-  (let* ((dbconnection (cdr (assq :dbconnection params)))
- (name-mapping '((:dbhost . sql-server)
- (:dbport . sql-port)
- (:dbuser . sql-user)
- (:dbpassword . sql-password)
- (:database . sql-database)))
- (mapped-name (cdr (assq name name-mapping
-(cadr (assq mapped-name
-(cdr (assoc dbconnection sql-connection-alist)
-(cdr (assq name params
+  (or (cdr (assq name params))
+  (and (assq :dbconnection params)
+  (let* ((dbconnection (cdr (assq :dbconnection params)))
+ (name-mapping '((:dbhost . sql-server)
+ (:dbport . sql-port)
+ (:dbuser . sql-user)
+ (:dbpassword . sql-password)
+ (:database . sql-database)))
+ (mapped-name (cdr (assq name name-mapping
+(cadr (assq mapped-name
+(cdr (assoc dbconnection sql-connection-alist
 
 (defun org-babel-execute:sql (body params)
   "Execute a block of Sql code with Babel.





Re: `with` as a list.

2020-05-31 Thread Mario Frasca

On 31/05/2020 19:19, Kyle Meyer wrote:

You've been sending a diff,
presumably from the point you branched off of to the tip of your branch.
In that case, you're already presenting each iteration you've sent as
one change; it just lacks a commit message.


right, that's indeed what I did, and this is also what I thought, so no 
need to rebase, squash or whatever, as long as I make sure that the diff 
I'm sending you is about this single issue, and let's agree on the 
commit message, because after all I'm adding a function to a software I 
don't really know.


I hope to send an updated patch soon, that will also include the docs.

I have no strong opinion on workflows, just trying to understand the one 
used here.


btw: if I had write permissions to the repositories, I would be adding 
test cases, and reviewing the docstrings, some of which I find 
misleading.  your remark on setf/setq could also be addressed in the 
code.  and some of the code ought to be refactored, as to allow for unit 
tests.


ciao, MF




Bug: org-collect-keywords is void when config uses org-babel-load-file [9.3.6 (release_9.3.6-683-g3b2de4 @ /home/eric/.emacs.d/straight/build/org/)]

2020-05-31 Thread Eric Berquist
When loading a configuration using `(org-babel-load-file (concat
user-emacs-directory "config.org"))` in `init.el`, this message is reported:

org-export--get-inbuffer-options: Symbol’s function definition is
void: org-collect-keywords

and export doesn't work.

The last commit that didn't have this issue for me was
3c4cb7b296c78aafb0d6302a4075f1f1fa1c7e1c.

An example `config.el` follows (or stick it in an Elisp source block in
`config.org`):

(setq straight-use-package-by-default t)
(defvar bootstrap-version)
(let ((bootstrap-file
   (expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
  (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
 "
https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el";
 'silent 'inhibit-cookies)
  (goto-char (point-max))
  (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(setq use-package-always-defer t
  use-package-verbose t)
(straight-use-package 'use-package)

(bind-key (kbd "C-x C-b") 'switch-to-buffer)
(bind-key (kbd "C-x b") 'ibuffer)
(bind-key (kbd "C-c b") 'switch-to-previous-buffer)

(add-to-list 'default-frame-alist '(font . "Panic Sans-11"))

(use-package org)

Emacs  : GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.20, cairo version 1.17.3)
 of 2020-05-24
Package: Org mode version 9.3.6 (release_9.3.6-683-g3b2de4 @
/home/eric/.emacs.d/straight/build/org/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-latex-listings 'minted
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-latex-default-packages-alist '(("AUTO" "inputenc" t ("pdflatex"))
("T1" "fontenc" t ("pdflatex")) ("" "graphicx" t) ("" "grffile" t)
("" "longtable" nil) ("" "wrapfig" nil)
("" "rotating" nil) ("normalem" "ulem" t) ("" "amsmath" t)
("" "textcomp" t) ("" "amssymb" t) (""
"capt-of" nil) ("colorlinks=true" "hyperref" nil)
("" "braket" t) ("final" "microtype"
nil) ("usenames,dvipsnames,svgnames,table" "xcolor" nil))
 org-edit-src-content-indentation 0
 org-src-tab-acts-natively t
 org-link-descriptive nil
 org-latex-pdf-process '("latexmk -pdf -xelatex -shell-escape
-output-directory=%o %f")
 org-agenda-files '("~/Dropbox/Notes" "~/Dropbox/research/lab_notebook")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-startup-folded nil
 org-mode-hook '(org-mode-export-hook #[0 "\300\301\302\303\304$\207"
[add-hook change-major-mode-hook org-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-export-with-smart-quotes t
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-preview-latex-default-process 'imagemagick
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-adapt-indentation nil
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-log-done 'time
 org-export-backends '(ascii html icalendar latex md)
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-export-dispatch-use-expert-ui t
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-clock-persist-file "/home/eric/.emacs.d/var/org/clock-persist.el"
 org-closed-keep-when-no-todo t
 org-html-with-latex '(mathjax)
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el")
("elisp" . "el"))
 org-publish-timestamp-directory "/home/eric/.emacs.d/var/org/timestamps/"
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-id-locations-file "/home/eric/.emacs.d/var/org/id-locations.el"
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link) ("id" :follow org-id-open)
   ("eww" :follow org-eww-open :store
org-eww-store-

Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-31 Thread Matthew Lundin
stardiviner  writes:

> Matthew Lundin  writes:
>
>>
>> I think you also need to replace the newline with a space in the upper
>> case version.
>>
> Supposed there is \n after #+end_src. I also checked the original version 
> before
> that change commit. The original has an newline. I write patch by comparing
> before and after (side by side).

I'm referring to this line in the patch:

indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
 ^

The newline that needs to be removed is indicated by "^".

You can see a correct similar version of this line on line 1932 of
ob-core.el.

The original line the problematic commit replaced would also have had a
space in both, since it called either downcase or upcase on the string
"#+begin_src ".

Best,

Matt



Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-31 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Matthew Lundin  writes:

> stardiviner  writes:
>
>> I updated the patch commit message.
>>
>> From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
>> From: stardiviner 
>> Date: Sun, 31 May 2020 10:59:41 +0800
>> Subject: [PATCH] fix 5f0a9cca3 missing space
>>
>> * lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
>> with missing space.
>> ---
>>  lisp/ob-core.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
>> index e554e3934..79937e517 100644
>> --- a/lisp/ob-core.el
>> +++ b/lisp/ob-core.el
>> @@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
>>  (if (looking-at "^") "" "\n")
>>  indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
>>  (if arg stars indent) "\n"
>> -indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
>> +indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
>>  lang
>>  (if (> (length headers) 1)
>>  (concat " " headers) headers)
>> -- 
>> 2.26.2
>>
>
> I think you also need to replace the newline with a space in the upper
> case version.
>

Supposed there is \n after #+end_src. I also checked the original version before
that change commit. The original has an newline. I write patch by comparing
before and after (side by side).

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7UT0kUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOt0ggAtPk/dBaarsrRZOLJaN3SUtMeeIUM
BVdY5194hxKVYSxGtvAZDEi4MimfUgBzuXfaytYlVDeBxd1ShBbaoRNecqzlvaLm
qUAvI3S1ALJKfE4NKZrGwmZAbYdSE1OlJrhNz5IZ5xuJRWIz/ssJyVNhXbwwXy5o
QIbKxdzFdQ1g1iEYJOJS6U7yv2glmLkjgqmosMmFoJCA9Qrup898drdeOqwtUM9n
dmy5uehZonZ0bQpyr6Y09jrWj9fsDD53noZH2K1J2LeHYtf5TMrL+mxMRBSuK8SP
BgfwPqz9mYh1/YQzgYfB0s+J/zT1oBzD08WHHmqxbtM0sOc4ixkv7xszIg==
=r+5b
-END PGP SIGNATURE-



Re: `with` as a list.

2020-05-31 Thread Kyle Meyer
Mario Frasca writes:

> On 30/05/2020 16:29, Mario Frasca wrote:
>> I hope to be back soon with a single commit... 
>
> one doubt.  what's the point of having me squash all in a single commit, 
> when I do not have write access to the repository? 

To provide me or another committer with a polished, final state to
apply, along with a commit message that follows the convention mentioned
at  and ideally explains
why the change should be applied.  (The rationale you sent in your first
message could be adapted for this.)  You've been sending a diff,
presumably from the point you branched off of to the tip of your branch.
In that case, you're already presenting each iteration you've sent as
one change; it just lacks a commit message.

Just for clarity: In this case, I think the change proposed so far makes
sense to present as a single commit.  I'm not claiming that in general a
patch series should be reduced to _one_ commit.

> if we were on github, I would be working on a pull request, which
> would have a description and a title, and contain several commits. 

If I were reviewing a pull request from you, I would still request that
you not pile fixup commits on top and that you instead rewrite/polish
the series to address feedback.  People have strong opinions in both
directions on this, and I hope this thread doesn't derail into a
discussion of those.  My point is just that this workflow is not unique
to mailing list patch submission.



Re: org.elc failed to define function orgstruct-mode

2020-05-31 Thread Dmitrii Korobeinikov
> M-x orgstruct-mode

> I get the error:

> command-execute: Autoloading file
> /usr/share/emacs/site-lisp/org/org.elc failed to define function
> orgstruct-mode

Interesting, with --no-site-lisp flag there's no error and the
orgstruct-mode seems to load just fine...

вс, 31 мая 2020 г. в 22:51, Dmitrii Korobeinikov :
>
> Hi!
>
> When I try
>
> M-x orgstruct-mode
>
> I get the error:
>
> command-execute: Autoloading file
> /usr/share/emacs/site-lisp/org/org.elc failed to define function
> orgstruct-mode
>
> Org mode version 9.3.6 (release_9.3.6-449-gb99357 @
> /usr/share/emacs/site-lisp/org/)
> GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of
> 2019-08-30
> Arch Linux
>
> What could be going on here?
>
> Best,
> DK



Re: Contact data and sync revisited

2020-05-31 Thread Russell Adams
On Sun, May 31, 2020 at 10:52:52PM +0200, rey-coyrehourcq wrote:
> There is probably something to do using EteSync end-to-end
> Cardav/Caldav FOSS program https://www.etesync.com/ :

That's very interesting, I hadn't seen that one. I'm not sure I care for their
"sign up" model, but much like Jitsi it appears you can host your own.

To that effect, I'm already running Nextcloud which is my sync target. I'm
already syncing Nextclound Contacts and Calendar to and from my phone with
DAVx5. It work great.

Now I just Org to export and push to Nextcloud (CalDAV and CardDAV). Org-caldav
works fine, I've already set that up for appointments. Now I'm trying to get Org
to work with CardDAV somehow.

So close, yet so far...


--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: Contact data and sync revisited

2020-05-31 Thread rey-coyrehourcq
Hi,

There is probably something to do using EteSync end-to-end
Cardav/Caldav FOSS program https://www.etesync.com/ : 

- android / ios client
- contacts management
- task management and task.org compatibility : 
https://blog.etesync.com/tasks-org-adds-etesync-support/
- dav bridge / radicale : 
https://blog.etesync.com/desktop-dav-bridge-a-few-improvements-and-a-radicale-dependency-issue/
- gnome support (summer 2020) 

I'm a noob in lisp/elisp but there is probably something to write to
sync org data with client of this awesome FOSS tool.  

Best


Le dimanche 31 mai 2020 à 10:31 -0700, Eric Abrahamsen a écrit :
> Russell Adams  writes:
> 
> > I've been trying to find the best way to manage my contacts. I've
> > dabbled with
> > org-contact and using an Org file with property drawers, I've
> > dabbled with
> > BBDB. I've looked at standalone programs.
> > 
> > My key problem is I need a way to access my contacts in Emacs and
> > Mutt, and send
> > them to my Android phone. Single direction sync is fine.
> > 
> > Using a Nextcloud host, org-caldav, and DAVx5 I have already
> > successfully pushed my
> > calendar events to my Android phone. This makes it even more
> > important for me to
> > solve this issue finally.
> > 
> > I've considered the merit of a few options:
> > 
> >  - Use Org-contacts
> >- Pro: It's in org! So easy, lets me keep notes and appointment
> > data easily.
> >- Cons: Doesn't export at all.
> > 
> >  - BBDB
> >- Pro: It's in Emacs natively, with Org integration.
> >- Pro: Larger users base than Org-contacts, more software
> >- Cons: Exports but requires additional tools to sync
> > 
> > Unfortunately looking at the options keeps coming back to how poor
> > general
> > support for CardDAV and vcard files is. In particular, the popular
> > vdirsyncer
> > tool is now looking for a new maintainer, and I had the impression
> > from his list
> > of grievances he might drop it entirely.
> 
> This is not yet a working solution, but I'm gradually getting there
> with
> EBDB, a port/rewrite of BBDB. It does vCard export, though not very
> well
> yet. I've also written a library called "vcard", which does parsing
> of
> vcards into Elisp data, but have yet to get off my butt and wire
> everything together. The end result will be an EBDB database that
> uses
> the vCard format natively for storage.
> 
> Then I was planning on relying on vdirsyncer for CardDAV syncing, and
> it's a bummer to hear that it might go unmaintained. I could write a
> native CardDAV client using dav.el, but seeing how much fun David
> Engster has maintaining org-caldav, I'm not eager to go that route.
> 
> If you're interested, you can follow this issue.
> 
> https://github.com/girzel/ebdb/issues/4
> 
> Yes, it's issue #4, opened in 2016. Don't let that discourage you!
> 
> Eric
> 
-- 


Sébastien Rey-Coyrehourcq
Research Engineer UMR IDEES
02.35.14.69.30

{Stronger security for your email, follow EFF tutorial : 
https://ssd.eff.org/}




signature.asc
Description: This is a digitally signed message part


Re: `with` as a list.

2020-05-31 Thread Mario Frasca

On 30/05/2020 16:29, Mario Frasca wrote:
I hope to be back soon with a single commit... 


one doubt.  what's the point of having me squash all in a single commit, 
when I do not have write access to the repository?  if we were on 
github, I would be working on a pull request, which would have a 
description and a title, and contain several commits.  I don't 
understand the workflow apparently.






Re: Contact data and sync revisited

2020-05-31 Thread Russell Adams
On Sun, May 31, 2020 at 07:49:20AM -1000, Bob Newell wrote:
> I was able to reproduce 100% of my (text mode) emacs
> environment on an Android tablet, an Android phone, and a
> Chromebook running an Android subsystem. I use rsync to a
> cloud service for two-way sync among eight varied devices (one
> at a time, of course).

Bob, I can't stand tablets and phones for the lack of a decent keyboard. While I
appreciate the suggestion, it's not one I'm likely to pursue.

I am curious if you integrated local Emacs on Android with the Android Contact
list somehow. ;]

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: Contact data and sync revisited

2020-05-31 Thread Bob Newell


Russell Adams  writes:

> My key problem is I need a way to access my contacts in Emacs and Mutt, and 
> send
> them to my Android phone. Single direction sync is fine.

Aloha,

I've probably mentioned this before in past postings, but
there is a comprehensive solution for Android if you install
the free Termux app, which has packages for emacs and mutt
(although I use gnus), plus rsync and zillions of other
tools. I was able to reproduce 100% of my (text mode) emacs
environment on an Android tablet, an Android phone, and a
Chromebook running an Android subsystem. I use rsync to a
cloud service for two-way sync among eight varied devices (one
at a time, of course).

It takes a seriously serious amount of up-front work and may
not be at all close to what you are seeking, but once it's set
up, it's amazingly effective and productive (at least for me).

-- 
Bob Newell
Honolulu, Hawai`i

- Via GNU/Linux/Emacs/Gnus/BBDB



Re: Contact data and sync revisited

2020-05-31 Thread Eric Abrahamsen
Russell Adams  writes:

> I've been trying to find the best way to manage my contacts. I've dabbled with
> org-contact and using an Org file with property drawers, I've dabbled with
> BBDB. I've looked at standalone programs.
>
> My key problem is I need a way to access my contacts in Emacs and Mutt, and 
> send
> them to my Android phone. Single direction sync is fine.
>
> Using a Nextcloud host, org-caldav, and DAVx5 I have already successfully 
> pushed my
> calendar events to my Android phone. This makes it even more important for me 
> to
> solve this issue finally.
>
> I've considered the merit of a few options:
>
>  - Use Org-contacts
>- Pro: It's in org! So easy, lets me keep notes and appointment data 
> easily.
>- Cons: Doesn't export at all.
>
>  - BBDB
>- Pro: It's in Emacs natively, with Org integration.
>- Pro: Larger users base than Org-contacts, more software
>- Cons: Exports but requires additional tools to sync
>
> Unfortunately looking at the options keeps coming back to how poor general
> support for CardDAV and vcard files is. In particular, the popular vdirsyncer
> tool is now looking for a new maintainer, and I had the impression from his 
> list
> of grievances he might drop it entirely.

This is not yet a working solution, but I'm gradually getting there with
EBDB, a port/rewrite of BBDB. It does vCard export, though not very well
yet. I've also written a library called "vcard", which does parsing of
vcards into Elisp data, but have yet to get off my butt and wire
everything together. The end result will be an EBDB database that uses
the vCard format natively for storage.

Then I was planning on relying on vdirsyncer for CardDAV syncing, and
it's a bummer to hear that it might go unmaintained. I could write a
native CardDAV client using dav.el, but seeing how much fun David
Engster has maintaining org-caldav, I'm not eager to go that route.

If you're interested, you can follow this issue.

https://github.com/girzel/ebdb/issues/4

Yes, it's issue #4, opened in 2016. Don't let that discourage you!

Eric



Re: [PATCH] ob-haskell: Line Continuations Mangle Block Output

2020-05-31 Thread Nick Daly
Hi Kyle, thank you again for your help and analysis.  In summary,
org-mode needs no patches, but inf-haskell's comint-prompt-regexp
needs updates.  I'll follow up with the inf-haskell maintainers.



> inf-haskell used to set comint-prompt-regexp in the body of
> inferior-haskell-mode...  This is inf-haskell's variable.
> ob-haskell shouldn't set it.

Thank you for your help in all this.  I couldn't find where the regex
was set in the org-mode source because it wasn't coming from org-mode
at all.  Putting this all together suggests that the correct fix is to
update the inf-haskell regex to handle "Prelude| " correctly in the
first place.

I believe it's possible to compress the current inf-haskell regexp
from this:

(setq-local comint-prompt-regexp
;; Why the backslash in [\\._[:alnum:]]?
"^\\*?[[:upper:]][\\._[:alnum:]]*\\(?:
\\*?[[:upper:]][\\._[:alnum:]]*\\)*\\( λ\\)?> \\|^λ?> $")

Down into this, without any significant loss of fidelity.  We really
don't care about any characters at the start of the line before the
final "> ".

(setq-local comint-prompt-regexp "^[[:alnum:].*_() |λ]*> ")

This seems useful because, as I discovered this morning, importing
modules mangles the prompt further:

Prelude> import Data.Time
Prelude Data.Time> :m + Data.Time.Clock
Prelude Data.Time Data.Time.Clock>

The testing data that this configuration correctly parsed is attached
for reference.

I'll figure out where to submit that patch to, and send it off.  It's
a single line change that shouldn't require any assignment papers.

Thanks again,
Nick
Prelude> import Data.Time
Prelude Data.Time> :m + Data.Time.Clock
Prelude Data.Time Data.Time.Clock> scanl (+) 0 [1,2,3,4]
"org-babel-haskell-eoe"
[0,1,3,6,10]
Prelude Data.Time Data.Time.Clock> "org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock> :{
flip' :: (a -> b -> c) -> (b -> a -> c)
flip' f = \x y -> f y x
:}
"org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock| Prelude Data.Time Data.Time.Clock| Prelude 
Data.Time Data.Time.Clock| Prelude Data.Time Data.Time.Clock> 
"org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock> :{
sum' :: (Num a) => [a] -> a
sum' xs = foldl (\ acc x -> acc + x) 0 xs
:}
sum' [1,2,3,4] == 10
"org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock| Prelude Data.Time Data.Time.Clock| Prelude 
Data.Time Data.Time.Clock| Prelude Data.Time Data.Time.Clock> True
Prelude Data.Time Data.Time.Clock> "org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock> :{
sum' :: (Num a) => [a] -> a
sum' xs = foldl (\ acc x -> acc + x) 0 xs
:}
print "hi"
"org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock| Prelude Data.Time Data.Time.Clock| Prelude 
Data.Time Data.Time.Clock| Prelude Data.Time Data.Time.Clock> "hi"
Prelude Data.Time Data.Time.Clock> "org-babel-haskell-eoe"
Prelude Data.Time Data.Time.Clock>


org.elc failed to define function orgstruct-mode

2020-05-31 Thread Dmitrii Korobeinikov
Hi!

When I try

M-x orgstruct-mode

I get the error:

command-execute: Autoloading file
/usr/share/emacs/site-lisp/org/org.elc failed to define function
orgstruct-mode

Org mode version 9.3.6 (release_9.3.6-449-gb99357 @
/usr/share/emacs/site-lisp/org/)
GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of
2019-08-30
Arch Linux

What could be going on here?

Best,
DK



Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-31 Thread Matthew Lundin
stardiviner  writes:

> I updated the patch commit message.
>
> From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Sun, 31 May 2020 10:59:41 +0800
> Subject: [PATCH] fix 5f0a9cca3 missing space
>
> * lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
> with missing space.
> ---
>  lisp/ob-core.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
> index e554e3934..79937e517 100644
> --- a/lisp/ob-core.el
> +++ b/lisp/ob-core.el
> @@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block (&optional arg)
>   (if (looking-at "^") "" "\n")
>   indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
>   (if arg stars indent) "\n"
> - indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
> + indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
>   lang
>   (if (> (length headers) 1)
>   (concat " " headers) headers)
> -- 
> 2.26.2
>

I think you also need to replace the newline with a space in the upper
case version.

Matt



Re: Contact data and sync revisited

2020-05-31 Thread Matthew Lundin
Russell Adams  writes:

> Unfortunately looking at the options keeps coming back to how poor
> general support for CardDAV and vcard files is. In particular, the
> popular vdirsyncer tool is now looking for a new maintainer, and I had
> the impression from his list of grievances he might drop it entirely.

Yes, I'm hoping vdirsyncer is popular enough that someone will step
forward as maintainer. There's still an official package in Arch Linux,
but I'm not sure how long that will last if the package ultimately
remains unmaintained.

My current syncing solution relies on the following tools:

 - khard (https://github.com/scheibler/khard)
 - vdirsyncer
 - card/caldav server (Radicale)
 - DAVx5 (android app)

I use khardel (an emacs front-end to khard) to create and edit contacts
within emacs:

https://gitlab.petton.fr/DamienCassou/khardel

khardel also has a helper function for selecting and inserting email
addresses: khardel-insert-email

For address completion within emacs, I normally just use notmuch's
built-in auto-completion (which based on indexed addresses of emails
either sent or received). But it's nice to be able to fall back on
khardel and my own contacts collection.

I code small integrations in emacs around khard's command-line
interface. For instance, I pipe khard contacts into an interactive emacs
function that allows me to select a contact/phone number and then send
an sms via kdeconnect-cli.

Best,

Matt





Re: Splitting large org file into smaller ones

2020-05-31 Thread John Kitchin
This seems like an important thing to get right, so I would hesitate to
do this very automatically.

I would write a function that does what you want, maybe like this:

#+BEGIN_SRC emacs-lisp
(defun subtree-to-file ()
  (interactive)
  (org-narrow-to-subtree)
  (goto-char (point-min))
  (let* ((heading (fifth (org-heading-components)))
 (fname (concat (mapconcat 'downcase (split-string heading) "-") 
".org")))
(when
(y-or-n-p (format "Write subtree to %s" fname))
  (org-cut-subtree)
  (with-temp-file fname
(org-yank
  (widen)
  (when (not (org-at-heading-p))
(org-next-visible-heading 1)))
#+END_SRC

This will generate filenames based on the heading name, and move the
content to that file if you agree with the filename. It does not check
if the fname exists, which may be a good idea. It does not do anything
fancy like promote the heading, it just moves it.

It is a good idea to do this on a copy of the original file, so that you
have an un-altered version in case it does not go as planned.


Marvin M. Doyley  writes:

> Hi there,
>
> Is there an efficient way to split a large org file into smaller ones?
>
> Lets say I have a master file with the following
>
>
> * Notes
> **  Candidate A
>  - Strong technical background
>  - High H-factor
>  - good funding
> - More established investigator
> - Huge startup need $$
>
> **  Candidate B
> - lower startup need
> - signal processing
> - young investigator
>
>
> How do I export the subtree to separate org files, say
>
> - Candidate-a.org 
> - Candidate-b.org 
>
>
> Thanks
>
> M


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: Bug: org-with-wide-buffer is used in org-refile.el without (require 'org-macs) [9.3.6 (release_9.3.6-441-gba6855 @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-05-31 Thread Ihor Radchenko
>> So, there's a lot we need to fix here :/

Everything is back to normal regarding my bug report on master.
I guess the patch moving org-get-outline-path did the trick.

This should be closed.

Best,
Ihor

Kyle Meyer  writes:

> Kyle Meyer  writes:
>
>> There's also a 'make single' target that compiles files separately.  My
>> understanding is that ideally its output should be free of warnings.
>> Running that right before the commit above (f636cf91b^), there are a
>> couple of warnings (at least one now resolved).  There are a lot after,
>> including the one you mention.
>>
>> There have been at least a couple of threads that bring up related
>> org-refile.el issues:
>>
>>   - 
>> https://yhetil.org/orgmode/CAFyQvY1VR5t_a=jo01+qwbuqk_9i8+2xg6w2-mg-dpfzjz9...@mail.gmail.com/
>>   - 
>> https://yhetil.org/orgmode/8861c9e9-6c19-ea8f-6a90-7a4667820...@thompsonclan.org/
>>
>> So, there's a lot we need to fix here :/
>
> I've proposed a fix [^1] at one of the above threads:
>
>   https://yhetil.org/orgmode/878siww3rq@kyleam.com
>
> [^1]: 
> https://code.orgmode.org/bzg/org-mode/commit/18e58aa0d7fd367b3506891b633a493f402e9fee

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong 
University, Xi'an, China
Email: yanta...@gmail.com, ihor_radche...@alumni.sutd.edu.sg



How to supply multiples of a custom src block header arg

2020-05-31 Thread George Mauer
It would seem that `:var` in src blocks gets special treatment.

I am hacking on ob-racket trying to add the ability to require from a
header (the `:results value` mode wraps everything in a `let` so you need
something special to put requires at the top level).

I do this

```
#+begin_src racket :require rebellion/collection/list :require
rebellion/streaming/transducer :var foo=1 :var bar=2
  (transduce (in-range 1 10)
 (folding + 0)
 #:into into-list)
#+end_src
```

Note there’s two `:var` headers and two custom `:require` headers

Yet when in my `org-babel-execute:racket` function I log `params`

```
(defun org-babel-execute:racket (body params)
  "Executes a Racket code block."
  (message "==params %s" params)
  ...
```

I get

```
==params ((:var foo . 1) (:var bar . 2) (:colname-names) (:rowname-names)
(:result-params replace) (:result-type . value) (:results . replace)
(:exports . code) (:session . none) (:cache . no) (:noweb . no) (:hlines .
no) (:tangle . no) (:lang . racket) (:require .
rebellion/streaming/transducer))
```

Note that both `:var` headers have corresponding cons cells but only the
last `:require` header does

What is causing this behavior and how would I modify it?


Contact data and sync revisited

2020-05-31 Thread Russell Adams
I've been trying to find the best way to manage my contacts. I've dabbled with
org-contact and using an Org file with property drawers, I've dabbled with
BBDB. I've looked at standalone programs.

My key problem is I need a way to access my contacts in Emacs and Mutt, and send
them to my Android phone. Single direction sync is fine.

Using a Nextcloud host, org-caldav, and DAVx5 I have already successfully 
pushed my
calendar events to my Android phone. This makes it even more important for me to
solve this issue finally.

I've considered the merit of a few options:

 - Use Org-contacts
   - Pro: It's in org! So easy, lets me keep notes and appointment data easily.
   - Cons: Doesn't export at all.

 - BBDB
   - Pro: It's in Emacs natively, with Org integration.
   - Pro: Larger users base than Org-contacts, more software
   - Cons: Exports but requires additional tools to sync

Unfortunately looking at the options keeps coming back to how poor general
support for CardDAV and vcard files is. In particular, the popular vdirsyncer
tool is now looking for a new maintainer, and I had the impression from his list
of grievances he might drop it entirely.

What could be a decent valid solution to this issue?

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: [PATCH] Fix org-narrow-to-subtree smaller than subtree

2020-05-31 Thread Nicolas Goaziou
Hello,

Kevin Liu  writes:

> Good point.  `org-mark-element` uses (org-element-property); I wonder if
> it makes sense to have the actual :end property of a subtree be the same
> as its narrowed boundary?

I don't think so. This is an issue in narrowing, not in the parser.

I fixed the bug in `org-element-mark'. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: nondeterministic org-test-with-temp-text?

2020-05-31 Thread Nicolas Goaziou
Hello,

Kevin Liu  writes:

> Relatedly, would you be willing to take a look at the bug at hand with
> (org-next-visible-headline)?

I just fixed it, IIUC. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: using org mode to help with a construction project

2020-05-31 Thread Russell Adams
On Sat, May 30, 2020 at 06:13:01PM -0700, Ram Bhamidipaty wrote:
> I am still a beginner at org mode - I am looking for ideas or
> information about how I can use org mode to help me manage a
> construction project.
>
> I have a list of contractors (name, phone, email, etc) that I want to
> contact - and eventually get bids. Right now I would like to keep track
> of which ones have been sent an initial email, a time stamp for that
> would also be good. Maybe even record any response.

Start with a text outline, since you're new to org. Try adding timestamps to
record when you did things with C-u C-c . (adding an inactive timestamp). Use
your header tags to record the state of things (TODO and DONE).

> If there were a nice way to select and export the contact info for
> certain contractors that would be nice. I have a list of around 40 and I
> want to contact them in batches of 5. Maybe I could pick 5, export the
> addresses to Thunderbird and send initial requests.

Treat it as all text for now while you're learning. Paste in their contact data
into a headline with them, and manage it that way. Create action items for them
underneath their entry.

Later you can get into things like drawers, column view, keywords, etc.

You're likely to always have to copy and paste out their contact data if you
aren't using an Emacs mail client.

Here's how I would start, in a fresh empty file.

* Construction Project

** Contractors

*** TODO BOB's Billy Goat Crew

Bob, 999-555-1212, off Blueberry Lane.

[2020-05-31 Sun 10:53]
Called bob today, and we discussed X, Y, and Z.

[2020-05-31 Sun 10:55]
Sent bob an email confirming our discussion, with points to follow up on

 TODO Bob had a question

[2020-05-31 Sun 10:55]
Do we use nails or screws? Must check!

*** DONE Sleezy Todd's Emporium of Fraud

Todd, 888-555-1212, under the bridge by the tracks.

[2020-05-30 Sat 08:54]
Called on Todd today. He said he could deliver everything. Sounded too
interested. Made an appt.

[2020-05-31 Sun 10:55]
Visited Todd today, and I'm not impressed. I think he'd shortcut the work and
has no good prior examples. No longer considering him.


--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: issue tracker?

2020-05-31 Thread Russell Adams
On Wed, May 27, 2020 at 12:59:24PM -0500, Mario Frasca wrote:
> myself, I recently posted a patch, received zero reaction, and have the
> impression it's now lost in the logs of this mailing list.  indeed
> pretty inefficient!

Have to point out, that you received replies after about a week. Remember OSS
projects are run by volunteers, and your patch is about a very specific
sub-function. Eventually someone did reach out to you about it, and you appear
to be having a pretty good exchange over the patch.

I don't see how any other solution would have helped. Your patch still would
have waited for someone with relevant experience to look at it.

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3