[O] "org-link-set-parameters" get parent properties

2019-01-31 Thread Tarjei Bærland
Hi!

I have a custom function for exporting image links in org-mode (I have my
html exported to the parent folder of my .org files, and I just want to
keep one copy of the image files).

How can I get the "attr_html" of the link for a custom
org-set-link-parameters function? As far as I can tell, the :export wants a
function taking (path desc backend), and I do not know how to extract the
parent of the link from this.

Thanks in advance!

Regards,
Tarjei


[O] org-set-link-parameters get html attributes

2018-08-22 Thread Tarjei Bærland
Hello!

I have created a custom link format in org mode, [[fig:path][desc]],
defined as

(org-link-set-parameters
   "fig"
   :follow (lambda (path)
(org-open-file-with-emacs
 (format "../figurer/%s" path)))
   :export (lambda (path desc backend)
(cond
 ((eq backend 'html)
  (format (concat "")
  path (or desc path))

I need this to be able to have one copy of the images, while having .org
and exported .html files in different directory levels.

However, if I now want to export an image with html attributes and caption,
e.g.

#+CAPTION:A caption
#+HTML_ATTR: :width 150px
[[fig:figname.png][Alt text]]

This ends up as





How can I get my new link format to include html attributes? All help much
appreciated!

Regards,

Tarjei


[O] Bug: Python block, print function in session [9.1.1 (9.1.1-6-gd40deb-elpa @ c:/Users/tabaa004/Dropbox/home/.emacs.d/elpa/org-20170925/)]

2018-06-06 Thread Tarjei Bærland
Hi!

The following src block prints correctly if run in non-session mode, it
does not print at all if the :session keyword is set.

#+BEGIN_SRC python :results output org
a, b = 0, 1

while b < 1000:
a, b = b, a + b
print(a, end=" ")
#+END_SRC

#+RESULTS:
#+BEGIN_SRC org
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
#+END_SRC

Is this expected behavior?

Kind regards,
Tarjei Bærland





Emacs  : GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)
 of 2015-07-25 on KAEL
Package: Org mode version 9.1.1 (9.1.1-6-gd40deb-elpa @
c:/Users/tabaa004/Dropbox/home/.emacs.d/elpa/org-20170925/)

current state:
==
(setq
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-footnote-section "nil"
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-agenda-skip-timestamp-if-done t
 org-occur-hook '(org-first-headline-recenter)
 org-src-tab-acts-natively t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-src-window-setup '(current-window)
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width nil
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-export-with-section-numbers nil
 org-export-with-toc nil
 org-list-allow-alphabetical t
 org-agenda-skip-scheduled-if-done t
 org-agenda-custom-commands '(("h" "Agenda og hjemme"
   ((agenda ""
 ((org-agenda-span 14)
  (org-deadline-warning-days 14)
  (org-agenda-prefix-format "")
  (org-agenda-filter-preset (quote
("-jobb"
 )
)
   )
  ("j" "Jobb i dag og i morra"
   ((agenda ""
 ((org-agenda-span 2)
  (org-agenda-filter-preset (quote
("+jobb")))
  (org-agenda-prefix-format "%t "))
 )
(todo "TODO"
 ((org-agenda-filter-preset (quote
("+jobb")))
  (org-agenda-max-entries 0))
 )
)
   )
  )
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-agenda-include-diary t
 org-startup-indented t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-capture-mode-hook '(delete-other-windows)
 org-from-is-user-regexp nil
 org-html-postamble nil
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-tags-column -94
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-html-footnotes-section "\n%s\n\n\n%s\n\n"
 org-trigger-hook '(taba-write-journal-on-todo)
 org-mode-hook '(visual-fill-column-mode visual-line-mode
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-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-refile-targets '((nil :maxlevel . 2) (org-agenda-files :maxlevel . 2))
 org-export-coding-system 'utf-8
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-refile-use-outline-path 'file
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-todo-keywords '((sequence "TODO" "|" "DONE")
 (sequence "." "