Re: [PATCH] Add markdown support to contrib/org-man export

2020-06-22 Thread Kyle Meyer
Jb writes:

> Hey Org-mode enthusiasts,
>
> Find attached a patch adding export of manual links for markdown.

Thanks for the patch.

> This is my first contribution (I welcome feedback regarding patch 
> formatting etc).

Looks good.  Things are more lax in contrib/, but commit messages tend
to still follow the format described at
.

Applied, adding a changelog entry to the message, in 2fa1dc34b.



Bug: Clock table documentation [9.3.7 (release_9.3.7-644-ge3a724 @ /home/nick/elisp/org-mode/lisp/)]

2020-06-22 Thread Nick Dokos



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


There is a sentence in the section "The clock table" of doc/org-manual.org
that seems to have been clipped. It's part of the paragraph that begins
on line 6600 of that file:

,
| The =#+BEGIN= line and specify a number of options to define the
| scope, structure, and formatting of the report.  Defaults for all
| these options can be configured in the variable
| ~org-clocktable-defaults~.
`

There's obviously something garbled there, but I'm not sure how it should go.


Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, 
cairo version 1.16.0)
 of 2020-06-15
Package: Org mode version 9.3.7 (release_9.3.7-644-ge3a724 @ 
/home/nick/elisp/org-mode/lisp/)
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Not working ob-C sample code

2020-06-22 Thread ian martins
Maybe you could use the C compiler instead of C++, or you could include the
c libraries you need. try these options:

#+begin_src C :var somedata=somedata

#+begin_src C++ :var somedata=somedata :includes '( 
)

On Mon, Jun 22, 2020 at 8:56 PM Naoya Yamashita  wrote:

> Hi! I'm Naoya. This is the first mail to this ML.
>
> First, thank you for developing such awesome packages!
>
> I found ob-C sample[1] is not working for me, I report that to this ML.
>
> [1]:
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.org.html
>
> ## Repro step
> 1. Require org and ob-C.
> 2. Write below in some org buffer.
> ```org
> #+tblname: somedata
> | nb| sqr | noise |
> |---+-+---|
> | zero  |   0 |  0.23 |
> | one   |   1 |  1.31 |
> | two   |   4 |  4.61 |
> | three |   9 |  9.05 |
> | four  |  16 | 16.55 |
>
> #+name: c-table
> #+header: :exports results
> #+begin_src C++ :var somedata=somedata
>   int main()
>   {
> for (int i=0; i   printf ("%2d %7s ", i, somedata_h(i,"nb"));
>   for (int j=1; j const char* cell = somedata[i][j];
> printf ("%5s %5g ", cell, 1000*atof(cell));
>   }
>   printf("\n");
> }
> return 0;
>   }
> #+end_src
> ```
> 3. Babel src block via C-c C-c.
> 4. Error occurred.  I get below error output
> ```
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp: In function ‘int get_column_num(int,
> const char**, const char*)’:
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp:17:9: error: ‘strcmp’ was not declared
> in this scope
>17 | if (strcmp(header[c],column)==0)
>   | ^~
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp:1:1: note: ‘strcmp’ is defined in
> header ‘’; did you forget to ‘#include ’?
>   +++ |+#include 
> 1 |
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp: In function ‘int main()’:
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp:27:5: error: ‘printf’ was not declared
> in this scope
>27 | printf ("%2d %7s ", i, somedata_h(i,"nb"));
>   | ^~
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp:1:1: note: ‘printf’ is defined in
> header ‘’; did you forget to ‘#include ’?
>   +++ |+#include 
> 1 |
> /tmp/babel-kMPbac/C-src-KDQDdx.cpp:30:38: error: ‘atof’ was not declared
> in this scope
>30 |   printf ("%5s %5g ", cell, 1000*atof(cell));
>   |  ^~~~
> zsh:1: permission denied: /tmp/babel-kMPbac/C-bin-EfCzWt
> ```
>
> ## Some note
> - These errors caused because a lack to include some library.
>   - Add some include statement generate and insert it in
> `org-babel-C-utility-header-to-C`?
>   - Add new option for a user preamble and insert it in
> `org-babel-C-expand-C`?
>
> Regards,
>


Not working ob-C sample code

2020-06-22 Thread Naoya Yamashita
Hi! I'm Naoya. This is the first mail to this ML.

First, thank you for developing such awesome packages!

I found ob-C sample[1] is not working for me, I report that to this ML.

[1]: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.org.html

## Repro step
1. Require org and ob-C.
2. Write below in some org buffer.
```org
#+tblname: somedata
| nb| sqr | noise |
|---+-+---|
| zero  |   0 |  0.23 |
| one   |   1 |  1.31 |
| two   |   4 |  4.61 |
| three |   9 |  9.05 |
| four  |  16 | 16.55 |

