Commit Graph

313 Commits

Author SHA1 Message Date
Bastien Guerry 2911965bfe org-agenda: Fix bug when showing the new time
* org-agenda.el (org-agenda-show-new-time): Ignore invisible
text when inserting the new time as a text property.

* org-compat.el (org-move-to-column): New argument
`ignore-invisible' to turn on `buffer-invisibility-spec'.

Thanks to Marcin Borkowski and Karl Voit for reporting this.
2013-11-06 09:59:46 +01:00
Carsten Dominik 7f9d0688d4 Fix cursor movement to a specific column
* lisp/org-compat.el (org-move-to-column): Turn off invisibility stuff
for moving the cursor to a column.

Pathc by Nick Dokos
2013-08-31 15:44:34 +02:00
Bastien Guerry ef98a614f6 org-compat.el: Fix indentation. 2013-06-11 03:17:27 +02:00
Achim Gratz 2e4bcfc50d org-compat: XEmacs actually needs the argument lists...
org-compat (define-obsolete-variable-alias,
define-obsolete-function-alias): Re-introduce argument lists as
XEmacs' byte-compiler otherwise stops compilation.

This means that no other advices must modify these functions with a
different argument list.
2013-06-10 20:47:41 +02:00
Achim Gratz d7eed32784 org-compat: remove argument lists from defadvice, use positional arguments instead
org-compat (custom-handle-keyword, define-obsolete-variable-alias,
define-obsolete-function-alias): Remove argument lists from defadvice
and use positional arguments instead of named arguments.
2013-06-10 20:13:43 +02:00
Achim Gratz 66057bd2a8 org-compat: strip last argument from define-obsolete-{function,variable}-alias for XEmacs
* lisp/org-compat.el (define-obsolete-variable-alias,
  define-obsolete-function-alias): Actually remove the third (and any
  following) argument from the argument list before calling the
  advised function.
2013-06-10 19:45:55 +02:00
Achim Gratz d36a933c65 Compatibility: fix XEmacs compilation failures
* lisp/ob-eval.el, lisp/ob.el, lisp/org-macro.el, lisp/org-mhe.el:
  Require org-macs and org-compat as necessary.
* lisp/ob-tangle.el: Declare function `org-store-link' and
  `org-open-link-from-string'.
* lisp/org-compat.el: Extend eval-and-compile clause and add advices
  for functions that have different parameter lists in XEmacs. Add
  variable definitions that XEmacs lacks .
* lisp/org-macs.el (declare-function): Define macro to use autoload
  instead for XEmacs.
* lisp/ox-html.el, lisp/ox-odt.el: XEmacs does not have table.el, so
  use 'noerror on the require form.
* lisp/ox-texinfo.el (org-texinfo-table-column-widths): Fix spliced
  argument list that XEmacs complains about by adding parenthesis.

This fixes all compilation failures on XEmacs and warnings related to
Org that indicate that XEmacs has compiled things wrongly (for
instance it might have interpreted a function as a variable symbol).
There are still many warnings that probably indicate serious problems.
2013-06-01 11:31:07 +02:00
Bastien Guerry 308f380ebc org-compat.el (org-ignore-region): Tiny docstring fix
* org-compat.el (org-ignore-region): Tiny docstring fix.
2013-03-26 12:50:14 +01:00
Bastien Guerry f9224ea36a lisp/org-compat.el (org-defvaralias): Fix declare form
* lisp/org-compat.el (org-defvaralias): Fix declare form.
2013-03-15 12:06:44 +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 bc7dbcab9f org.el (org-insert-heading): DTRT when in a narrowed region
* org.el (org-insert-heading): DTRT when in a narrowed region.

* org-compat.el (org-buffer-narrowed-p): New compatibility
function.

Thanks to Samuel Wales for reporting this problem.
2013-03-13 10:57:49 +01:00
Bastien Guerry 372a3ecda8 New compatibility macro `org-with-silent-modifications'
* org-macs.el: Don't define `with-silent-modifications' for
emacsen that don't have it.

