Commit Graph

794 Commits

Author SHA1 Message Date
Nicolas Goaziou d13b0745dc Mark a few functions as obsolete
* lisp/ob-R.el (org-babel-variable-assignments:R):
* lisp/ob-ref.el (org-babel-ref-goto-headline-id):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-agenda-switch-to):
* lisp/org-capture.el (org-capture-goto-target):
* lisp/org-clock.el (org-clock-goto):
(org-clock-special-range):
* lisp/org-ctags.el (org-ctags-visit-buffer-or-file):
* lisp/org-eshell.el (org-eshell-open):
* lisp/org-feed.el (org-feed-show-raw-feed):
* lisp/org-id.el (org-id-goto):
* lisp/org-irc.el (org-irc-visit-erc):
* lisp/org-macs.el (org-string-nw-p):
* lisp/org-mobile.el (org-mobile-apply):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org.el (org-get-location):
(org-tree-to-indirect-buffer):
(org-mark-ring-goto):
(org-refile):
(org-add-log-note):
(org-revert-all-org-buffers):
(org-switchb):
(org-cycle-agenda-files):
(org-submit-bug-report):
(org-goto-marker-or-bmk):
* lisp/ox-html.el (org-html-htmlize-generate-css): Silence byte
  compiler.

The following functions are marked as obsolete:
- `org-string-match-p'
- `org-number-sequence'
- `org-floor*'
- `org-pop-to-buffer-same-window'
- `org-delete-directory'
- `org-buffer-narrowed-p'
2016-06-23 10:00:00 +02:00
Nicolas Goaziou 4f63cfabb3 Deprecate `org-babel-trim' in favor of `org-trim'
* lisp/org.el (org-trim): Add optional argument.

* contrib/lisp/ob-mathematica.el (org-babel-execute:mathematica):
* contrib/lisp/org-bibtex-extras.el (obe-html-export-citations):
* contrib/lisp/org-mime.el (org-mime-compose):
* lisp/ob-C.el (org-babel-C-execute):
* lisp/ob-calc.el (org-babel-execute:calc):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-parse-multiple-vars):
(org-babel-read-element):
(org-babel-insert-result):
(org-babel-expand-noweb-references):
(org-babel-trim): Mark obsolete.
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-fortran.el (org-babel-execute:fortran):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
* lisp/ob-ocaml.el (org-babel-execute:ocaml):
* lisp/ob-octave.el (org-babel-octave-evaluate-session):
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
(org-babel-python-evaluate-session):
* lisp/ob-ref.el (org-babel-ref-split-args):
* lisp/ob-ruby.el (org-babel-ruby-evaluate):
* lisp/ob-shell.el (org-babel-sh-evaluate):
* lisp/ob-table.el (org-sbe):
* lisp/ob-tangle.el (org-babel-spec-to-string):
* lisp/org-bibtex.el (org-bibtex-get):
* testing/lisp/test-ob.el (test-ob/parse-header-args): Use `org-trim'
  instead of `org-babel-trim'.
2016-06-21 15:33:00 +02:00
Nicolas Goaziou ee7ca3cc43 org-list: Allow multiple receiver locations for radio lists
* lisp/org-list.el (org-list-send-list): Allow multiple receiver
  locations.
