[O] LaTeX preview
Hi, Is there an #+STARTUP parameter to automatically display LaTeX fragments? If not, where do I have to look to add it? -- Daimrod/Greg pgpwOUfDZhYGv.pgp Description: PGP signature
Re: [O] LaTeX preview
Bastien writes: > Hi Daimrod, > > Daimrod writes: > >> Is there an #+STARTUP parameter to automatically display LaTeX >> fragments? > > Nope, sorry. Here is a patch to add `org-startup-with-latex-preview'. It should work like `org-startup-with-inline-images'. diff --git a/doc/org.texi b/doc/org.texi index 030eaf8..a13d565 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -9752,6 +9752,19 @@ some aspects of the preview. In particular, the @code{:scale} (and for HTML export, @code{:html-scale}) property can be used to adjust the size of the preview images. +@vindex org-startup-with-latex-preview +You can turn on the previewing of all @LaTeX{} fragments of a file with + +@example +#+STARTUP: latexpreview +@end example + +To disable it, simply use + +@example +#+STARTUP: nolatexpreview +@end example + @node CDLaTeX mode, , Previewing @LaTeX{} fragments, Embedded @LaTeX{} @subsection Using CD@LaTeX{} to enter math @cindex CD@LaTeX{} diff --git a/lisp/org.el b/lisp/org.el index effb231..2e7f3a4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -580,6 +580,16 @@ the following lines anywhere in the buffer: :version "24.1" :type 'boolean) +(defcustom org-startup-with-latex-preview nil + "Non-nil means preview LaTeX fragments when loading a new Org file. + +This can also be configured on a per-file basis by adding one of +the followinglines anywhere in the buffer: + #+STARTUP: latexpreview + #+STARTUP: nolatexpreview" + :group 'org-startup + :type 'boolean) + (defcustom org-insert-mode-line-in-empty-file nil "Non-nil means insert the first line setting Org-mode in empty files. When the function `org-mode' is called interactively in an empty file, this @@ -4509,6 +4519,8 @@ After a match, the following groups carry important information: ("noalign" org-startup-align-all-tables nil) ("inlineimages" org-startup-with-inline-images t) ("noinlineimages" org-startup-with-inline-images nil) +("latexpreview" org-startup-with-latex-preview t) +("nolatexpreview" org-startup-with-latex-preview nil) ("customtime" org-display-custom-times t) ("logdone" org-log-done time) ("lognotedone" org-log-done note) @@ -5154,6 +5166,8 @@ The following commands are available: (set-buffer-modified-p bmp))) (when org-startup-with-inline-images (org-display-inline-images)) +(when org-startup-with-latex-preview + (org-preview-latex-fragment)) (when org-startup-indented (require 'org-indent) (org-indent-mode 1)) -- Daimrod/Greg pgpgs1Ek3Eswb.pgp Description: PGP signature
Re: [O] LaTeX preview
Bastien writes: > Hi, > > Daimrod writes: > >> Here is a patch to add `org-startup-with-latex-preview'. It should work >> like `org-startup-with-inline-images'. > > Thanks for the patch. Did you already sign a FSF copyright assignment > or do you plan to sign one? > > http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt > > I cannot apply/accept the patch otherwise :( > > Thanks, I've sent a request. I will tell you when it's done, I hope this won't take too much time. -- Daimrod/Greg pgpKi4EPvKFx2.pgp Description: PGP signature
Re: [O] OBBDB(3) or org-contacts
Russell Adams writes: >> I am a confirmed gnus user. No other email system comes close to >> doing what gnus can do. Given the large volume of email I get, >> splitting and scoring are essential to survival! Integration with >> bbdb is also obviously key for me. > > Slightly offtopic, but I'm a Mutt user that's eyeballed Gnus from a > distance for years. Could you elaborate on some of your favorite Gnus > features? He named it, splitting and scoring. The ability to easily mark a whole thread as important or unimportant combined with expunged is (imo) essential to manage large volume of email. The expunge facility let me hide threads; when a message is expunged it is not only marked as read, it just doesn't appear at all unless I specifically ask otherwise. OTOH when the score of a thread is increased, all messages in this thread (old and new) will appear in bold. -- Daimrod/Greg pgp3UwPkLdLKl.pgp Description: PGP signature
Re: [O] Redmine backend for org-sync
Sean Lynch writes: > As far as I've seen the Redmine backend for org-sync is > incomplete. Depending on what needs to be done to get this working, I > might have the time to work on it. > > Is it well defined what needs to be done to get this in a more usable > state? If so, let me know and I'll see if I can help. > > -Sean I'm not very familiar (yet) with Org Sync and you'll need to ask Aurelien (the author) for the redmine backend, but if you plan to work on Org Sync you might consider to use my git repository[1]. I've merged the forks that I've found on github which added some improvements, like org-element and multi-bytes support. I've also renamed the function to use a fully qualified name, that is `org-sync-' instead of `os-'. I've done some fixes in the README, improve the formatting in comments. I've also started to add a test suite -- using ERT -- while I was exploring the code. It's far from complete but I plan to work on it. I mostly use github, so it's most likely that I'll focus on its backend. [1] https://github.com/daimrod/org-sync -- Daimrod/Greg pgpw4e0I0KBkV.pgp Description: PGP signature
Re: [O] Wish: switch active time-stamps to inactive when CANCELED
Karl Voit writes: > Hi! Hi, > I tend to keep events that I do not attend in my calendar for > archiving reasons. But I switch their status to CANCELED. > Unfortunately, those events still appear on my Google calendar and > so forth. I get my usual reminders and it messes up my free/busy > list. > > Therefore, I am thinking that canceled events should turn their > active time-stamps into inactive with an Org-mode option. This way, > I can recall them in my agenda by typing ']' (show inactive > time-stamps) but they do not interfere with my daily workflow. > > What do you think of such an option for Org-mode? Org Mode has already facilities for archiving. You can either tag a headline and its children with the `archive' tag (bound to C-c C-x a) or archive a headline and its children in a separated file (bound to C-c $). In both cases they won't be displayed in the Agenda unless you active them (v a or v A). See (info "(org) Archiving") for a complete description of Archiving in Org Mode. -- Daimrod/Greg pgp5OycYv2Vpc.pgp Description: PGP signature
Re: [O] Wish: switch active time-stamps to inactive when CANCELED
Karl Voit writes: > * Daimrod wrote: >> >> Org Mode has already facilities for archiving. > > Thanks for the pointer but I know and I am using archiving in > Org-mode. > >> In both cases they won't be displayed in the Agenda unless you active >> them (v a or v A). > > Right. > > But in my workflow, I only archive whole projects when they are > finished completely. For multiple reasons, I don't want to separate > single events from the projects upfront. Why doesn't the method with :ARCHIVE: tag fit your needs? You can mark a subtree to ignore it. This way you keep the whole project as a whole. > I should have mentioned that in my first post, yes. -- Daimrod/Greg pgpfWUp13covR.pgp Description: PGP signature
Re: [O] Wish: switch active time-stamps to inactive when CANCELED
Viktor Rosenfeld writes: > Hi, > > Karl Voit wrote: > >> But still: there are two steps I have to make: (a) mark as canceled >> because I want this "CANCELED" string attached and (b) add the >> ARCHIVE tag. > > You can set the ARCHIVE tag when switching the TODO state automatically > using org-todo-state-tags-triggers. > > For example (untestet): > > #+BEGIN_SRC emacs-lisp > (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t > #+END_SRC Woo, I didn't know this one, that's a nice trick! > Cheers, > Viktor -- Daimrod/Greg pgpLSJRGGZZRc.pgp Description: PGP signature
Re: [O] colorg: Some news!
François Pinard writes: > Hi to all my Org friends. Hi, > ColOrg is a project about real-time collaborative editing of Org files. > Here are some news about its progress, after a second push this > weekend. It is not usable yet, but a few more steps have been taken. A > few more ropes are needed to tie it up all together, but not much. > > Some details follow. > > The ColOrg client (on the Emacs side) acquired code for processing all > commands coming from a ColOrg server. This includes per-collaborator > colorization of recently inserted text, and notification windows for > transient diagnostics. To be usable, the client still misses the > association between local buffers and remote resource numbers, so > modifications go where they were meant. The client should also ask the > server to build completions for existing users or resources. > > The ColOrg server (on the Python side) requires more work. The protocol > has been solidified a bit, but needs some love in the area of returned > values. The problem of proper command rewriting is now better analyzed, > it looks simpler, but still has to be programmed. I decided for a naive > approach, and by postponed optimization issues, all dark corners have > been lit, none remain so far that I know. > > The Wiki also got some more text. See https://github.com/pinard/ColOrg. That's a really cool project! Do you plan to keep the server in Python? Or do you think it would be possible to make this in Emacs Lisp only with Elnode[1] for the server-side? > François [1] http://elnode.org/ -- Daimrod/Greg pgpOL4G5oMPlo.pgp Description: PGP signature
Re: [O] colorg: Some news!
François Pinard writes: > Once we get a working solution, the protocol remains the contact point. > The server could be replaced using other languages, and new clients may > be written for other editors (given they are extensible enough). My > goal is quickly getting something usable, so I selected the means that > looked fastest to me, and that's how Python got in the picture. > > Is there any incentive for rewriting the server in Emacs Lisp? For one, > even if rather bearable, Emacs Lisp is not my preferred programming > language. Moreover, I consider a bit wrong having to rely on an editor > for tasks wholly unrelated to editing. Other people are free to have > differing opinions, and do that rewrite, however. It's not unlreated to editing, it's for collaborative editing! :) Anyway, I understand and respect your point of view. Moreover, it's nice of you to report on the mailing list, it helps to keep on eye. > If I really had more time and less pressure, I would likely have > selected Node (JavaScript) to write the server instead of Python. The > choice of JSON within the ColOrg communication protocol is a way, for > me, to leave that door opened. One not so hidden dream is to bring Org > mode a bit closer to Web browsers, if there are ways to do so. -- Daimrod/Greg pgpEc4gg27uJw.pgp Description: PGP signature
[O] #+PROPERTY documentation
Hi, It would be nice if the documentation mentioned the need to reparse the org buffer with `C-c C-c' when a property is set with #+PROPERTY. (info "(org) Property syntax") And, IMO, it should also be mentioned here: (info "(org) Buffer-wide header arguments"). A simple footnote like the one present here: (info "(org) Tag inheritance") should be sufficient. > (1) As with all these in-buffer settings, pressing `C-c C-c' > activates any changes in the line. -- Daimrod/Greg pgplZQR3DFgvj.pgp Description: PGP signature
Re: [O] #+PROPERTY documentation
John Hendy writes: > On Mon, Jan 21, 2013 at 12:41 PM, Daimrod wrote: >> Hi, >> >> It would be nice if the documentation mentioned the need to reparse the >> org buffer with `C-c C-c' when a property is set with #+PROPERTY. >> (info "(org) Property syntax") > > As in adding to the header arguments? Yeah, probably wouldn't hurt, > though it is, as stated below, documented that *any* change to the > header arguments requires C-c C-c. > > On a side note, is there the possibility for "normal" users to submit > git based changes to the manual? I know how to do this for Worg, but > I'd be happy to update stuff in the manual, too, when I catch them. > These sorts of things could be tweaked by the finder and it would save > the maintenance team a bit -- just scan the commit and notes for > rationale and accept. Sure, one can modify the file doc/org.texi. And you're right, I should have submit a patch. > John > >> >> And, IMO, it should also be mentioned here: >> (info "(org) Buffer-wide header arguments"). >> >> A simple footnote like the one present here: >> (info "(org) Tag inheritance") should be sufficient. >> >>> (1) As with all these in-buffer settings, pressing `C-c C-c' >>> activates any changes in the line. >> >> -- >> Daimrod/Greg -- Daimrod/Greg pgpQh8xnK3Ubb.pgp Description: PGP signature
Re: [O] #+PROPERTY documentation
Daimrod writes: > John Hendy writes: > >> On Mon, Jan 21, 2013 at 12:41 PM, Daimrod wrote: >>> Hi, >>> >>> It would be nice if the documentation mentioned the need to reparse the >>> org buffer with `C-c C-c' when a property is set with #+PROPERTY. >>> (info "(org) Property syntax") >> >> As in adding to the header arguments? Yeah, probably wouldn't hurt, >> though it is, as stated below, documented that *any* change to the >> header arguments requires C-c C-c. >> >> On a side note, is there the possibility for "normal" users to submit >> git based changes to the manual? I know how to do this for Worg, but >> I'd be happy to update stuff in the manual, too, when I catch them. >> These sorts of things could be tweaked by the finder and it would save >> the maintenance team a bit -- just scan the commit and notes for >> rationale and accept. > > Sure, one can modify the file doc/org.texi. And you're right, I should > have submit a patch. > >> John >> >>> >>> And, IMO, it should also be mentioned here: >>> (info "(org) Buffer-wide header arguments"). >>> >>> A simple footnote like the one present here: >>> (info "(org) Tag inheritance") should be sufficient. >>> >>>> (1) As with all these in-buffer settings, pressing `C-c C-c' >>>> activates any changes in the line. >>> So, here is a patch for this: From 09e569a651e77e8f2c1c2d1f0a285c69688fbd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Mon, 21 Jan 2013 23:45:47 +0100 Subject: [PATCH] add footnote to recall the user to refresh the org buffer when settings are changed. --- doc/org.texi |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 61f1ee5..c2bdd58 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4954,7 +4954,9 @@ publishers and the number of disks in a box like this: @end example If you want to set properties that can be inherited by any entry in a -file, use a line like +file, use a line like@footnote{As +with all these in-buffer settings, pressing @kbd{C-c C-c} activates any +changes in the line.} @cindex property, _ALL @cindex #+PROPERTY @example @@ -13252,7 +13254,9 @@ of @code{#+PROPERTY:} lines placed anywhere in an Org mode file (see For example the following would set @code{session} to @code{*R*}, and @code{results} to @code{silent} for every code block in the buffer, ensuring that all execution took place in the same session, and no results would be -inserted into the buffer. +inserted into the buffer.@footnote{As +with all these in-buffer settings, pressing @kbd{C-c C-c} activates any +changes in the line.} @example #+PROPERTY: session *R* -- 1.7.10.4 -- Daimrod/Greg pgp6BspWNmlxz.pgp Description: PGP signature
Re: [O] #+PROPERTY documentation
t...@tsdye.com (Thomas S. Dye) writes: > Aloha Daimrod (Greg), > > Daimrod writes: > >> >> So, here is a patch for this: > > If you add [PATCH] to the email Subject, your patch will be brought to > the attention of the developers. I didn't know, thanks. > All the best, > Tom -- Daimrod/Greg pgpRUIidjPMtV.pgp Description: PGP signature
[O] [PATCH] Re: #+PROPERTY documentation
Daimrod writes: > Hi, > > It would be nice if the documentation mentioned the need to reparse the > org buffer with `C-c C-c' when a property is set with #+PROPERTY. > (info "(org) Property syntax") > > And, IMO, it should also be mentioned here: > (info "(org) Buffer-wide header arguments"). > > A simple footnote like the one present here: > (info "(org) Tag inheritance") should be sufficient. > >> (1) As with all these in-buffer settings, pressing `C-c C-c' >> activates any changes in the line. Here is a patch for this: From 09e569a651e77e8f2c1c2d1f0a285c69688fbd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Mon, 21 Jan 2013 23:45:47 +0100 Subject: [PATCH] add footnote to recall the user to refresh the org buffer when settings are changed. --- doc/org.texi |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 61f1ee5..c2bdd58 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4954,7 +4954,9 @@ publishers and the number of disks in a box like this: @end example If you want to set properties that can be inherited by any entry in a -file, use a line like +file, use a line like@footnote{As +with all these in-buffer settings, pressing @kbd{C-c C-c} activates any +changes in the line.} @cindex property, _ALL @cindex #+PROPERTY @example @@ -13252,7 +13254,9 @@ of @code{#+PROPERTY:} lines placed anywhere in an Org mode file (see For example the following would set @code{session} to @code{*R*}, and @code{results} to @code{silent} for every code block in the buffer, ensuring that all execution took place in the same session, and no results would be -inserted into the buffer. +inserted into the buffer.@footnote{As +with all these in-buffer settings, pressing @kbd{C-c C-c} activates any +changes in the line.} @example #+PROPERTY: session *R* -- 1.7.10.4 -- Daimrod/Greg pgp3DZz0hzsT0.pgp Description: PGP signature
Re: [O] #+PROPERTY documentation
Nick Dokos writes: > Daimrod wrote: > >> John Hendy writes: >> >> > On Mon, Jan 21, 2013 at 12:41 PM, Daimrod wrote: >> >> Hi, >> >> >> >> It would be nice if the documentation mentioned the need to reparse the >> >> org buffer with `C-c C-c' when a property is set with #+PROPERTY. >> >> (info "(org) Property syntax") >> > >> > As in adding to the header arguments? Yeah, probably wouldn't hurt, >> > though it is, as stated below, documented that *any* change to the >> > header arguments requires C-c C-c. >> > >> > On a side note, is there the possibility for "normal" users to submit >> > git based changes to the manual? I know how to do this for Worg, but >> > I'd be happy to update stuff in the manual, too, when I catch them. >> > These sorts of things could be tweaked by the finder and it would save >> > the maintenance team a bit -- just scan the commit and notes for >> > rationale and accept. >> >> Sure, one can modify the file doc/org.texi. And you're right, I should >> have submit a patch. >> > > I believe that just as with code changes, doc changes also need FSF > copyright assignment. Ok, I've already sent an assignment request for another patch and it should be confirmed by the end of the week. > Nick -- Daimrod/Greg pgpKUC7Fa73Fv.pgp Description: PGP signature
Re: [O] [PATCH] Re: #+PROPERTY documentation
Bastien writes: > Daimrod writes: > >> Here is a patch for this: > > Thanks. Please add a proper ChangeLog to it. > > See http://orgmode.org/worg/org-contribute.html#sec-5 Thanks. > You also need to add TINYCHANGE at the bottom of the > git commit message. > > Thanks for your efforts! Is it better? I'll also reformat my other patches. From 4c71f10ecfdd8e44642cb18d27fe42a9b17fe1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Mon, 21 Jan 2013 23:45:47 +0100 Subject: [PATCH] Documentation: Add footnotes to recall the user to refresh the org buffer when settings are changed * doc/org.texi: Add a footnote to the following sections: - (info "(org) Property syntax") - (info "(org) Buffer-wide header arguments") TINYCHANGE --- doc/org.texi |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 61f1ee5..c2bdd58 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4954,7 +4954,9 @@ publishers and the number of disks in a box like this: @end example If you want to set properties that can be inherited by any entry in a -file, use a line like +file, use a line like@footnote{As +with all these in-buffer settings, pressing @kbd{C-c C-c} activates any +changes in the line.} @cindex property, _ALL @cindex #+PROPERTY @example @@ -13252,7 +13254,9 @@ of @code{#+PROPERTY:} lines placed anywhere in an Org mode file (see For example the following would set @code{session} to @code{*R*}, and @code{results} to @code{silent} for every code block in the buffer, ensuring that all execution took place in the same session, and no results would be -inserted into the buffer. +inserted into the buffer.@footnote{As +with all these in-buffer settings, pressing @kbd{C-c C-c} activates any +changes in the line.} @example #+PROPERTY: session *R* -- 1.7.10.4 -- Daimrod/Greg pgp9K8GOyUhnU.pgp Description: PGP signature
Re: [O] [PATCH] Re: #+PROPERTY documentation
Bastien writes: > Yes, close to perfect. As noted in the link I gave, you need to use > `C-x 4 a' in the section of the manual you changed in order to create > a proper ChangeLog. It's weird, `C-x 4 a' wasn't able to determine correctly the sections changed. :/ > In your case, the ChangeLog should start like this: > > * org.texi (Property syntax, Buffer-wide header arguments): > > Also, please add only one such footnote. Having twice the same > footnote is confusing for the readers -- if they remember "there > is a footnote for this..." they will not be able to remember if > it was the first or the second one. Choose the one that is the > most important -- given that the information is already available > in another section. You're right. I've replaced the footnote by a paragraph in (info "(org) Property syntax") because this footnote was already present elsewhere, and removed the footnote in (info "(org) Buffer-wide header arguments") because there is a link to (info "(org) Property syntax"). Here is (I hope) the final patch :) From be60dcba66d24d84986ea2650c2ef6ad96d29c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Thu, 24 Jan 2013 13:04:11 +0100 Subject: [PATCH] Update documentation of buffer-wide properties * doc/org.texi (Property syntax): Recall the user to refresh the org buffer when properties are set on a per-file basis. TINYCHANGE --- doc/org.texi |3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/org.texi b/doc/org.texi index 61f1ee5..6447f9c 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4961,6 +4961,9 @@ file, use a line like #+PROPERTY: NDisks_ALL 1 2 3 4 @end example +Contrary to properties set from a special drawer, you have to refresh the +buffer with @kbd{C-c C-c} to activate this changes. + If you want to add to the value of an existing property, append a @code{+} to the property name. The following results in the property @code{var} having the value ``foo=1 bar=2''. -- 1.7.10.4 -- Daimrod/Greg pgp__Xs3Q56S5.pgp Description: PGP signature
Re: [O] LaTeX preview
Daimrod writes: > Bastien writes: > >> Hi Daimrod, >> >> Daimrod writes: >> >>> Is there an #+STARTUP parameter to automatically display LaTeX >>> fragments? >> >> Nope, sorry. > > Here is a patch to add `org-startup-with-latex-preview'. It should work > like `org-startup-with-inline-images'. Here is a better formatted patch: From 63cd29b1d5b0c5758870a14ac3257e69d4560925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Thu, 24 Jan 2013 14:02:00 +0100 Subject: [PATCH] Add a new startup keyword to preview LaTeX fragments * doc/org.texi (Previewing @LaTeX{} fragments): Document the startup keywords which can be used to preview or not LaTeX fragments. (Summary of in-buffer settings): Improve formatting and add an entry for the variable `org-startup-with-latex-preview'. * org.el (org-mode, org-startup-options, org-startup-with-inline-images): Add the variable `org-startup-with-latex-preview' which can be used to preview LaTeX fragments on startup. This variable is set to `nil' by default. --- doc/org.texi | 32 lisp/org.el | 14 ++ 2 files changed, 46 insertions(+) diff --git a/doc/org.texi b/doc/org.texi index 37c7ac5..43a89ca 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -9758,6 +9758,19 @@ some aspects of the preview. In particular, the @code{:scale} (and for HTML export, @code{:html-scale}) property can be used to adjust the size of the preview images. +@vindex org-startup-with-latex-preview +You can turn on the previewing of all @LaTeX{} fragments in a file with + +@example +#+STARTUP: latexpreview +@end example + +To disable it, simply use + +@example +#+STARTUP: nolatexpreview +@end example + @node CDLaTeX mode, , Previewing @LaTeX{} fragments, Embedded @LaTeX{} @subsection Using CD@LaTeX{} to enter math @cindex CD@LaTeX{} @@ -14955,6 +14968,18 @@ inlineimages @r{show inline images} noinlineimages @r{don't show inline images on startup} @end example +@vindex org-startup-with-latex-preview +When visiting a file, @LaTeX{} fragments can be converted to images +automatically. The variable @code{org-startup-with-latex-preview} which +controls this behavior, is set to @code{nil} by default to avoid delays on +startup. +@cindex @code{latexpreview}, STARTUP keyword +@cindex @code{nolatexpreview}, STARTUP keyword +@example +latexpreview @r{preview @LaTeX{} fragments} +nolatexpreview @r{don't preview @LaTeX{} fragments} +@end example + @vindex org-log-done @vindex org-log-note-clock-out @vindex org-log-repeat @@ -15005,6 +15030,7 @@ nologdrawer @r{store log outside of drawer} logstatesreversed @r{reverse the order of states notes} nologstatesreversed @r{do not reverse the order of states notes} @end example + @vindex org-hide-leading-stars @vindex org-odd-levels-only Here are the options for hiding leading stars in outline headings, and for @@ -15023,6 +15049,7 @@ noindent @r{no virtual indentation according to outline level} odd@r{allow only odd outline levels (1,3,...)} oddeven@r{allow all outline levels} @end example + @vindex org-put-time-stamp-overlays @vindex org-time-stamp-overlay-formats To turn on custom format overlays over timestamps (variables @@ -15032,6 +15059,7 @@ To turn on custom format overlays over timestamps (variables @example customtime @r{overlay custom time format} @end example + @vindex constants-unit-system The following options influence the table spreadsheet (variable @code{constants-unit-system}). @@ -15041,6 +15069,7 @@ The following options influence the table spreadsheet (variable constcgs @r{@file{constants.el} should use the c-g-s unit system} constSI@r{@file{constants.el} should use the SI unit system} @end example + @vindex org-footnote-define-inline @vindex org-footnote-auto-label @vindex org-footnote-auto-adjust @@ -15067,6 +15096,7 @@ fnplain @r{create @code{[1]}-like labels automatically} fnadjust@r{automatically renumber and sort footnotes} nofnadjust @r{do not renumber and sort automatically} @end example + @cindex org-hide-block-startup To hide blocks on startup, use these keywords. The corresponding variable is @code{org-hide-block-startup}. @@ -15076,6 +15106,7 @@ To hide blocks on startup, use these keywords. The corresponding variable is hideblocks @r{Hide all begin/end blocks on startup} nohideblocks @r{Do not hide blocks on startup} @end example + @cindex org-pretty-entities The display of entities as UTF-8 characters is governed by the variable @code{org-pretty-entities} and the keywords @@ -15085,6 +15116,7 @@ The display of entities as UTF-8 characters is governed by the variable entitiespretty @r{Show entities as UTF-8 characters where possible} entitiesplain @r{Leave entities plain} @end example + @item #+TAGS: TAG1(c1) TAG2(c2) @vindex org-tag-alist These
Re: [O] [OT] open url in emacs was: Re: Using Org/babel for Emacs config files
Andreas Leha writes: > Kyle Machulis writes: >> https://raw.github.com/eschulte/emacs24-starter-kit/master/starter-kit.org > Apologies for hijacking this thread. But could someone tell me how to > open that link directly in emacs? My try with 'browse-url-emacs' > failed. You can use Emacs-w3m[1] to browse the web from Emacs. BTW, I've made functions to browse and copy URL in Emacs[2][3]. - `C-c b' to browse the URL at point - `C-c y' to copy the URL at point You can customize which browser is used to browse an URL with `gu-first-browse-url-function' and `gu-second-browse-url-function' (by default it uses `browse-url-browser-function' and `browse-url-generic'). The first one is used by default, the second one when you use a prefix (`C-u C-c b'). [1] http://emacs-w3m.namazu.org/ [2] https://github.com/daimrod/Emacs-config/blob/master/elisp/graze-url.el [3] https://github.com/daimrod/Emacs-config/blob/master/config-bindings.el#L73 -- Daimrod/Greg pgpFNhLmPkczU.pgp Description: PGP signature
[O] org-babel-execute-src-block deletes its src block.
Hi, I've recently switched from Org 7.4 to the master branch on the git repository, and I've encountered this weird situation. #+name: foo #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp If I evaluate this block I get: #+name: foo =42 =emacs-lisp Though it works as expected if I remove the name: #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp => #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp #+RESULTS: : 42 I've tried to figure out what was the problem and it lies in the regexp org-babel-src-name-w-name-regexp. So far I've found those workarounds: No spaces after the ':' #+name:foo #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp => #+name:foo #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp #+RESULTS: foo : 42 Add parentheses after the name. #+name: foo() #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp => #+name: foo() #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp #+RESULTS: foo : 42 No spaces before the src block #+name: foo #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp => #+name: foo #+begin_src emacs-lisp (defun foo () 42) (foo) #+end_src emacs-lisp #+RESULTS: foo : 42
Re: [O] org-babel-execute-src-block deletes its src block.
Nick Dokos writes: > Daimrod wrote: > >> >> Hi, I've recently switched from Org 7.4 to the master branch on the git >> repository, and I've encountered this weird situation. >> >> #+name: foo >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> >> If I evaluate this block I get: >> >> #+name: foo >> =42 >> =emacs-lisp >> >> Though it works as expected if I remove the name: >> >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> => >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> >> #+RESULTS: >> : 42 >> >> I've tried to figure out what was the problem and it lies in the regexp >> org-babel-src-name-w-name-regexp. >> >> So far I've found those workarounds: >> >> No spaces after the ':' >> >> #+name:foo >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> => >> #+name:foo >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> #+RESULTS: foo >> : 42 >> >> Add parentheses after the name. >> >> #+name: foo() >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> => >> #+name: foo() >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> >> #+RESULTS: foo >> : 42 >> >> No spaces before the src block >> >> #+name: foo >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> => >> #+name: foo >> #+begin_src emacs-lisp >> (defun foo () >> 42) >> (foo) >> #+end_src emacs-lisp >> >> #+RESULTS: foo >> : 42 > > Bug confirmed (but I didn't try all your workarounds, just the no spaces > before the #+begin_src and no space after the colon in the #+name). > > I take it it was working on 7.4? > Yes. > Nick > > PS. One side note: the syntax of code blocks is > > #+NAME: > #+BEGIN_SRC > > #+END_SRC > > so no emacs-lisp on the #+end_src line. Indeed, I don't know why I've pasted it like this, normally I don't do it.
Re: [O] org-babel-execute-src-block deletes its src block.
Eric Schulte writes: > Nick Dokos writes: > >> Daimrod wrote: >> >>> >>> Hi, I've recently switched from Org 7.4 to the master branch on the git >>> repository, and I've encountered this weird situation. >>> >>> #+name: foo >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> >>> If I evaluate this block I get: >>> >>> #+name: foo >>> =42 >>> =emacs-lisp >>> >>> Though it works as expected if I remove the name: >>> >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> => >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> >>> #+RESULTS: >>> : 42 >>> >>> I've tried to figure out what was the problem and it lies in the regexp >>> org-babel-src-name-w-name-regexp. >>> >>> So far I've found those workarounds: >>> >>> No spaces after the ':' >>> >>> #+name:foo >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> => >>> #+name:foo >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> #+RESULTS: foo >>> : 42 >>> >>> Add parentheses after the name. >>> >>> #+name: foo() >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> => >>> #+name: foo() >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> >>> #+RESULTS: foo >>> : 42 >>> >>> No spaces before the src block >>> >>> #+name: foo >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> => >>> #+name: foo >>> #+begin_src emacs-lisp >>> (defun foo () >>> 42) >>> (foo) >>> #+end_src emacs-lisp >>> >>> #+RESULTS: foo >>> : 42 >> >> Bug confirmed (but I didn't try all your workarounds, just the no spaces >> before the #+begin_src and no space after the colon in the #+name). >> > > This was caused by a commit of mine yesterday, I've just pushed up a fix > and a protecting test case. > > Thanks for catching, Works nicely. By the way, org-babel is awesome, thanks for your efforts!
[O] noweb documentation
Hi, it would be great if the documentation mentioned the syntax <> because the only place it's mentioned is in the docstring of `org-babel-expand-noweb-references'. Currently, the manual mentions only the syntax <>.
[O] add binding to org-babel-goto-named-src-block
Hi, many functions in org-babel are bound to a letter X and C-X, it would be nice if it was the case for org-babel-goto-named-src-block. Here is a trivial patch. diff --git a/lisp/ob-keys.el b/lisp/ob-keys.el index cc11343..759bef3 100644 --- a/lisp/ob-keys.el +++ b/lisp/ob-keys.el @@ -60,7 +60,6 @@ functions which are assigned key bindings, and see ("u" . org-babel-goto-src-block-head) ("\C-u" . org-babel-goto-src-block-head) ("g" . org-babel-goto-named-src-block) -("\C-g" . org-babel-goto-named-src-block) ("r" . org-babel-goto-named-result) ("\C-r" . org-babel-goto-named-result) ("\C-b" . org-babel-execute-buffer)
[O] Org Babel C/C++
Hi, I've made a small patch to ob-C.el so it now includes the current directory to the list of directories to be searched for header files. Without this, I cannot include a local header file because the compilation happens in /tmp and thus gcc or g++ doesn't search for header files in the directory I currently work. diff --git a/lisp/ob-C.el b/lisp/ob-C.el index f1525aa..4f33fc4 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -96,15 +96,14 @@ or `org-babel-execute:C++'." (progn (with-temp-file tmp-src-file (insert full-body)) (org-babel-eval - (format "%s -o %s %s %s -I \"%s\"" + (format "%s -o %s %s %s" (cond ((equal org-babel-c-variant 'c) org-babel-C-compiler) ((equal org-babel-c-variant 'cpp) org-babel-C++-compiler)) (org-babel-process-file-name tmp-bin-file) (mapconcat 'identity (if (listp flags) flags (list flags)) " ") - (org-babel-process-file-name tmp-src-file) - (file-name-directory (expand-file-name (buffer-file-name "" + (org-babel-process-file-name tmp-src-file)) "" ((lambda (results) (org-babel-reassemble-table (if (member "vector" (cdr (assoc :result-params params)))
Re: [O] Org Babel C/C++
Eric Schulte writes: > Applied, Thanks! > > Daimrod writes: > >> Hi, >> >> I've made a small patch to ob-C.el so it now includes the current >> directory to the list of directories to be searched for header files. >> Without this, I cannot include a local header file because the >> compilation happens in /tmp and thus gcc or g++ doesn't search for >> header files in the directory I currently work. >> >> diff --git a/lisp/ob-C.el b/lisp/ob-C.el >> index f1525aa..4f33fc4 100644 >> --- a/lisp/ob-C.el >> +++ b/lisp/ob-C.el >> @@ -96,15 +96,14 @@ or `org-babel-execute:C++'." >>(progn >> (with-temp-file tmp-src-file (insert full-body)) >> (org-babel-eval >> - (format "%s -o %s %s %s -I \"%s\"" >> + (format "%s -o %s %s %s" >> (cond >>((equal org-babel-c-variant 'c) org-babel-C-compiler) >>((equal org-babel-c-variant 'cpp) org-babel-C++-compiler)) >> (org-babel-process-file-name tmp-bin-file) >> (mapconcat 'identity >> (if (listp flags) flags (list flags)) " ") >> - (org-babel-process-file-name tmp-src-file) >> - (file-name-directory (expand-file-name >> (buffer-file-name "" >> + (org-babel-process-file-name tmp-src-file)) "" >> ((lambda (results) >> (org-babel-reassemble-table >> (if (member "vector" (cdr (assoc :result-params params))) Hum, I'm quite embarrassed, this doesn't work when the block is executed during an export. I didn't track it down yet, but (buffer-file-name) returns nil during the export probably because the buffer changes. A workaround would be to use the :flags header argument though it's a bit tedious because it doesn't seem possible to eval elisp during the export. i.e. #+BEGIN_SRC cpp :flags -I (file-name-directory (buffer-file-name)) ... #+END_SRC
Re: [O] Org Babel C/C++
Michael Hannon writes: > On Wednesday, March 28, 2012 at 4:01 PM Daimrod wrote: > >> Eric Schulte writes: >> >>> Applied, Thanks! >>> >>> Daimrod writes: >>> >>>> Hi, >>>> >>>> I've made a small patch to ob-C.el so it now includes the current >>>> directory to the list of directories to be searched for header files. >>>> Without this, I cannot include a local header file because the >>>> compilation happens in /tmp and thus gcc or g++ doesn't search for >>>> header files in the directory I currently work. >>>> >>>> diff --git a/lisp/ob-C.el b/lisp/ob-C.el >>>> index f1525aa..4f33fc4 100644 >>>> --- a/lisp/ob-C.el >>>> +++ b/lisp/ob-C.el >>>> @@ -96,15 +96,14 @@ or `org-babel-execute:C++'." >>>> (progn >>>> (with-temp-file tmp-src-file (insert full-body)) >>>> (org-babel-eval >>>> - (format "%s -o %s %s %s -I >> \"%s\"" >>>> + (format "%s -o %s %s %s" >>>> (cond >>>> ((equal org-babel-c-variant 'c) >> org-babel-C-compiler) >>>> ((equal org-babel-c-variant 'cpp) >> org-babel-C++-compiler)) >>>> (org-babel-process-file-name tmp-bin-file) >>>> (mapconcat 'identity >>>> (if (listp flags) flags (list flags)) " ") >>>> - (org-babel-process-file-name tmp-src-file) >>>> - (file-name-directory (expand-file-name >> (buffer-file-name "" >>>> + (org-babel-process-file-name tmp-src-file)) >> "" >>>> ((lambda (results) >>>> (org-babel-reassemble-table >>>> (if (member "vector" (cdr (assoc :result-params >> params))) >> >> Hum, I'm quite embarrassed, this doesn't work when the block is executed >> during an export. I didn't track it down yet, but (buffer-file-name) >> returns nil during the export probably because the buffer changes. >> >> A workaround would be to use the :flags header argument though it's a >> bit tedious because it doesn't seem possible to eval elisp during the >> export. >> >> i.e. >> >> #+BEGIN_SRC cpp :flags -I (file-name-directory (buffer-file-name)) >> ... >> #+END_SRC >> > > I ran into this problem a few months ago. I don't have the elisp skills to > patch Org mode, but I found something that worked for me: > > http://article.gmane.org/gmane.emacs.orgmode/49356/ > > -- Mike This won't work if you use different directories, you'll have to set the variable org-babel-C++-compiler every time. IMHO a good solution would be to be able to specify the directory used to compile, or maybe I should just use a Makefile.
Re: [O] Feature request for noweb mode that strips references on export
"Sean O'Halpin" writes: > Hi, > > I've tried to use the new :noweb strip-export feature but I can't work > out the magic combination of headers (working with git head, i.e. > commit 67694297fa0f9b32cf4bfe812ba8a5c5cf4a0859). > > Here is a stripped down example: > > START OF EXAMPLE > > * Example > > Define method > > #+name: boilerplate > #+begin_src ruby > def hello > "Hello World" > end > #+end_src > > Use it > > #+name: example > #+begin_src ruby :exports both :noweb strip-export > «boilerplate» > > hello > #+end_src > > And here is the result: > > #+RESULTS: example > : Hello World > > END OF EXAMPLE > > On export, I expect this to display the result string "Hello World" > after the code "hello" but get nothing. If I change the :noweb > strip-export to :noweb yes, I do get the output (but also the > boilerplate of course). > > Is strip-export meant to work like this? If so, could someone please > post a working example? > > Thanks, > Sean If you don't want to export boilerplate you've to use :exports none in it. #+name: boilerplate #+begin_src ruby :exports none def hello "Hello World" end #+end_src Use it #+name: example #+begin_src ruby :exports both :noweb strip-export <> hello #+end_src
Re: [O] Feature request for noweb mode that strips references on export
"Sean O'Halpin" writes: > On Fri, Mar 30, 2012 at 5:39 PM, Daimrod wrote: >> If you don't want to export boilerplate you've to use :exports none in >> it. >> >> #+name: boilerplate >> #+begin_src ruby :exports none >> def hello >> "Hello World" >> end >> #+end_src >> >> Use it >> >> #+name: example >> #+begin_src ruby :exports both :noweb strip-export >> <> >> >> hello >> #+end_src >> > Thanks but that's not my problem. When I use :exports both I get the > code but not the results output in my exported HTML. > Do you get the "Hello World" output? If so, it looks like I'll have to > debug my configuration. No, you're right, I have to execute evaluate the code manually to produce #+RESULTS: example : Hello World and then it's exported but only if the code isn't evaluated during the export. It looks like there is a bug with in the ruby part because the following code works as expected. -- * Title #+name: boilerplate #+begin_src emacs-lisp :exports none (defun hello () "Hello World") #+end_src Use it #+name: example #+begin_src emacs-lisp :exports both :noweb strip-export <> (hello) #+end_src -- It exports to -- 1 Title Use it (hello) Hello World --
Re: [O] Inline LaTeX fragments in emacs buffer
Dov Grobgeld writes: > Is there any way of getting org-mode to display inline LaTeX fragments > in the emacs buffer? E.g. I would like to be able to type: > > The size of the hypotenuse is $\sqrt{a^2+b^2}$ > > and then the buffer immediately shows: > > The size of the hypotenuse is √a²+b² > > where √a²+b² is a png image rendered via dvipng. > > I assume a toggle would switch between either seeing the formula or > seeing the source of the formula, just like for the display of inline > images. Also, pressing a backspace when the cursor is at the end of > the formula should erase the trailing $ sign, and turn off image > display of the formula, just like for [[links][name]]. > > Has anything like this been implemented? > > Thanks! > Dov Yes, you can produce a preview image with C-c C-x C-l. See (info "(org) Previewing LaTeX fragments") and (info "(org) Embedded LaTeX")
Re: [O] still seeing semi-regular lockups
Matt Lundin writes: > Eric Abrahamsen writes: > >> Nicolas Goaziou writes: >> >>> Hello, >>> >>> Eric Abrahamsen writes: >>> >>>> None of those three, I'm afraid! It was hanging on a variety of editing >>>> operations that, as far as I can tell, had little in common. There's a >>>> possibility that they were list-item-related, but really there wasn't >>>> much commonality. >>> >>> FYI, I recently fixed a bug[fn:1] that could introduce uncommon random >>> lockups. Hopefully, it may be related to your problem (which is >>> different from Daimrod's). >> >> Thanks for the followup! I was watching Daimrod's thread, and also >> Matt's most recent posting -- that also seemed more relevant to my >> problems, which were almost solely confined to log/state notes. I've >> pulled the fix, and will let you know if I see any more problems. > > With the latest git, I've experienced three lock-ups/freezes this > evening when a) archiving a subtree to a file, b) changing a todo state > with repeating timestamp, and 3) calling C-c C-c in an org-capture > buffer. (I don't think this is due to a recent change - I've been > running into these lockups sporadically for several months.) > > The freezes are very difficult to replicate reliably. When they happen, > emacs is unresponsive and can only be killed from the outside. Any tips > on how to debug this would be greatly appreciated. See my previous post: http://thread.gmane.org/gmane.emacs.orgmode/86255/focus=86263 You can wrap `jit-lock--debug-fontify' with: (advice-add 'jit-lock--debug-fontify :around (lambda (fun &rest args) (with-local-quit (apply fun args and then force emacs to break and display a backtrace by sending the SIGUSR2 to the emacs process. Best, -- Daimrod/Greg
Re: [O] org-contacts email completion by tags
Daimrod writes: > Thanks, but I'm refactoring org-contacts a bit, and I think I have found > a slightly better way to do that, but in the meantime you can use the > aforementioned hook for your function. It turns out that my idea was wrong, so I have used a version very similar to yours. The function is triggered by the prefix '#' (customizable) and can be used to match tags and properties. e.g. the following expression: #work-phd&BIRTHDAY<>"" will look for contacts with the tag 'work' but not the tag 'phd' and for which there is a BIRTHDAY properties. Best, -- Daimrod/Greg
Re: [O] how to hide titles marked with "DONE"
bofe writes: > Hi, > I use org to manage my projects. When some works are finished ,I > marked the titles “DONE”,but as time goes by ,there are too many of > them, that I can’t focus on the rest of unfinished works. > Is there a way to hide the “DONE" titles,rather than delete them? You can toggle the archive tag (C-c C-x a) or archive the tasks (C-c C-x C-a). -- Daimrod/Greg
Re: [O] Bug: org-contacts show "Non-existent agenda file ~/org/* virexit. [R]emove from list or [A]bort?" when trying to find contacts with M-x org-contacts [8.2.7b (8.2.7b-dist @ c:/Users/Seam/A
seamw...@gmail.com writes: > I put my captured contacts to "~/.orgmode/data/contact.org" and I can > successfully capture the contacts, however, when I eval the function > org-contacts in org mode, it just shows the message in the title. > > if the contact file is empty, it does not show the message, but org-contacts > show an empty match. -- > org-contacts show "Non-existent agenda file ~/org/* virexit. [R]emove > from list or [A]bort?" when trying to find contacts with M-x > org-contacts [8.2.7b (8.2.7b-dist @ > c:/Users/Seam/AppData/Roaming/.emacs.d/orgmode/lisp/)] -- It looks like you had added a file named '* virexit' to the agenda list, but that file doesn't exist anymore. `org-contacts' uses the agenda views to display contacts. I don't know the internals of `org-agenda' very well but I guess that it checks for agenda files even if the caller doesn't need them, hence the error. I don't know (yet) if it's possible to disable this behavior, but in the meantime you can remove the file from the agenda list. Best, -- Daimrod/Greg
Re: [O] org-contact Export
Esben Stien writes: Hello Esben, > Is there any way to retrieve a single org-contact as CSV or maybe a VCF > file? > > I know I can export all of them, but is there a function to get just the > one under point? It wasn't possible, but it is now. I've slightly modified `org-contacts-export-as-vcard' so that it will prompt for a user name when called with a prefix argument. The new function's behovior when called interactively is the following: 1. no prefix : do as before, export all contacts to `org-contacts-vcard-file'. 2. C-u : prompt for a contact name and use the contact at point if it exists, then export the matching contacts to `org-contacts-vcard-file'. 3. C-u C-u : same as 2. but prompt for a file name where to export instead of `org-contacts-vcard-file'. 4. C-u C-u C-u : same as 3. but prompt for a buffer name instead of a file name. When the function isn't called interactively it behaves as it did before. WDYT? Best, -- Daimrod/Greg
Re: [O] org-contact Export
Esben Stien writes: > Daimrod writes: > >> It wasn't possible, but it is now. I've slightly modified >> `org-contacts-export-as-vcard' so that it will prompt for a user name >> when called with a prefix argument. > > This is in git? Yes. >> The new function's behovior when called interactively is the following: >> 1. no prefix : do as before, export all contacts to >> `org-contacts-vcard-file'. >> 2. C-u : prompt for a contact name and use the contact at point if it >> exists, then export the matching contacts to >> `org-contacts-vcard-file'. >> 3. C-u C-u : same as 2. but prompt for a file name where to export >>instead of `org-contacts-vcard-file'. >> 4. C-u C-u C-u : same as 3. but prompt for a buffer name instead of a >>file name. > > How about export to kill-ring? Do you mean in the kill-ring instead of the buffer? or with another prefix level (C-u C-u C-u C-u)? -- Daimrod/Greg
Re: [O] per file org-todo-keywords?
Xebar Saram writes: > Hi all Hi, > i would like to know if its possible to have per file org-todo-keywords? i > know you can have custom TODO states in the top of the file/buffer but > then you loose the fast access to TODO states tight? No, it still works. > currently i have something like this: > > (setq org-todo-keywords (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") > (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" > > but i woud like different TODO keywords for specific file that i can use > fast access for > > any ideas? It's all in the documentation. see (info "(org) Tracking TODO state changes") >>>You can use the exact same syntax for setting logging preferences >>> local to a buffer: >>> #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@) -- Daimrod/Greg
[O] [feature request] Matching tags and properties
Hi all, ATM, it is possible to look for date in properties using special keywords such as , and . Unfortunately, the last two keywords doesn't match on timestamps that include time information. e.g. [2014-08-04 Mon] can be matched, but not [2014-08-04 Mon 21:20]. I think it would make sense to allow the later to be matched with , that is, to ignore time information. WDYT? -- Daimrod/Greg
[O] [PATCH] docstring improvement of org-agenda-refile
Hi, Here is a small patch to improve the docstring of `org-agenda-refile'. Can I apply it? >From acd2830755849a055ce46a34b65af89b9547fcb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Sun, 10 Aug 2014 01:41:16 +0200 Subject: [PATCH] lisp/org-agenda.el (org-agenda-refile): Documentation improvement * lisp/org-agenda.el (org-agenda-refile): State explicitly that '(16) = C-u C-u and that '(64) = C-u C-u C-u. --- lisp/org-agenda.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 3919328..8244eeb 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8475,8 +8475,8 @@ If this information is not given, the function uses the tree at point." (defun org-agenda-refile (&optional goto rfloc no-update) "Refile the item at point. -When GOTO is 0 or '(64), clear the refile cache. -When GOTO is '(16), go to the location of the last refiled item. +When GOTO is 0 or '(64) or \\[universal-argument] \\[universal-argument] \\[universal-argument], clear the refile cache. +When GOTO is '(14) or \\[universal-argument] \\[universal-argument], go to the location of the last refiled item. RFLOC can be a refile location obtained in a different way. When NO-UPDATE is non-nil, don't redo the agenda buffer." (interactive "P") -- 1.8.0.2722.gc0242e5 -- Daimrod/Greg
[O] [PATCH] docstring improvement of org-agenda-refile
Hi, Here is a small patch to improve the docstring of `org-agenda-refile'. Can I apply it? >From acd2830755849a055ce46a34b65af89b9547fcb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Sun, 10 Aug 2014 01:41:16 +0200 Subject: [PATCH] lisp/org-agenda.el (org-agenda-refile): Documentation improvement * lisp/org-agenda.el (org-agenda-refile): State explicitly that '(16) = C-u C-u and that '(64) = C-u C-u C-u. --- lisp/org-agenda.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 3919328..8244eeb 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8475,8 +8475,8 @@ If this information is not given, the function uses the tree at point." (defun org-agenda-refile (&optional goto rfloc no-update) "Refile the item at point. -When GOTO is 0 or '(64), clear the refile cache. -When GOTO is '(16), go to the location of the last refiled item. +When GOTO is 0 or '(64) or \\[universal-argument] \\[universal-argument] \\[universal-argument], clear the refile cache. +When GOTO is '(14) or \\[universal-argument] \\[universal-argument], go to the location of the last refiled item. RFLOC can be a refile location obtained in a different way. When NO-UPDATE is non-nil, don't redo the agenda buffer." (interactive "P") -- 1.8.0.2722.gc0242e5 -- Daimrod/Greg
Re: [O] Tab completion for link to file
Chris Henderson writes: Hi Chris, > How can I get auto tab completion for links to files? Is C-u C-c C-l what you're looking for? >From the *Help* of `org-insert-link': > With a C-u prefix, prompts for a file to link to. The file name can > be selected using completion. > > e.g. [[file+sys:///Users/chris/projects/marketing 2014]] > > Thanks. -- Daimrod/Greg
Re: [O] [PATCH] docstring improvement of org-agenda-refile
Charles Millar writes: > Charles Millar wrote: >> Daimrod wrote: >>> +When GOTO is '(14) or \\[universal-argument] >>> \\[universal-argument], go to the location of the last refiled >>> item. >> ^^ >> '(16) > Just opened my own reply and the '(16) may be misaligned. Good catch. I've applied the patch with the correction. -- Daimrod/Greg
Re: [O] org-elements-parse-buffer and weird property drawers
Eike writes: > Hello, > > Nicolas Goaziou writes: >> Eike writes: >> >>> I'm playing with the functions in org-elements.el and the following >>> effect seems strange to me: >>> >>> I have a few propery drawers with empty propertys, like >>> >>> #+BEGIN_EXAMPLE >>> :PROPERTIES: >>> :date: [2014-08-29 Fr] >>> :chf: 21.76 >>> :eur: >>> :END: >>> #+END_EXAMPLE >>> >>> If I do org-elements-parse-buffer, the empty one is not there, but the >>> first one is duplicated. At least, there are two node-property >>> elements in the tree like that: >>> >>> #+BEGIN_EXAMPLE >>> (node-property (:key "chf" :value "21.76" :begin 38 :end 58 :post-blank 0 >>> :post-affiliated 38 :parent #4)) >>> (node-property (:key "chf" :value "21.76" :begin 58 :end 67 :post-blank 0 >>> :post-affiliated 58 :parent #4)) >>> #+END_EXAMPLE >>> >>> The function call was this: >>> >>> #+begin_src emacs-lisp >>> (with-current-buffer "test-exp.org" >>> (org-element-parse-buffer)) >>> #+end_src >>> >>> And here is the "test-exp.org" org file: >>> >>> #+BEGIN_EXAMPLE >>> * Sonstiges >>> ** Pizza >>>:PROPERTIES: >>>:chf: 21.76 >>>:eur: >>>:END: >>> #+END_EXAMPLE >> >> This should be fixed. Thank you for reporting it. > > Many thanks! It works here now. Hi, Since the change to `org-re-property' I have problems to display org files. My *Message* buffer is spammed with the following error: Error during redisplay: (jit-lock-function 1119) signaled (error "No match 3 in highlight (3 (quote org-property-value) t)") this number changes I know the problem lies in org-re-property because if I revert the change, it works as it did before. Test file: * TODO Test :PROPERTIES: :TEST: test :END: Best, -- Daimrod/Greg
Re: [O] org-elements-parse-buffer and weird property drawers
Nicolas Goaziou writes: > Hello, > > Daimrod writes: > >> Since the change to `org-re-property' I have problems to display org >> files. My *Message* buffer is spammed with the following error: >> >> Error during redisplay: (jit-lock-function 1119) signaled (error "No match 3 >> in highlight (3 (quote org-property-value) t)") >> this number changes > > Fixed. Thank you. It works, thanks. > Regards, -- Daimrod/Greg
Re: [O] doing a capture and jumping to the file
Alan Schmitt writes: > Hello, Hello Alan, > I often find myself doing the following: use a capture template to > nicely setup an entry (often a date tree entry with a link to the > current document), then jump to the newly created headline to start > adding notes. I typically do this during meetings, as I do not want to > stay in the capture buffer all the time. > > Is there a way to setup a capture template such that it directly opens > the target file and set-up entry, instead of the capture buffer? > > I tried a universal argument before calling org-capture, but it only > jumps to the capture destination and does not set up the entry. You can customize your capture templates with `M-x org-capture RET C'. Look especially at the plist keywords `:immediate-finish` and `:jump-to-captured`. Best, -- Daimrod/Greg signature.asc Description: PGP signature
[O] Help on org-export-filter-link-functions
Hi, I've wrote a simple filter to customize how links are exported in latex: #+BEGIN_SRC (defun dmd--latex-bib-link-filter (data backend info) "Convert a bib link to a citation (e.g. bib:foo93 -> \cite{foo93})." (let* ((beg (next-property-change 0 data)) (link (if beg (get-text-property beg :parent data (cond ((and link (org-export-derived-backend-p backend 'latex) (string= (org-element-property :type link) "bib")) (format "\\cite{%s}" (org-element-property :path link))) ((and link (org-export-derived-backend-p backend 'latex) (string= (org-element-property :type link) "file") (string= (org-element-property :path link) "~/.bib.bib")) (format "\\cite{%s}" (org-element-property :search-option link))) (t data #+END_SRC And I was wondering whether there is an easier way to retrieve the org properties stored in the text properties of DATA. Best, -- Daimrod/Greg signature.asc Description: PGP signature
[O] Link to named block
Hi, I've made a small function to link to a named block in org files. #+BEGIN_SRC emacs-lisp (defun dmd--org-link-to-named-block () "Create an org-link to the named block at point. Blocks are named with #+NAME." (when (eq major-mode 'org-mode) (let* ((el (org-element-at-point)) (name (org-element-property :name el))) (when name (org-store-link-props :link name) #+END_SRC Do you think it should be added to org? I find it useful to add a link to a figure when I'm exporting to latex. I tried to add it to `org-store-link` but it's a big function and I wonder why it's not splitted in smaller functions. (e.g. org-help-store-link, org-w3-store-link, org-image-store-link, ...). If you agree, I could split it. WDYT? Best, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] Link to named block
Bastien writes: > Hi Greg, Hi Bastien, > Daimrod writes: > >> I've made a small function to link to a named block in org files. >> >> #+BEGIN_SRC emacs-lisp >> (defun dmd--org-link-to-named-block () >> "Create an org-link to the named block at point. >> >> Blocks are named with #+NAME." >> (when (eq major-mode 'org-mode) >> (let* ((el (org-element-at-point)) >>(name (org-element-property :name el))) >> (when name >> (org-store-link-props >> :link name) >> #+END_SRC >> >> Do you think it should be added to org? I find it useful to add a link >> to a figure when I'm exporting to latex. > > I'm not sure how to use the function above -- how do you set the link > itself, not just its properties? I don't. The link name is enough because named block usually have "nice" name. For example, given the following named block: #+NAME: fig:my-fig [[file:my-fig.png]] Then link will be [[fig:my-fig]]. >> I tried to add it to `org-store-link` but it's a big function and I >> wonder why it's not splitted in smaller functions. (e.g. >> org-help-store-link, org-w3-store-link, org-image-store-link, ...). >> If you agree, I could split it. > > Yes, please go ahead. noted. -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] Extra empty line at the top of the page when tangling.
Ivanov Dmitry writes: Hi, > Code: > > #+BABEL: :cache yes :tangle yes :noweb yes > > #+NAME: top_block > #+begin_src perl :tangle "test.pl" :noweb tangle From (info "(org) padline"): > 14.8.2.10 ‘:padline’ > > > Control in insertion of padding lines around code block bodies in > tangled code files. The default value is ‘yes’ which results in > insertion of newlines before and after each tangled code block. The > following arguments are accepted. > >• ‘yes’ Insert newlines before and after each code block body in > tangled code files. >• ‘no’ Do not insert any newline padding in tangled output. You can use the following block declaration: #+begin_src perl :tangle "test.pl" :noweb tangle :padline no > #!/usr/bin/perl > > use strict; > use warnings; > > open(my $fh, "<", "test.txt") > or die "cannot open < file name: $!"; > <> > close($fh); > #+end_src > > #+NAME: output-all > #+begin_src perl > while (my $line = <$fh>) { > print $line; > } > #+end_src > > Outputs a perl file, where the 1-st line is blank. What should I do to remove > it? -- Daimrod/Greg signature.asc Description: PGP signature
[O] [PATCH] Add `org-reverse-string'
I needed a `reverse-string' function and I've found two in Org Mode. `org-babel-reverse-string' and `org-id-reverse-string'. So instead of rolling my own (I'm playing with `org-contacts.el'), I think it would be better to unify those functions into one. From e058c4fac767a5faffd8debaabc489c174eef583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Sat, 26 Jan 2013 21:12:54 +0100 Subject: [PATCH] Unify `org-id-reverse-string' and `org-babel-reverse-string' into `org-reverse-string' * lisp/org.el (org-reverse-string): Add `org-reverse-string' to reverse a string. * lisp/org-id.el: Replace `org-id-reverse-string' by `org-reverse-string'. * lisp/ob-core.el: Replace `org-babel-reverse-string' by `org-reverse-string' TINYCHANGE --- lisp/ob-core.el |8 ++-- lisp/org-id.el |7 ++- lisp/org.el |4 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 9e4c8b1..0a495d0 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2495,10 +2495,6 @@ If the table is trivial, then return it as a scalar." (match-string 1 cell)) cell) t)) -(defun org-babel-reverse-string (string) - "Return the reverse of STRING." - (apply 'string (reverse (string-to-list string - (defun org-babel-chomp (string &optional regexp) "Strip trailing spaces and carriage returns from STRING. Default regexp used is \"[ \f\t\n\r\v]\" but can be @@ -2513,8 +2509,8 @@ overwritten by specifying a regexp as a second argument." "Strip leading and trailing spaces and carriage returns from STRING. Like `org-babel-chomp' only it runs on both the front and back of the string." - (org-babel-chomp (org-babel-reverse-string -(org-babel-chomp (org-babel-reverse-string string) regexp)) + (org-babel-chomp (org-reverse-string +(org-babel-chomp (org-reverse-string string) regexp)) regexp)) (defvar org-babel-org-babel-call-process-region-original nil) diff --git a/lisp/org-id.el b/lisp/org-id.el index b35ea5e..bb503bd 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -343,7 +343,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (unless (org-uuidgen-p unique) (setq unique (org-id-uuid ((eq org-id-method 'org) - (let* ((etime (org-id-reverse-string (org-id-time-to-b36))) + (let* ((etime (org-reverse-string (org-id-time-to-b36))) (postfix (if org-id-include-domain (progn (require 'message) @@ -376,9 +376,6 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (substring rnd 18 20) (substring rnd 20 32 -(defun org-id-reverse-string (s) - (mapconcat 'char-to-string (nreverse (string-to-list s)) "")) - (defun org-id-int-to-b36-one-digit (i) "Turn an integer between 0 and 61 into a single character 0..9, A..Z, a..z." (cond @@ -432,7 +429,7 @@ and time is the usual three-integer representation of time." (if (= 2 (length parts)) (setq prefix (car parts) time (nth 1 parts)) (setq prefix nil time (nth 0 parts))) -(setq time (org-id-reverse-string time)) +(setq time (org-reverse-string time)) (setq time (list (org-id-b36-to-int (substring time 0 4)) (org-id-b36-to-int (substring time 4 8)) (org-id-b36-to-int (substring time 8 12 diff --git a/lisp/org.el b/lisp/org.el index 5033cbf..65c8c60 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -21038,6 +21038,10 @@ for the search purpose." (error "Unable to create a link to here" (org-occur-in-agenda-files (regexp-quote link +(defun org-reverse-string (string) + "Return the reverse of STRING." + (apply 'string (reverse (string-to-list string + (defun org-uniquify (list) "Remove duplicate elements from LIST." (let (res) -- 1.7.10.4 -- Daimrod/Greg pgp4CXAjio3Ft.pgp Description: PGP signature
Re: [O] [PATCH] Add `org-reverse-string'
Eric Schulte writes: > This patch looks fine to me, although you'll need to add a > `declare-function' call to the top of ob-core.el (and maybe to org-id as > well) or the compiler will complain. I've added a `declare-function' call to `ob-core.el' but I think I don't need to add it to `org-id.el' because it already require `org.el'. Thanks for taking time to review this patch. From 91c4d0fde589e23de3bebbc4d8f95f90e85dbc14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Sat, 26 Jan 2013 22:27:51 +0100 Subject: [PATCH] Unify `org-id-reverse-string' and `org-babel-reverse-string' into `org-reverse-string' * lisp/org.el (org-reverse-string): Add `org-reverse-string' to reverse a string. * lisp/org-id.el(org-id-new, org-id-decode): Replace `org-id-reverse-string' by `org-reverse-string'. * lisp/ob-core.el(org-babel-trim): Replace `org-babel-reverse-string' by `org-reverse-string' and declare it. TINYCHANGE --- lisp/ob-core.el |9 +++-- lisp/org-id.el |7 ++- lisp/org.el |4 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 9e4c8b1..7453955 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -91,6 +91,7 @@ (declare-function org-escape-code-in-region "org-src" (beg end)) (declare-function org-unescape-code-in-string "org-src" (s)) (declare-function org-table-to-lisp "org-table" (&optional txt)) +(declare-function org-reverse-string "org" (string)) (defgroup org-babel nil "Code block evaluation and management in `org-mode' documents." @@ -2495,10 +2496,6 @@ If the table is trivial, then return it as a scalar." (match-string 1 cell)) cell) t)) -(defun org-babel-reverse-string (string) - "Return the reverse of STRING." - (apply 'string (reverse (string-to-list string - (defun org-babel-chomp (string &optional regexp) "Strip trailing spaces and carriage returns from STRING. Default regexp used is \"[ \f\t\n\r\v]\" but can be @@ -2513,8 +2510,8 @@ overwritten by specifying a regexp as a second argument." "Strip leading and trailing spaces and carriage returns from STRING. Like `org-babel-chomp' only it runs on both the front and back of the string." - (org-babel-chomp (org-babel-reverse-string -(org-babel-chomp (org-babel-reverse-string string) regexp)) + (org-babel-chomp (org-reverse-string +(org-babel-chomp (org-reverse-string string) regexp)) regexp)) (defvar org-babel-org-babel-call-process-region-original nil) diff --git a/lisp/org-id.el b/lisp/org-id.el index b35ea5e..bb503bd 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -343,7 +343,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (unless (org-uuidgen-p unique) (setq unique (org-id-uuid ((eq org-id-method 'org) - (let* ((etime (org-id-reverse-string (org-id-time-to-b36))) + (let* ((etime (org-reverse-string (org-id-time-to-b36))) (postfix (if org-id-include-domain (progn (require 'message) @@ -376,9 +376,6 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (substring rnd 18 20) (substring rnd 20 32 -(defun org-id-reverse-string (s) - (mapconcat 'char-to-string (nreverse (string-to-list s)) "")) - (defun org-id-int-to-b36-one-digit (i) "Turn an integer between 0 and 61 into a single character 0..9, A..Z, a..z." (cond @@ -432,7 +429,7 @@ and time is the usual three-integer representation of time." (if (= 2 (length parts)) (setq prefix (car parts) time (nth 1 parts)) (setq prefix nil time (nth 0 parts))) -(setq time (org-id-reverse-string time)) +(setq time (org-reverse-string time)) (setq time (list (org-id-b36-to-int (substring time 0 4)) (org-id-b36-to-int (substring time 4 8)) (org-id-b36-to-int (substring time 8 12 diff --git a/lisp/org.el b/lisp/org.el index 5033cbf..65c8c60 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -21038,6 +21038,10 @@ for the search purpose." (error "Unable to create a link to here" (org-occur-in-agenda-files (regexp-quote link +(defun org-reverse-string (string) + "Return the reverse of STRING." + (apply 'string (reverse (string-to-list string + (defun org-uniquify (list) "Remove duplicate elements from LIST." (let (res) -- 1.7.10.4 -- Daimrod/Greg pgpWxZ54NpGGd.pgp Description: PGP signature
Re: [O] How to improve Org startup time?
"Sebastien Vauban" writes: > Hello, Hello Sebastien, > I would like to have: > > - the minimal Org config loaded when opening any .org file; IOW, certainly not > the agenda files! > > - all files in `org-agenda-files' when calling any agenda view (C-c a ...) > > - the current clocked file when resume Org's clock mechanism. > > I'm ready to look at where to cut branches of the Org tree, if that does make > sense to you. Does it? You could try to pull from the main branch and test the latest option pushed by Bastien to improve the agenda startup. This option, `org-agenda-inhibit-startup', is set by default to t so shouldn't have anything to configure. Here is the original thread: http://comments.gmane.org/gmane.emacs.orgmode/65215 > Best regards, > Seb > > [1] Don't assume it's not related to some problem in my config. But, for this > point, AFAIU, it's not the case. -- Daimrod/Greg pgpxSMkRBXxEG.pgp Description: PGP signature
Re: [O] How to improve Org startup time?
"Sebastien Vauban" writes: > Hello Daimrod, > > Daimrod wrote: >> "Sebastien Vauban" writes: >>> I would like to have: >>> >>> - the minimal Org config loaded when opening any .org file; IOW, certainly >>> not >>> the agenda files! >>> >>> - all files in `org-agenda-files' when calling any agenda view (C-c a ...) >>> >>> - the current clocked file when resume Org's clock mechanism. >>> >>> I'm ready to look at where to cut branches of the Org tree, if that does >>> make >>> sense to you. Does it? >> >> You could try to pull from the main branch and test the latest option >> pushed by Bastien to improve the agenda startup. >> >> This option, `org-agenda-inhibit-startup', is set by default to t so >> shouldn't have anything to configure. > > Thanks for your notice -- it could (have) help(ed)... if I wasn't already > (quite) up-to-date; here's the results of `git log': > > commit f52600a43908d5b246901780b9a761e477ec5604 > Author: Eric Schulte > Date: Sat Jan 26 13:58:15 2013 -0700 > > fix bug: tangling #+headers: lines w/prefix arg > > commit bb40d29b45e091f3a4226c890e1130299c4dffd4 > Author: Nicolas Goaziou > Date: Sat Jan 26 18:05:56 2013 +0100 > > org-export: Fix subtree export when parent section is empty > > * contrib/lisp/org-export.el (org-export--get-subtree-options): When > point is at an headline and subtree export is called, make sure > export properties are extracted from parent headline. > * testing/lisp/test-org-export.el: Add test. > > commit 5e11659e66845e918a047f4a89d171f599729174 > Merge: 714b372 a119649 > Author: Bastien Guerry > Date: Sat Jan 26 15:11:21 2013 +0100 > > Merge branch 'maint' > > Conflicts: > lisp/org.el > > commit a1196499237b6a0389fba2d21b69c34068404519 > Author: Bastien Guerry > Date: Sat Jan 26 15:10:43 2013 +0100 > > org.el (org-agenda-inhibit-startup): Rename from > `org-agenda-inhibit-startup-visibility-cycling' > > * org.el (org-agenda-inhibit-startup): Rename from > `org-agenda-inhibit-startup-visibility-cycling'. > (org-agenda-prepare-buffers): Bind `org-inhibit-startup' to > `org-agenda-inhibit-startup'. > > I must admit I did not see any improvement -- at least, even if I did not make > any measures before and after that, I did not feel any improvement. Per chance, you did not forget to M-x compile ? ;) Joking aside, I'm sad it didn't any sensible improvement. -- Daimrod/Greg pgpT8YfVzH5VQ.pgp Description: PGP signature
Re: [O] How to improve Org startup time?
"Sebastien Vauban" writes: >> Finally, org-agenda-to-appt is very slow by default, it uses >> org-agenda-get-day-entries and check every entry... see the docstring on how >> to make it check only the ones you really need. > > Euh... > > ╭ > │ org-agenda-get-day-entries is a Lisp function in `org-agenda.el'. > │ > │ (org-agenda-get-day-entries &rest ARGS) > │ > │ Not documented. > ╰ > > ╭ > │ org-agenda-to-appt is an interactive autoloaded Lisp function in > │ `org-agenda.el'. > │ > │ (org-agenda-to-appt &optional REFRESH FILTER &rest ARGS) > │ > │ Not documented. > ╰ > > What am I missing? Those functions should be documented. Here is what I have: > org-agenda-get-day-entries is a compiled Lisp function in > `org-agenda.el'. > > (org-agenda-get-day-entries FILE DATE &rest ARGS) > > Does the work for `org-diary' and `org-agenda'. > FILE is the path to a file to be checked for entries. DATE is date like > the one returned by `calendar-current-date'. ARGS are symbols indicating > which kind of entries should be extracted. For details about these, see > the documentation of `org-diary'. > org-agenda-to-appt is an interactive autoloaded compiled Lisp function > in `org-agenda.el'. > > (org-agenda-to-appt &optional REFRESH FILTER &rest ARGS) > > Activate appointments found in `org-agenda-files'. > With a C-u prefix, refresh the list of > appointments. > > If FILTER is t, interactively prompt the user for a regular > expression, and filter out entries that don't match it. > > If FILTER is a string, use this string as a regular expression > for filtering entries out. > > If FILTER is a function, filter out entries against which > calling the function returns nil. This function takes one > argument: an entry from `org-agenda-get-day-entries'. > > FILTER can also be an alist with the car of each cell being > either 'headline or 'category. For example: > > '((headline "IMPORTANT") > (category "Work")) > > will only add headlines containing IMPORTANT or headlines > belonging to the "Work" category. > > ARGS are symbols indicating what kind of entries to consider. > By default `org-agenda-to-appt' will use :deadline, :scheduled > and :timestamp entries. See the docstring of `org-diary' for > details and examples. > > If an entry as a APPT_WARNTIME property, its value will be used > to override `appt-message-warning-time'. -- Daimrod/Greg pgpICwhkLc485.pgp Description: PGP signature
Re: [O] bbdb or bbdb3 or org-contacts
Bastien writes: > Hi Dieter, > > Dieter Wilhelm writes: > >> What do you advise, what is already usable and what is the way >> ahead, still bbdb or bbdb3 or already org-contacts? > > BBDB is great. org-contacts.el is too slow when you have many > contacts, and it is not really maintained anymore. I've started to use org-contacts.el. I haven't (yet) problem with its speed but I've improved the completion mecanism which prevented me to use it. When I'll finish to document/comment it, I'll post it here. > Best, -- Daimrod/Greg pgps9yHOag0AE.pgp Description: PGP signature
Re: [O] bbdb or bbdb3 or org-contacts
joa...@verona.se writes: > Daimrod writes: > >> Bastien writes: >> >>> Hi Dieter, >>> >>> Dieter Wilhelm writes: >>> >>>> What do you advise, what is already usable and what is the way >>>> ahead, still bbdb or bbdb3 or already org-contacts? >>> >>> BBDB is great. org-contacts.el is too slow when you have many >>> contacts, and it is not really maintained anymore. >> >> I've started to use org-contacts.el. I haven't (yet) problem with its >> speed but I've improved the completion mecanism which prevented me to >> use it. When I'll finish to document/comment it, I'll post it here. > > I would be very interested in having a look. See the attached patch files. I still need to need to take into account what could be after the cursor vv ATM I only use this From: John [cursor]D ^^ But I would like to use this But it mostly works. > I migrated from bbdb to org-contacts, but it turned out to be too slow, > so now I mostly isearch for the contact I want. > > Recently I've bee thinking of trying a strategy where bbdb could act as > a cache for org-contacts, but I havent tried it yet. It shouldnt be too > hard I think. org-contacts can generate a list of all contacts, that you > then iterate and generate the bbdb database from. It might be a useful > addition in any case. I was thinking to add a cache mecanism directly to `org-contacts.el'. It would load the content of the contacts files the first time into the appropriate structure and then reread the files only when they changed. Moreover, `org-contacts.el' doesn't use the new parser from `org-element.el' ATM, and using it might improve the performance too. PS: Sorry for the double patch files but the `org-reverse-string' part hasn't been merged yet and I use it. From d075570c544d89d27eb7eb53fcc46dbb627aa480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Sat, 26 Jan 2013 22:27:51 +0100 Subject: [PATCH 1/2] Unify `org-id-reverse-string' and `org-babel-reverse-string' into `org-reverse-string' * lisp/org.el (org-reverse-string): Add `org-reverse-string' to reverse a string. * lisp/org-id.el(org-id-new, org-id-decode): Replace `org-id-reverse-string' by `org-reverse-string'. * lisp/ob-core.el(org-babel-trim): Replace `org-babel-reverse-string' by `org-reverse-string' and declare it. TINYCHANGE --- lisp/ob-core.el |9 +++-- lisp/org-id.el |7 ++- lisp/org.el |4 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index bdf8c54..27f665a 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -91,6 +91,7 @@ (declare-function org-escape-code-in-region "org-src" (beg end)) (declare-function org-unescape-code-in-string "org-src" (s)) (declare-function org-table-to-lisp "org-table" (&optional txt)) +(declare-function org-reverse-string "org" (string)) (defgroup org-babel nil "Code block evaluation and management in `org-mode' documents." @@ -2512,10 +2513,6 @@ If the table is trivial, then return it as a scalar." (match-string 1 cell)) cell) t)) -(defun org-babel-reverse-string (string) - "Return the reverse of STRING." - (apply 'string (reverse (string-to-list string - (defun org-babel-chomp (string &optional regexp) "Strip trailing spaces and carriage returns from STRING. Default regexp used is \"[ \f\t\n\r\v]\" but can be @@ -2530,8 +2527,8 @@ overwritten by specifying a regexp as a second argument." "Strip leading and trailing spaces and carriage returns from STRING. Like `org-babel-chomp' only it runs on both the front and back of the string." - (org-babel-chomp (org-babel-reverse-string -(org-babel-chomp (org-babel-reverse-string string) regexp)) + (org-babel-chomp (org-reverse-string +(org-babel-chomp (org-reverse-string string) regexp)) regexp)) (defvar org-babel-org-babel-call-process-region-original nil) diff --git a/lisp/org-id.el b/lisp/org-id.el index 39ca170..a68adcf 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -343,7 +343,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (unless (org-uuidgen-p unique) (setq unique (org-id-uuid ((eq org-id-method 'org) - (let* ((etime (org-id-reverse-string (org-id-time-to-b36))) + (let* ((etime (org-reverse-string (org-id-time-to-b36))) (postfix (if org-id-include-domain (progn (require 'message) @@ -376,9 +376,6 @@ So a typical ID could look like \"Org:4nd91V40HI\"
Re: [O] bbdb or bbdb3 or org-contacts
Bastien writes: > Hi Grégoire, > > Daimrod writes: > >> See the attached patch files. I still need to need to take into account >> what could be after the cursor > > I've applied the patch against org-contacts.el, thanks for it. Thank you. > Do you want write access to the repo for maintaining org-contacts.el? I would love to. I've made some changes to `org-contacts.el' and Joakim has been very kind to test them, but there is still a lot of room for improvements (and bugs). However, I think I'll keep my public repository on github to test new features and merge them into upstream when I think they're ready. And if people can test them before that, it's even better. >> Moreover, `org-contacts.el' doesn't use the new parser from >> `org-element.el' ATM, and using it might improve the performance >> too. > > Indeed! -- Daimrod/Greg pgpWOIookBxzg.pgp Description: PGP signature
Re: [O] bbdb or bbdb3 or org-contacts
Bastien writes: > Hi Greg, > > Daimrod writes: > >> However, I think I'll keep my public repository on github to test new >> features and merge them into upstream when I think they're ready. And if >> people can test them before that, it's even better. > > no problem, don't hesitate to share the patches. > > Thanks! I think I haven't been clear, I would like to have write access to the upstream repository to merge my changes, but I will also keep my github version as a "bleeding edge" version to make it easier to test and propose changes without pushing into the upstream repository. -- Daimrod/Greg pgpR2VqFi3Djt.pgp Description: PGP signature
Re: [O] LaTeX preview
Evan Misshula writes: > +1 This is great, I wanted to do something but did not know how. I > am going to look at the patch. I'm glad to know other people like it too :) > If you have an interest in explaining to an interested Noob what you > did. I would be grateful. Sure, I knew I wanted something like the inlineimages STARTUP keywords. So, I've searched in the source all references to inlineimages. M-x moccur-grep RET inlineimages RET I've found: a custom variable: `org-startup-with-line-images' an entry in `org-startup-options' Then I've searched for `org-startup-with-inline-images' and found: > (when org-startup-with-inline-images > (org-display-inline-images)) Then, I've searched the name of the function which toggled the latex preview. C-h a latex RET then C-s preview in the *Apropos* buffer. At this point I had everything and I just needed to copy what was done for inlineimages and adapt it for latexpreview. > Best, > Evan -- Daimrod/Greg pgpj9253qHCTK.pgp Description: PGP signature
Re: [O] [PATCH] org-contacts: Fix Agenda format.
Rüdiger Sonderfeld writes: > * contrib/lisp/org-contacts.el: Use `org-agenda-prefix-format' to > format entry instead of unused org-agenda-format. > > Signed-off-by: Rüdiger Sonderfeld > --- > contrib/lisp/org-contacts.el | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el > index 49bf489..5858a07 100644 > --- a/contrib/lisp/org-contacts.el > +++ b/contrib/lisp/org-contacts.el > @@ -544,9 +544,9 @@ This function should be called from > `gnus-article-prepare-hook'." >(let ((org-agenda-files (org-contacts-files)) > (org-agenda-skip-function > (lambda () (org-agenda-skip-if nil `(notregexp ,name > -(org-agenda-format (propertize > -"%(org-contacts-icon-as-string)% p% > s%(org-contacts-irc-number-of-unread-messages)%+T" > -'keymap org-contacts-keymap)) > +(org-agenda-prefix-format (propertize > +"%(org-contacts-icon-as-string)% > s%(org-contacts-irc-number-of-unread-messages) " > +'keymap org-contacts-keymap)) > (org-agenda-overriding-header > (or org-agenda-overriding-header > (concat "List of contacts matching `" name "':" Applied, thank you. -- Daimrod/Greg pgptohHZVV0AS.pgp Description: PGP signature
Re: [O] killing all contents of a headline
42 147 writes: > Title is self-explanatory. Is there a command that lets me place the > cursor on a headline and delete its contents (i.e., all of its text)? I don't think know if this command exists, but, assuming your cursor is on the headline you can: 1. copy the title (C-a C-c SPC C-e M-w) 2. cut the subtree (C-c C-x C-w) 3. paste the previously copied headline C-y M-y If you find yourself doing this very often you could put it in a keyboardmacro. -- Daimrod/Greg pgpytX_zwEwaR.pgp Description: PGP signature
Re: [O] org-sync and redmine
Hello Bastien, Bastien writes: > hob...@poukram.net (Rémi Letot) writes: >> So I get to ask if anyone that I'm not aware of is still currently >> working on org-sync, and if yes if they are interrested in fixing the >> redmine backend ? > > Daimrod is working on it and I think he is interested in the Redmine > sync too. Yes, I would like to get the redmine backend practical, but I need time to understand org-sync and time to work on it, and I don't expect to find the time before mid-april. > Daimrod, let me know if you want write access to org-sync.git repo > on orgmode.org, you could then merge your changes directly. I'm still only playing with org-sync and I don't fully understand the changes I've merged, so I won't push before I'm more confident with my understanding of org-sync. Unless Aurélien is against it, because he wants to discuss before changes are made, you can give me the write access and I'll merge when I could. -- Daimrod/Greg pgp45PrLKeLyB.pgp Description: PGP signature
Re: [O] org-mode not working properly after update
Sanjib Sikder writes: > Hi, Hi Sanjib, > Org-mode is not working properly after I updated my Ubuntu 12.04 > yesterday. During the update, emacs also got updated. The .org files > look like plain text file, for example, no tree structure, no folding > etc. Does `M-x org-mode RET' activate Org Mode after you've opened the file? Do you have « ("\\.org\\'" . org-mode) » in auto-mode-alist? (check with `C-h v auto-mode-alist RET') -- Daimrod/Greg pgpx8IeSCBN5j.pgp Description: PGP signature
Re: [O] [org-contacts] need help for making gnus/message-mode integration optional
Simon Campese writes: > Hello, Hi Simon, > I have one quick feature request for org-contacts.el that should be > pretty easy and quick to implement: Could someone please introduce > customizable variables to optionally disable the gnus/message mode > integration? I've added a custom boolean, `org-contacts-enable-completion', that you can set to nil to disable the `message-mode' integration. Thanks for reporting this. > I don't know a lot of elisp, so instead of copy-pasting my way to a > half-baked solution that would maybe not be accepted upstream, I thought > that asking the experts here is more appropriate. > > My reason for this request: > For email address completion in message mode, I use a program that scans > through my whole email database (I use notmuch to manage emails and have > all my mails stored locally). This program is stored in > 'notmuch-address-command' and the integration has so far been done by > 'notmuch-address'. However, the recent version of org-contacts breaks > this behaviour, i.e. I only get the emails from my org-contacts file > when I try to complete recipients. As I don't want to add all the people > I correspond with electronically to my org-contacts file, this is a huge > annoyance. Could you try the attached patch and set the variable `org-contacts-complete-exclusive' to nil and see if it still happens. With this patch org-contacts should fail silently to complete and let other functions do the completion, so it should complete with both org-contacts and notmuch. Regards, From 9eef3177dc401b49a902fcbcbdf86dc1d63865d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Wed, 27 Feb 2013 13:31:12 +0100 Subject: [PATCH] org-contacts.el: Add a custom variable to let others functions complete in `message-mode' * contrib/lisp/org-contacts.el (org-contacts-complete-exclusive): a custom boolean variable to let others functions complete in `message-mode'. (org-contacts-complete-group, org-contacts-complete-name): Use `org-contacts-complete-exclusive'. --- contrib/lisp/org-contacts.el | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 8674533..8189da2 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -138,6 +138,12 @@ This overrides `org-email-link-description-format' if set." :group 'org-contacts :type 'boolean) +(defcustom org-contacts-complete-exclusive t + "Determine whether `org-contacts-message-complete-function' +should be the only function to complete or not." + :group 'org-contacts + :type 'boolean) + ;; Decalre external functions and variables (declare-function wl-summary-message-number "ext:wl-summary" ()) (declare-function wl-address-header-extract-address "ext:wl-address") @@ -421,7 +427,10 @@ A group FOO is composed of contacts with the tag FOO." ", "))) ;; We haven't found the correct group (completion-table-case-fold completion-list - (not org-contacts-completion-ignore-case + (not org-contacts-completion-ignore-case))) + :exclusive (if org-contacts-complete-exclusive + 'yes + 'no)) (defun org-contacts-complete-name (start end string) "Complete text at START with a user name and email." @@ -445,7 +454,10 @@ A group FOO is composed of contacts with the tag FOO." (org-contacts-make-collection-prefix (org-contacts-all-completions-prefix string - (remove-duplicates completion-list :test #'equalp))) + (remove-duplicates completion-list :test #'equalp))) + :exclusive (if org-contacts-complete-exclusive + 'yes + 'no) (defun org-contacts-message-complete-function (&optional start) "Function used in `completion-at-point-functions' in `message-mode'." -- 1.7.10.4 -- Daimrod/Greg pgpJPNCKaneHS.pgp Description: PGP signature
Re: [O] suggest a small change in the doc for org-drill
Gijs Hillenius writes: Hi Gijs, > Load the file spanish.org. > > load? I've replaced it by "Open". Thanks for reporting this. -- Daimrod/Greg pgpd4frI70f1U.pgp Description: PGP signature
Re: [O] [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
Frank Terbeck writes: Hi Frank, Thank you for the report; however, I'm unsure about the right solution. There is a problem with the current (eval-when-compile ...) but there are still warnings when I compile it (with emacs -batch -f batch-byte-compile). > In org-contacts-db-need-update-p: > org-contacts.el:169:14:Warning: function `some' from cl package called at > runtime > > In org-contacts-filter: > org-contacts.el:211:37:Warning: function `some' from cl package called at > runtime > > In org-contacts-test-completion-prefix: > org-contacts.el:373:12:Warning: function `find-if' from cl package called at > runtime > > In org-contacts-complete-name: > org-contacts.el:445:71:Warning: function `remove-duplicates' from cl package > called at runtime Those warnings disapear if I simply (require 'cl) at toplevel but it triggers this warning: > org-contacts.el:40:1:Warning: cl package required at runtime @All: Can I use (require 'cl) and ignore the warning or is there better solution? -- Daimrod/Greg pgp2M1C9H7f_a.pgp Description: PGP signature
Re: [O] [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
Achim Gratz writes: > Daimrod writes: >> @All: Can I use (require 'cl) and ignore the warning or is there better >> solution? > > You could if this would never go into mainline, where it is not allowed > due to the namespace pollution that cl causes. You could use cl-lib > instead, but then this would be an Emacs-24 only solution. In general, > the stanza ((eval-when-compile (require 'cl)) only works as intended > when you are only using cl macros, but you seem to use defuns. You > could check how hard it is to replace these with plain elisp, aside from > syntactical inconveniences this is usually not a big problem. I've done this, thanks for the advice. > Regards, > Achim. -- Daimrod/Greg pgp6UPcFcxhRs.pgp Description: PGP signature
Re: [O] A mix of habits and effort estimates?
Marcin Borkowski writes: > Hi list, Hi Marcin, > say that I'd like to learn a new language or something. I'd like to > devote, say, 180 minutes to it each week. Does anyone have an idea how > to achieve something like that in Org-mode: > > * I create a task (say, "Learn Italian") > * I clock in/out when I start/stop doing this > * I have a few other tasks like that > * and somehow, org-magically, I can view a weekly report summarizing > whether I spent too much or too little time on different projects. > > Is such a thing possible in Org-mode? I suspect that it might be > doable, maybe with effort estimates and/or column view (which I don't > use, but I can as well start using it), but it might also require some > elisp hacking. Does anyone have a setup for something like this? Not exactly what you're looking for, but, there is org-drill[1] a « flashcards and spaced repetition » system that will "optimize" when to review items. [1] http://orgmode.org/worg/org-contrib/org-drill.html -- Daimrod/Greg pgp5Vm_wDduGZ.pgp Description: PGP signature
Re: [O] [patch] ox-latex.el to allow customization of verbatim environments (e.g., to use fancyvrb)
Eric Schulte writes: > -(concat (format "\\begin{verbatim}\n%s\\end{verbatim}" > -(org-export-format-code-default src-block info)) > +(concat (format "\\begin{%s}\n%s\\end{%s}" > +org-latex-verbatim-env > +(org-export-format-code-default src-block info) > +org-latex-verbatim-env) IIUC you don't need concat+format here. -- Daimrod/Greg pgp1eukSKehML.pgp Description: PGP signature
Re: [O] phone links...
Feng Shu writes: Hello Feng, > Bastien writes: > >> Hi Feng, >> >> Feng Shu writes: >> >>> [update diff] make output format more beautiful >> >> thanks for the patch -- at first sight, the formatting should be >> fixed, let's try to avoid lines longer than 80 characters. But in >> general, I'd be more comfortable with someone taking org-contacts.el >> in charge: I copy Grégoire as he proposed to do this. >> >> Thanks, > > Hi Bastien, > > I don't think this patch should be include into master, > I don't want people run between two different format. > > Now org-mobile can't show propertiy quickly ,may be it's only a tmp > solution of the problem. > > I want org-contact.el can manage this kind of format directly instead of > exporting, but it's beyond my ability for I'm not a programmer I agree with you, it would be much better if org-contacts managed links within properties. I'll look at Michael's patch which implements this. Regards, -- Daimrod/Greg pgpqvdRQNKLgp.pgp Description: PGP signature
Re: [O] phone links...
Michael Strey writes: Hello Michael, > On Tue, Apr 09, 2013 at 09:31:40AM +0200, Michael Strey wrote: > > [...] > >> The problem is on the side of org-contacts. Org-contacts does not >> support links in its properties. > [...] > >> This shortcoming effects not only the phone links but email links as >> well. > > Attached is a patch to allow org links in org-contacts properties. > It allows entries like in the following example without effecting > org-contacts current functions. > > #+BEGIN_SRC org > * Surname, Name > :PROPERTIES: > :EMAIL:mailto:te...@test.de; [[mailto:n...@test.de]] f...@bar.biz > :PHONE:[[tel:+49 351 4129535]], +491766626196 [[+49 (351) 41295-35]] > :END: > #+END_SRC > > Phone links of the form [[tel:+49 351 412 95-35][My phone number]] or > [[tel:+49 351 41295-35]] are expected. `-', `/', `(', `)' and > whitespace characters are allowed in telephone numbers. Thank you for your patch, though here are a few suggestions: - It looks like `chomp' does the same thing the `org-trim' (in `org.el') if so you should use it. - You should use `org-link-display-format' instead of `org-contacts-strip-link'. - You have done some unrelated changes (fix some typos, ...), could you provide a separated patches for them? Regarding `org-contacts-split-property', I haven't found anything about multiple values within a node property in `org-element' and the syntax description doesn't mention it, so you were right to roll your own. :) However, I think it would be better to store the separators in a variable (like `org-contacts-property-values-separator') and maybe even to use it by default instead of `split-string-default-separators' because we use it more and because it's easy to forget. > +(loop for email in (org-contacts-split-property email-list) > + for gravatar = (gravatar-retrieve-synchronously > (org-contacts-strip-link email)) What do you think? Thanks again for your time! Regards, -- Daimrod/Greg pgpXWsW7sSTeB.pgp Description: PGP signature
Re: [O] phone links...
Feng Shu writes: > Daimrod writes: > >> >> I agree with you, it would be much better if org-contacts managed >> links >> within properties. > I think the two format have less difference > > org-android and org-android-NG can't show properties like outline, > I expect to see the implement of this feature Hmm, I don't understand what you want. Do you need the outline format: - to use it with another application/mode? - to quickly show/hide contacts information? - to support links? - something else? Regards, -- Daimrod/Greg pgpa_kck71TLW.pgp Description: PGP signature
Re: [O] phone links...
Michael Strey writes: >> - You should use `org-link-display-format' instead of >> `org-contacts-strip-link'. > > I don't think so. `org-link-display-format' returns the description of > the link if there is one. My `org-contacts-strip-link' always returns > the target. Using `org-link-display-format' would lead to wrong results > with links like > [[mailto:f...@bar.com][foo (at) bar (dot) com]] > [[tel:+49 351 4129535][+49 (0)351 4129535]] You're right, I had misunderstood the function. >> - You have done some unrelated changes (fix some typos, ...), could you >> provide a separated patches for them? > > Oh =:-|, another struggle with Git. I'm still learning and will do my best. If you're not already using magit[1] I highly recommend it to you. You can use it to commit only a portion of the changes (you can also do it with "git commit --interactive" but I find it easier with magit). >> Regarding `org-contacts-split-property', I haven't found anything about >> multiple values within a node property in `org-element' and the syntax >> description doesn't mention it, so you were right to roll your own. :) > > That wasn't me. This (disputable) feature was already there for the > :EMAIL: proprerty. Actually, I don't like multiple values within a node > property and would prefer a VCard-like syntax like > > #+BEGIN_SRC org > *** Strey, Michael > :PROPERTIES: > :KIND: individual > :ORG: STREY Consult > :FN: Michael Strey > :N:Strey;Michael;; > :ADR;TYPE=home:;;my street;my city;federal state;post code;my country > :EMAIL: mailto:st...@myprovider.de > :EMAIL;PREF=1:mailto:m...@mycompany.biz > :TEL;TYPE="fax,work":[[tel:0321 21104568]] > :TEL;TYPE="fax,home":[[tel:0351 4129535]] > :TEL;TYPE="voice,home":[[tel:0351 4129535]] > :LANG: de > :ICON: ~/GTD/Icons/icon-strey_michael.jpg > :END: > #+END_SRC I must admit I am unsure about this. On one side it does solve some problems, on the other side I don't really like the idea of adding this extra syntax on top of properties. I think it's fine to use semicolons to separate values in node properties, but I would like to expose a clean API to manipulate users and user's properties so that we don't have to use `*-split-*' everywhere. For example it could expose your previous example into this: #+BEGIN_SRC lisp '((kind "individual") (org "STREY Consult") (fn "Michael Strey") (n ("Stry" "Michael" "")) (adr ("" "" "my street" "my city" "federal state" "post code" "my country") :type home) (email "mailto:st...@myprovider.de";) (email "mailto:m...@mycompany.biz"; :pref 1) (tel "[[tel:0321 21104568]]" :type "fax,work") (tel "[[tel:0351 4129535]]" :type "fax,home") (tel "[[tel:0351 4129535]]" :type "voice,home") (lang "de") (icon "~/GTD/Icons/icon-strey_michael.jpg")) #+END_SRC >> However, I think it would be better to store the separators in a >> variable (like `org-contacts-property-values-separator') and maybe even >> to use it by default instead of `split-string-default-separators' >> because we use it more and because it's easy to forget. > > That was already hard-coded before in Feng's > `org-contacts-vcard-format'. But yes, you are right. Since it is > limited by some constraints we should make it an extra variable. > >> >> > +(loop for email in (org-contacts-split-property >> > email-list) >> >> >> > + for gravatar = (gravatar-retrieve-synchronously >> > (org-contacts-strip-link email)) > > This should be correctly and worked for me during my tests. > Confusingly `email-list' is not a list but a string here. My bad (again :/). Regards, 1. https://github.com/magit/magit -- Daimrod/Greg pgpA1Yp4mnukl.pgp Description: PGP signature
Re: [O] [Patch] phone links...
Michael Strey writes: > Greg, > > Here are the reworked patches. > > 0390: fixes two typos > 0391: contains all the changes from my last patch and your corrections > 0392: introduces a constant for the default value of separators Excellent. > On Sat, Apr 20, 2013 at 05:59:39PM +0200, Daimrod wrote: >> Michael Strey writes: > >> > Oh =:-|, another struggle with Git. I'm still learning and will do my >> > best. >> >> If you're not already using magit[1] I highly recommend it to you. You >> can use it to commit only a portion of the changes (you can also do it >> with "git commit --interactive" but I find it easier with magit). > > Thanks for the hint. It helped a lot. Merged & pulled. Thanks! -- Daimrod/Greg pgpTZPr3RPNGv.pgp Description: PGP signature
Re: [O] [Bug] org-startup-with-inline-images
(setq at (org-inside-LaTeX-fragment-p)) + (goto-char (max (point-min) (- (cdr at) 2))) + (org-back-to-heading)) + (setq beg (point) end (progn (outline-next-heading) (point)) + msg (if at "Creating image...%s" + "Creating images for entry...%s" + (message msg "") + (narrow-to-region beg end) + (goto-char beg) + (org-format-latex + (concat org-latex-preview-ltxpng-directory (file-name-sans-extension + (file-name-nondirectory + buffer-file-name))) + default-directory 'overlays msg at 'forbuffer + org-latex-create-formula-image-program) + (message msg "done. Use `C-c C-c' to remove images.")) (defun org-format-latex (prefix &optional dir overlays msg at forbuffer processing-type) @@ -18747,53 +18748,54 @@ When REFRESH is set, refresh existing images between BEG and END. This will create new image displays only if necessary. BEG and END default to the buffer boundaries." (interactive "P") - (unless refresh -(org-remove-inline-images) -(if (fboundp 'clear-image-cache) (clear-image-cache))) - (save-excursion -(save-restriction - (widen) - (setq beg (or beg (point-min)) end (or end (point-max))) - (goto-char beg) - (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" - (substring (org-image-file-name-regexp) 0 -2) - "\\)\\]" (if include-linked "" "\\]"))) - (case-fold-search t) - old file ov img type attrwidth width) - (while (re-search-forward re end t) - (setq old (get-char-property-and-overlay (match-beginning 1) - 'org-image-overlay) - file (expand-file-name - (concat (or (match-string 3) "") (match-string 4 - (when (image-type-available-p 'imagemagick) - (setq attrwidth (if (or (listp org-image-actual-width) -(null org-image-actual-width)) -(save-excursion - (save-match-data -(when (re-search-backward - "#\\+attr.*:width[ \t]+\\([^ ]+\\)" - (save-excursion - (re-search-backward "^[ \t]*$\\|\\`" nil t)) t) - (string-to-number (match-string 1)) - width (cond ((eq org-image-actual-width t) nil) - ((null org-image-actual-width) attrwidth) - ((numberp org-image-actual-width) - org-image-actual-width) - ((listp org-image-actual-width) - (or attrwidth (car org-image-actual-width - type (if width 'imagemagick))) - (when (file-exists-p file) - (if (and (car-safe old) refresh) - (image-refresh (overlay-get (cdr old) 'display)) - (setq img (save-match-data (create-image file type nil :width width))) - (when img - (setq ov (make-overlay (match-beginning 0) (match-end 0))) - (overlay-put ov 'display img) - (overlay-put ov 'face 'default) - (overlay-put ov 'org-image-overlay t) - (overlay-put ov 'modification-hooks - (list 'org-display-inline-remove-overlay)) - (push ov org-inline-image-overlays) + (when (display-graphic-p) +(unless refresh + (org-remove-inline-images) + (if (fboundp 'clear-image-cache) (clear-image-cache))) +(save-excursion + (save-restriction + (widen) + (setq beg (or beg (point-min)) end (or end (point-max))) + (goto-char beg) + (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" + (substring (org-image-file-name-regexp) 0 -2) + "\\)\\]" (if include-linked "" "\\]"))) + (case-fold-search t) + old file ov img type attrwidth width) + (while (re-search-forward re end t) + (setq old (get-char-property-and-overlay (match-beginning 1) + 'org-image-overlay) + file (expand-file-name + (concat (or (match-string 3) "") (match-string 4 + (when (image-type-available-p 'imagemagick) + (setq attrwidth (if (or (listp org-image-actual-width) + (null org-image-actual-width)) + (save-excursion +(save-match-data + (when (re-search-backward + "#\\+attr.*:width[ \t]+\\([^ ]+\\)" + (save-excursion + (re-search-backward "^[ \t]*$\\|\\`" nil t)) t) + (string-to-number (match-string 1)) + width (cond ((eq org-image-actual-width t) nil) +((null org-image-actual-width) attrwidth) +((numberp org-image-actual-width) + org-image-actual-width) +((listp org-image-actual-width) + (or attrwidth (car org-image-actual-width + type (if width 'imagemagick))) + (when (file-exists-p file) + (if (and (car-safe old) refresh) + (image-refresh (overlay-get (cdr old) 'display)) + (setq img (save-match-data (create-image file type nil :width width))) + (when img + (setq ov (make-overlay (match-beginning 0) (match-end 0))) + (overlay-put ov 'display img) + (overlay-put ov 'face 'default) + (overlay-put ov 'org-image-overlay t) + (overlay-put ov 'modification-hooks + (list 'org-display-inline-remove-overlay)) + (push ov org-inline-image-overlays)) (define-obsolete-function-alias 'org-display-inline-modification-hook 'org-display-inline-remove-overlay "24.3") -- 1.7.10.4 -- Daimrod/Greg pgp8Ee38tqMON.pgp Description: PGP signature
Re: [O] [Bug] org-startup-with-inline-images
Rick Frankel writes: > On 01.05.2013 13:28, Daimrod wrote: >> Thanks for the report, I've attached a patch that fixes this problem >> (in >> both `org-display-inline-images' and `org-preview-latex-fragment'). >> However I don't know if it is the right approach or if I should try >> to >> narrow this to lower-level functions. >> >> I know that `clear-image-cache' raise this error but I haven't tried >> to >> see if it the only one. Should I try to look more at it and add a >> `org-clear-image-cache' which will check if a graphic display is >> available or is the current solution fine? > > Looks good. No, I tried narrowing it down myself and it breaks in amy > other places in org-display-inline-images if you don't simply cond out > the entire function. Fixed in master, thanks again for your report! Regards, -- Daimrod/Greg pgpTI5qaAOJNF.pgp Description: PGP signature
Re: [O] [PATCH] Smart inference of task progress when exporting to TJ3
Martin writes: Hello Martin, Thanks for your patch. I will only make a few stylistic remarks. 1. Could you add `contrib/lisp/ox-taskjuggler.el:' to the subject? (The first line of the commit message) 2. IIUC you don't need the TINYCHANGE cookie because the changes are made in contrib/ which doesn't require copyright assignment. Furthermore, I don't think your changes could be considered `tiny' (it changes more than 20 lines and doesn't look like a rewrite). 3. Could you reformat a bit your code so it fit in 80 column? (You can often use M-q for the comments) -- Daimrod/Greg pgp8MNzaVlSsW.pgp Description: PGP signature
[O] bug#14374: bug#14374: Possibly incorrect custom :types
Glenn Morris writes: Hi Glenn, Thanks for this detailled report. May I ask how you did you tests? I can't find cus-test.el in my Emacs. I've attached a diff patch where I fix some of this. > Package: org-mode > > cus-test.el suggests the following variables may have incorrect > custom :types. (There may be some false positives.) > This refers to Org mode in current Emacs trunk. > > Eg, org-footnote-auto-adjust does not have "nil" as an option. > org-refile-target-verify-function It's a function with no function by default and I don't know how to fix it. Should we use '(choice function nil)? > org-icalendar-combined-description Seems fine to me. > org-link-frame-setup Patched (I've only interferred the functions name could VM users confirmed that they are correct). > org-export-with-archived-trees Patched. > org-bibtex-prefix It's suppose to be a string and after a quick look at the code I think it's safe to set it to nil but I'm not sure. > org-log-note-headings Patched. > org-structure-template-alist Patched. > org-export-html-postamble-format I think it's named `org-html-postamble-format' in master. The docstring and the type talks about an alist but the default value is not. I don't know which one is correct (the default value or the description). > org-get-priority-function Same problem than `org-refile-target-verify-function'. > org-export-odt-content-template-file Now `org-odt-content-template-file', the type is a file but the default value is nil. Should we use '(choice file nil)? > org-export-latex-quotes I couldn't find this variable in master. > org-export-html-toplevel-hlevel Now `org-html-toplevel-hlevel' and it doesn't seem to be wrong. > org-agenda-ndays The type is an integer but the default value is nil. Should we use '(choice integer nil)? I've just seen Carsten's mail so I'll stop here. > org-export-initial-scope > org-plantuml-jar-path > org-export-blocks-witheld > org-make-link-description-function > org-export-html-postamble > org-babel-lob-files > org-agenda-export-html-style > org-clock-heading-function > org-show-notification-handler > org-agenda-custom-commands > org-beamer-outline-frame-options > org-agenda-day-face-function > org-use-fast-tag-selection > org-export-docbook-xsl-fo-proc-command > org-link-translation-function > org-export-docbook-xslt-stylesheet > org-export-docbook-xslt-proc-command > org-columns-modify-value-for-display-function > org-export-html-preamble-format > org-agenda-auto-exclude-function > org-export-docbook-doctype > org-wl-namazu-default-index > org-agenda-inactive-leader > org-export-ascii-underline > org-sparse-tree-default-date-type > org-footnote-auto-adjust > org-protocol-default-template-key defcustom-fixes.path Description: Binary data -- Daimrod/Greg pgp38ECem9JSK.pgp Description: PGP signature
Re: [O] require a feature: merge many contacts which have the same name.
Feng Shu writes: > I think org-contacts.el shoule have the feature which can merge many > contacts which have the same name into one, for example: > #+begin_example > > * name > :PROPERTIES: > :EMAIL: [[mailto:a...@a.com]] [[mailto:b...@b.com]] > :PHONE: [[tel:123456789]] > :ALIAS:a > :END: > > * name > :PROPERTIES: > :EMAIL: [[mailto:c...@a.com]] [[mailto:d...@b.com]] > :PHONE: [[tel:987654321]] > :ALIAS:b > :END: > > * name > :PROPERTIES: > :EMAIL: [[mailto:e...@a.com]] [[mailto:f...@b.com]] > :PHONE: [[tel:111]] > :ALIAS:c > :END: > > > #+end_example > > how can I get the result: > #+begin_example > * name > :PROPERTIES: > :EMAIL: [[mailto:a...@a.com]] [[mailto:b...@b.com]] [[mailto:c...@a.com]] > [[mailto:d...@b.com]] [[mailto:e...@a.com]] [[mailto:f...@b.com]] > :PHONE: [[tel:123456789]] [[tel:987654321]] [[tel:]] > :ALIAS: a b c > :END: > > #+end_example Hi Feng, It's noted, I'll see what I can do this week-end. -- Daimrod/Greg pgpgoAyLvZ17T.pgp Description: PGP signature
[O] org-element
Hi, I'm playing a bit with org-element for org-contacts and I wanted to know what is the prefered way to change an element. For example, ATM, when I want to change an element property to add a new value, I do: #+BEGIN_SRC emacs-lisp (org-entry-put nil property (concat (org-entry-get nil property) " " new-value)) #+END_SRC Is it the correct way? IMHO it would be nicer if we could modify an object created by the new parser and write it back but I don't think it is possible (yet?). Regards, -- Daimrod/Greg pgpZ70aTA0Nyn.pgp Description: PGP signature
Re: [O] org-element
Nicolas Goaziou writes: > Hello, Hello Nicolas, > Daimrod writes: > >> I'm playing a bit with org-element for org-contacts and I wanted to know >> what is the prefered way to change an element. >> >> For example, ATM, when I want to change an element property to add a new >> value, I do: >> >> #+BEGIN_SRC emacs-lisp >> (org-entry-put nil property >> (concat (org-entry-get nil property) >> " " new-value)) >> #+END_SRC > > See `org-element-put-property' and friends. I've tried to use `org-element-put-property' but it only modifies the object in memory, not the element in the file. Is there a way to write the object into a file? > Regards, -- Daimrod/Greg pgpx5qxLaG4B3.pgp Description: PGP signature
Re: [O] [PATCH] org-contacts.el: add expire feature
acts-tel-property properties))) > + (expire (cdr (assoc-string org-contacts-expire-property properties))) >(note (cdr (assoc-string org-contacts-note-property properties))) >(bday (org-contacts-vcard-escape (cdr (assoc-string > org-contacts-birthday-property properties >(addr (cdr (assoc-string org-contacts-address-property properties))) >(nick (org-contacts-vcard-escape (cdr (assoc-string > org-contacts-nickname-property properties >(head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name)) > + (expire-list (when expire (setq expire-list > (org-contacts-split-property expire >emails-list result phones-list) > (concat head > (when email (progn > - (setq emails-list (org-contacts-split-property email)) > + (setq emails-list > (org-contacts-remove-expired-property expire-list > (org-contacts-split-property email))) ; There is a leading semi-colon. > (setq result "") > (while emails-list > (setq result (concat result "EMAIL:" > (org-contacts-strip-link (car emails-list)) "\n")) > @@ -886,7 +908,7 @@ to do our best." > (when addr > (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr))) > (when tel (progn > - (setq phones-list (org-contacts-split-property tel)) > + (setq phones-list (org-contacts-remove-expired-property > expire-list (org-contacts-split-property tel))) > (setq result "") > (while phones-list > (setq result (concat result "TEL:" > (org-contacts-strip-link (car phones-list)) "\n")) > -- > 1.7.10.4 [1] http://orgmode.org/worg/org-contribute.html#sec-5 -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts.el: add expire feature
Feng Shu writes: > (defun org-contacts-complete-name (start end string) >"Complete text at START with a user name and email." >(let* ((completion-ignore-case org-contacts-completion-ignore-case) > @@ -484,10 +497,17 @@ A group FOO is composed of contacts with the tag FOO." > ;; The contact name is always the car of the assoc-list > ;; returned by `org-contacts-filter'. > for contact-name = (car contact) > + > + ;; Build the list of the email addresses which has > + ;; been expired > + for expire-list = (org-contacts-split-property (or > + (cdr > (assoc-string org-contacts-expire-property > + >(caddr contact))) "")) > ;; Build the list of the user email addresses. > - for email-list = (org-contacts-split-property (or > - (cdr (assoc-string > org-contacts-email-property > -(caddr > contact))) "")) > + for email-list = (org-contacts-remove-expired-property > expire-list > + > (org-contacts-split-property (or > + > (cdr (assoc-string org-contacts-email-property > + > (caddr contact))) ""))) I forgot to ask, why do you also modify org-contacts-complete-name? This function isn't used to export to VCARD, but to complete the email in Gnus. -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts.el: add expire feature
Feng Shu writes: > Daimrod writes: > >> >> This is not very idiomatic elisp, I would write something more like: >> #+BEGIN_SRC emacs-lisp >> (remove-if (lambda (el) >>(member el expire-list)) >> list) >> #+END_SRC > > Thanks! > > Is this possible? > > test1@g = te...@gmail.com Yes, you could do it like this: #+BEGIN_SRC emacs-lisp (remove-if (lambda (el) (find-if (lambda (x) (string-match-p x el)) expire-list)) list) #+END_SRC This way you can use regular expressions in the ignore list. -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts.el: add expire feature
Feng Shu writes: > Hi Daimrod! > This is the 3 updated patch, if possible, please include it to master. It's merged and pushed. I've also pushed another commit to fix the formatting in some parts of the code and I've found a bug in `org-contacts-split-property', but it should be fixed now. > Thanks for your help! -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [Patch] phone links...
Michael Strey writes: Hello Michael, While merging a patch (from Feng Shu) I have found a bug in `org-contacts-split-property'. Though the docstring says that OMIT-NULLS is forced to t when SEPARATORS is nil (just like `split-string'), it wasn't the case. I've pushed a fix; could you check on your side that it doesn't break anything in your workflow? Thanks, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts.el: add expire feature
Karl Voit writes: Hi Karl, > This is a very good patch, fixing an issue I also do have currently. I am curious, what was the issue? Regards, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] Handling outdated contact information
Karl Voit writes: > * Daimrod wrote: >> >> Hi Karl, > > Hi Daimrod! > >>> This is a very good patch, fixing an issue I also do have currently. >> >> I am curious, what was the issue? > > Sure: I do use contacts.org by myself and I tend to collect data > about people and never delete any. For example, previously used > phone numbers are quite handy in order to get a connection between > old text messages or phone call logs and a person. > > However, I do not want to mess up current phone numbers with old > ones. > > With this ignore feature, I am able to address this issue (in the > future). For now, I do not export contact information from Org-mode > to somewhere else (except: lbdb -> mutt). In the future, I plan to > add a workflow that gets contact information form Org-mode (my > central point of information) to my phone and so forth. I see, thanks for the explanation. -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [patch] Add a complex org-contacts template to the file header
Feng Shu writes: Thanks for the patch! It's merged, I've taken the liberty to fix some typos. Regards, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts: Provide ordering when using cycle completion
Øyvind Stegard writes: > Hello list, Hello, Merged into master, thanks for patch! > I have recently switched to using org-contacts, after several years of > BBDB usage. When completing contacts in message-mode, I prefer cycling > the completion alternatives, for instance when a single contact has > multiple email addresses. So I set `completion-cycle-threshold' to some > value other than nil. > > However, the cycle ordering was not consistent with the order in which > email addresses appeared in the contact (actually, cycle order was > shortest candidate first, which I understand is a default). So the > "preferred" email address (or the first one defined in :EMAIL: property > of contact node) was typically not always chosen as first completion > suggestion in the cycle. > > I attach a patch here (against current org-mode git) which also provides > the display sort function for cycle completions in metadata. That seems > to resolve the problem for me. > > > Regards, > > Øyvind Stegard > -- > < Øyvind Stegard > < http://stegard.net/ > > > From 64623274f0a040c452df43b2a3f7b23b0af8fd57 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?=C3=98yvind=20Stegard?= > Date: Mon, 10 Jun 2013 11:08:56 +0200 > Subject: [PATCH] org-contacts: Provide ordering when using cycle completion > > * contrib/lisp/org-contacts.el (org-contacts-metadata-prefix): > Provide same function for cycle ordering as is used for display ordering > in completion metadata. > > When using cycle completion style for contacts, by setting > `completion-cycle-threshold' to some value, the ordering was not consistent > with order of email addresses in contact definition, nor the order > which was used for regular display completion. Fix that by also > supplying sort function for cycle completion in metadata. > --- > contrib/lisp/org-contacts.el | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el > index 5d63fcc..71f7bf4 100644 > --- a/contrib/lisp/org-contacts.el > +++ b/contrib/lisp/org-contacts.el > @@ -452,7 +452,8 @@ prefixes rather than just the beginning of the string." > > (defun org-contacts-metadata-prefix (string collection predicate) >'(metadata . > - ((display-sort-function . org-contacts-display-sort-function > + ((cycle-sort-function . org-contacts-display-sort-function) > + (display-sort-function . org-contacts-display-sort-function > > (defun org-contacts-complete-group (start end string) >"Complete text at START from a group. -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] Circular lists/shared structures in org-element parse-tree
Thorsten Jolitz writes: > Hi List, > > I wonder how I can find out in a (elisp) program the points in the parse > tree (returned by org-element-parse-buffer) where shared structures are > used. > > In the read-syntax, its easy to see (especially with `print-circle' set > to non-nil): > > #+begin_src emacs-lisp > #2=(org-data nil #1=(headline (:raw-value "header 1" >[...] :parent #2#) [...] > #+end_src > > but when processing the parse tree as a list in elisp, how can I detect the > fact that > > , > | :parent #2# > ` > > refers to > > ,- > | #2=(org-data nil > `- > > i.e. points back to an already existing structure? AFAIK you have to track all pointers inspected to see if one has already be seen. For example, I've implemented a version of equal[1] to compare this kind of lists (to add tests to org-sync). [1] https://github.com/daimrod/Emacs-config/blob/master/elisp/dmd-utils.el#L25 -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts: Update contacts cache if it contains markers with no buffer
Øyvind Stegard writes: > Hi list, Hello, > In contrib/lisp/org-contacts.el: > > The function `org-contacts-db-need-update-p' does two checks to > determine if the contacts cache should be updated: > 1. If the variable `org-contacts-last-update' is nil. > 2. If modification time of any file containing contacts is more recent than >timestamp recorded in `org-contacts-last-update'. > > There is another case where an update is required: when marker objects > contained in the contact cache `org-contacts-db' suddenly point to no > buffer. If a buffer containing contacts is killed, but underlying file > is not modified, org-contacts will not detect this, and cached markers > that pointed to the now killed buffer will become dead (have no buffer > associated with them). This seems to cause problems at least in > `org-contacts-anniversaries', which if used as diary sexp in an agenda > file, will cause "Bad sexp" errors. > > I have not done any thorough analysis of `org-contacts-anniversaries' > itself, but it seems to work OK whenever the markers in > `org-contacts-db' are OK. And it looks like the markers are used in that > code. > > To reproduce: > 1. Load up org-contacts and do a query with "M-x org-contacts". > 2. Kill at least one org-buffer containing a contact with BIRTHDAY >property set (but do not save underlying file). > 3. Make sure to use %%(org-contacts-anniversaries) in some agenda file. > 4. Opening agenda should produce a "Bad sexp" error. > > > I've attached a patch (against git master) which I am currently using. > It will cause org-contacts to re-load if a marker is found in cache that > points to no buffer. This looked to me like the quickest approach for > fixing it without getting to know org-contacts.el better. > Thanks for the bug report! Don't you think that checking if one of the buffer would be enough and faster? With something like (every #'get-file-buffer org-contacts-files) > > Regards, > > Øyvind -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts: Update contacts cache if it contains markers with no buffer
Øyvind Stegard writes: > Daimrod writes: > > [...] > >> Thanks for the bug report! >> >> Don't you think that checking if one of the buffer would be enough and >> faster? >> With something like (every #'get-file-buffer org-contacts-files) > > Hi, > > I thought about that, yes. But what about when an org-contacts buffer is > killed and subsequently re-opened (like using `find-alternate-file' with > same file name). Then the buffer will exist for the file, but it will be > a new instance, and the markers in org-contacts-db will still be dead. > That's why I decided to just check the markers instead. You're right, good catch! I've installed the patch and haven't felt any slowdown, but I've a small contacts file. If people complain about slowdown we could add a buffer local hook to ask before killing contacts files. > Regards, > > Øyvind -- Daimrod/Greg signature.asc Description: PGP signature
[O] ':post' Direct execution via Emacs Lisp
Hi, We can read in the manual: 14.8.2.25 ‘:post’ The ‘:post’ header argument is used to post-process the results of a code block execution. When a post argument is given, the results of the code block will temporarily be bound to the ‘*this*’ variable. This variable may then be included in header argument forms such as those used in *note var:: header argument specifications allowing passing of results to other code blocks, or direct execution via Emacs Lisp. ^^^ IIUC, it means that we can post process the data in Emacs Lisp, that is, by calling an Emacs Lisp function, not another source block. However, the example only shows how to do it with another source block. Is my understanding correct or not? If so, how can I post process the result with an Emacs Lisp function? Cheers, -- Daimrod/Greg
[O] [BUG] Bad escape with Babel + org-mode
Hi, I've encountered a bug when using org-mode in source blocks. I'm using the latest version of org-mode from git: Org-mode version 8.3beta (release_8.3beta-1195-g1a7364 [...]) I have no problem with the following snippet: #+BEGIN_SRC org ,* test 1 ,* test 2 ,* test 3 ,* test 4 ,* test 5 ,* test 6 ,* test 7 ,* test 8 ,* test 9 ,* test 10 #+END_SRC But I have an error with this one when I hit C-' to go back to my org file: error in `org-escape-code-in-region'> while: Invalid search bound (wrong side of point) #+BEGIN_SRC org ,* test 1 ,* test 2 ,* test 3 ,* test 4 ,* test 5 ,* test 6 ,* test 7 ,* test 8 ,* test 9 ,* test 10 ,* test 11 #+END_SRC And with the following snippet: #+BEGIN_SRC org ,* test 1 ,* test 2 ,* test 3 ,* test 4 ,* test 5 ,* test 6 ,* test 7 ,* test 8 ,* test 9 ,* test 10 ,* test 11 ,* test 12 #+END_SRC When I hit C-' to go back to the org file the block isn't properly escaped, it becomes: #+BEGIN_SRC org ,* test 1 ,* test 2 ,* test 3 ,* test 4 ,* test 5 ,* test 6 ,* test 7 ,* test 8 ,* test 9 ,* test 10 ,* test 11 * test 12 #+END_SRC I've tried to understand what's the problem and it looks like the position returned by `re-search-forward' in `org-escape-code-in-region' is wrong, but I don't know why. By wrong, I mean that the position returned isn't immediately after the expression found but slightly after, and the error increases which is why it doesn't fail with 10 items or less. e.g. * test 1 ^ point * test 2 ^ point * test 3 ^ point ... Best, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [BUG] Bad escape with Babel + org-mode
Nicolas Goaziou writes: > Hello, > > Daimrod writes: > >> I've encountered a bug when using org-mode in source blocks. I'm using >> the latest version of org-mode from git: >> Org-mode version 8.3beta (release_8.3beta-1195-g1a7364 [...]) >> >> I have no problem with the following snippet: >> #+BEGIN_SRC org >> ,* test 1 >> ,* test 2 >> ,* test 3 >> ,* test 4 >> ,* test 5 >> ,* test 6 >> ,* test 7 >> ,* test 8 >> ,* test 9 >> ,* test 10 >> >> #+END_SRC >> >> But I have an error with this one when I hit C-' to go back to my org >> file: >> >> error in `org-escape-code-in-region'> while: Invalid search bound (wrong >> side of point) >> #+BEGIN_SRC org >> ,* test 1 >> ,* test 2 >> ,* test 3 >> ,* test 4 >> ,* test 5 >> ,* test 6 >> ,* test 7 >> ,* test 8 >> ,* test 9 >> ,* test 10 >> ,* test 11 >> >> #+END_SRC >> >> And with the following snippet: >> #+BEGIN_SRC org >> ,* test 1 >> ,* test 2 >> ,* test 3 >> ,* test 4 >> ,* test 5 >> ,* test 6 >> ,* test 7 >> ,* test 8 >> ,* test 9 >> ,* test 10 >> ,* test 11 >> ,* test 12 >> #+END_SRC >> >> When I hit C-' to go back to the org file the block isn't properly >> escaped, it becomes: >> >> #+BEGIN_SRC org >> ,* test 1 >> ,* test 2 >> ,* test 3 >> ,* test 4 >> ,* test 5 >> ,* test 6 >> ,* test 7 >> ,* test 8 >> ,* test 9 >> ,* test 10 >> ,* test 11 >> * test 12 >> #+END_SRC > > Fixed in f91d194d4fe4644de9cac94a807a08c220ab521d. Thank you. Confirmed. Thanks ! > Regards, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] Filters lost after reviving buried, sticky agenda
Daniel Borchmann writes: > Dear all, > > I regularly lose all my filters when I bury a sticky agenda and revive > it later. In that case, the variable `org-agenda-tag-filter' is set to > nil, although it was non-nil before burying. > > I played around a bit, and found out that `org-agenda-tag-filter' is > buffer-local (which is not a surprise). When the agenda buffer is > revived, the function `org-agenda-prepare' is called, which, among > others, should reset the filters (provided that > `org-agenda-persistent-filter' is set). The beginning of the function > is > > --->8--- > (defun org-agenda-prepare (&optional name) > (let ((filter-alist (if org-agenda-persistent-filter > (list `(tag . ,org-agenda-tag-filter) > `(re . ,org-agenda-regexp-filter) > `(car . ,org-agenda-category-filter) > ...)) > ---8<--- > > It seems to me that `org-agenda-tag-filter' is read *before* the old > agenda buffer is poped up (i.e., made current), and thus results in a > `nil' value. Indeed, if I replace the definition of `filter-alist' by > > --->8--- > (let ((filter-alist (if org-agenda-persistent-filter > (with-current-buffer > (get-buffer org-agenda-buffer-name) > (list `(tag . ,org-agenda-tag-filter) > `(re . ,org-agenda-regexp-filter) > `(car . ,org-agenda-category-filter)) > ...) > ---8<--- > > then the bug (seems to) disappear. > > My question is now: is this correct, or did I understand something > wrong? If my understanding is correct, how this bug be fixed more > elegantly? It doesn't work at startup when agenda hasn't been built yet. The following patch does seem to fix that. If it's ok, I can push it. From d2e8fef81585c249f33fa37260f6228709a67017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Fri, 12 Jun 2015 17:35:30 +0200 Subject: [PATCH] lisp/org-agenda.el : Fix non-persistent filters when refreshing sticky agenda * lisp/org-agenda.el (org-agenda-prepare): Fix non-persistent filters when refreshing sticky agenda When a sticky agenda is buried, then reviving and refreshing, existing filters are ignored even when org-agenda-persistent-filter is `t'. Reported and fixed by Daniel Borchmann --- lisp/org-agenda.el | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index f5d1022..3a1f5bc 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3642,10 +3642,11 @@ FILTER-ALIST is an alist of filters we need to apply when (defun org-agenda-prepare (&optional name) (let ((filter-alist (if org-agenda-persistent-filter - (list `(tag . ,org-agenda-tag-filter) -`(re . ,org-agenda-regexp-filter) -`(effort . ,org-agenda-effort-filter) -`(car . ,org-agenda-category-filter) + (with-current-buffer + (get-buffer-create org-agenda-buffer-name) + (list `(tag . ,org-agenda-tag-filter) + `(re . ,org-agenda-regexp-filter) + `(car . ,org-agenda-category-filter)) (if (org-agenda-use-sticky-p) (progn (put 'org-agenda-tag-filter :preset-filter nil) -- 1.9.1 Best, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] [PATCH] org-contacts.el: Catch 'nextfile in org-contacts-db
Philippe Crama writes: > Hi, Hello Philippe, > This is a small patch to catch the 'nextfile thrown by > `org-check-agenda-file' in `org-contacts-db'. > > I don't know how to fix the TODO in the comment myself, sorry. At > least, with the patch, the execution doesn't abort anymore. Thanks for the report and the patch. I've attached a patch inspired by yours. WDYT? From b3bb252c6e2138fa65b7c960060d68ea8c260873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Mon, 15 Jun 2015 09:36:36 +0200 Subject: [PATCH] org-contacts.el: Handle missing files in `org-contacts-files' gracefully * contrib/lisp/org-contacts.el (org-contacts-files): Catch 'nextfile From `org-check-agenda-file' and update `org-contacts-files' if modified. (org-contacts-db): Don't call `org-check-agenda-file' now called in `org-contacts-files'. When `org-agenda-files' contains non-existent files, remove them if the user asks for it instead of failing. Modified from a patch proposal by Philippe Crama --- contrib/lisp/org-contacts.el | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index bc07fc1..3e14c7e 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -227,7 +227,12 @@ A regexp matching strings of whitespace, `,' and `;'.") (defun org-contacts-files () "Return list of Org files to use for contact management." - (or org-contacts-files (org-agenda-files t 'ifmode))) + (org-remove-if (lambda (file) + (when (catch 'nextfile + (org-check-agenda-file file)) + (customize-save-variable 'org-contacts-files + (delete file org-contacts-files + (or org-contacts-files (org-agenda-files t 'ifmode (defun org-contacts-db-need-update-p () "Determine whether `org-contacts-db' needs to be refreshed." @@ -261,7 +266,6 @@ to dead or no buffer." (make-progress-reporter "Updating Org Contacts Database..." 0 (length org-contacts-files))) (i 0)) (dolist (file (org-contacts-files)) - (org-check-agenda-file file) (with-current-buffer (org-get-agenda-file-buffer file) (unless (eq major-mode 'org-mode) (error "File %s is not in `org-mode'" file)) -- 1.9.1 > Regards, -- Daimrod/Greg signature.asc Description: PGP signature
Re: [O] Filters lost after reviving buried, sticky agenda
Daniel Borchmann writes: > ghItlhpu' Daimrod : >>> My question is now: is this correct, or did I understand something >>> wrong? If my understanding is correct, how this bug be fixed more >>> elegantly? >> >> It doesn't work at startup when agenda hasn't been built yet. The >> following patch does seem to fix that. If it's ok, I can push it. > > It works for me. Great! If nobody complains in the next days, I'll push it. Best, -- Daimrod/Greg signature.asc Description: PGP signature