* org-compat.el (org-with-silent-modifications): New
compatibility macro.

* org.el (org-refresh-category-properties)
(org-refresh-properties, org-entry-blocked-p)
(org-agenda-prepare-buffers):
* org-indent.el (org-indent-remove-properties)
(org-indent-add-properties):
* org-colview.el (org-columns-display-here)
(org-columns-remove-overlays, org-columns-quit)
(org-columns-edit-value, org-columns-compute-all)
(org-columns-compute, org-agenda-colview-compute):
* org-clock.el (org-clock-sum): Use the compatibility macro
`org-with-silent-modifications' instead of
`with-silent-modifications'.

Thanks to Achim for a preliminary patch.
2013-02-25 11:44:27 +01:00
Bastien Guerry 5ea1322c99 org-compat.el (org-file-equal-p): New compatibility function
* org-compat.el (org-file-equal-p): New compatibility function.

* ox.el (org-export-output-file-name): Use the new function.

Thanks to Mark Edgington for reporting this.
2013-02-19 18:01:03 +01:00
Bastien Guerry 7369cada30 Merge branch 'maint' 2013-01-13 11:17:56 +01:00
Bastien Guerry e8f5b0ad72 Delete `org-condition-case-unless-debug'
* org-compat.el (org-condition-case-unless-debug): Delete.

* org-odt.el (org-odt-cleanup-xml-buffers): Use
`condition-case' instead of `org-condition-case-unless-debug',
which is now deleted.
2013-01-13 09:27:08 +01:00
Bastien Guerry 3a5a4ddd41 Revert "Backwards compatibility: don't defalias special forms"
This reverts commit b63275350f.
2013-01-13 09:24:43 +01:00
Bastien Guerry 04eb4b08c3 Revert "Compatibility: Use org-define-obsolete-{function,variable}-alias"
This reverts commit 305f29776f.
2013-01-13 09:19:24 +01:00
Achim Gratz 409ee8a2f2 Compatibility: XEmacs does not have user-emacs-directory, use user-init-directory instead
* lisp/org-compat.el (user-emacs-directory): If not bound, define as an alias to
  `user-init-directory´ so that XEmacs continues to be happy with Org.
2013-01-12 18:24:18 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +01:00
Achim Gratz 305f29776f Compatibility: Use org-define-obsolete-{function,variable}-alias
* lisp/org-compat.el (org-define-obsolete-function-alias,
  org-define-obsolete-variable-alias): Introduce new compatibility
  macros to obsolete functions and variables.

* lisp/org-agenda.el, lisp/org-clock.el, lisp/org-id.el,
  lisp/org-lparse.el, lisp/org-protocol.el lisp/org.el: Use
  `org-define-obsolete-{function,variable}-alias´instead of
  `define-obsolate{function,variable}-alias´.
2013-01-06 18:29:05 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Bastien Guerry 1b4e396b6b Merge branch 'maint-fixes' into maint 2012-12-24 14:01:25 +01:00
Achim Gratz b63275350f Backwards compatibility: don't defalias special forms
* lisp/org-compat.el (org-condition-case-unless-debug): Do not use
  defalias for special forms, the Emacs 22 byte-compiler does not
  recognize them correctly when compiling macros.  Use a macro instead
  and rely on macro expansion.  That however makes the decision at
  compile time, which should be acceptable in this case since it only
  affects debugging.
2012-12-24 14:01:14 +01:00
Bastien Guerry 58999598ed New compatibility function `org-delete-directory'
* org-compat.el (org-delete-directory): New compatibility
function for Emacs 22, where `delete-directory' does not
support recursive deletion.

* org-odt.el (org-odt-cleanup-xml-buffers): Use the new
compatibility function.

Thanks to Achim and Jambunathan for suggesting this.
2012-12-24 13:51:48 +01:00
Achim Gratz b508943d32 org-compat: new macro org-no-popups
* lisp/org-compat.el (org-no-popups): New wrapper macro which
  let-binds the correct variables to suppress popup windows depending
  on the Emacs version in use.  This is a compile-time decision when
  byte-compiling.

* lisp/org.el (org-get-location, org-switch-to-buffer-other-window):
  Use the wrapper `org-no-popups´ to let-bind the correct variables
  for suppression of popup windows.
