[Orgmode] Re: Capture and clock options
Le vendredi 13 août 2010 à 07:47 -0400, Bernt Hansen a écrit : > This fixes it for me. Thanks Bastien! > > -Bernt And for me too, thanks a lot for this quick fix. Julien. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: macros: escaping "," and comments
On Fri, 13 Aug 2010 00:02:09 +0200, Stefan Vollmar wrote: > Hello, > > we are currently changing our institute's web site so that staff members > can have a personal page: they can submit Org-mode files which are then > automatically converted to (rather nice) HTML pages. One advantage is > that this allows us to give staff members a lot of freedom to create > content while keeping a "corporate identity" look (and getting the > director's permission in the first place). > > Our template needs a macro in the org template to create a more "fancy" > summary of personal information with a table, a portrait and some icons > (aside: please note that you can create really complex HTML code this > way if necessary). > > Here is a very simple example: > > #+title: test > #+macro: mhead #+html: email: $1 phone: > $2 > > {{{mhead( > someb...@somewhere.org, > 1-234-2134 > )}}} > > Imagine more lines (job description, fax, homepage, etc) and a more > complex table (hidden in a setup file). Having users provide information > in this way is not ideal, but has worked surprisingly well (the rest of > the template is "proper" Org-mode content). > > When creating the Org templates we ran into these problems with Org-mode > 7.01 and Emacs 23.2.1: > > (1) How can we escape "," in the macro call? Ideally, we would need > something like this: > > {{{mhead( > one entry\, still the same entry, > the second variable... > > (2) It would be nice to use something like this: > > {{{mhead( > # Email > someb...@somewhere.org, > # Phone > 1-234-2134 > )}}} > What would be really nifty would be to turn this kind of thing into microformats. http://microformats.org/ How hard would that be? > However, the "#" lines are currently not ignored (as comments) when > expanding the macro, these kind of comment lines would be helpful when > providing templates in general. > > (3) if, in the above example, we delete the #+title line before the > macro definition, that macro stops working (the macro definition is not > interpreted as such). It seems there must be at least one line with > arbitraty contents before the macro definition (bug?). > > I think, that (1) (maybe it is already possible - apologies if I > overlooked something) and (2) would be useful features in Org-mode. > > Many thanks in advance for any help with this. > > Warm regards, > Stefan Cheers Shelagh ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] macros: escaping "," and comments
On Aug 13, 2010, at 12:02 AM, Stefan Vollmar wrote: Hello, we are currently changing our institute's web site so that staff members can have a personal page: they can submit Org-mode files which are then automatically converted to (rather nice) HTML pages. One advantage is that this allows us to give staff members a lot of freedom to create content while keeping a "corporate identity" look (and getting the director's permission in the first place). Our template needs a macro in the org template to create a more "fancy" summary of personal information with a table, a portrait and some icons (aside: please note that you can create really complex HTML code this way if necessary). Here is a very simple example: #+title: test #+macro: mhead #+html: email: $1 phone: $2td> {{{mhead( someb...@somewhere.org, 1-234-2134 )}}} Imagine more lines (job description, fax, homepage, etc) and a more complex table (hidden in a setup file). Having users provide information in this way is not ideal, but has worked surprisingly well (the rest of the template is "proper" Org-mode content). When creating the Org templates we ran into these problems with Org- mode 7.01 and Emacs 23.2.1: (1) How can we escape "," in the macro call? Ideally, we would need something like this: {{{mhead( one entry\, still the same entry, the second variable... This should work - there was a bug, fixed now. (2) It would be nice to use something like this: {{{mhead( # Email someb...@somewhere.org, # Phone 1-234-2134 )}}} However, the "#" lines are currently not ignored (as comments) when expanding the macro, these kind of comment lines would be helpful when providing templates in general. Not implemented yet... - Carsten (3) if, in the above example, we delete the #+title line before the macro definition, that macro stops working (the macro definition is not interpreted as such). It seems there must be at least one line with arbitraty contents before the macro definition (bug?). I think, that (1) (maybe it is already possible - apologies if I overlooked something) and (2) would be useful features in Org-mode. Many thanks in advance for any help with this. Warm regards, Stefan -- Dr. Stefan Vollmar, Dipl.-Phys. Head of IT group Max-Planck-Institut für neurologische Forschung Gleuelerstr. 50, 50931 Köln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: voll...@nf.mpg.de http://www.nf.mpg.de ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] how to stop delete key putting a region into kill ring
When I am editing a text in Emacs - not only in org-mode - when I select a region and press to remove it, it's being placed into the clipboard and when I want to paste some text instead I have to get rid of it. Does anybody know, how to stop it and make simply kill the region without putting it into the clipboard? ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Archive Tasks
Dear Org-Users, I have a problem to archive my tasks. What should the row ":ARCHIVE:" look like, so that my "Task One" will be archived under "Tasks - Client 1" (see example below)? Thanks a lot! Karl --- My structure in gtd.org: --- * Tasks ** Client 1 *** DONE Task One :PROPERTIES: :ARCHIVE: %s_archive::* Tasks ??? :END: *** TODO Task Two ** Client 2 *** TODO Task Three --- --- gtd.org_archive should look the same: --- * Tasks ** Client 1 *** DONE Task One --- ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] ErgoEmacs
Hi all, I've just found ErgoEmacs (http://ergoemacs.org), another Emacs distribution for Windows that tries to make Emacs easy to use for ordinary users... and it does so: I was able to use it immediately, with all the standard Windows shortcuts--the only things that tripped me up briefly were the file commands (C-xf moved to C-o and C-xw moved to C-w), and that they moved M-x to M-a (M-x now cuts the entire line). This looks like a distro that might ease the learning curve enough to drive more widespread adoption of Emacs (and org-mode!): it really does seem to be as easy to use as Notepad right out of the box, yet doesn't take away any of the power of Emacs (as far as I can tell, except that I did have to load an org-mode file before capture would work, but that may be a setup problem on my part). If you're on Windows, take a look and see what you think... and for org newbies on win32, I think this is the version I would recommend. --Don ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: ErgoEmacs
Whoops, C-w is close-buffer; save is C-s. Other keys that have moved: C-space to M-space C-n to M-k C-p to M-i C-f to M-l (lowercase L) C-b to M-j C-s to M-; (M-; to M-') C-r to M-S-; These seem reasonable, though radically different from what an Emacs user is used to... but for someone new to Emacs, they are much better than the Emacs defaults, in my opinion. My fingers will need some retraining, though :) --Don On Sat, Aug 14, 2010 at 9:07 AM, Don Womick wrote: > Hi all, > > I've just found ErgoEmacs (http://ergoemacs.org), another Emacs > distribution for Windows that tries to make Emacs easy to use for ordinary > users... and it does so: I was able to use it immediately, with all the > standard Windows shortcuts--the only things that tripped me up briefly were > the file commands (C-xf moved to C-o and C-xw moved to C-w), and that they > moved M-x to M-a (M-x now cuts the entire line). This looks like a distro > that might ease the learning curve enough to drive more widespread adoption > of Emacs (and org-mode!): it really does seem to be as easy to use as > Notepad right out of the box, yet doesn't take away any of the power of > Emacs (as far as I can tell, except that I did have to load an org-mode file > before capture would work, but that may be a setup problem on my part). If > you're on Windows, take a look and see what you think... and for org newbies > on win32, I think this is the version I would recommend. > > --Don > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Menu-bar bug (was Org menu dropdown disappears -- bug??)
On Aug 14, 5:40 pm, rustom wrote: > Some time back I found that the menu (drop-down) under python > 'disappeared' ie clicking there did not show anything > > Today I found the same thing happened for the org and tbl menus -- > click there and nothing happens/shows. > > Restarted emacs -Q and it was there. > Ok so something in my setup. > > So tried > a My org specific setup (which is in a separate el-file) and no init > -- the menu is there > b My init but no org setups -- the menu has disappeared > > Now I can of course hunt down which setup is the culprit. (Just have > to start and stop emacs about 30 times!!) But I was just wondering if > some tip/bug etc is already known in this regard > > emacs version 23.1.1 > org version 7.01trans Update -- Now it seems more likely theres some bug somewhere. Start emacs -Q The menu-bar line is as expected ie it has File Edit Options Buffers Tools Lisp-Interaction Help Under Lisp-Interaction there are 5 entries: Complete-Lisp-SymbolEvaluate-Defun Now I do M-x org-mode The menu-bar now has File Edit Options Buffers Tools Org Tbl Help Note Lisp-Interaction has disappeared But under Org I see the same entries that were earlier under lisp interaction. emacs version 23.1.1 org version 7.01trans debian squeeze ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] how to stop delete key putting a region into kill ring
[Somewhat off-topic for this list, so it might be better to follow up on gnu.emacs.help or some such.] Ivanov Dmitry wrote: > When I am editing a text in Emacs - not only in org-mode - when I > select a region and press to remove it, it's being placed into > the clipboard and when I want to paste some text instead I have to get > rid of it. > > Does anybody know, how to stop it and make simply kill the > region without putting it into the clipboard? > My key is (normally) bound to delete-char and it does not behave at all the way you describe: in particular, it does not matter whether a region is selected or not - it deletes one character (and that is *not* saved in the kill ring.) In order to delete a selected region, I use C-w (kill-region) which *does* save the killed region to the kill ring (it also copies it to the X cut buffer - or the successors thereof - if emacs is running under X.) The kill-region function is also bound to S- in my case, which may be what you mean - or it may be that you have customized your keys somehow. You can delete the region without saving it to the kill ring by calling the function delete-region (which in my case is bound to the Clear item in the Edit menu). And you can rebind any key you want to call this function (in particular, the key, however inadvisable that would be)[1], at the risk of being incompatible with everybody else in the universe and therefore having a harder time getting help. In particular, if you do that, mentioning keys is not going to help: you will have to use C-h c (describe-key-briefly) or C-h k (describe-key) on the key in order to find out the function that it is bound to and then mention that. You might want to do that now with and see what function it is bound to. This latter problem is partly the reason that having command names, as well as key descriptions, in the manual is useful. It is also why things like ErgoEmacs (see Don Womick's posting in this list a little while ago) make whatever hair I have left on my head stand on end. BTW, I mention X and assume that you are running on some Unix variant. If you are running on Windows of some sort, things are probably different, at least in some details. HTH, Nick [1] see section 57.4, "Customizing Key Bindings", in the Emacs manual for details. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: how to stop delete key putting a region into kill ring
Nick Dokos writes: > [Somewhat off-topic for this list, so it might be better to follow up > on gnu.emacs.help or some such.] > > Ivanov Dmitry wrote: > >> When I am editing a text in Emacs - not only in org-mode - when I >> select a region and press to remove it, it's being placed into >> the clipboard and when I want to paste some text instead I have to get >> rid of it. >> > >> Does anybody know, how to stop it and make simply kill the >> region without putting it into the clipboard? >> > > My key is (normally) bound to delete-char and it does not > behave at all the way you describe: in particular, it does not matter > whether a region is selected or not - it deletes one character (and that > is *not* saved in the kill ring.) In order to delete a selected region, > I use C-w (kill-region) which *does* save the killed region to the kill > ring (it also copies it to the X cut buffer - or the successors > thereof - if emacs is running under X.) The kill-region function is also > bound to S- in my case, which may be what you mean - or it may > be that you have customized your keys somehow. Things have changed in Emacs24: , | *** New option `delete-active-region'. | If non-nil, C-d, [delete], and DEL delete the region if it is active | and no prefix argument is given. If set to `kill', these commands | kill instead. ` Before i had to use this: , | (defun tv-delete-char (arg beg end) | (interactive "p\nr") | (if (region-active-p) | (delete-region beg end) | (delete-char arg))) | | (global-set-key (kbd "C-d") 'tv-delete-char) ` > You can delete the region without saving it to the kill ring by calling > the function delete-region (which in my case is bound to the Clear item > in the Edit menu). And you can rebind any key you want to call this > function (in particular, the key, however inadvisable that > would be)[1], at the risk of being incompatible with everybody else in > the universe and therefore having a harder time getting help. In > particular, if you do that, mentioning keys is not going to help: you > will have to use C-h c (describe-key-briefly) or C-h k (describe-key) on > the key in order to find out the function that it is bound to and then > mention that. You might want to do that now with and see what > function it is bound to. > > > This latter problem is partly the reason that having command names, as > well as key descriptions, in the manual is useful. It is also why > things like ErgoEmacs (see Don Womick's posting in this list a little > while ago) make whatever hair I have left on my head stand on end. > > > BTW, I mention X and assume that you are running on some Unix variant. > If you are running on Windows of some sort, things are probably different, > at least in some details. > > HTH, > Nick > > [1] see section 57.4, "Customizing Key Bindings", in the Emacs manual > for details. > > > ___ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- Thierry Volpiatto Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] MathJax is now the default for HTML math
On 08/14/2010 08:09 AM, Carsten Dominik wrote: > From now on, the default settings will > use the incredible MathJax library to display math in > exported HTML. If you had never turned on LaTeX snipped > math publishing, this will now magically work all by itself. Yes, indeed it does! Since I read the announcement this morning, I have been playing with MathJax. I found that when an HTML file on the local hard disk uses MathJax from the web, MathJax reverts to image fonts in Firefox (this is caused by a security feature of Firefox and mentioned in the MathJax FAQ). Using a local MathJax installation in a subdirectory fixes this. Most of my time was spent messing around with XULRunner to load the exported HTML page, wait until MathJax has done its magic, then serialize the result back to XHTML. And replace the file:// URLs pointing to the fonts of my local MathJax installation with data: URIs, thus embedding the fonts within the HTML file itself, just because I can. The result is a single HTML file which does not require JavaScript to be viewed (and incurs no delay while the math is being rendered). However, as no MathJax code is present, the zoom and view source functions of MathJax are not available. I have put an example online. Normal org-mode export using MathJax from orgmode.org: http://www.jboecker.de/2010/08/14/mathjax-example.html Single-file no-javascript version: http://www.jboecker.de/2010/08/14/mathjax-example-nojs.html Internet Explorer will not use the correct font, AFAIK because it only supports the EOT fonts (MathJax uses OTF for other browsers), and in this case also because I embedded the fonts using data: URIs and IE limits the size of data: URIs to 32 KB. In browsers other than Firefox (I tested with Firefox and Opera), the font size and spacing will differ slightly between the two versions. If people are interested, I can try to make the program take the name of a file to operate on as a command line argument, so this could be run as part of an org-mode export process or something. Of course, the embedding of fonts in data: URIs would be optional. > I am really, really excited about this change. Using MathJax makes > Org-mode > a tool without peer for scientific note taking, I believe. It will > also drastically improve the quality of printed web pages, because > the web pages will not use fixed-resolution images, but scaleable fonts. And don't forget that on modern high resolution displays, it is common to zoom in just to be able to decipher math in images, especially if you want sub- and superscripts to be legible. -- Jan ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: MathJax is now the default for HTML math
The results look just GREAT. Could you post the org file to give dummies like me a head start? Especially the serializing back to HTML? How is it done? Thank you in advance! Detlef On Sat, 14 Aug 2010 21:37:26 +0200 Jan Böcker wrote: > On 08/14/2010 08:09 AM, Carsten Dominik wrote: > > From now on, the default settings will > > use the incredible MathJax library to display math in > > exported HTML. If you had never turned on LaTeX snipped > > math publishing, this will now magically work all by itself. > > Yes, indeed it does! > > Since I read the announcement this morning, I have been playing with > MathJax. I found that when an HTML file on the local hard disk uses > MathJax from the web, MathJax reverts to image fonts in Firefox (this is > caused by a security feature of Firefox and mentioned in the MathJax > FAQ). Using a local MathJax installation in a subdirectory fixes this. > > Most of my time was spent messing around with XULRunner to load the > exported HTML page, wait until MathJax has done its magic, then > serialize the result back to XHTML. > > And replace the file:// URLs pointing to the fonts of my local MathJax > installation with data: URIs, thus embedding the fonts within the HTML > file itself, just because I can. > > The result is a single HTML file which does not require JavaScript to be > viewed (and incurs no delay while the math is being rendered). However, > as no MathJax code is present, the zoom and view source functions of > MathJax are not available. > > I have put an example online. > > Normal org-mode export using MathJax from orgmode.org: > http://www.jboecker.de/2010/08/14/mathjax-example.html > > Single-file no-javascript version: > http://www.jboecker.de/2010/08/14/mathjax-example-nojs.html > > Internet Explorer will not use the correct font, AFAIK because it only > supports the EOT fonts (MathJax uses OTF for other browsers), and in > this case also because I embedded the fonts using data: URIs and IE > limits the size of data: URIs to 32 KB. > > In browsers other than Firefox (I tested with Firefox and Opera), the > font size and spacing will differ slightly between the two versions. > > If people are interested, I can try to make the program take the name of > a file to operate on as a command line argument, so this could be run as > part of an org-mode export process or something. Of course, the > embedding of fonts in data: URIs would be optional. > > > I am really, really excited about this change. Using MathJax makes > > Org-mode > > a tool without peer for scientific note taking, I believe. It will > > also drastically improve the quality of printed web pages, because > > the web pages will not use fixed-resolution images, but scaleable fonts. > > And don't forget that on modern high resolution displays, it is common > to zoom in just to be able to decipher math in images, especially if you > want sub- and superscripts to be legible. > > -- Jan > > ___ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] MathJax is now the default for HTML math
On Aug 14, 2010, at 9:37 PM, Jan Böcker wrote: On 08/14/2010 08:09 AM, Carsten Dominik wrote: From now on, the default settings will use the incredible MathJax library to display math in exported HTML. If you had never turned on LaTeX snipped math publishing, this will now magically work all by itself. Yes, indeed it does! Since I read the announcement this morning, I have been playing with MathJax. I found that when an HTML file on the local hard disk uses MathJax from the web, MathJax reverts to image fonts in Firefox (this is caused by a security feature of Firefox and mentioned in the MathJax FAQ). Using a local MathJax installation in a subdirectory fixes this. Most of my time was spent messing around with XULRunner to load the exported HTML page, wait until MathJax has done its magic, then serialize the result back to XHTML. Hi Jan, can you expand a bit on why this is interesting to do? What are the advantages? Thanks! - Carsten And replace the file:// URLs pointing to the fonts of my local MathJax installation with data: URIs, thus embedding the fonts within the HTML file itself, just because I can. The result is a single HTML file which does not require JavaScript to be viewed (and incurs no delay while the math is being rendered). However, as no MathJax code is present, the zoom and view source functions of MathJax are not available. I have put an example online. Normal org-mode export using MathJax from orgmode.org: http://www.jboecker.de/2010/08/14/mathjax-example.html Single-file no-javascript version: http://www.jboecker.de/2010/08/14/mathjax-example-nojs.html Internet Explorer will not use the correct font, AFAIK because it only supports the EOT fonts (MathJax uses OTF for other browsers), and in this case also because I embedded the fonts using data: URIs and IE limits the size of data: URIs to 32 KB. In browsers other than Firefox (I tested with Firefox and Opera), the font size and spacing will differ slightly between the two versions. If people are interested, I can try to make the program take the name of a file to operate on as a command line argument, so this could be run as part of an org-mode export process or something. Of course, the embedding of fonts in data: URIs would be optional. I am really, really excited about this change. Using MathJax makes Org-mode a tool without peer for scientific note taking, I believe. It will also drastically improve the quality of printed web pages, because the web pages will not use fixed-resolution images, but scaleable fonts. And don't forget that on modern high resolution displays, it is common to zoom in just to be able to decipher math in images, especially if you want sub- and superscripts to be legible. -- Jan - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: [Patch] Org-fontify
Hi Erik and all, > Erik Iverson wrote: >> Having not tried this out, are the aims different than David O'Toole's >> mode-specific fontification of org-mode source blocks? >> >> http://www.mail-archive.com/emacs-orgmode@gnu.org/msg28160.html >> >> See a picture of what he's done here: >> >> http://imagebin.ca/view/iRVK_as7.html > > Nothing to do, in fact. Complementary, I hope... > > The fact is that, when you use faces with background, you see the whole line > fontified (up to the right fringe), or only up to the end of the line (last > character, =C-e=). > > My patch cares for the first behavior. See http://www.mygooglest.com/sva/highlight-whole-ines.png for the results on my minimal example file. Best regards, Seb -- Sébastien Vauban ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [Bug] or not?
Hello, Here a sample of Org code put in a document. #+begin_src org ,SCHEDULED: <2010-08-12 Thu 10:20-10:45> #+end_src The =,= should render the line "inactive" and should not trigger any line in the agenda. Though, it does. Bug or not? Best regards, Seb -- Sébastien Vauban ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] MathJax is now the default for HTML math
On 08/14/2010 10:59 PM, Carsten Dominik wrote: > Hi Jan, > > can you expand a bit on why this is interesting to do? What are the > advantages? > > Thanks! > > - Carsten Advantages are: - The user is not required to have JavaScript enabled - In some cases, there is a speed advantage, because there is no rendering stage. This is especially noticeable on high-latency connections when the MathJax files are not already cached. - Fonts can be embedded into the HTML file itself, so it feels more 'document-like' (no need to move additional files around) - The approach might be interesting for HTML email, because it would require neither JavaScript nor attachments Of course, there are disadvantages too: - No interactive MathJax features (zoom, view source, switch rendering backend) - no fallback to image fonts (although AFAIK, all current versions of major browsers support CSS3 custom fonts) - slightly different spacing and font sizes in non-Firefox browsers - if fonts are embedded within the HTML file: * IE will not show the correct font (but in my test the formatting was still correct and readable) * The HTML file will be larger (my small example grew by 436 KB). Bandwidth is wasted because the fonts are base64-encoded. I would not recommend this for regular publishing on the web. As long as JavaScript is enabled (as it is in most cases), the disadvantages outweigh the advantages. It might come in handy if you want to send someone a single file (although you can always use PDF for that) or if you want to provide an alternative for users who have JavaScript disabled. Ideally, there would be some sort of graceful degradation, so that users without JavaScript see the non-JS version, but if JavaScript is enabled, the math gets re-rendered and all MathJax features are available. I have not explored the feasibility of that. On 08/14/2010 10:39 PM, Detlef Steuer wrote: > Could you post the org file to give dummies like me a head start? > Especially the serializing back to HTML? How is it done? I have attached the (very simple) example org file to this email. The first example is the result of exporting this file with C-c C-e h (like Carsten said, it Just Works). The second example is the result of processing the first one with a xulrunner application I hacked together (which is independent of emacs). I'll try to get that application into a publishable form tomorrow (remove hard-coded values, make embedding fonts into the HTML file optional, etc). My aim is to provide an elisp function to be called from an export hook which makes the appropriate call to create the non-JS version. -- Jan * Testing MathJax: $2^4 = 16 \le 16$ \( exp(z) = \sum_{k=0}^\infty \frac{z^k}{k!} \) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Docstrings: Use of `C-u' (was: [OT] Passing universal argument to a function)
Memnon Anon writes: > I am confused. [I prepared a long mail, but I deleted it all. I will try to keep it short] If one wants to bind a key to `C-u C-c C-x C-i', the easiest way is to have a look at the docstring and try to figure out, how to call the function in a lambda, i.e. an unnamed function, bound to the preferred key. Right? This person usually has a look at the docstring and tries to figure out how the argument is interpreted by the function: Sure, it is *most of the times* used as an interactive funtion, but binding a key (i.e. a common task) to a function called with `C-u' via a lambda (= a non interactive call) seems to be probable action. Right? So, in orgmode, I see 'some' functions - usually called interactively - which provide a docstring like this: ,[ org-clock.el ] | (defun org-clock-in (&optional select start-time) | "Start the clock on the current item. | If necessary, clock-out of the currently active clock. | With a prefix argument SELECT (\\[universal-argument]), offer a list of \ | recently clocked tasks to | clock into. When SELECT is \\[universal-argument] \\[universal-argument], \ | clock into the current task and mark | is as the default task, a special task that will always be offered in | the clocking selection, associated with the letter `d'." ` which say: use universal argument. But this seems - all by itself without looking at how the argument is used in the function - uncomplete for a user who wants to call the function non-interactively. I found only one other example so far, which is different: ,[ org-agenda.el ] | (defun org-agenda-set-restriction-lock (&optional type) | "Set restriction lock for agenda, to current subtree or file. | Restriction will be the file if TYPE is `file', or if type is the * universal prefix '(4), or if the cursor is before the first headline | in the file. Otherwise, restriction will be to the current subtree." ` Adding that the prefix argument will be interpretated as a *list of one* integer like this -> '(4) seems great. This clarifies that the test against the prefix argument is something like "(when (equal arg '(4))" without looking at the code of the function itself. Does this make any sense? Would adding the `'(4)' part to other docstrings be welcome? = Info Another point I am confused about: ,[ (info "(org)Agenda commands") ] | Remote editing | .. | | `0-9' | Digit argument. ` Okay, a number - as a Prefix, right? - gives a Digit argument. But what does this really do? For some commands, it works as a repeater: `5 n' in an agenda buffer moves down 5 lines. (This is not mentioned in the manual. Should it be?) But what does the Digit argument do for e.g. org-agenda-clock-out? ,[ org-agenda.el ] | (defun org-agenda-clock-out (&optional arg) | "Stop the currently running clock." | (interactive "P") | (unless (marker-buffer org-clock-marker) | (error "No running clock")) | (let ((marker (make-marker)) newhead) | (org-with-remote-undo (marker-buffer org-clock-marker) | (with-current-buffer (marker-buffer org-clock-marker) | (save-excursion | (save-restriction | (widen) | (goto-char org-clock-marker) | (org-back-to-heading t) | (move-marker marker (point)) | (org-clock-out) | (setq newhead (org-get-heading)) | (org-agenda-change-all-lines newhead marker) | (move-marker marker nil))) ` It takes an (optional) arg, but is it used anywhere?! If there is no arg interpreted anywhere, why is it there? I am *really* sorry if I waste your time on this, because it is clear to you and should be to anyone else; but I don't get. And orgmode brought me into this stuff, so where else should I ask? ;) Memnon "I should stick to latin!" Anon ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Menu-bar bug
Rustom Mody writes: > Update -- Now it seems more likely theres some bug somewhere. > Start emacs -Q > The menu-bar line is as expected ie it has > File Edit Options Buffers Tools Lisp-Interaction Help > > Under Lisp-Interaction there are 5 entries: > Complete-Lisp-SymbolEvaluate-Defun > > Now I do M-x org-mode > The menu-bar now has > File Edit Options Buffers Tools Org Tbl Help > > Note Lisp-Interaction has disappeared > > But under Org I see the same entries that were earlier under lisp > interaction. Cannot confirm that bug. It simply works as expected here. (emacs 24, Debian Squeeze, Org-mode 7.01 --- the one in emacs trunk). Sebastian ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [ANN] List improvement v.2
Hi Nicolas, I have finally started to look at your changes to the list implementation. Lots of it is very good! I like for example that TAB indentation now works a lot better. Here are a few problems I noted so far: 1 Error when pressing M-RET in second line after list ~~ - Example item1 - Exmaple item2 With cursor position at "@", M-RET throws an error 2 Incompatibility 1 - Example 1 - Ex 2 This used to be outside of the list. The HTML exporter still treats it as being outside of the list. The LaTeX exporter treats it as part of the last item. If I add a second empty line, then both exporters handle it well. So this breaks with documented properties of the lists. I guess this is unavoidable because this is just how the new list definition works. But it will break existing documents when exported to LaTeX 3 Text between two sublists - Ex1 - Ex2 - Ex2a - Ex2b Some text between two sublists - A new list starts This always was an inconsistency between HTML and LaTeX export, and it still is now. There seems to be no way now to do what I intend here, putting some text between two lists. On Jul 22, 2010, at 11:08 PM, Nicolas Goaziou wrote: Hello, Here is a new, and probably final feature-wise, suggestion of list improvement in Org Mode. Table of Contents = 1 What is it about again ? 2 Is that all ? 2.1 Preserving blank lines 2.2 Timer lists 2.3 Automatic rules 2.4 `org-apply-on-list' 3 Where can it be tried ? 1 What is it about again ? ~~~ I redefined lists in Org Mode. Lists start, as before, at a bullet (whose true regexp is at `org-item-beginning-re'), and end at either `org-list-end-regexp', a new headline, or, obviously, end of buffer. `org-list-end-regexp' is customizable and defaults to 2 blank lines, but `org-empty-line-terminates-plain-lists' has precedence over it. Moreover, any `org-list-end-regexp' found in special blocks does not end list. Here are two examples of valid lists: Case 1: `org-list-end-regexp' is at default value - First item - Sub item #+BEGIN_EXAMPLE Two blank lines below Two blank lines above #+END_SRC - Last sub item List has ended at the beginning of this line. Case 2: `org-list-end-regexp' is "^[ \t]*___[ \t]*\n" - item 1 - item 2 - sub-item - sub-item 2 - item 3 __ List has ended at the beginning of this line. Now, Org Mode knows when a list has ended and how to indent line accordingly. In other words, you can `org-return-indent' three times to exit a list and be at the right column to go on with the text. This new definition is also understood by exporters (LaTeX, DocBook, HTML or ASCII) and `org-list-end-regexp' will appear in source as a blank line, whatever its value is (as long as it starts with a caret and ends with a newline character, as specified in doc-string). Another advantage is that you can have two lists of different types in a row like in the example below: - item - item 1. item 2. item In this example, you can move (or cycle, or indent) items in the second list without worrying about changing the first one. 2 Is that all ? Yes and no. I tried as much as possible to keep compatibility with previous implementation. But, as I was at it, I made a number of minor improvements I am now going to describe. 2.1 Preserving blank lines === `org-move-item-up' and `org-move-item-down' will not eat blank lines anymore. You can move an item up and down and stay assured list will keep its integrity. The same is true for `org-sort-list' that would previously collapse the list being sorted. Sorting is now safe. `org-insert-item', when 'plain-list-item is set to 'auto in `org-blank-before-new-entry' (the default, I think), will work hard to guess the appropriate number of blank lines to insert before the item to come. The function is also much more predictable (in previous version, trying to insert an item with point on a blank line between 2 items would create a new headline). 2.2 Timer lists There are three improvements in timer lists (C-c C-x -). 1. When a new item is created, it should be properly indented and not sticked to column 0 anymore, 2. When an item is inserted in a pre-existing timer list, it will take profit of what has been done to `org-insert-item', 3. `org-sort-list' can now sort timer lists with the t and T commands. /Note/: in order to preserve lists integrity, Org Mode will send an error if you try to insert a timer list inside a list of another type. 2.3 Automatic rules I've added sets of rules (applied by default) that can improve lists experience. You can deactivate them individually by customizing `
[Orgmode] Re: [PATCH] Mode-specific fontification of babel source blocks
"David O'Toole" writes: > I've got a preliminary patch that adds optional "native" fontification > for source blocks. It uses the block's declared mode to fontify the > block text. So now blocks look the way they should, and this opens the > way to further enhancements. I've tested David's patch, and made some additions. It's really nice to have fontified code in the Org buffer. It's not that smooth when editing code in the Org buffer, but there seems to be no easy way round that (happy to be proved wrong). In the continued absence of an alternative, I think we should consider adding this. I've prepared a patch which does the following: - David's original patch - Extend regexp to match full Org code src block syntax - I've moved the fontification code out into a separate function - I've provided a standalone manual fontification function `org-src-fontify-block'. On my system, I have not managed to eliminate some point movement during fontification. This occurs because of the heavy-duty method of fontification (delete the code, re-insert fontified code generated in a separate buffer). On the other hand, Org users are not really encouraged to *edit* code in the Org buffer, and the slightly clunky fontification is only experienced by those who go against that. David's variable `org-src-fontify-natively' determines whether font-lock automatically fontifies code blocks. Even if that variable is nil, it is still possible to call `org-src-fontify-block' for manual fontification. Buffer movement is especially problematic with org-indent-mode. Patch against master attached, and also in branch org-src-fontification at g...@github.com:dandavison/org-devel.git. diff --git a/lisp/org-src.el b/lisp/org-src.el index baa2b11..3198439 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -654,6 +654,43 @@ the language, a switch telling if the content should be in a single line." (org-add-hook 'org-src-mode-hook 'org-src-mode-configure-edit-buffer) +(defun org-src-font-lock-fontify-block (lang start end) + (let* ((lang-mode (org-src-get-lang-mode lang)) + (string (buffer-substring-no-properties start end)) + (modified (buffer-modified-p)) + (fontified-output + (with-temp-buffer + (insert string) + (funcall lang-mode) + (font-lock-fontify-buffer) + (add-text-properties + (point-min) (point-max) + '(font-lock-fontified t fontified t font-lock-multiline t)) + (buffer-substring (point-min) (point-max) +(when fontified-output + (goto-char start) + (delete-region start end) + (insert fontified-output) + (set-buffer-modified-p modified))) + t) ;; Tell `org-fontify-meta-lines-and-blocks' that we fontified + +(defun org-src-fontify-block () + "Fontify code block at point" + (interactive) + (let ((org-src-fontify-natively t) + (info (org-edit-src-find-region-and-lang)) + (point (point))) +(font-lock-fontify-region (nth 0 info) (nth 1 info)) +(goto-char point))) + +(defun org-src-get-lang-mode (lang) + "Return major mode that should be used for LANG. +LANG is a string, and the returned major mode is a symbol." + (intern + (concat +((lambda (l) (if (symbolp l) (symbol-name l) l)) + (or (cdr (assoc lang org-src-lang-modes)) lang)) "-mode"))) + (provide 'org-src) ;; arch-tag: 6a1fc84f-dec7-47be-a416-64be56bea5d8 diff --git a/lisp/org.el b/lisp/org.el index a05f2bf..b381ad0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5017,17 +5017,23 @@ will be prompted for." '(display t invisible t intangible t)) t))) +(defvar org-src-fontify-natively nil + "When non-nil, fontify source blocks like their major mode would.") + (defun org-fontify-meta-lines-and-blocks (limit) "Fontify #+ lines and blocks, in the correct ways." (let ((case-fold-search t)) (if (re-search-forward - "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)\\(.*\\)\\)" + "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)[ \t]*\\(\\([^ \t\n]*\\)[ \t]*\\(.*\\)\\)\\)" limit t) - (let ((beg (match-beginning 0)) - (beg1 (line-beginning-position 2)) - (dc1 (downcase (match-string 2))) - (dc3 (downcase (match-string 3))) - end end1 quoting block-type) + (let* ((beg (match-beginning 0)) + (block-start (match-end 0)) + (block-end nil) + (lang (match-string 7)) + (beg1 (line-beginning-position 2)) + (dc1 (downcase (match-string 2))) + (dc3 (downcase (match-string 3))) + end end1 quoting block-type) (cond ((member dc1 '("html:" "ascii:" "latex:" "docbook:")) ;; a single line of backend-specific content @@ -5047,6 +5053,7 @@ will be prompted for." (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*") nil t) ;; on purpose, we look further than LIMIT (setq end (match-end 0) end1 (1- (match-beginning 0))) + (setq block-end (match-beginning 0)) (when quoting (remove-text-properties beg end '(display t
[Orgmode] [PATCH] Indent code with TAB in Org buffer
With this patch TAB in a code block aligns the code according to the major mode. The macro could be used to do the same thing for other commands (i.e. allow other commands to be invoked in the Org buffer, but actually carried out in the code buffer.) Patch attached and in branch src-block-tab at g...@github.com:dandavison/org-devel.git. diff --git a/lisp/org-src.el b/lisp/org-src.el index baa2b11..fc15a83 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -435,6 +435,19 @@ the fragment in the Org-mode buffer." (message "%s" msg) t))) +(defmacro org-src-do-in-edit-buffer (&rest body) + "Evaluate BODY in edit buffer if there is a code block at point. +Return t if a code block was found at point, nil otherwise." + `(when (org-edit-src-code) + ,@body + (org-edit-src-exit) t)) + +(defun org-src-tab-command () + "Do what TAB does in the edit buffer for code block at point." + (org-src-do-in-edit-buffer + (funcall (key-binding (kbd "TAB") + +(add-hook 'org-tab-first-hook 'org-src-tab-command) (defun org-edit-src-find-region-and-lang () "Find the region and language for a local edit. Return a list with beginning and end of the region, a string representing Dan ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode