Re: [O] [PATCH] Making org-agenda filters orthogonal and refreshed

2014-04-19 Thread Bastien
Hi Greg,

Greg Tucker-Kellogg gtuckerkell...@gmail.com writes:

 This is org-mode version 8.2.5h, directly off the git.

When mentioning the Org version for a patch you submit, please
include the whole version with C-u M-x org-version RET -- this
tells more than C-h v org-version.

 emacs version 24.4.50.1

 I have noticed that combining top headline filters and category
 filters didn't always work as documented.

Thanks for looking into this.

Before we go further enhancing the patch, are you willing to go with
the FSF copyright assignment?  I see you already have tiny changes and
we cannot accept more.  If you're not willing to sign, you'll drive
the debugging and I'll write the code.

Let me know.

Other than that, the diagnosis is good and the patch looks okay,
except for the use of defadvice.

Thanks,

-- 
 Bastien



Re: [O] how to stop the mouse pointer highlighting in agenda?

2014-04-19 Thread Bastien
Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 aha, interesting... but I get the message with tooltip-mode enabled and
 disabled...

When enabled, you get it as a tooltip.
When disabled, you get it in the echo area.

Tweak tooltip-delay to never display it.

-- 
 Bastien



Re: [O] how to stop the mouse pointer highlighting in agenda?

2014-04-19 Thread Igor Sosa Mayor
Bastien b...@gnu.org writes:

 When enabled, you get it as a tooltip.
 When disabled, you get it in the echo area.

 Tweak tooltip-delay to never display it.

aha... exactly! Many thnaks!

-- 
:: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
:: jabberid: rogorido  ::::




Re: [O] [PATCH] Making org-agenda filters orthogonal and refreshed

2014-04-19 Thread Greg Tucker-Kellogg
Hi Bastien,

Org-mode version 8.2.5h (release_8.2.5h-883-g45e881 @
/Users/gtk/.emacs.d/org/lisp/)

Sure, I'm happy to go with the FSF copyright agreement.  I'll send the
request today.

Greg


On Sat, Apr 19, 2014 at 2:02 PM, Bastien b...@gnu.org wrote:
 Hi Greg,

 Greg Tucker-Kellogg gtuckerkell...@gmail.com writes:

 This is org-mode version 8.2.5h, directly off the git.

 When mentioning the Org version for a patch you submit, please
 include the whole version with C-u M-x org-version RET -- this
 tells more than C-h v org-version.

 emacs version 24.4.50.1

 I have noticed that combining top headline filters and category
 filters didn't always work as documented.

 Thanks for looking into this.

 Before we go further enhancing the patch, are you willing to go with
 the FSF copyright assignment?  I see you already have tiny changes and
 we cannot accept more.  If you're not willing to sign, you'll drive
 the debugging and I'll write the code.

 Let me know.

 Other than that, the diagnosis is good and the patch looks okay,
 except for the use of defadvice.

 Thanks,

 --
  Bastien



Re: [O] org-review-schedule

2014-04-19 Thread Bastien
Hi Alan,

thanks for sharing -- some comments:

- you need to update the copyright of the file;

- example code in section 3 of the header is mangled;

- there are some dangling parentheses;

- use (get-text-property (point-min) ...) instead of
  (get-text-property 1 ...)

- I'd use org-review instead of org-review-schedule as prefix;

