Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el
Hi Chuck, Thanks for pointing that out, this all makes a lot more sense now. Prior to this patch ':includes' and ':defines' seem to work in the property list (as described in the old version of the org manual), so (I think) the updated version of this patch also removes those usages (for :defines, :includes), so you must use the new format described in the manual. Speaking of the manual, that entry managed to get me very confused at first, as it didn't seem to work for me, but then I realized that there is actually a typo in the NEWS entry, the second line should be: :header-args+: :var a=1 b=2 I'm not sure what the policy is on changing old NEWS entries, but I've attached a small patch to fix the typo. Let me know if you have any other feedback! :) -Jay On Mon, Jul 31, 2017 at 8:34 AM, Charles C. Berrywrote: > On Mon, 31 Jul 2017, Jay Kamat wrote: > >> Hello! >> >> Sorry for the late reply, I was pretty busy last week. An updated >> patch is attached! >> > > [snip] > >> >>> Using `org-entry-get' is no longer supported. You can replace the `or' >>> with >>> >>> (cdr (assq :namespaces params)) >> >> >> Done, I also replaced the other uses of 'org-entry-get' around the one >> I modified >> > > I don't think Nicolas meant that `org-entry-get' is no longer supported > literally. I think he was referring to using it to enable using Babel header > arguments as property names (as it did in your code). See: > > http://orgmode.org/Changes.html#org343de47 > > > HTH, > > Chuck From 65c8add92842c2e547b13d5c6fb2485e7fdbf2db Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 31 Jul 2017 22:47:33 -0700 Subject: [PATCH] ORG-NEWS: Fix a small typo in new org babel header example * etc/ORG-NEWS (Using): Fix typo in babel :header-args: conversion TINYCHANGE --- etc/ORG-NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index d7bd3e2ce7..5acaf7ee52 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -582,7 +582,7 @@ should be written instead ,* Headline :PROPERTIES: :header-args: :exports code -:header-args: :var a=1 b=2 +:header-args+: :var a=1 b=2 :header-args+: :var c=3 :END: #+END_EXAMPLE -- 2.11.0
Re: [O] [RFC] Shrink columns dynamically
Nicolas Goaziouwrites: > Moreover, I added two new STARTUP keywords: "shrink" and "noshrink", > which allow to apply aforementioned `org-table-shrink' command on all > tables upon opening a document. Not that "align" no longer toggle column > width. Hi Nicolas, I'm late to this conversation, but thank you for keeping the width cookies. I have a large Org file with some large tables with wide columns, and being able to restrict the width of one of the columns is essential to keeping others on the screen. My only feedback here is that maybe the startup keywords would be more descriptive if they were something like "table-shrink" or "column-shrink". I could imagine some new Org users conflating "folded" and "shrink" until they have used a more advanced feature like table column width cookies. :) Thanks, Adam
Re: [O] calculate weekday of birthday
Salome Soedergranwrites: > Hi everybody > > How can I make orgmode to give me the weekday of a specific date? > I have a list (org-table) with students' names and dates of birth that looks > like this: > |--+---+--+---+-+-+-| > | Name | Firstname | year | month | day | age | weekday | > |--+---+--+---+-+-+-| > | Doe | John | 2001 |05 | 21 | 16 | | > |--+---+--+---+-+-+-| > > #+TBLFM: @2$8..@>$6='(+ (- 2017 $5) (if(> $4 7) 0 1));L:: > > I have a formula to make orgtable calculate the age the student > reaches in the current academic year (Aug-July) but I don't know how > to get the birthday's weekday in the current year. Can anybody help > me? Thanks a lot in advance! > > Best, Salome > > , | org-day-of-week is a compiled Lisp function in | ‘../org-mode/lisp/org-clock.el’. | | (org-day-of-week DAY MONTH YEAR) | | Returns the day of the week as an integer. ` You'll have to translate that into a name: 0 = Sunday ... 6 = Saturday I believe. -- Nick
Re: [O] calculate weekday of birthday
Hi Salome, The decode-time function returns a list that includes the day-of-week as a number from 0-6. You'll have to give it an encoded time, which you can use encode-time for. A wild idea would be to use the shell "date" command, which is overkill for this, but I just happen to have this code handy, in case you or anyone else might find it useful: #+BEGIN_SRC elisp (defmacro call-process-with-args (process args) "Return results of running PROCESS with ARGS." (declare (indent defun)) `(with-temp-buffer (unless (= 0 (call-process ,process nil t nil ,@args)) (user-error ,(concat process " failed"))) (buffer-substring-no-properties (point-min) (point-max (defun get-day-of-week (string) "Parse STRING with the shell `date' command and return day-of-week as string." (call-process-with-args "date" "-d" string "+%a")) #+END_SRC
[O] Commit "org-agenda: Support for dimming..." breaks agenda display
Hi all, I updated Org recently and noticed that the agenda display looks very broken, especially in `org-agenda-log-mode'. I did a bisect; reverting commit 912a385518bcf2e320cc161d573ad329111de6c7 fixes it. Anyone else have this problem? regards, Oleh
Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.
This patch fixes this: >From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001 From: Kaushal ModiDate: Mon, 31 Jul 2017 14:30:40 -0400 Subject: [PATCH] Respect :with-title in ox-html * lisp/ox-html.el (org-html--build-meta-info): Do not insert tag in HTML export if :with-title property is nil. Example: by setting #+OPTIONS: title:nil Reported by: Ian --- lisp/ox-html.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index aeb38ebc10..08381d0c19 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1812,7 +1812,8 @@ INFO is a plist used as a communication channel." viewport-options ", ")) info) "\n"))) - (format "%s\n" title) + (when (plist-get info :with-title) + (format "%s\n" title)) (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\"" info) "\n" (and (org-string-nw-p author) -- 2.13.0 OK to commit to maint? On Mon, Jul 31, 2017 at 2:24 PM Kaushal Modi wrote: > > C-c C-e h H (html export to buffer) gives: > > = > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;> > http://www.w3.org/1999/xhtml; lang="en" xml:lang="en"> > > > > > This Title Must Not Export > == == > -- Kaushal Modi
Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.
On Mon, Jul 31, 2017 at 1:37 PMwrote: > I don't know if this is intended behaviour or not. > > Save the following as setuop.org > > #+BEGIN_SRC > > :SETUP: > #+LANGUAGE: en > #+DRAWERS: SETUP NOTES PROPERTIES > #+OPTIONS: author:nil date:nil d:nil title:nil ':t tex:t > #+STARTUP: content indent > > :END: > > #+END_SRC > I haven't seen that kind of property-drawer like syntax for setupfile before (:SETUP: .. :END:).. But looks like that's just the way you represented in this email? > Now include setup.org in test.org > > #+BEGIN_SRC > > #+SETUPFILE: ./setup.org > #+TITLE: A Three Second Route. > * A Three Second Route. > Some text. > > > #+END_SRC > > Exporting as html result in: > > #+BEGIN_SRC html > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;> > http://www.w3.org/1999/xhtml; lang="en" xml:lang="en"> > > > > > A Three Second Route. > > #+END_SRC > > Note that TITLE is exported. > > Using org-master bb6e40b08655cc2f33bdf6f9 > I can recreate this issue when using the HTML backed, not when using the ascii backend. My example: == setup.org == #+OPTIONS: title:nil author:nil toc:nil = == example.org = #+SETUPFILE: ./setup.org #+TITLE: This Title Must Not Export * Heading 1 Some text. = C-c C-e t A (ascii export to buffer) gives: = 1 Heading 1 === Some text. = C-c C-e h H (html export to buffer) gives: = http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;> http://www.w3.org/1999/xhtml; lang="en" xml:lang="en"> This Title Must Not Export == == -- Kaushal Modi
[O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.
I don't know if this is intended behaviour or not. Save the following as setuop.org #+BEGIN_SRC :SETUP: #+LANGUAGE: en #+DRAWERS: SETUP NOTES PROPERTIES #+OPTIONS: author:nil date:nil d:nil title:nil ':t tex:t #+STARTUP: content indent :END: #+END_SRC Now include setup.org in test.org #+BEGIN_SRC #+SETUPFILE: ./setup.org #+TITLE: A Three Second Route. * A Three Second Route. Some text. #+END_SRC Exporting as html result in: #+BEGIN_SRC html http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;> http://www.w3.org/1999/xhtml; lang="en" xml:lang="en"> A Three Second Route. #+END_SRC Note that TITLE is exported. Using org-master bb6e40b08655cc2f33bdf6f9 Ian.
Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el
On Mon, 31 Jul 2017, Jay Kamat wrote: Hello! Sorry for the late reply, I was pretty busy last week. An updated patch is attached! [snip] Using `org-entry-get' is no longer supported. You can replace the `or' with (cdr (assq :namespaces params)) Done, I also replaced the other uses of 'org-entry-get' around the one I modified I don't think Nicolas meant that `org-entry-get' is no longer supported literally. I think he was referring to using it to enable using Babel header arguments as property names (as it did in your code). See: http://orgmode.org/Changes.html#org343de47 HTH, Chuck
Re: [O] Bug: http://orgmode.org/cgit.cgi/org-mode.git/ - 502 Bad Gateway
Hi, it works again now. Best regards Robert On Mon, 31 Jul 2017 18:50:44 +0800 Chunyang Xuwrote: > I visited the URL by clicking "cgit" on http://orgmode.org/. > > >
[O] calculate weekday of birthday
Hi everybody How can I make orgmode to give me the weekday of a specific date? I have a list (org-table) with students' names and dates of birth that looks like this: |--+---+--+---+-+-+-| | Name | Firstname | year | month | day | age | weekday | |--+---+--+---+-+-+-| | Doe | John | 2001 |05 | 21 | 16 | | |--+---+--+---+-+-+-| #+TBLFM: @2$8..@>$6='(+ (- 2017 $5) (if(> $4 7) 0 1));L:: I have a formula to make orgtable calculate the age the student reaches in the current academic year (Aug-July) but I don't know how to get the birthday's weekday in the current year. Can anybody help me? Thanks a lot in advance! Best, Salome
[O] Bug: http://orgmode.org/cgit.cgi/org-mode.git/ - 502 Bad Gateway
I visited the URL by clicking "cgit" on http://orgmode.org/.
Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el
Hello! Sorry for the late reply, I was pretty busy last week. An updated patch is attached! > I suggest to add the following to "ob-C.el" so that `org-lint' can issue > a warning whenever :namespaces is used in a C block. Done. I needed to tweak the code a bit though to get it to work and to prevent flagging valid C headers as errors with org lint. > Using `org-entry-get' is no longer supported. You can replace the `or' > with > > (cdr (assq :namespaces params)) Done, I also replaced the other uses of 'org-entry-get' around the one I modified > Nitpick: I would put the "\n" on another line. I agree, and done :) > Could you also provide an ORG-NEWS entry for the feature? Done. I'm not sure if it went in the right place and if it's formatted correctly though, so can you give that a look over to make sure it looks good? Thanks again for taking the time to review this for me :D Let me know if you spot anything fishy or wrong. Also, RE: Copyright, this is the form I need to send, correct? http://orgmode.org/request-assign-future.txt -Jay On Sun, Jul 23, 2017 at 7:44 AM, Nicolas Goaziouwrote: > Hello, > > Jay Kamat writes: > >> However, it would be nice to add a "using namespace std" to this >> source code block, so it can become: >> >> #+BEGIN_SRC C++ :includes :namespaces std >> cout << "Hello world\n"; >> #+END_SRC >> >> >> Which makes it cleaner and easier to read, especially for very short >> code snippets, using a bunch of std tools. > > Good idea. > >> One concern that I have is that "using namespace *;" is only available >> in C++ and not C, but there isn't an easy way I could find to limit >> it's usage to only C++ blocks without a bunch of restructuring, so >> this will fail if you attempt to set a namespace on a plain C block. > > I suggest to add the following to "ob-C.el" so that `org-lint' can issue > a warning whenever :namespaces is used in a C block. > > (defconst org-babel-header-args:C '((includes . :any)) > "C-specific header arguments.") > > (defconst org-babel-header-args:C++ > `(,(append '((namespaces . :any)) > org-babel-header-args:C)) > "C++-specific header arguments.") > >> Also, this contribution puts me very close to the 15 line limit before >> I need to get FSF papers signed. I intend to sign papers soon, but I'm >> a little busy right now, and I'll get around to submitting the request >> later on. > > Thank you. FYI, in many cases, the whole process is very quick and not > time-consuming. > >> Subject: [PATCH] ob-C.el: Add support for specifying namespaces in C/C++ >> >> * lisp/ob-C.el (org-babel-C-expand-C): Add a :namespaces export option >> to C++ org babel blocks. Namespaces specified here will be added to >> the file in the format 'using namespace %s;'. Multiple namespaces >> can be specified, separated by spaces. > > Some comments follow. > >> + (namespaces (org-babel-read >> + (or (cdr (assq :namespaces params)) >> + (org-entry-get nil "namespaces" t)) >> +nil))) > > Using `org-entry-get' is no longer supported. You can replace the `or' > with > > (cdr (assq :namespaces params)) > >> + ;; namespaces >> + (mapconcat >> + (lambda (inc) (format "using namespace %s;" inc)) >> + namespaces "\n") > > Nitpick: I would put the "\n" on another line. > > Could you also provide an ORG-NEWS entry for the feature? > > Regards, > > -- > Nicolas Goaziou From bf08fb4f89024428a95615bdfede86e3c883d87c Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 16 Jul 2017 21:55:24 -0700 Subject: [PATCH] ob-C.el: Add support for specifying namespaces in C/C++ * lisp/ob-C.el (org-babel-C-expand-C): Add a :namespaces export option to C++ org babel blocks. Namespaces specified here will be added to the file in the format 'using namespace %s;'. Multiple namespaces can be specified, separated by spaces. TINYCHANGE --- etc/ORG-NEWS | 14 ++ lisp/ob-C.el | 34 -- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 936ecc36b2..1d08f9ba9d 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -200,6 +200,20 @@ To use =vertica= in an sql =SRC_BLK= set the =:engine= like this: SELECT * FROM nodes; ,#+END_SRC #+END_EXAMPLE + C++: New header ~:namespaces~ + +The new ~:namespaces~ export option can be used to specify namespaces +to be used within a C++ org source block. Its usage is similar to +~:includes~, in that it can accept multiple, space-separated +namespaces to use. This header is equivalent to adding ~using +namespace ;~ in the source block. Here is a "Hello World" in C++ +using ~:namespaces~: + +#+begin_example + ,#+BEGIN_SRC C++ :results output :namespaces std :includes +cout << "Hello World" << endl; + ,#+END_SRC +#+end_example *** New ~function~ scope argument for
[O] Bug: Git repository doesn't ignore contributed lisp/*.el files [9.0.9 (release_9.0.9-690-g27e5be @ /home/cassou/.emacs.d/lib/org/lisp/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. Hi, I've just cloned the repository and ran this command: make compile autoloads info ORG_ADD_CONTRIB="org-notmuch" Now, the lisp/ directory contains both org-notmuch.el and org-notmuch.elc. My problem is that the former is not ignored by git and my repository is now dirty. Would it be possible to make git ignore all lisp/*.el files for files that come from contrib/lisp? Thanks Emacs : GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.11) of 2017-04-26 Package: Org mode version 9.0.9 (release_9.0.9-690-g27e5be @ /home/cassou/.emacs.d/lib/org/lisp/) -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill