Merge branch 'master' of orgmode.org:org-mode

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
Bastien Guerry 2012-08-12 23:01:52 +02:00
commit 16d7b71762
4 changed files with 88 additions and 56 deletions

View File

@ -379,55 +379,63 @@ used as a communication channel."
"Format HEADLINE as a frame. "Format HEADLINE as a frame.
CONTENTS holds the contents of the headline. INFO is a plist CONTENTS holds the contents of the headline. INFO is a plist
used as a communication channel." used as a communication channel."
(concat "\\begin{frame}" (let ((fragilep
;; Overlay specification, if any. If is surrounded by square ;; FRAGILEP is non-nil when HEADLINE contains an element
;; brackets, consider it as a default specification. ;; among `org-e-beamer-verbatim-elements'.
(let ((action (org-element-property :beamer-act headline))) (org-element-map headline org-e-beamer-verbatim-elements 'identity
(cond info 'first-match)))
((not action) "") (concat "\\begin{frame}"
((string-match "\\`\\[.*\\]\\'" action ) ;; Overlay specification, if any. If is surrounded by square
(org-e-beamer--normalize-argument action 'defaction)) ;; brackets, consider it as a default specification.
(t (org-e-beamer--normalize-argument action 'action)))) (let ((action (org-element-property :beamer-act headline)))
;; Options, if any. (cond
(let ((options ((not action) "")
;; Collect options from default value and headline's ((string-match "\\`\\[.*\\]\\'" action )
;; properties. Also add a label for links. (org-e-beamer--normalize-argument action 'defaction))
(append (t (org-e-beamer--normalize-argument action 'action))))
(org-split-string org-e-beamer-frame-default-options ;; Options, if any.
",") (let ((options
(let ((opt (org-element-property :beamer-opt headline))) ;; Collect options from default value and headline's
(and opt (org-split-string ;; properties. Also add a label for links.
;; Remove square brackets if user (append
;; provided them. (org-split-string org-e-beamer-frame-default-options
(and (string-match "^\\[?\\(.*\\)\\]?$" opt) ",")
(match-string 1 opt)) (let ((opt (org-element-property :beamer-opt headline)))
","))) (and opt (org-split-string
(list ;; Remove square brackets if user
(format "label=sec-%s" ;; provided them.
(mapconcat (and (string-match "^\\[?\\(.*\\)\\]?$" opt)
'number-to-string (match-string 1 opt))
(org-export-get-headline-number headline info) ",")))
"-")))))) (list
;; Change options list into a string. FRAGILEP is non-nil (format "label=sec-%s"
;; when HEADLINE contains an element among (mapconcat
;; `org-e-beamer-verbatim-elements'. 'number-to-string
(let ((fragilep (org-element-map (org-export-get-headline-number headline info)
headline org-e-beamer-verbatim-elements 'identity "-"))))))
info 'first-match))) ;; Change options list into a string.
(org-e-beamer--normalize-argument (org-e-beamer--normalize-argument
(mapconcat (mapconcat
'identity 'identity
(if (or (not fragilep) (member "fragile" options)) options (if (or (not fragilep) (member "fragile" options)) options
(cons "fragile" options)) (cons "fragile" options))
",") ",")
'option))) 'option))
;; Title. ;; Title.
(format "{%s}" (format "{%s}"
(org-export-data (org-element-property :title headline) (org-export-data (org-element-property :title headline)
info)) info))
"\n" "\n"
contents ;; The following workaround is required in fragile frames
"\\end{frame}")) ;; as Beamer will append "\par" to the beginning of the
;; contents. So we need to make sure the command is
;; separated from the contents by at least one space. If
;; it isn't, it will create "\parfirst-word" command and
;; remove the first word from the contents in the PDF
;; output.
(if (not fragilep) contents
(replace-regexp-in-string "\\`\n*" "\\& " contents))
"\\end{frame}")))
(defun org-e-beamer--format-block (headline contents info) (defun org-e-beamer--format-block (headline contents info)
"Format HEADLINE as a block. "Format HEADLINE as a block.

View File

@ -73,6 +73,10 @@ MAKE_LOCAL_MK = $(BATCH) \
# Emacs must be started in lisp directory # Emacs must be started in lisp directory
BATCHL = $(BATCH) \ BATCHL = $(BATCH) \
--eval '(add-to-list '"'"'load-path ".")' --eval '(add-to-list '"'"'load-path ".")'
ELINTL = $(BATCHL) \
--eval '(load "elint")'
ELINTF = --eval '(elint-initialize t)' \
--eval '(elint-file "./$$(el)")'
# How to generate org-install.el # How to generate org-install.el
MAKE_ORG_INSTALL = $(BATCHL) \ MAKE_ORG_INSTALL = $(BATCHL) \
@ -132,9 +136,12 @@ SUDO = sudo
# INSTALL_INFO = ginstall-info # Debian: avoid harmless warning message # INSTALL_INFO = ginstall-info # Debian: avoid harmless warning message
INSTALL_INFO = install-info INSTALL_INFO = install-info
# target variant for 'compile' # target method for 'compile'
# _COMPILE_ = single # one Emacs process per compilation
# _COMPILE_ = source # ditto, but remove compiled file immediately
# _COMPILE_ = slint1 # possibly elicit more warnings
# _COMPILE_ = slint2 # possibly elicit even more warnings
_COMPILE_ = dirall _COMPILE_ = dirall
# (w/ slowdown compared to default variant)
# _COMPILE_ = single # 4x one Emacs process per compilation
# _COMPILE_ = source # 5x ditto, but remove compiled file immediately
# _COMPILE_ = slint1 # 3x possibly elicit more warnings
# _COMPILE_ = slint2 # 7x possibly elicit even more warnings
# _COMPILE_ = slint3 # 25x run elint in a single Emacs process
# _COMPILE_ = slint4 # 275x run elint in one Emacs process per source file

View File

@ -11,7 +11,9 @@ LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc)) LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
.PHONY: all compile compile-dirty \ .PHONY: all compile compile-dirty \
compile-single compile-source compile-slint1 compile-slint2 \ dirall source slint1 slint3 slint4 \
compile-single compile-source \
compile-slint1 compile-slint2 compile-slint3 compile-slint4 \
autoloads \ autoloads \
install clean cleanauto cleanall cleanelc clean-install install clean cleanauto cleanall cleanelc clean-install
@ -19,15 +21,30 @@ LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
all compile compile-dirty:: autoloads all compile compile-dirty:: autoloads
$(MAKE) compile-$(_COMPILE_) $(MAKE) compile-$(_COMPILE_)
compile-dirall: compile-dirall: dirall
@$(ELCDIR)
compile-single: $(LISPC) compile-single: $(LISPC)
compile-source: cleanelc compile-source: source dirall
compile-slint1: dirall slint1
compile-slint2: source dirall slint1
compile-slint3: slint3 dirall
compile-slint4: slint4 dirall
# internal
dirall:
@$(info ==================== $@ ====================)
@$(ELCDIR)
source: cleanelc
@$(info ==================== $@ ====================)
@$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);) @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
compile-slint1: compile-dirall slint1:
@$(info ==================== $@ ====================)
@$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);) @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
compile-slint2: slint3:
$(MAKE) compile-source compile-slint1 @$(info ==================== $@ ====================)
-@$(ELINTL) $(foreach el,$(LISPF),$(ELINTF))
slint4:
@$(info ==================== $@ ====================)
-@$(foreach el,$(LISPF),$(ELINTL) $(ELINTF);)
%.elc: %.el %.elc: %.el
@$(info Compiling single $(abspath $<)...) @$(info Compiling single $(abspath $<)...)

View File

@ -35,7 +35,7 @@ CONF_BASE = EMACS DESTDIR
CONF_DEST = lispdir infodir datadir testdir CONF_DEST = lispdir infodir datadir testdir
CONF_TEST = BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA CONF_TEST = BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA
CONF_EXEC = CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO CONF_EXEC = CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
CONF_CALL = BATCH BATCHL ELCDIR BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION CONF_CALL = BATCH BATCHL ELCDIR ELINTL ELINTF BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
config-eol:: EOL = \# config-eol:: EOL = \#
config-eol:: config-all config-eol:: config-all
config config-all:: config config-all::