Merge branch 'maint' into emacs-sync

This commit is contained in:
Kyle Meyer 2018-01-07 00:16:11 -05:00
commit 7f43614f2b
21 changed files with 383 additions and 143 deletions

View File

@ -12,7 +12,7 @@ development.
Anyone can get a clone of the current repository state using
the command
git clone git://orgmode.org/org-mode.git
git clone https://code.orgmode.org/bzg/org-mode.git
Having a clone is sufficient to start hacking and to produce
patches that can easily and consistently be applied to the
@ -23,19 +23,19 @@ development.
git clone git://repo.or.cz/org-mode.git
3. People who are interested to participate in the Org mode
3. People who are interested in participating to the Org mode
development can do so by sending patches to this address:
[[mailto:emacs-orgmode@gnu.org][emacs-orgmode@gnu.org]]
4. An interested developer can also request push access to the
central repository by sending her/his user-info to the
maintainer of Org mode or the webmaster of orgmode.org.
central repository by creating an account on code.orgmode.org
and by sending her/his user info to the maintainer.
After you have been added as a user with push privileges,
clone the repository through ssh using
git clone orgmode@orgmode.org:org-mode.git
git clone git@code.orgmode.org:bzg/org-mode.git
By requesting push access, you acknowledge that you have read
and agreed with the following rules:
@ -65,24 +65,25 @@ development.
- Among other things, Org mode is widely appreciated because
of its simplicity, cleanness and consistency. We should try
hard to preserve this and I would like to ask everyone to
keep this in mind when developing changes.
hard to preserve this and ask everyone to keep this in mind
when developing changes.
* The contrib directory
* The contrib/ directory
The git repository contains a contrib directory. This directory
The git repository contains a =contrib/= directory. This directory
is the playing field for any developer, also people who have not
(yet) signed the papers with the FSF. You are free to add files
to this directory, implementing extensions, new link types etc.
Also non-Lisp extensions like scripts to process Org files in
different ways are welcome in this directory. You should provide
documentation with your extensions, at least in the form of
commentary in the file, better on worg. Please discuss your
extensions on [[mailto:emacs-orgmode@gnu.org][emacs-orgmode@gnu.org]].
After files have been tested in contrib and found to be generally
useful, we may decide to clarify copyright questions and then
move the file into the Org mode core. This means they will be
moved up to the root directory and will also eventually be added
to GNU Emacs bzr repository. The final decision about this rests
with the maintainer.
After files have been tested in =contrib/= and found to be
generally useful, we may decide to clarify copyright questions
and then move the file into the Org mode core. This means they
will be moved up to the root directory and will also eventually
be added to GNU Emacs git repository. The final decision about
this rests with the maintainer.

View File