- maybe you can use naked timestamps like 2014-04-19 sam.
  instead of inactive ones, this way using [ in the agenda
  will not create false positives by inserting entries with
  a REVIEW property.

- I infer from a quick read that this works for the agenda but
  I guess this could work for both the agenda and Org buffers;

Since you took inspirationg from org-expiry, I guess some of
the comments above would apply there too... feel free to hack
into this directions for both org-expiry.el and org-review.el!
Actually, maybe both should be merged somehow, since expiring
is just reviewing entries to interactively delete them.

Thanks for this!

-- 
 Bastien



Re: [O] [RFC] Sloppy `org-element-context'?

2014-04-19 Thread Bastien
Hi Nicolas,

Nicolas Goaziou n.goaz...@gmail.com writes:

 As you may know, `org-element-context' returns the object under point,
 according to Org Syntax. The questions are: should it be a little
 sloppy, for convenience? And, if it should, what degree of sloppiness is
 acceptable?

I don't think `org-element-context' should be sloppy *at all*.

`org-element-context' and `org-element-at-point' should both stick to
the syntax as strictly defined -- that's where the value of your work
lies, and we should never dirty that.

IMHO the needed flexibility should be implemented at the level of what
users may want to do with the string at point, even if this means to
temporarily interpret this string in a different way than what the
syntax would do.

For example, on a comment, (eq 'comment (car (org-element-at-point)))
should always return `t'.  But if the user wants to open bracket links
from comments (or in a property), then something like this would do:

(defun org-open-links-in-comment-and-properties ()
  Open links in a comment or in a property.
  (interactive)
  (let ((string-ahead (and (looking-at .+) (match-string 0)))
(value (org-element-property :value (org-element-at-point
(with-temp-buffer
  (org-mode)
  (insert value)
  (goto-char (point-min))
  (search-forward string-ahead)
  (org-open-at-point

which do work right now.

Of course this could be generalized, provided the property to
consider is always named :value, which is not the case IIUC:
sometimes it's :raw-data, right?

My point is that sloppiness at the syntax level would break the
separation of concerns.

If we try to apply the MVC scheme to an org-mode file: the syntax
would give us the model of a file, the buffer properties give us
the view of the file, and functions to render the model or to act
on the buffer are the controllers.  Flexibility should not be in
the model, but in the controllers.

Those distinctions were blurred away before your parser because
Org files are just text... and because we assumed the view (from
the text properties) gave us something like a syntax.

Last but not least: the spirit of the solution shown above does
not prevent amending the syntax if we *really* need to amend it,
but that's where I'd be as conservative as possible -- that is,
as *you* :)

Hope this all makes sense -- let me know what you think.

-- 
 Bastien



Re: [O] [PATCH] Making org-agenda filters orthogonal and refreshed

2014-04-19 Thread Bastien
Hi Greg,

Greg Tucker-Kellogg gtuckerkell...@gmail.com writes:

 Org-mode version 8.2.5h (release_8.2.5h-883-g45e881 @
 /Users/gtk/.emacs.d/org/lisp/)

Thanks,

 Sure, I'm happy to go with the FSF copyright agreement.  I'll send the
 request today.

Re-thanks!

PS: the fix won't make it for 8.2.6 but the issue is a rather
minor one anyway -- so let's do this correctly for 8.3.

-- 
 Bastien



Re: [O] [RFC] Sloppy `org-element-context'?

2014-04-19 Thread Nicolas Richard
Bastien b...@gnu.org writes:
 I don't think `org-element-context' should be sloppy *at all*.

 Hope this all makes sense -- let me know what you think.

It makes sense to me, and I agree with you : org element should not
parse the syntax differently just because e.g. we put a link in a
comment and want to open it.

For comparison, AucTeX has a variable LaTeX-syntactic-comments which
controls that kind of thing : If non-nil comments will be handled
according to LaTeX syntax.

-- 
Nico.



Re: [O] [RFC] Sloppy `org-element-context'?

2014-04-19 Thread Bastien
Nicolas Richard theonewiththeevill...@yahoo.fr writes:

 For comparison, AucTeX has a variable LaTeX-syntactic-comments which
 controls that kind of thing : If non-nil comments will be handled
 according to LaTeX syntax.

That's interesting indeed, thanks for sharing.

-- 
 Bastien



Re: [O] Maintainer change on May 1st

2014-04-19 Thread Bastien
Hi Carsten,

now that I'm down the pile of email I was late on, let me say I'm
glad to be officially back -- it was a great relief to be able to
not be in charge for a year, it helped me to step back and do a lot
of other things.

So thanks for the switch one year earlier, and for this one!

Let's keep Org awesome all together.

-- 
 Bastien, who sounds a bit like a cheerleader now



Re: [O] [RFC] Org Minor Mode?

2014-04-19 Thread Thorsten Jolitz
Bastien b...@gnu.org writes:

Hi Bastien,

 Thorsten Jolitz tjol...@gmail.com writes:

 The real value and innovation of a true
 org-minor-mode would be to introduce Org's intelligent headlines and all
 the related functionality into the world of outcommented text in
 programming modes.

 Yes.  We could have `orgstruct-comment-prefix-regexp' along with
 `orgstruct-heading-prefix-regexp'.  I'll check this, thanks for
 the idea!

As long as there are hardcoded regexp searches all over the place in
org.el, org-agenda.el, orgtbl.el, and to a minor extends almost all
other Org libraries, I don't think just another outline-regexp can do
the trick - the called functions will fail when trying to match

,
| ^foo$
`

but looking at

,---
| ^comment-starter-syntaxfoomaybe-comment-end-syntax$
`---

Furthermore calling Org functions modifies the buffer, sometimes
inserting new lines, sometimes not. An Org minor-mode would need to
detect all newly inserted lines after a command call and outcomment them
with the programming major-mode's comment syntax. 

I already found a way to do that using external calls to diff, its
implemented in omm.el (needs to be debugged though, I stopped working on
it because it seemed the idea of an Org Minor Mode was a bit unpopular). 

In summary, its about:

 1. generalize the regexp constants and vars (allow for comment-syntax,
 when org-minor-mode)

 2. deal with hardcoded regexp-snippets in functions (my proposoal:
 replace ^ with org-BOL, $ with org-EOL, \\* with org-STAR)

 3. outcomment new lines after calls to Org commands. 

All the other stuff should be already there in orgstruct and outshine. 

-- 
cheers,
Thorsten




Re: [O] [RFC] Org Minor Mode?

2014-04-19 Thread Thorsten Jolitz
Samuel Wales samolog...@gmail.com writes:

Hi Samuel, 

 another option is to create annotation mechanisms that are so
 compelling that you don't need org in non-org files.

 your lists and tasks would stay in your org agenda files, but your
 external files would be able to show (via overlays) and link to the
 annotations in org.  in turn, your annotations in org would be able to
 send you to the spot in your extenal files that they refer to.

 we have a ton of annotation mechanisms in emacs and org, but they can
 perhaps be made more compelling in this way.

I think there probably do exist quite a lot of individual customized
systems to connect Org planning files to associated source code files,
and this is definitely a viable use pattern. 

But I think a simpler more direct approach is possible - simply an
outline-minor-mode on steroids (= org-minor-mode). If I structure my
source file with headlines like an org file, do visibility-cycling,
structure editing etc. like in Org-mode - why not add TODO's and
priorities and tags and properties to my headlines? The functionality to
do that is already there in Org-mode, and the syntax-elements used would
be exactly the same. Except the comment-syntax involved ...

 On 4/11/14, Richard Lawrence richard.lawre...@berkeley.edu wrote:
 Hi Thorsten,

 Bastien b...@gnu.org writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:

 Thorsten Jolitz tjol...@gmail.com writes:

 What do you think - is there any chance that Org-mode switches from
 static hardcoded regexp strings (all over the place) to dynamic
 regexps calculated at runtime (using libraries like drx.el or rx.el)?

 I hope not. The syntax should stabilize, not drift away.

 Agreed.  Maybe there are some hardcoded regexps that we can factor
 out, but dynamically building those fundamental regexp is a deadend.

 I agree with what Nicolas and Bastien have said, but I wanted to say
 that I think there is an interesting idea in Thorsten's post that
 shouldn't be dismissed out of hand.

 Org provides a set of UI concepts (tree-like structure, visibility
 cycling, tree filtering, task state tracking, building an agenda from
 multiple sources, ...)  that map nicely onto a lot of other situations,
 and would be really handy to have access to even when the syntax of the
 underlying file is incompatible with Org's syntax.

 There are two ways to think about Org syntax, which I think should be
 distinguished here.  One is as the grammar of a .org file: basically, a
 set of rules that allow a sequence of characters to be parsed into an
 AST.  The other way to think about Org syntax is the way Lisp
 programmers sometimes talk about syntax: as the AST itself, the
 collection of Lisp data types and their interrelationships that define a
 valid Org document.

 If Org were to evolve to the point where the UI concepts were
 implemented purely as transformations on an AST -- on Org syntax in the
 second sense -- then the way would be clear for making those concepts
 available in editing modes where the grammar of the underlying file is
 incompatible with Org syntax in the first sense.  A programming mode
 could, say, parse comments into an Org AST, then expose that AST to the
 functions implementing Org's UI concepts.  Et voila: you get visibility
 cycling, task state tracking, agendas...in your source code comments.

 One sort of use case where I think this idea could really shine is in
 dealing with email.  Obviously, the grammar of the underlying mail files
 (say, in a Maildir) will never be compatible with Org syntax in the
 first sense.  But Org handles so many of the concepts that apply to
 email (threading messages into hierarchies, visibility cycling, tagging,
 sorting by date or priority, thinking of messages as tasks to be dealt
 with, dealing with attachments) in such a nice way that I find myself
 sorely missing Org whenever I read mail in a client that doesn't
 implement them as nicely -- which is all of them.  If it were possible
 to build a parser for message files that transformed them into an Org
 AST, the mail client of my dreams would be in reach.

 I have no idea if evolving Org in this direction is feasible or even
 really desireable.  It may be that the two notions of Org syntax are
 tightly coupled in principle, so that the idea of producing an Org AST
 from an alternative underlying file format will never make sense.  But I
 think that would be surprising.

 This evolution would clearly require more work than just abstracting out
 the regular expressions that implement much of Org's syntax in the first
 sense, and I think Bastien and Nicolas are right that we don't want
 either notion of Org syntax to become less stable.  Still, I think
 there's a lot of interesting possibilities we could explore if Org's
 implementations of the two notions of syntax were to become less tightly
 coupled.

 Best,
 Richard




-- 
cheers,
Thorsten




Re: [O] org-review-schedule

2014-04-19 Thread Alan Schmitt
Hi Bastien,

Thanks a lot for these, I'll look into them. I have a couple questions
in the meantime.

On 2014-04-19 10:14, Bastien b...@gnu.org writes:

 - maybe you can use naked timestamps like 2014-04-19 sam.
   instead of inactive ones, this way using [ in the agenda
   will not create false positives by inserting entries with
   a REVIEW property.

OK. I'm not sure what [ is supposed to do in the agenda, and I don't
see how it could interfere. (I like inactive time stamps because I can
easily adjust their dates with C-left and C-right, is it possible to do
so with naked timestamps?)

 - I infer from a quick read that this works for the agenda but
   I guess this could work for both the agenda and Org buffers;

Yes, clearly.

 Since you took inspirationg from org-expiry, I guess some of
 the comments above would apply there too... feel free to hack
 into this directions for both org-expiry.el and org-review.el!
 Actually, maybe both should be merged somehow, since expiring
 is just reviewing entries to interactively delete them.

Yes. But I should think about it more to see where I could take this.

Thanks again,

Alan



Re: [O] org-review-schedule

2014-04-19 Thread Bastien
Alan Schmitt alan.schm...@polytechnique.org writes:

 - maybe you can use naked timestamps like 2014-04-19 sam.
   instead of inactive ones, this way using [ in the agenda
   will not create false positives by inserting entries with
   a REVIEW property.

 OK. I'm not sure what [ is supposed to do in the agenda, and I don't
 see how it could interfere.

It includes headlines with an inactive timestamp in the agenda.
So if you have a property :REVIEW_DELAY: [Inactive timestamp] this
headline will be show in the agenda if the timestamp matches.

 (I like inactive time stamps because I can
 easily adjust their dates with C-left and C-right, is it possible to do
 so with naked timestamps?)

Well... no.  Of course you can simply use inactive timestamps and
advice users not to include them in the agenda.

 Yes. But I should think about it more to see where I could take
 this.

Thanks in advance!

-- 
 Bastien



[O] [BUG?] Is there a bug with 'noweb' header when tangling source block?

2014-04-19 Thread Vladimir Lomov
Hello,

please consider attached example Org document 'ex.org'. There seems to
be a problem when tangling a source block with noweb reference, without
it source block is tangled fine.

Two examples are also attached.

Emacs version: 24.4.50 (trunk rev. 116991);
org-mode: Org-mode version 8.2.5h (release_8.2.5h-991-g06c947 @ 
/usr/share/emacs/site-lisp/org/)

---
WBR, Vladimir Lomov

-- 
Anyway, I keep picturing all these little kids playing some game in this
big field of rye and all.  Thousands of little kids, and nobody's around --
nobody big, I mean -- except me.  And I'm standing on the edge of some crazy
cliff.  What I have to do, I have to catch everybody if they start to go
over the cliff -- I mean if they're running and they don't look where they're
going I have to come out from somewhere and catch them.  That's all I'd do
all day.  I'd just be the catcher in the rye.  I know it;  I know it's crazy,
but that's the only thing I'd really like to be.  I know it's crazy.
-- J.D. Salinger, Catcher in the Rye


ex.org
Description: Lotus Organizer


ex-ex1.sh
Description: Bourne shell script


ex-ex2.sh
Description: Bourne shell script


Re: [O] Bug: text jumps left and right while typing math when org-indent-mode and linum-mode are enabled. [8.2.5h (8.2.5h-98-g0820d0-elpa @ /Users/kosta/.emacs.d/elpa/org-20140407/)]

2014-04-19 Thread Bastien
Hi Konstantin,

Konstantin Kliakhandler ko...@slumpy.org writes:

 I've discovered a bug that hinders typing when org-indent-mode and
 linum-mode are both enabled.

Yes, I see this glitch too, and I confirm disabling linum-mode
when org-indent-mode is the thing to do... unless someone gets
really annoyed by this and wants to fix it.

-- 
 Bastien



Re: [O] [BUG?] Is there a bug with 'noweb' header when tangling source block?

2014-04-19 Thread Bastien
Hi Vladimir,

Vladimir Lomov lomov...@gmail.com writes:

 please consider attached example Org document 'ex.org'. There seems to
 be a problem when tangling a source block with noweb reference, without
 it source block is tangled fine.

yes, a bug I introduced myself, fixed now.

Thanks for reporting this,

-- 
 Bastien



Re: [O] [RFC] Org Minor Mode?

2014-04-19 Thread Bastien
Hi Thorsten,

Thorsten Jolitz tjol...@gmail.com writes:

 In summary, its about:

  1. generalize the regexp constants and vars (allow for comment-syntax,
  when org-minor-mode)

  2. deal with hardcoded regexp-snippets in functions (my proposoal:
  replace ^ with org-BOL, $ with org-EOL, \\* with org-STAR)

  3. outcomment new lines after calls to Org commands.

I still think there is a simpler way, I'll explore this and
I'll let you know.

-- 
 Bastien



Re: [O] Fwd: Is `org-preview-latex-fragment` sensitive to alignment specified by document class options?

2014-04-19 Thread Rob Stewart
Hi Nick,

Thanks for guiding me to a solution, which was to write write my own
defcustom `my-org-format-latex-header`, changing the first line from
the definition in org.el to \\documentclass[fleqn]{article}. This
definition I call `my-org-format-latex-header`. I then redefine
`org-create-formula--latex-header` to use
`my-org-format-latex-header`, as so:

--8---cut here---start-8---
(defcustom my-org-format-latex-header \\documentclass[fleqn]{article}
\\usepackage[usenames]{color}
\[PACKAGES]
\[DEFAULT-PACKAGES]
\\pagestyle{empty} % do not remove
% The settings below are copied from fullpage.sty
\\setlength{\\textwidth}{\\paperwidth}
\\addtolength{\\textwidth}{-3cm}
\\setlength{\\oddsidemargin}{1.5cm}
\\addtolength{\\oddsidemargin}{-2.54cm}
\\setlength{\\evensidemargin}{\\oddsidemargin}
\\setlength{\\textheight}{\\paperheight}
\\addtolength{\\textheight}{-\\headheight}
\\addtolength{\\textheight}{-\\headsep}
\\addtolength{\\textheight}{-\\footskip}
\\addtolength{\\textheight}{-3cm}
\\setlength{\\topmargin}{1.5cm}
\\addtolength{\\topmargin}{-2.54cm}
  The document header used for processing LaTeX fragments.
It is imperative that this header make sure that no page number
appears on the page.  The package defined in the variables
`org-latex-default-packages-alist' and `org-latex-packages-alist'
will either replace the placeholder \[PACKAGES]\ in this
header, or they will be appended.
  :group 'org-latex
  :type 'string)

(defun org-create-formula--latex-header ()
  Return LaTeX header appropriate for previewing a LaTeX snippet.
  (let ((info (org-combine-plists (org-export--get-global-options
  (org-export-get-backend 'latex))
 (org-export--get-inbuffer-options
  (org-export-get-backend 'latex)
(org-latex-guess-babel-language
 (org-latex-guess-inputenc
  (org-splice-latex-header
   my-org-format-latex-header
   org-latex-default-packages-alist
   org-latex-packages-alist t
   (plist-get info :latex-header)))
 info)))
--8---cut here---end---8---

Now when I call `org-preview-latex-fragment`, the math is correctly
rendered in emacs:
http://imgur.com/mMrMIE6

My only question is: rather than using `defcustom` to define
`my-org-format-latex-header` (hence needing to redefine
`org-create-formula--latex-header`, how do I simply override the
existing definition for `org-format-latex-header`? A hasty attempt to
use setq threw the following backtrace:

--8---cut here---start-8---
Debugger entered--Lisp error: (wrong-type-argument symbolp The
document header used for processing LaTeX fragments.
It is imperative that this header make sure that no page number
appears on the page.  The package defined in the variables
`org-latex-default-packages-alist' and `org-latex-packages-alist'
will either replace the placeholder \[PACKAGES]\ in this
header, or they will be appended.)
  (setq org-format-latex-header \\documentclass[fleqn]{article} ..
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
--8---cut here---end---8---

Thanks Nick!

--
Rob

On 9 April 2014 18:22, Nick Dokos ndo...@gmail.com wrote:
 Rob Stewart robstewar...@gmail.com writes:


 I asked the question below a few days ago, about whether
 `org-preview-latex-fragment` is sensitive document class options that
 might affect alignment. I've so far not received feedback, and
 wondered whether there is more information that I could provide, or if
 my question is not interesting to other people :-)

 

 Is there a way to make `org-preview-latex-fragment` sensitive to LaTeX
 class options? I have a simple example to demonstrate where it does
 not:

 %%% #+LaTeX_CLASS: article #+LaTeX_CLASS_OPTIONS: [fleqn]
 #+LATEX_HEADER: \usepackage{amsmath}

 \begin{gather} b := (a \oplus s_1) \oplus s_2 \\ e := 0 \\
 \end{gather} %%%

 If LaTeX is generated for this document with
 `org-latex-export-to-latex`, which is compiled to a PDF with pdflatex,
 the b := and the e := are left aligned i.e. the b and e are
 vertically aligned.

 However, if `org-preview-latex-fragment` is called within emacs, the
 left alignment specified with the `[fleqn]` class option is not
 honoured. Thus, the two lines in the `gather` block are centrally
 aligned, which is the default case for `gather` blocks.


 org-preview-latex-image is its own self-contained universe and has very
 little in common with latex exporting. In particular, the preview
 preamble is generated by calling org-create-formula--latex-header. Try
 evaluating a call to the function in your *scratch* buffer and see what
 it gives you - I get:

 ,
 | (org-create-formula--latex-header)
 | \\documentclass{article}
 | \\usepackage[usenames]{color}
 | % Package minted omitted
 | \\usepackage[utf8]{inputenc}
 | \\usepackage[T1]{fontenc}
 | % Package fixltx2e omitted
 | \\usepackage{graphicx}
 | % 

Re: [O] Feature Request. org-bibtex-tags-are-keywords inherit tags

2014-04-19 Thread Leonard Randall
Hi Bastien,
Thanks for applying this and for being so diligent in keeping org great. I
have requested the fsf agreement and will sign it when it comes. One
additional minor issue I noticed is that in the docstring for the function
`org-bibtex', it reads, `org-bibtex-export-headline' where it should read
`org-bibtex-headline'.

I have also figured out that bug I mentioned. More on that in a minute.

Thanks,
Leonard


On 18 April 2014 15:47, Bastien b...@gnu.org wrote:

 Hi Leonard,

 Leonard Randall leonard.a.rand...@gmail.com writes:

  Thanks for the feedback. I have attached the modified patch.

 Applied, thanks.

 Have a look at the ChangeLog I added in the commit message.
 If you plan to add other change, please sign the FSF agreement:

 http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt

 Best,

 --
  Bastien



Re: [O] [BUG?] Is there a bug with 'noweb' header when tangling source block?

2014-04-19 Thread Vladimir Lomov
** Bastien [2014-04-19 14:56:19 +0200]:

 Hi Vladimir,

 Vladimir Lomov lomov...@gmail.com writes:

 please consider attached example Org document 'ex.org'. There seems to
 be a problem when tangling a source block with noweb reference, without
 it source block is tangled fine.

 yes, a bug I introduced myself, fixed now.

 Thanks for reporting this,

Thank you, I updated org-mode and now all work fine.

---
WBR, Vladimir Lomov

-- 
Those who are mentally and emotionally healthy are those who have
learned when to say yes, when to say no and when to say whoopee.
-- W.S. Krabill



Re: [O] Bug: Error with org-bibtex export with tags when using custom bibtypes [8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emacs.d/elpa/org-plus-contrib-20140324/)]

2014-04-19 Thread Leonard Randall
Hi Bastien et. al,
I figured out how to fix the bug i reported awhile ago. The problem was
that when making the keyword field for entries without keywords defined in
the `:PROPERTIES:' drawer,  org-bibtex uses `bibtex-make-field' from
`bibtex.el'. This function sends up an error if there are no fields defined
for the type of bib entry you are calling it on. In order to make it work
on non-standard bib types you would have to define the fields associated
with these types in `bibtex-entry-alist'.
One way to deal with this would be to mention this in the appropriate
docstrings. However this would leave org-bibtex somewhat unstable and
dependent on variables outside of `org'.  I think a better solution is to
make the keyword field without calling `bibtex-make-field'. This can be
done with a couple simple regexp functions.

Here is the patch that I came up with. Let me know what you think.
All best,
Leonard


org-bibtex.patch
Description: Binary data


[O] Fwd: Fwd: Is `org-preview-latex-fragment` sensitive to alignment specified by document class options?

2014-04-19 Thread Rob Stewart
Maybe a spoke too soon. My answer below is partly the case. When I
turn on latexpreview with `#+STARTUP: latexpreview` then my formula is
laid out the way I intend, i.e.:
http://imgur.com/eMrwiIJ

Strangely, however, when I hit C-c C-c to remove the preview, then run
`org-preview-latex-fragment` by hand, I see:
http://imgur.com/qznnKj3

Having read through the the org-mode derived mode, me stating
`#+STARTUP: latexpreview` in my org mode triggers a call to
`org-preview-latex-fragment` in org.el:

--8---cut here---start-8---
 (when org-startup-with-latex-preview
   (org-preview-latex-fragment))
--8---cut here---end---8---

So, what is happening between this call at startup, and me later
calling `org-preview-latex-fragment` by hand after org-mode has been
fully loaded? I have tried locating the temporary tex file that gets
generated with this call. But when `org-preview-latex-fragment is
called without errors, I cannot locate the temporary file?

--
Rob

-- Forwarded message --
From: Rob Stewart robstewar...@gmail.com
Date: 19 April 2014 14:02
Subject: Re: [O] Fwd: Is `org-preview-latex-fragment` sensitive to
alignment specified by document class options?
To: Nick Dokos ndo...@gmail.com, emacs-orgmode@gnu.org


Hi Nick,

Thanks for guiding me to a solution, which was to write write my own
defcustom `my-org-format-latex-header`, changing the first line from
the definition in org.el to \\documentclass[fleqn]{article}. This
definition I call `my-org-format-latex-header`. I then redefine
`org-create-formula--latex-header` to use
`my-org-format-latex-header`, as so:

--8---cut here---start-8---
(defcustom my-org-format-latex-header \\documentclass[fleqn]{article}
\\usepackage[usenames]{color}
\[PACKAGES]
\[DEFAULT-PACKAGES]
\\pagestyle{empty} % do not remove
% The settings below are copied from fullpage.sty
\\setlength{\\textwidth}{\\paperwidth}
\\addtolength{\\textwidth}{-3cm}
\\setlength{\\oddsidemargin}{1.5cm}
\\addtolength{\\oddsidemargin}{-2.54cm}
\\setlength{\\evensidemargin}{\\oddsidemargin}
\\setlength{\\textheight}{\\paperheight}
\\addtolength{\\textheight}{-\\headheight}
\\addtolength{\\textheight}{-\\headsep}
\\addtolength{\\textheight}{-\\footskip}
\\addtolength{\\textheight}{-3cm}
\\setlength{\\topmargin}{1.5cm}
\\addtolength{\\topmargin}{-2.54cm}
  The document header used for processing LaTeX fragments.
It is imperative that this header make sure that no page number
appears on the page.  The package defined in the variables
`org-latex-default-packages-alist' and `org-latex-packages-alist'
will either replace the placeholder \[PACKAGES]\ in this
header, or they will be appended.
  :group 'org-latex
  :type 'string)

(defun org-create-formula--latex-header ()
  Return LaTeX header appropriate for previewing a LaTeX snippet.
  (let ((info (org-combine-plists (org-export--get-global-options
  (org-export-get-backend 'latex))
 (org-export--get-inbuffer-options
  (org-export-get-backend 'latex)
(org-latex-guess-babel-language
 (org-latex-guess-inputenc
  (org-splice-latex-header
   my-org-format-latex-header
   org-latex-default-packages-alist
   org-latex-packages-alist t
   (plist-get info :latex-header)))
 info)))
--8---cut here---end---8---

Now when I call `org-preview-latex-fragment`, the math is correctly
rendered in emacs:
http://imgur.com/mMrMIE6

My only question is: rather than using `defcustom` to define
`my-org-format-latex-header` (hence needing to redefine
`org-create-formula--latex-header`, how do I simply override the
existing definition for `org-format-latex-header`? A hasty attempt to
use setq threw the following backtrace:

--8---cut here---start-8---
Debugger entered--Lisp error: (wrong-type-argument symbolp The
document header used for processing LaTeX fragments.
It is imperative that this header make sure that no page number
appears on the page.  The package defined in the variables
`org-latex-default-packages-alist' and `org-latex-packages-alist'
will either replace the placeholder \[PACKAGES]\ in this
header, or they will be appended.)
  (setq org-format-latex-header \\documentclass[fleqn]{article} ..
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
--8---cut here---end---8---

Thanks Nick!

--
Rob

On 9 April 2014 18:22, Nick Dokos ndo...@gmail.com wrote:
 Rob Stewart robstewar...@gmail.com writes:


 I asked the question below a few days ago, about whether
 `org-preview-latex-fragment` is sensitive document class options that
 might affect alignment. I've so far not received feedback, and
 wondered whether there is more information that I could provide, or if
 my question is not interesting to other people :-)

 

 Is there a way to make 

Re: [O] org-todo-keywords-1 detection in asyn export

2014-04-19 Thread zwz
Nicolas Goaziou n.goaz...@gmail.com writes:

 zwz zhangwe...@gmail.com writes:

 Can you give me some example code?

 I was thinking about something like this (untested):

 (let (template)
   (defun ngz-set-template (new)
 (setq template new))
   (defun ngz-latex-process (file)
 (case template
   (a (do-something-with file))
   (b (do-something-else-with file))
   (otherwise (do-default-with file)

 (defun ngz-latex-class-to-template (info backend)
   (when (org-export-derived-backend-p backend 'latex)
 (ngz-set-template
  (let ((value (plist-get info :latex-class)))
(cond ((string= value classA) 'a)
  ((string= value classB) 'b)
  (t nil
 info))

 (add-to-list 'org-export-filter-options-functions
  'ngz-latex-class-to-template)

 (setq org-latex-pdf-process #'ngz-latex-process)

 Obviously, you need to activate lexical binding.


 I am not sure if I get you totally.

 I was talking about BIND keyword, not about your initial
 implementation.

Thank you, Nicolas.
I used BIND before, but never like what your example code does.


 Here is what I put in my org-export-async-init-file:
 (defun ox-xetex-setup ()
   (if (member XeTeX org-todo-keywords-1)
   (setq org-latex-default-packages-alist
   (remove '(AUTO inputenc t)
   org-latex-default-packages-alist)
   org-latex-pdf-process
   '(latexmk -xelatex -pdf -silent -f %f

 (add-hook 'org-mode-hook (lambda () (ox-xetex-setup)))
 ;; instead of add-hook as above, you can just put
 ;; (ox-xetex-setup)
 ;; but again, it still calls pdflatex when export asynchronously


 [...]

 When I export it asynchronously, org-export calls pdflatex rather than
 xelatex to generate pdf.

 I think the problem comes from `org-todo-keywords-1'. Its value is
 probably not updated during export.

Yes, I guess so.
But it worked during *synchronous* export, even when I put
#+TODO: XeTeX
in a common option-template file, which is then included by #+SETUPFILE
in many org files. 



 Regards,




Re: [O] Feature Request. org-bibtex-tags-are-keywords inherit tags

2014-04-19 Thread Bastien
Hi Leonard,

Leonard Randall leonard.a.rand...@gmail.com writes:

 Thanks for applying this and for being so diligent in keeping org
 great. I have requested the fsf agreement and will sign it when it
 comes. One additional minor issue I noticed is that in the docstring
 for the function `org-bibtex', it reads, `org-bibtex-export-headline'
 where it should read `org-bibtex-headline'.

Fixed, thanks.

-- 
 Bastien



Re: [O] Bug: Error with org-bibtex export with tags when using custom bibtypes [8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emacs.d/elpa/org-plus-contrib-20140324/)]

2014-04-19 Thread Bastien
Hi Leonard,

Leonard Randall leonard.a.rand...@gmail.com writes:

 I figured out how to fix the bug i reported awhile ago. The problem
 was that when making the keyword field for entries without keywords
 defined in the `:PROPERTIES:' drawer,  org-bibtex uses
 `bibtex-make-field' from `bibtex.el'. This function sends up an error
 if there are no fields defined for the type of bib entry you are
 calling it on.

I fixed this by ignoring the error, since the field is inserted
anyway.

Thanks for reporting this and the suggested fix!

-- 
 Bastien



Re: [O] Maintainer change on May 1st

2014-04-19 Thread Takaaki ISHIKAWA
+1

Apr 19, 2014 6:33 PM、Bastien b...@gnu.org のメール:

 Hi Carsten,
 
 now that I'm down the pile of email I was late on, let me say I'm
 glad to be officially back -- it was a great relief to be able to
 not be in charge for a year, it helped me to step back and do a lot
 of other things.
 
 So thanks for the switch one year earlier, and for this one!
 
 Let's keep Org awesome all together.
 
 -- 
 Bastien, who sounds a bit like a cheerleader now
 




Re: [O] sharing my firsts, org babel tangle and init .org file

2014-04-19 Thread Charles Berry
Pete Ley peteley11235 at gmail.com writes:

 
 I've looked at the solution on worg and, though I didn't actually try to
 implement, it seems like tangling your init file every time you open
 Emacs is a little cumbersome. Please correct me if I'm wrong in this
 assumption. 


OK, here goes:

In `org-babel-load-file' the code following the comment

;; tangle if the org-mode file is newer than the elisp file

appears to only re-tangle the .el file iff it is older than the .org file

HTH,

Chuck




Re: [O] Bug: Error with org-bibtex export with tags when using custom bibtypes [8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emacs.d/elpa/org-plus-contrib-20140324/)]

2014-04-19 Thread Leonard Randall
Hi Bastien,

Bastien b...@altern.org wrote:

 I fixed this by ignoring the error, since the field is inserted
 anyway.

For some reason ignoring errors doesn't work for me. The new function,
doesn't add a keywords field to non-standard bib entry types, it just puts
the tags before the beginning of the bibtex entry, which would mess up the
resulting bibtex file.

The regexp functions I used are based on standard bibtex syntax, so they
should work in all circumstances. I tested my fix under various conditions
and with various variables set and it worked everywhere I tried it.

If you are worried about licensing, you could wait  to apply the patch
until I receive and sign the license, but I think that it is a sufficiently
small change that it should not be an issue.

All best,

Leonard


Re: [O] Bug: Error with org-bibtex export with tags when using custom bibtypes [8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /Users/leonardaveryrandall/.emacs.d/elpa/org-plus-contrib-20140324/)]

2014-04-19 Thread Bastien
Hi Leonard,

Leonard Randall leonard.a.rand...@gmail.com writes:

 For some reason ignoring errors doesn't work for me. The new
 function, doesn't add a keywords field to non-standard bib entry
 types, it just puts the tags before the beginning of the bibtex
 entry, which would mess up the resulting bibtex file.

Can you provide a minimal example where I reproduce this bug,
along with your Emacs and Org versions?  It works fine here.

 The regexp functions I used are based on standard bibtex syntax, so
 they should work in all circumstances. I tested my fix under various
 conditions and with various variables set and it worked everywhere I
 tried it.

I trust you on that, it's just that using re-search-forward here
does not seem necessary -- also, you could send an email to the
bibtex.el maintainers about the error being cryptic anyway, and
maybe not needed at all.

 If you are worried about licensing, you could wait  to apply the
 patch until I receive and sign the license, but I think that it is a
 sufficiently small change that it should not be an issue.

I'd rather wait till the paperwork is done, it gives us more time
to sort this out properly.

Thanks again,

-- 
 Bastien



Re: [O] how to stop the mouse pointer highlighting in agenda?

2014-04-19 Thread Samuel Wales
thank you both!

(add-hook 'org-finalize-agenda-hook
  (lambda ()
(set (make-local-variable 'tooltip-delay) 86400)
;; disable the face that comes up when mouse pointer
;; is over an org agenda line.  that can be confusing
;; because i already have a highlight face for point.
(remove-text-properties
 (point-min) (point-max) '(mouse-face t



Re: [O] Embedding an image in base64; exporting to ascii, html, and latex?

2014-04-19 Thread John Kitchin
I wrote some code that does some of this here:
http://kitchingroup.cheme.cmu.edu/blog/2014/03/05/Creating-a-transportable-zip-archive-of-an-org-file/

It doesn't do anything fancy like you describe, but it does get images and
files into the zip file.

John

---
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Fri, Apr 18, 2014 at 9:27 AM, Skip Collins skip.coll...@gmail.comwrote:

 On Thu, Apr 17, 2014 at 2:49 PM, Bastien b...@gnu.org wrote:
  How would that be different that zipping org files along with pictures
  and related needed content?

 Not different at all. Integrating the zipping into org-mode itself
 could standardize the process and make it more
 repeatable, portable, and convenient. Microsoft Word .docx files have
 something like this structure inside:
 .
 ├── [Content_Types].xml
 ├── _rels
 ├── docProps
 │   ├── app.xml
 │   ├── core.xml
 │   └── thumbnail.jpeg
 └── word
 ├── _rels
 │   └── document.xml.rels
 ├── document.xml
 ├── fontTable.xml
 ├── media
 │   └── image1.png
 ├── settings.xml
 ├── styles.xml
 ├── stylesWithEffects.xml
 ├── theme
 │   └── theme1.xml
 └── webSettings.xml

 An analogous structure inside a filename.orgz container might be
 useful. Perhaps something like:
 .
 ├── orgmain.org
 ├── config.org
 ├── media
 │   └── image1.png
 ├── elisp
 │   ├── init.el
 │   └── myorgmacros.el
 ├── babel
 └── export
 ├── styles
 └── output
 ├── orgmain.pdf
 └── orgmain.html

 A little elisp wizardry could ensure that invoking
 emacs filename.orgz
 would actually open and edit orgmain.org inside filename.orgz.

 Much of the tree structure could be optional, only included when
 certain features are used. Obviously, it would be necessary to put
 exported files outside of the .orgz file. But optionally including a
 copy inside could be useful. More important would be the inclusion of
 all non-standard input files needed to generate the output, things
 like images, elisp files, latex and html style files, etc. Maybe even
 a copy of the Emacs initialization file used when saving the container
 file. Finally, a standardized format for config.org would include
 things like Emacs version, Org version, creation date, modification
 date, a list of manually included files, etc.




Re: [O] babel and long-running computations

2014-04-19 Thread Christoph Groth
Thank you, John, for your detailed reply.

 we routinely do this, in the following way. We run jobs that may take
 up to a week to finish, and they are usually run on a cluster. Our
 setup relies on the following behavior for a script.

 1. you can run the script anytime you want, and it can tell the state
 of the calculation by some means. If the script has never been run
 before, it submits the job to a queue and exits. If the job is still
 in the queue, it exits, and if the job is done, it gives you the
 result.

Returning immediately with whatever state the long-running computation
is in currently seems indeed to be a good solution.  I think I will
setup something similar.  Would you share your experience on the
following issues?

- How do you interface such jobs from orgmode?  With org-babel, do
  you execute Python code, or do you run shell commands?

- Do you run your Emacs on the master node of the cluster?  Or does your
  setup involve running emacs on the machine you are working on and
  talking to the cluster over the network?

Cheers,
Christoph




Re: [O] Bug: text jumps left and right while typing math when org-indent-mode and linum-mode are enabled. [8.2.5h (8.2.5h-98-g0820d0-elpa @ /Users/kosta/.emacs.d/elpa/org-20140407/)]

2014-04-19 Thread Konstantin Kliakhandler
Thanks!


On Sat, Apr 19, 2014 at 3:06 PM, Bastien b...@gnu.org wrote:

 Hi Konstantin,

 Konstantin Kliakhandler ko...@slumpy.org writes:

  I've discovered a bug that hinders typing when org-indent-mode and
  linum-mode are both enabled.

 Yes, I see this glitch too, and I confirm disabling linum-mode
 when org-indent-mode is the thing to do... unless someone gets
 really annoyed by this and wants to fix it.

 --
  Bastien



Re: [O] How do I chain babel blocks with arguments?

2014-04-19 Thread Eric Schulte
 --8---cut here---start-8---
 #+name: z
 : bar
 #+name: test3
 #+begin_src emacs-lisp :var x=foo
 x
 #+end_src

 #+name:test4
 #+begin_src emacs-lisp :var y=test1(x=z)
 y
 #+end_src

 #+results: test4
 : bar

 #+call: test4(z=BAZ)
^
The above line has an error, your z should be an x.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] sharing my firsts, org babel tangle and init .org file

2014-04-19 Thread Eric Schulte
Bastien b...@gnu.org writes:

 Brady Trainor algeb...@uw.edu writes:

 Have you migrated your init files into .org file(s)? What's your
 setup?

 I do, and find it very convenient.

 My setup is here: http://bzg.fr/emacs.html

My setup is available here.

https://github.com/eschulte/emacs24-starter-kit

It is designed to be a good starting point for personalized configs.

Also, as Chuck mentioned, tangling does *not* take place every time
Emacs starts, only when the .org file is newer than the .el file.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



[O] org capture contexts not working?

2014-04-19 Thread Eric Abrahamsen
I've got this for three capture templates that should only work in Gnus:

(setq org-capture-templates-contexts
  '((M ((in-mode . gnus-\\(summary\\|article\\
(P ((in-mode . gnus-\\(summary\\|article\\
(H ((in-mode . gnus-\\(summary\\|article\\))

This worked for quite some time, but when I went back to use it again
today I found that these templates aren't filtered out in non-Gnus
settings. I tried stepping through the code of
`org-contextualize-validate-key' and think I've found the problem,
though I'll confess to a little confusion.

When that function checks the predicates (in-mode, not-in-file, etc), it
has this chunk for handling the not-in-file bit:

(if (and (eq (car rr) 'not-in-file)
 (buffer-file-name))
(not (string-match (cdr rr) (buffer-file-name)))
  t)

This was slightly mis-aligned in the source file, leading me to believe
it's just a nesting error. As it is, any template which *isn't using*
the not-in-file predicate is going to flag as acceptable for the current
context. I think it should just be:

(when (and (eq (car rr) 'not-in-file)
   (buffer-file-name))
  (not (string-match (cdr rr) (buffer-file-name

Testing indicates it works, am I missing anything? Pickaxe search for
the string not-in-file in git says the last relevant commit was two
years ago, so who knows what's going on...

Eric