Re: emacs-orgmode@gnu.org New Sign-in to your account

2020-09-16 Thread Bastien
The mail above is just spam, please ignore.

-- 
 Bastien



[PATCH] org.el: Allow transparent background in latex images

2020-09-16 Thread Roshan Shariff
* lisp/org.el (org-create-formula-image): When `:background' is set to
"Transparent" in `org-format-latex-options', do not output a
`\pagecolor{...}' command in the generated LaTeX file.  This will
cause dvisvgm, convert, or dvipng (with the `-bg Transparent' option)
to produce png or svg images with a transparent background.

* lisp/org.el (org-preview-latex-process-alist): Add the `-bg
Transparent' command-line option to dvipng, which causes it to produce
a PNG with an alpha channel when the dvi file has no `\background'
special.

TINYCHANGE
---
 lisp/org.el | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 053635c85..108dc6b5b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3282,7 +3282,7 @@ All available processes and theirs documents can be found 
in
  :image-output-type "png"
  :image-size-adjust (1.0 . 1.0)
  :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
- :image-converter ("dvipng -D %D -T tight -o %O %f"))
+ :image-converter ("dvipng -D %D -T tight -bg Transparent -o %O %f"))
 (dvisvgm
  :programs ("latex" "dvisvgm")
  :description "dvi > svg"
@@ -16146,10 +16146,10 @@ a HTML file."
 (if (eq fg 'default)
(setq fg (org-latex-color :foreground))
   (setq fg (org-latex-color-format fg)))
-(if (eq bg 'default)
-   (setq bg (org-latex-color :background))
-  (setq bg (org-latex-color-format
-   (if (string= bg "Transparent") "white" bg
+(setq bg (cond
+ ((eq bg 'default) (org-latex-color :background))
+ ((string= bg "Transparent") nil)
+ (t (org-latex-color-format bg
 ;; Remove TeX \par at end of snippet to avoid trailing space.
 (if (string-suffix-p string "\n")
 (aset string (1- (length string)) ?%)
@@ -16158,8 +16158,10 @@ a HTML file."
   (insert latex-header)
   (insert "\n\\begin{document}\n"
  "\\definecolor{fg}{rgb}{" fg "}%\n"
- "\\definecolor{bg}{rgb}{" bg "}%\n"
- "\n\\pagecolor{bg}%\n"
+ (if bg
+ (concat "\\definecolor{bg}{rgb}{" bg "}%\n"
+ "\n\\pagecolor{bg}%\n")
+   "")
  "\n{\\color{fg}\n"
  string
  "\n}\n"
-- 
2.26.2




Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Nick Dokos wrote:

> (setq org-latex-tables-centered nil)

Yes! :) Thanks :)

That took a couple of messages... :O

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: creating png images in emails with org-mode

2020-09-16 Thread Nick Dokos
Joseph Vidal-Rosset  writes:

> Hello,
>
> One more time, my setup to create png image via LaTeX in email in org-mode is 
> broken.
>
> I get this error message:
>
> Creating LaTeX preview...
> org-compile-file: File "/tmp/orgtex2wp50c.png" wasn’t produced.  Please 
> adjust ‘imagemagick’ part of ‘org-preview-latex-process-alist’.
>
> Your help is welcome, because I do not understand what I have to do, how I 
> have to "adjust" imagemagick.
>
> Best wishes,
>
> Jo.
>

Apparently, recent versions of ImageMagick (version 7 seems to be one)
on (perhaps) some distros ship with a
/etc/ImageMagick-/policy.xml file that imposes restrictions
on what can be done. Here's an SE question with some information:


https://emacs.stackexchange.com/questions/31408/error-message-when-previewing-latex-snippet-in-org-file

-- 
Nick

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




Re: eldoc recursion error

2020-09-16 Thread Kyle Meyer
James N V Cash writes:

> I've attached a patch that addresses the recursion issue with Emacs 28
> and shows eldoc properly with example python. It presumably should act
> the same with older versions of Emacs, although I haven't tested.

Thanks for the patch!  For information about the expected commit message
format, please see .

> diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
> index 3b0999340..ccc23b523 100644
> --- a/contrib/lisp/org-eldoc.el
> +++ b/contrib/lisp/org-eldoc.el
> @@ -116,9 +116,12 @@
>  (when (fboundp mode-func)
>(with-temp-buffer
>  (funcall mode-func)
> -(setq doc-func (and eldoc-documentation-function
> -(symbol-value 
> 'eldoc-documentation-function)))
> -(puthash lang doc-func org-eldoc-local-functions-cache))
> + (setq doc-func (if (boundp 'eldoc-documentation-functions)
> +(car eldoc-documentation-functions)
> +(and eldoc-documentation-function
> + (symbol-value 
> 'eldoc-documentation-function
> +
> + (puthash lang doc-func org-eldoc-local-functions-cache))
>doc-func)
>cached-func)))

Okay, so when eldoc-documentation-functions is defined (Emacs >=28), we
take the first function and go with it.  That might not be exactly what
you'd see in the native buffer, depending on whether there are other
members of eldoc-documentation-functions and how they interact.  (I'm
being vague, because I don't really know anything about eldoc, but it
seems like that must be the case.)  Anyway, I'd guess it will be good
enough in most cases, and it's certainly better than the recursion
error.

However, the docstring of eldoc-documentation-functions says

Each hook function is called with at least one argument CALLBACK,
a function, and decides whether to display a doc short string
about the context around point.

But downstream in org-eldoc-documentation-function, the function is
called with no arguments:

(t (let ((doc-fun (org-eldoc-get-mode-local-documentation-function lang)))
 (when (functionp doc-fun) (funcall doc-fun

That happens to work with python-eldoc-function, whose signature is
( _ignored), but it may error with other valid eldoc functions.
So, at the very least, I think we should wrap the call in a
condition-case with a wrong-number-of-arguments handler.

Thoughts?



Re: basic org questions

2020-09-16 Thread Nick Dokos
Emanuel Berg via "General discussions about Org-mode."  
writes:

> Matt Huszagh wrote:
>
>> Were you referring to the tables being centered
>> after export (I see from another part of this chain
>> that that's what you were referring to in the 3rd
>> question) when you wanted them left-aligned?
>> If that is the case, it would really help if you
>> specify that in your original question.
>> Appearance in an org-mode buffer and appearance in
>> the PDF, HTML, etc. after export are very different
>> things with very different configuration.
>
> Yes, after export to PDF, they are centered. they =
> the whole table items.

(setq org-latex-tables-centered nil)

-- 
Nick

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




[PATCH] org.el: Fix regression in handling of empty #+TAGS

2020-09-16 Thread Kyle Meyer
Allen Li writes:

> Previously, placing an empty #+TAGS: in a file would override
> org-file-tags for the file.  In 9.4, an empty #+TAGS: is ignored and
> org-file-tags is used.
>
> The relevant code in org.el:
>
>   (setq org-current-tag-alist
>   (org--tag-add-to-alist
>org-tag-persistent-alist
>(let ((tags (mapconcat #'identity
>   (cdr (assoc "TAGS" alist))
>   "\n")))
>  (if (org-string-nw-p tags) (org-tag-string-to-alist tags)
>org-tag-alist
>
> This regression is undesirable because I have a set of common
> org-file-tags for most files, but one particular file where
> automatically detecting the existing tags in the file works better (the
> default behavior when org-current-tag-alist is empty).

Thanks reporting.  That change in behavior came with b4e91b7e9 (New
function: org-collect-keywords, 2020-04-26), and I'm not seeing anything
in that commit that indicates it was intentional.

The following patch should restore the previous behavior.  I'll apply it
in a couple of days if no objections come in.

-- >8 --
Subject: [PATCH] org.el: Fix regression in handling of empty #+TAGS

* lisp/org.el (org-set-regexps-and-options): Allow an empty #+TAGS
value to override org-tag-alist, as it did before v9.4.
* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
test.

As of b4e91b7e9 (New function: org-collect-keywords, 2020-04-26), a
"#+TAGS" header can no longer be used to override a value of
org-tag-alist.  This breaks the workflow where a set of tags for most
files is defined via org-file-tags and then, in a particular file, an
empty #+TAGS header is used to ignore org-file-tags and trigger
collecting tags from the buffer instead.  Rework the handling to
restore this behavior.

Reported-by: Allen Li 
Ref: https://orgmode.org/list/80y2laly9v@felesatra.moe
---
 lisp/org.el  | 8 
 testing/lisp/test-org.el | 5 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index efdf4e3fc..a1930a012 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4279,10 +4279,10 @@ (defun org-set-regexps-and-options ( tags-only)
   (setq org-current-tag-alist
(org--tag-add-to-alist
 org-tag-persistent-alist
-(let ((tags (mapconcat #'identity
-   (cdr (assoc "TAGS" alist))
-   "\n")))
-  (if (org-string-nw-p tags) (org-tag-string-to-alist tags)
+(let ((tags (cdr (assoc "TAGS" alist
+  (if tags
+  (org-tag-string-to-alist
+   (mapconcat #'identity tags "\n"))
 org-tag-alist
   (setq org-tag-groups-alist
(org-tag-alist-to-groups org-current-tag-alist))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 1d48bae72..38bab1af9 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2457,6 +2457,11 @@ (ert-deftest test-org/set-regexps-and-options ()
(org-test-with-temp-text "#+TAGS: [ A : B C ]"
  (org-mode-restart)
  org-tag-groups-alist
+  (should-not
+   (let ((org-tag-alist '(("A"
+ (org-test-with-temp-text "#+TAGS:"
+   (org-mode-restart)
+   org-current-tag-alist)))
   ;; FILETAGS keyword.
   (should
(equal '("A" "B" "C")

base-commit: 73c929e3b507db9ee2867d35d10c8f393ff4d38d
-- 
2.28.0





Keep Org mode submodules in Emacs, please!

2020-09-16 Thread Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

[Resending to cater to prissy mailer]

Redesigning Org mode so that its secondary features are more modular,
and integrate better individually into Emacs, would be a big
improvement.

When the reorganization is finished, please keep all of the code
inside Emacs.  Each piece should be in Emacs core, or in GNU ELPA,
whichever seems more convenient.  Those are places we can refer to.
Please do not move any of the code to MELPA, because we will not refer
to it there.

I am not on the emacs-orgmode list.  Russell, if you get this directly
but it does not come through the list, would you please forward it
there?

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Re: Configuring text export block output

2020-09-16 Thread Tim Quelch


> I don't think ox-ascii has an option to control that, but you could get
> the behavior you're after by creating a derived backend.  In fact, the
> section of the manual that covers derived backends provides an example
> of extending the ox-ascii backend to tweak the rendering of the source
> blocks.

Thank you that is exactly what I was looking for. I must have missed that
example when I was looking through the docs.

Thanks,

Tim Quelch




Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Jeff Filipovits

Adam Spiers  writes:

Hrm, no this isn't good enough.  For graphical windows we still 
need
to set the display text properties to align all tags when the 
buffer
initially loads.  AFAICS there's currently no code to trigger 
this, so
it would need to be added, and for large files this might 
actually

cause problems with file loading time unless it was done in the
background (a bit like fontification can be done).


Initial test had some problems on my end. I have a couple 
ideas. Will try to write something tomorrow. Hopefully someone 
will chime in otherwise.



The upside of this is that it enabled me do to some hacking so now 
I can use a variable pitch font in the mu4e headers view and keep 
the columns aligned, which makes mu4e much prettier. 



--
Jeff Filipovits
Spears & Filipovits, LLC
1126 Ponce de Leon Avenue
Atlanta, GA 30306
678.237.9302 (direct)
j...@civil-rights.law

All emails confidential to the fullest extent of the law.



Re: pcase failure with Emacs 24 (was Emacs version for Org 9.4?)

2020-09-16 Thread Kyle Meyer
Jens Lechtenboerger writes:

> On 2020-09-15, Kyle Meyer wrote:
>
>> It is pretty tricky to debug, but the failure starts with 4a27b67fd
>> (org-element: Fix property drawers parsing, 2020-04-22).  As far as I
>> can see, the pattern introduced there is perfectly valid and should be
>> compatible with Emacs 24.  I'd _guess_ this is a pcase bug in Emacs 24,
>> particularly the one fixed by 528872c5f8 (bug#18554, 2014-09-27), but I
>> didn't make an effort to try to understand that commit.
>>
>> Interestingly, the error goes away if I just swap the elements in the
>> pcase (and ...) pattern added by that commit.  Dunno, but if that clears
>> up the failure on your end as well, I don't see any reason to not make
>> that change.
>>
>>
>> diff --git a/lisp/org-element.el b/lisp/org-element.el
>> [...]
>
> Yes, that fixes the problem over here.

Thanks for confirming.  Pushed (73c929e3b).



Re: Configuring text export block output

2020-09-16 Thread Kyle Meyer
Tim Quelch writes:

> For example if I have a source block
>
> #+begin_src python
> Some code here
> with multiple lines
> #+end_src
>
> With `org-ascii-export-as-ascii` the above block gives:
>
> ,
> | Some code here
> | with multiple lines
> `
>
> I don't really like this as the '|' at the start of the lines make it
> annoying to copy and paste. Is there a way to configure the export to
> give something surrounded by backticks?
>
> ```python
> Some code here
> with multiple lines
> ```
>
> I've had a look into the available `org-ascii-*` customise variables and
> I couldn't see anything which looked to give this functionality.

I don't think ox-ascii has an option to control that, but you could get
the behavior you're after by creating a derived backend.  In fact, the
section of the manual that covers derived backends provides an example
of extending the ox-ascii backend to tweak the rendering of the source
blocks.

(info "(org)Advanced Export Configuration")

You'd only need to modify that slightly, rewriting the
my-ascii-src-block function to do what you want.  Something like

(defun my-ascii-src-block (src-block contents info)
  (concat "```" (org-element-property :language src-block) "\n"
  (org-element-normalize-string
   (org-export-format-code-default src-block info))
  "```"))



Re: official orgmode parser

2020-09-16 Thread Ihor Radchenko
> So basically this is what this thread is about. One needs a working 
> Emacs instance and work in "push" mode to export any Org data. This 
> requires dealing with temporary files, as described above, and some 
> ad-hoc formats to keep whatever data I need to pull from org.

> "Pull" mode would be preferred. I could then, say, write a script in 
> Guile, execute 'emacs -batch' to export org data (I'm ok with that), 
> then parse the S-expressions to get what I need.

My choice to use "push" mode is just for performance reasons. Nothing
prevents you from writing a function called from emacs --batch that
converts parsed org data into whatever format your Guile script prefers.
That function may be either on Emacs side or on Guile side. Probably,
Emacs has more capabilities when dealing with s-expressions though.

You can even directly push the information from Emacs to API server.
You may find https://github.com/tkf/emacs-request useful for this task.

Finally, you may also consider clock tables to create clock summaries
using existing org-mode functionality. The tables can be named and
accessed using any programming language via babel.

Best,
Ihor


Przemysław Kamiński  writes:

> On 9/16/20 2:02 PM, Ihor Radchenko wrote:
>>> However what Ihor presented is interesting. Do you use similar approach
>>> with shellout and 'emacs -batch' to show currently running task or you
>>> 'push' data from emacs to show it in the taskbar?
>> 
>> I prefer to avoid querying emacs too often for performance reasons.
>> Instead, I only update the clocking info when I clock in/out in emacs.
>> Then, the clocked in time is dynamically updated by independent bash
>> script.
>> 
>> The scheme is the following:
>> 1. org clock in/out in Emacs trigger writing clocking info into
>> ~/.org-clock-in status file
>> 2. bash script periodically monitors the file and calculates the clocked
>> in time according to the contents and time from last modification
>> 3. the script updates simple textbox widget using awesome-client
>> 4. the script also warns me (notify-send) when the weighted clocked in
>> time is negative (meaning that I should switch to some more
>> productive activity)
>> 
>> Best,
>> Ihor
>> 
>> Przemysław Kamiński  writes:
>> 
>>> On 9/16/20 9:56 AM, Ihor Radchenko wrote:
> Wow, another awesomewm user here; could you share your code?

 Are you interested in something particular about awesome WM integration?

 I am using simple textbox widgets to show currently clocked in task and
 weighted summary of clocked time. See the attachments.

 Best,
 Ihor




 Marcin Borkowski  writes:

> On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:
>
>> So, I keep clock times for work in org mode, this is very
>> handy. However, my customers require that I use their service to
>> provide the times. They do offer API. So basically I'm using elisp to
>> parse org, make API calls, and at the same time generate CSV reports
>> with a Python interop with org babel (because my elisp is just too bad
>> to do that). If I had access to some org parser, I'd pick a language
>> that would be more comfortable for me to get the job done. I guess it
>> can all be done in elisp, however this is just a tool for me alone and
>> I have limited time resources on hacking things for myself :)
>
> I was in the exact same situation - I use Org-mode clocking, and we use
> Toggl at our company, so I wrote a simple tool to fire API requests to
> Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
> It's a bit more than 200 lines of Elisp, so you might try to look into
> it and adapt it to whatever tool your employer is using.
>
>> Another one is generating total hours report for day/week/month to put
>> into my awesomewm toolbar. I ended up using orgstat
>> https://github.com/volhovM/orgstat
>> however the author is creating his own DSL in YAML and I guess things
>> were much better off if it all stayed in some Scheme :)
>
> Wow, another awesomewm user here; could you share your code?
>
> Best,
>
> -- 
> Marcin Borkowski
> http://mbork.pl
>>>
>>>
>>> I don't have interesting code, just standard awesomevm setup. I run
>>> periodic script to output data computed by orgstat and show it in the
>>> taskbar (uses the shellout_widget).
>>>
>>> However what Ihor presented is interesting. Do you use similar approach
>>> with shellout and 'emacs -batch' to show currently running task or you
>>> 'push' data from emacs to show it in the taskbar?
>>>
>>> P.
>
>
> So basically this is what this thread is about. One needs a working 
> Emacs instance and work in "push" mode to export any Org data. This 
> requires dealing with temporary files, as described above, and some 
> ad-hoc formats to keep whatever data I need to pull from org.
>
> "Pull" mode would be 

Re: basic org questions

2020-09-16 Thread Thomas S. Dye
Yes, of course.  But first you need to write a style or class 
file.


All the best,
Tom

Emanuel Berg via General discussions about Org-mode. writes:


Thomas S Dye wrote:


There are many pieces of software that will allow
the user to the violate best typesetting practices
easily. LaTeX is not one of them.


In my experience, you can typeset whatever you want
with LaTeX, and in any way that you want.

non-fiction book:

  https://dataswamp.org/~incal/borta/borta.pdf

math teacher ad:

  https://dataswamp.org/~incal/about/matte.pdf

university paper:

  https://dataswamp.org/~incal/hs-linux/docs/report/report.pdf

(don't even remember what this was supposed to be)

  https://dataswamp.org/~incal/fps/cis/task_flow_demo.pdf



--
Thomas S. Dye
https://tsdye.online/tsdye



Configuring text export block output

2020-09-16 Thread Tim Quelch
Hi all,

Is there a way to configure how text is exported in ascii?

For example if I have a source block

#+begin_src python
Some code here
with multiple lines
#+end_src

With `org-ascii-export-as-ascii` the above block gives:

,
| Some code here
| with multiple lines
`

I don't really like this as the '|' at the start of the lines make it
annoying to copy and paste. Is there a way to configure the export to
give something surrounded by backticks?

```python
Some code here
with multiple lines
```

I've had a look into the available `org-ascii-*` customise variables and
I couldn't see anything which looked to give this functionality.
Preferably I'd love a way if I could configure this locally and
programatically, as in some contexts I might still want the "prettier"
output of the default, but in other contexts I might want the more
"practical" output of backticks.

Side question: Perhaps what I am wanting can be achieved with markdown
export, however it seems that the default markdown exporter exports code
indented. This has the same problem of being frustrating to copy-paste.
Is there a way to configure the md exporter to use fenced code blocks?

Thanks,

Tim Quelch



Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Thomas S Dye wrote:

> There are many pieces of software that will allow
> the user to the violate best typesetting practices
> easily. LaTeX is not one of them.

In my experience, you can typeset whatever you want
with LaTeX, and in any way that you want.

non-fiction book:

  https://dataswamp.org/~incal/borta/borta.pdf

math teacher ad:

  https://dataswamp.org/~incal/about/matte.pdf

university paper:

  https://dataswamp.org/~incal/hs-linux/docs/report/report.pdf

(don't even remember what this was supposed to be)

  https://dataswamp.org/~incal/fps/cis/task_flow_demo.pdf

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Stefan Nobis wrote:

> #+attr_latex: :center nil :booktabs t
> | My | Columns |
> |+-|
> |  1 |   2 |
> |  3 |   4 |

"PDF file produced with errors."

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
tomas wrote:

> Or just ask around here, but best with concrete,
> little goals each time.

?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
TEC wrote:

> You see, strangely enough - if you want to tweak
> the result of Org exporting to LaTeX, you have to
> write LaTeX :P

I got it to work. Thanks for your help. I'm not
abandoning org-mode just yet...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Adam Spiers
On Wed, Sep 16, 2020 at 11:55:53PM +0100, Adam Spiers wrote: 
I've actually managed it get it working now!  See the attached patch. 
However unfortunately it is not ready to be merged yet.  Firstly, it 
breaks `test-org/tag-align'.  Secondly, since this changes the method 
of alignment from simply using raw spaces to using a single space with 
a display text property, when the file is saved and reloaded, it just 
displays a single space and the alignment is lost.  Another 
unfortunate side-effect is that if the file is simultaneously 
displayed in a graphical window and a text window via the same emacs 
server (e.g. via emacsclient -t), then one of the two windows will 
have incorrect alignment. 

So I think the correct fix will be to keep the original number of 
spaces, but use a display text property to redisplay those spaces as a 
single space with the given width.  I'm guessing that the display text 
property will be ignored on text-only (tty) windows, fixing both 
problems in one go. 

So I'll take another stab at this soon, if Bastien or some other Org 
guru can confirm I'm on the right track. 


Hrm, no this isn't good enough.  For graphical windows we still need 
to set the display text properties to align all tags when the buffer 
initially loads.  AFAICS there's currently no code to trigger this, so 
it would need to be added, and for large files this might actually 
cause problems with file loading time unless it was done in the 
background (a bit like fontification can be done). 

Advice on how to handle this best is very welcome. 



Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Samuel Wales wrote:

>> Marking paragraphs by blank lines and without
>> indentation is deemed less readable (see for
>> example section 3.10 "Marking Paragraphs" in
>> https://komascript.de/~mkohm/scrguien.pdf). [...]
>
> for my part, i appreciate your using the "wrong"
> style for your email message, as my brain works
> significantly better with it. [i am not talking
> about anybody else's brain.]

:)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: how to exclude a file from appearing in the refile target cache?

2020-09-16 Thread Kyle Meyer
swedebugia writes:

>> > On Sep 15, 2020, at 3:37 PM, swedebugia 
[...]
>> > I read:
>> > https://orgmode.org/manual/Refile-and-Copy.html
>> > 
>> > But its unclear to me how to exclude a file from appearing in the
>> > refile target cache.
[...]
>> You can use org-refile-targets to explicitly tell which files to
>> include when you want to Copy and Refile. I am not near my computer,
>> otherwise I would have shared an example.
>
> Thanks! This should be added in the manual page linked above I think.

That section does mention org-refile-targets under org-refile:

By default, all level 1 headlines in the current buffer are
considered to be targets, but you can have more complex definitions
across a number of files.  See the variable ~org-refile-targets~ for
details.

Is there something else in particular you'd like to see there?



Re: Help administer code.orgmode.org: moderate user access and manage the gogs instance

2020-09-16 Thread Adam Spiers
On Wed, 16 Sep 2020 at 08:21, Bastien  wrote:
> Hi Timothy,
>
> TEC  writes:
>
> >> Is anyone willing to help with (1) and/or (2)?
> >
> > I'm willing to give (2), and potentially (1) a shot :)
>
> Thanks a lot!  I wrote you offlist about this.

It's not nearly as generous an offer, but as I don't have a gogs
account yet, I volunteer to be a guinea pig if TEC wants to practice
giving (1) a shot ;-)

I think I used to have push access to Worg many years ago, and I've
noticed one or two issues which I'd be happy to fix if I regained
that.  Or is Worg also subject to a peer review process these days?

Cheers,
Adam



Re: basic org questions

2020-09-16 Thread Samuel Wales
On 9/16/20, Stefan Nobis  wrote:
> Marking paragraphs by blank lines and without indentation is deemed
> less readable (see for example section 3.10 "Marking Paragraphs" in
> https://komascript.de/~mkohm/scrguien.pdf).
>
> But if you really insist on using this style, still the variant of
> setting the length parindent and parskip is considered bad practise.

for my part, i appreciate your using the "wrong" style for your email
message, as my brain works significantly better with it.  [i am not
talking about anybody else's brain.]



Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Adam Spiers
On Wed, Sep 16, 2020 at 03:03:02PM -0400, Jeff Filipovits wrote: 
It looks like (window-text-pixel-size) could be used to calculate the 
pixel length of the tags list? 


Ahah!  This indeed did the trick!  I have no idea how I missed this 
handy function previously when I was scouring the manual... 

I am having trouble deciphering the 
manual (https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification) 
for pixel specification for spaces, though. The right alignment 
specification for some reason sends the tags to the next line, as do 
most other solutions that I would expect to align the text to the 
right side of the window. 

I can experiment more in a couple days, but in the meantime maybe 
someone smarter than me give some hints on how to use the pixel 
specification properties. 


I've actually managed it get it working now!  See the attached patch. 
However unfortunately it is not ready to be merged yet.  Firstly, it 
breaks `test-org/tag-align'.  Secondly, since this changes the method 
of alignment from simply using raw spaces to using a single space with 
a display text property, when the file is saved and reloaded, it just 
displays a single space and the alignment is lost.  Another unfortunate 
side-effect is that if the file is simultaneously displayed in a graphical 
window and a text window via the same emacs server (e.g. via emacsclient -t), 
then one of the two windows will have incorrect alignment. 

So I think the correct fix will be to keep the original number of 
spaces, but use a display text property to redisplay those spaces as a 
single space with the given width.  I'm guessing that the display text 
property will be ignored on text-only (tty) windows, fixing both 
problems in one go. 

So I'll take another stab at this soon, if Bastien or some other Org 
guru can confirm I'm on the right track. 

BTW I tried your code and for some reason it didn't insert any space 
for me, but I didn't look into that yet. 


The way it’s written it would only reduce the gap between the headline 
and tags to a space, and it assumes there are multiple spaces there 
already. If there’s no space between the two, I don’t think it’ll 
insert one. Probably not the best way as it was thrown together to 
test the text property fix. 


I figured out that it wasn't working because my `org-tags-column' is a 
negative value in order to align flush-right, and your code didn't 
support that. 

I accepted long ago that the solution to using a variable pitch font 
for org headings was that the tags would not be aligned to the right 
and never looked back, so maybe this is not worth the price of fixing 
it if it is messy. And diving down to calculating the pixel width of 
text seems like it’s getting pretty messy. 


Actually I think it ended up fairly clean.  Huge thanks to you for 
giving me the hint I needed!  I just adapted your code a bit.  I've 
marked you as a co-author in the commit message.  For now your 
contribution probably still falls into the category of "Tiny changes": 


https://orgmode.org/worg/org-contribute.html#org9fbb342

However you might want to preemptively sign the copyright assignment 
papers: 


https://orgmode.org/worg/org-contribute.html#copyrighted-contributors
>From 7655c32847d7abd9da7603b1a1a314b7d1b87ba5 Mon Sep 17 00:00:00 2001
From: Adam Spiers 
Date: Wed, 16 Sep 2020 23:12:04 +0100
Subject: [PATCH] [WIP] org.el: Align tags using specified space display property
To: emacs-orgmode@gnu.org

Previously tags on heading lines were aligned using spaces, which
assumed a fixed width font.  However variable pitch fonts are becoming
increasingly popular, so ensure there is always a single space in
between the heading text and the (colon-delimited) list of tags, and
then if necessary use a display text property to specify the exact
width required by that space to align it in accordance with the value
of `org-tags-column' which the user has chosen:

  https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification

If the value is positive, align flush-left; if negative, align
flush-right; and if zero, just leave a normal width space.

See the following links for the discussion threads leading to this
patch:

- https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00415.html
- https://gitlab.com/protesilaos/modus-themes/-/issues/85

Signed-off-by: Adam Spiers 
Co-authored-by: Jeff Filipovits 
---
 lisp/org.el | 68 ++---
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 053635c85..e800eb642 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11831,35 +11831,45 @@ (defun org-toggle-tag (tag  onoff)
   res)))
 
 (defun org--align-tags-here (to-col)
-  "Align tags on the current headline to TO-COL.
-Assume point is on a headline.  Preserve point when aligning
-tags."
-  (when (org-match-line 

Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Stefan Nobis wrote:

>> #+latex_header: \setlength{\parindent}{0pt}
>> #+latex_header: \setlength{\parskip}{\baselineskip}
>
> Better use
>
> #+latex_header: \usepackage{parskip}
>
> as this package has less bad side-effects on other
> parts of the document than setting these far-reaching
> lengths directly.

OK, but the values still ned to be specified, right?

Or you mean all three:

  #+latex_header: \usepackage{parskip}
  #+latex_header: \parskip   1.5ex
  #+latex_header: \parindent   0pt

?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Stefan Nobis wrote:

> But otherwise I second your recommendation to not
> use this style of marking paragraphs if not
> absolutely required.

Well, I'm not exactly required to do anything, but
I know what I think something should look like...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Tim Cross wrote:

>> #+latex_header: \parskip   1.5ex
>> #+latex_header: \parindent   0pt
>
> Note that I agree with the other post recommending
> using the parskip package as a better solution.
> I had forgotten about that package when I posted
> the above, which is really just a dirty hack.

Yeah? Looks OK to me :)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: basic org questions

2020-09-16 Thread Tim Cross


Emanuel Berg via General discussions about Org-mode.  
writes:

> Tim Cross wrote:
>
>> #+latex_header: \parskip 1.5ex
>
> Got it! Thanks! Now it works, with:
>
>   #+latex_header: \parskip   1.5ex
>   #+latex_header: \parindent   0pt

Note that I agree with the other post recommending using the parskip
package as a better solution. I had forgotten about that package when I
posted the above, which is really just a dirty hack.

Tim

-- 
Tim Cross



Re: basic org questions

2020-09-16 Thread General discussions about Org-mode.
Tim Cross wrote:

> #+latex_header: \parskip 1.5ex

Got it! Thanks! Now it works, with:

  #+latex_header: \parskip   1.5ex
  #+latex_header: \parindent   0pt

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Control where files are emitted during block eval

2020-09-16 Thread George Mauer
I would like to create a playground.org file inside my node project where I
will put bits of code that I'm playing with during development.

The problem is that when I actually evaluate a source block it gets written
into a temporary location that I do not control - I therefore cannot
`require` my project's node modules as they will not be found.

Is there a way to control the location the temp file is written? Maybe -
assuming it uses `with-temp-file` - a way to control its directory and file
name generation algorithm via a header?


Re: strange bug after a fresh install

2020-09-16 Thread Jeremie Juste


Hello Uwe,

if seems that the problem lies with ob-ipython.
I would suggest to remove ob-ipython to check and then perform a fresh
install of ob-ipython.

HTH,
Jeremie


Uwe Brauer  writes:

> Hi
>
> I freshly installed Ubuntu 20.04 and used the pre compiled Emacs 26, I
> copies also all my init files.
>
> When I open an org file I obtain an error message I don't understand and
> attach any help is appreciated
>
> Regards
>
> Uwe Brauer 
>
> Debugger entered--Lisp error: (json-readtable-error 47)
>   signal(json-readtable-error (47))
>   json-read()
>   json-read-from-string("/home/oub/.login: No such file or 
> directory.\njupyter: Command not found.\n")
>   ob-ipython--get-kernels()
>   ob-ipython-auto-configure-kernels()
>   run-hooks(change-major-mode-after-body-hook text-mode-hook 
> outline-mode-hook org-mode-hook)
>   apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
> outline-mode-hook org-mode-hook))
>   run-mode-hooks(org-mode-hook)
>   org-mode()
>   set-auto-mode-0(org-mode nil)
>   set-auto-mode()
>   normal-mode(t)
>   after-find-file(nil t)
>   find-file-noselect-1(# 
> "~/kde3-trinity/INSTALL-Trusty.org" nil nil 
> "~/kde3-trinity/INSTALL-Trusty.org" (17304181 66309))
>   find-file-noselect("/home/mjpons/kde3-trinity/INSTALL-Trusty.org" nil nil 
> nil)
>   #f(compiled-function (filename  wildcards) "Edit file
> FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if
> none already exists.\nInteractively, the default if you just type RET
> is the current directory,\nbut the visited file name is available
> through the minibuffer history:\ntype \\[next-history-element] to pull
> it into the minibuffer.\n\nThe first time \\[next-history-element] is
> used after Emacs prompts for\nthe file name, the result is affected by
> `file-name-at-point-functions',\nwhich by default try to guess the
> file name by looking at point in the\ncurrent buffer.  Customize the
> value of `file-name-at-point-functions'\nor set it to nil, if you want
> only the visited file name and the\ncurrent directory to be available
> on first \\[next-history-element]\nrequest.\n\nYou can visit files on
> remote machines by specifying something\nlike
> /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can\nalso visit
> local files as a different user by specifying\n/sudo::FILE for the
> file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp
> Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS
> is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit
> multiple files.  You can\nsuppress wildcard expansion by setting
> `find-file-wildcards' to nil.\n\nTo visit a file without any kind of
> conversion and without\nautomatically choosing a major mode, use
> \\[find-file-literally]." (interactive #f(compiled-function ()
> #)) # 0x1b4a57>)("/home/mjpons/kde3-trinity/INSTALL-Trusty.org" nil)
>   ad-Advice-find-file(#f(compiled-function (filename 
> wildcards) "Edit file FILENAME.\nSwitch to a buffer visiting file
> FILENAME,\ncreating one if none already exists.\nInteractively, the
> default if you just type RET is the current directory,\nbut the
> visited file name is available through the minibuffer history:\ntype
> \\[next-history-element] to pull it into the minibuffer.\n\nThe first
> time \\[next-history-element] is used after Emacs prompts for\nthe
> file name, the result is affected by
> `file-name-at-point-functions',\nwhich by default try to guess the
> file name by looking at point in the\ncurrent buffer.  Customize the
> value of `file-name-at-point-functions'\nor set it to nil, if you want
> only the visited file name and the\ncurrent directory to be available
> on first \\[next-history-element]\nrequest.\n\nYou can visit files on
> remote machines by specifying something\nlike
> /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can\nalso visit
> local files as a different user by specifying\n/sudo::FILE for the
> file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp
> Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS
> is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit
> multiple files.  You can\nsuppress wildcard expansion by setting
> `find-file-wildcards' to nil.\n\nTo visit a file without any kind of
> conversion and without\nautomatically choosing a major mode, use
> \\[find-file-literally]." (interactive #f(compiled-function ()
> #)) #)
> "/home/mjpons/kde3-trinity/INSTALL-Trusty.org")
>   apply(ad-Advice-find-file #f(compiled-function (filename 
> wildcards) "Edit file FILENAME.\nSwitch to a buffer visiting file
> FILENAME,\ncreating one if none already exists.\nInteractively, the
> default if you just type RET is the current directory,\nbut the
> visited file name is available through the minibuffer history:\ntype
> \\[next-history-element] to pull it into the minibuffer.\n\nThe first
> time \\[next-history-element] is used after Emacs prompts for\nthe
> file name, the result 

Re: strange bug after a fresh install

2020-09-16 Thread Nicholas Savage
Are you using ob-ipython? Your trace makes it seem like that might be loaded 
maybe in your init files. This issue seems to cover the problem you are having, 
since it says that it's modifying `org-mode-hook'.

https://github.com/gregsexton/ob-ipython/issues/161

Maybe since you have a clean install you're missing jupyter while you weren't 
before?

On Wed, Sep 16, 2020, at 16:56, Uwe Brauer wrote:
> Hi
> 
> I freshly installed Ubuntu 20.04 and used the pre compiled Emacs 26, I
> copies also all my init files.
> 
> When I open an org file I obtain an error message I don't understand and
> attach any help is appreciated
> 
> Regards
> 
> Uwe Brauer 
> 
> 
> Attachments:
> * bug



Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Samuel Wales
can emacs supply tools that would be useful?

On 9/16/20, Jeff Filipovits  wrote:
>
> Adam,
>
> Thanks. You are right of course and I realized the right-align
> issue right after I sent my email.
>
> Adam Spiers  writes:
>
>> But the whole point of this exercise is to support
>> variable-width
>> fonts.  In this case, the correct position for the end of the
>> single
>> space is most likely not even a multiple of the fixed column
>> width, so
>> it would probably need to be measured in pixels rather than
>> columns. And in order to calculate it, it is first necessary to
>> calculate the exact width in pixels of the colon-delimited list
>> of
>> tags. As I mentioned in the comment linked above, I searched for
>> a way
>> of calculating the pixel width of the tag list, and the best I
>> could
>> find was `pos-visible-in-window-p' which has some issues which I
>> mentioned there.  If you have thoughts on whether I'm right
>> about
>> those, and if so how to solve them, I'd love to hear! Cheers,
>> Adam
>
> It looks like (window-text-pixel-size) could be used to calculate
> the pixel length of the tags list? I am having trouble deciphering
> the manual
> (https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification)
>
> for pixel specification for spaces, though. The right alignment
> specification for some reason sends the tags to the next line, as
> do most other solutions that I would expect to align the text to
> the right side of the window.
>
> I can experiment more in a couple days, but in the meantime maybe
> someone smarter than me give some hints on how to use the pixel
> specification properties.
>
>> BTW I tried your code and for some reason it didn't insert any
>> space
>> for me, but I didn't look into that yet.
>
> The way it’s written it would only reduce the gap between the
> headline and tags to a space, and it assumes there are multiple
> spaces there already. If there’s no space between the two, I don’t
> think it’ll insert one. Probably not the best way as it was thrown
> together to test the text property fix.
>
> I accepted long ago that the solution to using a variable pitch
> font for org headings was that the tags would not be aligned to
> the right and never looked back, so maybe this is not worth the
> price of fixing it if it is messy. And diving down to calculating
> the pixel width of text seems like it’s getting pretty messy.
>
> --
> Jeff Filipovits
> Spears & Filipovits, LLC
> 1126 Ponce de Leon Avenue
> Atlanta, GA 30306
> 678.237.9302 (direct)
> jrfilipov...@gmail.com
>
> All emails confidential to the fullest extent of the law.
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



strange bug after a fresh install

2020-09-16 Thread Uwe Brauer
Hi

I freshly installed Ubuntu 20.04 and used the pre compiled Emacs 26, I
copies also all my init files.

When I open an org file I obtain an error message I don't understand and
attach any help is appreciated

Regards

Uwe Brauer 

Debugger entered--Lisp error: (json-readtable-error 47)
  signal(json-readtable-error (47))
  json-read()
  json-read-from-string("/home/oub/.login: No such file or directory.\njupyter: 
Command not found.\n")
  ob-ipython--get-kernels()
  ob-ipython-auto-configure-kernels()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook 
org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(# 
"~/kde3-trinity/INSTALL-Trusty.org" nil nil "~/kde3-trinity/INSTALL-Trusty.org" 
(17304181 66309))
  find-file-noselect("/home/mjpons/kde3-trinity/INSTALL-Trusty.org" nil nil nil)
  #f(compiled-function (filename  wildcards) "Edit file 
FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if none 
already exists.\nInteractively, the default if you just type RET is the current 
directory,\nbut the visited file name is available through the minibuffer 
history:\ntype \\[next-history-element] to pull it into the minibuffer.\n\nThe 
first time \\[next-history-element] is used after Emacs prompts for\nthe file 
name, the result is affected by `file-name-at-point-functions',\nwhich by 
default try to guess the file name by looking at point in the\ncurrent buffer.  
Customize the value of `file-name-at-point-functions'\nor set it to nil, if you 
want only the visited file name and the\ncurrent directory to be available on 
first \\[next-history-element]\nrequest.\n\nYou can visit files on remote 
machines by specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the 
file name.  You can\nalso visit local files as a different user by 
specifying\n/sudo::FILE for the file name.\nSee the Info node `(tramp)File name 
Syntax' in the Tramp Info\nmanual, for more about this.\n\nInteractively, or if 
WILDCARDS is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit 
multiple files.  You can\nsuppress wildcard expansion by setting 
`find-file-wildcards' to nil.\n\nTo visit a file without any kind of conversion 
and without\nautomatically choosing a major mode, use \\[find-file-literally]." 
(interactive #f(compiled-function () #)) #)("/home/mjpons/kde3-trinity/INSTALL-Trusty.org" nil)
  ad-Advice-find-file(#f(compiled-function (filename  wildcards) "Edit 
file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if 
none already exists.\nInteractively, the default if you just type RET is the 
current directory,\nbut the visited file name is available through the 
minibuffer history:\ntype \\[next-history-element] to pull it into the 
minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs 
prompts for\nthe file name, the result is affected by 
`file-name-at-point-functions',\nwhich by default try to guess the file name by 
looking at point in the\ncurrent buffer.  Customize the value of 
`file-name-at-point-functions'\nor set it to nil, if you want only the visited 
file name and the\ncurrent directory to be available on first 
\\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by 
specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  
You can\nalso visit local files as a different user by specifying\n/sudo::FILE 
for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp 
Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil 
in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You 
can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo 
visit a file without any kind of conversion and without\nautomatically choosing 
a major mode, use \\[find-file-literally]." (interactive #f(compiled-function 
() #)) #) 
"/home/mjpons/kde3-trinity/INSTALL-Trusty.org")
  apply(ad-Advice-find-file #f(compiled-function (filename  wildcards) 
"Edit file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one 
if none already exists.\nInteractively, the default if you just type RET is the 
current directory,\nbut the visited file name is available through the 
minibuffer history:\ntype \\[next-history-element] to pull it into the 
minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs 
prompts for\nthe file name, the result is affected by 
`file-name-at-point-functions',\nwhich by default try to guess the file name by 
looking at point in the\ncurrent buffer.  Customize the value of 
`file-name-at-point-functions'\nor set it to nil, if you want only the visited 
file name and the\ncurrent directory to be available on first 

Re: [PATCH] Bug: Fontification: Heading following a comment

2020-09-16 Thread Nicolas Goaziou
Hello,

Sébastien Miquel  writes:

> It isn't clear to me which one should be preferable and in what
> situation.

It is [ \t] almost everywhere, as shown in the code base. The only
exception I know about is when we need to escape with zero-width space,
e.g., in `org-emphasis-regexp-components'.

> I couldn't find any reference to this in any documentation
> of Org syntax.

It should be in the document describing the syntax. If it is not there,
it should be added.

> I've replaced all instances of blank with (any " \t") in this function
> (that's the only instances in org.el).
> The attached patch fixes the original issue.

Thank you. I applied your patch.

Regards,
-- 
Nicolas Goaziou



Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Jeff Filipovits



Adam,

Thanks. You are right of course and I realized the right-align 
issue right after I sent my email. 


Adam Spiers  writes:

But the whole point of this exercise is to support 
variable-width
fonts.  In this case, the correct position for the end of the 
single
space is most likely not even a multiple of the fixed column 
width, so

it would probably need to be measured in pixels rather than
columns. And in order to calculate it, it is first necessary to
calculate the exact width in pixels of the colon-delimited list 
of
tags. As I mentioned in the comment linked above, I searched for 
a way
of calculating the pixel width of the tag list, and the best I 
could

find was `pos-visible-in-window-p' which has some issues which I
mentioned there.  If you have thoughts on whether I'm right 
about

those, and if so how to solve them, I'd love to hear! Cheers,
Adam


It looks like (window-text-pixel-size) could be used to calculate 
the pixel length of the tags list? I am having trouble deciphering 
the manual 
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification) 
for pixel specification for spaces, though. The right alignment 
specification for some reason sends the tags to the next line, as 
do most other solutions that I would expect to align the text to 
the right side of the window. 

I can experiment more in a couple days, but in the meantime maybe 
someone smarter than me give some hints on how to use the pixel 
specification properties. 

BTW I tried your code and for some reason it didn't insert any 
space

for me, but I didn't look into that yet.


The way it’s written it would only reduce the gap between the 
headline and tags to a space, and it assumes there are multiple 
spaces there already. If there’s no space between the two, I don’t 
think it’ll insert one. Probably not the best way as it was thrown 
together to test the text property fix. 

I accepted long ago that the solution to using a variable pitch 
font for org headings was that the tags would not be aligned to 
the right and never looked back, so maybe this is not worth the 
price of fixing it if it is messy. And diving down to calculating 
the pixel width of text seems like it’s getting pretty messy. 


--
Jeff Filipovits
Spears & Filipovits, LLC
1126 Ponce de Leon Avenue
Atlanta, GA 30306
678.237.9302 (direct)
jrfilipov...@gmail.com

All emails confidential to the fullest extent of the law.



Re: using header data in document

2020-09-16 Thread General discussions about Org-mode.
Eric S Fraga wrote:

> what does your #+date: line look like? Is it
> a single time stamp? If it is not, all of the above
> would return the same thing.

I don't have that line.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: official orgmode parser

2020-09-16 Thread Matt Huszagh
"Gerry Agbobada"  writes:

> I'm currently toying with the idea of trying a tree-sitter parser for Org. 
> The very static nature of a shared object parser (knowing TODO keywords are 
> pretty dynamic for example) is a challenge I'm not sure to overcome ; to be 
> honest even without that I can't say I'll manage to do it.

A tree-sitter parser for org would be great! Please keep this list
posted on any developments you make on this front. I made some minimal
attempts at this a while back, but didn't get very far.

Matt



Re: basic org questions

2020-09-16 Thread Stefan Nobis
Eric S Fraga  writes:

> #+latex_header: \setlength{\parindent}{0pt}
> #+latex_header: \setlength{\parskip}{\baselineskip}

Better use

#+latex_header: \usepackage{parskip}

as this package has less bad side-effects on other parts of the
document than setting these far-reaching lengths directly.

But otherwise I second your recommendation to not use this style of
marking paragraphs if not absolutely required.

-- 
Until the next mail...,
Stefan.



Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Adam Spiers

Hi Jeff,

Firstly thanks a lot for looking into this! 


On Tue, Sep 15, 2020 at 01:41:04PM -0400, Jeff Filipovits wrote:
Following the call for help to fix bugs, and with building guilt, I’ve 
taken a stab at fixing aligning tags when using a variable-pitch font. 
I haven’t tested this much because I do not know if it is misguided, 
but it seems to work. 

Seems the only way to do it is to use the ‘display text property and 
expand a single space between the headline and tags. Here is a drop-in 
replacement of org--align-tags-here which ensures there is one space 
between the tags and headline, and then expands that space by setting 
a text property. 


Yes, this is the same conclusion I reached a little while ago: 


   https://gitlab.com/protesilaos/modus-themes/-/issues/85#note_407147422

However as mentioned there, AFAICS this approach only manages to 
*left*-align the tags, not *right*-align them.  When there are several 
tags, this can be problematic as the colon-delimited list of tags will 
either spill over the buffer's right margin, or avoid that by 
requiring an alignment column which is further to the left and ends up 
interfering with the main text of the buffer.  Given that the 
colon-delimited lists have variable numbers of characters, I think 
it's clear that right alignment is the only decent space-efficient 
layout.


BTW I tried your code and for some reason it didn't insert any space for 
me, but I didn't look into that yet. 

I’ve removed the point-preserving code because it does not seem to be 
needed using this method. This would also allow removing 
org-fix-tags-on-the-fly from org-self-insert-command since there is 
only a single space between the headline and the tags and it is 
adjusted automatically. 


Makes sense. 

If this looks promising I can throw some more time at it. If not, I 
will happily abandon it. 


I think it's promising for sure.  But I think there is still a 
remaining problem regarding how to implement the right alignment of 
the colon-delimited list of tags.  If this list uses a fixed-width 
font then it is relatively easy, because then the value to provide to 
:align-to can be calculated as `org-tags-column' minus the column 
width of the tag list.  And indeed this seems to be how the original 
version of `org--align-tags-here' achieves right alignment: 


   (new (max (if (>= to-col 0) to-col
   (- (abs to-col) (string-width (match-string 1

But the whole point of this exercise is to support variable-width 
fonts.  In this case, the correct position for the end of the single 
space is most likely not even a multiple of the fixed column width, so 
it would probably need to be measured in pixels rather than columns. 
And in order to calculate it, it is first necessary to calculate the 
exact width in pixels of the colon-delimited list of tags. 

As I mentioned in the comment linked above, I searched for a way of 
calculating the pixel width of the tag list, and the best I could find 
was `pos-visible-in-window-p' which has some issues which I mentioned 
there.  If you have thoughts on whether I'm right about those, and if 
so how to solve them, I'd love to hear! 


Cheers,
Adam



Re: using header data in document

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 17:56, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> Eric S Fraga wrote:
>> The documentation that you have in your post says
>> that this works only if the actual date given in
>> the #+DATE directive is a single timestamp. So,
>> what did you specify there?
>
> I tried
>
>   {{{date()}}}
>   {{{date(%D)}}}
>   {{{date(%F)}}}
>
> all produced "September 16, 2020".

What I meant was: what does your #+date: line look like?  Is it a single
time stamp?  If it is not, all of the above would return the same thing.

> Yes, {{{modification-time(%F)}}} works!

Great.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: using header data in document

2020-09-16 Thread General discussions about Org-mode.
Eric S Fraga wrote:

>> {{{date()}}} works as does {{{date(%D)}}} in
>> a sense, only the format string doesn't seem to
>> influence the output, which is "September 16,
>> 2020".
>
> The documentation that you have in your post says
> that this works only if the actual date given in
> the #+DATE directive is a single timestamp. So,
> what did you specify there?

I tried

  {{{date()}}}
  {{{date(%D)}}}
  {{{date(%F)}}}

all produced "September 16, 2020".

> And, in practice, I actually use
> {{{modification-time(FORMAT)}}}. In both of these
> cases, you need to specify the format.

Yes, {{{modification-time(%F)}}} works!

Thanks!

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: Help with moderating non-subscribers messages on the Org mailing list

2020-09-16 Thread Bastien
Bastien  writes:

> We could use the help of more mailing list maintainers.

Thanks to everyone who responded!  We are now 9 persons moderating
the list, that helps a lot.

-- 
 Bastien



Re: using header data in document

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 17:18, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> {{{date()}}} works as does {{{date(%D)}}} in a sense,
> only the format string doesn't seem to influence the
> output, which is "September 16, 2020".

The documentation that you have in your post says that this works only
if the actual date given in the #+DATE directive is a single
timestamp.  So, what did you specify there?  If you give a time stamp,
like [2020-09-16 Wed], it works fine for me.  If you have something
else, e.g. September 16, 2020, the format string is ignored.

In any case, you may wish to use the {{{time(FORMAT)}}} macro instead as
this does not depend on the date you have specified explicitly. And, in
practice, I actually use {{{modification-time(FORMAT)}}}.  In both of
these cases, you need to specify the format.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: using header data in document

2020-09-16 Thread General discussions about Org-mode.
Eric S Fraga wrote:

> On Wednesday, 16 Sep 2020 at 00:08, Emanuel Berg via
> "General discussions about Org-mode." wrote:
>
>> Hm, date? Maybe that can be used to do a line like
>> the LaTeX's
>>
>>   Last modified: \today
>>
>> or how would one do that?
>
> Check out the info manual: [[info:org#Macro
> Replacement]] but you should be able to use
> {{{date(%D)}}} to get the date.

{{{date()}}} works as does {{{date(%D)}}} in a sense,
only the format string doesn't seem to influence the
output, which is "September 16, 2020".

(info "(org) Macro replacement")

  ‘{{{date}}}’
  ‘{{{date(FORMAT)}}}’
   This macro refers to the ‘#+DATE’ keyword.  FORMAT is an optional
   argument to the ‘{{{date}}}’ macro that will be used only if
   ‘#+DATE’ is a single timestamp.  FORMAT should be a format string
   understood by ‘format-time-string’.

(describe-function #'format-time-string)

  [...]
  %D is like "%m/%d/%y".
  [...]

So it should work according to these parts of the
documentation...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: using header data in document

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 00:08, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> Hm, date? Maybe that can be used to do a line like
> the LaTeX's
>
>   Last modified: \today
>
> or how would one do that?

Check out the info manual: [[info:org#Macro Replacement]] 
but you should be able to use {{{date(%D)}}} to get the date.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: basic org questions

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 06:13, Emanuel Berg wrote:
> TEC wrote:
>
>> #+begin_src latex
>> \setlength{\parindent}{0pt}
>> \setlength{\parskip}{\baselineskip}
>> #+end_src
>
> Also, that doesn't work. Put it in the document, new
> PDF, looks the same.

Try

#+latex_header: \setlength{\parindent}{0pt}
#+latex_header: \setlength{\parskip}{\baselineskip}

instead.  This works for me but only use it when required by the
recipient of the document (e.g. camera ready conference
proceedings).  Otherwise, I always go with LaTeX defaults as those were
designed by people that understood typesetting (unlike your average
conference organizer unfortunately).

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: creating png images in emails with org-mode

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 13:37, Joseph Vidal-Rosset wrote:
> My problem has just been solved with substituting dvipng for imagemagick:

This may solve your problem but you really shouldn't be having that
problem in the first place?  I use imagemagick, not dvipng, and things
work fine for me, e.g.

$$ \frac{a}{b} $$

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e


Re: official orgmode parser

2020-09-16 Thread Ihor Radchenko
FYI: You may find https://github.com/ndwarshuis/org-ml helpful.


Przemysław Kamiński  writes:

> On 9/15/20 2:37 PM, to...@tuxteam.de wrote:
>> On Tue, Sep 15, 2020 at 01:15:56PM +0200, Przemysław Kamiński wrote:
>> 
>> [...]
>> 
>>> There's the org-json (or ox-json) package but for some reason I
>>> wasn't able to run it successfully. I guess export to S-exps would
>>> be best here. But yes I'll check that out.
>> 
>> If that's your route, perhaps the "Org element API" [1] might be
>> helpful. Especially `org-element-parse-buffer' gives you a Lisp
>> data structure which is supposed to be a parse of your Org buffer.
>> 
>>  From there to S-expression can be trivial (e.g. `print' or `pp'),
>> depending on what you want to do.
>> 
>> Walking the structure should be nice in Lisp, too.
>> 
>> The topic of (non-Emacs) parsing of Org comes up regularly, and
>> there is a good (but AFAIK not-quite-complete) Org syntax spec
>> in Worg [2], but there are a couple of difficulties to be mastered
>> before such a thing can become really enjoyable and useful.
>> 
>> The loose specification of Org's format (arguably its second
>> or third strongest asset, the first two being its incredible
>> community and Emacs itself) is something which makes this
>> problem "interesting". People have invented lots of usages
>> which might be broken should Org change to a strict formal
>> spec. You don't want to break those people.
>> 
>> But yes, perhaps some day someone nails it. Perhaps it's you :)
>> 
>> Cheers
>> 
>> [1] https://orgmode.org/worg/dev/org-element-api.html
>> [2] https://orgmode.org/worg/dev/org-syntax.html
>> 
>>   - t
>> 
>
> So I looked at (pp (org-element-parse-buffer)) however it does print out 
> recursive stuff which other schemes have trouble parsing.
>
> My code looks more or less like this:
>
> (defun org-parse (f)
>(with-temp-buffer
>  (find-file f)
>  (let* ((parsed (org-element-parse-buffer))
> (all (append org-element-all-elements org-element-all-objects))
> (mapped (org-element-map parsed all
>   (lambda (item)
> (strip-parent item)
>(pp mapped
>
>
> strip-parent is basically (plist-put props :parent nil) for elements 
> properties. However it turns out there are more recursive objects, like
>
> :title
>#("Headline 1" 0 10
>  (:parent
>   (headline #2
> (section
>
> So I'm wondering do I have to do it by hand for all cases or is there 
> some way to output only a simple AST without those nested objects?
>
> Best,
> Przemek



Re: official orgmode parser

2020-09-16 Thread Przemysław Kamiński

On 9/16/20 2:02 PM, Ihor Radchenko wrote:

However what Ihor presented is interesting. Do you use similar approach
with shellout and 'emacs -batch' to show currently running task or you
'push' data from emacs to show it in the taskbar?


I prefer to avoid querying emacs too often for performance reasons.
Instead, I only update the clocking info when I clock in/out in emacs.
Then, the clocked in time is dynamically updated by independent bash
script.

The scheme is the following:
1. org clock in/out in Emacs trigger writing clocking info into
~/.org-clock-in status file
2. bash script periodically monitors the file and calculates the clocked
in time according to the contents and time from last modification
3. the script updates simple textbox widget using awesome-client
4. the script also warns me (notify-send) when the weighted clocked in
time is negative (meaning that I should switch to some more
productive activity)

Best,
Ihor

Przemysław Kamiński  writes:


On 9/16/20 9:56 AM, Ihor Radchenko wrote:

Wow, another awesomewm user here; could you share your code?


Are you interested in something particular about awesome WM integration?

I am using simple textbox widgets to show currently clocked in task and
weighted summary of clocked time. See the attachments.

Best,
Ihor




Marcin Borkowski  writes:


On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:


So, I keep clock times for work in org mode, this is very
handy. However, my customers require that I use their service to
provide the times. They do offer API. So basically I'm using elisp to
parse org, make API calls, and at the same time generate CSV reports
with a Python interop with org babel (because my elisp is just too bad
to do that). If I had access to some org parser, I'd pick a language
that would be more comfortable for me to get the job done. I guess it
can all be done in elisp, however this is just a tool for me alone and
I have limited time resources on hacking things for myself :)


I was in the exact same situation - I use Org-mode clocking, and we use
Toggl at our company, so I wrote a simple tool to fire API requests to
Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
It's a bit more than 200 lines of Elisp, so you might try to look into
it and adapt it to whatever tool your employer is using.


Another one is generating total hours report for day/week/month to put
into my awesomewm toolbar. I ended up using orgstat
https://github.com/volhovM/orgstat
however the author is creating his own DSL in YAML and I guess things
were much better off if it all stayed in some Scheme :)


Wow, another awesomewm user here; could you share your code?

Best,

--
Marcin Borkowski
http://mbork.pl



I don't have interesting code, just standard awesomevm setup. I run
periodic script to output data computed by orgstat and show it in the
taskbar (uses the shellout_widget).

However what Ihor presented is interesting. Do you use similar approach
with shellout and 'emacs -batch' to show currently running task or you
'push' data from emacs to show it in the taskbar?

P.



So basically this is what this thread is about. One needs a working 
Emacs instance and work in "push" mode to export any Org data. This 
requires dealing with temporary files, as described above, and some 
ad-hoc formats to keep whatever data I need to pull from org.


"Pull" mode would be preferred. I could then, say, write a script in 
Guile, execute 'emacs -batch' to export org data (I'm ok with that), 
then parse the S-expressions to get what I need.


P.



Re: official orgmode parser

2020-09-16 Thread tomas
On Wed, Sep 16, 2020 at 02:09:42PM +0200, Przemysław Kamiński wrote:

[...]

> So I looked at (pp (org-element-parse-buffer)) however it does print
> out recursive stuff which other schemes have trouble parsing.
> 
> My code looks more or less like this:
> 
> (defun org-parse (f)
>   (with-temp-buffer
> (find-file f)
> (let* ((parsed (org-element-parse-buffer))
>(all (append org-element-all-elements org-element-all-objects))
>(mapped (org-element-map parsed all
>  (lambda (item)
>(strip-parent item)
>   (pp mapped

Actually I'd tend to not modify the result, but to walk
it.

See `pcase' for a powerful pattern matcher which might
help you there.

Cheers
 - t


signature.asc
Description: Digital signature


Re: official orgmode parser

2020-09-16 Thread Przemysław Kamiński

On 9/15/20 2:37 PM, to...@tuxteam.de wrote:

On Tue, Sep 15, 2020 at 01:15:56PM +0200, Przemysław Kamiński wrote:

[...]


There's the org-json (or ox-json) package but for some reason I
wasn't able to run it successfully. I guess export to S-exps would
be best here. But yes I'll check that out.


If that's your route, perhaps the "Org element API" [1] might be
helpful. Especially `org-element-parse-buffer' gives you a Lisp
data structure which is supposed to be a parse of your Org buffer.

 From there to S-expression can be trivial (e.g. `print' or `pp'),
depending on what you want to do.

Walking the structure should be nice in Lisp, too.

The topic of (non-Emacs) parsing of Org comes up regularly, and
there is a good (but AFAIK not-quite-complete) Org syntax spec
in Worg [2], but there are a couple of difficulties to be mastered
before such a thing can become really enjoyable and useful.

The loose specification of Org's format (arguably its second
or third strongest asset, the first two being its incredible
community and Emacs itself) is something which makes this
problem "interesting". People have invented lots of usages
which might be broken should Org change to a strict formal
spec. You don't want to break those people.

But yes, perhaps some day someone nails it. Perhaps it's you :)

Cheers

[1] https://orgmode.org/worg/dev/org-element-api.html
[2] https://orgmode.org/worg/dev/org-syntax.html

  - t



So I looked at (pp (org-element-parse-buffer)) however it does print out 
recursive stuff which other schemes have trouble parsing.


My code looks more or less like this:

(defun org-parse (f)
  (with-temp-buffer
(find-file f)
(let* ((parsed (org-element-parse-buffer))
   (all (append org-element-all-elements org-element-all-objects))
   (mapped (org-element-map parsed all
 (lambda (item)
   (strip-parent item)
  (pp mapped


strip-parent is basically (plist-put props :parent nil) for elements 
properties. However it turns out there are more recursive objects, like


:title
  #("Headline 1" 0 10
(:parent
 (headline #2
   (section

So I'm wondering do I have to do it by hand for all cases or is there 
some way to output only a simple AST without those nested objects?


Best,
Przemek



Re: official orgmode parser

2020-09-16 Thread Ihor Radchenko
> However what Ihor presented is interesting. Do you use similar approach 
> with shellout and 'emacs -batch' to show currently running task or you 
> 'push' data from emacs to show it in the taskbar?

I prefer to avoid querying emacs too often for performance reasons.
Instead, I only update the clocking info when I clock in/out in emacs.
Then, the clocked in time is dynamically updated by independent bash
script.

The scheme is the following:
1. org clock in/out in Emacs trigger writing clocking info into
   ~/.org-clock-in status file
2. bash script periodically monitors the file and calculates the clocked
   in time according to the contents and time from last modification
3. the script updates simple textbox widget using awesome-client
4. the script also warns me (notify-send) when the weighted clocked in
   time is negative (meaning that I should switch to some more
   productive activity)

Best,
Ihor

Przemysław Kamiński  writes:

> On 9/16/20 9:56 AM, Ihor Radchenko wrote:
>>> Wow, another awesomewm user here; could you share your code?
>> 
>> Are you interested in something particular about awesome WM integration?
>> 
>> I am using simple textbox widgets to show currently clocked in task and
>> weighted summary of clocked time. See the attachments.
>> 
>> Best,
>> Ihor
>> 
>> 
>> 
>> 
>> Marcin Borkowski  writes:
>> 
>>> On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:
>>>
 So, I keep clock times for work in org mode, this is very
 handy. However, my customers require that I use their service to
 provide the times. They do offer API. So basically I'm using elisp to
 parse org, make API calls, and at the same time generate CSV reports
 with a Python interop with org babel (because my elisp is just too bad
 to do that). If I had access to some org parser, I'd pick a language
 that would be more comfortable for me to get the job done. I guess it
 can all be done in elisp, however this is just a tool for me alone and
 I have limited time resources on hacking things for myself :)
>>>
>>> I was in the exact same situation - I use Org-mode clocking, and we use
>>> Toggl at our company, so I wrote a simple tool to fire API requests to
>>> Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
>>> It's a bit more than 200 lines of Elisp, so you might try to look into
>>> it and adapt it to whatever tool your employer is using.
>>>
 Another one is generating total hours report for day/week/month to put
 into my awesomewm toolbar. I ended up using orgstat
 https://github.com/volhovM/orgstat
 however the author is creating his own DSL in YAML and I guess things
 were much better off if it all stayed in some Scheme :)
>>>
>>> Wow, another awesomewm user here; could you share your code?
>>>
>>> Best,
>>>
>>> -- 
>>> Marcin Borkowski
>>> http://mbork.pl
>
>
> I don't have interesting code, just standard awesomevm setup. I run 
> periodic script to output data computed by orgstat and show it in the 
> taskbar (uses the shellout_widget).
>
> However what Ihor presented is interesting. Do you use similar approach 
> with shellout and 'emacs -batch' to show currently running task or you 
> 'push' data from emacs to show it in the taskbar?
>
> P.



Re: official orgmode parser

2020-09-16 Thread Przemysław Kamiński

On 9/16/20 9:56 AM, Ihor Radchenko wrote:

Wow, another awesomewm user here; could you share your code?


Are you interested in something particular about awesome WM integration?

I am using simple textbox widgets to show currently clocked in task and
weighted summary of clocked time. See the attachments.

Best,
Ihor




Marcin Borkowski  writes:


On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:


So, I keep clock times for work in org mode, this is very
handy. However, my customers require that I use their service to
provide the times. They do offer API. So basically I'm using elisp to
parse org, make API calls, and at the same time generate CSV reports
with a Python interop with org babel (because my elisp is just too bad
to do that). If I had access to some org parser, I'd pick a language
that would be more comfortable for me to get the job done. I guess it
can all be done in elisp, however this is just a tool for me alone and
I have limited time resources on hacking things for myself :)


I was in the exact same situation - I use Org-mode clocking, and we use
Toggl at our company, so I wrote a simple tool to fire API requests to
Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
It's a bit more than 200 lines of Elisp, so you might try to look into
it and adapt it to whatever tool your employer is using.


Another one is generating total hours report for day/week/month to put
into my awesomewm toolbar. I ended up using orgstat
https://github.com/volhovM/orgstat
however the author is creating his own DSL in YAML and I guess things
were much better off if it all stayed in some Scheme :)


Wow, another awesomewm user here; could you share your code?

Best,

--
Marcin Borkowski
http://mbork.pl



I don't have interesting code, just standard awesomevm setup. I run 
periodic script to output data computed by orgstat and show it in the 
taskbar (uses the shellout_widget).


However what Ihor presented is interesting. Do you use similar approach 
with shellout and 'emacs -batch' to show currently running task or you 
'push' data from emacs to show it in the taskbar?


P.



Re: creating png images in emails with org-mode

2020-09-16 Thread Joseph Vidal-Rosset
Hello,

My problem has just been  solved with substituting dvipng for imagemagick:

(setq org-latex-create-formula-image-program 'dvipng)

; (setq org-latex-create-formula-image-program 'imagemagick)

Le mer. 16 sept. 2020 à 12:03, Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com> a écrit :

> Hello,
>
> One more time, my setup to create png image via LaTeX in email in org-mode
> is broken.
>
> I get this error message:
>
> Creating LaTeX preview...
> org-compile-file: File "/tmp/orgtex2wp50c.png" wasn’t produced.  Please
> adjust ‘imagemagick’ part of ‘org-preview-latex-process-alist’.
>
> Your help is welcome, because I do not understand what I have to do, how I
> have to "adjust" imagemagick.
>
> Best wishes,
>
> Jo.
>


creating png images in emails with org-mode

2020-09-16 Thread Joseph Vidal-Rosset
Hello,

One more time, my setup to create png image via LaTeX in email in org-mode
is broken.

I get this error message:

Creating LaTeX preview...
org-compile-file: File "/tmp/orgtex2wp50c.png" wasn’t produced.  Please
adjust ‘imagemagick’ part of ‘org-preview-latex-process-alist’.

Your help is welcome, because I do not understand what I have to do, how I
have to "adjust" imagemagick.

Best wishes,

Jo.


Help with moderating non-subscribers messages on the Org mailing list

2020-09-16 Thread Bastien
Dear all,

non-subscribers messages sent to emacs-orgmode@gnu.org are currently
moderated by Austin, Mikael and me.

We could use the help of more mailing list maintainers.

The task is to check the mailman administration page and to discard
messages that should not be sent to the list, while allowing those
sent by non-subscribers who ask relevant questions.

If you want to help with this, please reply to me only.  I think 3
more persons would be enough for now.

Thanks!

-- 
 Bastien



Re: Bug: org-priority face has extra space at the end starting from version 9.4 [9.4 (9.4-elpaplus @ /home/rrudakov/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-09-16 Thread Protesilaos Stavrou
Roman Rudakov  [2020-09-15, 18:50 +]:

> I use theme which draw boxes around priority cookie. Before updating to
> version 9.4 box was rendered just around square brackets, but since
> version 9.4 it has additional space at the end.
>
> I think it's related to the fact that org-priority face definition used
> to use separate regex which didn't include space, and now it uses
> variable org-priority-regexp which does include additional space
> character.
>
> [...]

This issue is noticeable with any face properties for 'org-priority'
such as box, background, underline, overline.

Just to add a reproducible recipe for this case.

On 'emacs -Q' running Org 9.4:

+ C-x C-f /tmp/test.org
+ Insert a heading, like:

* TODO [#A] This is a test

…see attached screenshot with "default" state.

* Now evaluate the following expression:

(set-face-attribute 'org-priority nil :underline t)

…see attached screenshot with "edited" state.

-- 
Protesilaos Stavrou
protesilaos.com


Re: official orgmode parser

2020-09-16 Thread Ihor Radchenko
> Wow, another awesomewm user here; could you share your code?

Are you interested in something particular about awesome WM integration?

I am using simple textbox widgets to show currently clocked in task and
weighted summary of clocked time. See the attachments.

Best,
Ihor



Marcin Borkowski  writes:

> On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:
>
>> So, I keep clock times for work in org mode, this is very
>> handy. However, my customers require that I use their service to
>> provide the times. They do offer API. So basically I'm using elisp to
>> parse org, make API calls, and at the same time generate CSV reports
>> with a Python interop with org babel (because my elisp is just too bad
>> to do that). If I had access to some org parser, I'd pick a language
>> that would be more comfortable for me to get the job done. I guess it
>> can all be done in elisp, however this is just a tool for me alone and
>> I have limited time resources on hacking things for myself :)
>
> I was in the exact same situation - I use Org-mode clocking, and we use
> Toggl at our company, so I wrote a simple tool to fire API requests to
> Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
> It's a bit more than 200 lines of Elisp, so you might try to look into
> it and adapt it to whatever tool your employer is using.
>
>> Another one is generating total hours report for day/week/month to put
>> into my awesomewm toolbar. I ended up using orgstat
>> https://github.com/volhovM/orgstat
>> however the author is creating his own DSL in YAML and I guess things
>> were much better off if it all stayed in some Scheme :)
>
> Wow, another awesomewm user here; could you share your code?
>
> Best,
>
> -- 
> Marcin Borkowski
> http://mbork.pl


Re: "text mode" org mode

2020-09-16 Thread Stefan Nobis
Emanuel Berg via "General discussions about Org-mode."
 writes:

> Thanks, I wonder tho if all this

>   (setq org-descriptive-links  nil)
>   (setq org-hide-emphasis-markers  nil)
>   (setq org-startup-folded'showeverything)

> is implied, with `visual-mode'?

Beware: =visible-mode= not "visual"!

As far as I understand the internal of Org an Emacs, some of the
visual features of Org are implemented with overlays, some are
implemented with text properties. Disabling visible-mode just makes
invisible text visible - but I do not fully understand whether this
affects really all kinds of "invisibility" or just some.

So I for myself prefer to say Org explicitly what I want instead of
trying to take advantage of an indirect effect that may disturb Orgs
internal state (or not; I just do not understand enough of Org and
Emacs internals to really judge this).

-- 
Until the next mail...,
Stefan.



Re: basic org questions

2020-09-16 Thread Thomas S. Dye

This is the unix design: let each tool do what it does well.

LaTeX decides how to format and align tables, and it does this 
very well.  Nevertheless, it does this at the level of the 
document class, which decides how tables are formatted and aligned 
for the whole document.  The idea of having a user decide table 
formatting and alignment on a case by case basis is completely 
foreign to the design of LaTeX.  It is also completely foreign to 
the best practices of book design.


There are many pieces of software that will allow the user to the 
violate best typesetting practices easily.  LaTeX is not one of 
them.


hth,
Tom

Emanuel Berg writes:


Matt Huszagh wrote:


Yes, after export to PDF, they are centered.
they = the whole table items.


I think this link
(https://orgmode.org/manual/Tables-in-LaTeX-export.html)
is the relevant part of the documentation.


Yeah, but in LaTeX being left aligned is not some
property of the table, everything is left-aligned,
and if you want it otherwise, you put between
\begin{center} and \end{center} ...



--
Thomas S. Dye
https://tsdye.online/tsdye



Re: basic org questions

2020-09-16 Thread Stefan Nobis
Emanuel Berg via "General discussions about Org-mode."
 writes:

> Tim Cross wrote:

>> #+latex_class: korma-article

> user-error: Unknown LaTeX class ‘korma-article’

>> #+latex_header:  \setlength{\parindent}{0pt}

> Yes, that's removed the indentation but didn't insert
> a blank line...

First of all: You don't want this. :)

Marking paragraphs by blank lines and without indentation is deemed
less readable (see for example section 3.10 "Marking Paragraphs" in
https://komascript.de/~mkohm/scrguien.pdf).

But if you really insist on using this style, still the variant of
setting the length parindent and parskip is considered bad practise.
These are very fundamental values for LaTeX and influence a lot more
that just the space between paragraphs. A much better solution would
be to use the package =parskip= (just add "\usepackage{parskip}" to
the preamble of the LaTeX document or add "#+LATEX_HEADER:
\usepackage{parskip}" to the preamble of the Org document).

If you want to customize the Org LaTeX export more globally, you can
put something like this in your Emacs init.el:

#+begin_src elisp
(add-to-list 'org-latex-classes
   '("koma-article"
 "\\documentclass[a4paper, pagesize, headings=normal, 
version=last]{scrartcl}"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

(setq org-latex-default-class "koma-article")

(setq org-latex-packages-alist
'(("" "unicode-math" t ("lualatex" "xelatex"))
  ("" "caption" nil)
  ("" "booktabs" t)))
#+end_src

In the case of the document classes of the Koma world, you have quite
some options for paragraph formatting. If you still insist on your
style of paragraph markings, you may add "parskip=full" to the
global options of the documentclass.

With the above settings, you globally define your preferred LaTeX
documentclass and some global settings as well as add some additionals
packages that are used on every LaTeX export done via Org. So you do
not have to put anything special in the individual Org documents but
the pure content (at the cost that the same Org document may produce a
different output on other Emacs installations with different global
settings).

For more details on what can be configured see
https://orgmode.org/manual/Exporting.html#Exporting. The options there
are mostly presented as in-document settings but most if not all of
them may also be set in some way globally via Emacs init.

-- 
Until the next mail...,
Stefan.



Re: official orgmode parser

2020-09-16 Thread Marcin Borkowski


On 2020-09-15, at 11:17, Przemysław Kamiński  wrote:

> So, I keep clock times for work in org mode, this is very
> handy. However, my customers require that I use their service to
> provide the times. They do offer API. So basically I'm using elisp to
> parse org, make API calls, and at the same time generate CSV reports
> with a Python interop with org babel (because my elisp is just too bad
> to do that). If I had access to some org parser, I'd pick a language
> that would be more comfortable for me to get the job done. I guess it
> can all be done in elisp, however this is just a tool for me alone and
> I have limited time resources on hacking things for myself :)

I was in the exact same situation - I use Org-mode clocking, and we use
Toggl at our company, so I wrote a simple tool to fire API requests to
Toggl on clock start/cancel/end: https://github.com/mbork/org-toggl
It's a bit more than 200 lines of Elisp, so you might try to look into
it and adapt it to whatever tool your employer is using.

> Another one is generating total hours report for day/week/month to put
> into my awesomewm toolbar. I ended up using orgstat
> https://github.com/volhovM/orgstat
> however the author is creating his own DSL in YAML and I guess things
> were much better off if it all stayed in some Scheme :)

Wow, another awesomewm user here; could you share your code?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: Help administer code.orgmode.org: moderate user access and manage the gogs instance

2020-09-16 Thread Bastien
Hi Timothy,

TEC  writes:

>> Is anyone willing to help with (1) and/or (2)?
>
> I'm willing to give (2), and potentially (1) a shot :)

Thanks a lot!  I wrote you offlist about this.

-- 
 Bastien



Re: basic org questions

2020-09-16 Thread tomas
On Wed, Sep 16, 2020 at 06:11:52AM +0200, Emanuel Berg wrote:
> TEC wrote:
> 
> > #+begin_src latex
> > \setlength{\parindent}{0pt}
> > \setlength{\parskip}{\baselineskip}
> > #+end_src
> 
> I know this commands well from my LaTeX projects,
> but I'm gonna use LaTeX anyway, what's the use of
> using org-mode?

LaTeX is (as you might know already ;-) for typesetting. Org
is for organising information.

Sometimes you want to typeset a representation of that information.

Cheers
 - t


signature.asc
Description: Digital signature


Re: basic org questions

2020-09-16 Thread tomas
On Wed, Sep 16, 2020 at 03:58:17AM +0200, Emanuel Berg via General discussions 
about Org-mode. wrote:
> Tim Cross wrote:
> 
> > #+latex_class: korma-article
> 
> user-error: Unknown LaTeX class ‘korma-article’

This might have been a typo: there is a family of LaTeX classes called
"koma" (not "korma", that's rather a family of Indian dishes ;-)

That said, I fail to find a korma-article.cls. So perhaps this wasn't
meant /literally/ by Tim, but rather a placeholder.

> > #+latex_header:  \setlength{\parindent}{0pt}
> 
> Yes, that's removed the indentation but didn't insert
> a blank line...

I think Tim is just furnishing examples, not a complete solution.

LaTeX is a world unto itself, and to fine-tune the results of your
LaTeX exporter (the PDF exporter is just a little appendix on that),
you'll have to dive a bit into that.

Or just ask around here, but best with concrete, little goals each
time.

Cheers
 - t


signature.asc
Description: Digital signature


Re: basic org questions

2020-09-16 Thread Stefan Nobis
Hi.

Details about Org tables are to be found in the manual at different
places (maybe not optimal, but that's the current structure). First of
all, aspects of tables inside Emacs and Org are discussed here:

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

But everything about exporting (generating PDF via LaTeX, HTML, etc.)
is discussed in the export sections. So details about exporting Org
tables to LaTeX can be found here:

   https://orgmode.org/manual/Tables-in-LaTeX-export.html#Tables-in-LaTeX-export

Here you can find the relevant option ":center". For example the
following Org table will be exported to LaTeX without centering and
using the booktabs package to nicely format the table:

--8<---cut here---start->8---

#+attr_latex: :center nil :booktabs t
| My | Columns |
|+-|
|  1 |   2 |
|  3 |   4 |

--8<---cut here---end--->8---


Generally, you have the option to just let Org handle all of the LaTeX
details. In this case, in most cases you do not even need to know
anything about LaTeX - that's what some people are excited about. On
the other hand, in this case you get what Org thinks is good enough
for you. If you want to fine-tune every detail about the resulting
PDF, you have no choice but to know LaTeX and use the options and
hooks to sprinkle your fine-tuning in the document.

BTW: I'm a long-time LaTeX user and a big fan of LaTeX. If I want to
typeset a document and tune any detail of it, in most cases I use
LaTeX and not try to modify Org to generate my hand-optimized LaTeX
code. On the other hand nowadays in many cases I just do not need to
control every little aspect of my final documents or the LaTeX code.
In these cases Org helps a lot to speed up creating simple, small
documents. I customized some aspects once globally and have to type
less (but still know LaTeX and sprinkle a few fine-tunings here and
there). So sometimes I view Org as a kind of very flexible LaTeX
template engine. :)

-- 
Until the next mail...,
Stefan.



Re: [PATCH] Bug: Fontification: Heading following a comment

2020-09-16 Thread Sébastien Miquel

Hi,

Thanks for taking a look.
Afaict, the only difference between blank and [ \t] are some weird 
unicode characters.
It isn't clear to me which one should be preferable and in what 
situation. I couldn't find any reference to this in any documentation of 
Org syntax.


I've replaced all instances of blank with (any " \t") in this function 
(that's the only instances in org.el).

The attached patch fixes the original issue.

Regards,
Sébastien Miquel

Nicolas Goaziou wrote:


Hello,

Sebastien Miquel  writes:


   (rx bol (group (zero-or-more blank) "#"
  (group (group (or (seq "+" (one-or-more (any "a-zA-Z")) 
(optional ":"))
-   space
+   blank

This looks wrong, but so does the current regexp. It should not be
`space' nor `blank', but [ \t] per Org syntax.

Regards,

>From 2bb847473f2199e1dfd03ddcafdd3563ed46ab78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= 
Date: Wed, 16 Sep 2020 07:49:34 +0200
Subject: [PATCH] org.el (org-fontify-meta-lines-and-blocks-1): Fix meta lines
 regexp

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Fix meta lines
regexp to work correctly for lines with only a #.

Replace blank in regexp by (any " \t").

TINYCHANGE
---
 lisp/org.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index d09d6c8d2..053635c85 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5219,14 +5219,14 @@ by a #."
   "Fontify #+ lines and blocks."
   (let ((case-fold-search t))
 (when (re-search-forward
-	   (rx bol (group (zero-or-more blank) "#"
+	   (rx bol (group (zero-or-more (any " \t")) "#"
 			  (group (group (or (seq "+" (one-or-more (any "a-zA-Z")) (optional ":"))
-	space
+	(any " \t")
 	eol))
  (optional (group "_" (group (one-or-more (any "a-zA-Z"))
-			  (zero-or-more blank)
+			  (zero-or-more (any " \t"))
 			  (group (group (zero-or-more (not (any " \t\n"
- (zero-or-more blank)
+ (zero-or-more (any " \t"))
  (group (zero-or-more any)
 	   limit t)
   (let ((beg (match-beginning 0))
@@ -5249,7 +5249,7 @@ by a #."
 		quoting (member block-type org-protecting-blocks))
 	  (when (re-search-forward
 		 (rx-to-string `(group bol (or (seq (one-or-more "*") space)
-	   (seq (zero-or-more blank)
+	   (seq (zero-or-more (any " \t"))
 		"#+end"
 		,(match-string 4)
 		word-end
@@ -5323,11 +5323,11 @@ by a #."
 	  ;; Handle short captions
 	  (save-excursion
 	(beginning-of-line)
-	(looking-at (rx (group (zero-or-more blank)
+	(looking-at (rx (group (zero-or-more (any " \t"))
    "#+caption"
    (optional "[" (zero-or-more any) "]")
    ":")
-			(zero-or-more blank
+			(zero-or-more (any " \t")
 	  (add-text-properties (line-beginning-position) (match-end 1)
 			   '(font-lock-fontified t face org-meta-line))
 	  (add-text-properties (match-end 0) (line-end-position)
-- 
2.28.0


Re: basic org questions

2020-09-16 Thread TEC


pssst. I think you're a bit off. See my reply ;)

All the best,

Timothy.