forked from mirrors/org-mode
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
This commit is contained in:
commit
8628e6e8a8
|
@ -128,22 +128,28 @@ options are taken from `org-babel-default-header-args'."
|
|||
|
||||
(defun org-babel-exp-code (info type)
|
||||
(let ((lang (first info))
|
||||
(body (second info))
|
||||
(switches (fourth info))
|
||||
(name (fifth info))
|
||||
(args (sixth info))
|
||||
(function-def-line ""))
|
||||
(body (second info))
|
||||
(switches (fourth info))
|
||||
(name (fifth info))
|
||||
(args (mapcar #'cdr
|
||||
(remove-if-not (lambda (el) (eq :var (car el))) (third info)))))
|
||||
(case type
|
||||
('inline (format "=%s=" (second info)))
|
||||
('inline (format "=%s=" body))
|
||||
('block
|
||||
(let ((str (format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body
|
||||
(if (string-match "\n$" body) "" "\n"))))
|
||||
(add-text-properties 0 (length str) (list 'org-caption name) str)
|
||||
str))
|
||||
('lob (save-excursion
|
||||
(re-search-backward org-babel-lob-one-liner-regexp)
|
||||
(format "#+BEGIN_SRC org-babel-lob\n%s\n#+END_SRC"
|
||||
(first (org-babel-lob-get-info))))))))
|
||||
(if (string-match "\n$" body) "" "\n"))))
|
||||
(add-text-properties 0 (length str)
|
||||
(list 'org-caption
|
||||
(format "%s(%s)"
|
||||
name (mapconcat #'identity args ", ")))
|
||||
str) str))
|
||||
('lob
|
||||
(let ((call-line (and (string-match "results=" (car args))
|
||||
(substring (car args) (match-end 0)))))
|
||||
(cond
|
||||
((eq backend 'html)
|
||||
(format "\n#+HTML: <label class=\"org-src-name\">%s</label>\n" call-line))
|
||||
((t (format ": %s\n" call-line)))))))))
|
||||
|
||||
(defun org-babel-exp-results (info type)
|
||||
(let ((lang (first info))
|
||||
|
|
|
@ -104,9 +104,5 @@ the word 'call'."
|
|||
(concat ":var results=" (mapconcat #'identity info " ")))))))
|
||||
(org-babel-execute-src-block nil (list "emacs-lisp" "results" params))))
|
||||
|
||||
(define-generic-mode org-babel-lob-mode
|
||||
'("#") (list org-babel-function-def-export-keyword) nil nil nil
|
||||
"Major mode for fontification of library of babel lines on export")
|
||||
|
||||
(provide 'org-babel-lob)
|
||||
;;; org-babel-lob.el ends here
|
||||
|
|
|
@ -2456,12 +2456,16 @@ INDENT was the original indentation of the block."
|
|||
(setq rtn
|
||||
(concat
|
||||
(if caption
|
||||
(format "<label class=\"org-src-name\">%s &equiv</label>"
|
||||
caption)
|
||||
(concat
|
||||
"<div class=\"org-src-container\">"
|
||||
(format
|
||||
"<label class=\"org-src-name\">%s</label>"
|
||||
caption))
|
||||
"")
|
||||
(replace-match
|
||||
(format "<pre class=\"src src-%s\">\n" lang)
|
||||
t t rtn)))))
|
||||
(format "<pre class=\"src src-%s\">\n" lang)
|
||||
t t rtn)
|
||||
(if caption "</div>" "")))))
|
||||
(if textareap
|
||||
(setq rtn (concat
|
||||
(format "<p>\n<textarea cols=\"%d\" rows=\"%d\" overflow-x:scroll >\n"
|
||||
|
|
Loading…
Reference in New Issue