[Orgmode] double entries in my diary / not identifying exisiting entries probably
Hi! First the information: Org-mode version 7.4 (release_7.4.376.gfa9df) GNU Emacs 23.2.1 (i586-suse-linux-gnu, GTK+ Version 2.20.1) of 2011-02-10 on build21 The symptoms: I usually log in my arrival in the office using: C-c a a i j Jumping straight to my diary entries. Since Friday, when I thought I had mistyped something I get a new header line for the day, even if it already exists. A picture may tell exactly what is going on: Before (having just entered the office): ** 2011-02 Februar *** 2011-02-14 Montag [2011-02-14 Mo 08:20]-- Hitting C-c a a i j a second time: ** 2011-02 Februar *** 2011-02-14 Montag [2011-02-14 Mo 08:20]-- ** 2011-02 Februar *** 2011-02-14 Montag May be it has something to do with the recent patch for identifying date-strings? Thx Detlef ___ 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] Improve percent escaping links in Org mode (pull request / OK to push)
At Sun, 13 Feb 2011 14:41:14 +0100, Bastien wrote: > > Hi David, > > David Maus writes: > > > Rebased to current head and here we go. > > Wow, great work -- thanks for the perfect changelogs! > > I've been through the patches, everythings looks good, feel > free to push (and to mark patches as "accepted" in patchwork.) Thanks for the quick review. I won't be available until wednesday so I most likely push wednesday or thursday evening with a short warning notice. > You mentioned some possible backward compatibility issues with > a few existing links before in this thead, any update on this? Nope, but it just occured to me that we might provide a small elisp command that users can run in a buffer to check for possible problems? The elisp could check each link for a substring that matches the def of a percent escaped character (%[a-zA-Z]{2}) and is not in the old `org-link-escape-chars' list. Such links might pose a problem because the new unescaping function will unescape this sequence. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgphagqGwithp.pgp Description: PGP signature ___ 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] Nice python listings colors, or solution to beamer + minted brokenness?
Hi Chris, That'll work well enough for now I think. Thanks much for the response! Chris Malone writes: > Also, it's not an elegant or automated solution, but check out Section > 2.8: Emphasize Identifiers in the listings manual.? You could > basically add something like > > emph={ReferenceDeskPanel}, emphstyle=\color{blue} > > to your =lstset= to get that particular class to have a blue font.? > You could add such a line for /every/ class you have by putting in the > optional argument as described in the manual.? I don't > know how one could do this for every word that follows the Python > =class= directive, as the =lstset= /key-value/ setup doesn't allow for > such things... > > HTH, > > Chris > > On Sun, Feb 13, 2011 at 8:46 PM, Chris Malone > wrote: > > Hi Chris, > > I doubt this will fix the problem (it is more of a curiosity), but why in > your =lstset= do you have the language as "\Python" instead of "Python"? > > Chris > > On Sun, Feb 13, 2011 at 7:35 PM, Christopher Allan Webber > wrote: > > Hello all, > > I currently am trying to export something vaguely like this for a > presentation in beamer: > > #+BEGIN_SRC python :exports code > class ReferenceDeskPanel(bpy.types.Panel): > . .bl_label = 'Reference Desk' > . .bl_space_type = 'VIEW_3D' > . .bl_region_type = 'TOOLS' > > . .def draw(self, context): > . . . .layout = self.layout > > . . . .row = layout.row() > . . . .row.prop( > . . . . . .context.scene, 'refdesk_search', > . . . . . .text="", icon='VIEWZOOM') > > . . . .search_string = context.scene.get('refdesk_search') > #+END_SRC > I've tried using listings with: > > #+begin_LaTeX > .\definecolor{keywords}{RGB}{255,0,90} > .\definecolor{comments}{RGB}{60,179,113} > > .\lstset{ > . .language=\Python, > . .keywordstyle=\color{keywords}, > . .commentstyle=\color{comments}emph, > . .procnamestyle=\color{blue}\textbf, > . .emphstyle=\color{black}\bfseries, > . .} > #+end_LaTeX > in my document but I can't figure out how to get the class name > (ReferenceDeskPanel) to be highlighted in any form. ?I've read through > the listings manual but I can't find any reference on how to do this. > > I also tried using minted, but I'm running into the problem discussed in > this thread: > > http://article.gmane.org/gmane.emacs.orgmode/32147/match=minted > > I'm at wit's end... I just want to figure out how to syntax highlight my > whole python snippet! ?Any examples of good color sets in listings to > use would be *greatly* appreciated! ?Or a solution to that minted + > beamer problem! ?Either one! > > Super, ultra thanks in advance, > ?- cwebb > > -- > ??? ? ?? > > ___ > 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] Nice python listings colors, or solution to beamer + minted brokenness?
Also, it's not an elegant or automated solution, but check out Section 2.8: Emphasize Identifiers in the listings manual. You could basically add something like emph={ReferenceDeskPanel}, emphstyle=\color{blue} to your =lstset= to get that particular class to have a blue font. You could add such a line for /every/ class you have by putting in the optional argument as described in the manual. I don't know how one could do this for every word that follows the Python =class= directive, as the =lstset= /key-value/ setup doesn't allow for such things... HTH, Chris On Sun, Feb 13, 2011 at 8:46 PM, Chris Malone wrote: > > Hi Chris, > > I doubt this will fix the problem (it is more of a curiosity), but why in > your =lstset= do you have the language as "\Python" instead of "Python"? > > Chris > > > > On Sun, Feb 13, 2011 at 7:35 PM, Christopher Allan Webber < > cweb...@dustycloud.org> wrote: > >> Hello all, >> >> I currently am trying to export something vaguely like this for a >> presentation in beamer: >> >> #+BEGIN_SRC python :exports code >> class ReferenceDeskPanel(bpy.types.Panel): >>bl_label = 'Reference Desk' >>bl_space_type = 'VIEW_3D' >>bl_region_type = 'TOOLS' >> >>def draw(self, context): >>layout = self.layout >> >>row = layout.row() >>row.prop( >>context.scene, 'refdesk_search', >>text="", icon='VIEWZOOM') >> >>search_string = context.scene.get('refdesk_search') >> #+END_SRC >> >> I've tried using listings with: >> >> #+begin_LaTeX >> \definecolor{keywords}{RGB}{255,0,90} >> \definecolor{comments}{RGB}{60,179,113} >> >> \lstset{ >>language=\Python, >>keywordstyle=\color{keywords}, >>commentstyle=\color{comments}emph, >>procnamestyle=\color{blue}\textbf, >>emphstyle=\color{black}\bfseries, >>} >> #+end_LaTeX >> >> in my document but I can't figure out how to get the class name >> (ReferenceDeskPanel) to be highlighted in any form. I've read through >> the listings manual but I can't find any reference on how to do this. >> >> I also tried using minted, but I'm running into the problem discussed in >> this thread: >> >> http://article.gmane.org/gmane.emacs.orgmode/32147/match=minted >> >> I'm at wit's end... I just want to figure out how to syntax highlight my >> whole python snippet! Any examples of good color sets in listings to >> use would be *greatly* appreciated! Or a solution to that minted + >> beamer problem! Either one! >> >> Super, ultra thanks in advance, >> - cwebb >> >> -- >> 𝓒𝓱𝓻𝓲𝓼𝓽𝓸𝓹𝓱𝓮𝓻 𝓐𝓵𝓵𝓪𝓷 𝓦𝓮𝓫𝓫𝓮𝓻 >> >> ___ >> 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
[Orgmode] Re: Something like SETUPFILE, but in .emacs?
Yes, that's definitely what I'm looking for. If I get some time I may write a function to allow autoloading a setupfile-syntax version (just for consistency/simplicity), but given shortness of time I'll probably just track down the vars and set them in my .emacs. :-) thanks! On Sun, Feb 13, 2011 at 4:16 PM, Dan Davison wrote: > Gary Oberbrunner writes: > >> On Sun, Feb 13, 2011 at 10:53 AM, Darlan Cavalcante Moreira >> wrote: >>> You can use auto-insert for this. >> >> I guess I'm really not using org-mode in the way it was intended -- >> everyone thinks I should put these values into each one of my org-mode >> files. > > Hi Gary, > > What did you think of the suggestion I made? > > http://article.gmane.org/gmane.emacs.orgmode/37408 > > I believe it pointed you in the right direction. You need to (a) find > the variables that control the export behavior in question, and (b) set > those variables in your .emacs. My reply gave a source of many of the > relevant variables, i.e. the default value of the variable > `org-export-plist-vars'. An example of one of those variables is > > [...] > >> As an example, I *never* want to export the creator line. > > `org-export-creator-info'. > > Let us know if you have trouble finding the appropriate variable for > something, or if setting the variables isn't behaving the way you want. > > Dan > > >> But most of the comments on this list seem to say I should >> modify my .org files (at least to include #+SETUPFILE), so I guess >> I'll consider that as standard practice. >> >> Would anyone be interested if I were to create a way to specify export >> values in a global file somewhere (~/.org-site-defaults or something) >> in the same syntax as SETUPFILE (#+kwd: value) that would set up all >> the defaults for _every_ org file? > -- -- Gary ___ 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] Help with Babel and using SQL
Eric and Dan: Thanks for the feedback. Here is what happened. Regarding var substitution, when I tested it earlier I was running org-mode 7.3 and it did not work. After upgrading to 7.4 the var substitution worked fine. I was also testing it from a xp machine and connecting to a mysql in a linux. First I got a "UNC paths not supported.." then I tried mapping a drive to the linux. That failed because babel was executing CMD.EXE and not finding mysql. This was an error on my side. So I switched my emacs session to linux and it worked. As far as the example provided by Eric on how to load a org table into mysql table, I am still trying to get this to work. When I execute the code babel creates a temp file as /tmp/babel-176640QI/sql-data-1766424f but mysql is complaining with a "ERROR 13 (HY000): Can't get stat of '/tmp/babel-176640QI/sql-data-1766424f' (Errcode: 13)" This must be an issue on my distribution (I think)?? I will continue to test and post results if I succeed. On Sun, Feb 13, 2011 at 12:21 PM, Eric Schulte wrote: > yesare writes: > > > Thanks. > > > > I opened up ob-sql.el and read the code to see if I can figure it out. > > > > I think I have answered my first question. I wrote the following and hit > > C-c C-c and I got the result set back. > > > > #+srcname: sampsql > > #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass > -D dbname > > select * from tablename; > > #+end_src > > > > Hi, > > I'm happy to see that the above is now working, so you are successfully > using sql to query an external database and insert the results into an > Org-mode file as a table. > > > > > regarding my 2nd question (reading orgtables), I am thinking that one > can't > > read orgtables in the same way as you read a db table. But you can use > an > > org table to extract data snippets to pass as variables to a sql or build > a > > dynamic sql. Is my understanding correct? > > > > > > I was also experimenting on passing variables. I modified the above > example > > as shown below but I did not get any results > > > > #+srcname: sampsql > > #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass > -D dbname :var table="tablename" > > select * from $table; > > #+end_src > > > > A useful tool in these situations where you are not sure what a code > block will do is to call `org-babel-expand-src-block' C-c C-v v. This > will show you how the code block is expanded. When called on your > example above, I see the following > > select * from tablename; > > so your two previous code blocks should behave identically. > > > If rather, you were hoping to read a value from an Org-mode table you > will need to make some adjustments to your previous block, see my > modified example below. It is different in that... > 1. I broke the header arguments out into multiple lines (for readability) > 2. I don't quote the table name so the Org reads it as a reference and > not a literal string > 3. when Org-mode passes tabular data to sql, it writes the data into an > external file, and then passes the name of that file into the sql > code block, so I adjusted the body of the sql code block to reflect > this behavior. Try expanding the org-mode code block below to see > the results. > > #+tblname: example-table-for-sql > | a | b | > |---+| > | 1 | 10 | > | 2 | 11 | > | 3 | 12 | > | 4 | 13 | > | 5 | 14 | > | 6 | 15 | > > #+srcname: sampsql > #+headers: :var table=example-table-for-sql > #+headers: :cmdline -h hostname -u username -pmypass -D dbname > #+begin_src sql :engine mysql > load data infile "$table" into mytable; > #+end_src > > Hope this is helpful. Best -- Eric > ___ 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] Nice python listings colors, or solution to beamer + minted brokenness?
Hi Chris, I doubt this will fix the problem (it is more of a curiosity), but why in your =lstset= do you have the language as "\Python" instead of "Python"? Chris On Sun, Feb 13, 2011 at 7:35 PM, Christopher Allan Webber < cweb...@dustycloud.org> wrote: > Hello all, > > I currently am trying to export something vaguely like this for a > presentation in beamer: > > #+BEGIN_SRC python :exports code > class ReferenceDeskPanel(bpy.types.Panel): >bl_label = 'Reference Desk' >bl_space_type = 'VIEW_3D' >bl_region_type = 'TOOLS' > >def draw(self, context): >layout = self.layout > >row = layout.row() >row.prop( >context.scene, 'refdesk_search', >text="", icon='VIEWZOOM') > >search_string = context.scene.get('refdesk_search') > #+END_SRC > > I've tried using listings with: > > #+begin_LaTeX > \definecolor{keywords}{RGB}{255,0,90} > \definecolor{comments}{RGB}{60,179,113} > > \lstset{ >language=\Python, >keywordstyle=\color{keywords}, >commentstyle=\color{comments}emph, >procnamestyle=\color{blue}\textbf, >emphstyle=\color{black}\bfseries, >} > #+end_LaTeX > > in my document but I can't figure out how to get the class name > (ReferenceDeskPanel) to be highlighted in any form. I've read through > the listings manual but I can't find any reference on how to do this. > > I also tried using minted, but I'm running into the problem discussed in > this thread: > > http://article.gmane.org/gmane.emacs.orgmode/32147/match=minted > > I'm at wit's end... I just want to figure out how to syntax highlight my > whole python snippet! Any examples of good color sets in listings to > use would be *greatly* appreciated! Or a solution to that minted + > beamer problem! Either one! > > Super, ultra thanks in advance, > - cwebb > > -- > 𝓒𝓱𝓻𝓲𝓼𝓽𝓸𝓹𝓱𝓮𝓻 𝓐𝓵𝓵𝓪𝓷 𝓦𝓮𝓫𝓫𝓮𝓻 > > ___ > 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] Re: [Feature request] org-backup
Ah! This would do I think :) Thanks! Marcelo. On Sun, Feb 13, 2011 at 6:45 PM, suvayu ali wrote: > On Sun, Feb 13, 2011 at 3:13 PM, Marcelo de Moraes Serpa > wrote: >> I already do this, but sometimes the files are spread around *many* >> directories. I.e, the model of having everything in a >> version-controlled directory is unpractical, so that's why I think it >> would be useful. > > If you are on *nix, then maybe something like this is what you are looking > for? > > mkdir -p ~/org/backup && \ > find $HOME -type f -name '*\.org' ! -path "$HOME/org/*" \ > -exec cp -t ~/org/backup/ \{\} \; > > -- > Suvayu > > Open source is the future. It sets us free. > ___ 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: [Feature request] org-backup
On Sun, Feb 13, 2011 at 3:13 PM, Marcelo de Moraes Serpa wrote: > I already do this, but sometimes the files are spread around *many* > directories. I.e, the model of having everything in a > version-controlled directory is unpractical, so that's why I think it > would be useful. If you are on *nix, then maybe something like this is what you are looking for? mkdir -p ~/org/backup && \ find $HOME -type f -name '*\.org' ! -path "$HOME/org/*" \ -exec cp -t ~/org/backup/ \{\} \; -- Suvayu Open source is the future. It sets us free. ___ 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: Something like SETUPFILE, but in .emacs?
Hi Gary, Dan Davison writes: > I believe it pointed you in the right direction. You need to (a) find > the variables that control the export behavior in question, and (b) set > those variables in your .emacs. I support this. Look for variables named org-export-* and set them appropriately in your .emacs.el or somewhere else. Then they will be available as default export values for all your file. If there is an option for which you don't have the proper org-export-* let us know. -- Bastien ___ 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] Nice python listings colors, or solution to beamer + minted brokenness?
Hello all, I currently am trying to export something vaguely like this for a presentation in beamer: #+BEGIN_SRC python :exports code class ReferenceDeskPanel(bpy.types.Panel): bl_label = 'Reference Desk' bl_space_type = 'VIEW_3D' bl_region_type = 'TOOLS' def draw(self, context): layout = self.layout row = layout.row() row.prop( context.scene, 'refdesk_search', text="", icon='VIEWZOOM') search_string = context.scene.get('refdesk_search') #+END_SRC I've tried using listings with: #+begin_LaTeX \definecolor{keywords}{RGB}{255,0,90} \definecolor{comments}{RGB}{60,179,113} \lstset{ language=\Python, keywordstyle=\color{keywords}, commentstyle=\color{comments}emph, procnamestyle=\color{blue}\textbf, emphstyle=\color{black}\bfseries, } #+end_LaTeX in my document but I can't figure out how to get the class name (ReferenceDeskPanel) to be highlighted in any form. I've read through the listings manual but I can't find any reference on how to do this. I also tried using minted, but I'm running into the problem discussed in this thread: http://article.gmane.org/gmane.emacs.orgmode/32147/match=minted I'm at wit's end... I just want to figure out how to syntax highlight my whole python snippet! Any examples of good color sets in listings to use would be *greatly* appreciated! Or a solution to that minted + beamer problem! Either one! Super, ultra thanks in advance, - cwebb -- 𝓒𝓱𝓻𝓲𝓼𝓽𝓸𝓹𝓱𝓮𝓻 𝓐𝓵𝓵𝓪𝓷 𝓦𝓮𝓫𝓫𝓮𝓻 ___ 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] German date in LaTeX export [7.3]
Hi Michael, phaebz writes: > The usepackage line for babel is necessary, because Language: de is not > recognized. With the above, I correctly get e.g. "Inhaltsverzeichnis" > instead of "Contents". But the timestamp in the title remains the english > one, namely "13 February 2011". How did you set "the timestamp in the title"? Through #+TITLE? Through #+DATE: ? There is something I miss here. Thanks, -- Bastien ___ 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] Insert ampersand in HTML export?
Uriel Avalos writes: > So this new variable is in the bleeding edge version of org-mode? Yes it is. > Will download and test. Thanks Thanks, -- Bastien ___ 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: [Feature request] org-backup
Marcelo de Moraes Serpa writes: > Anyway, doesn't seem it's something hard to do, so I might as well > just try getting something implemented, could be a good exercise in > elisp. :) Let us know how it goes. PS: I'm with Dan on this. For backing up directories, I use git repo. For backing up larger projects... well, I back up my whole $HOME. -- Bastien ___ 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: [Feature request] org-backup
Anyway, doesn't seem it's something hard to do, so I might as well just try getting something implemented, could be a good exercise in elisp. On Sun, Feb 13, 2011 at 5:13 PM, Marcelo de Moraes Serpa wrote: > Hi Dan! > > I already do this, but sometimes the files are spread around *many* > directories. I.e, the model of having everything in a > version-controlled directory is unpractical, so that's why I think it > would be useful. > > Marcelo. > > On Sun, Feb 13, 2011 at 3:49 PM, Dan Davison wrote: >> Marcelo de Moraes Serpa writes: >> >>> Hi list, >>> >>> Although I try to keep all my org files inside a ~/org directory, I >>> often find myself creating org files outside of this directory >>> context, for example, as a bucket for a new project I'm working on, to >>> keep notes, todos, etc. >>> >>> It'd be nice if we had a org-backup function that would fetch all >>> files from the agenda + linked files and create a compressed backup of >>> them. What do you think? >> >> Hi Marcelo, >> >> I think backing up text files is a job for other tools; not emacs. I'd >> recommend using a version control tool such as git for this. >> >> Dan >> >>> >>> Cheers, >>> >>> Marcelo. >>> >>> ___ >>> 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
[Orgmode] Re: [Feature request] org-backup
Hi Dan! I already do this, but sometimes the files are spread around *many* directories. I.e, the model of having everything in a version-controlled directory is unpractical, so that's why I think it would be useful. Marcelo. On Sun, Feb 13, 2011 at 3:49 PM, Dan Davison wrote: > Marcelo de Moraes Serpa writes: > >> Hi list, >> >> Although I try to keep all my org files inside a ~/org directory, I >> often find myself creating org files outside of this directory >> context, for example, as a bucket for a new project I'm working on, to >> keep notes, todos, etc. >> >> It'd be nice if we had a org-backup function that would fetch all >> files from the agenda + linked files and create a compressed backup of >> them. What do you think? > > Hi Marcelo, > > I think backing up text files is a job for other tools; not emacs. I'd > recommend using a version control tool such as git for this. > > Dan > >> >> Cheers, >> >> Marcelo. >> >> ___ >> 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
[Orgmode] Re: Help with Babel and using SQL
yesare writes: > Thanks. > > I opened up ob-sql.el and read the code to see if I can figure it out. > > I think I have answered my first question. I wrote the following and hit > C-c C-c and I got the result set back. > > #+srcname: sampsql > #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D > dbname > select * from tablename; > #+end_src > > regarding my 2nd question (reading orgtables), I am thinking that one can't > read orgtables in the same way as you read a db table. But you can use an > org table to extract data snippets to pass as variables to a sql or build a > dynamic sql. Is my understanding correct? I'm not sure yet. Could you give a concrete example of something that you think is not possible? Then it shouldn't be too hard for us to say whether it is or isn't possible. > I was also experimenting on passing variables. I modified the above example > as shown below but I did not get any results I'm not the best person to help here (Eric Schulte and Seb Vauban would know more about using babel with sql) but your example does seem to work to me. If I put point on the block and issue C-c C-v C-v (org-babel-expand-src-block), then I see select * from tablename; but if I get rid of the :var then I see select * from $table; demonstrating that the :var substitution has been performed What do you get when you expand the block? Dan > > #+srcname: sampsql > #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D > dbname :var table="tablename" > select * from $table; > #+end_src > > > > > > > > On Sun, Feb 13, 2011 at 3:08 AM, Bastien wrote: > >> Hi Yesare, >> >> I'm not familiar enough with Babel to give you useful guidance, >> but others on the list may help you. >> >> yesare writes: >> >> > I am trying to do two things. >> > >> > >> > 1. Query a mysql or oracle table and post results in orgtable format >> > 2. Select data from an existing orgtable in current buffer and do >> > further processing with them (example: insert them into Oracle). >> > >> > I am sorry if this is vague but I am just looking for some initial >> > guidance on how to get around. >> >> Can you post the code your tried? What you expected? What happened >> instead? This will help people to know where and why you're stuck. >> >> Thanks! >> >> -- >> Bastien >> > ___ > 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
[Orgmode] Re: [Feature request] org-backup
Marcelo de Moraes Serpa writes: > Hi list, > > Although I try to keep all my org files inside a ~/org directory, I > often find myself creating org files outside of this directory > context, for example, as a bucket for a new project I'm working on, to > keep notes, todos, etc. > > It'd be nice if we had a org-backup function that would fetch all > files from the agenda + linked files and create a compressed backup of > them. What do you think? Hi Marcelo, I think backing up text files is a job for other tools; not emacs. I'd recommend using a version control tool such as git for this. Dan > > Cheers, > > Marcelo. > > ___ > 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] org-stow (Proof of concept)
> > I'm roughly parsing 37% of this :) I will try to use less jargon. > Again, can you demonstrate a clear and simple use-case, assuming people > like me don't know anything about stow, stew, straw or whatsover? OK, here's a use-case. This is actually what I did right now while recording a note that tells me to document a use-case. * First I make a note with org-remember (C-c r) * C-u C-c C-c to save it and go to it * M-x org-stow-make-item-stowable * It prompts me for a parent item. I choose \home\tehom\projects\elisp\org-mode\doc\local\org-stow.org/org-stow/Progress/ With TAB, that's just a few keystrokes * M-x org-stow-item * Now there is a dblock from under "Progress" in org-stow.org that corresponds to this note, but that dblock is still empty. * Update dblocks * C-u C-c C-x C-u * You don't have to do this immediately; it will work at any time * Now it appears in two places: In notes and under the heading "Progress". * Can do other work on that item * In fact, I set it to "TODO" * Update dblocks again. * Now the "stowed" copy says "TODO" too * When I finish the writeup, I will come back here and set "DONE" and update. Another use-case: * At this point I added this write-up as another note. So now everything I'm doing to answer you is in notes. * M-x org-stow-make-item-stowable * This time I store it in \home\tehom\projects\elisp\org-mode\doc\local\org-stow.org/org-stow/Docs/ * M-x org-stow-item, update dblocks * Now the doc section of this file contains this item * Finish writing it (a moment from now) and update. So I've added to a document while just dealing with notes, and crucially, I can retract individual notes that become obsolete. Take care, Tom Breton (Tehom) ___ 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: [BABEL] "unset" :var definitions for subtree
"Eric Schulte" writes: > [...] >>> Maybe we could extend the :var header argument to support the following >>> syntax... >>> >>> #+begin_src emacs-lisp :var A=1 B=3 >>> ;; code >>> #+end_src >>> >>> or >>> >>> ** two vars in a properties block >>>:PROPERTIES: >>>:var: test1=7 test2=8 >>>:END: >>> >>> That shouldn't be overly difficult, and should solve our requirements. >> >> Yes, that looks good. >> >> In the following Org file >> >> --- >> #+property: :var a=1 b=2 >> >> * h1 >> :PROPERTIES: >> :var: c=3 >> :END: >> ** h11 >>:PROPERTIES: >>:var: d=4 e=5 b=7 >>:END: >> >> #+begin_src sh :var f=6 >> # code here >> #+end_src >> --- >> >> if we follow programming languages by analogy then the behavior we >> should aim for is for variables a,b,c,d,e to all be set in the src >> block, with b having the value 7. >> >> I've made a start on a patch to do that -- it involves treating :var >> differently from other header args. Whereas normal property inheritance >> searches up the tree until the specified property is encountered, my >> patch searches up the tree to the root, collecting all the :var >> assignments encountered. >> > > Maybe we should do this sort of exhaustive search for *all* header > argument types. Are there any header arguments aside from :var which > could possibly want to take multiple values collected at different > levels of inheritance? I suppose :results may also take multiple values > which could reasonably be collected across multiple levels of hierarchy. > >> >> So perhaps we should go for a solution involving both the new ":var a=1 >> b=2" syntax (to allow multiple :var in the same block), and the >> pluralistic inheritance described above (to allow :var to be collected >> from all levels in the hierarchy). >> > > That sounds good to me. Is this code up in a repository somewhere, or > should be send patches back and forth? This is in branch ob-inherit at https://github.com/dandavison/org-devel. I've given you write access to the repo. The branch isn't ready to go yet, just a first pass. Currently, with this file - #+property: var a=1 #+property: var b=2 * h1 :PROPERTIES: :var: c=3 :END: ** h11 :PROPERTIES: :var: b=4 :END: #+begin_src sh :var d=5 # code here #+end_src - C-c C-v C-v in the src block gives - c=3 a=1 b=2 d=5 # code here - (so b has the wrong value, but there will be more issues than just that) Dan > > Best -- Eric > >> >> Dan >> >> >> >>> >>> Sound good? -- Eric >>> >>> ___ >>> 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 ___ 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] [Feature request] org-backup
Hi list, Although I try to keep all my org files inside a ~/org directory, I often find myself creating org files outside of this directory context, for example, as a bucket for a new project I'm working on, to keep notes, todos, etc. It'd be nice if we had a org-backup function that would fetch all files from the agenda + linked files and create a compressed backup of them. What do you think? Cheers, Marcelo. ___ 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] Feature request: Select links by description [7.4]
On Fri, Feb 11, 2011 at 7:05 AM, Bastien wrote: > Hi Dave, > > Dave Abrahams writes: > >> When using org-insert-link, it would be far better for me to have it >> show me the _descriptions_ of links (the default link text), rather >> than showing me the links themselves. This is especially true of >> email links, which are generally long and unintelligible by >> themselves. >> >> I have something set up that stores a link to every email I send, so I >> can easily link to follow-ups in my active Org items. As a result, I >> end up with *lots* of stored links, which makes this a real struggle. > > `org-insert-link' *does* already displays the description of the links > like this: > > http://orgmode.org (Org Mode website) > http://orgmode.org/worg/ (Worg website) > > The description is within the parenthese. > > I think it's good to have both the link *and* the description. > > What would be a better way of presenting the description? Since you asked: put the descriptions first. The links I store are fairly complicated: they bring up a virtual folder containing all the messages in the thread of the message I just sent, with the message itself selected. I'm sure the descriptions don't show up at all because they get pushed off the right edge of the window. -- Dave Abrahams BoostPro Computing http://www.boostpro.com ___ 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: Something like SETUPFILE, but in .emacs?
Gary Oberbrunner writes: > On Sun, Feb 13, 2011 at 10:53 AM, Darlan Cavalcante Moreira > wrote: >> You can use auto-insert for this. > > I guess I'm really not using org-mode in the way it was intended -- > everyone thinks I should put these values into each one of my org-mode > files. Hi Gary, What did you think of the suggestion I made? http://article.gmane.org/gmane.emacs.orgmode/37408 I believe it pointed you in the right direction. You need to (a) find the variables that control the export behavior in question, and (b) set those variables in your .emacs. My reply gave a source of many of the relevant variables, i.e. the default value of the variable `org-export-plist-vars'. An example of one of those variables is [...] > As an example, I *never* want to export the creator line. `org-export-creator-info'. Let us know if you have trouble finding the appropriate variable for something, or if setting the variables isn't behaving the way you want. Dan > But most of the comments on this list seem to say I should > modify my .org files (at least to include #+SETUPFILE), so I guess > I'll consider that as standard practice. > > Would anyone be interested if I were to create a way to specify export > values in a global file somewhere (~/.org-site-defaults or something) > in the same syntax as SETUPFILE (#+kwd: value) that would set up all > the defaults for _every_ org file? ___ 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] Something like SETUPFILE, but in .emacs?
Aloha Gary, I would be interested in a way to set export defaults globally for my .org files. All the best, Tom On Feb 13, 2011, at 8:57 AM, Gary Oberbrunner wrote: On Sun, Feb 13, 2011 at 10:53 AM, Darlan Cavalcante Moreira wrote: You can use auto-insert for this. I guess I'm really not using org-mode in the way it was intended -- everyone thinks I should put these values into each one of my org-mode files. Maybe it's because I want to use it more like a word processor that can product odt, pdf, and html than an organizer, so I have dozens or hundreds of these? I really just want to set all the _defaults_ for those different export types somewhere globally, so both my large pile of existing org files as well as new ones all get a consistent look when exported. And if I change my "style" I'd like all my exports to adjust automatically. As an example, I *never* want to export the creator line. But most of the comments on this list seem to say I should modify my .org files (at least to include #+SETUPFILE), so I guess I'll consider that as standard practice. Would anyone be interested if I were to create a way to specify export values in a global file somewhere (~/.org-site-defaults or something) in the same syntax as SETUPFILE (#+kwd: value) that would set up all the defaults for _every_ org file? -- -- Gary ___ 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
[Orgmode] [Babel] Interpreting results as tables and (eval)'uation of them
I've encountered some weird, possible buggy, behavior when interpreting results as tables (tested with python, scheme and lisp). * Item 1: Interpreting result as table With ":results value" the result is interpreted as a table if possible, but with ":results output" it isn't. This happens with python, lisp and scheme, but not with c. The documentation suggests both value and output results should be interpreted as a table if possible. "By default, results are inserted as either a table or scalar depending on their value." [http://orgmode.org/manual/results.html] #+begin_src python :results output print "'(1 2)" #+end_src #+results: : '(1 2) #+begin_src python :results value return "'(1 2)" #+end_src #+results: | 1 | 2 | * Item 2: Evaluating list results When a result is interpreted as a list, the list is (eval)'ed. This happens in non-lisp languages (c, python) but not in lisp languages (lisp, scheme). In my opinion the lists should not be evaluated, but 'org-babel-script-escape' and 'org-babel-read' suggests it is intended behavior. Is this a bug or a feature? #+begin_src c++ :includes printf("(1 2)"); #+end_src Returns the error "Invalid function: 1". The correct approach is: #+begin_src c++ :includes printf("(list 1 2)"); #+end_src #+results: | 1 | 2 | With lisp the list is not evaluated (note that "'(1 2)" results in "(1 2)"). #+begin_src lisp '(1 2) #+end_src #+results: | 1 | 2 | * Item 3: Checking if result is a list is not safe Mismatched parenthesis and bad characters causes errors. I suggest showing the raw result if the result is not a valid list. I'm not sure if this is a bug or not. These error messages could be helpful in debugging code when trying to output a list that needs to be evaluated. Although the final output of the (invalid) list could also be helpful with debugging. #+begin_src c++ :includes printf("("); #+end_src Returns the error: End of file during parsing #+begin_src python return "(list #)" #+end_src Returns the error: Invalid read syntax: "#" Here are some possible solutions: #+begin_src emacs-lisp (defun org-babel-safe-read-dont-eval (str) "Converts string into a list. Elements are converted into strings to prevent read errors from special characters." (let ((str (replace-regexp-in-string "\\([^() \f\t\n\r\v]+\\)" "\"\\1\""str))) (condition-case nil (read str) (error (concat "\"" str "\"") (org-babel-safe-read-dont-eval "(1 1#123 1)") #+end_src #+results: | 1 | 1#123 | 1 | #+begin_src emacs-lisp (defun org-babel-safe-read-do-eval (str) "Converts string into a evaluated list." (condition-case nil (eval (read str)) (error (concat "\"" str "\"" (org-babel-safe-read-do-eval "(1 1#123 1)") #+end_src #+results: : "(1 1#123 1)" ___ 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] Something like SETUPFILE, but in .emacs?
On Sun, Feb 13, 2011 at 10:53 AM, Darlan Cavalcante Moreira wrote: > You can use auto-insert for this. I guess I'm really not using org-mode in the way it was intended -- everyone thinks I should put these values into each one of my org-mode files. Maybe it's because I want to use it more like a word processor that can product odt, pdf, and html than an organizer, so I have dozens or hundreds of these? I really just want to set all the _defaults_ for those different export types somewhere globally, so both my large pile of existing org files as well as new ones all get a consistent look when exported. And if I change my "style" I'd like all my exports to adjust automatically. As an example, I *never* want to export the creator line. But most of the comments on this list seem to say I should modify my .org files (at least to include #+SETUPFILE), so I guess I'll consider that as standard practice. Would anyone be interested if I were to create a way to specify export values in a global file somewhere (~/.org-site-defaults or something) in the same syntax as SETUPFILE (#+kwd: value) that would set up all the defaults for _every_ org file? -- -- Gary ___ 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] Insert ampersand in HTML export?
On Sun, 13 Feb 2011 10:10:13 +0100 Bastien wrote: > Hi Uriel, > > Uriel Avalos writes: > > > What about some type of escape character like \&? That way \& is > > exported as & instead of & or \$. Would that work? > > Handling escape characters is quite tricky, I'd better not go that way. > > > org-export-html-protect-char-alist may work in my case---the MATHML > > macros are in a seperate #+SETUPFILE. As long as this variable doesn't > > "bubble up" i.e., apply to the file that calls #+SETUPFILE, then it > > will work. > > Please tell me if it works. > > Thanks! > > -- > Bastien > > ___ > 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 So this new variable is in the bleeding edge version of org-mode? Will download and test. Thanks ___ 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: [BABEL] "unset" :var definitions for subtree
Dan Davison writes: > "Eric Schulte" writes: > >> [...] >>> >>> I agree, the things I was talking about don't end up being simpler in >>> terms of usage for this case. My thinking was that variable unsetting >>> might be something that would be required fairly rarely, and so it might >>> be worth appropriate to support it as part of a more general/powerful >>> mechanism tied into Org properties, or even that hook. >>> >> >> It does sound like if there were a way to disable inheritance for >> certain properties for certain sub-trees of a document, then that would >> be ideal -- although I can't imagine how such functionality would be >> implemented. Can we think of an Org-wide syntax for disinheriting >> specific properties? > > I'm not sure whether or how this fits it, but it's worth noting that Org > currently documents the following > > , > | org-entry-get-with-inheritance is a Lisp function in `org.el'. > | > | (org-entry-get-with-inheritance PROPERTY &optional LITERAL-NIL) > | > | Get entry property, and search higher levels if not present. > | The search will stop at the first ancestor which has the property defined. > | If the value found is "nil", return nil to show that the property > | should be considered as undefined (this is the meaning of nil here). > | However, if LITERAL-NIL is set, return the string value "nil" instead. > ` > > so that seems to suggest ":var nil" as a way of knocking out all :var > assignments, but doesn't immediately suggest how to knock out on a > per-variable basis. :var a=nil ? (Which otherwise would look for a src > block named "nil") > But then (I believe) once we implement the multiple inheritance mentioned in your other thread this would no longer work. > >>> Before we proceed with the variable unsetting, could someone provide a >>> motivating example, just to convince ourselves that the extra features >>> are justified? (The conclusion of another message was that the torque >>> script example was more a motivating example for shebang/preamble >>> processing than for variable unsetting.) >>> >> >> Certainly. >> >> 1. taking Rainer's first example, lets say that you want a variable >>specified for all but one code block in a file (maybe that one code >>block is the source of the value of the variable). In this case it >>would be much simpler to specify the variable file-wide, and then >>unset the variable for that one code block. > > Agreed. It's not clean, but currently in this situation one could just > set the offending variable to some other value. > >> 2. say you want the same session for /nearly/ every code block in a >>file. >> 3. same for :dir, :file, or :shebang... > > I'd just note that some of these already have natural values that can be > used to "unset" > > :session none > :dir . > :shebang "" > > :file > So the question seems to be, do we pick some /magic/ values for :var and :file, similar to "none" for sessions, or do we unify this unsetting behavior into a single magic value that can be used to unset any header argument. The later seems cleaner to me. Best -- Eric ___ 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: [BABEL] "unset" :var definitions for subtree
[...] >> Maybe we could extend the :var header argument to support the following >> syntax... >> >> #+begin_src emacs-lisp :var A=1 B=3 >> ;; code >> #+end_src >> >> or >> >> ** two vars in a properties block >>:PROPERTIES: >>:var: test1=7 test2=8 >>:END: >> >> That shouldn't be overly difficult, and should solve our requirements. > > Yes, that looks good. > > In the following Org file > > --- > #+property: :var a=1 b=2 > > * h1 > :PROPERTIES: > :var: c=3 > :END: > ** h11 >:PROPERTIES: >:var: d=4 e=5 b=7 >:END: > > #+begin_src sh :var f=6 > # code here > #+end_src > --- > > if we follow programming languages by analogy then the behavior we > should aim for is for variables a,b,c,d,e to all be set in the src > block, with b having the value 7. > > I've made a start on a patch to do that -- it involves treating :var > differently from other header args. Whereas normal property inheritance > searches up the tree until the specified property is encountered, my > patch searches up the tree to the root, collecting all the :var > assignments encountered. > Maybe we should do this sort of exhaustive search for *all* header argument types. Are there any header arguments aside from :var which could possibly want to take multiple values collected at different levels of inheritance? I suppose :results may also take multiple values which could reasonably be collected across multiple levels of hierarchy. > > So perhaps we should go for a solution involving both the new ":var a=1 > b=2" syntax (to allow multiple :var in the same block), and the > pluralistic inheritance described above (to allow :var to be collected > from all levels in the hierarchy). > That sounds good to me. Is this code up in a repository somewhere, or should be send patches back and forth? Best -- Eric > > Dan > > > >> >> Sound good? -- Eric >> >> ___ >> 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] Help with Babel and using SQL
yesare writes: > Thanks. > > I opened up ob-sql.el and read the code to see if I can figure it out. > > I think I have answered my first question. I wrote the following and hit > C-c C-c and I got the result set back. > > #+srcname: sampsql > #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D > dbname > select * from tablename; > #+end_src > Hi, I'm happy to see that the above is now working, so you are successfully using sql to query an external database and insert the results into an Org-mode file as a table. > > regarding my 2nd question (reading orgtables), I am thinking that one can't > read orgtables in the same way as you read a db table. But you can use an > org table to extract data snippets to pass as variables to a sql or build a > dynamic sql. Is my understanding correct? > > > I was also experimenting on passing variables. I modified the above example > as shown below but I did not get any results > > #+srcname: sampsql > #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D > dbname :var table="tablename" > select * from $table; > #+end_src > A useful tool in these situations where you are not sure what a code block will do is to call `org-babel-expand-src-block' C-c C-v v. This will show you how the code block is expanded. When called on your example above, I see the following select * from tablename; so your two previous code blocks should behave identically. If rather, you were hoping to read a value from an Org-mode table you will need to make some adjustments to your previous block, see my modified example below. It is different in that... 1. I broke the header arguments out into multiple lines (for readability) 2. I don't quote the table name so the Org reads it as a reference and not a literal string 3. when Org-mode passes tabular data to sql, it writes the data into an external file, and then passes the name of that file into the sql code block, so I adjusted the body of the sql code block to reflect this behavior. Try expanding the org-mode code block below to see the results. #+tblname: example-table-for-sql | a | b | |---+| | 1 | 10 | | 2 | 11 | | 3 | 12 | | 4 | 13 | | 5 | 14 | | 6 | 15 | #+srcname: sampsql #+headers: :var table=example-table-for-sql #+headers: :cmdline -h hostname -u username -pmypass -D dbname #+begin_src sql :engine mysql load data infile "$table" into mytable; #+end_src Hope this is helpful. Best -- Eric ___ 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] German date in LaTeX export [7.3]
I have these org-options set for export: #+LANGUAGE: de #+LATEX_HEADER: \usepackage[ngerman]{babel} The usepackage line for babel is necessary, because Language: de is not recognized. With the above, I correctly get e.g. "Inhaltsverzeichnis" instead of "Contents". But the timestamp in the title remains the english one, namely "13 February 2011". How do I change this? I did not find any option for this in the manual... Thanks in advance Michael Bach ___ 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] Something like SETUPFILE, but in .emacs?
You can use auto-insert for this. Put something like this in your .emacs file --8<---cut here---start->8--- (require 'autoinsert) (auto-insert-mode t) ;;; Adds hook to find-files-hook ;;; Set directory containing the auto-insert templates (Trailing slash is ;;; important) Change this directory to whatever you want (setq auto-insert-directory "~/Dropbox/Dotfiles/.emacs.d/auto-insert-templates/") (setq auto-insert-query nil) ;;; nil If you don't want to be prompted ;;; before insertion ;;; Define an auto-insert template for org files (define-auto-insert "\.org" "my-orgfile-template.org") --8<---cut here---end--->8--- Now create the file "my-orgfile-template.org" inside the auto-insert-directory with what you want and whenever you create a new org file the content in my-orgfile-template.org will be inserted. I like to have a heading with the configuration and leave only title, author and email at the beggining of the file. The template I use is --8<---cut here---start->8--- #+TITLE:Put The Title Here #+AUTHOR:Authors Name #+EMAIL:something@somethingElse * Some Header * Org-File Setup #+STARTUP: odd #+OPTIONS: toc:nil #+OPTIONS: ^:{} #+LINK: google http://www.google.com/search?q=%s #+LINK: nautilus elisp:(browse-dir "%s") #+LINK: sftp elisp:(browse-dir-sftp "%s") #+LINK: tomboy elisp:(tomboy-simple-open-note "%s") #+LINK: calibre file:~/Calibre Library/%s #+LINK: mendeley file:~/Mendeley_Desktop/%s #+STARTUP: logdone #+STARTUP: logreschedule #+STARTUP: logredeadline #+DRAWERS: PROPERTIES CLOCK LOGBOOK HIDDEN #+COLUMNS: %41ITEM(Task) %TODO %5Effort %5CLOCKSUM --8<---cut here---end--->8--- -- Darlan At Thu, 10 Feb 2011 16:40:44 -0500, Gary Oberbrunner wrote: > > [1 ] > [1.1 ] > First time poster on this list, but old-school Emacs user since 1982. And I > have to say, org-mode is amazing. I'm running current git master on emacs > 24.0.50.1 on Windows. > > I've put all my org-mode export template stuff into a setup file in my home > dir, and I make all my org-mode files use it by putting > #+SETUPFILE: ~/my-setup.org > > My question is can I make this totally automatic, so every .org file I load > gets that setupfile automatically? > > btw, here's my settings in my setup file in case anyone's interested. > Mostly export stuff for HTML and LaTeX so the output comes out nice. > > ## Emacs org-mode settings. Include into a .org file at the end like this: > ## #+SETUPFILE: ~/emacs-org-mode-setup.org > #+AUTHOR:me > #+EMAIL: ga...@example.org > #+DATE: > #+DESCRIPTION: > #+KEYWORDS: > #+LANGUAGE: en > #+OPTIONS: H:2 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t > author:nil email:nil creator:nil timestamp:nil > #+OPTIONS: TeX:t LaTeX:auto skip:nil d:nil todo:t pri:nil tags:not-in-toc > #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path: > http://orgmode.org/org-info.js > #+EXPORT_SELECT_TAGS: export > #+EXPORT_EXCLUDE_TAGS: noexport > #+LINK_UP: > #+LINK_HOME: > # Page formatting, use full page w/ less whitespace: > #+LaTeX_HEADER: \usepackage[cm]{fullpage} > #+LaTeX_HEADER: \usepackage[compact]{titlesec} > # Snug up lists: > #+LaTeX_HEADER: \usepackage{paralist} > #+LaTeX_HEADER: \let\itemize\compactitem > #+LaTeX_HEADER: \let\description\compactdesc > #+LaTeX_HEADER: \let\enumerate\compactenum > # Colors: > #+LaTeX_HEADER: \usepackage{color} > > > -- > -- Gary > [1.2 ] > > [2 ] > ___ > 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] Help with Babel and using SQL
Thanks. I opened up ob-sql.el and read the code to see if I can figure it out. I think I have answered my first question. I wrote the following and hit C-c C-c and I got the result set back. #+srcname: sampsql #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D dbname select * from tablename; #+end_src regarding my 2nd question (reading orgtables), I am thinking that one can't read orgtables in the same way as you read a db table. But you can use an org table to extract data snippets to pass as variables to a sql or build a dynamic sql. Is my understanding correct? I was also experimenting on passing variables. I modified the above example as shown below but I did not get any results #+srcname: sampsql #+begin_src sql :engine mysql :cmdline -h hostname -u username -pmypass -D dbname :var table="tablename" select * from $table; #+end_src On Sun, Feb 13, 2011 at 3:08 AM, Bastien wrote: > Hi Yesare, > > I'm not familiar enough with Babel to give you useful guidance, > but others on the list may help you. > > yesare writes: > > > I am trying to do two things. > > > > > > 1. Query a mysql or oracle table and post results in orgtable format > > 2. Select data from an existing orgtable in current buffer and do > > further processing with them (example: insert them into Oracle). > > > > I am sorry if this is vague but I am just looking for some initial > > guidance on how to get around. > > Can you post the code your tried? What you expected? What happened > instead? This will help people to know where and why you're stuck. > > Thanks! > > -- > Bastien > ___ 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] [PATCH] Properly format start and end times in time ranges.
Hi Tassilo, Tassilo Horn writes: > No, I'm no maintainer. But I think a contributor may make state > changes to his own patches. I don't think so, but I would be glad to be wrong! If so, we need to document this on Worg/org-contribute.org. >> Test this branch: >> >> >> http://git.naquadah.org/?p=~jd/org-mode.git;a=shortlog;h=refs/heads/jd/agenda-format > > I'll have a look at it! Great, thanks. The branch really deserves some testing and debugging... All best, -- Bastien ___ 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] Improve percent escaping links in Org mode (pull request / OK to push)
Hi David, David Maus writes: > Rebased to current head and here we go. Wow, great work -- thanks for the perfect changelogs! I've been through the patches, everythings looks good, feel free to push (and to mark patches as "accepted" in patchwork.) You mentioned some possible backward compatibility issues with a few existing links before in this thead, any update on this? Thanks a lot to you, Sebastian -- and Vincent B. for bringing up this issue! -- Bastien ___ 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] Help with translating the new variable `org-clock-clocktable-language-setup'
Dear all, I've pushed a fix which introduces a new custom variable `org-clock-clocktable-language-setup' - current value is: (("en" "File" "L" "Timestamp" "Headline" "Time" "ALL" "Total time" "File time") ("fr" "Fichier" "N" "Horodatage" "Tâche" "Durée" "TOUT" "Durée totale" "Durée fichier")) Now you can use :lang "fr" in clocktables to format your clocktable in french. Could people from various countries help with the translations of these strings? The format of each list in this alist is this: "en" : the two-characters language code "File" : For the _file_ column "L" : For the _level_ of the heading "Timestamp" : For the timestamp "Headline" : For the headline "Time" : For the time spent on the task "ALL" : Well, for "all". "Total time" : For the total time of the clocktable "File time" : For the time spent on a task in a file Thanks a lot in advance! -- Bastien ___ 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] headlines in HTML
At Sun, 30 Jan 2011 13:07:56 -0700, Samuel Wales wrote: > > David, > > Very interesting, thank you. > > Is it possible to style Blogger's post titles this way (i.e. in a > permanent way) too? Dunno much about Blogger but why not? If you can define a custom CSS than you can change the look/layout of all elements in your post. Just check which element is used for titles[1] and modify the CSS accordingly. Best, -- David [1] The Firefox extensions Firebug [http://getfirebug.com/] might come in handy. -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpxkxkadY8sM.pgp Description: PGP signature ___ 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] exporting atom/rss feeds; org-feed-alist not downloading anything from www.rememberthemilk.com
At Sun, 30 Jan 2011 18:37:29 -0600, David LeBauer wrote: > > I can also get the feed as either atom or rss, but it still gives the > same error; I have attached the rss below: > > > wk-Testhttp://www.rememberthemilk.com/home/dlebauer/4685768/rememberthemilk.comtest > task > twohttp://www.rememberthemilk.com/home/dlebauer/4685768/155949335tag:rememberthemilk.com,1999:tasks-dlebauer-4685768.task-155949335DavidDavid2011-01-29T20:35:42Ztest > task > 1http://www.rememberthemilk.com/home/dlebauer/4685768/155949330tag:rememberthemilk.com,1999:tasks-dlebauer-4685768.task-155949330DavidDavid2011-01-29T20:34:55Z These feeds seem not to be public or don't exist: If I try to fetch them I get a "Sorry, this user has no published lists." for the first one, and the second and third end up with an 404 (page does not exist). Could I ask you to fetch, say, the RSS feed and send it as regular message attachment? Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpSkIYQ29LZL.pgp Description: PGP signature ___ 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] Unintended behavior? Links without description
Hi, I've sent a patch separately. Please take a hard look at it, since org-bbdb.el is a suggested model for people to look at when devising custom link types. Yours, Christian On 2/12/11 11:11 PM, Bastien wrote: Hi Christian, Christian Moe writes: I think I've tracked down the problem, but I don't necessarily understand what org-export-normalize-links is supposed to do or what other behaviors depend on this, so I'm not going to submit a patch. If this is now the intended behavior, it will be no problem to rewrite the custom link export definitions to take account of it. Here again*, I think org-export-normalize-links: various backends will decide what to do about having identical [path] and [desc]. I'd welcome a patch making org-bbdb.el a bit more clever about this. Thanks! * see my recent email about org-footnote-normalize ___ 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
[PATCH] Re: [Orgmode] Unintended behavior? Links without description
bbdb: Export links with normalized desc part * org-bbdb.el (org-bbdb-export): When a link description has been added by org-export-normalize-links, use path instead (remove the `bbdb:' prefix). The existing code handled the case where desc is nil. However, this no longer occurs, since org-export-normalize-links now automatically adds a desc to links, with a `bbdb:' prefix that would not usually be wanted in exported text. The patch results in the same output as originally intended. TINYCHANGE diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index c04b7ff..1d3252c 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -208,10 +208,12 @@ date year)." "Create the export version of a BBDB link specified by PATH or DESC. If exporting to either HTML or LaTeX FORMAT the link will be italicized, in all other cases it is left unchanged." + (when (string= desc (format "bbdb:%s" path)) +(setq desc path)) (cond - ((eq format 'html) (format "%s" (or desc path))) - ((eq format 'latex) (format "\\textit{%s}" (or desc path))) - (t (or desc path + ((eq format 'html) (format "%s" desc)) + ((eq format 'latex) (format "\\textit{%s}" desc)) + (t desc))) (defun org-bbdb-open (name) "Follow a BBDB link to NAME." diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index c04b7ff..1d3252c 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -208,10 +208,12 @@ date year)." "Create the export version of a BBDB link specified by PATH or DESC. If exporting to either HTML or LaTeX FORMAT the link will be italicized, in all other cases it is left unchanged." + (when (string= desc (format "bbdb:%s" path)) +(setq desc path)) (cond - ((eq format 'html) (format "%s" (or desc path))) - ((eq format 'latex) (format "\\textit{%s}" (or desc path))) - (t (or desc path + ((eq format 'html) (format "%s" desc)) + ((eq format 'latex) (format "\\textit{%s}" desc)) + (t desc))) (defun org-bbdb-open (name) "Follow a BBDB link to NAME." ___ 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: org-git-link does not support locational information within file
Bastien writes: >> 2. use git versioned files transparently, i.e. org-git-store-link >> should support search (org-ids and text files) in linked git >> revisions of files. > > I've look into this. We could code things to add a search string: > > [[git:~/my.org::master@{2011-02-07}::Org code]] Just like org-protocol and org-annotate-helper this uses an opaque URI and positional arguments, something I'm not too fond of. It's easily broken and hard to extend in a backwards-compatible manner. If all uses of URI-like syntax were stratified to a single general form within orgmode, it would become a lot easier to move data back and forth using these URI, IMHO. Since the function is searching for something after the resource has been retrieved by the application that requested it, it should probably have URI fragment syntax, see RFC 2396 (this RFC actually replaces RFC1738 that org-protocol still references). Likewise the specification of what version to retrieve from Git should probably be in query syntax since it's done by the server of the request. Last but not least, the git scheme is already in use by git for specifying remotes, so I'd suggest not clobbering that namespace from within org. The use of "@" is reserved in certain places and use of braces is labeled "unwise". Hence something like: [[org://authority/git:/~/my.org?b=master;d=2011-02-07#Org%20code]] looks to be more friendly considering that maybe these links diffuse outside of org and are tried to be interpreted by URI parsers. It opens up a way to ask org servers for their data (when the authority segment is present, if not it uses the local data as implied by the org document containing the URI) and enables a uniform way to introduce sub-handlers (git:/ in this case). Org-protocol does some of that already and should be able to be extended to include the proposal above. The arguments are also named, so they can come in any order. Just a thought. [Note: emacsclient does only strip down consecutive slashes for what it considers the path to files. It's perfectly OK to give it a lisp expression that contains a string with as many slashes as you see fit, like this one. This might be a better way to get URI arguments to emacs server, then: emacsclient -e '(org-parse-URI "org:...")'] Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Q+, Q and microQ: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds ___ 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] [PATCH 16/16] Throw error if encoding character in utf8 fails
* lisp/org.el (org-link-escape): Throw error if encoding character in utf8 fails. --- lisp/org.el |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1415eb1..0eb3a2b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8598,8 +8598,10 @@ If optional argument MERGE is set, merge TABLE into (< char 32) (= char 37) (> char 126)) (mapconcat (lambda (sequence-element) (format "%%%.2X" sequence-element)) - (encode-coding-char char 'utf-8) "") - (char-to-string char))) text ""))) + (or (encode-coding-char char 'utf-8) + (error "Unable to percent escape character: %s" +(char-to-string char))) "") +(char-to-string char))) text ""))) (defun org-link-unescape (str) "Unhex hexified unicode strings as returned from the JavaScript function -- 1.7.2.3 ___ 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] [PATCH] ASCII export: Fixed a bug.
Hi Basten, thanks. Is there a reason for keeping the 'reverse' operation? The documentation for org-export-ascii-underline states that the characters are ordered by level (1, 2, ...). Why should they be accessed in reverse order then? Best regards, Valentin On Sun, Feb 13, 2011 at 12:44 PM, Bastien wrote: > Hi Valentin, > > Valentin Wüstholz writes: > >> I have attached a small patch for a bug that I reported a while ago. >> See http://thread.gmane.org/gmane.emacs.orgmode/36097. > > Thanks for this patch. I've just applied a simplified version of it, > which takes care of the bug. > > Best, > > -- > Bastien > ___ 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] [PATCH 15/16] Use `org-link-unescape' instead of obsolete unhex string function
* lisp/org-protocol.el (org-protocol-split-data) (org-protocol-open-source): Use `org-link-unescape' instead of obsolete unhex string function. --- lisp/org-protocol.el |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 46441db..b1ad0a9 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -301,7 +301,7 @@ part." (if unhexify (if (fboundp unhexify) (mapcar unhexify split-parts) - (mapcar 'org-protocol-unhex-string split-parts)) + (mapcar 'org-link-unescape split-parts)) split-parts))) (defun org-protocol-flatten-greedy (param-list &optional strip-path replacement) @@ -476,7 +476,7 @@ The location for a browser's bookmark should look like this: ;; As we enter this function for a match on our protocol, the return value ;; defaults to nil. (let ((result nil) -(f (org-protocol-unhex-string fname))) +(f (org-link-unescape fname))) (catch 'result (dolist (prolist org-protocol-project-alist) (let* ((base-url (plist-get (cdr prolist) :base-url)) -- 1.7.2.3 ___ 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] [PATCH 11/16] Add percent sign to list of escape chars
* org.el (org-link-escape-chars-browser, org-link-escape-chars): Add percent sign to list of escape chars. --- lisp/org.el |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 602462d..370109b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8543,14 +8543,14 @@ according to FMT (default from `org-email-link-description-format')." "]")) (defconst org-link-escape-chars - '(?\ ?\[ ?\] ?\; ?\= ?\+) + '(?\ ?\[ ?\] ?\; ?\= ?\+ ?\%) "List of characters that should be escaped in link. This is the list that is used for internal purposes.") (defvar org-url-encoding-use-url-hexify nil) (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.") -- 1.7.2.3 ___ 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] [PATCH 13/16] Refactor unescaping functions
* org.el (org-link-unescape): Simpler algorithm for replacing percent escapes. (org-link-unescape-compound): Use cond statements instead of nested if, convert hex string with string-to-number, save match data. (org-link-unescape-single-byte-sequence): Use mapconcat and string-to-number for unescaping single byte sequence. --- lisp/org.el | 102 ++ 1 files changed, 39 insertions(+), 63 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index fcd421f..f35f898 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8584,77 +8584,53 @@ If optional argument MERGE is set, merge TABLE into (defun org-link-unescape (str) "Unhex hexified unicode strings as returned from the JavaScript function encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." - (setq str (or str "")) - (let ((tmp "") - (case-fold-search t)) -(while (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str) - (let* ((start (match-beginning 0)) -(end (match-end 0)) -(hex (match-string 0 str)) -(replacement (org-link-unescape-compound (upcase hex - (setq tmp (concat tmp (substring str 0 start) replacement)) - (setq str (substring str end -(setq tmp (concat tmp str)) -tmp)) + (unless (and (null str) (string= "" str)) +(let ((pos 0) (case-fold-search t) unhexed) + (while (setq pos (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str pos)) + (setq unhexed (org-link-unescape-compound (match-string 0 str))) + (setq str (replace-match unhexed t t str)) + (setq pos (+ pos (length unhexed)) + str) (defun org-link-unescape-compound (hex) "Unhexify unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. Note: this function also decodes single byte encodings like `%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." - (let* ((bytes (remove "" (split-string hex "%"))) -(ret "") -(eat 0) -(sum 0)) -(while bytes - (let* ((b (pop bytes)) -(a (elt b 0)) -(b (elt b 1)) -(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) -(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0))) -(val (+ (lsh c1 4) c2)) -(shift - (if (= 0 eat) ;; new byte - (if (>= val 252) 6 - (if (>= val 248) 5 - (if (>= val 240) 4 - (if (>= val 224) 3 - (if (>= val 192) 2 0) - 6)) -(xor - (if (= 0 eat) ;; new byte - (if (>= val 252) 252 - (if (>= val 248) 248 - (if (>= val 240) 240 - (if (>= val 224) 224 - (if (>= val 192) 192 0) - 128))) - (if (>= val 192) (setq eat shift)) - (setq val (logxor val xor)) - (setq sum (+ (lsh sum shift) val)) - (if (> eat 0) (setq eat (- eat 1))) - (cond -((= 0 eat) ;multi byte - (setq ret (concat ret (org-char-to-string sum))) - (setq sum 0)) -((not bytes) ; single byte(s) - (setq ret (org-link-unescape-single-byte-sequence hex - )) ;; end (while bytes -ret )) + (save-match-data +(let* ((bytes (cdr (split-string hex "%"))) + (ret "") + (eat 0) + (sum 0)) + (while bytes + (let* ((val (string-to-number (pop bytes) 16)) + (shift-xor + (if (= 0 eat) + (cond +((>= val 252) (cons 6 252)) +((>= val 248) (cons 5 248)) +((>= val 240) (cons 4 240)) +((>= val 224) (cons 3 224)) +((>= val 192) (cons 2 192)) +(t (cons 0 0))) + (cons 6 128 + (if (>= val 192) (setq eat (car shift-xor))) + (setq val (logxor val (cdr shift-xor))) + (setq sum (+ (lsh sum (car shift-xor)) val)) + (if (> eat 0) (setq eat (- eat 1))) + (cond + ((= 0 eat) ;multi byte + (setq ret (concat ret (org-char-to-string sum))) + (setq sum 0)) + ((not bytes) ; single byte(s) + (setq ret (org-link-unescape-single-byte-sequence hex + )) ;; end (while bytes + ret ))) (defun org-link-unescape-single-byte-sequence (hex) "Unhexify hex-encoded single byte character sequences." - (let ((bytes (remove "" (split-string hex "%"))) - (ret "")) -(while bytes - (let* ((b (pop bytes)) -(a (elt b 0)) -(b (elt b 1)) -(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) -(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0 - (setq ret - (concat ret (char-to-string - (+ (lsh c1 4) c2)) -ret)) + (mapconcat (lambda (by
[Orgmode] [PATCH 10/16] Use new percent escape character table format
* org-mobile.el (org-mobile-escape-olp): Use new percent escape character table format. --- lisp/org-mobile.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 6616876..fe0a287 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -660,7 +660,7 @@ The table of checksums is written to the file mobile-checksums." (org-mobile-escape-olp (nth 4 (org-heading-components)) (defun org-mobile-escape-olp (s) - (let ((table '((?: . "%3a") (?\[ . "%5b") (?\] . "%5d") (?/ . "%2f" + (let ((table '(?: ?/))) (org-link-escape s table))) ;;;###autoload -- 1.7.2.3 ___ 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] [PATCH 09/16] Remove obsolete argument in call to org-link-unescape
* org-mobile.el (org-mobile-locate-entry): Remove obsolete argument in call to org-link-unescape. `org-link-unescape' always unescapes all percent escaped sequences. --- lisp/org-mobile.el |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index a278fb1..6616876 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -969,11 +969,10 @@ is currently a noop.") (if (not (string-match "\\`olp:\\(.*?\\):\\(.*\\)$" link)) nil (let ((file (match-string 1 link)) - (path (match-string 2 link)) - (table '((?: . "%3a") (?\[ . "%5b") (?\] . "%5d") (?/ . "%2f" - (setq file (org-link-unescape file table)) + (path (match-string 2 link))) + (setq file (org-link-unescape file)) (setq file (expand-file-name file org-directory)) - (setq path (mapcar (lambda (x) (org-link-unescape x table)) + (setq path (mapcar 'org-link-unescape (org-split-string path "/"))) (org-find-olp (cons file path)) -- 1.7.2.3 ___ 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] [PATCH 14/16] Always percent escape the percent sign
* lisp/org.el (org-link-escape, org-link-escape-chars-browser) (org-link-escape-chars): Always percent escape the percent sign. --- lisp/org.el |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 8fcb9c4..1415eb1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8565,14 +8565,14 @@ according to FMT (default from `org-email-link-description-format')." "]")) (defconst org-link-escape-chars - '(?\ ?\[ ?\] ?\; ?\= ?\+ ?\%) + '(?\ ?\[ ?\] ?\; ?\= ?\+) "List of characters that should be escaped in link. This is the list that is used for internal purposes.") (defvar org-url-encoding-use-url-hexify nil) (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.") @@ -8595,7 +8595,7 @@ If optional argument MERGE is set, merge TABLE into (mapconcat (lambda (char) (if (or (member char table) - (< char 32) (> char 126)) + (< char 32) (= char 37) (> char 126)) (mapconcat (lambda (sequence-element) (format "%%%.2X" sequence-element)) (encode-coding-char char 'utf-8) "") -- 1.7.2.3 ___ 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] [PATCH 08/16] Declare obsolete & alias to respective org-link-unescape-* functions
* org-protocol.el (org-protocol-unhex-string) (org-protocol-unhex-compound) (org-protocol-unhex-single-byte-sequence): Declare obsolete and alias to respective org-link-unescape-* functions. --- lisp/org-protocol.el | 88 +++--- 1 files changed, 12 insertions(+), 76 deletions(-) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index eb77f02..078905a 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -130,6 +130,18 @@ (filename &optional up)) (declare-function server-edit "server" (&optional arg)) +(define-obsolete-function-alias + 'org-protocol-unhex-compound 'org-link-unescape-compound + "2010-11-21") + +(define-obsolete-function-alias + 'org-protocol-unhex-string 'org-link-unescape + "2010-11-21") + +(define-obsolete-function-alias + 'org-protocol-unhex-single-byte-sequence + 'org-link-unescape-single-byte-sequence + "2011-11-21") (defgroup org-protocol nil "Intercept calls from emacsclient to trigger custom actions. @@ -292,82 +304,6 @@ part." (mapcar 'org-protocol-unhex-string split-parts)) split-parts))) -(defun org-protocol-unhex-string(str) - "Unhex hexified unicode strings as returned from the JavaScript function -encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." - (setq str (or str "")) - (let ((tmp "") - (case-fold-search t)) -(while (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str) - (let* ((start (match-beginning 0)) -(end (match-end 0)) -(hex (match-string 0 str)) -(replacement (org-protocol-unhex-compound (upcase hex - (setq tmp (concat tmp (substring str 0 start) replacement)) - (setq str (substring str end -(setq tmp (concat tmp str)) -tmp)) - - -(defun org-protocol-unhex-compound (hex) - "Unhexify unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. -Note: this function also decodes single byte encodings like -`%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." - (let* ((bytes (remove "" (split-string hex "%"))) -(ret "") -(eat 0) -(sum 0)) -(while bytes - (let* ((b (pop bytes)) -(a (elt b 0)) -(b (elt b 1)) -(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) -(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0))) -(val (+ (lsh c1 4) c2)) -(shift - (if (= 0 eat) ;; new byte - (if (>= val 252) 6 - (if (>= val 248) 5 - (if (>= val 240) 4 - (if (>= val 224) 3 - (if (>= val 192) 2 0) - 6)) -(xor - (if (= 0 eat) ;; new byte - (if (>= val 252) 252 - (if (>= val 248) 248 - (if (>= val 240) 240 - (if (>= val 224) 224 - (if (>= val 192) 192 0) - 128))) - (if (>= val 192) (setq eat shift)) - (setq val (logxor val xor)) - (setq sum (+ (lsh sum shift) val)) - (if (> eat 0) (setq eat (- eat 1))) - (cond -((= 0 eat) ;multi byte - (setq ret (concat ret (org-char-to-string sum))) - (setq sum 0)) -((not bytes) ; single byte(s) - (setq ret (org-protocol-unhex-single-byte-sequence hex - )) ;; end (while bytes -ret )) - -(defun org-protocol-unhex-single-byte-sequence(hex) - "Unhexify hex-encoded single byte character sequences." - (let ((bytes (remove "" (split-string hex "%"))) - (ret "")) -(while bytes - (let* ((b (pop bytes)) -(a (elt b 0)) -(b (elt b 1)) -(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) -(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0 - (setq ret - (concat ret (char-to-string - (+ (lsh c1 4) c2)) -ret)) - (defun org-protocol-flatten-greedy (param-list &optional strip-path replacement) "Greedy handlers might receive a list like this from emacsclient: '( (\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\") -- 1.7.2.3 ___ 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] [PATCH 06/16] Inline function to properly decode utf8 characters in Emacs 22
* org-macs.el (org-char-to-string): Inline function to properly decode utf8 characters in Emacs 22. Moved and renamed from org-protocol.el. * org-protocol.el (org-protocol-unhex-compound): Use renamed inline function. --- lisp/org-macs.el |9 - lisp/org-protocol.el | 13 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 5a56123..4451a54 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -35,7 +35,14 @@ (eval-and-compile (unless (fboundp 'declare-function) -(defmacro declare-function (fn file &optional arglist fileonly +(defmacro declare-function (fn file &optional arglist fileonly))) + (if (>= emacs-major-version 23) + (defsubst org-char-to-string(c) + "Defsubst to decode UTF-8 character values in emacs 23 and beyond." + (char-to-string c)) +(defsubst org-char-to-string (c) + "Defsubst to decode UTF-8 character values in emacs 22." + (string (decode-char 'ucs c) (declare-function org-add-props "org-compat" (string plist &rest props)) (declare-function org-string-match-p "org-compat" (&rest args)) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 33878a8..eb77f02 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -292,17 +292,6 @@ part." (mapcar 'org-protocol-unhex-string split-parts)) split-parts))) -;; This inline function is needed in org-protocol-unhex-compound to do -;; the right thing to decode UTF-8 char integer values. -(eval-when-compile - (if (>= emacs-major-version 23) - (defsubst org-protocol-char-to-string(c) - "Defsubst to decode UTF-8 character values in emacs 23 and beyond." - (char-to-string c)) -(defsubst org-protocol-char-to-string (c) - "Defsubst to decode UTF-8 character values in emacs 22." - (string (decode-char 'ucs c) - (defun org-protocol-unhex-string(str) "Unhex hexified unicode strings as returned from the JavaScript function encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." @@ -357,7 +346,7 @@ Note: this function also decodes single byte encodings like (if (> eat 0) (setq eat (- eat 1))) (cond ((= 0 eat) ;multi byte - (setq ret (concat ret (org-protocol-char-to-string sum))) + (setq ret (concat ret (org-char-to-string sum))) (setq sum 0)) ((not bytes) ; single byte(s) (setq ret (org-protocol-unhex-single-byte-sequence hex -- 1.7.2.3 ___ 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] [PATCH 12/16] Rename lambda argument
* org.el (org-link-escape): Rename lambda argument. --- lisp/org.el |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1b5c3a8..8d49c05 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8576,8 +8576,8 @@ If optional argument MERGE is set, merge TABLE into (lambda (char) (if (or (member char table) (< char 32) (> char 126)) - (mapconcat (lambda (sequence) - (format "%%%.2X" sequence)) + (mapconcat (lambda (sequence-element) + (format "%%%.2X" sequence-element)) (encode-coding-char char 'utf-8) "") (char-to-string char))) text ""))) -- 1.7.2.3 ___ 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] [PATCH 07/16] Unescape functions moved and renamed from org-protocol.el
* org.el (org-link-unescape, org-link-unescape-compound) (org-link-unescape-single-byte-sequence): Functions moved and renamed from org-protocol.el. --- lisp/org.el | 90 -- 1 files changed, 74 insertions(+), 16 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a29d429..602462d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8579,22 +8579,80 @@ If optional argument MERGE is set, merge TABLE into (encode-coding-char char 'utf-8) "") (char-to-string char))) text ""))) -(defun org-link-unescape (text &optional table) - "Reverse the action of `org-link-escape'." - (if (and org-url-encoding-use-url-hexify (not table)) - (url-unhex-string text) -(setq table (or table org-link-escape-chars)) -(when text - (let ((case-fold-search t) - (re (mapconcat (lambda (x) (regexp-quote (downcase (cdr x - table "\\|"))) - (while (string-match re text) - (setq text - (replace-match -(char-to-string (car (rassoc (upcase (match-string 0 text)) - table))) -t t text))) - text +(defun org-link-unescape (str) + "Unhex hexified unicode strings as returned from the JavaScript function +encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." + (setq str (or str "")) + (let ((tmp "") + (case-fold-search t)) +(while (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str) + (let* ((start (match-beginning 0)) +(end (match-end 0)) +(hex (match-string 0 str)) +(replacement (org-link-unescape-compound (upcase hex + (setq tmp (concat tmp (substring str 0 start) replacement)) + (setq str (substring str end +(setq tmp (concat tmp str)) +tmp)) + +(defun org-link-unescape-compound (hex) + "Unhexify unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. +Note: this function also decodes single byte encodings like +`%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." + (let* ((bytes (remove "" (split-string hex "%"))) +(ret "") +(eat 0) +(sum 0)) +(while bytes + (let* ((b (pop bytes)) +(a (elt b 0)) +(b (elt b 1)) +(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) +(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0))) +(val (+ (lsh c1 4) c2)) +(shift + (if (= 0 eat) ;; new byte + (if (>= val 252) 6 + (if (>= val 248) 5 + (if (>= val 240) 4 + (if (>= val 224) 3 + (if (>= val 192) 2 0) + 6)) +(xor + (if (= 0 eat) ;; new byte + (if (>= val 252) 252 + (if (>= val 248) 248 + (if (>= val 240) 240 + (if (>= val 224) 224 + (if (>= val 192) 192 0) + 128))) + (if (>= val 192) (setq eat shift)) + (setq val (logxor val xor)) + (setq sum (+ (lsh sum shift) val)) + (if (> eat 0) (setq eat (- eat 1))) + (cond +((= 0 eat) ;multi byte + (setq ret (concat ret (org-char-to-string sum))) + (setq sum 0)) +((not bytes) ; single byte(s) + (setq ret (org-link-unescape-single-byte-sequence hex + )) ;; end (while bytes +ret )) + +(defun org-link-unescape-single-byte-sequence (hex) + "Unhexify hex-encoded single byte character sequences." + (let ((bytes (remove "" (split-string hex "%"))) + (ret "")) +(while bytes + (let* ((b (pop bytes)) +(a (elt b 0)) +(b (elt b 1)) +(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) +(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0 + (setq ret + (concat ret (char-to-string + (+ (lsh c1 4) c2)) +ret)) (defun org-xor (a b) "Exclusive or." -- 1.7.2.3 ___ 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] [PATCH 05/16] New optional argument: Merge user table with default table
* org.el (org-link-escape): New optional argument. Merge user table with default table. --- lisp/org.el | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index cafb673..a29d429 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8554,14 +8554,22 @@ This is the list that is used for internal purposes.") "List of escapes for characters that are problematic in links. This is the list that is used before handing over to the browser.") -(defun org-link-escape (text &optional table) +(defun org-link-escape (text &optional table merge) "Return percent escaped representation of TEXT. TEXT is a string with the text to escape. Optional argument TABLE is a list with characters that should be -escaped. When nil, `org-link-escape-chars' is used." +escaped. When nil, `org-link-escape-chars' is used. +If optional argument MERGE is set, merge TABLE into +`org-link-escape-chars'." (if (and org-url-encoding-use-url-hexify (not table)) (url-hexify-string text) -(setq table (or table org-link-escape-chars)) +(cond + ((and table merge) + (mapc (lambda (defchr) + (unless (member defchr table) + (setq table (cons defchr table org-link-escape-chars)) + ((null table) + (setq table org-link-escape-chars))) (mapconcat (lambda (char) (if (or (member char table) -- 1.7.2.3 ___ 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] [PATCH 04/16] Fixup doc string
* org.el (org-link-escape): Fixup doc string. --- lisp/org.el |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 7d38907..cafb673 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8555,7 +8555,10 @@ This is the list that is used for internal purposes.") This is the list that is used before handing over to the browser.") (defun org-link-escape (text &optional table) - "Escape characters in TEXT that are problematic for links." + "Return percent escaped representation of TEXT. +TEXT is a string with the text to escape. +Optional argument TABLE is a list with characters that should be +escaped. When nil, `org-link-escape-chars' is used." (if (and org-url-encoding-use-url-hexify (not table)) (url-hexify-string text) (setq table (or table org-link-escape-chars)) -- 1.7.2.3 ___ 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] [PATCH 03/16] New format of percent escape table
* org.el (org-link-escape-chars, org-link-escape-chars-browser): New format of percent escape table. (org-link-escape): Use new table format. Just a plain list with the chars that should be escaped. --- lisp/org.el | 27 +-- 1 files changed, 5 insertions(+), 22 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9aeeeda..7d38907 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8543,32 +8543,15 @@ according to FMT (default from `org-email-link-description-format')." "]")) (defconst org-link-escape-chars - '((?\. "%20") -(?\[ . "%5B") -(?\] . "%5D") -(?\340 . "%E0") ; `a -(?\342 . "%E2") ; ^a -(?\347 . "%E7") ; ,c -(?\350 . "%E8") ; `e -(?\351 . "%E9") ; 'e -(?\352 . "%EA") ; ^e -(?\356 . "%EE") ; ^i -(?\364 . "%F4") ; ^o -(?\371 . "%F9") ; `u -(?\373 . "%FB") ; ^u -(?\; . "%3B") -;; (??. "%3F") -(?=. "%3D") -(?+. "%2B") -) - "Association list of escapes for some characters problematic in links. + '(?\ ?\[ ?\] ?\; ?\= ?\+) + "List of characters that should be escaped in link. This is the list that is used for internal purposes.") (defvar org-url-encoding-use-url-hexify nil) (defconst org-link-escape-chars-browser - '((?\ . "%20")) ; 32 for the SPC char - "Association list of escapes for some characters problematic in links. + '(?\ ) + "List of escapes for characters that are problematic in links. This is the list that is used before handing over to the browser.") (defun org-link-escape (text &optional table) @@ -8578,7 +8561,7 @@ This is the list that is used before handing over to the browser.") (setq table (or table org-link-escape-chars)) (mapconcat (lambda (char) - (if (or (assoc char table) + (if (or (member char table) (< char 32) (> char 126)) (mapconcat (lambda (sequence) (format "%%%.2X" sequence)) -- 1.7.2.3 ___ 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] [PATCH 02/16] New unicode aware percent encoding algorithm
* org.el (org-link-escape): New unicode aware percent encoding algorithm. --- lisp/org.el | 19 --- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 0c46eec..9aeeeda 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8576,17 +8576,14 @@ This is the list that is used before handing over to the browser.") (if (and org-url-encoding-use-url-hexify (not table)) (url-hexify-string text) (setq table (or table org-link-escape-chars)) -(when text - (let ((re (mapconcat (lambda (x) (regexp-quote - (char-to-string (car x - table "\\|"))) - (while (string-match re text) - (setq text - (replace-match -(cdr (assoc (string-to-char (match-string 0 text)) -table)) - t t text))) - text +(mapconcat + (lambda (char) + (if (or (assoc char table) + (< char 32) (> char 126)) + (mapconcat (lambda (sequence) + (format "%%%.2X" sequence)) + (encode-coding-char char 'utf-8) "") + (char-to-string char))) text ""))) (defun org-link-unescape (text &optional table) "Reverse the action of `org-link-escape'." -- 1.7.2.3 ___ 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] [PATCH 01/16] Decode single byte sequence if decoding unicode failed.
From: Sebastian Rose * org-protocol.el (org-protocol-unhex-single-byte-sequence): New function. Decode hex-encoded singly byte sequences. (org-protocol-unhex-compound): Use new function if decoding sequence as unicode character failed. --- lisp/org-protocol.el | 26 +++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 1c501f3..33878a8 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -305,7 +305,7 @@ part." (defun org-protocol-unhex-string(str) "Unhex hexified unicode strings as returned from the JavaScript function -encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ü'." +encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." (setq str (or str "")) (let ((tmp "") (case-fold-search t)) @@ -321,7 +321,9 @@ encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ü'." (defun org-protocol-unhex-compound (hex) - "Unhexify unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ü'." + "Unhexify unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. +Note: this function also decodes single byte encodings like +`%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." (let* ((bytes (remove "" (split-string hex "%"))) (ret "") (eat 0) @@ -353,12 +355,30 @@ encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ü'." (setq val (logxor val xor)) (setq sum (+ (lsh sum shift) val)) (if (> eat 0) (setq eat (- eat 1))) - (when (= 0 eat) + (cond +((= 0 eat) ;multi byte (setq ret (concat ret (org-protocol-char-to-string sum))) (setq sum 0)) +((not bytes) ; single byte(s) + (setq ret (org-protocol-unhex-single-byte-sequence hex )) ;; end (while bytes ret )) +(defun org-protocol-unhex-single-byte-sequence(hex) + "Unhexify hex-encoded single byte character sequences." + (let ((bytes (remove "" (split-string hex "%"))) + (ret "")) +(while bytes + (let* ((b (pop bytes)) +(a (elt b 0)) +(b (elt b 1)) +(c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0))) +(c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0 + (setq ret + (concat ret (char-to-string + (+ (lsh c1 4) c2)) +ret)) + (defun org-protocol-flatten-greedy (param-list &optional strip-path replacement) "Greedy handlers might receive a list like this from emacsclient: '( (\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\") -- 1.7.2.3 ___ 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] Improve percent escaping links in Org mode (pull request / OK to push)
Hi Bastien, > Wow... how could I missed this email? Thanks for the thorough details > about this change, which is most than welcome (I read Vincent's emails > about this.) > I hope you can rebase this on current head without too much headache, > and provide a set of patches. I'd rather read patches than just test > from a branch... Rebased to current head and here we go. Best, -- David ___ 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: Mails with icalendar appointments
Hi Vagn, Vagn Johansen writes: > For gnus I wrote this to import from text/calendar attachments > > http://ozymandias.dk/emacs/emacs.html#org-import-calendar > > It a automatically stores an org snippet to the ring. So most of the > time I can use press my remember keybinding and yank. Nice! I added a FAQ entry on Worg mentioning it. PS: don't your code need a s/calender/calendar ? -- Bastien ___ 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] [PATCH] ASCII export: Fixed a bug.
Hi Valentin, Valentin Wüstholz writes: > I have attached a small patch for a bug that I reported a while ago. > See http://thread.gmane.org/gmane.emacs.orgmode/36097. Thanks for this patch. I've just applied a simplified version of it, which takes care of the bug. Best, -- Bastien ___ 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] [PATCH] Properly format start and end times in time ranges.
Bastien writes: Hi Bastien, >> How come that you are replying in the first place? Some weeks ago >> I've set my patch to "Superseeded" state at patchwork. > > Well, I thought your patch didn't make its way through patchwork since > I didn't saw it there -- should have searched more carefully. How can > you set it as Superseeded by yourself? I don't see your name in the > list of maintainers on patchwork. No, I'm no maintainer. But I think a contributor may make state changes to his own patches. >> I've heard something like an `org-agenda-line-format'... > > Check it out: > > http://git.naquadah.org/?p=~jd/org-mode.git;a=summary > > Test this branch: > > > http://git.naquadah.org/?p=~jd/org-mode.git;a=shortlog;h=refs/heads/jd/agenda-format I'll have a look at it! Bye, Tassilo ___ 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] [PATCH] LaTeX export: Added formatting for time stamps in headlines.
Valentin Wüstholz writes: > I have attached a small patch, that adds nice formatting for time > stamps in headlines. Applied, thanks! -- Bastien ___ 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] [PATCH] ASCII export: Fixed a bug.
Hi, I have attached a small patch for a bug that I reported a while ago. See http://thread.gmane.org/gmane.emacs.orgmode/36097. Best regards, Valentin org-ascii.el.diff Description: Binary data ___ 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] [PATCH] LaTeX export: Added formatting for time stamps in headlines.
Hi, I have attached a small patch, that adds nice formatting for time stamps in headlines. Best regards, Valentin org-latex.el.diff Description: Binary data ___ 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] [PATCH] Properly format start and end times in time ranges.
Hi Tassilo, Tassilo Horn writes: > How come that you are replying in the first place? Some weeks ago I've > set my patch to "Superseeded" state at patchwork. Well, I thought your patch didn't make its way through patchwork since I didn't saw it there -- should have searched more carefully. How can you set it as Superseeded by yourself? I don't see your name in the list of maintainers on patchwork. >> I couldn't apply the patch against latest git HEAD -- would you mind >> rebasing and resubmit it? If you don't have time right now no problem >> at all -- Julien and I are working on a bigger agenda change and I'd >> rather apply your patch after his... > > Julien already changed parts of the range agenda display, and he told me > that he's planning a bunch of other agenda improvements, where anything > my patch did is also on his todo list, probably in a better, more > general way. Yes, probably -- apparently Julien didn't sent his reply to the list, that's why I thought your patch was waiting for a ACK. > I've heard something like an `org-agenda-line-format'... Check it out: http://git.naquadah.org/?p=~jd/org-mode.git;a=summary Test this branch: http://git.naquadah.org/?p=~jd/org-mode.git;a=shortlog;h=refs/heads/jd/agenda-format > So we can forget my patch. Okay, thanks for the update. -- Bastien ___ 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: Mails with icalendar appointments
Andreas Amann writes: > I get quite a few emails in icalendar format which are requests for > appointments. To avoid unnecessary distraction, I would like to quickly > convert them into org-mode TODO list items. What is the recommended way > to do this? Can the org-capture framework be used for this? > > I use notmuch to access email, and org-notmuch.el as capture interface > but I guess the same problem occurs for users of gnus or other email > clients. Do solutions exist for them? For gnus I wrote this to import from text/calendar attachments http://ozymandias.dk/emacs/emacs.html#org-import-calendar It a automatically stores an org snippet to the ring. So most of the time I can use press my remember keybinding and yank. -- Vagn Johansen ___ 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] [PATCH] Properly format start and end times in time ranges.
Bastien writes: Hi Bastien, >> * org-agenda.el (org-format-agenda-item): Properly format start and >> end times in time ranges, i.e., print the start time of the start >> date, no times for intermediate dates, and the end time with >> preceeding dots for the end date. > > Thanks for the patch, and sorry for the delay in replying. How come that you are replying in the first place? Some weeks ago I've set my patch to "Superseeded" state at patchwork. > I couldn't apply the patch against latest git HEAD -- would you mind > rebasing and resubmit it? If you don't have time right now no problem > at all -- Julien and I are working on a bigger agenda change and I'd > rather apply your patch after his... Julien already changed parts of the range agenda display, and he told me that he's planning a bunch of other agenda improvements, where anything my patch did is also on his todo list, probably in a better, more general way. I've heard something like an `org-agenda-line-format'... So we can forget my patch. Bye, Tassilo ___ 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] OpenDocumentText/OpenOffice Exporter - 0.6 Release
Hi Gary, Gary Oberbrunner writes: > I just joined the list recently and am very excited to try direct odt > export! I checked out Jambunathan's git repo. I'm already running > org-mode from its git master; is your repo a fork of the master, or > is it its own thing? Jambunathan's repo is a fork from org-mode.git. > It seems like it contains everything, so I should use it instead of > the main one? Jambunathan can merge changes from master org-mode.git so that his repo keeps current with latest org-mode.git changes, but that a lot of work. I hope we will be able to work on integrating this into org-mode.git so that users don't have to switch from one branch to another! HTH, -- Bastien ___ 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] OpenDocumentText/OpenOffice Exporter - 0.6 Release
Hi Jambunathan, Jambunathan K writes: > I am happy to make available 0.6 release of OpenOffice/OpenDocumentText > exporter. The exporter is based on org-parse.el contributed by Lennart > Borgman. Wow. I've tested it, following your instruction, and I was able to export the example files (and some smaller tests) to. odt. Great! I'll write to you and Lennart in private to see how we can reduce the number of dependencies (like org-newhtml.el) and try to integrate this into org-mode.git. Again, thanks for this nice and often requested contribution. -- Bastien ___ 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] Insert ampersand in HTML export?
Hi Uriel, Uriel Avalos writes: > What about some type of escape character like \&? That way \& is > exported as & instead of & or \$. Would that work? Handling escape characters is quite tricky, I'd better not go that way. > org-export-html-protect-char-alist may work in my case---the MATHML > macros are in a seperate #+SETUPFILE. As long as this variable doesn't > "bubble up" i.e., apply to the file that calls #+SETUPFILE, then it > will work. Please tell me if it works. Thanks! -- Bastien ___ 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] Help with Babel and using SQL
Hi Yesare, I'm not familiar enough with Babel to give you useful guidance, but others on the list may help you. yesare writes: > I am trying to do two things. > > > 1. Query a mysql or oracle table and post results in orgtable format > 2. Select data from an existing orgtable in current buffer and do > further processing with them (example: insert them into Oracle). > > I am sorry if this is vague but I am just looking for some initial > guidance on how to get around. Can you post the code your tried? What you expected? What happened instead? This will help people to know where and why you're stuck. Thanks! -- Bastien ___ 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: [ANN] OpenDocumentText/OpenOffice Exporter - 0.6 Release
Gary Thanks for trying out org-odt and sharing your feedback. > I just joined the list recently and am very excited to try direct odt > export! I checked out Jambunathan's git repo. I'm already running > org-mode from its git master; is your repo a fork of the master, or > is it its own thing? It seems like it contains everything, so I > should use it instead of the main one? It's a fork of the master. It may lag behind the master depending on my whims and fancies. > > Once I enabled png images in my Windows emacs (by copying the > appropriate DLLs), the following worked fine for me in my .emacs: > > #+begin_example > ;; Org-mode ODT (Open Document) export, EXPERIMENTAL: > (custom-set-variables > '(org-export-latex-default-packages-alist (quote (("AUTO" "inputenc" > t > '(org-export-with-LaTeX-fragments (quote dvipng)) > ) > (setq org-odt-base-dir "c:/Program Files (x86)/emacs/site-lisp/ > org-jambu") ; only used for odt export > (load-file (expand-file-name "contrib/odt/setup.el" > org-odt-base-dir)) > #+end_example > LaTeX related lines are required only if there are LaTeX fragments (like equations) which need to be embedded in to the resulting odt file. I have included these lines only because the test.org file that I use for testing has embedded LaTeX fragments. As you noted above, setup.el changes the load-path and has pointers to default styles file used for export. > I suppose one addition would be to allow for customized ODT character > and paragraph styles, e.g. customizing the styles.xml that gets > included into the doc. FYI, many of the user-defined styles used by the exporter have `org' prefix. Updating styles file either from a sample .odt file or .ott files is something in my list. Till such time as I add support for this feature one can use the following workaround: 1. customize the different styles in exported file and save it. 2. unzip the resulting odt file (Note: odt files are just .zip files) and extract styles.xml file from the same. 3. Customize the variable org-export-odt-styles-file to point to the above styles file. The above procedure should work though I haven't tried this myself. For the sake of record, many folks using `older version of emacs' have reported `delete-directory' related crashes while trying my exporter. I have pushed a fix for this a few minutes ago. Jambunathan 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] Alinea filling (hanlding of explicit line-breaks)
Dear all, I would like to suggest an evolution of fill.el. I can make the update and provide the diff file. The proposal is to add, in addition to paragraph separator, an alinea separator. Accordingly there would be a forward-alinea function similar to forward-paragraph. An alinea is, in French regulatory jargon, (er, what is the English word for alinea? ) a part in a paragraph that is separated by a line break, and typically starting with an indentation. Not all pargraphs are separated into alineas. That evolution would be completely backward compatible: with a nil alinea separator, the behaviour would be same as the current one, and otherwise paragraph filling would fill each alineas within the current paragraph as if they were paragraphs on their owns. I felt the need for this in two occasions, the first one was for EUPP (cf http://vincentbelaiche.pagesperso-orange.fr/#sec-1_2), and the second one was with Org mode. EUPP embeds lisp code into comments thanks to special markup added onto the usual comment marks. With EUPP, I needed to prevent the paragraph filling to mangle those comment extra marks, as otherwise they would be erroneously separated from normal comment marks. One solution would be that the EUPP mark that is at each end of line of embedded lisp code is configured as an alinea separator. I suggested an evolution on AUCTeX (as I use EUPP mostly in conjunction with LaTeX code), but the answer from Ralf Angeli at that time was that this should rather be an evolution of generic filling service in fill.el, and I was convinced by him that this would be a better way. Another occasion, is for Org mode. In Org-mode: the explicit line break is a `\\' placed at end of line. If `\\' is not at end of line it loses its meaning of line-break. Filling a paragraph that contains an explicit line break is quite a disturbance because most often the line tailing \\ is moved and as after filling it is no longer at the end of line, it loses its linebreaking power. The solution would be to configure `$' into the alinea separator, so that filling a paragraph does not mix alineas together. Feedback to this proposal is most welcome, in case that there is a consensus on the usefulness of alinea separation, I would provide the updated code/bazaar diff. VBR, Vincent. ___ 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] org-git-link does not support locational information within file
> ** Shortcomings of git-link in current org HEAD > Yet, org-git-link currently is too greedy for my daily use: > 1. they kill org-links for org headings, if the org files are > versioned in a git repository (and all of mine are!) and > 2. they kill in-file-search information for versioned non-org files. The discussion so far focused on extending the link syntax to allow multiple pieces of "location" information (e.g. location within the repository + location within the file), which is a good idea. However, I think the bigger problem with org-git-link in its current incarnation is that it forces me to use git:// links for all files under version control, which is NOT what I want to do 90% of the time. I have a quick hack to deal with this -- namely, commenting out ;; (add-hook 'org-store-link-functions 'org-git-store-link t) and using a separate keybinding for storing git links using the following function: (defun org-git-store-link-interactively (arg) "Store git link to current file." (interactive "P") (let ((org-store-link-functions (cons 'org-git-store-link org-store-link-functions))) (call-interactively 'org-store-link arg) )) In addition, I'm not crazy about using the "branch@{date}" format for storing links by default, so I hacked something that uses SHA1 instead... I could post a patch if anyone is curious. --Leo ___ 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