* testing/lisp/test-org-list.el (test-org-list/send-list): Add test.
2016-06-17 10:19:07 +02:00
Nicolas Goaziou 0ac099a6f8 Remove final parts of XEmacs compatibility code
* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
2016-05-26 13:56:25 +02:00
Nicolas Goaziou dba7652445 Merge branch 'maint' 2016-05-23 01:17:23 +02:00
Nicolas Goaziou f311921ad3 org-list: Fix `org-list-send-list' in LaTeX buffers
* lisp/org-list.el (org-list-send-list): Find correct translator.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107290>
2016-05-23 01:12:51 +02:00
Kyle Meyer d38e91867c Fix remaining declare-function issues on master
* lisp/org-list.el (org-export-create-backend):
Indicate that FN is not a defun.
* lisp/org-list.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-get-backend):
(org-export-get-environment):
(org-export-get-next-element):
(org-export-with-backend):
Correct source file name.
* lisp/org.el (calendar-check-holidays):
(org-agenda-format-item):
Correct argument list.
2016-05-15 19:16:30 -04:00
Paul Eggert 1f046ea4b1 Backport commit 65c8c7c from Emacs
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-exp.el (org-element-context):
* lisp/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/ob-haskell.el (org-export-to-file):
* lisp/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/ob-python.el (run-python):
* lisp/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org-colview.el (org-agenda-redo):
* lisp/org-feed.el (url-retrieve-synchronously):
* lisp/org-info.el (Info-find-node):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-macs.el (org-string-match-p):
* lisp/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/ob-comint.el (tramp-flush-directory-property):
* lisp/ob-tangle.el (org-babel-update-block-body):
* lisp/org-bibtex.el (org-babel-trim):
* lisp/org-pcomplete.el (org-export-backend-options):
* lisp/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/ob-comint.el (with-parsed-tramp-file-name)
* lisp/ob-core.el (with-parsed-tramp-file-name):
* lisp/org.el (org-beamer-mode):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/ob-core.el (org-save-outline-visibility):
Remove; not needed.
* lisp/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.

Pacify ‘make check-declare’
65c8c7cb96c14f9c6accd03cc8851b5a3459049e
Paul Eggert
Sat May 14 19:57:44 2016 -0700
2016-05-15 18:59:16 -04:00
Nicolas Goaziou fdbf441560 Obsolete `org-icompleting-read' and `org-completing-read-no-i'
* lisp/org.el (org-icompleting-read, org-completing-read-no-i): Obsolete
  aliases for `completing-read'
(org-iswitchb-completing-read): Remove function.
(org-sort-entries):
(org-refile-get-location):
(org-todo):
(org-deadline):
(org-occur-parameters):
(org-change-tag-in-region):
(org-fast-tag-selection):
(org-delete-property-globally):
(org-compute-property-at-point):
(org-buffer-list): Use genuine function.

* contrib/lisp/org-colview-xemacs.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* contrib/lisp/org-index.el (org-index):
* contrib/lisp/ox-bibtex.el (org-bibtex-goto-citation):
* lisp/ob-core.el (org-babel-insert-header-arg):
(org-babel-goto-named-src-block):
(org-babel-goto-named-result):
(org-babel-demarcate-block):
* lisp/org-agenda.el (org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-bulk-action):
* lisp/org-attach.el (org-attach-delete-one):
(org-attach-open):
* lisp/org-bibtex.el (org-bibtex-fleshout):
(org-bibtex-create):
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-colview.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* lisp/org-footnote.el (org-footnote-new):
* lisp/org-list.el (org-sort-list):
* lisp/ox-publish.el (org-publish):
* lisp/ox.el (org-export-dispatch): Use genuine function.
2016-01-10 21:16:29 +01:00
Kyle Meyer 6345de2d05 Merge branch 'maint' 2016-01-09 17:43:27 -05:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.

* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".

* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.

* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks.  Remove
  back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.

* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
  forbidden blocks.  Remove back-ends blocks, which are now special
  blocks.

* contrib/lisp/ox-extra.el: Update comments.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.

Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks.  The new syntax is

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

As a consequence, =INCLUDE= keywords syntax is modified, e.g.,

  #+INCLUDE: "file.org" HTML

becomes

  #+INCLUDE: "file.org" export html
2015-12-20 21:56:27 +01:00
Nicolas Goaziou 64aee4692a org-list: Fix sending empty lists
* lisp/org-list.el (org-list--to-generic-item): Fix sending empty lists.

* testing/lisp/test-org-list.el (test-org-list/to-generic): Add test.

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103462>
2015-12-08 18:45:21 +01:00
Nicolas Goaziou 43009088b7 org-list: Silence byte-compiler (part 2) 2015-12-05 09:41:14 +01:00
Nicolas Goaziou 2beaeffef1 org-list: Silence byte-compiler 2015-12-05 09:38:49 +01:00
Nicolas Goaziou 11291ffcd0 org-list: Radio lists use Org Export library
* lisp/org-list.el (org-list-to-lisp): New function.
(org-list-parse-list): Mark function obsolete.

(org-list-send-list):
(org-list-to-generic):
(org-list-make-subtree): Use new function.

(org-list-item-trim-br): Remove function.

(org-list-to-generic): Use Org Export library.
(org-list--depth):
(org-list--trailing-newlines):
(org-list--generic-eval):
(org-list--to-generic-plain-list):
(org-list--to-generic-item): New functions.

(org-list-to-latex):
(org-list-to-html):
(org-list-to-texinfo): Apply changes.  Allow parameters.
(org-list-to-subtree): Apply changes.

* lisp/org.el (org-toggle-heading):
* lisp/ob-core.el (org-babel-insert-result): Apply changes.

* doc/org.texi (Radio lists): Update documentation.

* testing/lisp/test-org-list.el (test-org-list/to-generic): New test.
2015-12-03 09:54:49 +01:00
Nicolas Goaziou df321b097f org-list: Fix unbound depth error
* lisp/org-list.el (org-list-parse-list): Use `letrec'.
(org-list-to-generic): Do not allow random sexp, but authorize functions.
(org-list-to-subtree): Apply change to previous function.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102651>
2015-11-08 00:07:33 +01:00
Aaron Ecay e4cd3dd22b Remove some home-grown copies of cl-lib functions.
* lisp/org.el (org-count, org-remove-if, org-remove-if-not):
(org-reduce, org-every, org-some): Obsolete, use cl-lib versions
everywhere.
(org-sublist): Reimplement in terms of `cl-subseq'; make obsolete.
2015-11-06 12:50:40 +00:00
Nicolas Goaziou 9b5757cb47 org-list: Fix small bug
* lisp/org-list.el (org-list-to-generic): Fix lexical binding mistake.
2015-11-02 22:09:05 +01:00
Nicolas Goaziou f0bf77e82a Activate lexical binding in some libraries
* lisp/ob-C.el (org-babel-prep-session:C):
(org-babel-load-session:C):
* lisp/ob-J.el:
(org-babel-expand-body:J):
(org-babel-execute:J):
* lisp/ob-R.el:
(org-babel-expand-body:R):
* lisp/ob-abc.el:
(org-babel-execute:abc):
(org-babel-prep-session:abc):
* lisp/ob-asymptote.el:
(org-babel-execute:asymptote):
(org-babel-prep-session:asymptote):
* lisp/ob-awk.el:
(org-babel-expand-body:awk):
* lisp/ob-calc.el:
(org-babel-expand-body:calc):
* lisp/ob-clojure.el:
* lisp/ob-comint.el:
(org-babel-comint-in-buffer):
(org-babel-comint-with-output):
(org-babel-comint-eval-invisibly-and-wait-for-file):
* lisp/ob-coq.el:
* lisp/ob-css.el:
(org-babel-execute:css):
(org-babel-prep-session:css):
* lisp/ob-ditaa.el:
(org-babel-execute:ditaa):
(org-babel-prep-session:ditaa):
* lisp/ob-dot.el:
(org-babel-execute:dot):
(org-babel-prep-session:dot):
* lisp/ob-ebnf.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-eval.el:
* lisp/ob-forth.el:
* lisp/ob-fortran.el:
(org-babel-execute:fortran):
(org-babel-prep-session:fortran):
(org-babel-load-session:fortran):
* lisp/ob-gnuplot.el:
(org-babel-expand-body:gnuplot):
(org-babel-prep-session:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-groovy.el:
(org-babel-prep-session:groovy):
(org-babel-groovy-initiate-session):
* lisp/ob-haskell.el:
(org-babel-haskell-initiate-session):
* lisp/ob-io.el:
(org-babel-prep-session:io):
(org-babel-io-initiate-session):
* lisp/ob-java.el:
(org-babel-execute:java):
* lisp/ob-js.el:
* lisp/ob-keys.el:
* lisp/ob-latex.el:
(org-babel-prep-session:latex):
* lisp/ob-ledger.el:
(org-babel-execute:ledger):
(org-babel-prep-session:ledger):
* lisp/ob-lilypond.el:
(org-babel-lilypond-commands):
(org-babel-lilypond-process-basic):
(org-babel-prep-session:lilypond):
(org-babel-lilypond-parse-line-num):
* lisp/ob-lisp.el:
* lisp/ob-makefile.el:
(org-babel-execute:makefile):
(org-babel-prep-session:makefile):
* lisp/ob-matlab.el:
* lisp/ob-maxima.el:
(org-babel-prep-session:maxima):
* lisp/ob-mscgen.el:
(org-babel-prep-session:mscgen):
* lisp/ob-ocaml.el:
(org-babel-execute:ocaml):
(org-babel-prep-session:ocaml):
* lisp/ob-octave.el:
(org-babel-execute:octave):
(org-babel-octave-initiate-session):
* lisp/ob-org.el:
(org-babel-prep-session:org):
* lisp/ob-perl.el:
(org-babel-prep-session:perl):
(org-babel-perl--var-to-perl):
(org-babel-perl-initiate-session):
* lisp/ob-picolisp.el:
(org-babel-expand-body:picolisp):
(org-babel-execute:picolisp):
* lisp/ob-plantuml.el:
(org-babel-execute:plantuml):
(org-babel-prep-session:plantuml):
* lisp/ob-processing.el:
(org-babel-prep-session:processing):
* lisp/ob-python.el:
(org-babel-python-initiate-session):
* lisp/ob-ref.el:
(org-babel-ref-resolve):
* lisp/ob-ruby.el:
(org-babel-ruby-initiate-session):
* lisp/ob-sass.el:
(org-babel-execute:sass):
(org-babel-prep-session:sass):
* lisp/ob-scala.el:
(org-babel-execute:scala):
(org-babel-prep-session:scala):
(org-babel-scala-initiate-session):
* lisp/ob-scheme.el:
* lisp/ob-screen.el:
(org-babel-prep-session:screen):
(org-babel-screen-session-write-temp-file):
(org-babel-screen-test):
* lisp/ob.el:
* lisp/org-colview.el:
(org-columns-todo):
(org-columns-set-tags-or-toggle):
(org-columns-new):
(org-columns-uncompile-format):
(org-agenda-colview-summarize):
* lisp/org-footnote.el:
(electric-indent-mode):
* lisp/org-indent.el:
(org-indent-refresh-maybe):
* lisp/org-list.el:
* lisp/org-macro.el:
(org-macro--collect-macros):
* lisp/org-src.el:
* lisp/org-table.el:
(sort-fold-case):
(org-table-create):
(org-table-field-info):
(org-table-transpose-table-at-point):
(org-table-remove-rectangle-highlight):
(orgtbl-create-or-convert-from-region):
(org-define-lookup-function):
* lisp/ox-ascii.el:
(org-ascii-format-drawer-function):
(org-ascii--has-caption-p):
(org-ascii-bold):
(org-ascii-center-block):
(org-ascii-clock):
(org-ascii-code):
(org-ascii-dynamic-block):
(org-ascii-entity):
(org-ascii-example-block):
(org-ascii-export-snippet):
(org-ascii-export-block):
(org-ascii-fixed-width):
(org-ascii-footnote-reference):
(org-ascii-horizontal-rule):
(org-ascii-inline-src-block):
(org-ascii-format-inlinetask-default):
(org-ascii-italic):
(org-ascii-keyword):
(org-ascii-latex-environment):
(org-ascii-latex-fragment):
(org-ascii-line-break):
(org-ascii-node-property):
(org-ascii-planning):
(org-ascii-quote-block):
(org-ascii-radio-target):
(org-ascii-special-block):
(org-ascii-src-block):
(org-ascii-statistics-cookie):
(org-ascii-subscript):
(org-ascii-superscript):
(org-ascii-strike-through):
(org-ascii-timestamp):
(org-ascii-underline):
(org-ascii-verbatim):
(org-ascii-verse-block):
(org-ascii-filter-headline-blank-lines):
(org-ascii-filter-paragraph-spacing):
(org-ascii-filter-comment-spacing): Use lexical binding.
2015-10-26 01:56:00 +01:00
Kyle Meyer 5362f63fad Merge branch 'maint' 2015-09-21 18:46:41 -04:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
Protect apostrophes not covered by the last backport.  Convert
expressions like '(...)  to \\='(...)  and symbols written as 'name to
`name'.  (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)

