Org export to HTML with encrypted information ??

2019-11-28 Thread David Masterson
My use-case is this:

I'd like to use Org to write up *all* the information about my family
life (so to speak) including medical histories of my family, issues with
the house, bank accounts, financial information, etc., so that my family
has all the information to refer to when necessary in a (hopefully)
well-structured form.  Naturally, this is going to have a fair amount of
really sensitive information.  By carefully outlining the information, I
can structure the sensitive information to be in key parts of the
documents that I can then encrypt using org-crypt.

That part is straightforward.  The tricky part is that my family is not
"Emacs literate" and, so, I'm thinking the best idea is to export the
information from Org files to HTML files so that I can then present to
them as a website.  They are used to browsing the web, so this should be
more natural to them.  The problem that I'm looking for help with is how
to deal with the encrypted information?  Any suggestions?

--
David



Re: Displaying remote images

2019-11-28 Thread briangpowell .
* Great, see a lot of interest and use of image-mode.el, suggest you check
out this thread

https://emacs.stackexchange.com/questions/3432/display-images-in-eshell-with-iimage-mode

** Suggest you check out and use iimage-mode.el --it may help ...that's
iimage-mode.el rather than, or in addition to, your use of image-mode.el



On Thu, Nov 28, 2019 at 9:20 PM Jack Kamm  wrote:

> I've attached a patch which implements displaying remote images.
>
> > This is a longstanding problem, and there was an attempt to patch it in
> > 2014, but the patch was never accepted:
> > https://lists.gnu.org/archive/html/emacs-orgmode/2014-11/msg00583.html
>
> Compared to the previous attempt from 2014, I think my patch is simpler
> -- it doesn't require creating any temp files.
>
> > The fault might be with image.el rather than with org-mode itself --
> > for example, when I execute the following elisp, I get the same blank
> > box:
>
> After doing some reading, I learned that image.el doesn't really create
> the image. Instead, create-image simply creates a blank string with a
> text property pointing to the image file location, and the rendering of
> the image gets handled later by the C code (for example, png_load_body()
> in image.c), which doesn't know how to read remote image files.
>
> Since I wasn't comfortable trying to get the C code to read the remote
> file, I instead took the approach used by image-mode.el, which reads the
> remote image file and passes its contents directly to create-image,
> instead of just passing the filename.
>
>


Re: Displaying remote images

2019-11-28 Thread Jack Kamm
I've attached a patch which implements displaying remote images.

> This is a longstanding problem, and there was an attempt to patch it in
> 2014, but the patch was never accepted:
> https://lists.gnu.org/archive/html/emacs-orgmode/2014-11/msg00583.html

Compared to the previous attempt from 2014, I think my patch is simpler
-- it doesn't require creating any temp files.

> The fault might be with image.el rather than with org-mode itself --
> for example, when I execute the following elisp, I get the same blank
> box:

After doing some reading, I learned that image.el doesn't really create
the image. Instead, create-image simply creates a blank string with a
text property pointing to the image file location, and the rendering of
the image gets handled later by the C code (for example, png_load_body()
in image.c), which doesn't know how to read remote image files.

Since I wasn't comfortable trying to get the C code to read the remote
file, I instead took the approach used by image-mode.el, which reads the
remote image file and passes its contents directly to create-image,
instead of just passing the filename.

>From 47120666dad6eb0b6ca716325d7de86924e1d28e Mon Sep 17 00:00:00 2001
From: Jack Kamm 
Date: Thu, 28 Nov 2019 17:45:56 -0800
Subject: [PATCH] org: display remote images

