Re: [O] [PATCH] ob-sql.el: Support sqlcmd and cygwin environment
Hi Nicolas, I suppose I should put the news entry to ./etc/ORG-NEWS file, but into which version? I created below entry, please take look and let me know where do you want me to put it. *** Improved support to Microsoft SQL Server in =ob-sql.el= =ob-sql.el= library removes support to the ~msosql~ engine which uses the deprecated =osql= command line tool, and replaces it with ~mssql~ engine which uses the =sqlcmd= command line tool. Use with properties like this: #+BEGIN_EXAMPLE :engine mssql :dbhost :dbuser :dbpassword :database #+END_EXAMPLE If you want to use the *trusted connection* feature, omit *both* the =dbuser= and =dbpassword= properties and add =cmdline -E= to the properties. If your Emacs is running in a Cygwin environment, the =ob-sql.el= library can pass the converted path to the =sqlcmd= tool. I checked the code and it does not quote the arguments for me. It is a safe manner in Windows to always quote the path. So I will keep it. I have a question. Currently the table generated by mssql engine has the "affected rows" append to the end, like this. | memberid | username | xx | flags | |---+--+--+---| | 1 | GPL | Indo | NULL | | 2 | GPL | Indo | NULL | | | | | | | (2 rows affected) | | | | I personally prefer to remove it. Do you or the org community has a preference about this? Maybe I should keep the behavior align with other engines? On Tue, Jun 14, 2016 at 9:02 PM Xi Shen wrote: > Hi Nicholas, > > Sure, I will add the news and declaration. > > The "format" is required to quote the filename, so the spaces won't > surprise sqlcmd. Maybe the arguments will be quoted when passing to the > command? > > On Tue, Jun 14, 2016, 19:52 Nicolas Goaziou > wrote: > >> Hello, >> >> Xi Shen writes: >> >> > I think I uploaded the wrong patch. Sorry~ Please check this one. >> >> It looks good. Thank you. I have one minor comment about it, see below. >> >> Also, could you provide an entry for ORG-NEWS since this is a user >> visible change? >> >> > +(defun org-babel-sql-convert-standard-filename (file) >> > + "Convert the file name to OS standard. >> > +In Cygwin environment, is uses Cygwin specific function to >> > +convert the file name and double quote it. Otherwise, uses Emacs >> > +standard conversion function." >> > + (if (fboundp 'cygwin-convert-file-name-to-windows) >> > + (format "\"%s\"" (cygwin-convert-file-name-to-windows file)) >> > +(convert-standard-filename file))) >> >> `cygwin-convert-file-name-to-windows' is going to generate a compilation >> warning. You need to declare it with `declare-function' at the top of >> the file. >> >> I'm also surprised that the function above doesn't return a string >> already. Are you sure the `format' part is needed? >> >> Regards, >> >> -- >> Nicolas Goaziou >> > -- > > > Thanks, > David S. > -- Thanks, David S.
Re: [O] Bug: not defined [8.2.10 (release_8.2.10 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]
Hi Nicolas, I tried 8.3, but the issue is there, too. Best regards, Daniel ☵☯☲ 2016年6月1日 13:36,"Nicolas Goaziou" 写道: > Hello, > > Kejia柯嘉 writes: > > > does enter an editing buffer, and in terms of the manual > > (http://orgmode.org/manual/Literal-examples.html) does exit the > > buffer: > > ``` > > C-c ' > > Edit the source code example at point in its native mode. This works > > by switching to a temporary buffer with the source code. You need to > > exit by pressing C-c ' again. > > ''' > > however, is not defined in the code editing buffer now. > > > > Emacs : GNU Emacs 25.1.50.1 (x86_64-apple-darwin13.4.0, NS > > appkit-1265.21 Version 10.9.5 (Build 13F1603)) > > of 2016-05-19 > > Package: Org-mode version 8.2.10 (release_8.2.10 @ > > /Applications/Emacs.app/Contents/Resources/lisp/org/) > > Could you upgrade Org to a more recent version and try again? > > Regards, > > -- > Nicolas Goaziou >
Re: [O] bibliography as part of the source document?
On 2016-06-13 at 13:28, Sharon Kimble wrote: > Ken Mankoff writes: >> On 2016-06-13 at 13:07, Sharon Kimble wrote: >>> I'm trying to have all my information for a org-mode document >>> exported to latex contained within the source document. Specifically >>> having the bibliography within the source document. >>> >>> But how do I do it? I've tried googling but haven't turned up >>> anything useful. Can you help please? >> >> What about putting the BibTeX contents in the Org file. Tangle on >> export to Bib file. >> > > Yes, that's what I'm trying to do, but how do I tangle it? I don't know how to tell Org to tangle-on-export with an argument or a setting, but it can evaluate code blocks on export, and one of those can do the tangling for you. The following might work? #+begin_src emacs-lisp :exports none (org-babel-goto-named-src-block "bibtex") (org-babel-tangle) #+end_src #+begin_src bibtex :tangle file.bib bib contents go here #+end_src -k.
Re: [O] org-install?
On Tue, Jun 14, 2016 at 12:06 PM, Rustom Mody wrote: > What is the setup procedure recommended for git-installed org? 1. Clone it to ~/src 2. Generate autoloads and Compiling Org without make: http://orgmode.org/worg/org-hacks.html 3. Before the packaging stuff loads and runs in your config: 4. Always load the newest file: (setq load-prefer-newer t) 5. Load Org-Mode (add-to-list 'load-path "~/src/org-mode/lisp") (add-to-list 'load-path "~/src/org-mode/contrib/lisp") (require 'org)
Re: [O] How to have #+ORGTBL: SEND install converted table to MORE than 1 receiver location?
Hello, I'm just resending this question because I haven't received any answers/ideas in a week. I also asked it in https://emacs.stackexchange.com/questions/23836/how-to-have-org-mode-radio-table-install-converted-table-to-more-than-one-receiv, with no answers so far. Thanks, Omid On 06/07/2016 12:16 PM, Omid wrote: > Right now, it only installs to the first location. > > On 06/07/2016 12:13 PM, Omid wrote: >> Hello, >> >> Is there a way to have #+ORGTBL: SEND install converted table to MORE >> than 1 receiver location? Specifically, in LaTeX I have >> >> \begin{comment} >> #+ORGTBL: SEND r_hf-vector orgtbl-to-generic :splice t :lend " " >> :sep " & " >> | f | >> | 0 | >> | \vdots | >> | 0 | >> \end{comment} >> >> And I'd like it to be installed in both locations below. >> >> % BEGIN RECEIVE ORGTBL r_hf-vector >> f \\ >> 0 \\ >> \vdots \\ >> 0 \\ >> % END RECEIVE ORGTBL r_hf-vector >> >> % BEGIN RECEIVE ORGTBL r_hf-vector >> f \\ >> 0 \\ >> \vdots \\ >> 0 \\ >> % END RECEIVE ORGTBL r_hf-vector >> >> >> Org-mode version 8.3.4 (8.3.4-60-g19cf68-elpa) >> GNU Emacs 24.5.1 >> >> Thanks, >>
Re: [O] Absolute timestamps in timer list
Hmm, good point... I'm new to Emacs and Lisp so this might be a good exercise for me. Thanks for the direction! Regards, Rob On Tue, Jun 14, 2016 at 11:22 AM, Nicolas Goaziou wrote: > Hello, > > Robert Moore writes: > > > I think this really cool but i'm also looking to have the option to use > > absolute timestamps like so: > > > > - <2016-06-14 Tue 10:34> :: First item > > - <2016-06-14 Tue 10:39> :: Second item > > - <2016-06-14 Tue 10:48> :: Third item > > > > Not sure if this has been raised before. I did have look around but > didn't > > find anything. Any pointers would be great! > > I don't think an option is needed here. It's just M-RET followed by "C-u > C-c . RET". You can automate the process with a macro or some Lisp. > > > Regards, > > -- > Nicolas Goaziou >
Re: [O] org-install?
As I understand, the worg pages are not official pages. They can be contributed to by anyone interested. I would rather refer to http://orgmode.org/manual/Installation.html to official org installation instructions. In a nutshell, to install org from git, 1. Clone the git repo 2. Copy default.mk to local.mk and make changes in that as needed. Typically one would simply need to change just the prefix variable. Change any variable as you need in local.mk 3. make cleanall && make && make install On Tue, Jun 14, 2016 at 1:12 PM Rustom Mody wrote: > There are a number of documentation pages, eg > http://orgmode.org/worg/org-tutorials/org4beginners.html > http://orgmode.org/worg/org-faq.html > > that recommend to use > (require 'org-install) > > However org-install itself says: > > ;; The file org-install is obsolete. > ;; > ;; It is provided here so that (require 'org-install) does not > ;; trigger an error for users with obsolete Emacs configuration. > ;; You can safely remove (require 'org-install) from your config." > > > And contains nothing else!! > > So what exactly is the case? > What is the setup procedure recommended for git-installed org? > -- -- Kaushal Modi
[O] org-install?
There are a number of documentation pages, eg http://orgmode.org/worg/org-tutorials/org4beginners.html http://orgmode.org/worg/org-faq.html that recommend to use (require 'org-install) However org-install itself says: ;; The file org-install is obsolete. ;; ;; It is provided here so that (require 'org-install) does not ;; trigger an error for users with obsolete Emacs configuration. ;; You can safely remove (require 'org-install) from your config." And contains nothing else!! So what exactly is the case? What is the setup procedure recommended for git-installed org?
Re: [O] Changing org-block background with org-src-fontify-natively
On 2016-06-13 19:12, Rasmus writes: >> One thing I don't understand is how I reveal what is hidden by the >> burger symbol. I move my cursor around, including on top of the burger, >> and nothing changes. Should I run some command to reveal it? > > Indeed. That's the main selling point of prettify-symbols-mode. It might > be in Emacs-25; check if the variable prettify-symbols-unprettify-at-point > is defined. I use: > > (setq prettify-symbols-unprettify-at-point 'right-edge) It does not exist here (on emacs 24.5.1), so I guess I need to wait till emacs 25 ships. In the meantime it's fairly easy to temporarily turn off prettify-symbols-mode (as it really looks good when enabled, so I still want to use it). > If time allows, I will rewrite it as a separate mode as prettify-symbols > mode is not quite right for this purpose. That would be great! Thanks, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 Monthly Athmospheric CO₂, Mauna Loa Obs. 2015-05: 403.94, 2016-05: 407.70 signature.asc Description: PGP signature
Re: [O] extract a region from a table and export it
Uwe Brauer writes: "John" == John Kitchin writes: > > > >> or, rows 0, 1 and 4. > >> #+BEGIN_SRC emacs-lisp :var d=data >> (loop for i in '(0 1 4) collect (elt d i)) >> #+END_SRC > > Ok the second code works now, and is almost what I want, but I need it > mostly for columns, it is not obvious for me that corresponds in the > syntax above to columns. See (info "(org) var") in particular the section on "Indexable variable values". Additionally, an empty index, or the single character ‘*’, are both interpreted to mean the entire range and as such are equivalent to ‘0:-1’, as shown in the following example in which the entire first column is referenced. #+NAME: example-table | 1 | a | | 2 | b | | 3 | c | | 4 | d | #+BEGIN_SRC emacs-lisp :var data=example-table[,0] data #+END_SRC #+RESULTS: | 1 | 2 | 3 | 4 | -- If you can mix business and politics wonderful things can happen!
Re: [O] Absolute timestamps in timer list
Hello, Robert Moore writes: > I think this really cool but i'm also looking to have the option to use > absolute timestamps like so: > > - <2016-06-14 Tue 10:34> :: First item > - <2016-06-14 Tue 10:39> :: Second item > - <2016-06-14 Tue 10:48> :: Third item > > Not sure if this has been raised before. I did have look around but didn't > find anything. Any pointers would be great! I don't think an option is needed here. It's just M-RET followed by "C-u C-c . RET". You can automate the process with a macro or some Lisp. Regards, -- Nicolas Goaziou
[O] Absolute timestamps in timer list
Hi All, Does anybody know of a way to use absolute timestamps instead of relative timestamps in a timer list? For example: pressing C-c C-x - starts a list with a relative timestamp like so: - 0:00:00 :: First item Pressing M- adds more items to the list with the corresponding relative timestamp like so: - 0:00:00 :: First item - 0:00:05 :: Second item - 0:00:12 :: Third item I think this really cool but i'm also looking to have the option to use absolute timestamps like so: - <2016-06-14 Tue 10:34> :: First item - <2016-06-14 Tue 10:39> :: Second item - <2016-06-14 Tue 10:48> :: Third item Not sure if this has been raised before. I did have look around but didn't find anything. Any pointers would be great! Regards, Rob
[O] Thank you!
I have recently adopted org-mode for both task lists and technical writing and wanted to express my sincere thanks to the creator, developers, and maintainers for such a wonderful piece of software. Keep up the great work! -gyro
Re: [O] extract a region from a table and export it
>>> "John" == John Kitchin writes: > How about: > #+tblname: grades > || H1 | H2 | H3 | Great exactly what I needed, thanks! Maybe such code should be included somewhere, (manual?) Uwe
Re: [O] [PATCH] ob-sql.el: Support sqlcmd and cygwin environment
Hi Nicholas, Sure, I will add the news and declaration. The "format" is required to quote the filename, so the spaces won't surprise sqlcmd. Maybe the arguments will be quoted when passing to the command? On Tue, Jun 14, 2016, 19:52 Nicolas Goaziou wrote: > Hello, > > Xi Shen writes: > > > I think I uploaded the wrong patch. Sorry~ Please check this one. > > It looks good. Thank you. I have one minor comment about it, see below. > > Also, could you provide an entry for ORG-NEWS since this is a user > visible change? > > > +(defun org-babel-sql-convert-standard-filename (file) > > + "Convert the file name to OS standard. > > +In Cygwin environment, is uses Cygwin specific function to > > +convert the file name and double quote it. Otherwise, uses Emacs > > +standard conversion function." > > + (if (fboundp 'cygwin-convert-file-name-to-windows) > > + (format "\"%s\"" (cygwin-convert-file-name-to-windows file)) > > +(convert-standard-filename file))) > > `cygwin-convert-file-name-to-windows' is going to generate a compilation > warning. You need to declare it with `declare-function' at the top of > the file. > > I'm also surprised that the function above doesn't return a string > already. Are you sure the `format' part is needed? > > Regards, > > -- > Nicolas Goaziou > -- Thanks, David S.
Re: [O] Some LaTeX Beamer / org-mode questions
Hello, Rasmus writes: > Re the beamer manual 10.1, we could add the following keywords, > #+short_title, #+short_subtitle, #+short_date , #+institute and > #+short_institute. Thank you for your work. I didn't test your patch. However, here are some late comments about this suggestion. > Maybe we can have a titlegraphics like, > > #+attr_beamer: :titlegraphics t > [[file:link.pdf]] I think #+TITLEGRAPHICS: [[file:link.pdf]] would be cleaner. > ;; Otherwise, use `latex' back-end. > - (t (org-export-with-backend 'latex link contents info) > + (t (cond ((and (org-export-inline-image-p link) > + (plist-get (org-export-read-attribute > + :attr_beamer (org-export-get-parent-element > link)) > +:titlegraphic)) > +"") > + (t (org-export-with-backend 'latex link contents info))) The last `cond' could be merged with the one above. It looks like there's unnecessary branching here. Anyway, it probably should not be included per suggestion above. > > Plain List > @@ -855,21 +866,65 @@ holding export options." > (when (integerp sec-num) >(format "\\setcounter{secnumdepth}{%d}\n" sec-num))) > ;; Author. > - (let ((author (and (plist-get info :with-author) > - (let ((auth (plist-get info :author))) > - (and auth (org-export-data auth info) > -(email (and (plist-get info :with-email) > -(org-export-data (plist-get info :email) info > + (let* ((author (and (plist-get info :with-author) > + (let ((auth (plist-get info :author))) > +(and auth (org-export-data auth info) > + (short-author (and author (plist-get info :short-author))) Since "short-author" is `parsed', this should be wrapped within `org-export-data' somehow. You do it below, but it introduces some code duplication. > + (email (and (plist-get info :with-email) > + (org-export-data (plist-get info :email) info))) > + ) You left a dangling parenthesis. > (cond ((and author email (not (string= "" email))) > - (format "\\author{%s\\thanks{%s}}\n" author email)) > - ((or author email) (format "\\author{%s}\n" (or author email) > + (format "\\author%s{%s\\thanks{%s}}\n" > + (if short-author > + (format "[%s]" (org-export-data short-author info)) > "") > + author email)) > + ((or author email) (format "\\author%s{%s}\n" > + (if short-author > + (format "[%s]" (org-export-data > short-author info)) "") > + (or author email) See above. Also, I would move the (format ...) below (or author email) > ;; Date. > - (let ((date (and (plist-get info :with-date) (org-export-get-date > info > - (format "\\date{%s}\n" (org-export-data date info))) > - ;; Title > - (format "\\title{%s}\n" title) > + (let* ((date (and (plist-get info :with-date) (org-export-get-date > info))) > + ;; TODO: add optional argument of ‘org-export-get-date’. > + (short-date (and date (org-export-data > +(org-export-get-date > + (plist-put info :date > +(plist-get info > :beamer-short-date))) > +info > + (format "\\date%s{%s}\n" (if (org-string-nw-p short-date) > + (format "[%s]" short-date) "") I would put the "" below (format "[%s]" short-date): it doesn't make clear there is an else branch otherwise. > +(org-export-data date info))) > + ;; Title. > + (let ((short-title (and title > + (plist-get info :beamer-short-title > + (format "\\title%s{%s}\n" > +(if short-title (format "[%s]" (org-export-data short-title > info)) "") > +title)) See above. > + ;; Titlegraphics. > + (let ((titlegraphic-link > + (org-element-map (plist-get info :parse-tree) 'link > + (lambda (link) > + (when (and (org-export-inline-image-p link) > +(plist-get (org-export-read-attribute > +:attr_beamer > (org-export-get-parent-element link)) > + :titlegraphic)) > + link)) > + info t))) See above. Regards, -- Nicolas Goaziou
Re: [O] extract a region from a table and export it
How about: #+tblname: grades || H1 | H2 | H3 | |+++| | P1 | 90 | 89 | 91 | | P2 | 67 | 65 | 78 | | P3 | 99 | 98 | 97 | collect row 0 and 2, columns 0 (P) and 2 (H2) #+BEGIN_SRC emacs-lisp :var data=grades (loop for i in '(0 2) with row = nil do (setq row (nth i data)) collect (list (nth 0 row) (nth 2 row))) #+END_SRC #+RESULTS: | P1 | 89 | | P3 | 98 | Uwe Brauer writes: "John" == John Kitchin writes: > > > >> or, rows 0, 1 and 4. > >> #+BEGIN_SRC emacs-lisp :var d=data >> (loop for i in '(0 1 4) collect (elt d i)) >> #+END_SRC > > Ok the second code works now, and is almost what I want, but I need it > mostly for columns, it is not obvious for me that corresponds in the > syntax above to columns. > > >> #+RESULTS: >> | 1 | a | >> | 2 | r | >> | 8 | y | > > > > >> Uwe Brauer writes: > >>> Hi >>> >>> Is it possible to extract just say two regions from a huge table and >>> convert it to say CSV? >>> >>> Uwe Brauer -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu
[O] MobileOrg: adding new file
Hello So what I wanted to discuss was the possibility for a MobileOrg to create new files from its phone and keep them synched. Currently the list of synched files is a file called "index.org" stored in the synch folder and Emacs and MobileOrg use ite for pulling changes. However everytime Emacs pushes a changes, it overwrites this file. Because for pushing, Emacs use a second list of files, the variable 'org-agenda-files and it will recreate a new index.org based on org-agenda-files content. To conclude, if MobileOrg had added a file to synch in index.org, it will be removed from the list after next Emacs push. So my suggestion is for Emacs to stop using org-agenda-files to generate the list of synched file but use the currently existing index.org. In case index.org does not exist (for eg. at repo initialization), then org-agenda-files can be used to create it. To be honest, after a lot of reflexion, I think more and more about using a external synch mechanism (such as git) instead of using org-mobile.el. A positive point would be to allow non-Emacs people to use MobileOrg with synchronization. So I may not even use my own suggestion but I still think it is worth to mention this "incoherence". Regards On Sun, Jun 12, 2016 at 3:24 PM Nicolas Goaziou wrote: > Hello, > > Benoît Coste writes: > > > I am working on remodeling MobileOrg for Android and I'd like to discuss > a > > few changes for mobile-org.el. > > I read your mail from a month ago. Unfortunately, I don't know enough of > this library to be useful to the discussion. > > > I am trying to contact the maintainer of mobile org. The file > mobile-org.el > > says cars...@orgmode.org but I tried it and it is not working. Does > anyone > > know who is currently maintaining mobile-org.el ? > > It is part of Org core, so anyone with write access to repository can > maintain it. The current maintainer is Bastien Guerry, who reads this > list. IOW, you can discuss the changes here. > > Regards, > > -- > Nicolas Goaziou >
Re: [O] extract a region from a table and export it
>>> "John" == John Kitchin writes: Hi John, > can you write a little code block that filters the table for what you > want, and then convert that to a pdf? Great! Thanks a lot. This is a brilliant idea, on a second thought I would even say that I don't need orgtbl-to-csv, but I just want to extract 3 columns of a table which contains 10. What would the relevant syntax be for column, please? This way I have a poor-man's database (basically I need that for the grades of my students). > Something like: > #+tblname: data > | 1 | a | > | 2 | r | > | 5 | 7 | > | 4 | 9 | > | 8 | y | > #+BEGIN_SRC emacs-lisp :var d=data > (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x) 8))) d) nil) > #+END_SRC I obtain an error when I run your code (but of them, namely) (but I am using a very recent version of org mode) , | | Debugger entered--Lisp error: (wrong-type-argument listp "nil") | -filter((lambda (x) (and (> (car x) 2) (< (car x) 8))) "nil") | (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x) 8))) | d) nil) (let ((d (quote "nil"))) (orgtbl-to-csv (-filter (lambda (x) | (and (> (car x) 2) (< (car x) 8))) d) nil)) (progn (let ((d (quote | "nil"))) (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< | (car x) 8))) d) nil))) eval((progn (let ((d (quote "nil"))) | (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x) 8))) | d) nil org-babel-execute:emacs-lisp("(orgtbl-to-csv (-filter | (lambda (x) (and (> (car x) 2) (< (car x) 8))) d) nil)" ((:comments . | "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") | (:tangle . "no") (:exports . "code") (:results . "replace") (:var d . | "nil") (:session . "none") (:hlines . "no") (:result-type . value) | (:result-params "replace") (:rowname-names) (:colname-names))) | org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() | org-babel-execute-maybe() org-babel-execute-safely-maybe() | run-hook-with-args-until-success(org-babel-execute-safely-maybe) | org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) | call-interactively(org-ctrl-c-ctrl-c nil nil) | command-execute(org-ctrl-c-ctrl-c) ` What could the problem? Thanks again! Uwe
Re: [O] [PATCH]: Fix latex image bug in org-mime-org-buffer-htmlize
Hello, Carlo Nucera writes: > attached is a patch that should fix a bug in the function > org-mime-org-buffer-htmlize (thanks to punchagan on irc!). > > When exporting an org buffer with a latex snippet including the org > option tex: dvipng the images were always created in /tmp/ltxpng/, but > the reported link in the htmlized buffer was the local ./ltxpng folder; > so, unless the org file to htmlize was actually in /tmp, the user got an > error saying that the image could not be found. > > This was caused by the two different ways in which the function > org-mime-replace-images is used inside of org-mime-org-buffer-htmlize > and org-mime-htmlize. > > To correct the problem, the function org-mime-replace-images doesn't > take anymore the current-file parameter (that was only used to get its > directory) and instead always creates a temporary directory using > temporary-file-directory. I amended the commit message so as to include references to the functions being modified, and applied the patch. Thank you. Regards, -- Nicolas Goaziou
Re: [O] extract a region from a table and export it
>>> "John" == John Kitchin writes: > or, rows 0, 1 and 4. > #+BEGIN_SRC emacs-lisp :var d=data > (loop for i in '(0 1 4) collect (elt d i)) > #+END_SRC Ok the second code works now, and is almost what I want, but I need it mostly for columns, it is not obvious for me that corresponds in the syntax above to columns. > #+RESULTS: > | 1 | a | > | 2 | r | > | 8 | y | > Uwe Brauer writes: >> Hi >> >> Is it possible to extract just say two regions from a huge table and >> convert it to say CSV? >> >> Uwe Brauer
Re: [O] [BUG] [PATCH] ox-rss: Put email address in element
Hello, Arun Isaac writes: > The RSS specification requires the email address and the name of the > author to be provided in the element in the format > "em...@domain.com (Name)". > > http://www.rssboard.org/rss-specification#ltauthorgtSubelementOfLtitemgt > > Currently, only the author's name is provided. This is invalid > RSS. Please find attached a patch fixing this. Applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] ob-sql.el: Support sqlcmd and cygwin environment
Hello, Xi Shen writes: > I think I uploaded the wrong patch. Sorry~ Please check this one. It looks good. Thank you. I have one minor comment about it, see below. Also, could you provide an entry for ORG-NEWS since this is a user visible change? > +(defun org-babel-sql-convert-standard-filename (file) > + "Convert the file name to OS standard. > +In Cygwin environment, is uses Cygwin specific function to > +convert the file name and double quote it. Otherwise, uses Emacs > +standard conversion function." > + (if (fboundp 'cygwin-convert-file-name-to-windows) > + (format "\"%s\"" (cygwin-convert-file-name-to-windows file)) > +(convert-standard-filename file))) `cygwin-convert-file-name-to-windows' is going to generate a compilation warning. You need to declare it with `declare-function' at the top of the file. I'm also surprised that the function above doesn't return a string already. Are you sure the `format' part is needed? Regards, -- Nicolas Goaziou
Re: [O] [PATCH] org-babel-goto-named-src-block bugfix and test
Hello, Marco Wahl writes: > I have no idea for a cleaner implementation of these tests. AFAICS > these tests look good (and also your code.) If someone has a better > idea for the tests they can be changed. I don't. > I would drop test > > #v+ > ;; non-existent name > (should-not > (execute-kbd-macro > "\M-xorg-babel-goto-named-src-block\ndef\n")) > #v- > > because its outcome has nothing to do with the existence of the name > "def" AFAICS. Or maybe replace with > > (should (string= "source-code block `non-existent' not found in this buffer" > (org-babel-goto-named-src-block "non-existent"))) > > +1 for commit! I'm not very keen on having `should' macro in the inner parts of tests, because it makes debugging failing tests harder, but a test is better than nothing. So, all in all, it looks good enough to be pushed. Thank you ! Regards, -- Nicolas Goaziou
Re: [O] extract a region from a table and export it
can you write a little code block that filters the table for what you want, and then convert that to a pdf? Something like: #+tblname: data | 1 | a | | 2 | r | | 5 | 7 | | 4 | 9 | | 8 | y | #+BEGIN_SRC emacs-lisp :var d=data (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x) 8))) d) nil) #+END_SRC #+RESULTS: : 5,7 : 4,9 or, rows 0, 1 and 4. #+BEGIN_SRC emacs-lisp :var d=data (loop for i in '(0 1 4) collect (elt d i)) #+END_SRC #+RESULTS: | 1 | a | | 2 | r | | 8 | y | Uwe Brauer writes: > Hi > > Is it possible to extract just say two regions from a huge table and > convert it to say CSV? > > Uwe Brauer -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu
Re: [O] extract a region from a table and export it
On 14 June 2016 at 11:44, Uwe Brauer wrote: > Is it possible to extract just say two regions from a huge table and > convert it to say CSV? Yes. Anything you can think of is possible in Emacs. Usually in two or more different ways. :-) Presumably you want to automate this to make it quickly repeatable. Please show us some sample table rows and explain the criteria you would want to use to identify which regions to extract. -- Phil Hudson http://hudson-it.ddns.net @UWascalWabbit PGP/GnuPG ID: 0x887DCA63
[O] extract a region from a table and export it
Hi Is it possible to extract just say two regions from a huge table and convert it to say CSV? Uwe Brauer
Re: [O] [PATCH] org-babel-goto-named-src-block bugfix and test
>>> The test uses lines like: >>> >>> (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") >>> >>> to emulate interactive usage. >>> >>> This feels like a hack, and the messages generated spill into my >>> *shell* buffer when I run `make test'. If there is a cleaner way to >>> do this, I'd like to know it. >>> >>> WDYT? >> >> Why not just use e.g. >> >> (org-babel-goto-named-src-block "def") >> > > Because that does not test the `(interactive ...)' form, which > comprises most of the code in `org-babel-goto-named-src-block'. Okay. I have no idea for a cleaner implementation of these tests. AFAICS these tests look good (and also your code.) If someone has a better idea for the tests they can be changed. I would drop test #v+ ;; non-existent name (should-not (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\ndef\n")) #v- because its outcome has nothing to do with the existence of the name "def" AFAICS. Or maybe replace with (should (string= "source-code block `non-existent' not found in this buffer" (org-babel-goto-named-src-block "non-existent"))) +1 for commit! Best regards, -- Marco Wahl -- GPG: 0x49010A040A3AE6F2
Re: [O] Tagging an entire org file
> #+FILETAGS: foo That's just what I was looking for. Thank you! signature.asc Description: PGP signature