If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
2015-09-21 18:38:39 -04:00
Nicolas Goaziou 67fe03bcd7 Remove `org-list-empty-line-terminates-plain-lists'
* lisp/org-list.el (org-list-empty-line-terminates-plain-lists): Remove
  variable.
(org-list-end-re):
(org-list-separating-blank-lines-number):
* lisp/org.el (org-blank-before-new-entry): Adapt to change above.

* testing/lisp/test-org-element.el (test-org-element/at-point):
* testing/lisp/test-org-list.el (test-org-list/move-item-down):
(test-org-list/move-item-up):
(test-org-list/insert-item): Update tests.

This variable is not useful: plain lists can always be terminated with
two blank lines.
2015-08-14 16:34:37 +02:00
Nicolas Goaziou 9bb87f49f7 org-list: Fix "Invalid search bound" error
* lisp/org-list.el (org-update-checkbox-count): Fix "Invalid search
  bound" error.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/99837>
2015-08-11 14:11:15 +02:00
Nicolas Goaziou ac0661189e org-list: Fix statistics updating with cookie in sublist
* lisp/org-list.el (org-update-checkbox-count): Properly update
  statistics cookies in a sublist.

* testing/lisp/test-org-list.el (test-org-list/update-checkbox-count):
Add test.

Reported-by: Gerald Wildgruber <Gerald.Wildgruber@unibas.ch>
<http://permalink.gmane.org/gmane.emacs.orgmode/99792>
2015-08-10 23:23:39 +02:00
Paul Eggert ff92583e42 Backport commit eb0f65b from Emacs master branch
Don't overflow if computing approximate percentage
eb0f65b4fbbea60100b53cb40a1d7138d47ad0d2
Paul Eggert
Fri Jul 31 10:13:38 2015 -0700

* lisp/org-list.el (org-update-checkbox-count):
* lisp/org.el (org-table-map-tables)
(org-update-parent-todo-statistics):
Prefer (floor (* 100.0 NUMERATOR) DENOMINATOR) when calculating
progress-report percentages and the like.  This avoids problems
if (* 100 NUMERATOR) would overflow.
* lisp/org-colview.el (org-nofm-to-completion):
Prefer (round (* 100.0 NUMERATOR) DENOMINATOR) to a
more-complicated and less-accurate approximation.
2015-08-04 22:58:47 -04:00
Nicolas Goaziou 145ac49faf org-list: Silence byte-compiler 2015-06-09 17:14:13 +02:00
Nicolas Goaziou a4cc9d82d8 org-list: Fix checkbox update with inlinetasks
* lisp/org-list.el (org-update-checkbox-count): Change algorithm.  Use
  Element parser.

* testing/lisp/test-org-list.el (test-org-list/update-checkbox-count):
  New test.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/97594>
2015-06-09 17:06:17 +02:00
Nicolas Goaziou a0c1e490b3 Silence byte-compiler
* lisp/org-footnote.el:
* lisp/org-list.el:
* lisp/org-macro.el:
* lisp/org-src.el:
* lisp/org.el: Silence byte-compiler.
2015-05-30 14:28:35 +02:00
Bastien 7e5249c9fd Merge branch 'maint'
Conflicts:
	lisp/org-list.el
2015-05-20 08:00:54 +02:00
Stefan Monnier 42228a99ca lisp/org-{macs, list}.el: Fix lexical warnings
* lisp/org-{macs,list}.el: Fix lexical warnings

    * lisp/org-list.el (org-list-struct): Remove unused var `ind'.
    (org-list-get-next-item, org-list-get-prev-item)
    (org-list-get-children): Mark unused arg `struct'.
    (org-list-use-alpha-bul-p): Remove unused var `bul'.
    (org-toggle-checkbox): Mark unused var.
    (org-update-checkbox-count): Remove unused var `box-num'.
    (org-adapt-indentation): Declare.
    (org-list-parse-list): Declare var instead of adding a dummy duplicate.
    (org-list-send-list): Remove unused var `txt'.
    (org-list-to-latex, org-list-to-texinfo): Mark unused arg `params'.
    (org-list-to-subtree): Add prefix to dyn-bind var, and declare them.

    * lisp/org-macs.el: Use `declare'.
    (org-with-limited-levels): Declare dyn-bound vars.
2015-05-20 07:57:20 +02:00
Nicolas Goaziou 9aa69058bc org-list: Preserve newline characters when changing description lists
* lisp/org-list.el (org-list-to-generic): Preserve newline characters
  after description in description lists.

Reported-by: Leo Ufimtsev <lufimtse@redhat.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97432>
2015-05-07 01:16:32 +02:00
Nicolas Goaziou 5a550938ce org-list: Modify M-RET on a description tag
* lisp/org-list.el (org-list-insert-item): On a description tag,
  insert item before current one.  However, past the colons, insert it
  after.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add
  tests.

Reported-by: Leo Ufimtsev <lufimtse@redhat.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96330>
2015-03-23 23:35:57 +01:00
Nicolas Goaziou 0d24086657 Update some copyright years 2015-02-16 01:40:07 +01:00
Nicolas Goaziou 836d9db8a9 org-list: Fix continuated items repair
* lisp/org-list.el (org-list-struct-apply-struct): Preserve disparate
  indentation in contuated contents, i.e., contents after a plain list
  still within an item.

* testing/lisp/test-org-list.el (test-org-list/repair): Add test.

This fixes the following case:

  - item
     - child
     item contents
       with different indentation

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94977>
2015-02-14 12:37:41 +01:00
Nicolas Goaziou 8ff32ab112 Be more cautious when preserving visibility
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-list.el (org-list-swap-items):
(org-list-send-item): In order to preserve visibility of moved items
or elements, only consider inner overlays.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94320>
2015-01-30 00:20:01 +01:00
Nicolas Goaziou 34bbb39454 Fix parser wrt to defcustom syntax related changes
* lisp/org-element.el (org-element-paragraph-separate,
  org-element--object-regexp): Turn defconst into defvar.
(org-element--set-regexps): Properly set previous variables.
(org-element-update-syntax): New function.

* lisp/org-list.el (org-plain-list-ordered-item-terminator,
  org-list-allow-alphabetical): Call new function whenever these
  variables are modified and Org is already loaded.

* lisp/org.el (org-add-link-type): Call new function since a new link
  type triggers a rebuild of syntax regexps, possibly invalidating
  cache in all Org buffers.

Reported-by: Christopher Dannheim <ch.dannheim@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/92487>
2014-11-10 00:08:44 +01:00
Nicolas Goaziou ce2090ccfd Fix indentation in lists
* lisp/org-list.el (org-list-item-body-column): Take into
  consideration empty items and bullets followed by two spaces.

* lisp/org.el (org--get-expected-indentation): Fix return value for
  items in lists.
(org-indent-region): Fix infloop when indenting some types of plain
lists.  Also fix error when region starts with blank lines at the
beginning of the buffer.

* testing/lisp/test-org.el (test-org/indent-region): Add tests.
2014-10-13 19:03:14 +02:00
Bastien Guerry ddb536e833 Merge branch 'maint' 2014-06-23 09:45:48 +02:00
Bastien Guerry be9a1638af Fix typos: backport revision r117377 from emacs trunk 2014-06-23 09:40:19 +02:00
Nicolas Goaziou 38aebc8c24 Merge branch 'maint' 2014-06-01 14:20:51 +02:00
Nicolas Goaziou 198fc8d483 org-list: Fix typo in docstring
* lisp/org-list.el (org-list-repair): Fix typo in docstring.
2014-06-01 14:20:12 +02:00
Bastien Guerry 25f47777ef Complete commit 07158e
* org.el (org-refresh-category-properties)
(org-complete-expand-structure-template)
(org-buffer-property-keys, org-context):
* org-mouse.el (org-mouse-context-menu):
* org-list.el (org-list-send-list):
* org-element.el (org-element--list-struct):
* org-archive.el (org-all-archive-files): Allow spaces before
any option keyword.

* org.el (org-fontify-meta-lines-and-blocks-1): Fix
fontification of all option keywords.

Thanks to Alan Schmitt for raising the problem with fontification.
2014-03-13 11:28:07 +01:00
Bastien Guerry 72b8a86d9c Merge branch 'maint' 2014-01-12 10:03:17 +01:00
Bastien Guerry 9305b41ceb Backport typo fixes from Emacs revno 115988 2014-01-12 09:54:21 +01:00
Bastien Guerry f8e1745440 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-07 14:19:03 +01:00
Bastien Guerry 7d9a883b50 Update copyright years again.
Hint: copyright years are all updated in Emacs.
2014-01-07 14:18:17 +01:00
Bastien Guerry c41f5075ac Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-05 06:36:11 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Achim Gratz 0e313e0405 ob-list, ob-ref: fix byte-compiler warnings
* lisp/org-list.el: Declare dynamic variable `org-drawer-regexp´.
* lisp/ob-ref.el: Declare functions `org-babel-lob-execute´ and
  `org-babel-lob-get-info´ and dynamic variable
  `org-babel-lob-one-liner-regexp´.
2013-11-14 21:22:14 +01:00
Nicolas Goaziou 6202ec7b3b Remove need to declare drawers before using them
* lisp/org-agenda.el (org-agenda-prepare): Remove reference to
  `org-drawers-for-agenda'.
(org-agenda-show-1): Remove reference to `org-drawers'.
* lisp/org-clock.el (org-clock-remove-empty-clock-drawer,
  org-clock-cancel): Apply signature change to
  `org-remove-empty-drawer-at'.
* lisp/org-element.el (org-element--list-struct): Use
  `org-drawer-regexp' instead of `org-drawers'.
* lisp/org-feed.el (org-feed-drawer): Update docstring according to
  change.
* lisp/org-list.el (org-in-item-p, org-list-context): Use
  `org-drawer-regexp' instead of `org-drawers'.
* lisp/org-mobile.el (org-mobile-create-index-file): Remove reference
  to `org-drawers-for-agenda'.
* lisp/org-pcomplete.el (pcomplete/org-mode/drawer): Remove function.
* lisp/org.el (org-drawer-regexp): Make variable global.
(org-drawers): Remove variable.
(org-set-regexps-and-options): Ignore DRAWER keyword.
(org-cycle): Use `org-drawer-regexp' instead of `org-drawers'.
(org-cycle-hide-drawers): Add an optional argument to ignore some
drawers.
(org-remove-empty-drawer-at): Remove second argument.  Rewrite
function.
(org-clone-subtree-with-time-shift): Apply signature change to
`org-remove-empty-drawer-at'.
(org-toggle-ordered-property): Apply `org-delete-property' signature
change.
(org-map-entries): Remove reference to `org-drawers-for-agenda'.
(org-entry-delete): Remove optional argument.  Small refactoring.
(org-insert-drawer): Remove reference to `org-drawers'.
(org-delete-property): Apply `org-entry-delete' signature change.
(org-in-drawer-p): Rewrite function.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org.el: Update tests.
* testing/lisp/test-ox.el: Update tests.
2013-10-31 21:19:40 +01:00
Bastien Guerry 0eb0e5778b Use bzg@gnu.org instead of bzg AT gnu DOT org 2013-10-08 08:07:21 +02:00
Nicolas Goaziou 35e5e5b8b0 org-list: Fix misleading docstring
* lisp/org-list.el (org-list-allow-alphabetical): Remove reference to
  unused VALUE.
2013-10-04 21:13:23 +02:00
Nicolas Goaziou 5fdb93eb39 Merge branch 'maint' 2013-09-04 15:26:11 +02:00
Nicolas Goaziou 29c2827469 org-list: Fix list repairing
* lisp/org-list.el (org-list-struct-apply-struct): Do not move item's
  contents within a child above when repairing indentation.
* testing/lisp/test-org-list.el: Add tests.
2013-09-04 15:21:33 +02:00
Bastien Guerry 6f4e06e54b org-list.el (org-sort-list): Use `x' instead of `c' for sorting plain list by checked status
* org-list.el (org-sort-list): Use `x' instead of `c' for
sorting plain list by checked status.
2013-07-04 01:33:02 +02:00
Bastien Guerry f80e262967 org-list.el (org-sort-list): Implement sorting by "checked" status for check lists
* org-list.el (org-sort-list): Implement sorting by "checked"
status for check lists.

