Re: org-agenda-tag-filter-preset: maybe a recent bug?

2022-10-18 Thread Garjola Dindi
On Tue 18-Oct-2022 at 05:39:27 +02, Liu Hui 
wrote: 
> Hi Garjola,
>
> The preset of filter is not supposed to be used with individual
> command. The docstring of 'org-agenda-tag-filter-preset' says:
>
>> The preset filter is a global property of the entire agenda view. In
>> a block agenda, it will not work reliably to define a filter for one
>> of the individual blocks. You need to set it in the global options
>> and expect it to be applied to the entire view.
>
> So you just need to preset the filter in the global options, e.g.
>
>   ;; multi-block view
>   ("W" "Work Daily Action List"
>((agenda ""))
>((org-agenda-tag-filter-preset
>  (quote
>   ("+work")
>
> or
>
>   ("W" "Work Daily Action List"
>agenda ""
>((org-agenda-tag-filter-preset
>  (quote
>   ("+work")

Hi Liu,

Thank you very much for your answer. It seems that I have been using
wrong agenda custom commands for several years!

In any case, your suggestion solved my problem and I am back on the main
branch. 

Thank you.

Garjola


-- 



org-agenda-tag-filter-preset: maybe a recent bug?

2022-10-17 Thread Garjola Dindi


Hi,

I use ~org-agenda-tag-filter-preset~ in custom commands to generate
views like this:

,
| ("W" "Work Daily Action List"
|  ((agenda ""
|   ((org-agenda-span 1)
|(org-agenda-sorting-strategy
| (quote
|  ((agenda category-up tag-up time-up
|(org-agenda-tag-filter-preset
| (quote
|  ("+work")))
|(org-deadline-warning-days 7
|  nil nil)
`

I am usually following the ~main~ branch that I update once a week and
this kind of custom command stopped working about one week ago (October
8).

The agenda view is generated, but the filter is not applied. 

I did not change anything in my configuration. I have checked and it
works if I use the ~bugfix~ branch.

I was wondering if some of the changes recently made to solve a bug with
sticky agendas caused the issue. But if nobody else noticed anything, I
may have a misunderstanding in my way of defining the custom command
that was revealed by recent bugfixes?

Thanks for your help.

Garjola

-- 



Re: Invalid duration format error with active timestamp

2021-05-19 Thread Garjola Dindi
On Tue 18-May-2021 at 23:23:39 +02, Rainer Hansen
 wrote: 
> Hi Garjola,
>
> I had the same problem.
>
> I fixed it by downloading manually the last working version of Org from
> https://orgmode.org/elpa/,
> i.e. https://orgmode.org/elpa/org-20210503.tar
> and manually stored the extracted directory into my elpa directory,
> /home/garjola/.emacs.d/elpa/ in your case.
>
> After restarting Emacs Org agenda worked fine again.
>
> I hope that helps.
>
> Regards,
> Rainer

Hi Rainer,

Thanks for the tip. I finally got the update via the package manager
before having the time to test your solution.

And org works great as always!

Cheers.

G.

>
> Garjola Dindi  writes:
>
>> On Mon 17-May-2021 at 16:01:25 +02, Nicolas Goaziou
>>  wrote: 
>>> Hello,
>>>
>>> Garjola Dindi  writes:
>>>
>>>> I am using the most recent elpa version of org
>>>> 9.4.5 (9.4.5-93-gbc857b-elpa @
>>>> /home/garjola/.emacs.d/elpa/org-20210510/) with emacs master branch.
>>>>
>>>> Since updating org yesterday, when I use a timestamp like 
>>>>
>>>> ,
>>>> | <2021-05-17 Mon 10:00-11:00>
>>>> `
>>>>
>>>>
>>>> building the agenda fails with this backtrace:
>>>>
>>>> ,
>>>> | Debugger entered--Lisp error: (error "Invalid duration format:
>>>> | #(\"10:00-11:00\" 0 5 (font...")
>>>
>>> This was fixed a few days ago.
>>>
>>> Since Org in ELPA is updated every Monday, you need to update it again
>>> (later?) today to get the fix.
>>>
>>
>> Hi,
>>
>> Thanks for your answer. I've been impatiently refreshing the packages
>> since yesterday, but I don't see any new version of org.
>>
>> I am using 
>>
>> http://orgmode.org/elpa/
>>
>> Is this still correct? Just wondering, since I understood that some
>> things are changing in org packaging and distribution.
>>
>> Thanks for your great work!
>
>
>

-- 




Re: Invalid duration format error with active timestamp

2021-05-18 Thread Garjola Dindi
On Mon 17-May-2021 at 16:01:25 +02, Nicolas Goaziou
 wrote: 
> Hello,
>
> Garjola Dindi  writes:
>
>> I am using the most recent elpa version of org
>> 9.4.5 (9.4.5-93-gbc857b-elpa @
>> /home/garjola/.emacs.d/elpa/org-20210510/) with emacs master branch.
>>
>> Since updating org yesterday, when I use a timestamp like 
>>
>> ,
>> | <2021-05-17 Mon 10:00-11:00>
>> `
>>
>>
>> building the agenda fails with this backtrace:
>>
>> ,
>> | Debugger entered--Lisp error: (error "Invalid duration format:
>> | #(\"10:00-11:00\" 0 5 (font...")
>
> This was fixed a few days ago.
>
> Since Org in ELPA is updated every Monday, you need to update it again
> (later?) today to get the fix.
>

Hi,

Thanks for your answer. I've been impatiently refreshing the packages
since yesterday, but I don't see any new version of org.

I am using 

http://orgmode.org/elpa/

Is this still correct? Just wondering, since I understood that some
things are changing in org packaging and distribution.

Thanks for your great work!

-- 




Invalid duration format error with active timestamp

2021-05-17 Thread Garjola Dindi


Hi,

I am using the most recent elpa version of org
9.4.5 (9.4.5-93-gbc857b-elpa @
/home/garjola/.emacs.d/elpa/org-20210510/) with emacs master branch.

Since updating org yesterday, when I use a timestamp like 

,
| <2021-05-17 Mon 10:00-11:00>
`


building the agenda fails with this backtrace:

,
| Debugger entered--Lisp error: (error "Invalid duration format:
| #(\"10:00-11:00\" 0 5 (font...")
| 
|   error("Invalid duration format: %S" #("10:00-11:00" 0 11 (face
|   org-date keymap (keymap (follow-link . mouse-face) (mouse-3 .
|   org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) mouse-face
|   highlight wrap-prefix #("  " 0 2 (face org-indent)) line-prefix #("  "
|   0 2 (face org-indent)) org-category "work" fontified t)))
| 
|   org-duration-to-minutes(#("10:00-11:00" 0 11 (face org-date keymap
|   (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse)
|   (mouse-2 . org-open-at-mouse)) mouse-face highlight wrap-prefix #("  "
|   0 2 (face org-indent)) line-prefix #("  " 0 2 (face org-indent))
|   org-category "work" fontified t)))
| 
|   org-agenda-format-item(nil #("Planning
|   ..." 0 68 (face org-level-1 wrap-prefix #("* " 0 2 (face org-indent))
|   line-prefix "" org-category "work" fontified t) 68 77 (keymap (keymap
|   (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2
|   . org-open-at-mouse)) mouse-face highlight face (org-tag org-level-1)
|   wrap-prefix #("* " 0 2 (face org-indent)) line-prefix "" org-category
|   "work" fontified t) 77 78 (rear-nonsticky (mouse-face highlight keymap
|   invisible intangible help-echo org-linked-text htmlize-link) keymap
|   (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse)
|   (mouse-2 . org-open-at-mouse)) mouse-face highlight face (org-tag
|   org-level-1) wrap-prefix #("* " 0 2 (face org-indent)) line-prefix ""
|   org-category "work" fontified t)) " " "work" (#("work" 0 4 (inherited
|   t)) "planning") #("<2021-05-17 Mon 10:00-11:00>" 0 1 (face
|   (rainbow-delimiters-depth-1-face org-date) keymap (keymap (follow-link
|   . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 .
|   org-open-at-mouse)) mouse-face highlight wrap-prefix #("  " 0 2 (face
|   org-indent)) line-prefix #("  " 0 2 (face org-indent)) org-category
|   "work" fontified t) 1 27 (face org-date keymap (keymap (follow-link .
|   mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 .
|   org-open-at-mouse)) mouse-face highlight wrap-prefix #("  " 0 2 (face
|   org-indent)) line-prefix #("  " 0 2 (face org-indent)) org-category
|   "work" fontified t) 27 28 (face (rainbow-delimiters-depth-1-face
|   org-date) keymap (keymap (follow-link . mouse-face) (mouse-3 .
|   org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) mouse-face
|   highlight wrap-prefix #("  " 0 2 (face org-indent)) line-prefix #("  "
|   0 2 (face org-indent)) org-category "work" rear-nonsticky (mouse-face
|   highlight keymap invisible intangible help-echo org-linked-text
|   htmlize-link) fontified t))
|   "<\\([[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{..." nil)
| 
|   org-agenda-get-timestamps(nil)
`

Does this ring a bell to somebody? I have been using timestamps like
this for a while without problems. I have checked the manual and I still
see this kind of timestamps in the corresponding section.

Thank you.

G.

-- 




Re: Viewing link information

2020-10-30 Thread Garjola Dindi
On Fri 30-Oct-2020 at 17:14:37 +01, Russell Adams
 wrote: 
> Are there other ways to view information about an org link that I
> don't list below?
>
>  - M-x org-insert-link, the prompts for link and description show the
>current values. Requires interacting with the prompts.
>
>  - Switch to fundamental mode
>
>  - M-x org-toggle-link-display
>
> Are there ways to see this information live while navigating? Maybe on
> the modeline, or messages?
>

I have this in my init file. I don't remember where I got it from.

It displays the link target in the minibuffer when point is on a link. 

#+BEGIN_SRC emacs-lisp
(defvar my/org-link-target-message-timer nil
  "Variable to store the link message timer in.")

(defun my/org-link-target-show-link-messages ()
  "Turn on link messages.
You will see a message in the minibuffer when on an org link."
  (interactive)
  (or my/org-link-target-message-timer
  (setq my/org-link-target-message-timer
(run-with-idle-timer 0.5 t
'my/org-link-target-link-message)
my/org-link-target-show-link-on-enter t)))


(defun my/org-link-target-cancel-link-messages ()
  "Stop showing messages in minibuffer when on a link."
  (interactive)
  (cancel-timer my/org-link-target-message-timer)
  (setq my/org-link-target-message-timer nil
my/org-link-target-show-link-on-enter nil))

(setq my/org-link-target-show-link-on-enter t)

(when my/org-link-target-show-link-on-enter
  (my/org-link-target-show-link-messages))

(defun my/org-link-target-link-message ()
  "Print a minibuffer message about the link that point is on."
  (interactive)
  ;; the way links are recognized in org-element-context counts blank
  ;; spaces after a link and the closing brackets in literal links. We
  ;; don't try to get a message if the cursor is on those, or if it is
  ;; on a blank line.
  (when (not (or (looking-at " ")   ;looking at a space
 (lookinpg-at "^$") ;looking at a blank line
 (looking-at "]")   ;looking at a bracket at the end
;looking at the end of the line.
 (looking-at "$")))

(save-restriction
  (widen)
  (when (eq major-mode 'org-mode)
(let* ((object (org-element-context))
   (type (org-element-property :type object))
   (link-content (org-element-property :path
   object)))
  (save-excursion
(when (-contains? '("http" "https" "file") type)
  (message "%s:%s" type link-content
#+END_SRC




Agenda buffer name after following a time stamp

2020-10-24 Thread Garjola Dindi
Hi,

Accidentally pressing  or  on an inactive time stamp in
an org mode buffer, I found myself in an agenda buffer with name "*Org
Agenda(a:2020-10-22)" corresponding to the agenda of the date of the
time stamp.

I understand that this is the expected behaviour (jumping to that date),
but I am puzzled by the buffer name. Most annoyingly, from this moment,
unless I restart emacs, most new agenda generations will create a buffer
with the same name, that is "*Org Agenda(a:2020-10-22)" in my example
independently of the date for which the agenda is generated.

Steps to reproduce:

1. Press  on [2020-10-22 Thu]. This generates the agenda for
   that date in a buffer named "*Org Agenda(a:2020-10-22)"
2. Close the agenda with "q" or "x"
3. invoke the org-agenda dispatcher, choose t (or any other view except
   "a"). This generates a buffer named "*Org Agenda(a:2020-10-22)"
   instead of "*Org Agenda*".

Using the interactive commands org-todo-list has the same behaviour.

However, using "a" in the agenda dispatcher or calling org-agenda-list
generates a buffer correctly called  "*Org Agenda*".

I have tried with "emacs -q" and the behaviour is the same.

Is this an expected behaviour? I have not been able to find the
information in the manual.

Thank you.

G.
- 




Re: When will 9.4 be on orgmode/elpa ?

2020-09-18 Thread Garjola Dindi
On Fri 18-Sep-2020 at 08:57:15 +02, Detlef Steuer 
wrote: 
> Hi all,
>
> I use https://orgmode.org/elpa/ org-plus-contrib to stay uptodate with
> org.
>
> As it seems GNU elpa has org-9.4.
>
> Normally I would be more patient, but I'm having very strange movements
> of point(!) during folding/unfolding in an old, largish file where
> folding always worked. The cursor ends up in a different part of my
> file after unfolding some headline. Further I was unable to bisect the
> file. When removing headlines to construct a minimal example, the exact
> headline where this phenomen happens, changes. Well, I would like to
> try 9.4 first before asking for further help.
>

Hi,

I am having exactly the same behaviour and I have also been unable to
generate a minimum working example. I have observed that the
misbehaviour happens when cycling with , but  works OK.

Garjola.





Re: Display in minibuffer link under point

2020-05-16 Thread Garjola Dindi
On Mon 11-May-2020 at 17:53:06 +02, John Kitchin
 wrote: 
> org-ref doesn't do anything fancy here, it just runs an idle timer:
>
> https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L597
>
> that runs a function defined at
> https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L3633
>
> that function is kind of long because it computes the message, and only
> in specific contexts.
>

Hi,

This is what I did:

(when (not (or (looking-at " ") ;looking at a space
 (looking-at "^$")  ;looking at a blank line
 (looking-at "]")   ;looking at a bracket at the end
;looking at the end of the line.
 (looking-at "$")))

(save-restriction
  (widen)
  (when (eq major-mode 'org-mode)
(let* ((object (org-element-context))
   (type (org-element-property :type object))
   (link-content (org-element-property :path object)))
  (save-excursion
(message "%s:%s" type link-content))


It seems to do what I want.

Thank you very much for your help.

Garjola


> Garjola Dindi  writes:
>
>> Hi,
>>
>> Thanks both of you for your answers.
>>
>> What would be the way to automatically trigger =display-local-help= when the 
>> point is on the link? Org-ref does that beautifully ;)
>>
>> Thanks again.
>>
>> Garjola
>>
>> On Fri 08-May-2020 at 22:48:37 +02, John Kitchin  
>> wrote:
>>> It looks like that variable is obsolete now since Emacs 24.1, and 
>>> (tooltip-mode -1) is probably the way to get the same thing now.
>>>
>>> John
>>>
>>> ---
>>> Professor John Kitchin
>>> Doherty Hall A207F
>>> Department of Chemical Engineering
>>> Carnegie Mellon University
>>> Pittsburgh, PA 15213
>>> 412-268-7803
>>> @johnkitchin
>>> http://kitchingroup.cheme.cmu.edu
>>>
>>> On Fri, May 8, 2020 at 1:18 PM briangpowell .  
>>> wrote:
>>>
>>>  I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio 
>>> desktop:
>>>
>>>  (setq tooltip-use-echo-area (not tooltip-use-echo-area))
>>>
>>>  Of course I had to do some programming to do that but the above should get 
>>> you started
>>>
>>>  And we can leave that programming as an exercise for the class--right Dr. 
>>> Kitchin?
>>>
>>>  ;-)
>>>
>>>  On Fri, May 8, 2020 at 9:19 AM John Kitchin  
>>> wrote:
>>>
>>>  M-x display-local-help might do it.
>>>
>>>  John
>>>
>>>  -------
>>>  Professor John Kitchin
>>>  Doherty Hall A207F
>>>  Department of Chemical Engineering
>>>  Carnegie Mellon University
>>>  Pittsburgh, PA 15213
>>>  412-268-7803
>>>  @johnkitchin
>>>  http://kitchingroup.cheme.cmu.edu
>>>
>>>  On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>>>
>>>  Hi,
>>>
>>>  Is there a way to display in the minibuffer the URL of the link under
>>>  the point in the same way as when the mouse pointer is over the link?
>>>
>>>  Thanks!
>>>
>>>  Garjola
>>>  --
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
-- 




Re: org-caldav-sync hanging

2020-05-12 Thread Garjola Dindi
On Tue 12-May-2020 at 12:59:22 +02, "Loris Bennett"
 wrote: 
> Eric S Fraga  writes:
>
>> On Tuesday, 12 May 2020 at 09:29, Loris Bennett wrote:
>>> The Nextcloud instance at work is version 15 and is accessible via the
>>> browser, but there was some outage recently and some server-side
>>> tweakage may also have occurred while things were being fixed.
>>
>> I don't know if this is related but a recent point release to nextcloud
>> caused problems with an OPTIONS directive that org-caldav-sync uses.  A
>> subsequent bug fix has corrected this but may not have been incorporated
>> in your server yet.
>>
>> See https://github.com/nextcloud/server/issues/20624
>>
>> The provider I use for calendar services had to manually patch their
>> instance of nextcloud to get it working again for org-caldav-sync.
>
> Thanks for the pointer, but the link seems to refer to a regression
> introduced between versions 18.0.3 and 18.0.4, whereas the server I am
> talking to is some version of version 15.
>
> My android phone is able to sync in both directions via DavX5, so the
> server is obviously not totally borked in terms of syncing.  So some
> aspect of the org-caldav-sync seems to be hitting the problem.

Hi,

FYI, I found this issue when looking for a solution for the same problem:
https://github.com/dengste/org-caldav/issues/195

In my case, if I am patient enough, the sync completes after 30-50 minutes.
-- 




Re: Display in minibuffer link under point

2020-05-10 Thread Garjola Dindi
Hi,

Thanks both of you for your answers. 

What would be the way to automatically trigger =display-local-help= when the 
point is on the link? Org-ref does that beautifully ;)

Thanks again.

Garjola

On Fri 08-May-2020 at 22:48:37 +02, John Kitchin  
wrote: 
> It looks like that variable is obsolete now since Emacs 24.1, and 
> (tooltip-mode -1) is probably the way to get the same thing now. 
>
> John
>
> ---
> Professor John Kitchin 
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
> On Fri, May 8, 2020 at 1:18 PM briangpowell .  
> wrote:
>
>  I use this variable to toggle my Gnu Emacs Org-Mode buffer into an audio 
> desktop:
>
>  (setq tooltip-use-echo-area (not tooltip-use-echo-area))
>
>  Of course I had to do some programming to do that but the above should get 
> you started
>
>  And we can leave that programming as an exercise for the class--right Dr. 
> Kitchin?
>
>  ;-)
>
>  On Fri, May 8, 2020 at 9:19 AM John Kitchin  wrote:
>
>  M-x display-local-help might do it.
>
>  John
>
>  ---
>  Professor John Kitchin 
>  Doherty Hall A207F
>  Department of Chemical Engineering
>  Carnegie Mellon University
>  Pittsburgh, PA 15213
>  412-268-7803
>  @johnkitchin
>  http://kitchingroup.cheme.cmu.edu
>
>  On Fri, May 8, 2020 at 9:15 AM Garjola Dindi  wrote:
>
>  Hi,
>
>  Is there a way to display in the minibuffer the URL of the link under
>  the point in the same way as when the mouse pointer is over the link?
>
>  Thanks!
>
>  Garjola
>  -- 
-- 




Display in minibuffer link under point

2020-05-08 Thread Garjola Dindi
Hi,

Is there a way to display in the minibuffer the URL of the link under
the point in the same way as when the mouse pointer is over the link?

Thanks!

Garjola
-- 




Re: [O] Effort estimates on repeating tasks

2019-10-03 Thread garjola
On Thu 19-Sep-2019 at 21:39:10 +02, garj...@garjola.net wrote: 
> Hi,
>
> I like the warning in the mode line when the time clocked on a task goes
> beyond the effort estimates in the properties drawer.
>
> However, I don’t know how to use this for repeating tasks or habits.
> That is, I want to work on a given task every day for less than N
> minutes and be warned when going beyond this amount. Of course,
> using the Effort property will warn me the first time, but will be
> useless after that, unless I delete the clocked time at the beginning of
> each new session.
>
> Is there a way to do that properly?
>
> Thanks in advance for your help.
>
> G.

Hi,

I have been investigating this and I think I could advice 
org-clock-get-clock-string. I have never written advices to functions and I 
don’t know org’s API.

Since I want to change the clock string only for repeating tasks, I have done 
this, which just adds “Repeating” to the clock string when clocking a repeating 
task:

#+BEGIN_SRC emacs-lisp
(defun ocgcs (orig-fun  args)
  "Advice for effort in repeating tasks"
  (progn
(if (org-entry-get (point) "LAST_REPEAT")
(concat "Repeating" 
(apply orig-fun args))
  (apply orig-fun args
(advice-add 'org-clock-get-clock-string :around #'ocgcs)
#+END_SRC

What I would like to do now is getting the total time clocked today for the 
task and then compare it to the Effot property value. I have found how to get 
the total amount of time clocked for the task, but I don’t know how to limit 
this to today.

Any ideas?

Thank you.

G.



[O] Effort estimates on repeating tasks

2019-09-19 Thread garjola
Hi,

I like the warning in the mode line when the time clocked on a task goes
beyond the effort estimates in the properties drawer.

However, I don’t know how to use this for repeating tasks or habits.
That is, I want to work on a given task every day for less than N
minutes and be warned when going beyond this amount. Of course,
using the Effort property will warn me the first time, but will be
useless after that, unless I delete the clocked time at the beginning of
each new session.

Is there a way to do that properly?

Thanks in advance for your help.

G.
-- 



Re: [O] Disable typo-mode in org source code blocks

2019-09-03 Thread garjola
On Mon 02-Sep-2019 at 20:26:22 +02, John Kitchin
 wrote: 
> You can use cursor-sensor mode for this if you have emacs 26ish. The idea is 
> you set cursor-sensor functions on a region that do something depending on 
> whether you enter or leave the region. Below, I tie into
> the org font lock mechanisms to add these properties so that when you enter, 
> typo mode gets turned off, and when you leave it gets turned back on. I use a 
> similar approach to put src-block specific key maps
> on src blocks. There are two examples of functions that are "lightly tested". 
> I can see why you would want this disabled in src blocks, it never puts the 
> right quote in! 
>

[…]

Hi,

Thanks for this! I will have to spend some time before I understand
everything, but this is of great help.
-- 



Re: [O] Disable typo-mode in org source code blocks

2019-09-02 Thread garjola
On Mon 02-Sep-2019 at 10:35:02 +02, Tim Cross 
wrote: 
> I think Eric is correct. There is also another reason. If you edit the
> source blocks with C-', then any escaping needed (such as putting a ','
> before '*') will also be automatically handled, plus of course you get
> all the programing mode goodness.
>
> Fraga, Eric  writes:
>
>> On Monday,  2 Sep 2019 at 09:01, garj...@garjola.net wrote:
>>> I am using typo-mode (https://github.com/jorgenschaefer/typoel) in my
>>> org buffers (actually with a hook for text-mode), but I would like to
>>> disable it in source code blocks.
>>>
>>> I have been unable to find a hook to do so (I understand that
>>> org-src-mode-hook is used when editing with ‘C-c '’ but not in the org
>>> buffer).
>>
>> I am not entirely sure what you want here.  If it is that you want to
>> turn off typo-mode when point moves into a src block but while still in
>> the whole org buffer, then you cannot do this AFAIK.  The best approach
>> is to always edit src blocks using C-c ' (org-edit-special) and then you
>> can use org-src-mode-hook to do what you want.

Thanks to both of you. I usually edit in the separate buffer, but I
don’t for one liners. It’s a pity that this is not possible, but I can
live with that!

Thanks again!
-- 



[O] Disable typo-mode in org source code blocks

2019-09-02 Thread garjola
Hi,

I am using typo-mode (https://github.com/jorgenschaefer/typoel) in my
org buffers (actually with a hook for text-mode), but I would like to
disable it in source code blocks.

I have been unable to find a hook to do so (I understand that
org-src-mode-hook is used when editing with ‘C-c '’ but not in the org
buffer).

Can you help me with this?

Thanks.

G.
-- 



Re: [O] Converting tags to TODO states

2019-04-16 Thread garjola
On Tue 16-Apr-2019 at 15:26:16 +02, Bernt Hansen 
wrote: 
> garj...@garjola.net writes:
>
>> Hi,
>>
>> For my GTD implementation with org-mode, I have been using the :next:
>> tag for my next actions. I would like now to use a "NEXT" TODO keyword,
>> which means that I need to convert all :next: tags with "TODO" headlines
>> into "NEXT" headlines without the :next: tag. 
>>
>> I have *a lot* of org files, so an automatic procedure is needed. Since
>> I am not fluent in elisp, I was going to write a python script to do
>> this, but maybe there is already a way to do this conversion with
>> org-mode itself?
>>
>> The tricky thing I see with parsing is dealing with the ":" in the case
>> of multiple tags (I know how to do this in python, but I don't in
>> elisp).
>>
>> Thanks for any hint you can provide.
>>
>> Garjola
>
> As this is a one-time change I would just use the agenda and bulk
> operations to fix your entries.
>
> If the files already contribute to your agenda (I assume they do) 
> you can just run a tag match on :next:
>
> C-c a m next RET
>
> and mark all the entries returned with 
>
> m (repeat for each task)
>
> then add a NEXT todo keyword
>
> B t NEXT RET
>
> and mark all the tasks again
>
> m (repeat for each task)
>
> and remove the :next: tag
>
> B - next RET
>
> and save your files.
>
> HTH,
> Bernt

Hi Bernt,

You just made me discover that one can change tags on bulk. I have used
bulk operations for rescheduling, but not for this.

That's great!

Thanks!
-- 



[O] Converting tags to TODO states

2019-04-15 Thread garjola
Hi,

For my GTD implementation with org-mode, I have been using the :next:
tag for my next actions. I would like now to use a "NEXT" TODO keyword,
which means that I need to convert all :next: tags with "TODO" headlines
into "NEXT" headlines without the :next: tag. 

I have *a lot* of org files, so an automatic procedure is needed. Since
I am not fluent in elisp, I was going to write a python script to do
this, but maybe there is already a way to do this conversion with
org-mode itself?

The tricky thing I see with parsing is dealing with the ":" in the case
of multiple tags (I know how to do this in python, but I don't in
elisp).

Thanks for any hint you can provide.

Garjola


-- 



[O] org-babel: capturing the output of a shell command that does not return

2018-09-19 Thread garjola
Hi,

I need to capture the output of a shell command run from a babel code block, 
but this command does not return. By that, I mean that the command prints some 
text to the terminal, but does not end (it launches a deamon). Something like 
this:

#+BEGIN_SRC bash
jupyter kernel 
#+END_SRC

When run in a terminal, the command outputs some text like:

>> >>>
>> > >
> [KernelApp] Starting kernel 'python3' 
>>
> [KernelApp] Connection file: 
> /run/user/1000/jupyter/kernel-8a5cf00c-182c-4212-9bbc-7aa6ec436b95.json >
> [KernelApp] To connect a client: --existing 
> kernel-8a5cf00c-182c-4212-9bbc-7aa6ec436b95.json >
> > >> 
> > >>
> > > >

and sits there waiting for requests. I would like to capture the output to 
parse it. I need the name of the json file to pass it as a :session argument to 
subsequent code blocks like this:

#+BEGIN_SRC emacs-lisp
(setq org-babel-default-header-args
  (cons '(:session . 
"/run/user/1000/jupyter/kernel-8a5cf00c-182c-4212-9bbc-7aa6ec436b95.json")
(assq-delete-all :session org-babel-default-header-args)))
#+END_SRC

#+BEGIN_SRC ipython :results output drawer :session 
"/run/user/1000/jupyter/kernel-8a5cf00c-182c-4212-9bbc-7aa6ec436b95.json"
print(2+2)
#+END_SRC

Maybe there is another way to run the shell command and extract the file name I 
need (in elisp?), but I don't know how.

I anybody could point me in the right direction, this would be very helpful.

Thank you.

G.

-- 



[O] C++ sessions for Babel with cling interpreter

2017-11-05 Thread garjola
Hi all,

I use C++ source code blocks in babel frequently and I am very happy with the 
results. As C++ is a compiled language, ob-C.el does not support sessions.

Unfortunately, this breaks a little my litterate programming workflow, since I 
don't know how to use small code snippets without sessions.

I have recently discovered cling [1], [2] a C++ interpreter which comes with de 
Root package [3]. I have also found a cling inferior mode [4] to interact with 
the interpreter in a comint buffer.

I was wondering if it would be difficult to update ob-C.el to use cling for 
session support. My elisp knowledge is too poor to understand what is involved 
in doing such a thing, but I would be interested in trying or helping somebody 
do it. Unfortunately, I have the impression that the developers of ob-C.el are 
not around this list anymore?

I would very much appreciate suggestions on how to proceed.

Thank you.

Garjola.

Footnotes: 
[1]  https://root.cern.ch/cling
[2]  https://www.youtube.com/watch?v=Lbi7MLS03Yc
[3]  https://root.cern.ch/
[4]  https://github.com/brianqq/inferior-cling

-- 
Dr. Dindi
Dad, Philosopher, Hacker



Re: [O] Bug in latex export figure labels?

2015-10-16 Thread garjola

Nicolas Goaziou  wrote:
> 
> Hello,
>> Am I doing something wrong?
>
> This is a feature. See `org-latex-prefer-user-labels'.
>
>

Oups! Thank you and apologies!
-- 
Dr. Dindi
Dad, Philosopher, Hacker



[O] Bug in latex export figure labels?

2015-10-16 Thread garjola
Hi,

I am having issues when exporting to LaTeX using labels in figures. The
following snippet

> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> #+CAPTION: Comparison >
> #+NAME:  fig:irreg2   >
> #+attr_latex: :width 0.9\textwidth :placement [H] >
> [[file:irregular_red.png]]>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

gets exported as (see the label)

> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> \begin{figure}[H]>
> \centering   >
> \includegraphics[width=0.9\textwidth]{irregular_red.png} >
> \caption{\label{fig:orgparagraph1}   >
> Comparison}  >
> \end{figure} >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

instead of 

> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> \begin{figure}[H]>
> \centering   >
> \includegraphics[width=0.9\textwidth]{irregular_red.png} >
> \caption{\label{fig:irreg2}Comparison}   >
> \end{figure} >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

I noticed this when updating the melpa package to the latest one. Using
the git repository I have tried several versions of org-mode and the
"bug" was introduced between release 8.2.9 and release 8.3. 

Since I am a little bit surprised that this has not been noticed, I am
reluctant to say that this is a bug, but the same file gets exported
differently with these 2 releases.

I have also tried to change +NAME to +LABEL and the result is the same.

Am I doing something wrong?

Thank you.

Garjola




-- 
Dr. Dindi
Dad, Philosopher, Hacker