emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: ob-clojure tangling does not handle comments correctly [8.2.5h (8.2.5h-6-g8e1386-elpa @ /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)]
@ 2014-02-06  6:03 Lee Hinman
  2014-02-06 16:32 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Hinman @ 2014-02-06  6:03 UTC (permalink / raw)
  To: emacs-orgmode

When tangling a block like:

#+BEGIN_SRC clojure :tangle foo.clj
(println "foo")
;; My comment
#+END_SRC

The tangled code looks like:

(let [org-mode-print-catcher (java.io.StringWriter.)]
(clojure.pprint/with-pprint-dispatch clojure.pprint/code-dispatch
(clojure.pprint/pprint (do (println "foo")
;; My comment) org-mode-print-catcher) (str org-mode-print-catcher)))

Which is invalid because of the commented line (commenting out more than
intended). There needs to be an extra newline after the tangled
content/comment.


Emacs  : GNU Emacs 24.3.50.1 (x86_64-apple-darwin13.0.0, NS
apple-appkit-1265.00)
 of 2013-12-26 on Xanadu.local
Package: Org-mode version 8.2.5h (8.2.5h-6-g8e1386-elpa @
/usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)

current state:
==============
(setq
 org-export-backends '(ascii html icalendar latex md)
 org-export-babel-evaluate nil
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
                      org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-agenda-diary-file "~/diary"
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-imenu-depth 3
 org-agenda-start-on-weekday nil
 org-confirm-shell-link-function 'yes-or-no-p
 org-agenda-sticky t
 org-agenda-custom-commands '(("N" "Notes" tags "NOTE"
                               ((org-agenda-overriding-header "Notes")
                                (org-tags-match-list-sublevels t))
                               )
                              ("h" "Habits" tags-todo "STYLE=\"habit\""
                               ((org-agenda-overriding-header "Habits")
                                (org-agenda-sorting-strategy
                                 (quote (todo-state-down effort-up
category-keep)))
                                )
                               )
                              (" " "Agenda"
                               ((agenda "" nil)
                                (tags "REFILE"
                                 ((org-agenda-overriding-header "Tasks
to Refile")
                                  (org-tags-match-list-sublevels nil))
                                 )
                                (tags-todo "-CANCELLED/!"
                                 ((org-agenda-overriding-header "Stuck
Projects")
                                  (org-agenda-skip-function (quote
bh/skip-non-stuck-projects))
                                  (org-agenda-sorting-strategy
                                   (quote (priority-down category-keep)))
                                  )
                                 )
                                (tags-todo "-HOLD-CANCELLED/!"
                                 ((org-agenda-overriding-header "Projects")
                                  (org-agenda-skip-function (quote
bh/skip-non-projects))
                                  (org-agenda-sorting-strategy
                                   (quote (priority-down category-keep)))
                                  )
                                 )
                                (tags-todo "-CANCELLED/!NEXT"
                                 ((org-agenda-overriding-header "Project
Next Tasks")
                                  (org-agenda-skip-function
                                   (quote
bh/skip-projects-and-habits-and-single-tasks))
                                  (org-tags-match-list-sublevels t)
                                  (org-agenda-todo-ignore-scheduled
                                   bh/hide-scheduled-and-waiting-next-tasks)
                                  (org-agenda-todo-ignore-deadlines
                                   bh/hide-scheduled-and-waiting-next-tasks)
                                  (org-agenda-todo-ignore-with-date
                                   bh/hide-scheduled-and-waiting-next-tasks)
                                  (org-agenda-sorting-strategy
                                   (quote (priority-down todo-state-down
effort-up category-keep)))
                                  )
                                 )
                                (tags-todo "-REFILE-CANCELLED-WAITING/!"
                                 ((org-agenda-overriding-header
                                   (if (marker-buffer
org-agenda-restrict-begin)
                                    "Project Subtasks" "Standalone Tasks")
                                   )
                                  (org-agenda-skip-function (quote
bh/skip-project-tasks-maybe))
                                  (org-agenda-todo-ignore-scheduled
                                   bh/hide-scheduled-and-waiting-next-tasks)
                                  (org-agenda-todo-ignore-deadlines
                                   bh/hide-scheduled-and-waiting-next-tasks)
                                  (org-agenda-todo-ignore-with-date
                                   bh/hide-scheduled-and-waiting-next-tasks)
                                  (org-agenda-sorting-strategy (quote
(category-keep))))
                                 )
                                (tags-todo "-CANCELLED+WAITING/!"
                                 ((org-agenda-overriding-header "Waiting
and Postponed Tasks")
                                  (org-agenda-skip-function (quote
bh/skip-stuck-projects))
                                  (org-tags-match-list-sublevels nil)
                                  (org-agenda-todo-ignore-scheduled
(quote future))
                                  (org-agenda-todo-ignore-deadlines
(quote future)))
                                 )
                                (tags "-REFILE/"
                                 ((org-agenda-overriding-header "Tasks
to Archive")
                                  (org-agenda-skip-function (quote
bh/skip-non-archivable-tasks))
                                  (org-tags-match-list-sublevels nil))
                                 )
                                )
                               nil)
                              )
 org-return-follows-link t
 org-todo-keyword-faces '(("STARTED" :foreground "deep sky blue" :weight
bold)
                          ("DONE" :foreground "SpringGreen1" :weight bold)
                          ("WAITING" :foreground "orange" :weight bold)
                          ("INPROGRESS" :foreground "cyan" :weight bold)
                          ("NEEDSREVIEW" :foreground "#edd400" :weight
bold))
 org-agenda-include-diary t
 org-startup-indented t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-from-is-user-regexp "\\<Lee Hinman\\>"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-dim-blocked-tasks nil
 org-mode-hook '(er/add-org-mode-expansions yas-minor-mode-on
                 (lambda nil (define-key org-mode-map [C-tab] (quote
other-window))
                  (define-key org-mode-map [C-S-tab]
                   (function (lambda nil (interactive) (other-window -1))))
                  )
                 turn-on-auto-fill
                 #[nil "\300\301\302\303\304$\207"
                   [org-add-hook change-major-mode-hook
org-show-block-all append local] 5]
                 #[nil "\300\301\302\303\304$\207"
                   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-refile-targets '((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9))
 org-agenda-cmp-user-defined 'bh/agenda-sort
 org-outline-path-complete-in-steps nil
 org-stuck-projects '("" nil nil "")
 org-agenda-compact-blocks t
 org-agenda-sorting-strategy '((agenda habit-down time-up
user-defined-up priority-down effort-up
                                category-keep)
                               (todo category-up priority-down effort-up)
                               (tags category-up priority-down
effort-up) (search category-up))
 org-agenda-time-grid '((daily today remove-match) #("----------------"