2012-12-20 12:57:52 +01:00
Bastien Guerry 23e2346c4c org-compat.el: Fix bug: don't use `eval-when-compile' when aliasing `user-error'.
* org-compat.el: Fix bug: don't use `eval-when-compile' when
aliasing `user-error'.

Thanks to Bernt Hansen for reporting this bug.
2012-12-19 17:43:57 +01:00
Achim Gratz b9ea74a195 Backwards compatibility for `user-error´
* lisp/org-compat.el (user-error): Defalias to `error´ for Emacsen
  that don't have it.
2012-12-19 15:33:29 +01:00
Achim Gratz d56ad98544 fix a possible (wrong-type-argument stringp nil) error
* lisp/org-compat.el: Make sure that file-name-directory is getting a
  stringp.  This avoids a possible "(wrong-type-argument stringp nil)"
  error when the library in question does not exist.
2012-10-07 18:11:33 +02:00
Achim Gratz c5977e7e9d Revert "org-compat.el: New compatibility function `org-random'"
This reverts commit 7719734dd7.

* lisp/org-id.el: Do not use (random t), we just want a new random
  number, not a re-seeding of the PRNG for which (random t) doesn't
  provide enough entropy anyway.  Even if (random) would always
  produce the same sequence, the other components going into the MD5
  hash ensure that the result will be unique.
2012-09-11 21:42:38 +02:00
Bastien Guerry 7719734dd7 org-compat.el: New compatibility function `org-random'
* org-compat.el (org-random): New compatibility function.

* org-id.el (org-id-uuid): Use it.
2012-09-03 13:16:52 +02:00
Bastien Guerry 4bde726bbb * org-compat.el (org-check-version): Autoload. 2012-08-26 20:04:41 +02:00
Achim Gratz bf352eceda Rename utils/ to mk/, move some files to mk/ and make the requisite changes throughout
* Makefile: Include default.mk and targets.mk from mk/ where they've
  been moved to.

* README_maintainer: Rename utils to make throughout.

* doc/Makefile: Rename utils to make throughout.

* doc/org.texi: Remove reference to utils/, x11idle.c is now in
  contrib/scripts.

* mk/make_emacs_changelog: Add mk/ to list of directories not to be
  reported in Emacs' ChangeLog.  Also retain utils/ and re-add
  UTILITIES; add a comment explaining why these need to stay.

* mk/default.mk: Rename utils to make throughout.  Include version.mk
  from mk/ where it's been moved to.

* mk/targets.mk: Rename utils to make throughout.

* mk/server.mk: Rename utils to make throughout.  Only put those files
  from mk/ into the archives that are needed outside the server:
  default.mk targets.mk version.mk and org-fixup.el.

* lisp/org-compat.el: Rename utils to make throughout.

* .gitignore:  Rename utils to make throughout.
2012-08-26 15:27:19 +02:00
Bastien Guerry 0c8e87b8d2 Rename UTILITIES/ to utils/ 2012-08-23 12:47:10 +02:00
Bastien Guerry cacb08334a Merge branch 'org-no-properties' 2012-08-15 14:43:35 +02:00
Bastien Guerry b62604236d Replace `org-labels' by `let*'
* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Replace
`org-labels' by `let*'.

* org-bibtex.el (org-bibtex-headline): Ditto.

* org-compat.el: Delete `org-labels'.
2012-08-15 09:56:35 +02:00
Bastien Guerry 722e0e0c83 Remove `org-substring-no-properties' and some redundant code
* org-macs.el (org-no-properties): Allow a new parameter
`restricted' to restrict the properties removal to those in
`org-rm-props'.  The default is now to remove all properties.

* org-compat.el (org-substring-no-properties): Remove unused
defun.