@ -2475,7 +2475,7 @@ in the buffer."
(point))))))
(defun org-babel-result-to-file (result &optional description)
"Convert RESULT into an `org-mode' link with optional DESCRIPTION.
"Convert RESULT into an Org link with optional DESCRIPTION.
If the `default-directory' is different from the containing
file's directory then expand relative links."
(when (stringp result)

View File

@ -58,9 +58,13 @@ returned is the value of the last form in BODY. Assume that
point is at the beginning of the Babel block."
(declare (indent 1) (debug body))
`(let ((source (get-text-property (point) 'org-reference)))
(with-current-buffer org-babel-exp-reference-buffer
;; Source blocks created during export process (e.g., by other
;; source blocks) are not referenced. In this case, do not move
;; point at all.
(with-current-buffer (if source org-babel-exp-reference-buffer
(current-buffer))
(org-with-wide-buffer
(goto-char source)
(when source (goto-char source))
,@body))))
(defun org-babel-exp-src-block ()

View File

@ -39,9 +39,9 @@
;; directory).
;; Although it might seem more natural to use Emacs Lisp for most
;; Lisp-based programming tasks inside Org-Mode, an Emacs library
;; written in Emacs Lisp, PicoLisp has at least two outstanding
;; features that make it a valuable addition to Org-Babel:
;; Lisp-based programming tasks inside Org, an Emacs library written
;; in Emacs Lisp, PicoLisp has at least two outstanding features that
;; make it a valuable addition to Org Babel:
;; PicoLisp _is_ an object-oriented database with a Prolog-based query
;; language implemented in PicoLisp (Pilog). Database objects are

View File

@ -3563,7 +3563,7 @@ removed from the entry content. Currently only `planning' is allowed here."
txt))
(defun org-check-for-org-mode ()
"Make sure current buffer is in org-mode. Error if not."
"Make sure current buffer is in Org mode. Error if not."
(or (derived-mode-p 'org-mode)
(error "Cannot execute Org agenda command on buffer in %s"
major-mode)))
@ -4509,7 +4509,7 @@ is active."
(with-current-buffer buffer
(with-syntax-table (org-search-syntax-table)
(unless (derived-mode-p 'org-mode)
(error "Agenda file %s is not in `org-mode'" file))
(error "Agenda file %s is not in Org mode" file))
(let ((case-fold-search t))
(save-excursion
(save-restriction
@ -4774,7 +4774,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
rtnall (append rtnall rtn))
(with-current-buffer buffer
(unless (derived-mode-p 'org-mode)
(error "Agenda file %s is not in `org-mode'" file))
(error "Agenda file %s is not in Org mode" file))
(save-excursion
(save-restriction
(if (eq buffer org-agenda-restrict)
@ -5067,9 +5067,9 @@ of what a project is and how to check if it stuck, customize the variable
(defun org-agenda-cleanup-fancy-diary ()
"Remove unwanted stuff in buffer created by `fancy-diary-display'.
This gets rid of the date, the underline under the date, and
the dummy entry installed by `org-mode' to ensure non-empty diary for each
date. It also removes lines that contain only whitespace."
This gets rid of the date, the underline under the date, and the
dummy entry installed by Org mode to ensure non-empty diary for
each date. It also removes lines that contain only whitespace."
(goto-char (point-min))
(if (looking-at ".*?:[ \t]*")
(progn
@ -5214,7 +5214,7 @@ the documentation of `org-diary'."
(list (format "ORG-AGENDA-ERROR: No such org-file %s" file))
(with-current-buffer buffer
(unless (derived-mode-p 'org-mode)
(error "Agenda file %s is not in `org-mode'" file))
(error "Agenda file %s is not in Org mode" file))
(setq org-agenda-buffer (or org-agenda-buffer buffer))
(setf org-agenda-current-date date)
(save-excursion

View File

@ -1,6 +1,6 @@
;;; org-capture.el --- Fast note taking in Org -*- lexical-binding: t; -*-
;; Copyright (C) 2010-2017 Free Software Foundation, Inc.
;; Copyright (C) 2010-2018 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
@ -927,18 +927,24 @@ Store them in the capture property list."
(_ (error "Cannot find target ID \"%s\"" id))))
(`(file+headline ,path ,headline)
(set-buffer (org-capture-target-buffer path))
;; Org expects the target file to be in Org mode, otherwise
;; it throws an error. However, the default notes files
;; should work out of the box. In this case, we switch it to
;; Org mode.
(unless (derived-mode-p 'org-mode)
(error "Target buffer \"%s\" for file+headline not in Org mode"
(current-buffer)))
(org-display-warning
(format "Capture requirement: switching buffer %S to Org mode"
(current-buffer)))
(org-mode))
(org-capture-put-target-region-and-position)
(widen)
(goto-char (point-min))
(if (re-search-forward (format org-complex-heading-regexp-format
(regexp-quote headline))
nil t)
(goto-char (line-beginning-position))
(beginning-of-line)
(goto-char (point-max))
(or (bolp) (insert "\n"))
(unless (bolp) (insert "\n"))
(insert "* " headline "\n")
(beginning-of-line 0)))
(`(file+olp ,path . ,outline-path)

View File

@ -182,24 +182,28 @@ The number of levels is controlled by `org-inlinetask-min-level'."
(defun org-inlinetask-goto-end ()
"Go to the end of the inline task at point.
Return point."
Return point."
(save-match-data
(beginning-of-line)
(let* ((case-fold-search t)
(inlinetask-re (org-inlinetask-outline-regexp))
(task-end-re (concat inlinetask-re "END[ \t]*$")))
(inlinetask-re (org-inlinetask-outline-regexp))
(task-end-re (concat inlinetask-re "END[ \t]*$")))
(cond
((looking-at task-end-re))
((looking-at inlinetask-re)
(forward-line)
(cond
((looking-at task-end-re))
((looking-at inlinetask-re))
((org-inlinetask-in-task-p)
(re-search-forward inlinetask-re nil t))))
(t (re-search-forward inlinetask-re nil t)))
(end-of-line)
(point))))
((looking-at-p task-end-re)
(forward-line))
((looking-at-p inlinetask-re)
(forward-line)
(cond
((looking-at-p task-end-re) (forward-line))
((looking-at-p inlinetask-re))
((org-inlinetask-in-task-p)
(re-search-forward inlinetask-re nil t)
(forward-line))
(t nil)))
(t
(re-search-forward inlinetask-re nil t)
(forward-line)))))
(point))
(defun org-inlinetask-get-task-level ()
"Get the level of the inline task around.
@ -330,7 +334,9 @@ This function is meant to be used in `org-cycle-hook'."
(org-inlinetask-goto-end)))))
(`children
(save-excursion
(while (and (outline-next-heading) (org-inlinetask-at-task-p))
(while
(or (org-inlinetask-at-task-p)
(and (outline-next-heading) (org-inlinetask-at-task-p)))
(org-inlinetask-toggle-visibility)
(org-inlinetask-goto-end))))))

View File

@ -496,12 +496,6 @@ variable is initialized with `org-table-analyze'.")
(concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)")
"Match a reference that needs translation, for reference display.")
(defconst org-table-separator-space
(propertize " " 'display '(space :width 1))
"Space used around fields when aligning the table.
This space serves as a segment separator for the purposes of the
bidirectional reordering.")
(defmacro org-table-save-field (&rest body)
"Save current field; execute BODY; restore field.
Field is restored even in case of abnormal exit."
@ -650,17 +644,30 @@ nil When nil, the command tries to be smart and figure out the
(org-table-align))))
;;;###autoload
(defun org-table-import (file arg)
(defun org-table-import (file separator)
"Import FILE as a table.
The file is assumed to be tab-separated. Such files can be produced by most
spreadsheet and database applications. If no tabs (at least one per line)
are found, lines will be split on whitespace into fields."
The command tries to be smart and figure out the separator in the
following way:
- when each line contains a TAB, assume TAB-separated material
- when each line contains a comma, assume CSV material
- else, assume one or more SPACE characters as separator.
When non-nil, SEPARATOR specifies the field separator in the
lines. It can have the following values:
(4) Use the comma as a field separator
(16) Use a TAB as field separator
(64) Prompt for a regular expression as field separator
integer When a number, use that many spaces, or a TAB, as field separator
regexp When a regular expression, use it to match the separator."
(interactive "f\nP")
(or (bolp) (newline))
(unless (bolp) (insert "\n"))
(let ((beg (point))
(pm (point-max)))
(insert-file-contents file)
(org-table-convert-region beg (+ (point) (- (point-max) pm)) arg)))
(org-table-convert-region beg (+ (point) (- (point-max) pm)) separator)))
;;;###autoload
@ -888,10 +895,7 @@ edit. Full value is:\n"
;; Compute the formats needed for output of the table.
(let ((hfmt (concat indent "|"))
(rfmt (concat indent "|"))
(rfmt1 (concat org-table-separator-space
"%%%s%ds"
org-table-separator-space
"|"))
(rfmt1 " %%%s%ds |")
(hfmt1 "-%s-+"))
(dolist (l lengths (setq hfmt (concat (substring hfmt 0 -1) "|")))
(let ((ty (if (pop typenums) "" "-"))) ; Flush numbers right.
@ -1175,7 +1179,7 @@ to a number. In the case of a timestamp, increment by days."
(- (org-time-string-to-absolute txt)
(org-time-string-to-absolute txt-up)))
((string-match org-ts-regexp3 txt) 1)
((string-match "\\([-+]\\)?[0-9]+\\(?:\.[0-9]+\\)?" txt-up)
((string-match "\\([-+]\\)?\\(?:[0-9]+\\)?\\(?:\.[0-9]+\\)?" txt-up)
(- (string-to-number txt)
(string-to-number (match-string 0 txt-up))))
(t 1)))
@ -4320,14 +4324,14 @@ FACE, when non-nil, for the highlight."
;;;###autoload
(define-minor-mode orgtbl-mode
"The `org-mode' table editor as a minor mode for use in other modes."
"The Org mode table editor as a minor mode for use in other modes."
:lighter " OrgTbl" :keymap orgtbl-mode-map
(org-load-modules-maybe)
(cond
((derived-mode-p 'org-mode)
;; Exit without error, in case some hook functions calls this
;; by accident in org-mode.
(message "Orgtbl-mode is not useful in org-mode, command ignored"))
;; Exit without error, in case some hook functions calls this by
;; accident in Org mode.
(message "Orgtbl mode is not useful in Org mode, command ignored"))
(orgtbl-mode
(and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?!
;; Make sure we are first in minor-mode-map-alist

View File

@ -57,7 +57,7 @@
:description (or w3m-current-title w3m-current-url))))
(defun org-w3m-copy-for-org-mode ()
"Copy current buffer content or active region with `org-mode' style links.
"Copy current buffer content or active region with Org style links.
This will encode `link-title' and `link-location' with
`org-make-link-string', and insert the transformed test into the kill ring,
so that it can be yanked into an Org buffer with links working correctly."
@ -94,7 +94,7 @@ so that it can be yanked into an Org buffer with links working correctly."
;; get link title at current point.
(setq link-title (buffer-substring (point)
(org-w3m-get-anchor-end)))
;; concat `org-mode' style url to `return-content'.
;; concat Org style url to `return-content'.
(setq return-content (concat return-content
(org-make-link-string
link-location link-title))))

View File

@ -1,7 +1,7 @@
;;; org.el --- Outline-based notes management and organizer -*- lexical-binding: t; -*-
;; Carstens outline-mode for keeping track of everything.
;; Copyright (C) 2004-2017 Free Software Foundation, Inc.
;; Copyright (C) 2004-2018 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
@ -749,7 +749,7 @@ For export specific modules, see also `org-export-backends'."
(const :tag "C panel: Simple routines for us with bad memory" org-panel)
(const :tag "C registry: A registry for Org links" org-registry)
(const :tag "C screen: Visit screen sessions through Org links" org-screen)
(const :tag "C secretary: Team management with org-mode" org-secretary)
(const :tag "C secretary: Team management with Org" org-secretary)
(const :tag "C sqlinsert: Convert Org tables to SQL insertions" orgtbl-sqlinsert)
(const :tag "C toc: Table of contents for Org buffer" org-toc)
(const :tag "C track: Keep up with Org mode development" org-track)
@ -4873,7 +4873,7 @@ After a match, the following groups carry important information:
("beamer" org-startup-with-beamer-mode t)
("entitiespretty" org-pretty-entities t)
("entitiesplain" org-pretty-entities nil))
"Variable associated with STARTUP options for org-mode.
"Variable associated with STARTUP options for Org.
Each element is a list of three items: the startup options (as written
in the #+STARTUP line), the corresponding variable, and the value to set
this variable to if the option is found. An optional forth element PUSH
@ -5937,7 +5937,7 @@ by a #."
(defun org-fontify-meta-lines-and-blocks (limit)
(condition-case nil
(org-fontify-meta-lines-and-blocks-1 limit)
(error (message "org-mode fontification error in %S at %d"
(error (message "Org mode fontification error in %S at %d"
(current-buffer)
(line-number-at-pos)))))
@ -6928,6 +6928,7 @@ If POS is nil, use `point' instead."
(org-list-set-item-visibility (point-at-bol) struct 'children)
(org-show-entry)
(org-with-limited-levels (org-show-children))
(org-show-set-visibility 'canonical)
;; FIXME: This slows down the func way too much.
;; How keep drawers hidden in subtree anyway?
;; (when (memq 'org-cycle-hide-drawers org-cycle-hook)
@ -7022,20 +7023,22 @@ With a numeric prefix, show all headlines up to that level."
(save-excursion
(org-back-to-heading t)
(outline-hide-subtree)
(org-reveal)
(cond
((equal state "folded")
(outline-hide-subtree))
((equal state "children")
(org-show-hidden-entry)
(org-show-children))
((equal state "content")
(save-excursion
(save-restriction
(org-narrow-to-subtree)
(org-content))))
((member state '("all" "showall"))
(outline-show-subtree)))))))
(org-reveal))
(cond
((equal state "folded")
(outline-hide-subtree)
(org-end-of-subtree t t))
((equal state "children")
(org-show-hidden-entry)
(org-show-children))
((equal state "content")
(save-excursion
(save-restriction
(org-narrow-to-subtree)
(org-content)))
(org-end-of-subtree t t))
((member state '("all" "showall"))
(outline-show-subtree))))))
(unless no-cleanup
(org-cycle-hide-archived-subtrees 'all)
(org-cycle-hide-drawers 'all)
@ -10282,11 +10285,19 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
;; We are linking to this same file, with a search option
(setq link search)))))
;; Check if we can/should use a relative path. If yes, simplify the link
;; Check if we can/should use a relative path. If yes, simplify
;; the link.
(let ((case-fold-search nil))
(when (string-match "\\`\\(file\\|docview\\):" link)
(let* ((type (match-string-no-properties 0 link))
(path (substring-no-properties link (match-end 0)))
(path-start (match-end 0))
(search (and (string-match "::\\(.*\\)\\'" link)
(match-string 1 link)))
(path
(if search
(substring-no-properties
link path-start (match-beginning 0))
(substring-no-properties link (match-end 0))))
(origpath path))
(cond
((or (eq org-link-file-path-type 'absolute)
@ -10307,7 +10318,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
(setq path (substring (expand-file-name path)
(match-end 0)))
(setq path (abbreviate-file-name (expand-file-name path)))))))
(setq link (concat type path))
(setq link (concat type path (and search (concat "::" search))))
(when (equal desc origpath)
(setq desc path)))))
@ -12379,7 +12390,7 @@ When called through ELisp, arg is also interpreted in the following way:
(or (looking-at (concat " +" org-todo-regexp "\\( +\\|[ \t]*$\\)"))
(looking-at "\\(?: *\\|[ \t]*$\\)"))
(let* ((match-data (match-data))
(startpos (point-at-bol))
(startpos (copy-marker (line-beginning-position)))
(logging (save-match-data (org-entry-get nil "LOGGING" t t)))
(org-log-done org-log-done)
(org-log-repeat org-log-repeat)

View File

@ -1,6 +1,6 @@
;;; ox-beamer.el --- Beamer Back-End for Org Export Engine -*- lexical-binding: t; -*-
;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
;; Copyright (C) 2007-2018 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
;; Nicolas Goaziou <n.goaziou AT gmail DOT com>
@ -174,11 +174,11 @@ through `org-beamer-environments-extra' variable.")
("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}")
("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}")
("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}")
("theorem" "t" "\\begin{theorem}%a%U" "\\end{theorem}")
("definition" "d" "\\begin{definition}%a%U" "\\end{definition}")
("example" "e" "\\begin{example}%a%U" "\\end{example}")
("theorem" "t" "\\begin{theorem}%a[%h]" "\\end{theorem}")
("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}")
("example" "e" "\\begin{example}%a[%h]" "\\end{example}")
("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}")
("proof" "p" "\\begin{proof}%a%U" "\\end{proof}")
("proof" "p" "\\begin{proof}%a[%h]" "\\end{proof}")
("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
"Environments triggered by properties in Beamer export.
These are the defaults - for user definitions, see

View File

@ -79,7 +79,7 @@ BTEST = $(BATCH) $(BTEST_INIT) \
$(foreach req,$(BTEST_EXTRA),$(req-extra)) \
--eval '(org-test-run-batch-tests org-test-select-re)'
# Running a plain emacs with no config and this Org-mode loaded. This
# Running a plain emacs with no config and this Org mode loaded. This
# should be useful for manual testing and verification of problems.
NOBATCH = $(EMACSQ) $(BTEST_INIT) -l org -f org-version

View File

@ -12,7 +12,7 @@ while (<IN>) {
print OUT '<link rel="stylesheet" href="http://orgmode.org/org-manual.css" type="text/css" />';
} elsif (/<div class="contents">/) {
print OUT;
print OUT '<p>This is the official manual for the latest <a href="http://orgmode.org">Org-mode</a> release.</p><div id="table-of-contents">';
print OUT '<p>This is the official manual for the latest <a href="http://orgmode.org">Org mode</a> release.</p><div id="table-of-contents">';
} elsif (/<h2>Table of Contents<\/h2>/) {
print OUT;
print OUT '<a href="http://orgmode.org">http://orgmode.org</a><br/><div id="text-table-of-contents">';

View File

@ -31,7 +31,7 @@
"Make the file org-version.el in the current directory.
This function is internally used by the build system and should
be used by foreign build systems or installers to produce this
file in the installation directory of org-mode. Org will not
file in the installation directory of Org mode. Org will not
work correctly if this file is not present (except directly from
the Git work tree)."
(with-temp-buffer
@ -47,7 +47,7 @@ Inserted by installing Org mode or when a release is made.\"
org-release))
;;;\#\#\#autoload
\(defun org-git-version ()
\"The Git version of org-mode.
\"The Git version of Org mode.
Inserted by installing Org or when a release is made.\"
(let ((org-git-version \"" org-git-version "\"))
org-git-version))
@ -65,7 +65,7 @@ Inserted by installing Org or when a release is made.\"
"Make the file org-loaddefs.el in the current directory.
This function is internally used by the build system and should
be used by foreign build systems or installers to produce this
file in the installation directory of org-mode. Org will not
file in the installation directory of Org mode. Org will not
work correctly if this file is not up-to-date."
(with-temp-buffer
(set-visited-file-name "org-loaddefs.el")

View File

@ -54,7 +54,7 @@ close(IN);
print <<HEAD;
================================================================================
Org-Mode Reference Card (for version $orgversionnumber)
Org Mode Reference Card (for version $orgversionnumber)
================================================================================
HEAD
@ -74,7 +74,7 @@ while(<IN>){
}
next if($page != 1);
next if(/^%/);
next if /Org-Mode Reference Card \([12]\/2\)/;
next if /Org Mode Reference Card \([12]\/2\)/;
next if /\\centerline{\(for version \\orgversionnumber\)}/;
next if /\(for version \)/;
next if /\\newcolumn/;

View File

@ -68,7 +68,7 @@ config-cmd config-all::
$(foreach var,$(CONF_CALL),$(info $(var) = $($(var))$(EOL)))
config config-test config-exe config-all config-version::
$(info ========= Org version)
$(info make: Org-mode version $(ORGVERSION) ($(GITVERSION) => $(lispdir)))
$(info make: Org mode version $(ORGVERSION) ($(GITVERSION) => $(lispdir)))
@echo ""
oldorg: compile info # what the old makefile did when no target was specified

View File

@ -1,5 +1,5 @@
# -*- mode:org -*-
#+TITLE: Org-mode Testing
#+TITLE: Org mode Testing
#+PROPERTY: results silent
* Dependencies
@ -11,9 +11,9 @@ repository]].
* Non-interactive batch testing from the command line
The simplest way to run the Org-mode test suite is from the command
The simplest way to run the Org mode test suite is from the command
line with the following invocation. Note that the paths below are
relative to the base of the Org-mode directory.
relative to the base of the Org mode directory.
Also note that many of the current tests uses babel evaluation...
@ -32,8 +32,8 @@ The options in the above command are explained below.
| -Q | ignores any personal configuration ensuring a vanilla Emacs instance is used |
| --batch | runs Emacs in "batch" mode with no gui and termination after execution |
| -l | loads Org-mode and the org mode test suite defined in testing/org-test.el |
| --eval | reloads Org-mode and allows evaluation of code blocks by the tests |
| -l | loads Org mode and the Org mode test suite defined in testing/org-test.el |
| --eval | reloads Org mode and allows evaluation of code blocks by the tests |
| -f | actually runs the tests using the `org-test-run-batch-tests' function |
* Trigger the tests with 'make'
@ -53,19 +53,42 @@ See ../mk/default.mk for details.
The 'dirty' targets are for recompiling without cleaning and
rebuilding everything. This usually speeds up the recompilation
considerably.
considerably. Note that this speed up comes to the price of possibly
weird errors due to the unclean build.
The 'dirty' target is called test-dirty.
The dirty target for testing is called ~test-dirty~.
#+BEGIN_SRC sh :dir (expand-file-name "..") :results silent
make test-dirty
#+END_SRC
Note that the outcome may /not/ be in perfect shape.
** Select tests by regexp
Variable ~BTEST_RE~ can be set to limit the tests which are performed.
~BTEST_RE~ is interpreted as regexp.
Example:
#+begin_src shell
make BTEST_RE='test-.*-inlinetask' test-dirty
#+end_src
yields
#+begin_example
...
selected tests: test-.*-inlinetask
Running 2 tests (2017-12-28 15:04:45+0100)
passed 1/2 test-org-export/handle-inlinetasks
passed 2/2 test-org-inlinetask/goto-end
Ran 2 tests, 2 results as expected (2017-12-28 15:04:45+0100)
...
#+end_example
* Interactive testing from within Emacs
To run the Org-mode test suite from a current Emacs instance simply
To run the Org mode test suite from a current Emacs instance simply
load and run the test suite with the following commands.
1) First load the test suite.

View File

@ -1,4 +1,4 @@
This is an example file for use by the Org-mode tests.
This is an example file for use by the Org mode tests.
This file is special because it has no headings, which can be
erroneously assumed by some code.

View File

@ -2,7 +2,7 @@
#+OPTIONS: num:nil ^:nil
#+STARTUP: hideblocks
This is an example file for use by the Org-mode tests.
This is an example file for use by the Org mode tests.
* top
** code block

View File

@ -27,41 +27,137 @@
;;; Test movement
(ert-deftest test-org-inlinetask/goto-end ()
"Tests around org-inlinetask."
(ert-deftest test-org-inlinetask/org-inlinetask-goto-end ()
;; Goto end.
(should
(equal "** H\n***** I\n***** END<point>\nfoo"
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H\n<point>***** I\n***** END\nfoo"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string)))))
(equal
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H
<point>***** I
***** END
foo"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string)))
"** H
***** I
***** END
<point>foo"))
;; Goto end. End is buffer end.
(should
(equal "** H\n***** I\n***** END<point>"
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H\n<point>***** I\n***** END"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string)))))
(equal
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H
<point>***** I
***** END"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string)))
"** H
***** I
***** END<point>"))
;; Goto end. Starting somewhere.
(should
(equal "** H\n***** I\n***** END<point>\n***** I\n***** END"
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H\n****<point>* I\n***** END\n***** I\n***** END"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string))))))
(equal
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H
****<point>* I
***** END
***** I
***** END"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string)))
"** H
***** I
***** END
<point>***** I
***** END"))
(should
(equal
(let ((org-inlinetask-min-level 5)
(org-adapt-indentation t))
(org-test-with-temp-text
"** H
***** I
<point> inside
***** END
***** I
***** END"
(org-inlinetask-goto-end)
(insert "<point>")
(buffer-string)))
"** H
***** I
inside
***** END
<point>***** I
***** END")))
(ert-deftest test-org-inlinetask/inlinetask-within-plain-list ()
"Fold inlinetasks in plain-lists.
Report:
http://lists.gnu.org/archive/html/emacs-orgmode/2017-12/msg00502.html"
(should
(org-test-with-temp-text
"* Test
<point>- x
- a
*************** List folding stopped here
*************** END
- b
"
(org-cycle-internal-local)
(invisible-p (1- (search-forward "- b"))))))
(ert-deftest test-org-inlinetask/folding-directly-consecutive-tasks/0 ()
"Fold directly consecutive inlinetasks."
(should
(org-test-with-temp-text
"* Test
<point>- x
- a
*************** List folding stopped here
*************** END
*************** List folding stopped here
*************** END
- b
"
(org-cycle-internal-local)
(invisible-p (1- (search-forward "- b"))))))
(ert-deftest test-org-inlinetask/folding-directly-consecutive-tasks/1 ()
"Fold directly consecutive inlinetasks."
(should
(org-test-with-temp-text
"<point>* Test
*************** p1
p2
*************** END
*************** p3
p4
*************** END
"
(outline-hide-subtree)
(org-cycle)
(and
(not (invisible-p (1- (search-forward "p1"))))
(invisible-p (1- (search-forward "p2")))
(not (invisible-p (1- (search-forward "p3"))))
(invisible-p (1- (search-forward "p4")))))))
(provide 'test-org-inlinetask)
;;; test-org-inlinetask.el ends here

View File

@ -6704,6 +6704,95 @@ CLOCK: [2012-03-29 Thu 10:00]--[2012-03-29 Thu 16:40] => 6:40"
(org-copy-visible (point-min) (point-max))
(current-kill 0 t))))))
(ert-deftest test-org/set-visibility-according-to-property ()
"Test `org-set-visibility-according-to-property' specifications."
;; "folded" state.
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: folded
:END:
** <point>b"
(org-set-visibility-according-to-property)
(invisible-p (point))))
;; "children" state.
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: children
:END:
** b
<point>Contents
** c"
(org-set-visibility-according-to-property)
(invisible-p (point))))
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: children
:END:
** b
Contents
*** <point>c"
(org-set-visibility-according-to-property)
(invisible-p (point))))
;; "content" state.
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: content
:END:
** b
<point>Contents
*** c"
(org-set-visibility-according-to-property)
(invisible-p (point))))
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: content
:END:
** b
Contents
*** <point>c"
(org-set-visibility-according-to-property)
(not (invisible-p (point)))))
;; "showall" state.
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: showall
:END:
** b
<point>Contents
*** c"
(org-set-visibility-according-to-property)
(not (invisible-p (point)))))
(should
(org-test-with-temp-text
"
* a
:PROPERTIES:
:VISIBILITY: showall
:END:
** b
Contents
*** <point>c"
(org-set-visibility-according-to-property)
(not (invisible-p (point))))))
(provide 'test-org)