[Orgmode] Release 6.17
Hi, I am releasing version 6.17 of Org-mode. Besides the footnote support discussed already extensively here, this release also contains a new feature to make Org-mode more usable for writing tutorials and similar documents with code examples. Lines in code examples can now be numbered, and you can link to specific lines with magical highlighting of the line when hovering the moue over the link. Enjoy. - Carsten Changes in Version 6.17 === Overview = - Footnote support - Line numbers and references in literal examples - New hooks for export preprocessing - Capture column view into a different file Details Footnote support - Org-mode now directly supports the creation of footnotes. In contrast to the /footnote.el/ package, Org-mode's footnotes are designed for work on a larger document, not only for one-off documents like emails. The basic syntax is similar to the one used by /footnote.el/, i.e. a footnote is defined in a paragraph that is started by a footnote marker in square brackets in column 0, no indentation allowed. The footnote reference is simply the marker in square brackets inside text. For example: The Org homepage[fn:1] now looks a lot better than it used to. ... [fn:1] The link is: http://orgmode.org Org-mode extends the number-based syntax to /named/ footnotes and optional inline definition. Using plain numbers as markers is supported for backward compatibility, but not encouraged because of possible conflicts with LaTeX syntax. Here are the valid references: - [1] :: A plain numeric footnote marker. - [fn:name] :: A named footnote reference, where `name' is a unique label word or, for simplicity of automatic creation, a number. - [fn:: This is the inline definition of this footnote] :: A LaTeX-like anonymous footnote where the definition is given directly at the reference point. - [fn:name: a definition] :: An inline definition of a footnote, which also specifies a name for the note. Since Org allows multiple references to the same note, you can then use use `[fn:name]' to create additional references. Footnote labels can be created automatically, or you create names yourself. This is handled by the variable `org-footnote-auto-label' and its corresponding `#+STARTUP' keywords, see the docstring of that variable for details. The following command handles footnotes: - C-c C-x f :: The footnote action command. When the cursor is on a footnote reference, jump to the definition. When it is at a definition, jump to the (first) reference. Otherwise, create a new footnote. Depending on the variable `org-footnote-define-inline' (with associated `#+STARTUP' options `fninline' and `nofninline'), the definitions will be placed right into the text as part of the reference, or separately into the location determined by the variable `org-footnote-section'. When this command is called with a prefix argument, a menu of additional options is offered: - s :: Sort the footnote definitions by reference sequence. During editing, Org makes no effort to sort footnote definitions into a particular sequence. If you want them sorted, use this command, which will also move entries according to `org-footnote-section'. - n :: Normalize the footnotes by collecting all definitions (including inline definitions) into a special section, and then numbering them in sequence. The references will then also be numbers. This is meant to be the final step before finishing a document (e.g. sending off an email). The exporters do this automatically, and so could something like `message-send-hook'. - d :: Delete the footnote at point, and all references to it. - C-c C-c :: If the cursor is on a footnote reference, jump to the definition. If it is a the definition, jump back to the reference. When called with a prefix argument at either location, offer the same menu as `C-u C-c C-x f'. - C-c C-o or mouse-1/2 :: Footnote labels are also links to the corresponding definition/reference, and you can use the usual commands to follow these links. Org-mode's footnote support is designed so that it should also work in buffers that are not in Org-mode, for example in email messages. Just bind `org-footnote-action' to a global key like `C-c f'. The main trigger for this development came from a hook function written by Paul Rivier, to implement named footnotes and to convert them to numbered ones before export. Thanks, Paul! Thanks also to Scot Becker for a thoughtful post bringing this subject back onto the discussion table, and to Matt Lundin for the idea of named footnotes and his prompt testing of the new features. Line numbers and references in literal examples
Re: [Orgmode] Release 6.17
On Jan 4, 2009, at 9:13 AM, Carsten Dominik wrote: Hi, I am releasing version 6.17 of Org-mode. [...] Line numbers and references in literal examples [...] Here is an example: #+begin_src emacs-lisp -n -r (defmacro org-unmodified (rest body) ((def)) Execute body without changing `buffer-modified-p'. `(set-buffer-modified-p ((back)) (prog1 (buffer-modified-p) ,@body))) #+end_src [[Line ((def))]] contains the macro name. Later at line [[((back))]], This did not come out right, it must be [[((def))][Line ((def))]] contains the macro name. Later at line [[((back))]] i.e. the linke part of the link must be only the coderef cookie, while the description part may contain additional text. - Carsten ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Release 6.17
On Jan 4, 2009, at 3:33 PM, Steven E. Harris wrote: Carsten Dominik carsten.domi...@gmail.com writes: Code references use special labels embedded directly into the source code. Such labels look like ((name)) and must be unique within a document. How does the parser know that, say, ((def)) is not a valid expression in the surrounding Lisp forms? Is it important that it be separated by space, or be the last token on the line? Trying to concoct a motivating example, consider a structure represented as nested lists: , | '(a | ((b c) d) | (((e) f))((def)) | g) ` Without knowing what the enclosing `quote' form means, how do know that ((def)) is not part of it? Hi Steven, good question, and the answer is that is does not know, cannot know, because this is a feature that is supposed to work for any kind of example, an the parser cannot know all possible syntaxes :-) This idea is to make this work in a heuristic way, by using something that is unlikely enough to occur in real code. You are right that what I am using might be too dangerous for emacs lisp or other lisp dialects, and it could also show up in other languages like C. What would be safer? namelike the other Org-mode targets? That would make sense. Does anyone know a language where this would be used in real life? It would make it harder to write about Org-mode, though. Or do we need another option, so that, if needed, we could switch do a different syntax? Comments are very welcome. - Carsten ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Emacs-orgmode Digest, Vol 35, Issue 7
Carsten On Jan 4, 2009, at 3:33 PM, Steven E. Harris wrote: Carsten Dominik carsten.domi...@gmail.com writes: Code references use special labels embedded directly into the source code. Such labels look like ((name)) and must be unique within a document. How does the parser know that, say, ((def)) is not a valid expression in the surrounding Lisp forms? Is it important that it be separated by space, or be the last token on the line? Trying to concoct a motivating example, consider a structure represented as nested lists: , | '(a | ((b c) d) | (((e) f)) ((def)) | g) ` Without knowing what the enclosing `quote' form means, how do know that ((def)) is not part of it? Carsten Hi Steven, Carsten good question, and the answer is that is does not know, cannot Carsten know, because this is a feature that is supposed to work for any Carsten kind of example, an the parser cannot know all possible syntaxes Carsten :-) Carsten This idea is to make this work in a heuristic way, by using Carsten something that is unlikely enough to occur in real code. Carsten You are right that what I am using might be too dangerous for emacs Carsten lisp or other lisp dialects, and it could also show up in other Carsten languages like C. Carsten What would be safer? Carsten name like the other Org-mode targets? That would make sense. Carsten Does anyone know a language where this would be used in real life? Carsten It would make it harder to write about Org-mode, though. Carsten Or do we need another option, so that, if needed, we could switch Carsten do a different syntax? Carsten Comments are very welcome. Would it be possible to adopt an approach like that used in Latex verbatim mode, where one could introduce a new delimeter for use in the block in question (perhaps with default being and )? ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] How to pause the relative timer
I jumped into some elisp, and eventually I might get it, but while I think I'm close, my vacation is over, and I'm going to call uncle. Here is some crummy code I started putting together to try to pause the relative timer in org-timer.el. Can someone give me a nudge, and suggest what's wrong? (Lot's, I'll wager!). I get the message time-to-seconds: Symbol's function definition is void: org-pause-timer-time when running org-aed-pause-timer-start after setting with org-aed-pause-timer-pause. I'll bet there are better ways to do this. I'll figure it out when I have time. ---%-- (defvar org-pause-timer-time nil t=X for stopped timer.) (defun org-aed-pause-timer-pause () Set the time at pause to a variable for later recovery in org-aed-pause-timer-start (interactive) (let (org-pause-timer-time (current-time (defun org-aed-pause-timer-start () Recover pause start time, do the math, and restart at the new time (interactive) (insert (format org-timer-format (org-timer-secs-to-hms (floor (- (time-to-seconds (current-time)) (time-to-seconds (org-pause-timer-time X I have a plan, beyond the mere and obvious utility of being able to pause the timer. With some help, I've burgled some code and gotten a function to start vlc asynchronously on a video file from dired. Eventually, I want to figure out how to pause the vlc process, and pause the org-mode timer at the same time. It just occurred to me, however, that it would be even more interesting to pause the video player and org-mode's timer would put the pause time into the buffer, to accept a note. Hmmm... FOr that I have to figure out how to remotely pause vlc and restart. Of course, this kind of project could easily get out of hand. I'm afraid it's beyond my programming ability, but it's already interesting. Frivolous? If anyone wants to look at the dired-vlc.el code, I'll send it, but I would think it's beyond this list's boundaries of interest (if that's possible). Thanks for Org-mode, and thanks for being patient. Alan -- Alan Davis It's never a matter of liking or disliking ... ---Santa Ynez Chumash Medicine Man ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Release 6.17
Carsten Dominik carsten.domi...@gmail.com writes: Code references use special labels embedded directly into the source code. Such labels look like ((name)) and must be unique within a document. How does the parser know that, say, ((def)) is not a valid expression in the surrounding Lisp forms? Is it important that it be separated by space, or be the last token on the line? Trying to concoct a motivating example, consider a structure represented as nested lists: , | '(a | ((b c) d) | (((e) f))((def)) | g) ` Without knowing what the enclosing `quote' form means, how do know that ((def)) is not part of it? -- Steven E. Harris ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Release 6.17
Carsten Dominik domi...@science.uva.nl writes: This idea is to make this work in a heuristic way, by using something that is unlikely enough to occur in real code. And that is a tough problem, as code is usually defined as stuff that contains all kinds of weird (and often paired) delimiters. [...] What would be safer? namelike the other Org-mode targets? That would make sense. Does anyone know a language where this would be used in real life? It would make it harder to write about Org-mode, though. Or do we need another option, so that, if needed, we could switch do a different syntax? This reminds me of the leaning toothpick problem with regular expression syntax; Perl and some other languages adopted the flexibility to accept any matching delimiters (either the same character used twice or a balancing pair) in lieu of the default '/' delimiter character. There was the need to have the delimiters be able to get out of the way of the dominant syntax within that particular regular expression. Here, too, I expect that we'd either need to define language-specific escape hatches, or stop guessing and force the user to define the active delimiters. What if the user could specify before each code block some dispatch character that then had to be followed by a more telling string, such as #line:def. In that example, the octothorpe is the dispatch character, the line: is the belt-and-suspenders clarifying tag, and the def is the named label for that line. Force it to be at the end of the line (perhaps modulo trailing space), as there should only be one definition per line. A regular expression match would look for #line:([^)]+)\s*$ ^ | + (not fixed) except that the dispatch character would need to be composed in and regex-quoted appropriately. Also, that one would tolerate anything but a closing parenthesis in a label; it could be more restrictive to tolerate something more commonly expected of an identifier such as alphanumerics, dashes, and underscores. You could punt even further and just demand that the user provide a suitable regex for finding the line labels unambiguously. I'm just leery of trying to pick a default that's expected to work not just within natural language, but within program source code. -- Steven E. Harris ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] extensible syntax
A general idea, which might or might not be useful. There are occasionally questions about syntax, like this: Also, I'm afraid definition matching regexp won't play nicely with text indentation, ... -- Paul Or this: What would be safer? -- Carsten I like the footnote implementation, so this is for future features, not necessarily footnotes. One issue when implementing new syntax (or changing existing syntax or cleaning up code) is parsing risk, which I will define as the risk that the syntax and the regexp or matching code: 1) conflicts with user text 2) conflicts with existing features 3) will be hard to maintain 4) constrains future features by making them conflict syntactically 5) makes you run out of syntax to use in the future 6) will require complicated regexps 7) doesn't readily handle stuff you might want in the future, like being combined with another feature 8) will be hard to quote, escape, comment, *boldify*, etc. 9) doesn't handle nestability, print-readability, pretty-printability, syntax coloring, etc. 10) will be inefficient when called in a loop 11) isn't factored out 12) etc. For example, one of the many reasons for using org-IDs (:)) in the conversation manager (as proposed) is that there are already functions to parse org-IDs, so a new syntax is not necessary and therefore parsing risk is minimized. In case parsing risk is a concern when adding a new feature to org, here is one idea: have a generic syntax that is extensible with keywords. The idea is to have a bracketing syntax with a reserved keyword as the first element that says what you are doing. To use footnotes as an example (this is not a suggestion to change footnote syntax, just an example that can be used for future syntax): You might use something like here is some text to be footnoted $[fn apple] to specify the footnote link, and $[fn-target apples are delicious] to specify the target. The general point I want to make is that once such a syntax is decided on, many future features are possible without introducing parsing risk. For example, you can implement a new feature as $[my-new-feature ...]. Then there is no parsing risk, even though you have just added a new feature. For modifications of features, you can use keywords: $[my-new-feature ... :myparameter ...]. These are easily parsed by standard functions for parsing lists. You can develop ways to boldify, quote, nest, prettily print, etc. this syntax, and those ways will work well with all future features that use it. Of course, the dollar sign and brackets are not the only possibility; it could be percent sign and parentheses, for example. You will not be starting from scratch. Lisp has already worked out many of these issues. I will leave it to those who write massive amounts of org code to decide whether an extensible syntax might be useful to reduce parsing risk for future features. But I thought that I would propose the idea in case it is of interest. -- For personal gain, myalgic encephalomyelitis denialists are knowingly causing further suffering and death by grossly corrupting science. Do you care about the world? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Release 6.17
On Sun, Jan 4, 2009 at 10:01 AM, Carsten Dominik domi...@science.uva.nl wrote: On Jan 4, 2009, at 3:33 PM, Steven E. Harris wrote: Carsten Dominik carsten.domi...@gmail.com writes: Code references use special labels embedded directly into the source code. Such labels look like ((name)) and must be unique within a document. How does the parser know that, say, ((def)) is not a valid expression in the surrounding Lisp forms? Is it important that it be separated by space, or be the last token on the line? Trying to concoct a motivating example, consider a structure represented as nested lists: , | '(a | ((b c) d) | (((e) f))((def)) | g) ` Without knowing what the enclosing `quote' form means, how do know that ((def)) is not part of it? Hi Steven, good question, and the answer is that is does not know, cannot know, because this is a feature that is supposed to work for any kind of example, an the parser cannot know all possible syntaxes :-) This idea is to make this work in a heuristic way, by using something that is unlikely enough to occur in real code. You are right that what I am using might be too dangerous for emacs lisp or other lisp dialects, and it could also show up in other languages like C. What would be safer? namelike the other Org-mode targets? That would make sense. Does anyone know a language where this would be used in real life? It would make it harder to write about Org-mode, though. Or do we need another option, so that, if needed, we could switch do a different syntax? Comments are very welcome. - Carsten I think that is quote words in perl 6. @list = $this is a 'list' of 7 strings # in perl 6 is @list = qw/$this is a 'list' of 7 strings/ # in perl 5. It's looking like perl 6 will be a reality and that syntax is recommend in several places like hash dereferences. %hashbareword # look up bareword in %hash I can't remember enough off the top of my head, but I think name will play merry heck with common(?) perl 6 code. I can look up more examples if needed. Edd ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Minor bug in footnotes
Hi Carsten, After some additional testing of footnote options, I discovered another minor quirk. It occurs when org-footnote-section is set to a value such as Footnotes (the default value). When org-footnote-action is called for the very first time in an org buffer, the Footnotes headline is automatically created, but the footnote is placed above the headline. I believe this occurs when the Footnotes headline is the last line in the buffer, which is the case when the headline is automatically created. Once an empty line is placed beneath the Footnotes headline, new footnotes are correctly placed beneath it. The example below illustrates the behavior. Thanks, Matt begin org file * Headline one The first footnote.[fn:1] The second footnote.[fn:2] Now I will add a an empty line beneath the Footnotes section.[fn:3] [fn:1] Notice that this footnote is inserted above the Footnotes section. [fn:2] The same behavior. * Footnotes [fn:3] Notice that the footnote is now placed below the footnote section. -end org file- ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Release 6.17
On Jan 4, 2009, at 3:33 PM, Steven E. Harris wrote: [...] Without knowing what the enclosing `quote' form means, how do know that ((def)) is not part of it? Hi Steven, good question, and the answer is that is does not know, cannot know, because this is a feature that is supposed to work for any kind of example, an the parser cannot know all possible syntaxes :-) This idea is to make this work in a heuristic way, by using something that is unlikely enough to occur in real code. You are right that what I am using might be too dangerous for emacs lisp or other lisp dialects, and it could also show up in other languages like C. What would be safer? [...] Perhaps it would make sense to let the syntax vary by source language. Like, elisp could have something like ;;((def))\n and C something like /*((def))*/. Tom Breton ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Release 6.17
I have a reply under the subject, extensible syntax. One possibility is this: if the syntax exists in a given language (fairly unlikely), then you simply escape like this: \c = c for all c (including \ itself). -- For personal gain, myalgic encephalomyelitis denialists are knowingly causing further suffering and death by grossly corrupting science. Do you care about the world? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Agenda column view conflicts with diary inclusion
On Mon, Jan 5, 2009 at 7:16 AM, Matthew Lundin wrote: When I include diary entries in the agenda, I get the following error while calling columns view in the agenda: org-entry-properties: Wrong type argument: stringp, nil When I turn off diary inclusion by typing D, the problem goes away. Certainly, it is trivial to turn off diary inclusion before calling columns view or to create a custom agenda command that does the same, but I thought I'd report this behavior. I can not duplicate this. It works okay for me. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode