Re: desktop notifications (Re: idea for capture anywhere in x)

2022-10-29 Thread Ihor Radchenko
Samuel Wales  writes:

> perhaps some fuction in org-capture-before-finalize-hook could raise
> emacs for a tiny period of time or something, in the case that it is
> invoked when emacs is not visible. if so, and idk if poss, i would
> have to try it to find out if it wfm.
>
> then i wouldn't hafe to keep trying notification tools ad try to get
> them to have sufficient fonts colors sizes etc. and work.  :)

I use the following code to raise helm frames:

*** Run/search menu via Emacs helm
 #launcher #runner
Inspired by [[id:Mattduckemacs_as_fuzzy_launc_and_alfred_replac6c6][[Mattduck] 
Emacs as a fuzzy launcher and Alfred-replacement]]
#+begin_src bash :tangle ~/.local/bin/emacs-helm-menu :shebang #!/bin/bash
if [[ "$(getactvwindclass)" == "emacs.Emacs" ]]; then
# Relies on my key bindings
xdotool key --clearmodifiers --delay 60 alt+l e h;
# release any pressed modifiers
xdotool keyup super alt ctrl shift
else
emacsclient -c --frame-parameters="((title . \"Helm frame\") (unsplittable 
. t))" -e "(let ((inhibit-message t) (helm-full-frame t) 
(helm-use-undecorated-frame-option nil)) (catch :quit 
(yant/helm-org-ql-agenda-files nil) (when (= 0 helm-exit-status) (let ((fr 
(selected-frame))) (make-frame) (delete-frame fr))) (unless (= 0 
helm-exit-status) (user-error \"%s\" \"Exit frame\"";
fi
#+end_src

You may be interesteed in the --frame-parameters argument to
emacsclient. Similar alist can be passed to `make-frame' from Elisp.
You can refer to 30.4.3 Window Frame Parameters section of Elisp manual.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Inserting arbitrary lines before tables with Babel

2022-10-29 Thread Ihor Radchenko
Kierin Bell  writes:

> When evaluating Babel code blocks with a ':results table' header
> argument, what is the best way to automatically insert text _outside_
> of the table?
>
> For example, if I have a source block:
> #+NAME: get-random-table
> #+begin_src R :var length=12 :results table
>   runif(length)
> #+end_src
>
> ... Then 'org-babel-execute-maybe' (C-c C-v e) will output a nicely
> formatted Org table:
> #+RESULTS: get-random-table
> |  0.645291731692851 |
> | 0.0425670417025685 |
> |  0.220107783330604 |
> |  0.413881630403921 |
> |  0.817712268792093 |
> |  0.972381719155237 |
>
> ... But if I want to insert a line, for example containing a 'NAME'
> keyword, before and _outside of_ that table, there seems to be no easy
> way to do this automatically.

Just insert it right before #+results keyword. #+results is just another
affiliated keyword and can be combined with others.

#+NAME: random-table-1
#+RESULTS: get-random-table
|  0.645291731692851 |
| 0.0425670417025685 |
|  0.220107783330604 |
|  0.413881630403921 |
|  0.817712268792093 |
|  0.972381719155237 |

Also, if you use :exports results, you can refer to the table as
"get-random-table" - the same with the source block name.

> Trying to insert lines using subsequent code blocks (arguments, noweb,
> etc.) will either strip Org table formatting or add additional lines
> within the table instead of outside of it (depending on the ':results'
> arguments). There is the same problem with using a ':post' header
> argument, and ':wrap' does not allow arbitrary insertion of individual
> lines.

What is wrong with the example in 16.6 Results of Evaluation? It shows
how to prepend #+ATTR_LATEX :width 5cm. #+NAME: would be the same.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Exporting images to different output formats

2022-10-29 Thread Ihor Radchenko
Michael Welle  writes:

> I want to export to different output formats. Trouble is the way ox-gfm
> exports images. So I thought, hm, why not utilise macros to abstract away
> the differences. Well, that escalated quickly:
>
> #+macro: img_gfm (eval (concat "#+begin_export md\n![img](" $1 " \"" $2  
> "\")\n*Abb.: " $2 "* (Quelle: " $3 ")\n#+end_export"))
>
> #+macro: img_latex (eval "foobar")
>
> # Image export for Github flavoured markdown
> # $1 path to image
> # $2 caption
> # $3 source
> #+macro: img (eval (cl-case org-export-current-backend ('gfm (concat 
> "{{{img_gfm(" $1 "," $2 "," $3")}}}")) ('latex "{{{img_latex}}}") (t 
> "barfoo")))
>
>
> {{{img(./foo, foo, barfoo)}}}
>
> That kind of works (and breaks if I want commas in the caption)

Re: commas. See 13.5 Macro Replacement

   (1) Since commas separate the arguments, commas within arguments have
to be escaped with the backslash character.  So only those backslash
characters before a comma need escaping with another backslash
character.

> , but is
> ugly as... and doesn't get better if I implement the other output formats.

Agree. The proper way to implement this is special blocks + custom
export filter that will take care about backend selection.

Also, see https://list.orgmode.org/orgmode/87y1yr9gbl@gmail.com/
referring to https://github.com/alhassy/org-special-block-extras/

> Maybe syntax like @@latex: ...@@ would help. But no, I think that is
> defined in the specific backends, not as a general mechanism.

You can have multiple export blocks---one for each backend.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-29 Thread Timothy
Hi Daniel,

> Add a “strip-tangle” noweb option to strip the noweb tags when tangling, but
> keep and expand them otherwise.

I must admit I can’t see the point of this — would you mind providing an
example of when this would be useful?

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-29 Thread Ihor Radchenko
Daniel Ziltener  writes:

> From: Daniel Ziltener 
>
> * lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags
> from block if :noweb has been set to strip-tangle.
> * lisp/ob-core.el (org-babel-common-header-args-w-values): add
> "strip-tangle" as new allowed value.
> * testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): add new test
> case for strip-tangle.
> * doc/org-manual.org (Noweb Reference Syntax): adjust documentation for
> the noweb header argument.
> * etc/ORG-NEWS: add entry for new header argument value.
>
> This patch adds the "strip-tangle" option for the :noweb header
> argument. This strips the noweb tags before tangling the block. This can
> be useful for e.g. testing purposes where one wants to use a block as
> test case that can be both run inline as well as tangled into a file for
> automated testing.

Thanks, but it looks like your PGP signature corrupted the email patch.
Could you please create a separate patch file and attach it in the
reply?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org table proposal: merge and split cells in org-tables

2022-10-29 Thread Ihor Radchenko
Uwe Brauer  writes:

> In a conversation with Ihor Radchenko it was considered as being helpful
> to provide a table in which cells are merged and split.

We should consider this idea seriously as this and related features are
being requested frequently in the community. I recall the following
contexts:

- Support merging cells when exporting to LaTeX tables
- Text filling inside tables

> Here is one
>
> ++-+
> | Region |  Sales  |
> |+-+---+---+---+
> ||  Q1 |Q2 |Q3 |Q4 |
> |+---+-+-+-+-+-+-+-+
> || foo   | bar | foo | bar | foo | bar | foo | bar |
> ++---+-+-+-+-+-+-+-+
> | North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |
> ++---+-+-+-+-+-+-+-+
> | South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |
> ++---+-+-+-+-+-+-+-+

This essentially suggests supporting table.el syntax natively. Or maybe
extending it by mixing with native Org tables.

In terms of syntax, adding cell boundary support might be simply a
question of allowing ++ in Org tables. It will not break anything as
we already parse +-+ as table.el tables.

At lower level of org-element representation, we do not need to change
much either. table-row elements are already not tied to a fixed number
of cells in every row. And we may extend table-row 'rule type to define
the "++   +   +---+--+" cell boundaries.

However, in order to support merging cells, one needs to rework Org in a
number of places. At least:

1. org-element parser and interpreter
2. org-table.el in its totality
3. export backends
4. table formulas; in particular, cell references
5. update syntax document

> Or better

> 
> | Region |  Sales  |
> |---
> ||  Q1 |Q2 |Q3 |Q4 |
> |---
> || foo   | bar | foo | bar | foo | bar | foo | bar |
> 
> | North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |
> 
> | South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |
> 

This will clash with horizontal-rule syntax. Not acceptable. Also,
parsing this kind of table will be significantly harder programatically.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread Ihor Radchenko
Max Nikulin  writes:

> I agree that stderr may be important. I would not mind to have a buffer 
> that combines both stderr and stdout (maybe fontified). Despite order of 
> messages in separate streams is not strictly defined, it still may shed 
> some light on the reason what went wrong.

I am not sure about the right approach of mixing streams.
What we currently do is directing stderr to a separate file. See
`org-babel--shell-command-on-region' and `org-babel-eval'.

Also, note that our error display code is not only used by shell
scripts. Also, by other interpreted languages like python. And we use
compilation-mode, which provides reasonable fontification in many cases.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread Ihor Radchenko
to...@tuxteam.de writes:

>> What you are describing would better fit into a new :results option.
>
> Oh, I missed the popup part. Sounds useful for yet another profile,
> yes.

If you need it, feel free to open a separate feature request for extra
:results options in ob-shell. Possibly providing more details how you
envision this header argument to work.

> And thanks for your incredible work on Org. Do you ever sleep?

Remember that we may have radically different time zones. What appears
to be nightly emails may not necessarily be sent at night. 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Setting org-todo-keywords through directory-local variables

2022-10-29 Thread Ihor Radchenko
[sending to Org ML in-reply to the relevant thread]

Kévin Le Gouguec  writes:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003
28.1.90; Can local variables be loaded before loading major mode?

> … reminded me of a patch I submitted to the Org ML… some time ago 
> (sorry for not following up) to set TODO keywords via .dir-locals.el:
>
> https://list.orgmode.org/87a70stkmv@gmail.com/

Your patch is not listed on https://updates.orgmode.org/
It is also not in my records (I am only following patches closely since
the beginning of this year).
So, it slipped through the cracks.
I am bumping it herein.

At least, the :safe marking is something we can merge right away.

> My rationale with this patch was that AUCTeX and markdown-mode both use
> hack-local-variables-hook successfully to (re)compute stuff from
> dir/file-locals; I figured Org…
>
> * should bite the bullet, at some point: it'd just be really neat for
>   Emacs users used to this feature,

Maybe. That's why this emacs-devel thread.

> * could do so piecemeal, adding support for variables one at a time as
>   people chime in the ML to express a need.

> E.g. my patch only added support for org-todo-keywords and
> org-todo-keyword-faces, but it laid the foundation for adding support
> for other variables later.

I'd prefer to solve it once and for all. I tried early loading of
file-local variables in the past, but had to revert the commit because
of major issues. See
https://list.orgmode.org/87r11wkmew@ucl.ac.uk/T/#mab6359ed2107d5515c6bb6b266551f0c5049ceca

Maybe the hook approach can work better. But I'd prefer to discuss all
the possible caveats first.

> Also to try to reduce the risk of breakage, it went for "compute Org
> settings normally; then selectively recompute some if relevant variables
> are found in dir/file-locals".  That way "regular" Org users who rely
> rather on SETUPFILEs wouldn't be impacted, only "early adopters" of
> dir/file-locals might shoot themselves in the foot.

I am not sure what is the problem with SETUPFILE.
We can simply load it in the hook. Though the priority of SETUPFILE vs.
local variables should be discussed. Probably, local variables should
take precedence to keep things consistent with the rest of Emacs.

> (Also it had tests )

Tests are always welcome :)

> Anyhoo.  Not even sure the patch applies after two years, but the
> general approach might be worth looking into?

Sure.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Identical attributes id="text-table-of-contents" of div with role="doc-toc" when exporting to html when using tables of contents for multiple subheadings

2022-10-29 Thread Ihor Radchenko
Michel Damiens  writes:

> when exporting to html this org document :
>
>  #+OPTIONS: toc:1
>  * par 1
>  #+TOC: headlines 1 local
>  ** par 1.1
>  ** par 1.2
>  * par 2
>  #+TOC: headlines 1 local
>  ** par 2.1
>  ** par 2.2
>
> div's for toc (with role="org-toc") in subheadings par 1 and par 2 get the
> same id : text-table-of-contents :

Confirmed.
Timothy, could you take a look?
We could probably modify the id in `org-html-toc' when SCOPE is non-nil.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-x11idle-exists-p with emacs --daemon

2022-10-29 Thread Ihor Radchenko
Max Nikulin  writes:

> On 28/10/2022 11:28, Ihor Radchenko wrote:
>> 
>> * lisp/org-clock.el (org-x11idle-exists-p): Do not check if load-time
>> `window-system' is `x'.  Instead, rely on the check in
>> `org-user-idle-seconds'.
>
> I would say that even there it is not strictly correct to test 
> `window-system', perhaps `x-display-list' is a bit better since 
> particular frame may be a terminal one running in xterm, but user has x 
> frames.

I am not sure here.

Let us first establish the purpose of all this fiddling with idle
program.

`org-user-idle-seconds' is aiming to find the actual idle time of an Org
user. Not just in Emacs, but also in other places. That's why the
fallback `org-emacs-idle-seconds' is not the most accurate, and we are
trying to use other, more accurate, means to determine idle time.

`org-user-idle-seconds' uses system command to determine idle time, when
possible. On Mac, such command is always available. On X11, Org defaults
to https://git.sr.ht/~bzg/worg/tree/master/item/code/scripts/x11idle.c
script that will fail to work from non-X frame, AFAIU.

So, I do think the `window-system' is the right way to invoke x11idle at
least. Terminal frames may not have access to X11 scope and thus will
not be able to determine the real idle time. Not to mention that
terminal Emacs may not be running on X and even successfully getting
idle time will yield erroneous results.

> In server.el I found
>
>  (frame-parameter frame 'display)
>
> that might be even better and should work with daemon having a single 
> frame in xterm. I can not figure out if --display command line option 
> affects some variable of Emacs daemon.

I do not understand. I just tried to check the value of `window-system'
in terminal Emacs frame and in X11 Emacs frame running using the same
Emacs daemon. The value in X11 frame is 'x and nil in terminal. So,
`window-system' already accounts for current frame.

> Another tricky case is multiple x connection to different displays. It 
> seems GTK3 have some limitations (pgtk build) and such rarely used 
> configuration will become completely obsolete.

Multiple X connection means non-deterministic idle time. Each individual
X server will have its own idle time. The current approach with running
`org-x11-idle-seconds' in current frame is the most reasonable in such
scenario, IMHO.

>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>> index e98a34f0d..ca026c44f 100644
>> --- a/lisp/org-clock.el
>> +++ b/lisp/org-clock.el
>> @@ -1201,8 +1201,7 @@ (defun org-mac-idle-seconds ()
>>  
>>  (defvar org-x11idle-exists-p
>>;; Check that x11idle exists
>> -  (and (eq window-system 'x)
>> -   (eq 0 (call-process-shell-command
>> +  (and (eq 0 (call-process-shell-command
>>(format "command -v %s" org-clock-x11idle-program-name)))
>
> I joined to this discussion presuming (by some confusion) that such 
> variable should be lazily initialized on first call of 
> `org-user-idle-seconds'. I considered `window-system' test as a way to 
> distinguish GUI and text Emacs sessions. Actually such parameter is 
> dynamic. Remotely running Emacs may be disconnected from one X server 
> and connected to another session.
>
> Actually `window-system' check has another role: skip command 
> availability test on systems other than Linux.
>
> What is the result of "command -v" on Windows? Should it be executed 
> there at all (unconditionally at load time)?

It will fail and the value of `org-x11idle-exists-p' will be nil. I do
not see any problem here.

> P.S. There are a number of X11 servers for Windows. I am unsure if Emacs 
> builds for Windows and X11 frames are supported. I am lost how to 
> properly test such cases in the code.

We do not care. We check if idle program works by calling it. If it
fails (due to command being not available or not supporting the X11
server), we fall back to safe approach using Emacs idle time.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-29 Thread Daniel Ziltener

From: Daniel Ziltener 

* lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags
from block if :noweb has been set to strip-tangle.
* lisp/ob-core.el (org-babel-common-header-args-w-values): add
"strip-tangle" as new allowed value.
* testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): add new test
case for strip-tangle.
* doc/org-manual.org (Noweb Reference Syntax): adjust documentation for
the noweb header argument.
* etc/ORG-NEWS: add entry for new header argument value.

This patch adds the "strip-tangle" option for the :noweb header
argument. This strips the noweb tags before tangling the block. This can
be useful for e.g. testing purposes where one wants to use a block as
test case that can be both run inline as well as tangled into a file for
automated testing.
---
 doc/org-manual.org |  6 ++
 etc/ORG-NEWS   |  5 +
 lisp/ob-core.el    |  2 +-
 lisp/ob-tangle.el  |  4 +++-
 testing/lisp/test-ob-tangle.el | 26 ++
 5 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 18a050069..064d51bcd 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -18993,6 +18993,12 @@ tangled, or exported.
   Expansion of noweb syntax references in the body of the code block
   when tangling.  No expansion when evaluating or exporting.

+- =strip-tangle= ::
+
+  Expansion of noweb syntax references in the body of the code block
+  when evaluating or exporting.  Removes noweb syntax references
+  when exporting.
+
 - =no-export= ::

   Expansion of noweb syntax references in the body of the code block
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6e875deb6..2c66d2e45 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,6 +228,11 @@ commands.
 =:noweb-prefix= can be set to =no= to prevent the prefix characters
 from being repeated when expanding a multiline noweb reference.

+*** New =:noweb= babel header argument value =strip-tangle=
+
+=:noweb= can be set to =strip-tangle= to strip the noweb syntax references
+before tangling.
+
 *** New LaTeX source block backend using =engraved-faces-latex=

 When ~org-latex-src-block-backend~ is set to ~engraved~,
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 518831ec6..c52f113b4 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -414,7 +414,7 @@ then run `org-babel-switch-to-session'."
 (mkdirp    . ((yes no)))
 (no-expand)
 (noeval)
-    (noweb    . ((yes no tangle no-export strip-export)))
+    (noweb    . ((yes no tangle strip-tangle no-export strip-export)))
 (noweb-ref    . :any)
 (noweb-sep  . :any)
 (noweb-prefix . ((no yes)))
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 2da92efaf..d9d847195 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -536,7 +536,9 @@ non-nil, return the full association list to be used by
  (body
   ;; Run the tangle-body-hook.
   (let ((body (if (org-babel-noweb-p params :tangle)
-              (org-babel-expand-noweb-references info)
+  (if (string= "strip-tangle" (cdr (assq :noweb 
(nth 2 info
+  (replace-regexp-in-string 
(org-babel-noweb-wrap) "" (nth 1 info))

+                (org-babel-expand-noweb-references info))
         (nth 1 info
     (with-temp-buffer
   (insert
diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index a0003ee40..af2a72682 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -510,6 +510,32 @@ another block
         (org-split-string (buffer-string
   (delete-file file))

+(ert-deftest ob-tangle/strip-tangle ()
+  "Test if strip-tangle works correctly when tangling noweb code blocks."
+  (should
+   (equal '("1")
+  (let ((file (make-temp-file "org-tangle-")))
+    (unwind-protect
+    (progn
+  (org-test-with-temp-text-in-file
+   (format "
+#+name: block1
+#+begin_src elisp
+2
+#+end_src
+
+#+begin_src elisp :noweb strip-tangle :tangle %s
++1<>
+#+end_src
+" file)
+   (let ((org-babel-noweb-error-all-langs nil)
+ (org-babel-noweb-error-langs nil))
+ (org-babel-tangle)))
+  (with-temp-buffer
+    (insert-file-contents file)
+    (org-split-string (buffer-string
+  (delete-file file))
+
 (ert-deftest ob-tangle/detangle-false-positive ()
   "Test handling of false positive link during detangle."
   (let (buffer)
--
2.35.3




OpenPGP_0x752C7F031AADF16F.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: desktop notifications (Re: idea for capture anywhere in x)

2022-10-29 Thread Samuel Wales
i am lost in a sea of partial solutions and hints that myb rain cannot
process at this time, despite their straightforwardness.  i do like
the idea of having confidence that a capture worked thgouh very much.

perhaps some fuction in org-capture-before-finalize-hook could raise
emacs for a tiny period of time or something, in the case that it is
invoked when emacs is not visible. if so, and idk if poss, i would
have to try it to find out if it wfm.

then i wouldn't hafe to keep trying notification tools ad try to get
them to have sufficient fonts colors sizes etc. and work.  :)

On 10/29/22, Max Nikulin  wrote:
> On 29/10/2022 11:59, Ihor Radchenko wrote:
>>
>> Functions in org-capture-before-finalize-hook have access to the
>> contents of the capture buffer text. So, one can call `start-process' to
>> run notify-send shell command and put the actual captured text into the
>> notification (displayed briefly or for longer time according to the
>> switches passed to notify-send).
>
> I like this idea. Reading your message from Sat, 29 Oct 2022 02:59:51
> + I decided that for yourself you set up an Emacs frame as a pop-up
> to display capture result. However I believe it is better to use either
> org-clock or Emacs notify functions directly instead of notify-send tool.
>
> Samuel, I suggested notify-send tool as a means to debug notifications
> in isolation (without `org-capture'). Have you managed to configure
> notification-daemon, dunst or some other alternative to get acceptable
> appearance and proper timeout before notification disappears.
>
>
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: citar--library-file-action

2022-10-29 Thread Henrik Frisk
Den tis 25 okt. 2022 kl 22:42 skrev Bruce D'Arcus :

> For citar support/bugs, you should report on the github issue tracker.
>
> But my guess: you need to install citar-embark, as a while ago, we
> moved the embark-related functionality into a separate package. If
> it's been a few months since you've updated, that would likely explain
> it.
>
If someone should come acress this thread I can confirm that Bruce's
suggestion works. Just install citar-embark and configure it according to
the instructions on the github page. Should I add this to the issue tracker
as well Bruce?


Re: Getting X selection reliably (Re: idea for capture anywhere in x)

2022-10-29 Thread Samuel Wales
i am still slightly lost [varying cognitive issues] but wanted to make
one correction.  i think i have my capture set up so that my typical
capture location shows, although it is underneath ff so cannot be seen
at the time.  so a new frame in many cases is not necessary; the
existing emacs frame could pop up for a brief period in principle.
not much of a correction but there it is.

On 10/28/22, Samuel Wales  wrote:
> if what we are talking about is checking the text or metadata as org
> capture or emacs understands it against what we are capturing in a
> maximized application, by means of a popup and a human [myself], then:
>
> i'd say an emacs frame popping up over the application [whether the
> application is emacs or firefox or whatever] as just another frame for
> my normal emacs [which has some degree of optimization for ergo and
> accessibiity], but frame shrunk to fit the text, would actually be
> preferable to a separate popup application/notifier tool [which would
> require unfamiliar configuration and might not even be ergo or
> accessible or portable/lts], provided that it goes away after a
> configured delay, and does not require the keyboard or the mouse to
> make it go away.  so an emacs frame is not a bad idea, just has to be
> done right.  i think.
>
>> For other applications, since you have a requirement of maximized
>> application window and purely mouse action, I am
> unsure if you managed to configure fluxbox to add a custom menu entry
> accessible in such layout.
>
> fluxbox is the only wm or de that seems to do everything i need.  in
> this case, it is quite straightforward for me [or else i have put out
> of my mind any annoyance at previous years' efforts in making it
> work].
>
> what it does is have a bar that drops down when mouse pointer hits top
> edge of window.  this only works if the application is maximized or
> normalized rather than fullscreen in fluxbox's terminology.  and that
> is the case for everything i'd need to capture.  the only fullscreen
> apps i have are video players, and idk what the point of fullscreen is
> but with video players they seem to get fit to screen right then as
> opposed to having the video extend off teh edge of the screen or be
> tiny or whatever.  i do not need to capture from vlc or mpv.
> [although a super-fancy doug englebart demo type of pov might have me
> grabbing a few minutes of video and capturing it and then speech to
> text from the video and metadata would be captured but i am not
> holding my breath or expecting that.]
>
> then rclick on that fluxbox bar drops down a fluxbox menu of highly
> useful things, which i can add a line to in .fluxbox/.menu to add one.
> usually shell commands.  and also various fluxbox items like maximize
> and close.  and menus i never use courtesy of fluxbox and debian].  it
> is copacetic.  except for one rather annoying bug, which is that the
> bar stays there if i select anything from that manu, so i have to move
> pointer to the top again and then back to make it go away again.  i
> gave up trying to fix that bug, wish it could be fixed.  but adding a
> menu item is for me trivial.  so that part is not part of the problem.
> i just open .menu and cargo cult a line that says capture.
>
>
> On 10/28/22, Max Nikulin  wrote:
>> On 29/10/2022 09:59, Ihor Radchenko wrote:
>>> Max Nikulin writes:
>>>
 %(org-get-x-clipboard 'PRIMARY)
 "
   :immediate-finish t)

 However to be at the safe side I would check if (org-get-x-clipboard
 'PRIMARY) value is not nil at first.
>>>
>>> My approach to this is simply showing a popup with captured heading
>>> after capture. If anything is wrong, I can quickly notice.
>>>
>>> Not sure if it is suitable for Samuel though.
>>
>> I started with a small wrapper that checks if Emacs server is running
>> and creates a new frame if it does not exist yet. So I avoided a pitfall
>> with empty string instead of selection. I intentionally do not use
>> :immediate-finish to inspect capture and to add some comment.
>>
>> Samuel wish to have minimal distraction: no sound, no popup window,
>> Emacs window is not raised in front of current application, visual
>> notification should disappear after some pause.
>>
>> That is why I believe that additional checks are required in such silent
>> workflow to avoid missed data in notes.
>>
>>
>>
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: Init.el

2022-10-29 Thread Eduardo Ochs
On Sat, 29 Oct 2022 at 16:08, Renato Pontefice
 wrote:
> (...)

Hi Renato,

I've uploaded a version with some fixes of your init.el to:

  https://0x0.st/oYcy.txt

I just added comment signs at the beginning of some lines, and I used
TAB in most lines to make Emacs indent - i.e., position - them
correctly. Here is a screenshot of how my fixed version of your
init.el looks in Emacs with the colors that I use:

  https://i.ibb.co/4J2T6VQ/sshot.png

Note that all comments appear in brown.

My favorite elisp tutorial is the second link below:

  http://angg.twu.net/eev-intros/find-eev-quick-intro.html#2
  http://angg.twu.net/eev-intros/find-elisp-intro.html

Cheers,
  Eduardo Ochs
  http://angg.twu.net/eepitch.html



Inserting arbitrary lines before tables with Babel

2022-10-29 Thread Kierin Bell


Hello,

When evaluating Babel code blocks with a ':results table' header
argument, what is the best way to automatically insert text _outside_
of the table?

For example, if I have a source block:
#+NAME: get-random-table
#+begin_src R :var length=12 :results table
  runif(length)
#+end_src

... Then 'org-babel-execute-maybe' (C-c C-v e) will output a nicely
formatted Org table:
#+RESULTS: get-random-table
|  0.645291731692851 |
| 0.0425670417025685 |
|  0.220107783330604 |
|  0.413881630403921 |
|  0.817712268792093 |
|  0.972381719155237 |

... But if I want to insert a line, for example containing a 'NAME'
keyword, before and _outside of_ that table, there seems to be no easy
way to do this automatically.

Trying to insert lines using subsequent code blocks (arguments, noweb,
etc.) will either strip Org table formatting or add additional lines
within the table instead of outside of it (depending on the ':results'
arguments). There is the same problem with using a ':post' header
argument, and ':wrap' does not allow arbitrary insertion of individual
lines.

What I have in mind is to be able to do things like:
#+CALL: get-named-table(name="random-table-1", source-block="get-random-table", 
length=7)

#+RESULTS:
#+NAME: random-table-1
| 0.310966729884967 |
| 0.700660327449441 |
| 0.668548531830311 |
| 0.497187710367143 |
| 0.245545281097293 |
| 0.597585438517854 |
| 0.639235997572541 |

The only "solution" I can think of -- using Elisp to reformat list
objects as Org tables -- feels like an overly complicated hack:

#+NAME: get-named-table
#+begin_src emacs-lisp :results raw :var name="default-name" length=12
  (when (and (boundp 'source-block) (stringp source-block))
(let ((data (ensure-list (read (eval `(org-sbe ,source-block (length 
,length)))
  (concat
   (format "#+NAME: %s" name)
   "\n"
   (orgtbl-to-orgtbl
(or (and (seq-every-p
  (lambda (e)
(or (eq e 'hline) (listp e)))
  data)
 data)
(list data))
nil
#+end_src

Is there a better way? (I'm learning that there usually is with Org.)
The ability to dynamically prepend and append (e.g., #+TBLFM:) lines to
results tables seems like it would be useful.


Thanks,
Kierin



indent-tabs-mode in org (was: ob-clojure eval error when has comment at end of code line)

2022-10-29 Thread Daniel Kraus


Ihor Radchenko  writes:
> Daniel Kraus  writes:
>
>> - What should I use for indention? Looking in ob-clojure and org.el
>>   it seems that using tabs with tab-width 8 is standard but there's
>>   quite a few lines where it's spaces only.
> That is a good question. I guess, just Emacs default.
> Our code is not consistent here...
> Maybe Bastien can clarify better.

jFYI, because I was just wondering why the org
.dir-locals.el sets indent-tabs-mode to nil.
Luckily Kyle wrote a good commit message:

--cut--
.dir-locals.el: Set indent-tabs-mode to nil in Elisp sources

Despite .dir-locals.el having a catchall value of t for
indent-tabs-mode, Org's Elisp files are a mix of tabs and spaces.
Emacs has used a value of nil for indent-tabs-mode since 93d4412046
(Set indent-tabs-mode to nil in (most) Elisp sources, 2015-04-15).  Do
the same.

Ref: https://orgmode.org/list/87eejsg9vw@gnu.org
--cut--

So that clarifies it for me and I do NOT indent with tabs in the future :)

Cheers,
  Daniel



Re: Init.el

2022-10-29 Thread tomas
On Sat, Oct 29, 2022 at 09:08:08PM +0200, Renato Pontefice wrote:
> I’m sorry, but I’m in a big big confusion…I regreat but I’m unable to correct 
> the prob the is originated to my init.el and the conclusion is that I cannot 
> use emac.
> I ask if you can correct my init.el (that I post)

OK, below is your file, each line preceded by >, as is usual
in quoting mails. My comments are mixed in-between, I hope
this is readable for you:

> ;; -ss*- mode: elisp -*-
> 
> 
> ;;--setta il formato della data diversamente --
> ;;(setq-default org-display-custom-times t)
> (setq org-time-stamp-custom-formats '("<%a %d %m %Y>" . "<%a %d %m %Y 
> %H:%M>"))
> 
> ;;- comandi per gestire la grandezza della finestraprincipale di emacs 
> -
> (setq initial-frame-alist
>(append '((width . 200) (height . 400) (top 45) (left 45) ())
>initial-frame-alist))
> 
> ;;---(add-to-list 'default-frame-alist '(height . 24))
> (add-to-list 'default-frame-alist '(width . 80)) 
> 
> ;; fà partire in AGENDA la settimana dal giorno 1---
> (setq calendar-week-start-day 1)
> 
> ;;---settaggi carattere e dimensione di default del carattere--
> (set-face-attribute 'default nil :font "Andale Mono" :height 160 )
> 
> ;; Disable the splash screen (to enable it agin, replace the t with 0)
> (setq inhibit-splash-screen t)
> 
> ;; Enable transient mark mode
> (transient-mark-mode 1)
> 
> ;;Org mode configuration
> Enable Org mode

This "Enable Org mode" has to be preceded by a semicolon,
like so:

  ;; Enable Org mode

(we had this one already)

> (require 'org)

This one is actually unnecessary, because it is done again a couple
of lines below. But it should be harmless.

> 
> ;; Make Org mode work with files ending in .org
> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
> The above is the default in recent emacsen

This one should be commented out, like the "Enable..." above:

  ;; The above is...

> (require 'org)
> (setq org-log-done t)
> 
> ;; set maximum indentation for description lists
> (setq org-list-description-max-indent 5)
> 
> ;; prevent demoting heading also shifting text inside sections
> (setq org-adapt-indentation nil)
> 
> ;; determina le sequenze di stato al TODO
> (setq org-todo-keywords
>  '((sequence "TODO" "IN-PROGRESS" "WAITING" "DONE")))
> 
> ;;-- file utilizzati  per TODO list in Agenda
> (setq org-agenda-files '( "~/org/agenda/"   
> ;;  "~/org/agenda/amorc.org "
> ;;  "~/org/agenda/amorc.org "
> ;; "~/org/agenda/renato.org "
>  ))
> ;; mappa alcuni tasti per ottenere le parentesi graffe e quadre
> (global-set-key "\M-(" (lambda () (interactive) (insert "{")))
> (global-set-key "\M-)" (lambda () (interactive) (insert "}")))
> (global-set-key "\M-7" (lambda () (interactive) (insert "#")))
> (global-set-key "\M-8" (lambda () (interactive) (insert "[")))
> (global-set-key "\M-9" (lambda () (interactive) (insert "]")))
> 
> (global-set-key "\M-9" (lambda () (interactive) (insert "]")))
> 
> ;;---Aggiunge il TIMESTAMP quando chiudo uno statemet TODO
> (setq org-log-done 'time)
> 
> ;;fa aggiungere una nota di testo quando si chiude un TODO
> (setq org-log-done 'note)
> 
> ;;--setta dei tasti comodi da utilizzare in emacs
> (global-set-key (kbd "C-c l") #'org-store-link)
> (global-set-key (kbd "C-c a") #'org-agenda)
> (global-set-key (kbd "C-c c") #'org-capture)
> 
> ;;--- azioni applicate ai TODO
> (setq org-todo-keywords
>  '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
> (custom-set-variables

The above should be commented out, since the rest of the expression
is commented out, too. Otherwise you get unbalanced parentheses.
Change the above line to this:

  ;; (custom-set-variables

>  ;;custom-set-variables was added by Custom.
>  ;;If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> ;; '(package-selected-packages '(org-contacts frame-tabs ebdb)))
> ::(custom-set-faces
> ;;  custom-set-faces was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> ;;)
> ;;-apre emacs-org mode in modalità Agenda
> (org-agenda-list)
> (delete-other-windows)

With these changes the file parses successfully in "my" Emacs.

Hope that helps

-- 
tomás


signature.asc
Description: PGP signature


Init.el

2022-10-29 Thread Renato Pontefice
I’m sorry, but I’m in a big big confusion…I regreat but I’m unable to correct 
the prob the is originated to my init.el and the conclusion is that I cannot 
use emac.
I ask if you can correct my init.el (that I post)
;; -ss*- mode: elisp -*-


;;--setta il formato della data diversamente --
;;(setq-default org-display-custom-times t)
(setq org-time-stamp-custom-formats '("<%a %d %m %Y>" . "<%a %d %m %Y %H:%M>"))

;;- comandi per gestire la grandezza della finestraprincipale di emacs -
(setq initial-frame-alist
   (append '((width . 200) (height . 400) (top 45) (left 45) ())
   initial-frame-alist))

;;---(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(width . 80)) 

;; fà partire in AGENDA la settimana dal giorno 1---
(setq calendar-week-start-day 1)

;;---settaggi carattere e dimensione di default del carattere--
(set-face-attribute 'default nil :font "Andale Mono" :height 160 )

;; Disable the splash screen (to enable it agin, replace the t with 0)
(setq inhibit-splash-screen t)

;; Enable transient mark mode
(transient-mark-mode 1)

;;Org mode configuration
Enable Org mode
(require 'org)

;; Make Org mode work with files ending in .org
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
The above is the default in recent emacsen
(require 'org)
(setq org-log-done t)

;; set maximum indentation for description lists
(setq org-list-description-max-indent 5)

;; prevent demoting heading also shifting text inside sections
(setq org-adapt-indentation nil)

;; determina le sequenze di stato al TODO
(setq org-todo-keywords
 '((sequence "TODO" "IN-PROGRESS" "WAITING" "DONE")))

;;-- file utilizzati  per TODO list in Agenda
(setq org-agenda-files '( "~/org/agenda/"   
;;  "~/org/agenda/amorc.org "
;;  "~/org/agenda/amorc.org "
;; "~/org/agenda/renato.org "
 ))
;; mappa alcuni tasti per ottenere le parentesi graffe e quadre
(global-set-key "\M-(" (lambda () (interactive) (insert "{")))
(global-set-key "\M-)" (lambda () (interactive) (insert "}")))
(global-set-key "\M-7" (lambda () (interactive) (insert "#")))
(global-set-key "\M-8" (lambda () (interactive) (insert "[")))
(global-set-key "\M-9" (lambda () (interactive) (insert "]")))

(global-set-key "\M-9" (lambda () (interactive) (insert "]")))

;;---Aggiunge il TIMESTAMP quando chiudo uno statemet TODO
(setq org-log-done 'time)

;;fa aggiungere una nota di testo quando si chiude un TODO
(setq org-log-done 'note)

;;--setta dei tasti comodi da utilizzare in emacs
(global-set-key (kbd "C-c l") #'org-store-link)
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c c") #'org-capture)

;;--- azioni applicate ai TODO
(setq org-todo-keywords
 '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
(custom-set-variables
 ;;custom-set-variables was added by Custom.
 ;;If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;; '(package-selected-packages '(org-contacts frame-tabs ebdb)))
::(custom-set-faces
;;  custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;;)
;;-apre emacs-org mode in modalità Agenda
(org-agenda-list)
(delete-other-windows)

In a way that I can reuse org mode again
I really don’t find what’s goes bad (I don’t know lisp)

Really thank you


Renato

> Il giorno 29 ott 2022, alle ore 19:46,   
> ha scritto:
> 
> ;;Org mode configuration
> ;; Enable Org mode
> (require ‘org)



Re: Position 972

2022-10-29 Thread tomas
On Sat, Oct 29, 2022 at 06:16:30PM +, Juan Manuel Macías wrote:

[...]

> Renato, adding to what Tomas and Bruno have explained to you very well,
> you have another case in the init that you sent me by mail. Notice the
> third line here:

Oh, I get it that Juan Manuel has received one copy of the init.el.

Then I take back my last mail :-)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Position 972

2022-10-29 Thread tomas
On Sat, Oct 29, 2022 at 06:29:33PM +, Juan Manuel Macías wrote:
> Renato Pontefice writes:
> 
> > Symbol's value as variable is void: ‘org
> 
> It's 'org not ‘org. Notice the difference between the quotes[1]. (Did you
> modify that part? It was correct before).

Perhaps it was Google (through gmail) who modified it. They do that kind
of things. We don't know.

@Renato: it seems your init.el is badly mangled. Please, go through it
and look for pieces of private information. If there are any, remove
them and post the rest for us to see (this has been suggested a couple
of times). That will be a lot quicker than to chase every single bug
in the dark.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Position 972

2022-10-29 Thread Juan Manuel Macías
Renato Pontefice writes:

> Symbol's value as variable is void: ‘org

It's 'org not ‘org. Notice the difference between the quotes[1]. (Did you
modify that part? It was correct before).

[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html



Re: Position 972

2022-10-29 Thread Juan Manuel Macías
Renato Pontefice writes:

> Bruno,
> With the common you told me I reach che 972 /M-g c 972) and I found this:
>
> ;;Org mode configuration
>  Enable Org mode
> (require ‘org)
>
> Could be this the error?
>
> Now I’ve erased the two ;; save init.el and restart emacs, but now I obtain:
> -
> Warning (initialization): An error occurred while loading 
> ‘/Users/renatopontefice/.emacs.d/init.el’:
>
> Symbol's value as variable is void: Enable
>
> To ensure normal operation, you should investigate and remove the
> cause of the error in your initialization file.  Start Emacs with
> the ‘--debug-init’ option to view a complete error backtrace. Disable showing 
> Disable logging
> ———
>
> What’s now…

Renato, adding to what Tomas and Bruno have explained to you very well,
you have another case in the init that you sent me by mail. Notice the
third line here:

--
;; Make Org mode work with files ending in .org
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
The above is the default in recent emacsen
(require 'org)
(setq org-log-done t)
--

Emacs will understand The line that begins "The above is the..." as
code, and it is not code but a comment to the code. Therefore, you must
protect that line with an escape character, which in Elisp is (at least)
one ";" (as Tomas explained to you):

;; Make Org mode work with files ending in .org
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
;; The above is the default in recent emacsen
(require 'org)
(setq org-log-done t)

And you also have another case, towards the end:

-
(custom-set-variables
 ;;custom-set-variables was added by Custom.
 ;;If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;; '(package-selected-packages '(org-contacts frame-tabs ebdb)))
::(custom-set-faces
;;  custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;;)


The first line (custom-set-variables) is the beginning of a code that is
commented out (= protected, so that Emacs doesn't read it). This line
should also be commented out (protected), with ;. Otherwise Emacs will
run into a code that starts but doesn't have a resolution.

If you fix that and the line that starts with "Enable", you should no
longer have errors in your init.

Best regards,

Juan Manuel 



Re: Position 972

2022-10-29 Thread Renato Pontefice
Ok, I’ve reinserted the line you send me, but now, the error 972 ia 
disappeared, but I have this error:

__

Warning (initialization): An error occurred while loading 
‘/Users/renatopontefice/.emacs.d/init.el’:

Symbol's value as variable is void: ‘org

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace. Disable showing 
Disable logging
___

I cannot understand what going on have you any idea?


Thank you

Re

> Il giorno 29 ott 2022, alle ore 19:46,   
> ha scritto:
> 
> ;;Org mode configuration
> ;; Enable Org mode
> (require ‘org)



Re: Position 972

2022-10-29 Thread tomas
On Sat, Oct 29, 2022 at 06:29:28PM +0200, Renato Pontefice wrote:
> Bruno,
> With the common you told me I reach che 972 /M-g c 972) and I found this:
> 
> ;;Org mode configuration
>  Enable Org mode
> (require ‘org)
> 
> Could be this the error?
> 
> Now I’ve erased the two ;; save init.el and restart emacs, but now I obtain:

No, no: you have to put (at least one) ; in front of "Enable".

Thing is: a semicolon marks a comment (so Emacs doesn't try to read
it as a program), and this line "Enable Org mode" is meant as a
comment. The mark is missing.

The whole thing should look like this:

;;Org mode configuration
;; Enable Org mode
(require ‘org)

(actually it doesn't matter how many ; are in front of Enable, but
two would correspond to the convention).

Cheers
-- 
tomás


signature.asc
Description: PGP signature


org table proposal: merge and split cells in org-tables

2022-10-29 Thread Uwe Brauer


Hi

This subject is brought up regularly. 

In a conversation with Ihor Radchenko it was considered as being helpful
to provide a table in which cells are merged and split.

Here is one

++-+
| Region |  Sales  |
|+-+---+---+---+
||  Q1 |Q2 |Q3 |Q4 |
|+---+-+-+-+-+-+-+-+
|| foo   | bar | foo | bar | foo | bar | foo | bar |
++---+-+-+-+-+-+-+-+
| North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |
++---+-+-+-+-+-+-+-+
| South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |
++---+-+-+-+-+-+-+-+

Or better





| Region |  Sales  |
|---
||  Q1 |Q2 |Q3 |Q4 |
|---
|| foo   | bar | foo | bar | foo | bar | foo | bar |

| North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |

| South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |






-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




Position 972

2022-10-29 Thread Renato Pontefice
Bruno,
With the common you told me I reach che 972 /M-g c 972) and I found this:

;;Org mode configuration
 Enable Org mode
(require ‘org)

Could be this the error?

Now I’ve erased the two ;; save init.el and restart emacs, but now I obtain:
-
Warning (initialization): An error occurred while loading 
‘/Users/renatopontefice/.emacs.d/init.el’:

Symbol's value as variable is void: Enable

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace. Disable showing 
Disable logging
———

What’s now…

Renato


Identical attributes id="text-table-of-contents" of div with role="doc-toc" when exporting to html when using tables of contents for multiple subheadings

2022-10-29 Thread Michel Damiens
Hello,

when exporting to html this org document :

 #+OPTIONS: toc:1
 * par 1
 #+TOC: headlines 1 local
 ** par 1.1
 ** par 1.2
 * par 2
 #+TOC: headlines 1 local
 ** par 2.1
 ** par 2.2

div's for toc (with role="org-toc") in subheadings par 1 and par 2 get the
same id : text-table-of-contents :


 
  Table des matières
  
   
par 1
par 2
   
  
 
 
  par 1
  
   <-- HERE
   
 par 1.1
 par 1.2
   
  
  
  
   par 1.1
  
  
   par 1.2
  
 
 
  par 2
  
<-- HERE

par 2.1
par 2.2

   
  
  
   par 2.1
  
  
   par 2.2
  
 


Is it possible to differentiate them in modifying some export option ?

Thanks for your help.
Michel


[CLOSED] Re: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list

2022-10-29 Thread Christopher M. Miles

Daniel Kraus  writes:

> Hi
>
> Ihor Radchenko  writes:
>> "Christopher M. Miles"  writes:
>>> Any review comments about this patch?
>> I have sent the following comment shortly after your followup:
>
> I even made another post after that, suggesting that the if condition
> is not even needed. Simply always quoting seems to work and is also the
> way it's done in `ob-lisp.el`.
> See https://list.orgmode.org/orgmode/874jvp9wsg@kraus.my/
>
> This simple patch is also already installed. Can you test if that works for 
> you?
>
> And in case you missed it, I made another reply for you bug report
> about inline comments.
> Check https://list.orgmode.org/orgmode/878rl1a1e0@kraus.my/
>
> Thanks,
>   Daniel

Indeed, your solution is better. Sorry that I have not realized your
patch. Thanks for notify me again. Closed this thread now.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

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


signature.asc
Description: PGP signature


Re: Still prob the I cannot solve....

2022-10-29 Thread Bruno Barbier


Hi Renato,

You'll have more chance to get help if you reply to the list, using the
same thread.

Renato Pontefice  writes:

> When I start emacs, now I receive this messages:
> 
> Warning (initialization): An error occurred while loading 
> ‘/Users/renatopontefice/.emacs.d/init.el’:
>
> Symbol's value as variable is void: Enable

This is the problem Emacs is telling you about:

  ;;Org mode configuration
  Enable Org mode
  (require 'org)

it should be:
  ;;Org mode configuration
  ;; Enable Org mode
  (require 'org)

Did you fix that problem?


> Debugger entered--Lisp error: (void-variable Enable)
>   eval-buffer(# nil
>   "/Users/renatopontefice/.emacs.d/init.el" nil t)  ; Reading at
>   buffer position 972
   

About moving to the position 972, you'll find the answer in the Emacs
manual. For example:
   https://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-Point.html

Did you try what I told you to do ?

   M-g c 972

If the fixed init.el, that I've sent you, didnt work, you might consider
posting it here so that other people may help.

Hope this help,


Bruno


>   load-with-code-conversion("/Users/renatopontefice/.emacs.d/init.el" 
> "/Users/renatopontefice/.emacs.d/init.el" t t)
>   load("/Users/renatopontefice/.emacs.d/init" noerror nomessage)
>   startup--load-user-init-file(#f(compiled-function () # -0x148fea9201ab75f>) #f(compiled-function () #) 
> t)
>   command-line()
>
>
> What does they means?



bug#35453: 26.1; Poor performance of vertical-motion in large org buffer

2022-10-29 Thread Stefan Kangas
For posterity, this was closed by feature/noverlay being merged:
https://lists.gnu.org/archive/html/emacs-devel/2022-10/msg02166.html





Re: incorrect indentation of new item inserted with capture template

2022-10-29 Thread Ihor Radchenko
Ian Garmaise  writes:

> I figured out the problem.  Seems like date trees expect only list items
> between date headlines.
> I had been adding headlines between dates, and this seems to confuse the
> insertion mechanism.  I now stick to list items and it works perfectly.
> Might be a good idea to add something about this to the manual.

If you post an example where org-datetree gets confused, we can improve
things on Org side.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Cannot find therefore at 972 character...

2022-10-29 Thread Juan Manuel Macías
Renato Pontefice writes:

> I tried ib more way, but I’m unable to see where the error is.
>
> Can you help me? Please
>
> Renato
>
> Otherwise I haver to put away all that I’ve done and restart from0

Renato, can you please put the content of your
/Users/renatopontefice/.emacs.d/init.el file here? (copy and paste). Of
course, if your file has sensitive information like passwords and such,
don't forget to remove that before posting it here).

As you've already been told, there's an error in your file, but we can't
help you if we don't see it.

Best regards,

Juan Manuel 



Re: [off-topic] E-readers and Org-Mode

2022-10-29 Thread Max Nikulin

On 28/10/2022 00:53, Juan Manuel Macías wrote:


Everything said in this threed is very interesting, but now I am
hesitating between buying one of these devices or simply a 10-inch
tablet with a good screen, and then applying all possible blue light
filters to it.
Another option is a hardware filter: yellow glasses. I am unsure if the 
following statement is trustworthy, but marketing is based on suppressed 
chromatic aberration inside eyes.


I think, you should decide what is better for your sight: active screen 
and perhaps dark theme or paper-like reflective display. Some people 
complains that particular devices may have annoying flickering at low 
screen brightness due to pulse width modulation. Some devices have too 
bright screen even when brightness is set to min value.


If it is acceptable to you to limit device usage to reading and 
handwritten notes then a e-Ink might be really great. You can extend 
such notes in Emacs on a PC later.


P.S. Concerning free PDF annotation tool, I have not tested if it is 
convenient and available on Android, but Firefox-106 release notes have 
the following entry:


> It is now possible to edit PDFs: including writing text, drawing, and 
adding signatures.


Almost certainly "edit" in their parlance in namely annotations, not 
real changes of PDF structure.






Re: org-x11idle-exists-p with emacs --daemon

2022-10-29 Thread Max Nikulin

On 28/10/2022 11:28, Ihor Radchenko wrote:


* lisp/org-clock.el (org-x11idle-exists-p): Do not check if load-time
`window-system' is `x'.  Instead, rely on the check in
`org-user-idle-seconds'.


I would say that even there it is not strictly correct to test 
`window-system', perhaps `x-display-list' is a bit better since 
particular frame may be a terminal one running in xterm, but user has x 
frames. In server.el I found


(frame-parameter frame 'display)

that might be even better and should work with daemon having a single 
frame in xterm. I can not figure out if --display command line option 
affects some variable of Emacs daemon.


Another tricky case is multiple x connection to different displays. It 
seems GTK3 have some limitations (pgtk build) and such rarely used 
configuration will become completely obsolete.



diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index e98a34f0d..ca026c44f 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1201,8 +1201,7 @@ (defun org-mac-idle-seconds ()
 
 (defvar org-x11idle-exists-p

   ;; Check that x11idle exists
-  (and (eq window-system 'x)
-   (eq 0 (call-process-shell-command
+  (and (eq 0 (call-process-shell-command
   (format "command -v %s" org-clock-x11idle-program-name)))


I joined to this discussion presuming (by some confusion) that such 
variable should be lazily initialized on first call of 
`org-user-idle-seconds'. I considered `window-system' test as a way to 
distinguish GUI and text Emacs sessions. Actually such parameter is 
dynamic. Remotely running Emacs may be disconnected from one X server 
and connected to another session.


Actually `window-system' check has another role: skip command 
availability test on systems other than Linux.


What is the result of "command -v" on Windows? Should it be executed 
there at all (unconditionally at load time)?


P.S. There are a number of X11 servers for Windows. I am unsure if Emacs 
builds for Windows and X11 frames are supported. I am lost how to 
properly test such cases in the code.






Re: incorrect indentation of new item inserted with capture template

2022-10-29 Thread Ian Garmaise
Hi Ihor,

I figured out the problem.  Seems like date trees expect only list items
between date headlines.
I had been adding headlines between dates, and this seems to confuse the
insertion mechanism.  I now stick to list items and it works perfectly.
Might be a good idea to add something about this to the manual.

Thanks for following up.

Cheers,

Ian


On Sat, Oct 29, 2022 at 12:49 AM Ihor Radchenko  wrote:

> Ian Garmaise  writes:
>
> > I have had this problem for several months.
> >
> > I keep a daily journal.  Each morning I add a new entry in a journal file
> > using a capture template.  The journal file is always loaded.
> > On some occasions the indentation of the new entry is incorrect.
> >
> > Here's an example of incorrect indentation:
> >
> > *** 2021-12-05 Sunday
> >
> > - item 1
> > - item 2
> >
> > * 2021-12-06 Monday
> >
> > What I usually do is undo the insertion and reissue the command.
> > This always works.
>
> Sorry for the late reply.
> I am unable to reproduce the problem of the latest main.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
=
Ian Garmaise
Consultant
Phorix Solutions Group
ia...@phorixsol.com
Toronto cell: 416.432.2251 (also on Whatsapp)

https://www.linkedin.com/in/igarmaise/

http://www.PhorixSol.com


Cannot find therefore at 972 character...

2022-10-29 Thread Renato Pontefice
I tried ib more way, but I’m unable to see where the error is.

Can you help me? Please

Renato

Otherwise I haver to put away all that I’ve done and restart from0


Exporting images to different output formats

2022-10-29 Thread Michael Welle
Hello,

I want to export to different output formats. Trouble is the way ox-gfm
exports images. So I thought, hm, why not utilise macros to abstract away
the differences. Well, that escalated quickly:

#+macro: img_gfm (eval (concat "#+begin_export md\n![img](" $1 " \"" $2  
"\")\n*Abb.: " $2 "* (Quelle: " $3 ")\n#+end_export"))

#+macro: img_latex (eval "foobar")

# Image export for Github flavoured markdown
# $1 path to image
# $2 caption
# $3 source
#+macro: img (eval (cl-case org-export-current-backend ('gfm (concat 
"{{{img_gfm(" $1 "," $2 "," $3")}}}")) ('latex "{{{img_latex}}}") (t "barfoo")))


{{{img(./foo, foo, barfoo)}}}

That kind of works (and breaks if I want commas in the caption), but is
ugly as... and doesn't get better if I implement the other output formats.

Maybe syntax like @@latex: ...@@ would help. But no, I think that is
defined in the specific backends, not as a general mechanism.

So, how can I do it better?

All the best,
hmw



Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread Max Nikulin

On 29/10/2022 11:05, Ihor Radchenko wrote:


As explained in the above quote, it may be reasonable to display stderr
in the shell (and possibly other) src blocks upon execution.

+ Stderr may contain important information even if the code block
   succeeds
- Displaying stderr will raise *Error* buffer, which may or may not be
   expected or desired.

What do you think?


I agree that stderr may be important. I would not mind to have a buffer 
that combines both stderr and stdout (maybe fontified). Despite order of 
messages in separate streams is not strictly defined, it still may shed 
some light on the reason what went wrong.







Re: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list

2022-10-29 Thread Daniel Kraus
Hi

Ihor Radchenko  writes:
> "Christopher M. Miles"  writes:
>> Any review comments about this patch?
> I have sent the following comment shortly after your followup:

I even made another post after that, suggesting that the if condition
is not even needed. Simply always quoting seems to work and is also the
way it's done in `ob-lisp.el`.
See https://list.orgmode.org/orgmode/874jvp9wsg@kraus.my/

This simple patch is also already installed. Can you test if that works for you?

And in case you missed it, I made another reply for you bug report
about inline comments.
Check https://list.orgmode.org/orgmode/878rl1a1e0@kraus.my/

Thanks,
  Daniel



bug#35453: 26.1; Poor performance of vertical-motion in large org buffer

2022-10-29 Thread Eli Zaretskii
> From: Ihor Radchenko 
> Cc: Eli Zaretskii ,  35...@debbugs.gnu.org
> Date: Sat, 29 Oct 2022 09:02:31 +
> 
> Ihor Radchenko  writes:
> 
> >> There are no intervals in this story.  The way overlays are
> >> implemented, they don't use intervals (if by that you mean the
> >> facilities in intervals.c).  Someone was working on making overlays
> >> more efficient by changing the low-level implementation details, but
> >> that work is yet unfinished.
> >
> > I see. Hope that overlays will be optimised eventually...
> 
> And "eventually" finally came :)
> I am pretty sure that this can be closed now.

Thanks, done.





Re: [PATCH] org-manual: Suggest to wait for one month and followup when reporting bugs

2022-10-29 Thread Ihor Radchenko
Bastien Guerry  writes:

> Ihor Radchenko  writes:
>
>> I think we can expose our mailing list policy a bit more in the manual.
>
> Yes, I think this is a good idea.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5a358b3a3575776430a7702a901f92f71cd11b9e

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[CLOSED] Re: [BUG] Org mode treat tags as links

2022-10-29 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> I defined a custom link type "video:".
>>
>> And when I added tag "video" in tags like bellowing:
>>
>> #+begin_src org
>> * headline 1 :tag1:video:hello
>> #+end_src
>
> Note that this particular example actually contains a link. Because you
> forgot the closing ":" in the tags.
>
> I guess you meant
>
> * headline 1 :tag1:video:hello:
>

Yes, I miss typed the last colon. Thanks for understanding correctly.

>> It caused the tag ":video:" parsed and recognized as link. Here is the 
>> screenshot:
>> I suppose the link parsing need to be improved.
>
> This is fontification error.
> You can examine the parser state by issuing M-: (org-element-context) with
> point at the "link". It is correctly recognized as a headline with no link.
>
> The error is due to limitations in our current implementation of
> fontification. Will be fixed in
> https://orgmode.org/list/87ee7c9quk.fsf@localhost

I see, Thanks for notifying.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

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


signature.asc
Description: PGP signature


Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread tomas
On Sat, Oct 29, 2022 at 09:09:04AM +, Ihor Radchenko wrote:
> to...@tuxteam.de writes:
> 
> > As I hinted at, I also wanted to have the exit code documented [...]

> Note that what we are discussing here is different from your
> description. A popup window accumulating stderr is displayed upon code
> evaluation. stderr does not go into results.
> 
> What you are describing would better fit into a new :results option.

Oh, I missed the popup part. Sounds useful for yet another profile,
yes.

Thanks and sorry for the noise.

And thanks for your incredible work on Org. Do you ever sleep?

In awe
-- 
tomás


signature.asc
Description: PGP signature


Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread Ihor Radchenko
to...@tuxteam.de writes:

> As I hinted at, I also wanted to have the exit code documented. So
> my setup was a bit more involved than this. Plus, I didn't want all
> that code scaffolding to show up in the typeset results (my audience
> had enough to digest as it was), so I hid all that in the prologue/
> epilogue.

Note that what we are discussing here is different from your
description. A popup window accumulating stderr is displayed upon code
evaluation. stderr does not go into results.

What you are describing would better fit into a new :results option.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [off-topic] E-readers and Org-Mode

2022-10-29 Thread Juan Manuel Macías
Juan Manuel Macías writes:

> [...] Anyway, I think it would be possible to write some python
> script[1] to extract the annotations and then parse the resulting xml
> from there to get a nice and beautiful Org document. Which also leads
> me to wonder if anyone has tried that. 

I've found that org-noter has the `org-noter-create-skeleton' function,
which exports PDF annotations to Org and keeps them in sync with the PDF
(via pdf-tools). Tremendously useful! :-)



bug#35453: 26.1; Poor performance of vertical-motion in large org buffer

2022-10-29 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> There are no intervals in this story.  The way overlays are
>> implemented, they don't use intervals (if by that you mean the
>> facilities in intervals.c).  Someone was working on making overlays
>> more efficient by changing the low-level implementation details, but
>> that work is yet unfinished.
>
> I see. Hope that overlays will be optimised eventually...

And "eventually" finally came :)
I am pretty sure that this can be closed now.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 





Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread tomas
On Fri, Oct 28, 2022 at 11:43:39PM -0700, Samuel Wales wrote:
> long ago i made the contents of my shell blocks look like this:
> 
> {
>   code
> } 2>&1
> :

As I hinted at, I also wanted to have the exit code documented. So
my setup was a bit more involved than this. Plus, I didn't want all
that code scaffolding to show up in the typeset results (my audience
had enough to digest as it was), so I hid all that in the prologue/
epilogue.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Org mode, Org Mode, Org-mode or Org-Mode?

2022-10-29 Thread Marcin Borkowski


On 2022-10-28, at 23:50, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>> What is the "official" version?  I found at least two spelling on
>> orgmode.org...
>
> If we look into doc/Documentation_Standards.org:
>
> - Prefer "Org mode" to "Org-mode" or "org-mode".  This is simply
>   because it reflects an existing convention in [[info:emacs:Top][The 
> Emacs Manual]] which
>   consistently documents mode names in this form - "Text mode",
>   "Outline mode", "Mail mode", etc.
>
> It is _the_ convention.

Thanks!

> Another question is whether we actually follow it everywhere...

Yep...

-- 
Marcin Borkowski
http://mbork.pl



Re: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list

2022-10-29 Thread Bastien
Daniel Kraus  writes:

> I think I'll go with the big `cond` above to auto-detect what's
> installed. That's probably the best out-of-the-box experience.

Indeed, thank you!

-- 
 Bastien



Re: ob-clojure session support

2022-10-29 Thread Bastien Guerry
Hi Ihor and Daniel,

Ihor Radchenko  writes:

> If Bastien removed session support, and you do not see any justification,
> it was most likely an oversight. 

>From memory, I removed session support in ob-clojure.el because it was
too buggy.

> We generally avoid feature regressions:
> https://bzg.fr/en/the-software-maintainers-pledge/
>
> So, if sessions are currently not supported, it should be considered a
> bug and fixed. 

Indeed, having session support would be better.  
Thanks for reimplementing it!

-- 
 Bastien



Re: [WORG] Document in more detail about what maintainers do?

2022-10-29 Thread Bastien Guerry
Hi Ihor,

Ihor Radchenko  writes:

> One month has passed, and I decided to apply the patch as is.
> https://git.sr.ht/~bzg/worg/commit/6fbe51dee6bf276584c24fa1e7ec673526c9326e

Thanks!

-- 
 Bastien



desktop notifications (Re: idea for capture anywhere in x)

2022-10-29 Thread Max Nikulin

On 29/10/2022 11:59, Ihor Radchenko wrote:


Functions in org-capture-before-finalize-hook have access to the
contents of the capture buffer text. So, one can call `start-process' to
run notify-send shell command and put the actual captured text into the
notification (displayed briefly or for longer time according to the
switches passed to notify-send).


I like this idea. Reading your message from Sat, 29 Oct 2022 02:59:51 
+ I decided that for yourself you set up an Emacs frame as a pop-up 
to display capture result. However I believe it is better to use either 
org-clock or Emacs notify functions directly instead of notify-send tool.


Samuel, I suggested notify-send tool as a means to debug notifications 
in isolation (without `org-capture'). Have you managed to configure 
notification-daemon, dunst or some other alternative to get acceptable 
appearance and proper timeout before notification disappears.






Re: Getting X selection reliably (Re: idea for capture anywhere in x)

2022-10-29 Thread Max Nikulin

On 29/10/2022 13:03, Samuel Wales wrote:


fluxbox is the only wm or de that seems to do everything i need.
Then you should have no problem to call `org-capture' using emacsclient 
as a menu entry action. Does it work for you? From my point of view 
"capture anywhere in x" task should be roughly solved. The following 
steps may be necessary to polish the approach and to make it reliable.


P.S. I forgot to post a link to a fluxbox bug that was quite annoying 
for me when I was trying to test something in a lightweight environment. 
I had to rebuild fluxbox package with an additional patch:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743772
Cannot move Gnome 3.12 applications





Re: couldn't org-table-create-with-table\.el respect hline

2022-10-29 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>>> Do you need a specific table.el feature that you miss in native Org tables?
>> 
>> Merging and splitting cells!

> Can you please send a separate message detailing the feature request and
> how you envision this functionality to work? (I know that many people
> desire this feature, but it is not easy. A good dedicated discussion
> may help to push things forward in this area.)

Ok I do this later.

I suspect that the wrapping function might be useful.


> Also, I am wondering what happens with merged cells when you convert
> from table.el to native Org tables. I suspect that it does not work
> well... 

Well the hline problem makes it somehow difficult 

But when I was able to convert, the merged cells end up as individual
cells, so it did not help

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: couldn't org-table-create-with-table\.el respect hline

2022-10-29 Thread Ihor Radchenko
Uwe Brauer  writes:

>> Do you need a specific table.el feature that you miss in native Org tables?
>
>  Merging and splitting cells!

Can you please send a separate message detailing the feature request and
how you envision this functionality to work? (I know that many people
desire this feature, but it is not easy. A good dedicated discussion
may help to push things forward in this area.)

Also, I am wondering what happens with merged cells when you convert
from table.el to native Org tables. I suspect that it does not work
well... 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread Samuel Wales
long ago i made the contents of my shell blocks look like this:

{
  code
} 2>&1
:


On 10/28/22, to...@tuxteam.de  wrote:
> On Sat, Oct 29, 2022 at 04:05:19AM +, Ihor Radchenko wrote:
>> Rudolf Adamkovič  writes:
>>
>> > Ihor Radchenko  writes:
>> >
>> >> I do not think that it make sense to display that buffer when the code
>> >> finishes successfully. I can see this kind of behaviour
>> >> breaking/spamming automated scripts or export---code working in the
>> >> past may throw error output into unsuspecting users.
>> >
>> > But the exit code has nothing to do with the standard error.
>
> [...]
>
>> > For example, I use a program for work that uploads data to a certain
>> > 3rd-party server.  It exits with a zero code but also shows extremely
>> > important notices on error output.  As an "unsuspecting user", if I
>> > used
>> > Babel to run the program, I would end up in a trouble.
>
> [...]
>
>> Dear All,
>>
>> As explained in the above quote, it may be reasonable to display stderr
>> in the shell (and possibly other) src blocks upon execution.
>>
>> + Stderr may contain important information even if the code block
>>   succeeds
>> - Displaying stderr will raise *Error* buffer, which may or may not be
>>   expected or desired.
>>
>> What do you think?
>
> My take as an Org user is that this makes a lot of sense. I don't know
> whether there is an elegant way to accomodate all the use cases in
> an elegant way, but to provide a concrete example where I'd have found
> it handy...
>
> While preparing a handout for an introduction to shell programming
> (at a very basic level), I wanted to embed little examples with
> their results. Org rocks at this kind of task.
>
> But in this case it's important to show everything the students are
> going to see. One could argue that the error part is even the most
> important.
>
> So what I needed was not only the stderr (optionally somehow separated
> from stdout -- optionally as someone would see it in some terminal
> session), but also all the above even when the exit code was nonzero.
>
> Ideally, a display of that exit code, too.
>
> I ended up massaging prologue and epilogue, which worked nicely,
> but sadly is language dependent for a set of concepts which are,
> one could argue, independent of the language [1].
>
> So yes, I would be thrilled by such a possibility.
>
> Cheers
>
> [1] These are OS conventions. So also a language of sorts, but at
> another level.
>
> --
> tomás
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: couldn't org-table-create-with-table\.el respect hline

2022-10-29 Thread Uwe Brauer

> Uwe Brauer  writes:

   org--> table conversion is not reversible. hlines are not part of
> table.el syntax and cannot be retained.


> I recommend using native Org tables.

> Do you need a specific table.el feature that you miss in native Org tables?

 Merging and splitting cells!

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: when exporting to odt or html, latex equations are not exported when in soure block: BUG?

2022-10-29 Thread Uwe Brauer

> Uwe Brauer  writes:

> Just use :results raw. Org understands latex environments natively.
> See 12.5.1 LaTeX fragments section of the manual.

thanks

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: Please add support for dlangs packagemanager to ob-C.el

2022-10-29 Thread Ihor Radchenko
tbanelwebmin  writes:

> Your TINYCHANGE fits into the 15 lines limit. I will review it.
>
> As Bastien said, we follow as much as we can a predefined format for commit 
> messages:
> https://orgmode.org/worg/org-contribute.html#commit-messages
>
> You may also look at past commit messages, for instance this one:
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0a6a56c804099e358ca558119b7aede0b2b9b90f
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/log/
>
> If you want to further contribute, maybe in another TINYCHANGE, automatic 
> unit tests are very valuable. There
> are already examples of Dlang tests in:
> testing/examples/ob-C-test.org
> testing/lisp/test-ob-C.el

Thierry, do I understand correctly that the only objection if the commit
message format? If so, I can fix it and apply the patch. Will it be ok?

(One month has passed since your review and no response has been given.
Since the patch is useful, we may as well take care about such a small
issue as formatting)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [WORG] Document in more detail about what maintainers do?

2022-10-29 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Bastien  writes:
>
>> Ihor Radchenko  writes:
>>
>>> I think the part about CC is missing in
>>> https://orgmode.org/worg/org-maintenance.html#orga0c76fb
>>
>> Indeed - can you add it?
>
>>> Also, I find it important to take note about worg documentation for
>>> built-in babel backends. I did not even know it exist for a long time.
>>>
>>> WDYT?
>>
>> +1 -- and also suggest adding tests, a part that I missed.
>
> See the attached.

One month has passed, and I decided to apply the patch as is.
https://git.sr.ht/~bzg/worg/commit/6fbe51dee6bf276584c24fa1e7ec673526c9326e

Let me know if you have any objections.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-29 Thread tomas
On Sat, Oct 29, 2022 at 04:05:19AM +, Ihor Radchenko wrote:
> Rudolf Adamkovič  writes:
> 
> > Ihor Radchenko  writes:
> >
> >> I do not think that it make sense to display that buffer when the code
> >> finishes successfully. I can see this kind of behaviour
> >> breaking/spamming automated scripts or export---code working in the
> >> past may throw error output into unsuspecting users.
> >
> > But the exit code has nothing to do with the standard error.

[...]

> > For example, I use a program for work that uploads data to a certain
> > 3rd-party server.  It exits with a zero code but also shows extremely
> > important notices on error output.  As an "unsuspecting user", if I used
> > Babel to run the program, I would end up in a trouble.

[...]

> Dear All,
> 
> As explained in the above quote, it may be reasonable to display stderr
> in the shell (and possibly other) src blocks upon execution.
> 
> + Stderr may contain important information even if the code block
>   succeeds
> - Displaying stderr will raise *Error* buffer, which may or may not be
>   expected or desired.
> 
> What do you think?

My take as an Org user is that this makes a lot of sense. I don't know
whether there is an elegant way to accomodate all the use cases in
an elegant way, but to provide a concrete example where I'd have found
it handy...

While preparing a handout for an introduction to shell programming
(at a very basic level), I wanted to embed little examples with
their results. Org rocks at this kind of task.

But in this case it's important to show everything the students are
going to see. One could argue that the error part is even the most
important.

So what I needed was not only the stderr (optionally somehow separated
from stdout -- optionally as someone would see it in some terminal
session), but also all the above even when the exit code was nonzero.

Ideally, a display of that exit code, too.

I ended up massaging prologue and epilogue, which worked nicely,
but sadly is language dependent for a set of concepts which are,
one could argue, independent of the language [1].

So yes, I would be thrilled by such a possibility.

Cheers

[1] These are OS conventions. So also a language of sorts, but at
another level.

-- 
tomás


signature.asc
Description: PGP signature


Re: [PATCH] ob-maxima.el: Fix execution on MS Windows

2022-10-29 Thread Ihor Radchenko
Nikolay Kudryavtsev  writes:

> Anyway, I've tried to get it to work using shell-quote-argument, see the 
> attached patch. Seems to work well enough in practice on both platforms 
> and for cases like (setq temporary-file-directory "/tmp/`echo hi`/").
> From 47690d14ac4838d8e39f08bd8224f0b4af053359 Mon Sep 17 00:00:00 2001
> From: Nikolay Kudryavtsev 
> Date: Sun, 26 Dec 2021 22:47:19 +0300
> Subject: [PATCH] ob-maxima.el: Fix execution on MS Windows

Thanks for the patch, and sorry for the late reply.
I have applied your patch onto main adding TINYCHANGE cookie to the
commit message.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6156b57bdf2b14ccfbf6646e8d217599738b694d

You are also listed as an Org contributor now.
https://git.sr.ht/~bzg/worg/commit/6a5bccb1aeca8e2b3ecef64238002bcfb46f68e0

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Getting X selection reliably (Re: idea for capture anywhere in x)

2022-10-29 Thread Samuel Wales
if what we are talking about is checking the text or metadata as org
capture or emacs understands it against what we are capturing in a
maximized application, by means of a popup and a human [myself], then:

i'd say an emacs frame popping up over the application [whether the
application is emacs or firefox or whatever] as just another frame for
my normal emacs [which has some degree of optimization for ergo and
accessibiity], but frame shrunk to fit the text, would actually be
preferable to a separate popup application/notifier tool [which would
require unfamiliar configuration and might not even be ergo or
accessible or portable/lts], provided that it goes away after a
configured delay, and does not require the keyboard or the mouse to
make it go away.  so an emacs frame is not a bad idea, just has to be
done right.  i think.

> For other applications, since you have a requirement of maximized application 
> window and purely mouse action, I am
unsure if you managed to configure fluxbox to add a custom menu entry
accessible in such layout.

fluxbox is the only wm or de that seems to do everything i need.  in
this case, it is quite straightforward for me [or else i have put out
of my mind any annoyance at previous years' efforts in making it
work].

what it does is have a bar that drops down when mouse pointer hits top
edge of window.  this only works if the application is maximized or
normalized rather than fullscreen in fluxbox's terminology.  and that
is the case for everything i'd need to capture.  the only fullscreen
apps i have are video players, and idk what the point of fullscreen is
but with video players they seem to get fit to screen right then as
opposed to having the video extend off teh edge of the screen or be
tiny or whatever.  i do not need to capture from vlc or mpv.
[although a super-fancy doug englebart demo type of pov might have me
grabbing a few minutes of video and capturing it and then speech to
text from the video and metadata would be captured but i am not
holding my breath or expecting that.]

then rclick on that fluxbox bar drops down a fluxbox menu of highly
useful things, which i can add a line to in .fluxbox/.menu to add one.
usually shell commands.  and also various fluxbox items like maximize
and close.  and menus i never use courtesy of fluxbox and debian].  it
is copacetic.  except for one rather annoying bug, which is that the
bar stays there if i select anything from that manu, so i have to move
pointer to the top again and then back to make it go away again.  i
gave up trying to fix that bug, wish it could be fixed.  but adding a
menu item is for me trivial.  so that part is not part of the problem.
i just open .menu and cargo cult a line that says capture.


On 10/28/22, Max Nikulin  wrote:
> On 29/10/2022 09:59, Ihor Radchenko wrote:
>> Max Nikulin writes:
>>
>>> %(org-get-x-clipboard 'PRIMARY)
>>> "
>>>   :immediate-finish t)
>>>
>>> However to be at the safe side I would check if (org-get-x-clipboard
>>> 'PRIMARY) value is not nil at first.
>>
>> My approach to this is simply showing a popup with captured heading
>> after capture. If anything is wrong, I can quickly notice.
>>
>> Not sure if it is suitable for Samuel though.
>
> I started with a small wrapper that checks if Emacs server is running
> and creates a new frame if it does not exist yet. So I avoided a pitfall
> with empty string instead of selection. I intentionally do not use
> :immediate-finish to inspect capture and to add some comment.
>
> Samuel wish to have minimal distraction: no sound, no popup window,
> Emacs window is not raised in front of current application, visual
> notification should disappear after some pause.
>
> That is why I believe that additional checks are required in such silent
> workflow to avoid missed data in notes.
>
>
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com