* org.texi (Plain lists): Add index entry for sorting plain
list.  Document sorting by checked status for check lists.
2013-07-03 14:57:19 +02:00
Nicolas Goaziou 73b7f3192c org-list: Properly update `org-list-allow-alphabetical'
* lisp/org-list.el (org-list-allow-alphabetical): Properly update
  `org-list-allow-alphabetical' when changed after org.el has been
  loaded.
2013-04-26 14:13:24 +02:00
Bastien Guerry e6776ce711 org-list.el (org-sort-list): Fix infloop
* org-list.el (org-sort-list): Fix infloop.

Thanks to Samuel Wales for reporting this.
2013-04-22 00:24:39 +02:00
Bastien Guerry 7c466e470c org-list.el (org-sort-list): Don't move point when matching time values
* org-list.el (org-sort-list): Don't move point when matching
time values.

Thanks to Samuel Wales for reporting this bug.
2013-04-16 08:23:52 +02:00
Bastien Guerry f373bca58b Rename some list variables
* org-element.el (org-element-paragraph-separate): Use
new name `org-list-allow-alphabetical'.

* org-list.el (org-list-allow-alphabetical): Rename from
`org-alphabetical-lists'.
(org-list-empty-line-terminates-plain-lists): Rename from
`org-empty-line-terminates-plain-lists'.
(org-checkbox-hierarchical-statistics): Rename from
`org-hierarchical-checkbox-statistics'.

* org.texi (Plain lists, Checkboxes): Use non-obsolete
variable names.
2013-03-23 17:45:15 +01:00
Bastien Guerry 6b38452498 org-list.el (org-insert-item): Don't ask for a definition term
* org-list.el (org-insert-item): Don't ask for a definition
term when insert an item in a description list.

This breaks the type-flow way too much.
2013-03-16 19:15:58 +01:00
Bastien Guerry e0e699ab3d org-compat.el: New compatibility function `org-defvaralias'
* org-compat.el (org-defvaralias): Newcompatibility function.
* org.el:
* org-agenda.el:
* org-list.el:
* org-gnus.el:
* org-clock.el: Use it.
2013-03-14 13:53:52 +01:00
Bastien Guerry 8481088c4a org-list.el: Rename some options and add aliases
* org-list.el (org-cycle-include-plain-lists): Also add to the
'org-cycle customization group.
(org-list-allow-alphabetical)
(org-checkbox-hierarchical-statistics)
(org-list-empty-line-terminates-plain-lists)
(org-list-description-max-indent): Rename and add aliases to old
names.
2013-03-14 13:41:06 +01:00
Nicolas Goaziou 40fc9e869f org-list: Use export back-ends to transform radio lists
* lisp/org-list.el (org-list-send-list): Do not rely on
  `org-list-parse-list'.
(org-list-to-latex, org-list-to-html, org-list-to-texinfo): Use
appropriate export back-end instead of using `org-list-to-generic'.
* testing/lisp/test-org-list.el: Add tests.
2013-03-04 12:33:04 +01:00
Bastien Guerry 49772f1f26 Remove hidden links when comparing items or entries.
* org.el (org-sort-remove-invisible): Add a docstring.
(org-sort-entries): Remove hidden links when comparing
entries.

* org-list.el (org-sort-list): Remove hidden links when
comparing list items.

Thanks to François Pinard for suggesting this.
2013-02-25 10:15:44 +01:00
Bastien Guerry 71c3c12b39 Use `user-error' when moving or modifying the element at point is not possible
* org.el (org-move-subtree-down, org-forward-element)
(org-backward-element):
* org-table.el (org-table-previous-field)
(org-table-move-column, org-table-move-row):
* org-list.el (org-move-item-down, org-move-item-up)
(org-cycle-item-indentation): Use `user-error' when moving or
modifying the element at point is not possible.
2013-02-22 10:31:35 +01:00
Bastien Guerry 1ee94060bc org-list.el (org-list-bullet-string): Small fix
* org-list.el (org-list-bullet-string): Replace match when
there is a match, otherwise just return the bullet.
2013-02-15 23:09:10 +01:00
Bastien Guerry 7a4d026b67 Remove references to the DocBook exporter
* org.el (org-emphasis-alist, org-protecting-blocks):
* org-src.el (org-edit-src-find-region-and-lang):
* org-list.el (org-list-forbidden-blocks):
* org-footnote.el (org-footnote-forbidden-blocks): Remove
references to the deleted DocBook exporter.

* org.texi (Top, Markup, Initial text, Images and tables)
(@LaTeX{} fragments, @LaTeX{} fragments, Exporting)
(Export options, JavaScript support, Beamer class export):
Remove references to the DocBook export, which has been
deleted.
(History and Acknowledgments): Mention that DocBook has been
deleted, suggest to use the Texinfo exporter instead, then to
convert the .texi to DocBook with makeinfo.
(Links in ODT export, Tables in ODT export): Fix indices.
2013-02-14 09:48:36 +01:00
Nicolas Goaziou 73ddb3c49c Remove references to `org-protected' `org-example' and `original-indentation'
* lisp/org-macs.el (org-if-unprotected, org-if-unprotected-1,
  org-if-unprotected-at): Removed macros.
(org-re-search-forward-unprotected): Removed function.
* lisp/org.el (org-format-latex): Remove reference to `org-protected'.
* lisp/org-list.el (org-list-struct): Remove reference to
  `org-example' and `org-protected'.
* lisp/org-footnote.el (org-footnote-at-reference-p): Remove reference
  to `org-protected'.
* lisp/org-capture.el (org-capture-fill-template): Remove reference to
  `org-protected'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
  Remove reference to `org-protected' value.

These text properties were used by the old export framework. They are
not needed anymore.
2013-02-06 23:06:31 +01:00
Nicolas Goaziou c300a50402 Merge branch 'maint' 2013-01-19 15:40:39 +01:00
Nicolas Goaziou f67370f6ea org-list: Fix bug when repairing checkbox with an ORDERED property
* lisp/org-list.el (org-list-struct-fix-box): When a checkbox has to
  be resetted because of a non-nil ORDERED property value, make sure
  it had a checkbox already.
2013-01-19 15:37:16 +01:00
Bastien Guerry b6615d0179 Merge branch 'maint' 2013-01-01 17:11:12 +01:00
Bastien Guerry f1067fb47c org-list.el (org-cycle-include-plain-lists): Docstring enhancement
* org-list.el (org-cycle-include-plain-lists): Docstring
enhancement.

Thanks to James Harkins for raising this issue.
2013-01-01 16:31:26 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Nicolas Goaziou 0421be2cee Merge branch 'maint' 2012-11-13 15:46:33 +01:00
Nicolas Goaziou 5dbccdb432 org-list: Fix infloop when inserting an item
* lisp/org-list.el (org-list-separating-blank-lines-number): When
  computing number of blank lines separating items, also count those
  in unparsed blocks, like example blocks.
* testing/lisp/test-org-list.el: Add tests.

In the following situation, with `org-blank-before-new-entry' set to
`auto' for `plain-list-item, a blank line should be inserted when
inserting the following item:

- item1
  #+BEGIN_EXAMPLE

  contents

  #+END_EXAMPLE
2012-11-13 15:45:09 +01:00
Carsten Dominik 651dfdfe33 Respect additional arguments to sorting functions
Without this patch, calls to the sorting functions from lisp did not
work as advertised.

* lisp/org-list.el (org-sort-list): Respect sorting-type and getkey-func when
they are specified in the call.

* lisp/org.el (org-sort-entries): Respect sorting-type and getkey-func when
they are specified in the call.
2012-10-09 08:27:17 +02:00
Bastien Guerry 655da8d1d3 Remove useless (t nil) sexps at the end of some (cond ...) constructs
* org.el (org-compute-latex-and-specials-regexp)
(org-paste-subtree, org-sort-entries, org-store-link)
(org-open-at-point, org-file-remote-p, org-add-log-setup)
(org-set-tags-to, org-fast-tag-selection)
(org-diary-sexp-entry): Ditto.

* org-agenda.el (org-agenda-get-blocks, org-cmp-priority)
(org-cmp-effort, org-cmp-todo-state, org-cmp-alpha)
(org-cmp-tag, org-cmp-time): Remove useless (t nil) sexps at
the end of (cond ...) constructs.