#+name: c-table
#+header: :exports results
#+begin_src C++ :var somedata=somedata
  int main()
  {
for (int i=0; i’; did you forget to ‘#include ’?
  +++ |+#include 
1 |
/tmp/babel-kMPbac/C-src-KDQDdx.cpp: In function ‘int main()’:
/tmp/babel-kMPbac/C-src-KDQDdx.cpp:27:5: error: ‘printf’ was not declared
in this scope
   27 | printf ("%2d %7s ", i, somedata_h(i,"nb"));
  | ^~
/tmp/babel-kMPbac/C-src-KDQDdx.cpp:1:1: note: ‘printf’ is defined in header
‘’; did you forget to ‘#include ’?
  +++ |+#include 
1 |
/tmp/babel-kMPbac/C-src-KDQDdx.cpp:30:38: error: ‘atof’ was not declared in
this scope
   30 |   printf ("%5s %5g ", cell, 1000*atof(cell));
  |  ^~~~
zsh:1: permission denied: /tmp/babel-kMPbac/C-bin-EfCzWt
```

## Some note
- These errors caused because a lack to include some library.
  - Add some include statement generate and insert it in
`org-babel-C-utility-header-to-C`?
  - Add new option for a user preamble and insert it in
`org-babel-C-expand-C`?

Regards,


Re: [PATCH] Add mode for automatically unhiding emphasis markers in the current region

2020-06-22 Thread Kyle Meyer
Gustavo Barros writes:

> Just an user here, but I'd like to leave my +1 to this proposed feature.
> [...]

Thanks.  That's very useful feedback.

> I can add another thought on the matter.  While prettify-symbols is a
> mode, org-hide-emphasis-markers is an option/variable.  So I wonder if
> the feature would fit better the current state of things in Org as
> either another option/defcustom or by simply expanding the range of
> possible values for org-hide-emphasis-markers (e.g. t, nil,
> not-at-point, not-at-point-right-edge).  But this is just a thought, I'd
> be happy to see this feature be included either way.

Hmm, yeah, that's worth thinking about.  I mentioned eliminating the
org-auto-emphasis-unhide-at-point option, but I didn't consider doing it
by absorbing the values into org-hide-emphasis-markers and dropping the
mode.  Given what org-auto-emphasis-mode does underneath, though, it
does fit quite neatly into a minor mode toggle.



use-package examples?

2020-06-22 Thread William Denton
It could be useful to have some documentation about installing and 
configuring Org with use-package [1].


I just redid my Org config this way, and I'm happy to say it works, though a 
use-package wizard would probably cut it in half.  (To me use-package is 
advanced magic, and I don't understand all the incantations.)


If anyone can suggest some good examples to look at, I'll try starting some 
documentation about it.  I know about Diego Zamboni [2] and Sacha Chua [3], but 
there must be more.  Things with custom faces and such would be especially 
welcome.


Bill

[1] https://github.com/jwiegley/use-package
[2] https://github.com/zzamboni/dot-emacs/
[3] https://github.com/sachac/.emacs.d
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: https://staplr.org/



Bug: ox-md: URL in HTML tables should not use markdown syntax [9.3.1 (9.3.1-dist @ /usr/share/emacs/site-lisp/elpa/org-9.3.1/)]

2020-06-22 Thread Dominique Dumont
Hi

The following org-mode table is exported in plain markdown mode as an
HTML table:

| name   | link   |
|+|
| debian | [[http://www.debian.org][debian]] |

Unfortunately, the link inside the table is exported with Markdown
syntax:



debian
[debian](http://www.debian.org)


This is not allowed according to markdownguide.org : "You can’t use
Markdown syntax inside block-level HTML tags. For example, italic and
**bold** won’t work."

See https://www.markdownguide.org/basic-syntax#html-best-practices

Could you fix ox-md.el to export links (and maybe other markupds) as
HTML inside a table ?

All the best






Emacs  : GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2020-05-17, modified by Debian
Package: Org mode version 9.3.1 (9.3.1-dist @ 
/usr/share/emacs/site-lisp/elpa/org-9.3.1/)

current state:
==
(setq
 org-duration-format '((special . h:mm))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 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-refile-targets '(("~/private/gtd/gtd.org" :maxlevel . 3)
  ("~/private/gtd/someday.org" :level . 1)
  ("~/private/gtd/tickler.org" :maxlevel . 2))
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-agenda-files '("~/private/gtd/inbox.org" "~/private/gtd/gtd.org"
"~/private/gtd/tickler.org")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-plantuml-jar-path "/usr/share/plantuml/plantuml.jar"
 org-mode-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
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 org-eldoc-load)
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 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-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 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-babel-load-languages '((emacs-lisp . t) (shell . t) (perl . t) (js . t) 
(plantuml . t))
 org-link-file-path-type 'relative
 org-export-backends '(md odt latex icalendar html ascii)
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-src-lang-modes '(("redis" . redis) ("php" . php) ("C" . c) ("C++" . c++)
  ("asymptote" . asy) ("bash" . sh) ("beamer" . latex)
  ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist)
  ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . 
tuareg)
  ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql))
 org-occur-hook '(org-first-headline-recenter)
 org-structure-template-alist '(("n" . "notes") ("a" . "export ascii") ("c" . 
"center")
("C" . "comment") ("e" . "example") ("E" . 
"export")
("h" . "export html") ("l" . "export latex") 
("q" . "quote")
("s" . "src") ("v" . "verse"))
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" 
"CANCELLED(c)"))
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-babel-tangle-lang-exts '(("vala" . "vala") ("ruby" . "rb") ("python" . 
"py")
  ("picolisp" . "l") ("ocaml" . "ml") ("maxima" . 
"max")
  ("lua" . "lua") ("lisp" . "lisp") ("LilyPond" . 
"ly")
  ("latex" . "tex") ("java" . "java") ("groovy" . 
"groovy")
  ("clojure" . "clj") ("D" . "d") ("C++" . "cpp")
  ("perl" . "pl") ("emacs-lisp" . "el") ("elisp" . 
"el"))
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-open-link :export
 

[bug?] should ltxpng be ltximg in ox-html?

2020-06-22 Thread Eric S Fraga
Hello,

line 1696 of ox-html.el (up to date version on git) is:

   :alt (if (string-match-p "^ltxpng/" source)
   
I wonder whether "^ltxpng" should actually be "^ltximg"?

Better yet, should it not be built from the value of
org-preview-latex-image-directory, defined as a custom variable and used
in one place in ox-html?  Or have I confused two different aspects of
LaTeX images?  I'm asking because the hardcoded pattern doesn't pick up
the alt= text for accessibility in HTML export of LaTeX fragments.

The same applies to ox-odt, by the way.

Thank you.
-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-645-g945f49



Bug: Inconsistent formatting when terminating bold inside a link [9.3 (release_9.3 @ /usr/share/emacs/27.0.91/lisp/org/)]

2020-06-22 Thread Tom Alexander
When you have a section of bold text that ends inside a link, for example:

  *can you [[http://foo.bar/][terminate *bolds* inside]] links*

Inside emacs it bolds the text "can you terminate bolds" and represents 
"terminate *bolds* inside" as a link, but if you export to any non-text format 
(I tested html, LaTeX to PDF, and ODT) then it breaks the link exporting the 
raw org-mode link syntax.

Expected behavior: I see three options. Naturally in HTML you can't do can 
you http://foo.bar/";>terminate bolds inside links so it could 
either

1. duplicate the bold tag:

can you http://foo.bar/";>terminate bolds inside links

2. or the text inside a link could be considered an independent context from 
the outside text:
can you http://foo.bar/";>terminate bolds inside links

3. or the emacs rendering can be updated to accurately reflect the link being 
broken as it currently is in the exported output.

Reproduced the issue with `emacs -q`. Below is the version/config information:

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-06-09
Package: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/27.0.91/lisp/org/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 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-odt-format-headline-function 'org-odt-format-headline-default-function
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 #[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-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 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-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 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-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-occur-hook '(org-first-headline-recenter)
 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-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-open-link :export 
org-attach-export-link
:complete org-attach-complete-link)
   ("id" :follow org-id-open) ("eww" :follow eww :store 
org-eww-store-link)
   ("rmail" :follow org-rmail-open :store 
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link 
:export org-irc-export)
   ("info" :follow org-info-open :export org-info-export 
:store
org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-export :store
org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete
org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys") 
("file+emacs")
   ("shell" :follow org-link--open-shell)
   ("news" :follow
#[257 "\301\300\302Q!\207" ["news" browse-url ":"] 5 
"\n\n(fn URL)"])
   ("mailto" :follow
#[257 "\301\300\302Q!\207" ["mailto" browse-url ":"] 5 
"\n\n(fn URL)"])
   ("https" :follow
#[257 "\301\300\302Q!\207" ["https" browse-url ":"] 5 
"\n\n(fn URL)"])
   ("http" :follow
#[257 "\301\300\302Q!\207" ["h

Re: [PATCH] Add mode for automatically unhiding emphasis markers in the current region

2020-06-22 Thread Gustavo Barros


Hi Kyle, Hi Shankar,

On Mon, 22 Jun 2020 at 05:40, Kyle Meyer  wrote:

> Shankar Rao writes:
>
>> This patch adds a minor mode that makes emphasis markers be automatically
>> unhidden when the point is inside the region of emphasis and then the
>> markers are rehidden when the point is moved elsewhere. I posted this on
>> /r/orgmode on reddit (
>> https://www.reddit.com/r/orgmode/comments/gss1g4/update_i_made_my_own_sbrorgemphasizemode_that/),
>> and people there suggested that I submit this here as a patch.
>
> I don't prefer my emphasis markers hidden (i.e. I leave
> org-hide-emphasis-markers at nil), so perhaps I'm not the best to judge,
> but that does sound like a nice feature.
>
> I'm hoping others will try this out and give their thoughts.

Just an user here, but I'd like to leave my +1 to this proposed feature.
I did use org-hide-emphasis-markers in the past and I liked it, but
eventually dropped it because of the inconveniences of editing at the
border of an emphasized region.  This proposed feature eliminates the
"which side of the invisible character are we?" ambiguity, so I repute
it very nice indeed.  I would certainly appreciate the inclusion of such
a feature and, since I've been around, I've seen folks demanding
something of the sort (memory here, no hard data).  Indeed, I was one of
the people at Reddit who suggested Shankar submitted this to the list.

I did (lightly) test the code as posted on Reddit, and liked what I
saw.  I tried a number of cases I could think of: multiple lines, nested
emphasis markers etc.  As far as I tried, it did work as advertised.

I also did report a corner case I found:

> The only edge case I found, which in no way mars the absolute coolness
> of this, is when you are actually inserting the emphasis marker. For
> example, if you type *word*. Right after you type the last "*" the
> emphasis will be hidden, even though the point position would have it to
> be shown. Same thing if you select word and "C-c C-x C-f *". You have to
> actually move point, for the mode to work in this situation.

Shankar replied me this behavior is the same in prettify-symbols-mode,
on which the code is based.  I do not use prettify-symbols-mode myself,
but did play with it a little because of this, and could not infer a
regularity, so I must trust Shankar's point here.  And it is indeed just
a corner situation, which has no further implication I can conceive, and
which does not diminish the usefulness of the feature.

I can add another thought on the matter.  While prettify-symbols is a
mode, org-hide-emphasis-markers is an option/variable.  So I wonder if
the feature would fit better the current state of things in Org as
either another option/defcustom or by simply expanding the range of
possible values for org-hide-emphasis-markers (e.g. t, nil,
not-at-point, not-at-point-right-edge).  But this is just a thought, I'd
be happy to see this feature be included either way.

So, thanks Shankar for proposing the patch, and thanks Kyle for
reviewing it.

HTH.
Best,
Gustavo.



Re: [Manual] missing parameter documentation in the Capturing column view paragraph

2020-06-22 Thread Paul Bonaud
Oh right, many thanks for both the answers !

On Sat, 20 Jun 2020 at 07:44, Kyle Meyer  wrote:

> Paul Bonaud writes:
>
> > In the “Capturing column view” paragraph of the Org-mode manual there is
> no
> > mention of the `:match` parameter which was added in
> >
> https://code.orgmode.org/bzg/org-mode/commit/8983ac917b1ca1b46697a5d27655e4ef71fa6537
> >
> > It would be nice to add it in the Manual of org-mode available at
> > https://orgmode.org/manual/Capturing-column-view.html
>
> Thanks for noticing.  It looks like an entry for :match was added by
> Carsten in 1a978953a (2020-03-23).  That commit will be included in the
> 9.4 release.
>
> > If I can contribute via a patch or git please let me know how I can do
> > this. I didn't find the source code of the orgmode.org/manual in the
> wild.
>
> For future reference, it's in the above repo under doc/org-manual.org.
> Patches for other issues are of course very appreciated.  Information on
> contributing is at .
>