* org-remember.el (org-remember-apply-template): Remove
redundant removal of text properties.
(org-remember-apply-template): Use `org-no-properties'.

* org-capture.el (org-capture-fill-template): Remove redundant
removal of text properties.
(org-capture-fill-template): Use `org-no-properties'.

* org-gnus.el (org-gnus-open, org-gnus-follow-link): Use
`org-no-properties'.
2012-08-15 09:35:21 +02:00
Eric Schulte 37e19ea2d0 Revert "Don't use `org-labels'"
This reverts commit 9d4e1517b6.
2012-08-13 08:17:46 -06:00
Eric Schulte 9d4e1517b6 Don't use `org-labels'
Reworking the previous commit which attempted to remove org-labels.

* org-compat.el (org-labels): Remove.

* org-bibtex.el (org-bibtex-headline): Don't use `org-labels'.

* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto.
2012-08-13 07:42:17 -06:00
Bastien Guerry 525e96a97e Revert "Don't use `org-labels'"
This reverts commit ba16c3c6f5.
2012-08-13 06:37:57 +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 ba16c3c6f5 Don't use `org-labels'
* org-compat.el (org-labels): Remove.

* org-bibtex.el (org-bibtex-headline): Don't use `org-labels'.

* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto.
2012-08-11 10:43:56 +02:00
Bastien Guerry baaa4873c7 org-compat.el (org-flet): Remove alias
* org-compat.el (org-flet): Remove alias.
2012-08-10 17:45:16 +02:00
Eric Schulte 63b5f8f2e8 replace flet/labels with org-flet/org-labels
This patch ensure Org-mode will build on all supported versions of
Emacs, after the renaming of the cl macros behind the cl- prefix in the
recent Emacs trunk.

* lisp/org-compat.el (org-flet): Compatibility function now that flet
  has been removed from cl-macs.
  (org-labels): Compatibility function now that labels has been removed
  from cl-macs.
* lisp/ob-R.el (org-compat): Require org-compat.
* lisp/ob-comint.el: Require org-compat.
* lisp/ob-exp.el (org-babel-exp-do-export): Switch to compatibility
  function.
* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Switch to
  compatibility function.
* lisp/ob-lob.el (org-babel-lob-get-info): Switch to compatibility
  function.
  (org-babel-lob-execute): Switch to compatibility function.
* lisp/ob-python.el (org-babel-python-evaluate-session): Switch to
  compatibility function.
* lisp/ob-ref.el (org-babel-ref-index-list): Switch to compatibility
  function.
* lisp/ob-sh.el (org-babel-sh-var-to-string): Switch to compatibility
  function.
* lisp/ob-tangle.el (org-babel-load-file): Switch to compatibility
  function.
  (org-babel-tangle): Switch to compatibility function.
  (org-babel-spec-to-string): Switch to compatibility function.
* lisp/ob.el (org-babel-view-src-block-info): Switch to compatibility
  function.
  (org-babel-execute-src-block): Switch to compatibility function.
  (org-babel-edit-distance): Switch to compatibility function.
  (org-babel-switch-to-session-with-code): Switch to compatibility
  function.
  (org-babel-sha1-hash): Switch to compatibility function.
  (org-babel-balanced-split): Switch to compatibility function.
  (org-babel-join-splits-near-ch): Switch to compatibility function.
  (org-babel-get-rownames): Switch to compatibility function.
  (org-babel-format-result): Switch to compatibility function.
  (org-babel-insert-result): Switch to compatibility function.
  (org-babel-examplize-region): Switch to compatibility function.
  (org-babel-merge-params): Switch to compatibility function.
  (org-babel-noweb-p): Switch to compatibility function.
  (org-babel-expand-noweb-references): Switch to compatibility function.
* lisp/org-bibtex.el (org-bibtex-headline): Switch to compatibility
  function.
  (org-bibtex-fleshout): Switch to compatibility function.
  (org-bibtex-read): Switch to compatibility function.
  (org-bibtex-write): Switch to compatibility function.
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Switch to
  compatibility function.
* lisp/org-exp.el (org-export-format-source-code-or-example): Switch to
  compatibility function.
