Re: [O] getting file properties
Hello, Nick Dokos ndo...@gmail.com writes: Here's one way: (defun jk-org-kwds () (let* ((parse-tree (org-element-parse-buffer)) (keys (org-element-map parse-tree 'keyword (function identity (mapcar (function (lambda (x) (cons (org-element-property :key x) (org-element-property :value x keys))) This returns a list of (KEY. VALUE) pairs. I'm sure there are other (better, cheaper) ways, but I'm going through org-element.el, and having that hammer in hand, everything looks like a nail to me :-) I suggest the slightly more efficient variation: (defun jk-org-kwds () (org-element-map (org-element-parse-buffer 'element) 'keyword (lambda (keyword) (cons (org-element-property :key keyword) (org-element-property :value keyword) The optional argument `element' prevents `org-element-parse-buffer' from diving too deep and `org-element-map' does the job of `mapcar'. Regards, -- Nicolas Goaziou
[O] Problems with Agenda view in org-mode
Hello dear developers of org mode, I ran into a problem using the agenda view with org. When I turn on the agenda view I want to see the different levels of next such as in NEXT Do that . NEXT Do this .. NEXT do this now This is the way it works on my Linux OS however, using Windows 7 I don't see the different levels. There is only one level, such as: NEXT Do that NEXT Do this. NEXT do this now Is there a way to get the Linux view on the agenda? Thanks in advance! -- Freundliche Grüße, Florian Faul
Re: [O] Problem with setting up org-protocol
Dnia 2013-05-05, o godz. 02:46:46 Suvayu Ali fatkasuvayu+li...@gmail.com napisał(a): Hi Marcin, Since you already looked at it, I have a comment without looking at it myself :-p. On Sat, May 04, 2013 at 11:41:20PM +0200, Marcin Borkowski wrote: *** Linux setup (Gnome) -For this to work, you'll need the Gnome-Libraries to be installed. +(Instructions taken from [[http://stackoverflow.com/questions/7464951/how-to-make-org-protocol-work][this answer on StackOverflow]].) + +Create and save a file called org-protocol.desktop to ~/.local/share/applications containing: + +: [Desktop Entry] +: Name=org-protocol +: Exec=emacsclient %u +: Type=Application +: Terminal=false +: Categories=System; +: MimeType=x-scheme-handler/org-protocol; + +Then run: + +: $ update-desktop-database ~/.local/share/applications/ -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/command '/usr/local/bin/emacsclient %s' --type String -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/enabled --type Boolean true As far as I know, gconf was replaced with dconf with the new Gnome. In that case it might be better to replace the instructions with the corresponding dconf command line instead of some Gnome only binary (update-desktop-database here). Would you be willing to take a look at it? Didn't know that. But if you look closer, you'll see the minus signs in front of these lines - actually, I deleted them;). Maybe what you write is the reason the recipe from Worg didn't work? I don't know too much about Gnome - I'm just a user, so I don't know. Cheers, Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University
Re: [O] Problem with setting up org-protocol
On Sun, May 05, 2013 at 12:07:36PM +0200, Marcin Borkowski wrote: Dnia 2013-05-05, o godz. 02:46:46 Suvayu Ali fatkasuvayu+li...@gmail.com napisał(a): Hi Marcin, Since you already looked at it, I have a comment without looking at it myself :-p. On Sat, May 04, 2013 at 11:41:20PM +0200, Marcin Borkowski wrote: *** Linux setup (Gnome) -For this to work, you'll need the Gnome-Libraries to be installed. +(Instructions taken from [[http://stackoverflow.com/questions/7464951/how-to-make-org-protocol-work][this answer on StackOverflow]].) + +Create and save a file called org-protocol.desktop to ~/.local/share/applications containing: + +: [Desktop Entry] +: Name=org-protocol +: Exec=emacsclient %u +: Type=Application +: Terminal=false +: Categories=System; +: MimeType=x-scheme-handler/org-protocol; + +Then run: + +: $ update-desktop-database ~/.local/share/applications/ -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/command '/usr/local/bin/emacsclient %s' --type String -: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/enabled --type Boolean true As far as I know, gconf was replaced with dconf with the new Gnome. In that case it might be better to replace the instructions with the corresponding dconf command line instead of some Gnome only binary (update-desktop-database here). Would you be willing to take a look at it? Didn't know that. But if you look closer, you'll see the minus signs in front of these lines - actually, I deleted them;). Exactly my point. I was suggesting instead of losing the information by deleting it, it would be worthwhile to translate the gconf commands to the corresponding dconf commands. Maybe what you write is the reason the recipe from Worg didn't work? I don't know too much about Gnome - I'm just a user, so I don't know. But you *are* a user :), I was just suggesting with a little more effort maybe you can figure out what the correct command is. I think it would be a worthy addition to Worg. With your current change, we make the Worg entry even more desktop dependent than before[1]. Hope my encourangements get you motivated to look into this. Cheers, Footnotes: [1] Although gconf/dconf is used with Gnome, there are many other desktops that use them as backends. After all most Gnome apps are rather popular. -- Suvayu Open source is the future. It sets us free.
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Hi Alan, I've removed the defaults from OPENING and CLOSING. See the attached patch. Cheers, Viktor Alan Schmitt wrote: Viktor Rosenfeld writes: Rasmus also suggested setting the default opening and closing to nil because we should not assume that everybody speaks English. Maybe, every variable should default to nil. Yes, I think it's a good idea. I often have lines that set the opening and closing to '~' to avoid having them. Alan From 1455bc78d87649ff2b41760f382c20fae4ecd585 Mon Sep 17 00:00:00 2001 From: Viktor Rosenfeld listuse...@gmail.com Date: Sun, 5 May 2013 15:11:15 +0200 Subject: [PATCH 1/2] ox-koma-letter.el: No default opening and closing line. * ox-koma-letter.el (org-koma-letter-opening): No default / set to nil. (org-koma-letter-closing): No default / set to nil. We should not assume a formal English opening and closing line. A letter requires many personal options, such as the address, so it is no more work to also these options. TINYCHANGE --- contrib/lisp/ox-koma-letter.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 31ccd89..37ff903 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -105,12 +105,12 @@ :group 'org-export-koma-letter :type 'string) -(defcustom org-koma-letter-opening Dear Madam or Sir, +(defcustom org-koma-letter-opening nil Letter's opening, as a string. :group 'org-export-koma-letter :type 'string) -(defcustom org-koma-letter-closing Sincerely yours, +(defcustom org-koma-letter-closing nil Koma-Letter's closing, as a string. :group 'org-export-koma-letter :type 'string) -- 1.8.2.2
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Hi Rasmus and Alan, I've changed the code so the value for foldmarks is passed through to KOMA-Script. It's a bit ugly insofar as one has to specify foldmarks:true to use the default values instead of other options, such as backaddress:t. However, subject also uses a string already. See the attached patch. Cheers, Viktor Rasmus wrote: Viktor Rosenfeld listuse...@gmail.com writes: Yeah, I guess it's true. Still, since foldmarks depends on which envelopes you have at hand it might make sense to have it accept a string. In lisp-terms a string is still t. On the other hand the current approach is consistent with your approach above so that's a merit. The more I think about it the more I agree that you should be able to set any value of foldmarks. The only problem I see is that for other boolean options one can use `t' whereas for foldmarks one would need to use `true' (because `t' is a valid configuration value for foldmarks). But as long as that's documented I see no problem. I will post a patch, once Alan applies my previous patches. I don't know the details of the exporter well enough on this detail, but perhaps it can be utilized that t ≠ t; if that's true in the exporter as well. In normal lisp (characterp t) = t and (characterp t) nil. But I'm not sure if t would be transformed before being able to check. . . Thanks, Rasmus -- May the Force be with you From b506dd781404a999056a0348fb7f3eb8c8ef4524 Mon Sep 17 00:00:00 2001 From: Viktor Rosenfeld listuse...@gmail.com Date: Sun, 5 May 2013 15:22:51 +0200 Subject: [PATCH 2/2] ox-koma-letter.el: Give the user complete control over foldmarks appearance. * ox-koma-letter.el (org-koma-letter-use-foldmarks) Update documentation (org-koma-letter-template): Pass foldmarks setting to KOMA-Script TINYCHANGE --- contrib/lisp/ox-koma-letter.el | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 37ff903..96c0569 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -130,10 +130,15 @@ :group 'org-export-koma-letter :type 'boolean) -(defcustom org-koma-letter-use-foldmarks t - Print foldmarks. +(defcustom org-koma-letter-use-foldmarks true + Configure appearence of fold marks. + +Accepts any valid value for the KOMA-Script `foldmarks' option. + +Use `foldmarks:true' to activate default fold marks or +`foldmarks:nil' to deactivate fold marks. :group 'org-export-koma-letter - :type 'boolean) + :type 'string) (defcustom org-koma-letter-use-phone t Print sender's phone number. @@ -286,7 +291,7 @@ holding export options. (with-email (plist-get info :with-email))) (concat (format \\KOMAoption{backaddress}{%s}\n (if with-backaddress true false)) - (format \\KOMAoption{foldmarks}{%s}\n (if with-foldmarks true false)) + (format \\KOMAoption{foldmarks}{%s}\n (if with-foldmarks with-foldmarks false)) (format \\KOMAoption{fromphone}{%s}\n (if with-phone true false)) (format \\KOMAoption{fromemail}{%s}\n (if with-email true false ;; Document start -- 1.8.2.2
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Hi Rasmus, Rasmus wrote: Viktor, In a similar spirit to subject is firsthead. First head is displayed by default in scrlttr2 as far as I recall, which is annoying. Is firsthead something that you change on a letter-by-letter basis? Or do you configure it once for your letters and never change it? In the latter case the configuration can be moved of to an LCO file. In the former case an option would be nice. I had to actually change the options I introduced so far for different letters (e.g., I don't want foldmarks if I send the letter by email). How I use scrlttr2: I rarely use firsthead as I find ugly. I use firstfoot all of the time and I change it regularly. E.g. for some letters I include bank addresse. Still, I see your point. So firsthead would be a boolean export option whereas firstfood would be a variable to set its content? I can see the use. Both take whatever LaTeX you'll throw at them (within reasons) so neither is boolean. I use a table with varying information for my firstfoot and nothing for my first head, but if you had a business letter you'd maybe have a logo up there or what not. But again, the question is whether it should be a LCO file or Org. One thing I'd like to do when time permits is to make a firstfood argument that takes a table name as an input, simply because tables are much nicer to work with in Org. But again it might be an overkill. . . I've thought about it and do not think it is a good idea to introduce specific options for firstfoot and so on. Since firstfoot can take arbitrary TeX-Code, setting it in the Org file can quickly become cumbersome. And a footer containing banking information is fairly consistent, so it can be set in an optional LCO file. I've used this as an example in the tutorial on Worg. (I pushed the tutorial today, but it's not published yet.) Cheers, Viktor –Rasmus -- . . . It begins of course with The Internet. A Net of Peers.
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Hi Alan, I've pushed a draft tutorial to Worg, but it's not published yet. Do you know if there is a delay or if I have to do anything else? I saw the publishing process output after my push which ended with the following: remote: Publishing file /home/emacs/git/worg/sitemap.org using `org-publish-org-to-html' remote: Symbol's function definition is void: org-publish-org-to-html remote: worg publish process 7241 exited at 05/05/13@07:53:51 To w...@orgmode.org:worg.git a3eed5c..9531016 master - master I assume this is an error? In any case, you can find the tutorial at ./org-tutorials/koma-letter-export.org Cheers, Viktor Alan Schmitt wrote: Hi, Viktor Rosenfeld writes: Hi, I've hacked the ox-koma-letter exporter to make it more configurable. See the Changelog of the attached patch, hopefully I've followed the Changelog guidelines propertly. This looks very nice, thanks a lot. I'm not sure about the procedure to apply this patch, however. Should I do it myself? Also, I could not find an ox-koma-letter tutorial on Worg. I would be willing to create such a tutorial, maybe next weekend. Can anybody edit the contents on Worg or do I need special priviledges? You need to ask for write access. I started writing a tutorial, but I was caught up in too many things and could not finish it. If you want I can send you privately what I have written (or I can push it to worg and we can edit it together). Best, Alan
Re: [O] Is it possible to create links to M-x occur results?
Hi, Rick Frankel wrote: On Fri, May 03, 2013 at 09:14:43AM +0200, Carsten Dominik wrote: On 2.5.2013, at 19:25, Leo Alekseyev dnqu...@gmail.com wrote: Nice! Short and sweet, and works great. It should go on orgmode.org somewhere in the cool hacks section. Make a patch if you don't have write access to worg... I have added it to org-hacks.org between Store link to a message when sending in Gnus and Send html messages and attachments with Wanderlust, but when i push to master, i get the following in the log output from the git-hook and it' doesn't show up in the website: remote: Publishing file /home/emacs/git/worg/sitemap.org using `org-publish-org-to-html' remote: Symbol's function definition is void: org-publish-org-to-html I just pushed a change to Worg and got the same error message. Cheers, Viktor
[O] [PATCH] Escape double quotes in URL passed to browse-url
Escape double quotes in URL passed to browse-url * lisp/org.el (org-link-escape-chars-browser): Add char double quote. * lisp/org.el (org-open-at-point): Make use of the constant `org-link-escape-chars-browser'. * testing/lisp/test-org.el (test-org/org-link-unescape-ascii-extended-char): Fill paragraph. (test-org/org-link-escape-url-with-escaped-char): Fill paragraph and typo. (test-org/org-link-escape-chars-browser): New test. This is to make work to open the Org link [[http://some.host.com/search?q=Org mode]] in a browser. From 28726bcc7b7c440d70e2d95ea5a61d0cd5f084ea Mon Sep 17 00:00:00 2001 From: Michael Brand michael.ch.br...@gmail.com Date: Sun, 5 May 2013 17:02:18 +0200 Subject: [PATCH] Escape double quotes in URL passed to browse-url * lisp/org.el (org-link-escape-chars-browser): Add char double quote. * lisp/org.el (org-open-at-point): Make use of the constant `org-link-escape-chars-browser'. * testing/lisp/test-org.el (test-org/org-link-unescape-ascii-extended-char): Fill paragraph. (test-org/org-link-escape-url-with-escaped-char): Fill paragraph and typo. (test-org/org-link-escape-chars-browser): New test. This is to make work to open the Org link [[http://some.host.com/search?q=Org mode]] in a browser. --- lisp/org.el | 26 +- testing/lisp/test-org.el | 16 +--- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ae0110f..b839a8f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9693,7 +9693,7 @@ according to FMT (default from `org-email-link-description-format'). This is the list that is used for internal purposes.) (defconst org-link-escape-chars-browser - '(?\ ) + '(?\ ?\) List of escapes for characters that are problematic in links. This is the list that is used before handing over to the browser.) @@ -10423,16 +10423,24 @@ application the system uses for this file type. (apply cmd (nreverse args1 ((member type '(http https ftp news)) - (browse-url (concat type : (if (org-string-match-p [[:nonascii:] ] path) -(org-link-escape - path org-link-escape-chars-browser) - path + (browse-url +(concat type : +(if (org-string-match-p + (concat [[:nonascii:] + org-link-escape-chars-browser ]) + path) +(org-link-escape path org-link-escape-chars-browser) + path ((string= type doi) - (browse-url (concat org-doi-server-url (if (org-string-match-p [[:nonascii:] ] path) - (org-link-escape - path org-link-escape-chars-browser) -path + (browse-url +(concat org-doi-server-url +(if (org-string-match-p + (concat [[:nonascii:] + org-link-escape-chars-browser ]) + path) +(org-link-escape path org-link-escape-chars-browser) + path ((member type '(message)) (browse-url (concat type : path))) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 259dc04..6aa0de7 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -395,15 +395,25 @@ (should (string= àâçèéêîôùû -(decode-coding-string (org-link-unescape %E0%E2%E7%E8%E9%EA%EE%F4%F9%FB) 'latin-1 +(decode-coding-string +(org-link-unescape %E0%E2%E7%E8%E9%EA%EE%F4%F9%FB) 'latin-1 (ert-deftest test-org/org-link-escape-url-with-escaped-char () - Escape and unscape a URL that includes an escaped char. + Escape and unescape a URL that includes an escaped char. http://article.gmane.org/gmane.emacs.orgmode/21459/; (should (string= http://some.host.com/form?id=blah%2Bblah25; -(org-link-unescape (org-link-escape http://some.host.com/form?id=blah%2Bblah25;) +(org-link-unescape + (org-link-escape http://some.host.com/form?id=blah%2Bblah25;) + +(ert-deftest test-org/org-link-escape-chars-browser () + Escape a URL to pass to `browse-url'. + (should + (string= +http://some.host.com/search?q=%22Org%20mode%22; +(org-link-escape http://some.host.com/search?q=\Org mode\ +org-link-escape-chars-browser -- 1.7.4.2
[O] link abbreviation with multiple params, e. g. for geo locations
Hi all I suggest that the Org link abbreviation supports multiple and repeated parameters so that it can handle more than the one and only parameter %s as of now. What I have in mind is to abbreviate the URL [[http://maps.google.com/maps?ll=4.56,7.89spn=0.3,0.3q=4.56,7.89]] this way : #+LINK: geo http://maps.google.com/maps?ll=%1spn=%2,%2q=%1 : [[geo:4.56,7.890.3]] where in the Org link is the separator of the parameters %1 and %2. Note the repeated use of %1 and %2 in this case which is a good part of the convenience. I tried with a workaround URL that by itself would work [[http://maps.google.com/maps?ll=4.56,7.89spn=0.3,0.3q=4.56,7.89spn=0.3,0.3]] with the repeated spn. But below the second %s remains without replacement which means the marker in the map gets lost when trying this with release_8.0.2-72-gccfe83: #+LINK: geo http://maps.google.com/maps?ll=%sq=%s [[geo:4.56,7.89spn=0.3,0.3]] Does it make sense to put at least repeatable %s, but then also multiple and repeatable parameters for link abbreviations to the wish list? Or did I miss something else that supports also org-open-at-point, maybe Org macros? I am not sure if %1 %2 etc. for the parameters is a good choice since it might interfere with escaped chars in #+LINK. Maybe 1 2 etc. interfere less because the to separate URL parameters are followed mostly by letters, as well as the in HTML entities, AFAIK. Michael
Re: [O] [PATCH] Escape double quotes in URL passed to browse-url
Applied, thanks. - Carsten On 5.5.2013, at 17:04, Michael Brand michael.ch.br...@gmail.com wrote: Escape double quotes in URL passed to browse-url * lisp/org.el (org-link-escape-chars-browser): Add char double quote. * lisp/org.el (org-open-at-point): Make use of the constant `org-link-escape-chars-browser'. * testing/lisp/test-org.el (test-org/org-link-unescape-ascii-extended-char): Fill paragraph. (test-org/org-link-escape-url-with-escaped-char): Fill paragraph and typo. (test-org/org-link-escape-chars-browser): New test. This is to make work to open the Org link [[http://some.host.com/search?q=Org mode]] in a browser. 0001-Escape-double-quotes-in-URL-passed-to-browse-url.patch.txt
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Viktor Rosenfeld writes: Hi Alan, I've removed the defaults from OPENING and CLOSING. See the attached patch. Thanks, I've applied it. To magit/emacs users: is there a way to apply a patch (with signoff) directly from emacs (I guess with magit)? I typically go to a shell to do so ... Alan
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Hi Victor, Viktor Rosenfeld writes: Hi Rasmus and Alan, I've changed the code so the value for foldmarks is passed through to KOMA-Script. It's a bit ugly insofar as one has to specify foldmarks:true to use the default values instead of other options, such as backaddress:t. However, subject also uses a string already. I have a question about this: is there some special magic that makes the string nil to be parsed as `nil' and not as the string? About the subject, I had a quick look at the code and I find it surprising: the default is untitled, and I don't know how one can set it to nil (unless there is some magic in plist-get that transforms the nil string into nil). Please don't hesitate to educate me, I'm very much an emacs-lisp newbie. Best, Alan
Re: [O] getting file properties
Thanks for the great suggestions (Nick, Nick, and Eric)! Here are the two functions that finally do what I wanted. I added the second function to get a specific result. #+RANDOM: tfjkdsla jfkdsa #+BEGIN_SRC emacs-lisp :results value ; suggested by Nicolas Goaziou n.goaz...@gmail.com (defun jk-org-kwds () (org-element-map (org-element-parse-buffer 'element) 'keyword (lambda (keyword) (cons (org-element-property :key keyword) (org-element-property :value keyword) (defun jk-org-kwd (KEYWORD) get the value of a KEYWORD in the form of #+KEYWORD: value (cdr (assoc KEYWORD (jk-org-kwds (jk-org-kwd RANDOM) #+END_SRC #+RESULTS: : tfjkdsla jfkdsa A less orgish way I worked out last night after browsing through org.el is: #+ANDREWID: jkitchin #+BEGIN_SRC emacs-lisp :results value (defun jk-get-file-keyword (KEYWORD) get the value from a line like this #+OPTION: value in a file. (interactive) (let ((case-fold-search t) (re (format ^#\\+%s:[ \t]+\\([^\t\n]+\\) KEYWORD))) (if (not (save-excursion (or (re-search-forward re nil t) (re-search-backward re nil t (error (format No line containing #+%s: value found KEYWORD))) (match-string 1))) (jk-get-file-keyword ANDREWID) #+END_SRC #+RESULTS: : jkitchin This is pretty awesome! John --- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Hi Alan, Alan Schmitt wrote: Hi Victor, Viktor Rosenfeld writes: Hi Rasmus and Alan, I've changed the code so the value for foldmarks is passed through to KOMA-Script. It's a bit ugly insofar as one has to specify foldmarks:true to use the default values instead of other options, such as backaddress:t. However, subject also uses a string already. I have a question about this: is there some special magic that makes the string nil to be parsed as `nil' and not as the string? I assume there must be. If I specify `foldmarks:nil' the if-statement in line 294 evaluates it as false: #+BEGIN_SRC emacs-lisp (format \\KOMAoption{foldmarks}{%s}\n (if with-foldmarks with-foldmarks false)) #+END_SRC About the subject, I had a quick look at the code and I find it surprising: the default is untitled, and I don't know how one can set it to nil (unless there is some magic in plist-get that transforms the nil string into nil). Same as above. `subject:nil' causes the code to skip the when-statement in line 301. #+BEGIN_SRC emacs-lisp (let ((with-subject (plist-get info :with-subject))) (when with-subject (concat (format \\KOMAoption{subject}{%s}\n with-subject) (format \\setkomavar{subject}{%s}\n\n (org-export-data (plist-get info :title) info) #+END_SRC Note, that untitled prints the subject but without a prefix. Setting it to nil hides the subject altogether. Please don't hesitate to educate me, I'm very much an emacs-lisp newbie. Me too. Cheers, Viktor Best, Alan
[O] Patch for org-md, with optional GFM source code output
Hi all, Not sure this will be accepted, but personally it is very useful when I output org to md and publish it with octopress. I understood that the commits to org-mode should possess some quality. Modified lisp/ox-md.el diff --git a/lisp/ox-md.el b/lisp/ox-md.el index 61f42b8..4188694 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -89,7 +89,7 @@ This variable can be set to either `atx' or `setext'. (quote-block . org-md-quote-block) (quote-section . org-md-example-block) (section . org-md-section) - (src-block . org-md-example-block) + (src-block . org-md-src-block) (template . org-md-template) (verbatim . org-md-verbatim))) @@ -142,7 +142,7 @@ channel. value))) - Example Block and Src Block + Example Block (defun org-md-example-block (example-block contents info) Transcode EXAMPLE-BLOCK element into Markdown format. @@ -153,6 +153,61 @@ channel. (org-remove-indentation (org-element-property :value example-block + Src Block + +(defcustom org-md-src-style 'indent + Style used to format the source. +This variable can be set to either `indent', `github-flavored' + or `octopress'. + For the information about github-flavored markdown, see +\https://help.github.com/articles/github-flavored-markdown\;. + +The main difference between github-flavored and octopress is that +the latter recognizes #+CAPTION as a title. + :group 'org-export-md + :type '(choice + (const :tag Use ordinary markdown style indent) + (const :tag Use Github flavored markdown style + github-flavored) + (const :tag Use Octopress flavored markdown style + octopress))) + + +(defun %string-prop (prop block) + (let ((prop (org-element-property prop block))) +(if prop prop ))) + +(defun org-md-src-block (src-block contents info) + Transcode SRC-BLOCK element into Markdown format. +CONTENTS is nil. INFO is a plist used as a communication +channel. + (case org-md-src-style +(indent (org-md-example-block src-block contents info)) +(github-flavored + (concatenate + 'string + ``` + (%string-prop :language src-block) + \n + (org-remove-indentation + (org-element-property :value src-block)) + ```)) +(octopress + (concatenate + 'string + ``` + (%string-prop :language src-block) + + (let ((caption (org-element-property :caption src-block))) +(if caption +(org-export-data + (org-export-get-caption src-block) info) + )) + \n + (org-remove-indentation + (org-element-property :value src-block)) + ``` + Headline -- 浅井 政太郎 東京大学大学院 総合文化研究科広域システム科学科 1年 福永研究室(http://metahack.org/) 東京大学運動会自動車部 Tel: 044-856-9009 Mail: guicho2.71...@gmail.com Website(private): http://guicho271828.github.io/
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Viktor Rosenfeld writes: I have a question about this: is there some special magic that makes the string nil to be parsed as `nil' and not as the string? I assume there must be. If I specify `foldmarks:nil' the if-statement in line 294 evaluates it as false: #+BEGIN_SRC emacs-lisp (format \\KOMAoption{foldmarks}{%s}\n (if with-foldmarks with-foldmarks false)) #+END_SRC OK. About the subject, I had a quick look at the code and I find it surprising: the default is untitled, and I don't know how one can set it to nil (unless there is some magic in plist-get that transforms the nil string into nil). Same as above. `subject:nil' causes the code to skip the when-statement in line 301. #+BEGIN_SRC emacs-lisp (let ((with-subject (plist-get info :with-subject))) (when with-subject (concat (format \\KOMAoption{subject}{%s}\n with-subject) (format \\setkomavar{subject}{%s}\n\n (org-export-data (plist-get info :title) info) #+END_SRC Note, that untitled prints the subject but without a prefix. Setting it to nil hides the subject altogether. Thanks for the clarification. I've applied the patch. Best, Alan
Re: [O] [PATCH] Improve configurability of ox-koma-letter
Viktor Rosenfeld writes: Hi Alan, I've pushed a draft tutorial to Worg, but it's not published yet. Do you know if there is a delay or if I have to do anything else? I saw the publishing process output after my push which ended with the following: remote: Publishing file /home/emacs/git/worg/sitemap.org using `org-publish-org-to-html' remote: Symbol's function definition is void: org-publish-org-to-html remote: worg publish process 7241 exited at 05/05/13@07:53:51 To w...@orgmode.org:worg.git a3eed5c..9531016 master - master I assume this is an error? I guess, I've never published on worg before. In any case, you can find the tutorial at ./org-tutorials/koma-letter-export.org Thanks, I'll have a look. Alan
[O] html email, math formula as pictures are not displayed.
Hello I cc this to the orgmode list, since it might be relevant. The function org-mime-htmlize allows me to send LaTeX math formula as png images. However when I receive mails, generated by thunderbird or gmail, which provide a similar functionality I can see in thunderbirds the png of the generated formulas, however in Xemacs, Ma gnus 0.6 I only see things like [image: $\|vk(t)\|_{Hs+1,}$], instead of , Is there anything in my gnus configuration I show change? thanks Uwe Brauer
[O] org-preview-latex-fragment is very picky
Hello the following formula works well with org-preview-latex-fragment However $ \|vk(t)\|_{Hs+1,}$ Not nor $ \|vk(t)\|_{Hs+1,}$, Could that behaviour made a little less picky? thanks Uwe Brauer
Re: [O] Patch for org-md, with optional GFM source code output
Hello, 浅井 政太郎 guicho2.71...@gmail.com writes: Not sure this will be accepted, but personally it is very useful when I output org to md and publish it with octopress. Thanks for your patch. Though, the very point of ox-md.el is to produce vanilla flavour, not Octopress' or Github's. You could create a derived back-end from it instead, e.g. ox-md-octopress.el and request to put it in contrib directory. See `org-export-define-derived-backend' for details. +(defun %string-prop (prop block) + (let ((prop (org-element-property prop block))) +(if prop prop ))) This is not needed (and the namespace used is wrong: it should be prefixed with `org-md-' since there's no module in elisp). I suggest to use `org-string-nw-p' instead. +(defun org-md-src-block (src-block contents info) + Transcode SRC-BLOCK element into Markdown format. +CONTENTS is nil. INFO is a plist used as a communication +channel. + (case org-md-src-style +(indent (org-md-example-block src-block contents info)) +(github-flavored + (concatenate `concat' is sufficient here. Regards, -- Nicolas Goaziou
Re: [O] Bug: org-refresh-category-properties: Invalid function: org-with-silent-modifications [8.0 (8.0-3-g7248fb-elpaplus at /home/gcharron/.emacs.d/elpa/org-plus-contrib-20130418/)]
Bastien bzg at gnu.org writes: Hi Gilles, Gilles Charron writes: Can't display agenda or sparse tree on org 8.0; (installed via elpa) always reporting: org-indent-add-properties: Invalid function: org-with-silent-modifications You probably hit the famous ELPA installation bug, which is mentioned early in the 8.0 release notes. When installing from ELPA, please do so from a fresh Emacs session where no Org function has been called. If you still have the bug, please consider using the .tar.gz distribution instead. I had the same bug. I just uninstalled org-mode via the package manager, then reinstalling it in a fresh session : org works perfectly now (at least no bug found yet) ! Org-mode version 8.0.2 (8.0.2-2-g93da18-elpa @ /home/xxx/.emacs.d/elpa/org-20130429/) GNU Emacs 24.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) of 2012-10-13 on cw-bkp0, modified by Debian JM
Re: [O] org-preview-latex-fragment is very picky
Uwe Brauer o...@mat.ucm.es writes: Hello the following formula works well with org-preview-latex-fragment $\|v^k(t However $ \|vk(t)\|_{Hs+1,δ}$ Not nor $ \|vk(t)\|_{Hs+1,δ}$, Could that behaviour made a little less picky? Probably not. Note these are Org features irrespective of fragment preview. There was some talk about it not so long ago. Basically, it just happens that $·$ works as desired most of the time. The proper way in LaTeX as well as in Org is \(·\). Often you'll find that in challenging cases you're better off with \(·\). To see whether $·$ will work I use (setq org-highlight-latex-and-related '(latex)) To have nice symbols making preview of fragments less dire I use pretty entities: (setq org-pretty-entities t) Pretty entities can also be turned on locally. For missing glyphs you're using you can do something like: (setq org-entities-user '((implies \\Rightarrow t rArr; = = ⇒) (iff \\iff t hArr; = = ⇔))) Hope this helps. –Rasmus -- Don't panic!!!
Re: [O] org-preview-latex-fragment is very picky
Dnia 2013-05-05, o godz. 21:07:23 Rasmus ras...@gmx.us napisał(a): Basically, it just happens that $·$ works as desired most of the time. The proper way in LaTeX as well as in Org is \(·\). Often you'll find that in challenging cases you're better off with \(·\). Just before someone asks why: http://tex.stackexchange.com/questions/510/are-and-preferable-to-dollar-signs-for-math-mode Regards, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University
[O] new (iCalendar) exporter problem
Hi Nicolas, I'm using the new icalendar export and one of it's more advanced features: (setq org-icalendar-exclude-tags '(noexport drawnin)) The docstring says: Tags that exclude a tree from export. This variable allows to specify different exclude tags from other back-ends. It can also be set with the ICAL_EXCLUDE_TAGS keyword. What really happens: The icalendar CATEGORIES which I am filling with these (i.e. (setq org-icalendar-categories '(all-tags))) no longer bears the mentioned strings, but the actual entries are still there. I could not see any obvious mistake in how exclude-tags are handled. Thus, I concluded maybe it affects other exporters as well. Apart from that, it seems to work fine. I just got me the latest maint but the issue persists. Cheers, Simon
Re: [O] new (iCalendar) exporter problem
Hello, Simon Thum simon.t...@gmx.de writes: I'm using the new icalendar export and one of it's more advanced features: (setq org-icalendar-exclude-tags '(noexport drawnin)) The docstring says: Tags that exclude a tree from export. This variable allows to specify different exclude tags from other back-ends. It can also be set with the ICAL_EXCLUDE_TAGS keyword. There's a mistake in the docstring: it is ICALENDAR_EXCLUDE_TAGS. What really happens: The icalendar CATEGORIES which I am filling with these (i.e. (setq org-icalendar-categories '(all-tags))) no longer bears the mentioned strings, but the actual entries are still there. I cannot reproduce it (i.e. the actual entries are removed). Could you provide an ECM? Regards, -- Nicolas Goaziou
Re: [O] new (iCalendar) exporter problem
I'm trying. I forgot to mention some things I notice: 1) It's a script that exports (batch mode) 2) Tags are coming from #+FILETAGS: Does this help you reproduce? On 05/05/2013 10:14 PM, Nicolas Goaziou wrote: Hello, Simon Thum simon.t...@gmx.de writes: I'm using the new icalendar export and one of it's more advanced features: (setq org-icalendar-exclude-tags '(noexport drawnin)) The docstring says: Tags that exclude a tree from export. This variable allows to specify different exclude tags from other back-ends. It can also be set with the ICAL_EXCLUDE_TAGS keyword. There's a mistake in the docstring: it is ICALENDAR_EXCLUDE_TAGS. What really happens: The icalendar CATEGORIES which I am filling with these (i.e. (setq org-icalendar-categories '(all-tags))) no longer bears the mentioned strings, but the actual entries are still there. I cannot reproduce it (i.e. the actual entries are removed). Could you provide an ECM? Regards,
Re: [O] new (iCalendar) exporter problem
Simon Thum simon.t...@gmx.de writes: I'm trying. I forgot to mention some things I notice: 1) It's a script that exports (batch mode) 2) Tags are coming from #+FILETAGS: Does this help you reproduce? No. The following code exports fine: --8---cut here---start-8--- #+filetags: tag #+icalendar_exclude_tags: drawnin noexport #+bind: org-icalendar-categories (all-tags) * Test :drawnin: 2013-05-05 Sun Desc * Test 2 2013-05-06 Mon Desc2 --8---cut here---end---8--- Regards, -- Nicolas Goaziou
Re: [O] new (iCalendar) exporter problem
I guess we have it then. Your example leads to icalendar without content. However I have: #+filetags: drawnin #+icalendar_exclude_tags: drawnin noexport #+bind: org-icalendar-categories (all-tags) * Test (no tag here - 2013-05-05 Sun Desc That one indeed exports, but IMO shouldn't. On 05/05/2013 10:37 PM, Nicolas Goaziou wrote: Simon Thum simon.t...@gmx.de writes: I'm trying. I forgot to mention some things I notice: 1) It's a script that exports (batch mode) 2) Tags are coming from #+FILETAGS: Does this help you reproduce? No. The following code exports fine: --8---cut here---start-8--- #+filetags: tag #+icalendar_exclude_tags: drawnin noexport #+bind: org-icalendar-categories (all-tags) * Test :drawnin: 2013-05-05 Sun Desc * Test 2 2013-05-06 Mon Desc2 --8---cut here---end---8--- Regards,
Re: [O] new (iCalendar) exporter problem
Simon Thum simon.t...@gmx.de writes: I guess we have it then. Your example leads to icalendar without content. What is the value of `org-icalendar-with-timestamps'? I don't see any difference between my * Test 2 headline and your * Test below. However I have: #+filetags: drawnin #+icalendar_exclude_tags: drawnin noexport #+bind: org-icalendar-categories (all-tags) * Test (no tag here - 2013-05-05 Sun Desc That one indeed exports, but IMO shouldn't. exclude tags are not inherited. Regards, -- Nicolas Goaziou
Re: [O] new (iCalendar) exporter problem
On 05/05/2013 11:01 PM, Nicolas Goaziou wrote: Simon Thum simon.t...@gmx.de writes: I guess we have it then. Your example leads to icalendar without content. What is the value of `org-icalendar-with-timestamps'? org-icalendar-with-timestamps: active But see below. I don't see any difference between my * Test 2 headline and your * Test below. Yes, I copied only the first of your headlines. That lead to the confusing statement of mine. But the behaviour is consistent: a #filetags: tag cannot prevent export of the file's headlines. IMO this is a bug. My use case is to prevent duplicates that come from me importing outside iCals into org (using ical2org). When exporting, I do not want these to be re-exported. I could remove the files from the agenda altogether, but tags offer a more logical path for me. Cheers, Simon However I have: #+filetags: drawnin #+icalendar_exclude_tags: drawnin noexport #+bind: org-icalendar-categories (all-tags) * Test (no tag here - 2013-05-05 Sun Desc That one indeed exports, but IMO shouldn't. exclude tags are not inherited. Regards,
[O] org-search-view skips over commented subtrees
When I search for a {regexp}, using the agenda, with restriction set to the current file, I get entries that contain matching text in ordinary lines and entries that contain matching text in commented lines. This is desired. However, the COMMENT keyword on a headline stops results from showing. This is not desired. It is also inconsistent with commented lines. I strongly prefer for all matches to show up, whether commented or not. However, in principle there could be an option to not match anything that is commented. If such an option is desired, however, I suggest the safer value of nil as a default. Thanks. Samuel -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com The disease DOES progress. MANY people have died from it. ANYBODY can get it.
[O] orgmode header issue with emacs themes
Hello, I am cycling my emacs themes (through out the day) to adapt my eyes' contrast/tiredness during the day. However, as I cycled through themes, many times over the dark color themes, there's an addition for font background - especially for those 'org-mode' header lines (and comment lines), which is annoying. some suggestions to fix this behavior (I am just thinking delete those org related lines in the themes for now)? thanks a lot isaac
[O] issues with export of LaTeX figure captions
G'day fellow orgmode users, I've encountered an issue/difference with the way the recent babel processor handles captions. In versions prior to 8 the following WORKED (on export produced a figure environment with a caption): #+CAPTION: Fails to produce table environment and so caption in the new orgmode #+LABEL: fig:fails #+begin_src R :session :results graphics :file fails.pdf :exports results plot(1:10) #+end_src Under orgmode version 8.0.2 (8.0.2-2-g93da18-elpa the same code does not work, the includegraphics is exported sans the figure environment. Under this latest orgmode the following does work: #+begin_src R :session :results graphics :file ok.pdf :exports results plot(1:10) #+end_src #+CAPTION: Succeeds to produce table environment and so caption #+LABEL: fig:OK #+RESULTS[2d39a23f088d95e808bb867f97a0ecd2df621bbd]: [[file:ok.pdf]] However, this second construction of code has the following issues: 1. it is different to prior method which worked 2. it is ugly to have the caption sandwiched between the code and the results 3. often, but not always, when the code is re-executed the caption and label is lost I also see that HTML export also fails to produce a caption. Is this an issue in orgmode that can be addressed or is it an issue with my understanding? I must admit as much as I like org-babel I have long found the options for headers and arguments hard to understand well. Cheers, Robert Cunningham
[O] org-datetree-goto-date
I wanted a function that would take me to a particular date in a datetree and didn't find one, so I wrote my own and bound it to C-c d. (defun org-datetree-goto-date (optional siblings) Go to and show the date in the date tree. With optional argument SIBLINGS, on each level of the hierarchy all siblings are shown. If no entry exists for the date, it will be created. (interactive P) (let ((date (decode-time (org-read-date nil t (org-datetree-find-date-create (list (nth 4 date) (nth 3 date) (nth 5 date (outline-show-heading) (show-subtree) (org-reveal siblings)) (add-hook 'org-mode-hook (lambda () (local-set-key [(control ?c) ?d] 'org-datetree-goto-date))) Maybe this would be useful for others if included in org-mode. Liam
Re: [O] Agenda buffer: 't' key moves current item to window's top line
Bastien bzg at altern.org writes: Hi James, James Harkins jamshark70 at gmail.com writes: After a recent update, I noticed that the agenda buffer now moves the displayed text when you change an item's TODO state using 't'. Fixed, thanks! I'm still seeing the move-to-top bug, as James stated in OP. I'm using Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3.50/lisp/org/). Bastien, in which release was it fixed?
Re: [O] Export Org-mode content to Reveal.js presentations
Hi, Rasmus, Org-Reveal is now updated for displaying MathJax, as the HTML exporter does, except that the MathJax.org server is used instead of Orgmode.org server. Please check the updated sample illustration: http://naga-eda.org/home/yujie/org-reveal/#/4/4 :) 2013/5/3 Rasmus ras...@gmx.us Yujie Wen yjwen...@gmail.com writes: Hi, I'd like to introduce a new Org-Mode exporter, Org-reveal, that exports Org-mode contents to Reveaj.js presentations. Reveal.js is a web-based presentation framework, with beautiful 3-D effects and 2-D slides arrangements. The original sample illustration can be found at http://lab.hakim.se/reveal-js/#/. With Org-reveal, you can easily exports your Org documents to Reveal.js presentations. A sample presentation created by Org-reveal can be found at http://naga-eda.org/home/yujie/org-reveal/. Org-reveal is hosted on https://github.com/yjwen/org-reveal. Should you have any suggestion or bug-report, please contact me yjwen.ty AT gmail DOT com. Both sets of slides look amazing! Thanks for proving this exporter. Will you distribute it via org-contrib or org eventually? One (lazy) question: does it support MathJax as standard Org HTML? Again, thanks! –Rasmus -- Enough with the bla bla!
Re: [O] Export Org-mode content to Reveal.js presentations
Hi, Eric, The same feeling of me, so I wrote an exporter for Reveal.js. Hope you can enjoy it. Thanks Yujie 2013/5/4 Eric S Fraga e.fr...@ucl.ac.uk Yujie Wen yjwen...@gmail.com writes: Hi, I'd like to introduce a new Org-Mode exporter, Org-reveal, that exports Org-mode contents to Reveaj.js presentations. This looks really interesting. So many choices, so little time... :( I really like the ability to see the zoomed out view of the set of slides as well as the L/R and U/D paradigm. I can see using the latter to have detail that may be missed in a short talk but included in a longer version of the same talk. Thanks, eric -- : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D : in Emacs 24.3.50.1 and Org release_8.0.2-68-g40635b
Re: [O] [PATCH] export to various flavors of (X)HTML
Hi Eric, Rick, Francois and others, Nicolas commented to me about this patch that he was wondering if it would not be better to have a separate backend for html5, i.e. ox-html5.el that could be derived from ox-html.el and make it easier in the future to build it out to take full advantage of html5 features. I think he has a point, and I would like to hear your comments. Thanks - Carsten On 2.5.2013, at 23:07, Eric Abrahamsen e...@ericabrahamsen.net wrote: Rick Frankel r...@rickster.com writes: On Tue, Apr 30, 2013 at 08:26:52PM -0700, Eric Abrahamsen wrote: Rick Frankel r...@rickster.com writes: Whoops. Wrong key. Patch actually attached to this email... rick Great, I'll consolidate all these -- would it be better to mush them into one big patch, or to keep them separate (I suppose for ease of rollback, if something goes wrong)? Probably squashing them into one patch would be the best. But Carsten or Bastien might disagree :). rick Okay, there it is: one big patch (including your xml declaration fix). I didn't add any more refined handling of the html5-fancy option. As a second-order option it didn't seem worthy of an #+OPTIONS entry, and I didn't bother checking for an empty string, either. It can always be #+BINDed if necessary, and if it ever annoys anyone I can fix it further. E 0001-ox-html.el-Export-to-different-X-HTML-flavors-includ.patch