[O] Preventing RESULTS from being formatted as org table [ob-awk]
Hi, I am running the latest builds of emacs-25 branch and org master branch. I used ob-awk for the first time today and was surprised to see that the #+RESULTS: were displayed as org tables. I do not know if that is due to ob-awk or ob-core and so am posting it here. Here is the minimum working example: (1) Launch emacs -Q (2) Create a test.txt file with the below contents (without the = lines of course): = test.txt = emacs25.0.95 org-mode 8.3.4 = (3) Eval (require 'ob-awk) (4) Create this test.org file = test.org = #+BEGIN_SRC awk :in-file test.txt :exports both { print "My", $1, "version is", $2, "."} #+END_SRC = (5) Now with point in that src block, hit C-c C-c, answer "yes" to the babel eval query, and you will get the below result! #+RESULTS: | My | emacs| version | is | 25.0.95 | . | | My | org-mode | version | is | 8.3.4 | . | So how can I generate the result as one would normally see by running awk in the terminal, without the additional org-table pipe characters? -- -- Kaushal Modi
Re: [O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not
Thanks again, John Kitchin writes: >> But what does not currently work for me (and what used to work): >> getting a choice of citation: cite/citep/citeauthor/nocite/whatever. > > To get this, you press C-u enter on the candidate you select, and that > should give you a new helm selection for citation type. This is > currently only possible in the helm backend. I am not sure if it can be > done with ivy yet. still can't get that to work, sorry, giving up for now, ie. resorting to org w/ plain old reftex. > I think C-u C-c ] will give a list of labels to make a ref link to. > Maybe you don't have any labels, so it looks empty. This is fine now, that I have some links Thanks anyway, Andreas
Re: [O] [PATCH] ob-sql.el: Support sqlcmd and cygwin environment
Yes, I think it is better to let upstream function to resolve the path for org-mode. But I have never contacted Emacs developers before. Should I go through the bug-gnu-em...@gnu.org mail list? Or there's a more effective channel? On Sat, Jun 11, 2016 at 4:41 PM Nicolas Goaziou wrote: > Hello, > > Xi Shen writes: > > > According to > > > https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-File-Names.html > , > > the `convert-standard-filename` works for *nix and MS-DOS, but not Cygwin > > environment. And I tested, it does not work. For the prefix, please > advice > > me a better one. Maybe we should path this function first? How can I > > patch/update a Emacs native function? > > Since there is no module in Emacs, you need to prefix functions and > variables according to the package, or, even better, the library they > belong to. > > Hence, functions and variables in "ob-sql.el" are prefixed with > "org-babel-sql-". > > Do you mind discussing it upstream on emacs-devel ML first? I don't > think this kind of function belongs to Org. If upstream has no > equivalent and doesn't want to add one, we might consider adding it to > the library. > > WDYT? > > >> > The `osql` command line tool was last updated in 2004, > >> > https://technet.microsoft.com/en-us/library/aa214012(v=sql.80).aspx, > >> > and could not output the query result in a way that morden > >> > `org-table.el` expects. The `sqlcmd` is the preferred command line > >> > tool to connect the Microsoft SQL Server and it also has a Linux > >> > version, > >> > https://msdn.microsoft.com/en-us/library/hh568447(v=sql.110).aspx. > >> > >> Would it make sense to remove the msosql support then? > >> > > Yes, but I am also thinking about backward compatibility. Do you want > > me to create a patch to remove `msosql` support? > > AFAIU, according to your comment, "osql" output is barely usable. If you > think it is still usable and even used by some users, then I do not mind > keeping it. I just wanted to be sure we're not keeping something that is > not reasonable to keep. > > >> #'identity > >> > >> > >>> OK, but what's the difference? Care to give me a short lesson? > >>>Thanks! > > Not much difference, hence the "nitpick" tag. > > 'identity is a generic symbol, #'identity clearly indicates we (the > user, the compiler) are interested in the symbol function cell. > > In this case, it is obvious, but it is not always the case in other > parts of the code base, and more consistency in the right direction > doesn't hurt. > > > Regards, > > -- > Nicolas Goaziou > > Thanks, David -- Thanks, David S.
Re: [O] Changing org-block background with org-src-fontify-natively
On 2016-06-11 at 07:40, Rasmus wrote: > Prettify-symbols-mode, I'm using the version that will be shipped with > Emacs 25.1. Details here: > > https://pank.eu/blog/pretty-babel-src-blocks.html That post says, >> It might be nice to reveal the burger whenever the cursor is on the >> same line as the burger. I tried to get this working, but I couldn’t >> get it working property. Would this solve it? http://endlessparentheses.com/new-in-emacs-25-1-have-prettify-symbols-mode-reveal-the-symbol-at-point.html -k.
[O] [PATCH] org-babel-goto-named-src-block bugfix and test
Hi all, The revision a few months back of `org-babel-goto-named-src-block' broke some of the interactive uses. I have fixed these in the attached patch. Also, I provide an ERT test for those interactive uses --- filling in the initial-input with the name of the symbol, results block name, #+call: name, or not if point is elsewhere. 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? ChuckFrom 6b6d0beb908474b75e903c86649a04b6ef71048c Mon Sep 17 00:00:00 2001 From: Charles Berry Date: Sat, 11 Jun 2016 15:45:20 -0700 Subject: [PATCH] org-babel-goto-named-src-block bugfix * lisp/ob-core.el (org-babel-goto-named-src-block): The user prompt (i.e. `initial-input' arg of `completing-read') will be the name of the results block, noweb reference, call reference, or symbol if point is in such. * testing/lisp/test-ob.el (test-ob/goto-named-src-block): Simulate interactive use of `org-babel-goto-named-src-block'. --- lisp/ob-core.el | 18 -- testing/lisp/test-ob.el | 42 ++ 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 2e9a4d1..63983d5 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1690,16 +1690,22 @@ If the point is not on a source block then return nil." (all-block-names (org-babel-src-block-names))) (list (completing-read "source-block name: " all-block-names nil t - (let* ((context (org-element-context)) - (type (org-element-type context))) + (let* ((context (org-element-context)) + (type (org-element-type context)) + (noweb-ref + (and (memq type '(inline-src-block src-block)) +(org-in-regexp (org-babel-noweb-wrap) (cond - ((and (memq type '(inline-src-block src-block)) ;<> -(org-in-regexp (org-babel-noweb-wrap + (noweb-ref + (buffer-substring +(+ (car noweb-ref) (length org-babel-noweb-wrap-start)) +(- (cdr noweb-ref) (length org-babel-noweb-wrap-end ((memq type '(babel-call inline-babel-call)) ;#+CALL: (org-element-property :call context)) - ((org-element-property :results context)) ;#+RESULTS: + ((car (org-element-property :results context))) ;#+RESULTS: ((let ((symbol (thing-at-point 'symbol))) ;Symbol. - (and (member-ignore-case symbol all-block-names) + (and symbol + (member-ignore-case symbol all-block-names) symbol))) (t ""))) (let ((point (org-babel-find-named-block name))) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index aa26602..fe5bbea 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -1581,6 +1581,48 @@ echo \"$data\" (org-test-with-temp-text "#+results: foo" (org-babel-find-named-result "foo" +(ert-deftest test-ob/goto-named-src-block () +"Test interactive use of `org-babel-goto-named-src-block'." +(org-test-with-temp-text-in-file + " +#+NAME: abc +#+BEGIN_SRC emacs-lisp :results value +(1+ 1) +#+END_SRC +#+CALL: abc( lorem() ) :results raw :wrap EXAMPLE +#+BEGIN_SRC emacs-lisp +<> +#+END_SRC +abc +#+RESULTS: abc +: 2 +" + ;; non-existent name + (should-not + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\ndef\n")) + ;; correct name + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\nabc\n") + (should (= 14 (point))) + ;; call line - autocompletion + (forward-line 3) + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") + (should (= 14 (point))) + ;; noweb reference - autocompletion + (forward-line 5) + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") + (should (= 14 (point))) + ;; at symbol - autocompletion + (forward-line 7) + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") + (should (= 14 (point))) + ;; in results - autocompletion + (forward-line 8) + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") + (should (= 14 (point))) + (forward-line 9) + (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") + (should (= 14 (point) + (ert-deftest test-ob/where-is-src-block-result () "Test `org-babel-where-is-src-block-result' specifications." ;; Find anonymous results. -- 2.6.4 (Apple Git-63)
Re: [O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not
John - thanks for your fast reply, and I am learning: didn't know that it should be possible to C-u on the candidate selected - still: it's not working for me (yet), - I assume the error is on my side, but I need more time to find it: start out from a fresh, barely nothing config maybe, will get back, in case I get lost. -Andreas John Kitchin writes: > Andreas Reuleaux writes: > >> I have used org-ref in the past and I liked it, >> now I am trying to get it working again. >> In a way this has become easier: >> >> * I can install org-ref from Melpa now, instead of >> tangling from the org-ref.org file in the past >> >> * with a fairly simple setup (omitting the details for now, >> but can give them of course), and the default >> >> (setq org-ref-completion-library 'org-ref-helm-bibtex) >> >> I get to chose my papers/books to cite in a quite comfortable way >> when I press C-c ] >> >> But what does not currently work for me (and what used to work): >> getting a choice of citation: cite/citep/citeauthor/nocite/whatever. > > To get this, you press C-u enter on the candidate you select, and that > should give you a new helm selection for citation type. This is > currently only possible in the helm backend. I am not sure if it can be > done with ivy yet. > >> Basically I want >> >> * a list to choose from in the first place >> >> * preferrably have my own list of choices, allowing me to focus on the >> ones that I really do use (not get distracted by other more exotic >> ones), and that what I can also switch on a per document basis >> between bitex/natbib/biblatex and the available options there > > You can customize org-ref-cite-types for this. Make it shorter, a local > var, etc... > >> >> I know that org-ref is relying on reftex in this regard, >> and when I just use plain reftex, or even (require 'org-ref-reftex), >> I get to chose cite/citep/citeauthor etc., but I loose the comfort >> of the org-ref-helm-bibtex input method. >> >> Ideally - I guess I am dreaming - I would want to rely >> on ivy (or helm) for narrowing down my choice of cite/citep/citeauthor >> etc - rather than type some retex keystroke. >> >> I got some help from this list in past, how to configure my reftex >> list of choices, to use biblatex entries: parencite etc. - thanks again, >> and can go through these old emails of mine of course, but I am not >> sure in how far these things still apply, given that org-ref has >> changed quite a lot in between. Also at the time, I was at least >> presented some menu when I typed C-u C-c ] - so it was just a matter > > I think C-u C-c ] will give a list of labels to make a ref link to. > Maybe you don't have any labels, so it looks empty. > >> of modifying that menu, now I only get to see "pattern:" in the minibuffer. >> >> Thanks, >> Andreas
Re: [O] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not
Andreas Reuleaux writes: > I have used org-ref in the past and I liked it, > now I am trying to get it working again. > In a way this has become easier: > > * I can install org-ref from Melpa now, instead of > tangling from the org-ref.org file in the past > > * with a fairly simple setup (omitting the details for now, > but can give them of course), and the default > > (setq org-ref-completion-library 'org-ref-helm-bibtex) > > I get to chose my papers/books to cite in a quite comfortable way > when I press C-c ] > > But what does not currently work for me (and what used to work): > getting a choice of citation: cite/citep/citeauthor/nocite/whatever. To get this, you press C-u enter on the candidate you select, and that should give you a new helm selection for citation type. This is currently only possible in the helm backend. I am not sure if it can be done with ivy yet. > Basically I want > > * a list to choose from in the first place > > * preferrably have my own list of choices, allowing me to focus on the > ones that I really do use (not get distracted by other more exotic > ones), and that what I can also switch on a per document basis > between bitex/natbib/biblatex and the available options there You can customize org-ref-cite-types for this. Make it shorter, a local var, etc... > > I know that org-ref is relying on reftex in this regard, > and when I just use plain reftex, or even (require 'org-ref-reftex), > I get to chose cite/citep/citeauthor etc., but I loose the comfort > of the org-ref-helm-bibtex input method. > > Ideally - I guess I am dreaming - I would want to rely > on ivy (or helm) for narrowing down my choice of cite/citep/citeauthor > etc - rather than type some retex keystroke. > > I got some help from this list in past, how to configure my reftex > list of choices, to use biblatex entries: parencite etc. - thanks again, > and can go through these old emails of mine of course, but I am not > sure in how far these things still apply, given that org-ref has > changed quite a lot in between. Also at the time, I was at least > presented some menu when I typed C-u C-c ] - so it was just a matter I think C-u C-c ] will give a list of labels to make a ref link to. Maybe you don't have any labels, so it looks empty. > of modifying that menu, now I only get to see "pattern:" in the minibuffer. > > Thanks, > Andreas -- 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] issue w/ org-ref setup: C-c ] works, but C-u C-C ] not
I have used org-ref in the past and I liked it, now I am trying to get it working again. In a way this has become easier: * I can install org-ref from Melpa now, instead of tangling from the org-ref.org file in the past * with a fairly simple setup (omitting the details for now, but can give them of course), and the default (setq org-ref-completion-library 'org-ref-helm-bibtex) I get to chose my papers/books to cite in a quite comfortable way when I press C-c ] But what does not currently work for me (and what used to work): getting a choice of citation: cite/citep/citeauthor/nocite/whatever. Basically I want * a list to choose from in the first place * preferrably have my own list of choices, allowing me to focus on the ones that I really do use (not get distracted by other more exotic ones), and that what I can also switch on a per document basis between bitex/natbib/biblatex and the available options there I know that org-ref is relying on reftex in this regard, and when I just use plain reftex, or even (require 'org-ref-reftex), I get to chose cite/citep/citeauthor etc., but I loose the comfort of the org-ref-helm-bibtex input method. Ideally - I guess I am dreaming - I would want to rely on ivy (or helm) for narrowing down my choice of cite/citep/citeauthor etc - rather than type some retex keystroke. I got some help from this list in past, how to configure my reftex list of choices, to use biblatex entries: parencite etc. - thanks again, and can go through these old emails of mine of course, but I am not sure in how far these things still apply, given that org-ref has changed quite a lot in between. Also at the time, I was at least presented some menu when I typed C-u C-c ] - so it was just a matter of modifying that menu, now I only get to see "pattern:" in the minibuffer. Thanks, Andreas
Re: [O] Changing org-block background with org-src-fontify-natively
> Rasmus writes: R> swfl...@flintfam.org (Samuel W. Flint) writes: >> How exactly do you get the pencil instead of the #+BEGIN_SRC and >> #+END_SRC? R> Prettify-symbols-mode, I'm using the version that will be shipped R> with Emacs 25.1. Details here: R> https://pank.eu/blog/pretty-babel-src-blocks.html Thank you!! Sam -- Samuel W. Flint 4096R/266596F4 (9477 D23E 389E 40C5 2F10 DE19 68E5 318E 2665 96F4) (λs.s s) λs.s s signature.asc Description: PGP signature
[O] [feature request] Plain list item timestamp support
Hello Orgers, As you possibly know [see (info "(org) Timers")] list items created with M-RET get prefixed with the current timer value when they match a certain form. #+BEGIN_EXAMPLE * Work so hard - 0:00:00 :: Start - 0:00:03 :: Working so hard M-RET (with timer on 0:00:30) yields the line - 0:00:30 :: #+END_EXAMPLE I suggest to implement the same mechanism for inactive timestamps. #+BEGIN_EXAMPLE * Work so hard - [2016-06-11 Sat 15:33] Start - [2016-06-11 Sat 15:34] Working so hard M-RET (when the current time is [2016-06-11 Sat 15:35]) yields the line - [2016-06-11 Sat 15:35] #+END_EXAMPLE WDYT? Best regards, -- Marco 0x49010A040A3AE6F2
Re: [O] [PATCH} Re: inline code block problem; first attempt
Good morning, On 06/10/2016 05:49 PM, Nicolas Goaziou wrote: Hello, "Charles C. Berry" writes: Sounds good. Done. Thank you for the feedback. Thank you Nicolas and Chuck. Works for me, now. Charlie Millar
Re: [O] Changing org-block background with org-src-fontify-natively
swfl...@flintfam.org (Samuel W. Flint) writes: > How exactly do you get the pencil instead of the #+BEGIN_SRC and > #+END_SRC? Prettify-symbols-mode, I'm using the version that will be shipped with Emacs 25.1. Details here: https://pank.eu/blog/pretty-babel-src-blocks.html Xebar Saram writes: > and the different background colors per code block type (different > background for python. lisp etc :)) It's documented in this patch. http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=af463605f10459ae32cd2d8ee1f9ad0a7f333eff Let me know if something is unclear. > That is some rock-star stuff! Thanks! It's Emacs after all! Rasmus -- Bang bang
Re: [O] Bug: Adding a simple list item expands the entire simple list [8.3.4 (8.3.4-79-gbd4948-elpa @ c:/Users/sb/.emacs.d/elpa/org-20160606/)]
Hello, Steinar Bang writes: > What I did do: > I pressed M-RET to insert a new item in an org simple list, with the > other items, some containing sub lists with items, closed. > > What I expected to happen: > I expected the items that were closed to stay closed, and a new item to > be inserted. > > What happened instead: > When the item was inserted, the entire simple list tree was expanded. > > To explain what I mean by "expanded": > > If I have > ** Item1 > - First item of simple list > - Child of first item of simple list > - Second item of simple list > - Child of second item > - Child of child of second item > ** Item2 > > and have most of the nodes closed, like this: > ** Item1 > - First item of simple list... > - Second item of simple list... > ** Item2 > > and then insert a new item into the simple list, the entire tree will > > open (like the first example). Fixed. Thank you. Regards, -- Nicolas Goaziou
Re: [O] bug#23745: 25.0.94; Org: (pop-to-mark-command) doesn't work when using (org-open-at-point) to visit a same-file link
The following message is a courtesy copy of an article that has been posted to gmane.emacs.bugs as well. Hi Dima, Thanks for the report. Dima Kogan writes: > = > * > b > > * > [[]] > = > > With the point at the [[]] link, I can visit the heading with > C-c C-o (org-open-at-point), and I can go back to where I was with the > org-specific C-c & (org-mark-ring-goto). But I should also be able to go > back with C-u C-SPC (effectively pop-to-mark-command), since that works > for inside-the-same-buffer jumps in all other emacs context, including > non-org ones. I suspect all we would need to do is to > (push-mark-command) before we jump in (org-open-at-point). Is this > simply forgotten, or was it omitted on purpose? If the former, I'll post > a patch. I think you are right; your description of behavior would be consistent. Note that once I click C-c & at "* " and thus return to the link "[[]]" I can pop the mark to go back to "* " but the reverse is not possible. A fix for this would be appreciated. Thanks, Rasmus -- Send from my Emacs
Re: [O] [PATCH] ob-sql.el: Support sqlcmd and cygwin environment
Hello, Xi Shen writes: > According to > https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-File-Names.html, > the `convert-standard-filename` works for *nix and MS-DOS, but not Cygwin > environment. And I tested, it does not work. For the prefix, please advice > me a better one. Maybe we should path this function first? How can I > patch/update a Emacs native function? Since there is no module in Emacs, you need to prefix functions and variables according to the package, or, even better, the library they belong to. Hence, functions and variables in "ob-sql.el" are prefixed with "org-babel-sql-". Do you mind discussing it upstream on emacs-devel ML first? I don't think this kind of function belongs to Org. If upstream has no equivalent and doesn't want to add one, we might consider adding it to the library. WDYT? >> > The `osql` command line tool was last updated in 2004, >> > https://technet.microsoft.com/en-us/library/aa214012(v=sql.80).aspx, >> > and could not output the query result in a way that morden >> > `org-table.el` expects. The `sqlcmd` is the preferred command line >> > tool to connect the Microsoft SQL Server and it also has a Linux >> > version, >> > https://msdn.microsoft.com/en-us/library/hh568447(v=sql.110).aspx. >> >> Would it make sense to remove the msosql support then? >> > Yes, but I am also thinking about backward compatibility. Do you want > me to create a patch to remove `msosql` support? AFAIU, according to your comment, "osql" output is barely usable. If you think it is still usable and even used by some users, then I do not mind keeping it. I just wanted to be sure we're not keeping something that is not reasonable to keep. >> #'identity >> >> >>> OK, but what's the difference? Care to give me a short lesson? >>>Thanks! Not much difference, hence the "nitpick" tag. 'identity is a generic symbol, #'identity clearly indicates we (the user, the compiler) are interested in the symbol function cell. In this case, it is obvious, but it is not always the case in other parts of the code base, and more consistency in the right direction doesn't hurt. Regards, -- Nicolas Goaziou
Re: [O] Should org-get-outline-path strip dedicated targets?
Hello, timor writes: > If I have a document like this: > > * some header <> > ** some subtree > *** some entry > > Then calling org-get-outline-path on the deepest headline returns > ("some header <>" "some subtree") > > I don't know what exactly org-get-outline-path is used for in org > mode, but for what I want to use it, I will remove the > "<>" part manually. > > I was just wondering if maybe this should already be done in > org-get-outline-path itself, since links are also replaced by their > description according to the documentation. Links and targets are different in the sense that the former has an invisible part, unlike to the latter. `org-get-outline-path' simply removes that part since users probably do not distinguish their headings using hidden characters. OTOH, it could make sense to preserve targets, e.g., in the following: * Doc 1 ** Introduction <> ... * Doc 2 ** Introduction <> ... Eventually, albeit tangential to the problem, I think using a CUSTOM_ID is probably better than inserting a target in a headline. Regards, -- Nicolas Goaziou