Commit Graph

611 Commits

Author SHA1 Message Date
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