Re: [O] The + character creating strike-through markup within in-line literal / code blocks

2018-06-24 Thread John Magolske
Hi,

Thanks for the reply.

* Nicolas Goaziou  [180624 16:11]:
> John Magolske  writes:
> > to show in-line code as literal I tried:
> >
> > in the expression =(x +. y)= the =+.= is a function ...
> >
> > being under the impression that bracketing text with = would enclose
> > everything within to be literal. But what's happening -- as evidenced
> > by syntax coloring -- is that the first and second + characters here
> > create a strike-through region from the middle of one literal region
> > to the middle of the other. With (setq org-hide-emphasis-markers t)
> 
> It happens because syntax coloring is a bit dumb. It uses regexps but
> not the parser. However, if you try, e.g., to export the document, the
> plus signs will not be treated as markers.

Ok, just tried org-html-export-as-html and see it renders properly
in html:

... expression (x +. y) the +. is ...

but I feel like there's a bug in the regex, that the =code= and
~verbatim~ marker characters should be able to prevent any other
marker characters bracketed by them from causing highlighting. Not
sure if I'll have time to dig into this any time soon, but it'd be
interesting to see how markdown-mode.el handles `inline code` defined
by backquotes, as it doesn't have the issues I'm seeing with how org.el
renders inline code. For example, all the text contained within the
backquotes here: `is this *bold* ?` shows up highlighted as code,
the *bold* there looks no different. In org-mode however, the *bold*
in ~is this *bold* ?~ shows up highlighted as bold, even though
org-html-export-as-html renders it as is this *bold* ? .

> > Also tried to remove strike-through emphasis altogether by commenting
> > out the strike-through section in org-emphasis-alist like so:
> >
> > (setq org-emphasis-alist
> >   (quote
> >(("*" bold)
> > ("/" italic)
> > ("_" underline)
> > ("=" org-verbatim verbatim)
> > ("~" org-code verbatim)
> > ("+" nil)
> > ;; ("+" (:strike-through t))
> > )))
> >
> > Then re-started Emacs, but am still having the above issues.
> 
> You could try to remove ("+" ...) completely from the variable and
> restart Emacs.

I tried this:

(setq org-emphasis-alist
  (quote
   (("*" bold)
("/" italic)
("_" underline)
("=" org-verbatim verbatim)
("~" org-code verbatim

but for some reason I'm still seeing the exact same issues. In any
case, I don't think trying to do away with strike-through capability
is something I'd like to pursue. When viewing OCaml code in org-mode,
these also will not render properly:

in =(x *. y)= the =*.= is a function ...
in =(x /. y)= the =/.= is a function ...

highlighting this section as bold and italic respectively:

. y)= the =

Ideally I'd like to make the org-verbatim and org-code emphasis regex
more robust.

Regards,

John


-- 
John Magolske
http://b79.net/contact



[O] org-map-entries calls org-agenda-prepare-buffers unnecessarily?

2018-06-24 Thread Adam Porter
Hi,

I've noticed that org-map-entries calls org-agenda-prepare-buffers
whenever its SCOPE argument is nil.  According to the docstring, a nil
SCOPE means, "The current buffer, respecting the restriction if any," so
it doesn't seem necessary to call org-agenda-prepare-buffers.

I noticed this because I have a function in my org-mode-hook that runs
org-map-entries (applying a read-only property to entries with a
read_only tag), and whenever I find-file on a non-existent Org file, I'm
prompted, "Non-existent agenda file %s.  [R]emove from list or
[A]bort?", which is caused by org-map-entries being called with a nil
SCOPE, which calls org-agenda-prepare-buffers, which calls
org-check-agenda-file on the not-yet-existent file.  So if this behavior
is indeed unnecessary, it would be nice to fix it.

Is this a bug, or am I missing something?

Thanks.




Re: [O] info URL « open at point » patch

2018-06-24 Thread Eli Zaretskii
> From: Vincent Belaïche 
> CC: "emacs-de...@gnu.org" , "emacs-orgmode@gnu.org"
>   
> Date: Sun, 24 Jun 2018 20:34:26 +
> 
> I agree it is a bit strange, but the reason for it is simple : I would
> like a single entry point for all the manuals installed on my PC, so
> that my old and tired brain does not have to remember where the manual
> is located, and what format is it written in. So it would be nice if all
> the manuals were just listed in the info top level menu.

That's not the strange part.  The strange part is to reference an HTML
document from a Texinfo document.



Re: [O] Bug: org-toggle-tag always marks buffer modified [9.1.13 (9.1.13-elpaplus @ .emacs.d/elpa/org-plus-contrib-20180618/)]

2018-06-24 Thread Bernt Hansen
Nicolas Goaziou  writes:

> Bernt Hansen  writes:
>
>> This problem still exists when the capture template includes TAGS
>>
>> In the below capture-templates definition the "t" (todo) template works
>> fine but the "m" Meeting template does not allow SPC to enter a space
>> between words when entering the headling for the meeting task.
>>
>> (setq org-capture-templates
>>   (quote (("t" "Todo" entry (file "C:/D-Drive/org/refile.org")
>>  "* TODO %?\n%U\n\n%x\n" :clock-in t :clock-resume t)
>>("m" "Meeting" entry (file
>>   "C:/D-Drive/org/refile.org")
>>  "* TODO %? :MEETING:\n%U\n\n" :clock-in t :clock-resume
>>   t
>
> I re-introduced the problem recently. This is now fixed, with
> a regression test for good measure.

Fix confirmed :)

Thanks,
Bernt



Re: [O] point moves and zoom level reverts when refreshing agenda

2018-06-24 Thread Samuel Wales
On 6/24/18, Marco Wahl  wrote:
> Bonjour!

merci a tout.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] Babel Edit Code Whole Session Context

2018-06-24 Thread Kevin Foley
Hi Grant,

> I hear you and think I understand what you say. I also know it can be
> irritating when
> somebody answers a slightly different question question you asked. If
> you humor me,
> I'm about to do that.

No problem, I appreciate all discussion on the matter.

> I don't know how to do what you ask. However, I have something to do
> that I would be
> pretty happy.

> 1. Set the default headers args to noweb :tangle
> 2. Develop blocks normally, without Company.
> 3. When I am ready to work on the whole codebase with company, tangle
> to a file.
> 4. Go to that file. Leverage Company and make changes. When you are
> done detangle.
> 5. Iterate

I'm thinking of trying to implement something similar.  My solution would
be to place all code from blocks of the same session into the edit buffer
and then narrow to only the section from the current code block.  Then all
features should work seamlessly.  I'm not quite sure the best approach to
do this but I'm going to start poking around in the source code to see if
it's feasible.

If anyone has a solution that's already available or any feedback on my
proposed approach I'd greatly appreciate it.

-- 
Thanks,
Kevin Foley


Re: [O] info URL « open at point » patch

2018-06-24 Thread Eli Zaretskii
> From: Vincent Belaïche 
> CC: "emacs-de...@gnu.org" , "emacs-orgmode@gnu.org"
>   
> Date: Sun, 24 Jun 2018 18:21:20 +
> 
> What I want to do is to refer an HTML or PDF document from an Info document. 
> So
> I want the info browser to launch the web browser for it to open a
> « file: »  protocol document.

Got it.  Strange use case, but whatever.



Re: [O] info URL « open at point » patch

2018-06-24 Thread Eli Zaretskii
> From: Vincent Belaïche 
> CC: "emacs-de...@gnu.org" , "emacs-orgmode@gnu.org"
>   
> Date: Sun, 24 Jun 2018 16:48:30 +
> 
> To my understanding @xref works only for info links (node names or anchors, 
> or qualified thereof where the
> qualificator is the info document name) --- maybe I am wrong, tell me if so 
> ---  but I want to refer to an HTML
> or PDF document.

No, Texinfo cross-references work in any format supported by Texinfo.
If your link should only appear in the HTML version, you could use the
@ifhtml..@end ifhtml conditional, and similarly with links that should
only appear in PDF (i.e. printed version) of the manual.  There's also
@ifnotinfo etc.

So once again I don't think I understand the problem.  Could you
perhaps elaborate, or show an actual example?



Re: [O] Babel Edit Code Whole Session Context

2018-06-24 Thread Grant Rettke
Hi Kevin,

On Sun, Jun 24, 2018 at 9:50 AM, Kevin Foley  wrote:
> Is there anyway to edit a source code block with the context of all other
> source code blocks in the same session?  Specifically when working with
> Python I'd like features like company to be able to use the rest of the code
> in the session.

I hear you and think I understand what you say. I also know it can be
irritating when
somebody answers a slightly different question question you asked. If
you humor me,
I'm about to do that.

I don't know how to do what you ask. However, I have something to do
that I would be
pretty happy.

1. Set the default headers args to noweb :tangle
2. Develop blocks normally, without Company.
3. When I am ready to work on the whole codebase with company, tangle
to a file.
4. Go to that file. Leverage Company and make changes. When you are
done detangle.
5. Iterate

That way you can get what you need albeit not how you wanted it to work.



[O] Babel Edit Code Whole Session Context

2018-06-24 Thread Kevin Foley
Is there anyway to edit a source code block with the context of all other
source code blocks in the same session?  Specifically when working with
Python I'd like features like company to be able to use the rest of the
code in the session.

For example consider the following org file:

#+begin_src python :tangle yes :session my_session
  var = 'variable'

  var_upper = var.
#+end_src

#+begin_src python :tangle yes :session my_session
  var_lower = var.
#+end_src

If I call `org-edit-src-code` on the first block and move the point to
after the dot in "var." and call `elpy-company-backend` I get suggestions
of all methods associated with strings in Python.  However if I do the same
in the second code block I get the message "No completion found".

Is there any solution to this issue?

-- 
Thanks,
Kevin Foley


Re: [O] info URL « open at point » patch

2018-06-24 Thread Jean-Christophe Helary


> On Jun 24, 2018, at 15:57, Vincent Belaïche  wrote:
> 
> Bonjour tout l'monde !
> I am writing to both Emacs-devel and org-mode list because this concerns
> browsing URL, and Org-mode already has quite some stuff on this.
> Recently I came across this that in an Info file a « file: » protocol
> URL is not opened at point. Please find attached a patch to make it
> known to the Emacs info browser.
> My point was that I have some manual that are only in HTML or PDF, like
> the SVN manual, In have a local copy, and I want to find it through a
> manual index that I written in Texinfo to get an info node with this
> index.

> 

Wouldn't it be shorter and easier to understand/maintain to explicitly describe 
the protocols:

+ ((setq node (Info-get-token (point) 
"\\(?:f\\(?:ile\\|tp\\)\\|https?\\)://"

???

Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune





Re: [O] info URL « open at point » patch

2018-06-24 Thread Eli Zaretskii
> From: Vincent Belaïche 
> Date: Sun, 24 Jun 2018 06:57:53 +
> 
> I am writing to both Emacs-devel and org-mode list because this concerns
> browsing URL, and Org-mode already has quite some stuff on this.
> Recently I came across this that in an Info file a « file: » protocol
> URL is not opened at point. Please find attached a patch to make it
> known to the Emacs info browser.
> My point was that I have some manual that are only in HTML or PDF, like
> the SVN manual, In have a local copy, and I want to find it through a
> manual index that I written in Texinfo to get an info node with this
> index.

Maybe I'm missing something, but I don't understand why support for
file:// protocol is needed in Info.  Info already supports its own
protocol of referencing to an external file, via the @xref command and
its varieties, with 4 or more arguments.  So why cannot you simply use
one of those cross-referencing commands, if you want a reference to
another manual?

Thanks.



[O] Setting parent ID property while archiving a subtree

2018-06-24 Thread Andrei Beliankou
Dear list members,

I wonder if there is a direct way to add the parent ID to an archived
subtree like `ARCHIVE_PARENT_ID` shown in the example:

** DONE [#A] Split spark batch jobs emr repository
   CLOSED: [2018-02-06 Tue 15:40] SCHEDULED: <2018-02-01 Thu>
   :PROPERTIES:
   :ID:   cf36b714-b602-49e6-9101-b2a50e20a61b
   :CREATED_AT: [2017-11-28 Tue 15:41]
   :ARCHIVE_TIME: 2018-06-24 Sun 12:56
   :ARCHIVE_FILE: ~/Documents/gtd/projects.org
   :ARCHIVE_OLPATH: Work/Projects/Project: Important (#A)
   :ARCHIVE_CATEGORY: Cat01
   :ARCHIVE_TODO: DONE
   :ARCHIVE_PARENT_ID: 43c3f727-05a3-4278-bfbe-7d21c0b818dc
   :END:

`org-archive` offers a way of setting `org-archive-save-context-info`
which doesn't contain parent-ID properties.

Any ideas?

Best,

Andrei Beliankou



Re: [O] Babel: Why does noweb work differently depending on 'call depth'?

2018-06-24 Thread jhe...@t-online.de
Thank you for this hint.

I still do not really get the reason, why the difference shows up only in the 
compare part of the cond
and works as expected in the t body, so I will go deeper into evaluation order 
and var replacement code.

Greetings 


>> Noweb expansion is done before references in the current source block
>> are resolved. You are sending p1="$x" instead of p1="valB".

>> Regards,
>> Nicolas Goaziou




Re: [O] coderef does not provide file path for org-insert-link when not in original buffre

2018-06-24 Thread stardiviner
I just toke a look at the source code of `org-store-link'. I think it's 
possible to implement it. I will take a try.
Might need to add support in `org-open-at-point` [C-c C-o].

Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> `org-insert-link` should be smart on decide whether current buffer is the 
>> same buffer with `org-store-link` source buffer, if yes, use [[(set the temp 
>> buffer to unibyte)]]. If no, use:
>>
>> [[file:~/Org/elquery.org::(set%20the%20temp%20buffer%20to%20unibyte)][(set 
>> the temp buffer to unibyte)]]
>>
>> WDYT?
>
> It sounds like a good idea. Do you want to implement it?
>
> Regards,


-- 
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  



Re: [O] The + character creating strike-through markup within in-line literal / code blocks

2018-06-24 Thread Nicolas Goaziou
Hello,

John Magolske  writes:

> I'd like to enter some in-line literal code in an org document
> covering OCaml. For example, in this:
>
> in the expression (x +. y) the +. is a function ...
>
> to show in-line code as literal I tried:
>
> in the expression =(x +. y)= the =+.= is a function ...
>
> being under the impression that bracketing text with = would enclose
> everything within to be literal. But what's happening -- as evidenced
> by syntax coloring -- is that the first and second + characters here
> create a strike-through region from the middle of one literal region
> to the middle of the other. With (setq org-hide-emphasis-markers t)

It happens because syntax coloring is a bit dumb. It uses regexps but
not the parser. However, if you try, e.g., to export the document, the
plus signs will not be treated as markers.

> Is there some way to get the + to show up as literal within in-line
> sections enclosed by = or ~ ? I suppose I could do something like:
>
> in the expression src_ocaml{(a +. b)} the src_ocaml{(+.)} is a function 
> ...
>
> But was hoping to use the more succinct = or ~ syntax.

You could insert a zero-width space between "+" and ".", in either or
both occurrences.

> Also tried to remove strike-through emphasis altogether by commenting
> out the strike-through section in org-emphasis-alist like so:
>
> (setq org-emphasis-alist
>   (quote
>(("*" bold)
> ("/" italic)
> ("_" underline)
> ("=" org-verbatim verbatim)
> ("~" org-code verbatim)
> ("+" nil)
> ;; ("+" (:strike-through t))
> )))
>
> Then re-started Emacs, but am still having the above issues.

You could try to remove ("+" ...) completely from the variable and
restart Emacs.

Regards,

-- 
Nicolas Goaziou



Re: [O] point moves and zoom level reverts when refreshing agenda

2018-06-24 Thread Marco Wahl
Bonjour!

Nicolas Goaziou  writes:

> Thank you. It looks good. Feel free to apply it.

Thanks, I did.

> I have two suggestions however:
>
> 1. There is some code duplication, e.g., (dolist ...), could this be
>factored out before applying the patch?

Yes, done, thanks for the hint.  The patch has been committed.

> 2. Would it make sense to add the variables to preserve in a dedicated
>top-level variable instead of burying them in the code?

I don't know.  Possibly this is a YAGNI.  A top-level variable could be
introduced any time.  Further someone might come up with a freshly
rewritten agenda in the meantime. ;)

BTW: It might be a good idea to take ideas from `list-buffers' and
friends for the rewrite of the agenda.


Ciao,
 Marco





[O] The + character creating strike-through markup within in-line literal / code blocks

2018-06-24 Thread John Magolske


I'd like to enter some in-line literal code in an org document
covering OCaml. For example, in this:

in the expression (x +. y) the +. is a function ...

to show in-line code as literal I tried:

in the expression =(x +. y)= the =+.= is a function ...

being under the impression that bracketing text with = would enclose
everything within to be literal. But what's happening -- as evidenced
by syntax coloring -- is that the first and second + characters here
create a strike-through region from the middle of one literal region
to the middle of the other. With (setq org-hide-emphasis-markers t)
I'm seeing this:

in the expression (x . y) the . is a function ...

The + is acting as a markup character, whereas when the above example
is entered like so:

: in the expression (x +. y) the +. is a function ...

it all shows up just fine with the + coming through as a literal
character.

Is there some way to get the + to show up as literal within in-line
sections enclosed by = or ~ ? I suppose I could do something like:

in the expression src_ocaml{(a +. b)} the src_ocaml{(+.)} is a function ...

But was hoping to use the more succinct = or ~ syntax.

Also tried to remove strike-through emphasis altogether by commenting
out the strike-through section in org-emphasis-alist like so:

(setq org-emphasis-alist
  (quote
   (("*" bold)
("/" italic)
("_" underline)
("=" org-verbatim verbatim)
("~" org-code verbatim)
("+" nil)
;; ("+" (:strike-through t))
)))

Then re-started Emacs, but am still having the above issues.

Thanks for any help,

John

-- 
John Magolske
http://b79.net/contact