* org-mobile.el (org-mobile-create-index-file): Ditto.

* org-lparse.el (org-lparse-format-table-row): Ditto.

* org-list.el (org-sort-list): Ditto.

* org-id.el (org-id-get): Ditto.

* org-html.el (org-export-html-preprocess): Ditto.

* org-exp.el (org-default-export-plist)
(org-table-clean-before-export): Ditto.

(t nil) in (cond (...) (...) (t nil)) has no other meaning that to
remind the developer that the cond sexp returns nil in case no condition
is matched.  For several (cond ...) constructs this is obvious from reading
the code.  For others, the reminder might be useful and we leave it.

See the discussion about this on emacs-devel:
http://thread.gmane.org/gmane.emacs.devel/152664
2012-08-19 14:42:54 +02:00
Nicolas Goaziou ad94a9433b Addendum to 50a434bb9f
* lisp/org-element.el (org-element-item-parser): Do not remove tag
  from body if list isn't descriptive.
* lisp/org-list.el (org-insert-item): Only ask about a term for
  descriptive lists.
(org-list-struct, org-list-insert-item): Do not recognize a tag in an
ordered list.
* testing/lisp/test-org-element.el: Add test.
2012-08-18 13:13:31 +02:00
Nicolas Goaziou 50a434bb9f org-list: Fix list type with mixed constructs
* lisp/org-list.el (org-list-automatic-rules): Remove `bullet' rule,
  which is now hard-coded.
(org-cycle-list-bullet): Hard code `bullet' rule.
(org-list-get-list-type): Make sure a list with numbered bullets
cannot have `descriptive' type.
* testing/lisp/test-org-list.el: Add tests.
2012-08-18 09:30:33 +02:00
Bastien Guerry 70dd1196d2 Massive code clean-up.
Delete trailing whitespaces.
Indent all sexps correctly.
Sentences end with double spaces.
2012-08-11 19:10:44 +02:00
Bastien Guerry cbb7742d3b org-list.el (org-mark-list): Delete.
* org-list.el (org-mark-list): Delete.
2012-07-31 17:15:07 +02:00
Michael Brand 41f427f4bb Description list: improve regexp consistency
* lisp/org-list.el (org-at-item-description-p,
org-list-item-body-column): Make the inline regexp more consistent
with `org-list-full-item-re', the inline regexp "Description list
items" from `org-set-font-lock-defaults and others'.

This resolves some issues with M-q (org-fill-paragraph) on description
lists.
2012-06-12 14:35:05 +02:00
Nicolas Goaziou e5b5656aa2 org-list: Allow check-boxes in description lists
* lisp/org-list.el (org-list-automatic-rules): Allow check-boxes in
  description lists.
(org-list-struct-apply-struct, org-insert-item): Remove rule check.
2012-06-09 14:42:07 +02:00
Nicolas Goaziou 248d3fa76f Merge branch 'maint' 2012-05-08 09:01:47 +02:00
Nicolas Goaziou 56fe788c8f org-list: Fix visibility preservation
* lisp/org-list.el (org-list-struct): Fix white spaces.
(org-list-swap-items, org-list-send-item): Fix visibility
preservation.
2012-05-08 09:00:18 +02:00
Nicolas Goaziou 9cd8b88a40 Merge branch 'maint' 2012-05-07 22:36:34 +02:00
Nicolas Goaziou 200cf5efe1 org-list: Preserve visibility when moving items
* lisp/org-list.el (org-list-swap-items, org-list-send-item): Preserve
  visibility when moving items.
2012-05-07 22:35:41 +02:00
Bastien Guerry c465c7bdf0 org-list.el: Return an error when there is no list at point.
* org-list.el (org-mark-list): Return an error when there is
no list at point.
2012-05-05 10:52:57 +02:00
Nicolas Goaziou 97b0696212 org-list: Fix bugs relative to item indentation
* lisp/org-list.el (org-list-struct-indent): Follow
  `org-list-demote-modify-bullet' specifications for ordered bullets.
(org-list-indent-item-generic, org-indent-item-tree,
org-outdent-item-tree): Fix bug when operating on a region.
(org-outdent-item, org-indent-item): Allow to operate on a region.
* lisp/org.el (org-shiftmetaleft, org-shiftmetaright): Allow to
  operate on a region.
* testing/lisp/test-org-list.el: Add tests.
2012-04-21 12:13:49 +02:00
Nicolas Goaziou dbc6fd1ebf Merge branch 'hotfix' 2012-04-18 13:02:09 +02:00
Nicolas Goaziou 7d6309f132 org-list: Fix bugs relative to item indentation
* lisp/org-list.el (org-list-struct-indent): Follow
  `org-list-demote-modify-bullet' specifications for ordered bullets.
(org-list-indent-item-generic, org-indent-item-tree,
org-outdent-item-tree): Fix bug when operating on a region.
(org-outdent-item, org-indent-item): Allow to operate on a region.
* lisp/org.el (org-shiftmetaleft, org-shiftmetaright): Allow to
  operate on a region.
* testing/lisp/test-org-list.el: Add tests.
2012-04-18 13:01:44 +02:00
Bastien Guerry c19f5c3c0d Add :version to org-list.el options. 2012-04-03 13:32:23 +02:00
Bastien Guerry ecd0562c5f Fix the master branch.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.

This commit also bumps the version number to 7.8.06.

The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
2012-03-19 22:01:29 +01:00
Bastien Guerry 6e306f65ff Fix copyright years in maint. 2012-03-17 16:31:04 +01:00
Bastien Guerry de42649f7b Manually revert maint to e85080.
e85080 is the last correct commit in the maint branch
before releasing 7.8.04.  The 7.8.05 release should be
done from this commit.
2012-03-17 16:28:46 +01:00
Bastien Guerry 73bb18ba37 Manually revert to the Release 7.8.04 tag. 2012-03-17 15:52:24 +01:00
Bastien Guerry 38c5045725 Fix copyright years. 2012-03-17 14:36:25 +01:00
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.

This commit reverts back the maint branch to its state before
merging the master branch.  From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
2012-03-17 14:34:01 +01:00
Bastien Guerry b879590f3b Merge branch 'maint' 2012-03-08 13:50:51 +01:00
Adam Spiers 11e441e85f Fix typos 2012-03-08 13:50:19 +01:00
Nicolas Goaziou b2fb61cd56 Merge branch 'maint' 2012-02-29 21:04:52 +01:00
Nicolas Goaziou bdb66b4c61 org-list: Fix small bug
* lisp/org-list.el (org-list-struct): Fix small bug introduced by
  commit 8b7a3f2498.
* testing/lisp/test-org-list.el: Add test.
2012-02-29 21:04:15 +01:00
Nicolas Goaziou 3869bf1b0b org-list: Whitespace cleanup 2012-02-21 11:59:12 +01:00
Nicolas Goaziou 387bd87c73 org-list: Implement a function to return an item sequence number
* lisp/org-list.el (org-list-get-item-number): New function.
2012-02-20 16:07:14 +01:00
Nicolas Goaziou 8b7a3f2498 org-list: Remove two defcustoms
* lisp/org-list.el (org-list-ending-method, org-list-end-regexp):
  Removed variables.
(org-in-item-p, org-list-separating-blank-lines-number,
org-list-parse-list, org-list-struct): Apply changes.
* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): Apply changes.
* lisp/org-latex.el (org-export-latex-lists): Apply changes.
* doc/org.texi (Plain lists): Document removal.

Conflicts:

	lisp/org-list.el
2012-02-19 09:16:21 -07:00
Bastien Guerry d5ca0780f9 Fix typos and spelling mistakes.
Thanks to Paul Eggert for this fixes in Emacs trunk.
2012-02-19 08:23:42 -07:00
Nicolas Goaziou cf87d15483 org-list: Remove two defcustoms
* lisp/org-list.el (org-list-ending-method, org-list-end-regexp):
  Removed variables.
(org-in-item-p, org-list-separating-blank-lines-number,
org-list-parse-list, org-list-struct): Apply changes.
* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): Apply changes.
* lisp/org-latex.el (org-export-latex-lists): Apply changes.
* doc/org.texi (Plain lists): Document removal.
2012-02-17 00:04:34 +01:00
Bastien Guerry 04971de4b9 Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1)
* org-exp.el (org-export-kill-product-buffer-when-displayed)
(org-export-initial-scope, org-export-date-timestamp-format)
(org-export-with-tasks, org-export-email-info)
(org-export-table-remove-empty-lines): Add version tag.

* org-mobile.el (org-mobile-files-exclude-regexp)
(org-mobile-use-encryption, org-mobile-encryption-tempfile)
(org-mobile-encryption-password, org-mobile-agendas): Add
version tag.

* ob-plantuml.el (org-plantuml-jar-path): Add version tag.