---
 lisp/org.el | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 90f222c8b..dc7bcc7aa 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16754,13 +16754,20 @@ buffer boundaries with possible narrowing."
 			(t nil)))
 			  (old (get-char-property-and-overlay
 (org-element-property :begin link)
-'org-image-overlay)))
+'org-image-overlay))
+			  (remote-p (file-remote-p file)))
 		  (if (and (car-safe old) refresh)
 			  (image-refresh (overlay-get (cdr old) 'display))
-			(let ((image (create-image file
+			(let ((image (create-image (if (not remote-p)
+		   file
+		 (with-temp-buffer
+		   (insert-file-contents file)
+		   (string-make-unibyte
+			(buffer-substring-no-properties
+			 (point-min) (point-max)
 		   (and (image-type-available-p 'imagemagick)
 			width 'imagemagick)
-		   nil
+		   remote-p
 		   :width width)))
 			  (when image
 			(let ((ov (make-overlay
-- 
2.24.0



Re: Displaying remote images

2019-11-28 Thread Jack Kamm
Hi Brian,

> Emacs and OrgMode do many great things; but, the focus has always been, at
> it's core, the most powerful editor and stateless organizing software--it's
> not a browser of dynamically generated Internet pics--Emacs W3 was created
> to do that, and it hasn't been updated in years--suggest you look at Emacs
> W3 browser code and/or w3m browser or even UZBL browser--all of which were
> made into good extensions for doing such things--UZBL by the way has been
> made to operate fully encapsulated in an emacs buffer

I'm not looking for a browser of dynamically generated Internet pics --
I would just like to display a static image that lives on an SSH server
somewhere.

In particular, my use-case is for making plots with a remote R session
via org-babel. I want those plots to display correctly in the org-file
I'm working in (which may also be on the remote server).

> * Idea 3
> Use the patch you reference and create your own .el program that gets
> loaded and run when you want it--a cursory examination of the patch
> reveals that it depends on ImageMagick which is great software that
> everyone should use; but, it's a dependency that is NOT emacs software and
> so it makes sense that it was never put into the main OrgMode software tree

The patch does not add any dependency on ImageMagick -- those references
to imagemagick existed before the patch, and are still in org.el today.

> * Idea 1
> Create a "cron job" or "at job" that does updates up to the minute and make
> those images current...and local--and the cron job can auto-delete the temp
> file later or back it up
>
> * Idea 2
> Make an elisp .el program that gets loaded and run whenever you open the
> .org file with the remote image...and that code updates the images locally

These are interesting ideas, but I'm only interested in looking at
static images, so they seem a bit like overkill for my desired use case.



Re: Displaying remote images

2019-11-28 Thread briangpowell .
* Idea 1
Create a "cron job" or "at job" that does updates up to the minute and make
those images current...and local--and the cron job can auto-delete the temp
file later or back it up

* Idea 2
Make an elisp .el program that gets loaded and run whenever you open the
.org file with the remote image...and that code updates the images locally

* Idea 3
Use the patch you reference and create your own .el program that gets
loaded and run when you want it--a cursory examination of the patch
reveals that it depends on ImageMagick which is great software that
everyone should use; but, it's a dependency that is NOT emacs software and
so it makes sense that it was never put into the main OrgMode software tree

P.S. I created code and methods to put and run animated .gif's into OrgMode
buffers and run them, it was amusing; but, it wasted a lot of ram and
slowed everything down

Emacs and OrgMode do many great things; but, the focus has always been, at
it's core, the most powerful editor and stateless organizing software--it's
not a browser of dynamically generated Internet pics--Emacs W3 was created
to do that, and it hasn't been updated in years--suggest you look at Emacs
W3 browser code and/or w3m browser or even UZBL browser--all of which were
made into good extensions for doing such things--UZBL by the way has been
made to operate fully encapsulated in an emacs buffer





On Thu, Nov 28, 2019 at 12:36 PM Jack Kamm  wrote:

> When trying to display a remote image file in an org-mode buffer, I
> only see a blank square instead of the image.
>
> This is a longstanding problem, and there was an attempt to patch it in
> 2014, but the patch was never accepted:
> https://lists.gnu.org/archive/html/emacs-orgmode/2014-11/msg00583.html
>
> The fault might be with image.el rather than with org-mode itself --
> for example, when I execute the following elisp, I get the same blank
> box:
>
> (insert-image (create-image "/scp:pi:/home/pi/foo.png"))
>
> However, if I open the remote file in its own buffer using image-mode,
> I can correctly view the image.
>
> Anyways, I would like to try and fix this, but not sure whether we
> should pursue a fix in org.el (as in the linked patch), or in
> image.el, or elsewhere.
>
> Any advice on how to proceed here?
>
>


Displaying remote images

2019-11-28 Thread Jack Kamm
When trying to display a remote image file in an org-mode buffer, I
only see a blank square instead of the image.

This is a longstanding problem, and there was an attempt to patch it in
2014, but the patch was never accepted:
https://lists.gnu.org/archive/html/emacs-orgmode/2014-11/msg00583.html

The fault might be with image.el rather than with org-mode itself --
for example, when I execute the following elisp, I get the same blank
box:

(insert-image (create-image "/scp:pi:/home/pi/foo.png"))

However, if I open the remote file in its own buffer using image-mode,
I can correctly view the image.

Anyways, I would like to try and fix this, but not sure whether we
should pursue a fix in org.el (as in the linked patch), or in
image.el, or elsewhere.

Any advice on how to proceed here?



How to mark task as done at specified (past) time?

2019-11-28 Thread Tim Landscheidt
Hi,

with Emacs 26.2/org-mode 9.1.9, I have a repeating task that
I close with a helper function:

| (defun tl-entry-done ()
|   (interactive)
|   (find-file "/path/to/file.org")
|   (goto-char (org-find-entry-with-id "ENTRY-ID"))
|   (org-todo 'done))

Every time I do this task, I get an acknowledging mail, so
instead of manually closing this task (and forgetting to do
that, or delaying it for some time) I want Gnus to mark the
task as done /at the time when the mail was sent/, i. e. in:

|- State "DONE"   from "TODO"   [2019-11-27 Mi 16:44]

I want "2019-11-27 Mi 16:44" not to be the current time, but
some other (past) time.

How can I mark a task as done at a specified time?  Looking
at org-add-planning-info, there seems to be a mechanism to
pass a timestamp, but it does not seem to be exposed at
higher levels (?).

Do I have to cl-flet org-current-time or something similar?

Tim