* lisp/org-macs.el (org-called-interactively-p): Indentation fix.
* lisp/org-mouse.el (org-mouse-timestamp-today): Switch to compatibility
  function.
  (org-mouse-set-priority): Switch to compatibility function.
  (org-mouse-popup-global-menu): Switch to compatibility function.
  (org-mouse-context-menu): Switch to compatibility function.
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data): Switch to
  compatibility function.
  (org-plot/gnuplot-script): Switch to compatibility function.
* lisp/org.el (org-entry-get): Switch to compatibility function.
  (org-fill-paragraph): Switch to compatibility function.
  (org-auto-fill-function): Switch to compatibility function.
2012-07-25 09:23:57 -06:00
Jambunathan K f4148cf525 Merge origin/maint 2012-07-19 19:29:24 +05:30
Jambunathan K 16d23c07dd org-compat.el: Augment earlier commit
* lisp/org-compat.el (org-condition-case-unless-debug): Alias
to `condition-case' when both `condition-case-no-debug' and
`condition-case-unless-debug' is unavailable.
2012-07-19 19:15:42 +05:30
Bastien Guerry 7cc0eda245 New alias `org-condition-case-unless-debug'.
* org-odt.el (org-odt-cleanup-xml-buffers): Use the new alias.

* org-compat.el: Alias `org-condition-case-unless-debug' to
`condition-case-unless-debug' or `condition-case-no-debug'.
2012-07-19 19:00:12 +05:30
Achim Gratz 6fbc226ca5 further cleanup for org version
* UTILITIES/org-fixup.el (org-make-org-version): Provide feature
  'org-version.
* lisp/org-compat.el (org-check-version): New macro.  Check if
  org-version.el exists and provide autoloads to that. Otherwise check
  if org-fixup.el exists and use it to provide definitions.  Finally
  if nothing worked, complain about a botched installation and provide
  fallback definitions.
* lisp/org.el: Use org-check-version.

This should finally provide the correct behaviour in all supported
use-cases as well as a few corner scenarios that were reported on the
mailing list and allow to always build on Git, ELPA and Emacs Bzr
correctly.  The file org-version.el must be added to the Emacs sources
and should be re-generated each time orgmode Git is synced to Emacs
Bzr (it would be best to automate this).

Note that the internal functions (org-release) and (org-git-release)
are not autoloaded when org-version is not present and become only
available when org.el is loaded.  This should pose no problem since
they are only used by (org-version), which is autoloaded from org.el.
2012-07-15 13:53:53 +02:00
Bastien Guerry 1fe42fd0bc New alias `org-condition-case-unless-debug'.
* org-odt.el (org-odt-cleanup-xml-buffers): Use the new alias.

* org-compat.el: Alias `org-condition-case-unless-debug' to
`condition-case-unless-debug' or `condition-case-no-debug'.
2012-07-12 10:30:33 +02:00
Achim Gratz 4f29c630d8 XEmacs compatibility improvements
* lisp/org-compat.el (org-find-library-dir): rename
  org-find-library-name (misleading) and implement with a function
  that exists identically in Emacs/XEmacs.

* UTILITIES/org-fixup.el: change calls to org-find-library-dir.
  Simplify invocations of git, use the same arguments as in targets.mk
  and use only functions that work the same in EMacs and XEmacs.

* lisp/org-exp-blocks.el: change calls to org-find-library-dir.

* lisp/org.el: change calls to org-find-library-dir.  Make require for
  noutline fail silently because it is missing from XEmacs.
2012-05-18 07:45:45 +02:00
Bastien Guerry b3f60f791e Convert compatibility defun to a macro.
* lisp/org-compat.el (org-find-library-name): Convert into a macro to
  avoid compilation of a function from XEmacs in Emacs and vice versa.

Based on a not fully working proposal by A. Gratz to the orgmode
mailing list:
http://lists.gnu.org/archive/html/emacs-orgmode/2012-04/msg00009.html
2012-05-01 10:40:15 +02:00