* org.el (org-babel-load-languages, org-clone-delete-id)
(org-log-buffer-setup-hook)
(org-loop-over-headlines-in-active-region)
(org-use-sub-superscripts, org-startup-with-beamer-mode)
(org-startup-with-inline-images, org-ctrl-k-protect-subtree)
(org-catch-invisible-edits)
(org-link-search-must-match-exact-headline)
(org-confirm-shell-link-not-regexp)
(org-confirm-elisp-link-not-regexp, org-log-refile)
(org-refile-use-cache)
(org-refile-active-region-within-subtree)
(org-todo-repeat-to-state, org-get-priority-function)
(org-agenda-jump-prefer-future)
(org-read-date-force-compatible-dates)
(org-use-effective-time)
(org-complete-tags-always-offer-all-agenda-tags)
(org-properties-postprocess-alist)
(org-format-latex-signal-error)
(org-latex-to-mathml-jar-file)
(org-latex-to-mathml-convert-command)
(org-export-latex-default-packages-alist)
(org-hidden-keywords, org-pretty-entities)
(org-pretty-entities-include-sub-superscripts)
(org-src-fontify-natively, org-effort-durations)
(org-speed-command-hook): Add version tag.

* org-html.el (org-export-html-footnote-separator)
(org-export-html-mathjax-options)
(org-export-html-mathjax-template)
(org-export-html-headline-anchor-format)
(org-export-html-preamble-format)
(org-export-html-postamble-format)
(org-export-html-table-align-individual-fields)
(org-export-html-protect-char-alist, org-export-html-divs):
Add version tag.

* org-ctags.el (org-ctags-path-to-ctags)
(org-ctags-open-link-functions)
(org-ctags-new-topic-template): Add version tag.

* ob-exp.el (org-export-babel-evaluate): Add version tag.

* org-beamer.el (org-beamer-use-parts)
(org-beamer-frame-level, org-beamer-frame-default-options)
(org-beamer-column-view-format, org-beamer-themes)
(org-beamer-environments-extra, org-beamer-fragile-re)
(org-beamer-outline-frame-title)
(org-beamer-outline-frame-options): Add version tag.

* org-wl.el (org-wl-link-remove-filter)
(org-wl-shimbun-prefer-web-links)
(org-wl-nntp-prefer-web-links, org-wl-disable-folder-check)
(org-wl-namazu-default-index): Add version tag.

* org-clock.el (org-task-overrun-text)
(org-clocktable-defaults, org-clock-clocktable-formatter)
(org-clock-clocktable-language-setup)
(org-clock-report-include-clocking-task)
(org-clock-resolve-expert): Add version tag.

* ob-lob.el (org-babel-lob-files): Add version tag.

* org-freemind.el (org-freemind-node-css-style): Add version
tag.

* org-archive.el (org-archive-reversed-order)
(org-archive-subtree-add-inherited-tags): Add version tag.

* org-bibtex.el (org-bibtex-autogen-keys, org-bibtex-prefix)
(org-bibtex-treat-headline-as-title)
(org-bibtex-export-arbitrary-fields)
(org-bibtex-key-property, org-bibtex-tags)
(org-bibtex-tags-are-keywords, org-bibtex-no-export-tags)
(org-bibtex-type-property-name): Add version tag.

* org-timer.el (org-timer-default-timer): Add version tag.

* org-taskjuggler.el (org-export-taskjuggler-extension)
(org-export-taskjuggler-project-tag)
(org-export-taskjuggler-resource-tag)
(org-export-taskjuggler-target-version)
(org-export-taskjuggler-default-project-version)
(org-export-taskjuggler-default-project-duration)
(org-export-taskjuggler-default-reports)
(org-export-taskjuggler-default-global-properties): Add
version tag.

* org-habit.el (org-habit-today-glyph)
(org-habit-completed-glyph): Add version tag.

* org-list.el (org-alphabetical-lists)
(org-list-ending-method, org-list-end-regexp)
(org-list-automatic-rules, org-list-use-circular-motion)
(org-list-indent-offset): Add version tag.

* ob-picolisp.el (org-babel-picolisp-cmd): Add version tag.

* org-icalendar.el (org-icalendar-alarm-time)
(org-icalendar-combined-description)
(org-icalendar-honor-noexport-tag)
(org-icalendar-date-time-format): Add version tag.

* org-src.el (org-src-tab-acts-natively): Add version tag.

* org-exp-blocks.el (org-export-blocks-postblock-hook): Add
version tag.

* org-table.el (org-table-exit-follow-field-mode-when-leaving-table)
(org-table-fix-formulas-confirm)
(org-table-duration-custom-format)
(org-table-formula-field-format): Add version tag.

* org-publish.el (org-publish-sitemap-sort-files)
(org-publish-sitemap-sort-folders)
(org-publish-sitemap-sort-ignore-case)
(org-publish-sitemap-date-format)
(org-publish-sitemap-file-entry-format): Add version tag.

* ob-js.el (org-babel-js-cmd): Add version tag.

* org-docbook.el (org-export-docbook-footnote-separator)
(org-export-docbook-xslt-stylesheet): Add version tag.

* org-entities.el (org-entities-ascii-explanatory)
(org-entities-user): Add version tag.

* ob.el (org-confirm-babel-evaluate)
(org-babel-no-eval-on-ctrl-c-ctrl-c): Add version tag.

* ob-tangle.el (org-babel-tangle-lang-exts)
(org-babel-post-tangle-hook, org-babel-pre-tangle-hook)
(org-babel-tangle-body-hook)
(org-babel-tangle-comment-format-beg)
(org-babel-tangle-comment-format-end)
(org-babel-process-comment-text): Add version tag.

* org-gnus.el (org-gnus-nnimap-query-article-no-from-file):
Add version tag.

* org-crypt.el (org-crypt-disable-auto-save): Add version tag.

* org-inlinetask.el (org-inlinetask-default-state): Add
version tag.

* ob-scheme.el (org-babel-scheme-cmd): Add version tag.

* ob-lisp.el (org-babel-lisp-dir-fmt): Add version tag.

* org-attach.el (org-attach-store-link-p): Add version tag.

* org-capture.el (org-capture-templates)
(org-capture-before-finalize-hook)
(org-capture-after-finalize-hook): Add version tag.

* org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled)
(org-agenda-time-leading-zero, org-agenda-follow-indirect)
(org-agenda-menu-two-column, org-agenda-menu-show-matcher)
(org-agenda-timegrid-use-ampm)
(org-agenda-remove-timeranges-from-blocks)
(org-agenda-inactive-leader, org-agenda-current-time-string)
(org-agenda-show-current-time-in-grid)
(org-agenda-search-view-force-full-words)
(org-agenda-search-view-always-boolean)
(org-agenda-clock-consistency-checks)
(org-agenda-include-deadlines)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-day-face-function)
(org-agenda-category-icon-alist)
(org-agenda-bulk-custom-functions)
(org-agenda-insert-diary-extract-time): Add version tag.

* org-latex.el (org-export-latex-inputenc-alist)
(org-export-latex-tag-markup)
(org-export-latex-timestamp-inactive-markup)
(org-export-latex-href-format)
(org-export-latex-hyperref-format)
(org-export-latex-footnote-separator)
(org-export-latex-quotes)
(org-export-latex-table-caption-above)
(org-export-latex-listings-w-names)
(org-export-latex-minted-langs)
(org-export-latex-listings-options)
(org-export-latex-minted-options)
(org-latex-default-figure-position, org-export-pdf-logfiles):
Add version tag.

* org-faces.el (org-faces-easy-properties)
(org-fontify-quote-and-verse-blocks, org-cycle-level-faces):
Add version tag.

* ob-ditaa.el (org-ditaa-jar-option): Add version tag.

Thanks to Glenn Morris for reporting this.
2012-02-13 15:49:28 +01:00
Bastien Guerry aee6f9008a New function `org-mark-list' bound to `C-c C-@'.
* org-list.el (org-mark-list): New function.

* org.el (org-mode-map): Add a keybinding for the new function.
2012-01-25 13:52:20 +01:00
Bastien Guerry fadca5e8eb Fix typos and spelling mistakes.
Thanks to Paul Eggert for this fixes in Emacs trunk.
2012-01-10 11:56:15 +01:00
Bastien Guerry e44d2975ff Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
Bastien Guerry b73075a8d2 Code cleanup up: rename org-on-*-p to org-at-*-p.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.

Also define two aliases.
2012-01-02 19:52:35 +01:00
Nicolas Goaziou 8c19c76d2e org-list: Change behaviour of C-c C-c at a list item with an argument
* lisp/org-list.el (org-list-write-struct): Add an optional argument
  for structure changes happening outside the function.
* lisp/org.el (org-ctrl-c-ctrl-c): Now, C-u C-c C-c on the first item
  of a sub-list should toggle check-box presence of every item in the
  same sub-list.  Also fix check-box insertion on a single item.
2011-12-31 17:35:37 +01:00
Nicolas Goaziou 809318dd5b Better handling of ill-formed lists
* lisp/org-list.el (org-list-parents-alist): When no parent is found
  for an item, set it as the closest less indented item above.  If
  none is found, make it a top level item.
(org-list-write-struct): Externalize code.
(org-list-struct-fix-item-end): New function.
(org-list-struct): Remove a now useless fix.
* lisp/org.el (org-ctrl-c-ctrl-c): Use new function.
2011-10-02 23:17:11 +02:00
Nicolas Goaziou 0019b6f193 org-list: fix code typo 2011-08-24 02:11:36 +02:00
Nicolas Goaziou 08ca5be491 org-list: tiny code change
* lisp/org-list.el (org-list-struct-apply-struct): don't
  use (copy-marker (point)) instead of (point-marker).