0 16 (org-heading t))
                        (900 1100 1300 1500 1700))
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-refile-use-outline-path t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-archive-location "%s_archive::* Archived Tasks"
 org-agenda-insert-diary-extract-time t
 org-refile-allow-creating-parent-nodes 'confirm
 org-todo-keywords '((sequence "TODO(t)" "STARTED(s)" "INPROGRESS(i)"
"WAITING(w)" "|" "DONE(d)")
                     (sequence "TODO(t)" "INPROGRESS(i)"
"NEEDSREVIEW(n)" "|" "DONE(d)"))
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-habit
org-info org-irc org-mhe
               org-rmail org-w3m)
 org-agenda-window-setup 'current-window
 org-babel-tangle-lang-exts '(("python" . "py") ("ruby" . "rb")
("clojure" . "clj")
                              ("emacs-lisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-edit-src-content-indentation 0
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-startup-truncated nil
 org-cycle-separator-lines 0
 org-completion-use-ido t
 org-babel-load-languages '((emacs-lisp . t) (clojure . t) (sh . t)
(ruby . t) (python . t)
                            (gnuplot . t))
 org-agenda-files '("~/org/todo.org" "~/org/notes.org"
"~/org/journal.org" "~/org/work.org"
                    "~/org/refile.org" "~/org/meetings.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-confirm-babel-evaluate nil
 org-src-fontify-natively t
 org-tag-alist '(("oss" . 111) ("home" . 104) ("work" . 119) ("book" . 98))
 )

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: ob-clojure tangling does not handle comments correctly [8.2.5h (8.2.5h-6-g8e1386-elpa @ /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)]
  2014-02-06  6:03 Bug: ob-clojure tangling does not handle comments correctly [8.2.5h (8.2.5h-6-g8e1386-elpa @ /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)] Lee Hinman
@ 2014-02-06 16:32 ` Bastien
  2014-02-06 17:08   ` Lee Hinman
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2014-02-06 16:32 UTC (permalink / raw)
  To: Lee Hinman; +Cc: emacs-orgmode

Hi Lee,

Lee Hinman <lee@writequit.org> writes:

> When tangling a block like:
>
> #+BEGIN_SRC clojure :tangle foo.clj
> (println "foo")
> ;; My comment
> #+END_SRC
>
> The tangled code looks like:
>
> (let [org-mode-print-catcher (java.io.StringWriter.)]
> (clojure.pprint/with-pprint-dispatch clojure.pprint/code-dispatch
> (clojure.pprint/pprint (do (println "foo")
> ;; My comment) org-mode-print-catcher) (str org-mode-print-catcher)))
>
> Which is invalid because of the commented line (commenting out more than
> intended). There needs to be an extra newline after the tangled
> content/comment.

Can you try with latest ob-clojure.el from the master branch?
We fixed a few things recently, and the example works fine for
me.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: ob-clojure tangling does not handle comments correctly [8.2.5h (8.2.5h-6-g8e1386-elpa @ /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)]
  2014-02-06 16:32 ` Bastien
@ 2014-02-06 17:08   ` Lee Hinman
  2014-02-06 21:46     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Hinman @ 2014-02-06 17:08 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

On 2/6/14, 9:32 AM, Bastien wrote:
> Can you try with latest ob-clojure.el from the master branch?
> We fixed a few things recently, and the example works fine for
> me.

I tried it running from git (org-version returns "Org-mode version
8.2.3a (release_8.2.3a @ /Users/hinmanm/src/elisp/org-mode/lisp/)")

I'm still getting it tangled as

(let [org-mode-print-catcher (java.io.StringWriter.)]
(clojure.pprint/with-pprint-dispatch clojure.pprint/code-dispatch
(clojure.pprint/pprint (do (println "foo")
;; My comment) org-mode-print-catcher) (str org-mode-print-catcher)))

I did some bisecting on my dotfiles and determined it was caused by this
line:

(setq org-babel-default-header-args
      (cons '(:results . "code")
            (assq-delete-all :results org-babel-default-header-args)))


Which seems very strange to me, once I comment out that line the text is
tangled as just

(println "foo")
;; My comment

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: ob-clojure tangling does not handle comments correctly [8.2.5h (8.2.5h-6-g8e1386-elpa @ /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)]
  2014-02-06 17:08   ` Lee Hinman
@ 2014-02-06 21:46     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2014-02-06 21:46 UTC (permalink / raw)
  To: Lee Hinman; +Cc: emacs-orgmode

Lee Hinman <lee@writequit.org> writes:

> I tried it running from git (org-version returns "Org-mode version
> 8.2.3a (release_8.2.3a @ /Users/hinmanm/src/elisp/org-mode/lisp/)")

Latest release is 8.2.5h, later than the one reported.

> (setq org-babel-default-header-args
>       (cons '(:results . "code")
>             (assq-delete-all :results org-babel-default-header-args)))
>
>
> Which seems very strange to me, once I comment out that line the text is
> tangled as just
>
> (println "foo")
> ;; My comment

Okay, so this is in your config.  Maybe try latest Org to see if you
can keep your config?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-06 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06  6:03 Bug: ob-clojure tangling does not handle comments correctly [8.2.5h (8.2.5h-6-g8e1386-elpa @ /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/org/)] Lee Hinman
2014-02-06 16:32 ` Bastien
2014-02-06 17:08   ` Lee Hinman
2014-02-06 21:46     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).