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] 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



[O] org-vcard -- possible to convert .vcf files to .org ?

2017-02-18 Thread John Magolske
Can org-vcard convert .vcf files into .org files? I have a .vcf file,
a list of contacts generated from an android phone, which I'd like to
edit, through a process like:

contacts.vcf -> contacts.org

then after editing that contacts.org file do:

contacts.org -> contacts2.vcf

so that contacts2.vcf can be re-imported to the phone.

I tried org-vcard-import along with:

Source: file
Destination: buffer 
Filename? /tmp/Contacts.vcf

which tells me:

Imported contacts data to buffer ’*org-vcard-import*’

but that buffer is empty. Same when I select as Destination "file",
it produces an empty file.

I see org-vcard is "... a package for exporting and importing vCards
from within GNU Emacs' Org mode." So I'm thinking it should be
possible to do something like this, but I can't seem to get it
working.

TIA for any clarification,

John

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



Re: [O] org-capture -- optionally add time-of-day as with C-c . ?

2016-02-10 Thread John Magolske
Hi Aaron,

* Aaron Ecay  [160210 11:22]:
> Using %^T seems to give the desired behavior you describe in your
> message.  Can you try it and see if it works for you?  (Regrettably,
> it’s not obvious from the docstring of ‘org-capture-templates’ that it
> should behave like that, since %T is supposed to insert a time
> unconditionally.  But in my testing, %^T only inserts a time if one is
> entered by the user.)

I just tried %^T and it did not work -- a time-of-day was included in
all cases. What *did* work however is the lowercase %^t version. With
that in my org-capture template, just the date is inserted, except when
an explicit time-of-day is entered at the minibuffer prompt. Then that
time is added after the date. This makes picking dates & times with
org-capture a breeze.

Thanks for clueing me in!

John

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



[O] org-capture -- optionally add time-of-day as with C-c . ?

2016-02-10 Thread John Magolske
In setting up org-capture, I'd like to have behaviour similar to what
`org-time-stamp` provides, which by default is bound to:

C-c .

That command in org-mode brings up a 3-month calendar and a minibuffer
prompt for entering a date. With nothing entered at the prompt, just a
RET, a timestamp with the current date is inserted like so:

<2016-02-09 Tue>

If a date is picked from the calender, say March 26, then that date
is inserted:

<2016-03-26 Sat>

If, for example, 2pm is entered at the minibuffer prompt and March 8
is picked from the calender, then a timestamp like so gets inserted:

<2016-03-08 Tue 14:00>

I find this to be a very nice, intuitive interface. Time-of-day is
easily added, but only if explicitly input. Otherwise just the date
shows up. I'm having a hard time setting this up for org-capture...
I can get close with something like:

  (setq org-capture-templates
  '(("t" "todo" entry (file+headline "~/org/todo.org" "Tasks")
  "* TODO %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t) 
t)\n")))

But that always inserts a time-of-day into the timestamp, using the
current time if nothing is input at the minibuffer prompt. So if I
just pick March 8 from the calender, that date will be inserted along
with the current time-of-day like so:

** TODO
SCHEDULED: <2016-03-08 Mon 00:53>

Which pretty much always necessitates a manual edit of the time to
either remove it or adjust it to something relevant.

When explicitly adding a time value at the prompt in the minibuffer,
2pm for example, then picking March 8, this would show up:

** TODO
SCHEDULED: <2016-03-08 Tue 14:00>

And that works great. It's just the aforementioned situation where no
time-of-day is entered and the current time-of-day gets associated
with some future-date timestamp rather than just having that date show
up by itself with no time-of-day.

Is there some way to have the `C-c .` behaviour outlined above happen
in org-capture?

TIA for any help,

John

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