2011-08-23 22:20:55 +02:00
Nicolas Goaziou 8bb1a0c57f org-list: forgot a double space 2011-08-23 22:19:14 +02:00
Nicolas Goaziou 969baac557 org-list: corrections to commentary section and add linefeed 2011-08-23 22:17:20 +02:00
Nicolas Goaziou 065c5c3241 Make some files pass checkdoc test 2011-08-23 21:43:30 +02:00
Nicolas Goaziou 405ebb43df org-list: remove dependency on `org-back-over-empty-lines'
* lisp/org-list.el (org-list-separating-blank-lines-number): the
  behaviour of `org-back-over-empty-lines' depends on the associated
  value of `headline' in `org-blank-before-new-entry', which is out of
  context in a list.
2011-08-21 21:39:56 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Nicolas Goaziou b6fab3770b org-list: remove left-over commented code and clean white space 2011-08-16 10:23:04 +02:00
Bastien Guerry ad23b7d173 Fix bzg email address (s/altern/gnu). 2011-08-15 21:22:30 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Nicolas Goaziou dfda5fc8b4 org-list: get correct structure with empty items
* lisp/org-list.el (org-list-full-item-re): when an item has only
  a bullet and no space after it, list structure would not be
  recognized correctly.
2011-08-15 18:29:37 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
Bastien Guerry d9b7afd835 org-list.el: Allow the generic list exporter to trim line breaks in items.
* org-list.el (org-list-item-trim-br): New function.
(org-list-to-generic): New parameter :nobr to use the new
function.
2011-08-14 16:38:55 +02:00
John Wiegley d24a141d96 Renamed unnecessary use of sort* to sort 2011-08-13 16:43:22 -05:00
Nicolas Goaziou 1bbfec57af org-list: don't clear marker while still in use
* lisp/org-list.el (org-toggle-checkbox): don't clear lim-down while
  used in the while loop.
2011-08-12 15:17:48 +02:00
Nicolas Goaziou b4aee73ef1 org-list: fix bug in `org-toggle-checkbox' on current item
* lisp/org-list.el (org-toggle-checkbox): lim-down must be a marker.
2011-08-12 15:11:19 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Nicolas Goaziou 4f85aa21c6 org-list: fix a small error when guessing blank lines before items
* lisp/org-list.el: search blank lines down to the end of the item
  instead of stopping at the item, in order to possibly match such
  lines within the item.
2011-07-26 17:46:55 +02:00
Nicolas Goaziou ba092ec08d Do not add an extraneous blank lines when parsing lists
* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): don't remove the ending regexp
  when it consists in blank lines.
* lisp/org-list.el (org-list-parse-list): ditto, but remove it
  completely when it isn't made of blank lines (i.e. during export process).
2011-07-24 20:03:30 +02:00
Bastien Guerry 5c53026d32 Fix (a lot of) compiler warnings.
Also introduce `org-pop-to-buffer-same-window' as a compatibility
function for Emacs =>24.1.
2011-07-18 19:25:10 +02:00
Nicolas Goaziou a161ecfd6a org-list: move point after asking for new term when inserting an item
* lisp/org-list.el (org-list-insert-item): actualize code comments.
(org-insert-item): for consistency, point cannot be moved at
a surprising place when the user is being asked to choose a new
description term to insert in the list. Point should stay where the
user called the command.
2011-07-18 13:51:15 +02:00
Nicolas Goaziou f7f2394448 org-list: clean left-over markers
* lisp/org-list.el (org-list-send-item, org-list-struct-apply-struct,
  org-apply-on-list, org-toggle-checkbox): make markers point nowhere
  when they have become useless.
2011-07-18 00:57:01 +02:00
Nicolas Goaziou 054230b138 org-list: never add useless blank lines when inserting an item
* lisp/org-list.el (org-list-insert-item): when insertion point is in
  some white line after the end of the list, remove all unnecessary
  white lines there before proceeding. Also refactor a snippet of
  code.
2011-07-17 22:54:21 +02:00
Nicolas Goaziou 108bd48e25 org-list: introduce a variable to distinguish sub-items better
* lisp/org-list.el (org-list-indent-offset): new variable.
(org-list-struct-fix-ind): make use of the new variable.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou aad4a7d4d3 Complete default values for check-boxes in LaTeX exporter
* lisp/org-latex.el (org-export-latex-list-parameters): complete
  default value with cbtrans option.
* lisp/org-list.el (org-list-to-latex): set a more consistent default
  value.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou 90ef02a02b org-list: move and rename org-list-exchange-items
* lisp/org-list.el (org-list-swap-items): move it to a meaningful
  position in source code (i.e. before any function using it), and
  rename it to an easier name.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou 688a29c0d6 org-list: change heuristics for number of lines separating items
* lisp/org-list.el (org-list-separating-blank-lines-number): if there
  are blank lines already in the whole list, add a blank line.
2011-07-12 09:12:19 +02:00
Nicolas Goaziou 41355053e6 org-list: introduce a variable to consider lists as rings
* lisp/org-list.el (org-list-use-circular-move): new variable.
(org-previous-item, org-next-item): make use of the new variable.
(org-move-item-down, org-move-item-up): make use of the new
variable. Simplify code.
2011-07-12 09:12:13 +02:00
Nicolas Goaziou 6338eb72a6 org-list: add a new method on lists (org-list-send-item)
* lisp/org-list.el (org-list-delete-item, org-list-send-item): new
  functions.
2011-07-12 09:09:34 +02:00
Nicolas Goaziou ecabda5603 org-list: docstring update
* lisp/org-list.el (org-plain-list-ordered-item-terminator): remove
  incorrect assumption.
2011-07-10 10:40:03 +02:00
Nicolas Goaziou dc85f45194 More forbidden blocks for lists and footnotes
* lisp/org-footnote.el (org-footnote-forbidden-blocks): add missing
  exporter specific blocks.
* lisp/org-list.el (org-list-forbidden-blocks): ditto.
2011-07-10 10:33:25 +02:00
Nicolas Goaziou d29fcc50ea org-list: make use of new `org-in-block-p' function
* lisp/org-list.el (org-list-in-valid-context-p): use `org-in-block-p'.
2011-07-08 18:08:34 +02:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Nicolas Goaziou 934aae8812 Allow white spaces between the counter and the check-box in an item
* lisp/org-list.el (org-list-full-item-re): allow counter and
  check-box to be separated by white spaces.
(org-list-struct-apply-struct): reflect changes made to
`org-list-full-item-re'.
* lisp/org-html.el (org-html-export-list-line): recognize spaces
  between counter and check-boxes as valid.
* lisp/org-docbook.el (org-export-docbook-list-line): ditto.
2011-06-30 22:57:18 +02:00
Nicolas Goaziou e070ebe6b0 org-list: org-list-insert-item respects its POS argument value
* lisp/org-list.el (org-list-insert-item): make sure point is moved
  to the specified POS before starting the function.
2011-06-30 20:35:56 +02:00
Nicolas Goaziou cc76e76509 org-list: fix bug with item cycling
* lisp/org-list.el (org-cycle-item-indentation): cycling back to
  original position deleted any additional information in the item,
  like a counter or a tag.
2011-06-28 20:26:49 +02:00
Nicolas Goaziou c4086ad1e4 org-list: doc-strings white-spaces fixes 2011-06-28 20:26:49 +02:00
Carsten Dominik 67893d3158 Declare a function to keep compiler happy 2011-06-24 06:47:32 +02:00
Nicolas Goaziou a0bc3bdebc org-list: fix update of check-boxes cookies in whole trees
* lisp/org-list.el (org-reset-checkbox-state-subtree): make the
  command more robust, and correctly update check-boxes in the whole
  sub-tree.
(org-update-checkbox-count): fix bug accumulating count of checkboxes
when walking a subtree.
(org-update-checkbox-count-maybe): add an optional argument passed to
org-update-checkbox-count.

Thanks to Paul Mead for the report.
2011-06-20 21:59:58 +02:00
Nicolas Goaziou 432c53a474 org-list: add a way to configure transitional check-boxes export
* lisp/org-list.el (org-list-parse-list): replace transitional
check-boxes with "[CBTRANS]" string during parsing.
(org-list-to-generic): use the new property `:cbtrans' to configure
export string for transitional check-boxes.
2011-06-17 15:11:49 +02:00
Nicolas Goaziou 889a487ae4 org-list: fix item's start number in LaTeX exporter
* lisp/org-list.el (org-list-to-latex): the enumerate environment in
latex increments the counter before using it. Therefore, org-mode
should set the enumeration counter to the desired value minus one.

Patch from Darlan Cavalcante Moreira
TINYCHANGE
2011-06-10 15:50:51 +02:00
Nicolas Goaziou 51946c36d7 Keep byte-compiler happy 2011-06-06 20:46:31 +02:00
Nicolas Goaziou ddeab1a8af Changes automatically made to cookies shouldn't move tags
* lisp/org.el (org-auto-align-tags): change docstring.
(org-update-parent-todo-statistics): keep tags aligned even when
statistics cookies are shifting them.
* lisp/org-list.el (org-update-checkbox-count): keep tags aligned even
when statistics cookies are shifting them.
2011-06-05 18:55:25 +02:00
Nicolas Goaziou b39a271fcb Keep byte-compiler happy 2011-05-28 18:16:34 +02:00
Nicolas Goaziou ddc2467387 Fix list before first heading conversion to odd levels subtree
* lisp/org-list.el (org-list-to-subtree): if the list is before first
  heading and `org-odd-levels-only' is non-nil, the first item gets
  two stars instead of one.
* lisp/org.el (org-reduced-level): a level of 0 was reduced to 1 with
  `org-odd-levels-only' non-nil.
2011-05-28 14:13:11 +02:00
Nicolas Goaziou 8f0ea16167 Ignore lists within exporters specific blocks
* lisp/org-exp.el (org-export-mark-list-properties): even if context
  is invalid, mark list item with `list-context' property.
* lisp/org-list.el (org-list-forbidden-blocks): add exporters specific
  blocks to the list of forbidden blocks.

Thanks to Jai Bharat Patel for reporting this.
2011-05-27 16:53:54 +02:00
Nicolas Goaziou f194eb1719 org-list: fix bug when sorting a list with a custom function
* lisp/org-list.el (org-sort-list): function tries to intern
  getkey-func before it is defined, so it's always nil.

Based on a patch from Le Wang.
2011-05-26 17:48:25 +02:00
Nicolas Goaziou 2500c6b1c8 org-list: fix heuristics for number of lines to insert with a new item
* lisp/org-list.el (org-list-separating-blank-lines-number): fix
  confusion between point and item beginning. Now, if no information
  is avalaible, truly follow user preference when it inserts blank
  lines manually.
  (org-list-insert-item): send correct argument to the preceding
  function.
2011-05-15 22:38:56 +02:00
Nicolas Goaziou 946640d84d org-list: correctly identify description lists
* lisp/org-list.el (org-list-full-item-re): allow description term to
  have a newline character after the colons.
2011-05-07 02:33:13 +02:00
Nicolas Goaziou 073ab7de83 org-list: check with-case argument when sorting a list alphabetically
* lisp/org-list.el (org-sort-list): no longer ignore with-case
  argument: the function sorted case-sensitively, regardless of
  argument.
2011-05-07 02:17:19 +02:00
Nicolas Goaziou 7327b483f1 org-list: small docstring fix 2011-04-24 11:25:40 +02:00
Nicolas Goaziou fc91845fa5 org-list: fix bug with structure and blocks/drawers indentation
* lisp/org-list.el (org-list-struct): when walking down the list, the
  function would not pay attention to drawers or blocks indentation.
  Thus, such constructs couldn't consistently end an item or a list.
  This patch ensures line indentation is stored (if applicable) before
  skipping them. Also fixed doc-string and comments.
2011-04-24 11:23:01 +02:00
Nicolas Goaziou a7a4693f66 org-list: don't forget to allow alphabetical counters 2011-04-09 16:09:32 +02:00
Nicolas Goaziou abad1b4994 Auto-fill shouldn't insert new items
* lisp/org-list.el (org-list-in-valid-context-p): renamed from
  org-list-in-valid-block-p.
  (org-at-item-p,org-list-search-generic): use renamed function.

* lisp/org.el (org-fill-item-nobreak-p): new function.
  (org-set-autofill-regexps): modify `fill-nobreak-predicate' to
  prevent auto-fill from breaking line just before an item regexp.
2011-04-09 13:20:37 +02:00
Nicolas Goaziou 2f72b3efcb org-list: fix cookie updating
* lisp/org-list.el: move org-update-checkbox-count-maybe call outside
  of save-excursion to get back to original position.
2011-03-30 19:00:45 +02:00
Nicolas Goaziou d9c5b384f8 org-list: org-keyword-time-regexp might be nil in other major modes
* lisp/org-list.el (org-toggle-checkbox): build value of
  org-keyword-time-regexp instead of using it directly, as it's
  buffer-local, and function might be called outside Org.
2011-03-23 21:02:38 +01:00
Nicolas Goaziou 051b5b291c org-list: fix infinite loop on erroneous block and drawer constructs
* lisp/org-list.el (org-list-struct,org-in-item-p): don't assume end
  of blocks or drawers necessarily start somewhere. It it isn't the
  case, treat them as normal text.
2011-03-23 18:33:05 +01:00
Nicolas Goaziou 06ca884162 org-list: fix bug with org-toggle-checkbox
* lisp/org-list.el (org-list-checkbox): when called from an headline,
  function would normally skip drawers, but not if a SCHEDULED or
  DEADLINE keyword is standing before the drawer. Also avoid problems
  if function is called in buffers not is Org mode.
2011-03-23 17:38:16 +01:00
Nicolas Goaziou 74169a8029 org-list: org-drawer-regexp is nil outside Org buffers
* lisp/org-list.el (org-in-item-p): re-build org-drawer-regexp,
  whatever the major mode is.
2011-03-20 09:10:53 +01:00
Nicolas Goaziou b6fc03b70c org-list: enhance list transformations and fix glitches
* lisp/org-list.el (org-list-to-generic): set a default term for
  ill-formed description lists. Do not insert newline characters
  unless told to.
  (org-list-to-texinfo,org-list-to-html): apply changes to
  `org-list-parse-liste'.
2011-03-17 16:11:04 +01:00
Nicolas Goaziou f8c627a44b org-list: fix parsing of counters
* lisp/org-list.el (org-list-parse-list): fixed regexp.
2011-03-14 23:36:19 +01:00
Nicolas Goaziou df26ae8e69 Checkboxes should progress from intermediate state to checked
Thanks to Matt Lundin for pointing that out.
2011-03-12 16:40:37 +01:00
Nicolas Goaziou f8ca5d85ba org-list: small refactoring
* lisp/org-list.el (org-list-in-valid-block-p): new function.
(org-at-item-p,org-list-search-generic): use new function.
2011-03-09 20:30:18 +01:00
Nicolas Goaziou 4090006ab1 org-list: fix confusion due to indent-tabs-mode 2011-03-08 23:49:39 +01:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Nicolas Goaziou 38877e6cf9 org-list: update statistical cookies with check-boxes in an hidden subtree
* lisp/org-list.el (org-update-checkbox-count): Ensure cookies on an
  heading are correctly updated when checkboxes are hidden. It allows,
  for example, to use C-c C-x C-b on a collapsed tree and still get
  the update.
2011-03-06 21:34:35 +01:00
Nicolas Goaziou 1ecee90f47 org-list: slight speed-up for org-list-context 2011-03-06 16:00:34 +01:00
Nicolas Goaziou b65280ae2b org-list: fix infinite loop introduced by last refactoring 2011-03-01 12:22:13 +01:00
Nicolas Goaziou fcf66e74c6 org-list: refactor code 2011-02-28 22:33:31 +01:00
Nicolas Goaziou 7b211c86e7 org-list: fix insertion of item with indent-tabs-mode is non-nil
* lisp/org-list.el (org-list-insert-item): when computing size of item
  being inserted, function has to take into account that indentation
  may not only be made of spaces.
2011-02-25 20:48:27 +01:00
Nicolas Goaziou 7745ad28c3 org-list: fix checkbox toggling
* lisp/org-list.el (org-toggle-checkbox): fix bug where top item in
  list was omitted when checking boxes.

Patch from Nick Dokos.
2011-02-25 18:16:24 +01:00
Nicolas Goaziou 6489346093 Make byte-compiler happy 2011-02-22 20:55:41 +01:00
Nicolas Goaziou 90ad814703 org-list: indentation has precedence over visibility cycling
* lisp/org-list (org-cycle-item-indentation): do not break an
  indentation cycle because visibility cycling is requested. This
  happens when an item becomes a parent, due to indentation change.
  Not considered empty anymore, the function cannot change its
  indentation again.
2011-02-22 18:57:57 +01:00
Nicolas Goaziou 9dc1ac5660 org-list: refactor code 2011-02-22 18:46:33 +01:00
Nicolas Goaziou 99aa57fb20 org-list: cycling indentation must not add white spaces at eol
* lisp/org-list.el (org-cycle-item-indentation): each time the
  function moves item back to child position, a white space is added
  to the line.
2011-02-20 17:38:26 +01:00
Nicolas Goaziou fde7e150bb org-list: docstrings changes 2011-02-18 13:43:49 +01:00
Nicolas Goaziou 19ea827cd7 org-list: unwrap org-entry-get from ignore-errors
* lisp/org-list.el (org-toggle-checkbox, org-update-checkbox-count):
  no need to wrap org-entry-get in ignore-errors since commit
  7dd425cc5d
2011-02-18 13:43:49 +01:00
Nicolas Goaziou f6bbdaf7cc org-list: minor fix in regexp 2011-02-18 12:45:13 +01:00
Nicolas Goaziou b43ad47ad1 Insert a newline character before <\li> when exporting lists
* lisp/org-html.el (org-html-export-list-line): insert a newline
  character before ending an item, as anchor could be on a line
  going to be deleted, like a drawer ending string.
* lisp/org-list.el (org-list-to-html): same.
2011-02-18 12:45:13 +01:00
Nicolas Goaziou 2de0a87f7d org-list: apply removal of org-invisible-p 2011-02-18 12:45:12 +01:00