Re: [O] FW: [RFC] Link-type for attachments, more attach options

2020-01-14 Thread stardiviner


Gustav Wikström  writes:

> Hi,
>
>> -Original Message-
>> From: Emacs-orgmode  On
>> Behalf Of stardiviner
>> Sent: den 13 januari 2020 14:42
>> To: emacs-orgmode@gnu.org
>> Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options
>> 
>> 
>> I found when I set option ~(setq org-attach-store-link-p t)~. Then attach
>> a file, store file link with =[C-c C-l]=. The stored link. I open this
>> link got error "No such file: ". I tested this with minimal Emacs
>> config. confirmed this problem.
>> 
>
> I cannot reproduce this. In my try with a minimal Emacs (emacs -q) and with 
> only that single customization it works for me. I'm testing it in linux. A 
> wild guess.. Could it be that you used the move operation instead of the copy 
> operation when attaching the file?
>
> Regards
> Gustav

Did you reproduce this issue with =emacs -q= ? That is a built-in Org Mode 
version
which does not contains the latest version =org-attach.el=.

Here is my minimal Emacs config:

#+begin_src emacs-lisp :tangle "~/.config/emacs/minimal-init.el"
(package-initialize)

;;; add my init files directory

(add-to-list 'load-path "/usr/share/emacs/site-lisp/")

(add-to-list 'load-path (expand-file-name "init" user-emacs-directory))

;; recursively load init files.
(let ((default-directory (expand-file-name "init" user-emacs-directory)))
  (setq load-path
(append
 (let ((load-path (copy-sequence load-path))) ; shadow
   (append
(copy-sequence (normal-top-level-add-to-load-path '(".")))
(normal-top-level-add-subdirs-to-load-path)))
 load-path)))

(setq load-prefer-newer t)

;;; [ package.el ] -- Emacs Lisp Package Archive (ELPA)

(require 'package)

(setq package-enable-at-startup nil)

(setq package-menu-async t)

(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))

;;; ELPA Mirrors
;; (setq-default package-archives
;;'(("gnu" . "https://elpa.gnu.org/packages/;)
;;  ("melpa" . "http://melpa.org/packages/;)
;;  ("melpa-stable" . "http://stable.melpa.org/packages/;)
;;  ("marmalade" . "http://marmalade-repo.org/packages/;)
;;  ("org"   . "http://orgmode.org/elpa/;)))

(setq-default package-archives
  '(("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/;)
("org"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/;)
("gnu"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/;)))

(let* ((elpa-archives-dir (expand-file-name "elpa/archives/" 
user-emacs-directory))
   (elpa-gnu-archives-dir (concat elpa-archives-dir "gnu"))
   (elpa-melpa-archives-dir (concat elpa-archives-dir "melpa"))
   (elpa-org-archives-dir (concat elpa-archives-dir "org")))
  (unless (and (file-exists-p elpa-gnu-archives-dir)
   (file-exists-p elpa-melpa-archives-dir)
   (file-exists-p elpa-org-archives-dir))
(package-refresh-contents)))

(package-initialize)

(add-to-list 'display-buffer-alist
 '("^\\*package-build-result\\*"
   (display-buffer-reuse-window display-buffer-below-selected)))


;;; Load `use-package' ahead before `package-initialize' for (use-package org 
:pin manual ...).
;;; [ use-package ]

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile
  (require 'use-package))
(require 'bind-key) ; if you use any `:bind' variant
(use-package delight; if you use `:delight'
  :ensure t)
;; (use-package deminish   ; if you use `:diminish'
;;   :ensure t)

(setq use-package-verbose t ; 'debug: any evaluation errors report to 
`*use-package*` buffer.
  use-package-always-ensure nil)

;;; use latest source code version Org Mode.
(if (not (file-exists-p "~/Code/Emacs/org-mode/lisp/"))
(progn
  (use-package org
:pin org
:ensure t
:preface (setq org-modules nil)
:mode (("\\.org\\'" . org-mode)))
  (use-package org-plus-contrib
:pin org
:ensure t))

  ;; disable Emacs built-in Org Mode
  (delete (format "/usr/local/share/emacs/%s/lisp/org" emacs-version) load-path)
  (delete "/usr/share/emacs/site-lisp/org/" load-path)
  
  (use-package org
:pin manual
:load-path "~/Code/Emacs/org-mode/lisp/"
:defer t
:preface
;; Org Mode modules -- modules that should always be loaded together with 
org.el.
;; t: greedy load all modules.
;; nil: disable all extra org-mode modules to speed-up Org-mode file 
opening.
(setq org-modules nil)
:mode (("\\.org\\'" . org-mode))
:init
;; add source code version Org-mode Info into Emacs.
(with-eval-after-load 'info
  (add-to-list 'Info-directory-list "~/Code/Emacs/org-mode/doc/")
  (info-initialize))
;; load org before using some Org settings.
(require 'org)
(use-package org-plus-contrib
  :pin manual
  

Re: attachment: link type export to HTML invalid attach dir

2020-01-14 Thread stardiviner


Gustav Wikström  writes:

> Hi again,
>
>> -Original Message-
>> From: Emacs-orgmode  On
>> Behalf Of stardiviner
>> Sent: den 14 januari 2020 06:04
>> To: Gustav Wikström 
>> Cc: emacs-orgmode@gnu.org
>> Subject: Re: attachment: link type export to HTML invalid attach dir
>> 
>> [...]
>>
>> Many thanks for really quick patching.
>> 
>> I tested out the new patch, still does not work.
>> 
>> #+begin_src org
>> ,** Strings are not Lists, but Anyway…
>>:PROPERTIES:
>>:ID:   2fd354f3-ac7a-499d-9fe4-a76626bbdb38
>>:END:
>> 
>> In Calva Paredit, strings are treated in much the same way as lists are.
>> Here’s an example showing Slurp and Barf, Forward/Backward List, and Grow
>> Selection.
>> 
>> [[attachment:string-as-list.gif]]
>> 
>> #+end_src
>> 
>> The upper org content is exported as this (HTML page):
>> 
>> #+begin_example
>> Strings are not Lists, but Anyway…
>> 
>> In Calva Paredit, strings are treated in much the same way as lists are.
>> Here’s an example showing Slurp and Barf, Forward/Backward List, and Grow
>> Selection.
>> 
>> file:///home/stardiviner/Org/Wiki/Computer
>> Technology/Programming/Emacs/Data/Emacs Packages/string-as-list.gif
>> #+end_example
>> 
>> You can see:
>> 
>> 1. the link still does not contains the attach directory from ~(org-
>> attach-dir)~.
>> 2. image links are not exported as inline image displayed with ~> src="...">~.
>
> Ah, you're right. I missed a few things. Should be fixed now in master. Care 
> to verify from your end again?
>
> Thanks
> Gustav

I checked out the latest commit "0ac6a9e1f", The ~~ tag is solved. But the
~(org-attach-dir)~ still not work. The exported ~~ inline image 
still
does not contains the attach directory.

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

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



Re: [PATCH] restore window configuration after org-edit-src-exit

2020-01-14 Thread Jack Kamm
By the way -- I just got my copyright papers officially updated for my
current job -- so we don't need to worry about line counts and whatnot
anymore :)

Best,
John "Jack" Kamm



About options to export/tangle block for markdown or html, on a remote tramp ssh relative dir ?

2020-01-14 Thread rey-coyrehourcq
Hi,

I'm using tramp and remote ssh VM with org-mode v9 & org-babel  to
produce reproducible scientific document on web using ox-hugo. 

In this context, to describe my scientific workflow, i'm interested to
display html or markdown block content in my final exported document 
AND export this content as a file (bla.html or bla.org used as input
file for other scripts into org document) in my remote session.

I have a global header arg which define my session on vm  : 

:properties:
:header-args:sh: :dir /ssh:rzine@multipass:/home/rzine/
:end:

To move into different folders using relative or absolute path starting
from this remote :dir i found some weird solution, and ask for other
answer by org experts here : 
https://emacs.stackexchange.com/questions/54914/rewrite-relative-or-absolute-path-from-inherited-tramp-ssh-property-with-org-bab

But i face another problem, in the final document, i'm interest to
display and export html/markdown text, so i use BEGIN_EXPORT block.

#+BEGIN_EXPORT html
...
#+END_EXPORT 

#+BEGIN_EXPORT markdown
...
#+END_EXPORT 

But is it possible using options to :
- export this block as file using :tangle, 
- on a remote :dir using option for #+BEGIN_EXPORT ?

I search a little on the org doc and on the mailling list, but i see
nothing like this.

Thanks for your help,
Best,

-- 


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: [O] FW: [RFC] Link-type for attachments, more attach options

2020-01-14 Thread Gustav Wikström
Hi,

> -Original Message-
> From: Emacs-orgmode  On
> Behalf Of stardiviner
> Sent: den 13 januari 2020 14:42
> To: emacs-orgmode@gnu.org
> Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options
> 
> 
> I found when I set option ~(setq org-attach-store-link-p t)~. Then attach
> a file, store file link with =[C-c C-l]=. The stored link. I open this
> link got error "No such file: ". I tested this with minimal Emacs
> config. confirmed this problem.
> 

I cannot reproduce this. In my try with a minimal Emacs (emacs -q) and with 
only that single customization it works for me. I'm testing it in linux. A wild 
guess.. Could it be that you used the move operation instead of the copy 
operation when attaching the file?

Regards
Gustav



RE: attachment: link type export to HTML invalid attach dir

2020-01-14 Thread Gustav Wikström
Hi again,

> -Original Message-
> From: Emacs-orgmode  On
> Behalf Of stardiviner
> Sent: den 14 januari 2020 06:04
> To: Gustav Wikström 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: attachment: link type export to HTML invalid attach dir
> 
> [...]
>
> Many thanks for really quick patching.
> 
> I tested out the new patch, still does not work.
> 
> #+begin_src org
> ,** Strings are not Lists, but Anyway…
>:PROPERTIES:
>:ID:   2fd354f3-ac7a-499d-9fe4-a76626bbdb38
>:END:
> 
> In Calva Paredit, strings are treated in much the same way as lists are.
> Here’s an example showing Slurp and Barf, Forward/Backward List, and Grow
> Selection.
> 
> [[attachment:string-as-list.gif]]
> 
> #+end_src
> 
> The upper org content is exported as this (HTML page):
> 
> #+begin_example
> Strings are not Lists, but Anyway…
> 
> In Calva Paredit, strings are treated in much the same way as lists are.
> Here’s an example showing Slurp and Barf, Forward/Backward List, and Grow
> Selection.
> 
> file:///home/stardiviner/Org/Wiki/Computer
> Technology/Programming/Emacs/Data/Emacs Packages/string-as-list.gif
> #+end_example
> 
> You can see:
> 
> 1. the link still does not contains the attach directory from ~(org-
> attach-dir)~.
> 2. image links are not exported as inline image displayed with ~ src="...">~.

Ah, you're right. I missed a few things. Should be fixed now in master. Care to 
verify from your end again?

Thanks
Gustav


Inserting a row divider/header into org-babel results

2020-01-14 Thread sergio ruiz
Adding a header to the data
===

  I am presenting some simple data here, but the idea is, I would like
  to programatically add a header to the results of an org-babel
  evaluation. Looking at the results from `data_table', I would like to
  intercept the first line so that I can massage it into the preferred
  output. I am just unsure how to insert the header into my output.

  My goal is to be able to generate the "Preferred result"
  programatically.

  Any Ideas?

  Thanks!


Latex Test
~~

Table test here:


  ,
  | rows = (1..5)
  |   columns = (1..5)
  |   results = []
  |   rows.each_with_index do |row|
  | result_row = []
  | columns.each do |column|
  |   result_row << column * row
  | end
  | results << result_row
  |   end
  |   results
  `

   1   2   3   4   5
   2   4   6   8  10
   3   6   9  12  15
   4   8  12  16  20
   5  10  15  20  25


Preferred result


   column 1  column 2  column 3  column 4  column 5
  --
  2 4 6 810
  3 6 91215
  4 8121620
  510152025




peace,
sergio
photographer, journalist, visionary

Public Key: 
https://pgp.key-server.io/pks/lookup?op=get=0x69B08F58923AB3A2
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
@sergio_101@mastodon.social
https://sergio101.com
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



signature.asc
Description: Message signed with OpenPGP


Re: Src block fontification when scrolled off window

2020-01-14 Thread Fraga, Eric
On Tuesday, 14 Jan 2020 at 07:21, Aaron Jensen wrote:
> In one of my org files, I will occasionally see src blocks lose their
> formatting. [...]
>
> Is this expected behavior? Is there a way to increase the lookback amount?

I don't see this behaviour.  You might want to look at
jit-lock-chunk-size but that's me grasping at straws...


-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.3-34-g2eee3c



Src block fontification when scrolled off window

2020-01-14 Thread Aaron Jensen
Hi,

In one of my org files, I will occasionally see src blocks lose their
formatting. Specifically, if I switch to editing the src block, or I
first open an org file that is expanded to a section with a src block,
if the beginning #+begin_src is scrolled above the window, but part of
the block itself is still visible, the src block will be fontified as
if it were regular text in org. I have org-src-fontify-natively. If I
scroll up so that #+begin_src is in view, it fontifies as expected.

Is this expected behavior? Is there a way to increase the lookback amount?

Thanks,

Aaron