Browse Source

Update autoloads.

* org.el: Don't dynamically autoload already autoloaded
functions.
(org-clock-update-time-maybe): Move to org-clock.el.

* org-exp.el (org-insert-export-options-template): Remove
autoload cookie.

* org-clock.el (org-resolve-clocks, org-clock-in)
(org-clock-out, org-clock-cancel, org-clock-goto)
(org-clock-sum, org-clock-display, org-clock-report)
(org-dblock-write:clocktable): Add autoload cookie.
(org-clock-update-time-maybe): Moved from org.el.

* org-beamer.el (org-beamer-sectioning, org-beamer-mode): Ditto.

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

* org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling, org-toggle-archive-tag): Add
autoload cookie.

* org-colview.el (org-columns, org-dblock-write:columnview)
(org-insert-columns-dblock, org-agenda-columns): Ditto.

* org-table.el (org-table-create-with-table.el)
(org-table-create-or-convert-from-region, org-table-create)
(org-table-convert-region, org-table-import)
(org-table-export, org-table-align)
(org-table-justify-field-maybe, org-table-next-field)
(org-table-previous-field, org-table-next-row)
(org-table-copy-down, org-table-field-info)
(org-table-current-dline, org-table-goto-column)
(org-table-insert-column, org-table-delete-column)
(org-table-move-column-right, org-table-move-column-left)
(org-table-move-column, org-table-move-row-down)
(org-table-move-row-up, org-table-move-row)
(org-table-insert-row, org-table-insert-hline)
(org-table-hline-and-move, org-table-kill-row)
(org-table-sort-lines, org-table-cut-region)
(org-table-copy-region, org-table-paste-rectangle)
(org-table-convert, org-table-wrap-region)
(org-table-edit-field, org-table-sum)
(org-table-get-stored-formulas)
(org-table-maybe-eval-formula)
(org-table-rotate-recalc-marks)
(org-table-maybe-recalculate-line, org-table-eval-formula)
(org-table-recalculate, org-table-iterate)
(org-table-edit-formulas)
(org-table-toggle-coordinate-overlays)
(org-table-toggle-formula-debugger, orgtbl-to-generic)
(orgtbl-to-tsv, orgtbl-to-csv, orgtbl-to-latex)
(orgtbl-to-html, orgtbl-to-texinfo, orgtbl-to-orgtbl): Ditto.
Bastien Guerry 5 years ago
parent
commit
30f1a62878
8 changed files with 130 additions and 176 deletions
  1. 3 0
      lisp/org-archive.el
  2. 1 0
      lisp/org-ascii.el
  3. 2 1
      lisp/org-beamer.el
  4. 52 0
      lisp/org-clock.el
  5. 4 0
      lisp/org-colview.el
  6. 0 1
      lisp/org-exp.el
  7. 53 2
      lisp/org-table.el
  8. 15 172
      lisp/org.el

+ 3 - 0
lisp/org-archive.el

@@ -181,6 +181,7 @@ if LOCATION is not given, the value of `org-archive-location' is used."
 	      (file-name-nondirectory
 	       (buffer-file-name (buffer-base-buffer))))))
 
+;;;###autoload
 (defun org-archive-subtree (&optional find-done)
   "Move the current subtree to the archive.
 The archive can be a certain top-level heading in the current file, or in
@@ -369,6 +370,7 @@ this heading."
     (if (looking-at "^[ \t]*$")
 	(outline-next-visible-heading 1))))
 
+;;;###autoload
 (defun org-archive-to-archive-sibling ()
   "Archive the current heading by moving it under the archive sibling.
 The archive sibling is a sibling of the heading with the heading name
@@ -483,6 +485,7 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
 	    (goto-char end)))))
     (message "%d trees archived" cntarch)))
 
+;;;###autoload
 (defun org-toggle-archive-tag (&optional find-done)
   "Toggle the archive tag for the current headline.
 With prefix ARG, check all children of current headline and offer tagging

+ 1 - 0
lisp/org-ascii.el

@@ -553,6 +553,7 @@ publishing directory."
 	  (kill-buffer (current-buffer)))
       (current-buffer))))
 
+;;;###autoload
 (defun org-export-ascii-preprocess (parameters)
   "Do extra work for ASCII export."
   ;;

+ 2 - 1
lisp/org-beamer.el

@@ -228,7 +228,7 @@ the tag does not have any semantic meaning."
 	(org-entry-put nil "BEAMER_env" (match-string 1 tags)))
        (t (org-entry-delete nil "BEAMER_env"))))))
 
-
+;;;###autoload
 (defun org-beamer-sectioning (level text)
   "Return the sectioning entry for the current headline.
 LEVEL is the reduced level of the headline.
@@ -370,6 +370,7 @@ org-beamer-extra are all scoped into this function dynamically."
   "The keymap for `org-beamer-mode'.")
 (define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment)
 
+;;;###autoload
 (define-minor-mode org-beamer-mode
   "Special support for editing Org-mode files made to export to beamer."
   nil " Bm" nil)

+ 52 - 0
lisp/org-clock.el

@@ -962,6 +962,7 @@ to be CLOCKED OUT.")))
 	    (not (memq ch '(?K ?G ?S ?C))))
        fail-quietly)))))
 
+;;;###autoload
 (defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid)
   "Resolve all currently open org-mode clocks.
 If `only-dangling-p' is non-nil, only ask to resolve dangling
@@ -1059,6 +1060,8 @@ so long."
   (setq org-clock-current-task nil))
 
 (defvar org-clock-out-time nil) ; store the time of the last clock-out
+
+;;;###autoload
 (defun org-clock-in (&optional select start-time)
   "Start the clock on the current item.
 If necessary, clock-out of the currently active clock.
@@ -1428,6 +1431,7 @@ line and position cursor in that line."
 	    (and (re-search-forward org-property-end-re nil t)
 		 (goto-char (match-beginning 0))))))))
 
+;;;###autoload
 (defun org-clock-out (&optional switch-to-state fail-quietly at-time)
   "Stop the currently running clock.
 Throw an error if there is no running clock and FAIL-QUIETLY is nil.
@@ -1587,6 +1591,7 @@ UPDOWN tells whether to change 'up or 'down."
 			     ((eq org-ts-what 'year) (* 24 3600 365.2)))))
 	     org-ts-what 'updown)))))))
 
+;;;###autoload
 (defun org-clock-cancel ()
   "Cancel the running clock by removing the start timestamp."
   (interactive)
@@ -1613,6 +1618,7 @@ UPDOWN tells whether to change 'up or 'down."
   (message "Clock canceled")
   (run-hooks 'org-clock-cancel-hook))
 
+;;;###autoload
 (defun org-clock-goto (&optional select)
   "Go to the currently clocked-in entry, or to the most recently clocked one.
 With prefix arg SELECT, offer recently clocked tasks for selection."
@@ -1651,6 +1657,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
   (let ((range (org-clock-special-range 'today)))
     (org-clock-sum (car range) (cadr range) nil :org-clock-minutes-today)))
 
+;;;###autoload
 (defun org-clock-sum (&optional tstart tend headline-filter propname)
   "Sum the times for each subtree.
 Puts the resulting times in minutes as a text property on each headline.
@@ -1749,6 +1756,7 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
       (org-clock-sum tstart)
       org-clock-file-total-minutes)))
 
+;;;###autoload
 (defun org-clock-display (&optional total-only)
   "Show subtree times in the entire buffer.
 If TOTAL-ONLY is non-nil, only show the total time for the entire file
@@ -1879,6 +1887,7 @@ fontified, and then returned."
 				(re-search-forward "^[ \t]*#\\+END" nil t)
 				(point-at-bol)))))
 
+;;;###autoload
 (defun org-clock-report (&optional arg)
   "Create a table containing a report about clocked time.
 If the cursor is inside an existing clocktable block, then the table
@@ -2165,6 +2174,7 @@ the currently selected interval size."
 	  (org-update-dblock)
 	  t)))))
 
+;;;###autoload
 (defun org-dblock-write:clocktable (params)
   "Write the standard clocktable."
   (setq params (org-combine-plists org-clocktable-defaults params))
@@ -2675,6 +2685,48 @@ This function is made for clock tables."
 (defvar org-clock-loaded nil
   "Was the clock file loaded?")
 
+(defun org-clock-update-time-maybe ()
+  "If this is a CLOCK line, update it and return t.
+Otherwise, return nil."
+  (interactive)
+  (save-excursion
+    (beginning-of-line 1)
+    (skip-chars-forward " \t")
+    (when (looking-at org-clock-string)
+      (let ((re (concat "[ \t]*" org-clock-string
+			" *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
+			"\\([ \t]*=>.*\\)?\\)?"))
+	    ts te h m s neg)
+	(cond
+	 ((not (looking-at re))
+	  nil)
+	 ((not (match-end 2))
+	  (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
+		     (> org-clock-marker (point))
+		     (<= org-clock-marker (point-at-eol)))
+	    ;; The clock is running here
+	    (setq org-clock-start-time
+		  (apply 'encode-time
+			 (org-parse-time-string (match-string 1))))
+	    (org-clock-update-mode-line)))
+	 (t
+	  (and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
+	  (end-of-line 1)
+	  (setq ts (match-string 1)
+		te (match-string 3))
+	  (setq s (- (org-float-time
+		      (apply 'encode-time (org-parse-time-string te)))
+		     (org-float-time
+		      (apply 'encode-time (org-parse-time-string ts))))
+		neg (< s 0)
+		s (abs s)
+		h (floor (/ s 3600))
+		s (- s (* 3600 h))
+		m (floor (/ s 60))
+		s (- s (* 60 s)))
+	  (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
+	  t))))))
+
 (defun org-clock-save ()
   "Persist various clock-related data to disk.
 The details of what will be saved are regulated by the variable

+ 4 - 0
lisp/org-colview.el

@@ -686,6 +686,7 @@ around it."
       (move-marker org-columns-top-level-marker org-entry-property-inherited-from)
     (move-marker org-columns-top-level-marker (point))))
 
+;;;###autoload
 (defun org-columns (&optional columns-fmt-string)
   "Turn on column view on an org-mode file.
 When COLUMNS-FMT-STRING is non-nil, use it as the column format."
@@ -1222,6 +1223,7 @@ of fields."
 	      (push row tbl)))))
       (append (list title 'hline) (nreverse tbl)))))
 
+;;;###autoload
 (defun org-dblock-write:columnview (params)
   "Write the column view table.
 PARAMS is a property list of parameters:
@@ -1334,6 +1336,7 @@ and tailing newline characters."
       (t (error "Garbage in listtable: %s" x))))
    tbl "\n"))
 
+;;;###autoload
 (defun org-insert-columns-dblock ()
   "Create a dynamic block capturing a column view table."
   (interactive)
@@ -1357,6 +1360,7 @@ and tailing newline characters."
 (defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el
 (defvar org-agenda-columns-add-appointments-to-effort-sum); as well
 
+;;;###autoload
 (defun org-agenda-columns ()
   "Turn on or update column view in the agenda."
   (interactive)

+ 0 - 1
lisp/org-exp.el

@@ -3231,7 +3231,6 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
    org-archive-location
    "org file:~/org/%s.org"))
 
-;;;###autoload
 (defun org-insert-export-options-template ()
   "Insert into the buffer a template with information for exporting."
   (interactive)

+ 53 - 2
lisp/org-table.el

@@ -423,6 +423,7 @@ available parameters."
   (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)")
   "Match a reference that needs translation, for reference display.")
 
+;;;###autoload
 (defun org-table-create-with-table.el ()
   "Use the table.el package to insert a new table.
 If there is already a table at point, convert between Org-mode tables
@@ -439,6 +440,7 @@ and table.el tables."
       (org-table-convert)))
    (t (call-interactively 'table-insert))))
 
+;;;###autoload
 (defun org-table-create-or-convert-from-region (arg)
   "Convert region to table, or create an empty table.
 If there is an active region, convert it to a table, using the function
@@ -451,6 +453,7 @@ If there is no such region, create an empty table with `org-table-create'."
       (org-table-convert-region (region-beginning) (region-end) arg)
     (org-table-create arg)))
 
+;;;###autoload
 (defun org-table-create (&optional size)
   "Query for a size and insert a table skeleton.
 SIZE is a string Columns x Rows like for example \"3x2\"."
@@ -483,6 +486,7 @@ SIZE is a string Columns x Rows like for example \"3x2\"."
 	  (goto-char pos)))
     (org-table-align)))
 
+;;;###autoload
 (defun org-table-convert-region (beg0 end0 &optional separator)
   "Convert region to a table.
 The region goes from BEG0 to END0, but these borders will be moved
@@ -543,6 +547,7 @@ nil      When nil, the command tries to be smart and figure out the
     (goto-char beg)
     (org-table-align)))
 
+;;;###autoload
 (defun org-table-import (file arg)
   "Import FILE as a table.
 The file is assumed to be tab-separated.  Such files can be produced by most
@@ -558,6 +563,7 @@ are found, lines will be split on whitespace into fields."
 
 (defvar org-table-last-alignment)
 (defvar org-table-last-column-widths)
+;;;###autoload
 (defun org-table-export (&optional file format)
   "Export table to a file, with configurable format.
 Such a file can be imported into usual spreadsheet programs.
@@ -673,6 +679,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 (defconst org-narrow-column-arrow "=>"
   "Used as display property in narrowed table columns.")
 
+;;;###autoload
 (defun org-table-align ()
   "Align the table at point by aligning all vertical bars."
   (interactive)
@@ -884,6 +891,7 @@ With argument TABLE-TYPE, go to the end of a table.el-type table."
       (goto-char (match-beginning 0)))
     (point-marker)))
 
+;;;###autoload
 (defun org-table-justify-field-maybe (&optional new)
   "Justify the current field, text to left, number to right.
 Optional argument NEW may specify text to replace the current field content."
@@ -924,6 +932,7 @@ Optional argument NEW may specify text to replace the current field content."
 	  (setq org-table-may-need-update t))
 	(goto-char pos))))))
 
+;;;###autoload
 (defun org-table-next-field ()
   "Go to the next field in the current table, creating new lines as needed.
 Before doing so, re-align the table if necessary."
@@ -953,6 +962,7 @@ Before doing so, re-align the table if necessary."
       (error
        (org-table-insert-row 'below)))))
 
+;;;###autoload
 (defun org-table-previous-field ()
   "Go to the previous field in the table.
 Before doing so, re-align the table if necessary."
@@ -1006,6 +1016,7 @@ With numeric argument N, move N-1 fields backward first."
 	  (forward-char 1)))
     (if (<= (point) pos) (org-table-end-of-field 2))))
 
+;;;###autoload
 (defun org-table-next-row ()
   "Go to the next row (same column) in the current table.
 Before doing so, re-align the table if necessary."
@@ -1029,6 +1040,7 @@ Before doing so, re-align the table if necessary."
       (skip-chars-backward "^|\n\r")
       (if (looking-at " ") (forward-char 1)))))
 
+;;;###autoload
 (defun org-table-copy-down (n)
   "Copy a field down in the current column.
 If the field at the cursor is empty, copy into it the content of
@@ -1173,6 +1185,7 @@ is always the old value."
 	val)
     (forward-char 1) ""))
 
+;;;###autoload
 (defun org-table-field-info (arg)
   "Show info about the current field, and highlight any reference at point."
   (interactive "P")
@@ -1228,6 +1241,7 @@ is always the old value."
 	(message "In table column %d" cnt))
       cnt)))
 
+;;;###autoload
 (defun org-table-current-dline ()
   "Find out what table data line we are in.
 Only data lines count for this."
@@ -1244,6 +1258,7 @@ Only data lines count for this."
 	(message "This is table line %d" cnt))
       cnt)))
 
+;;;###autoload
 (defun org-table-goto-column (n &optional on-delim force)
   "Move the cursor to the Nth column in the current table line.
 With optional argument ON-DELIM, stop with point before the left delimiter
@@ -1266,6 +1281,7 @@ However, when FORCE is non-nil, create new columns if necessary."
 	(backward-char 1)
       (if (looking-at " ") (forward-char 1)))))
 
+;;;###autoload
 (defun org-table-insert-column ()
   "Insert a new column into the table."
   (interactive)
@@ -1335,6 +1351,7 @@ first dline below it is used.  When ABOVE is non-nil, the one above is used."
 	  (setq i (1+ i)))))
     nil))
 
+;;;###autoload
 (defun org-table-delete-column ()
   "Delete a column from the table."
   (interactive)
@@ -1367,15 +1384,18 @@ first dline below it is used.  When ABOVE is non-nil, the one above is used."
       (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID"))
 			      col -1 col))))
 
+;;;###autoload
 (defun org-table-move-column-right ()
   "Move column to the right."
   (interactive)
   (org-table-move-column nil))
+;;;###autoload
 (defun org-table-move-column-left ()
   "Move column to the left."
   (interactive)
   (org-table-move-column 'left))
 
+;;;###autoload
 (defun org-table-move-column (&optional left)
   "Move the current column to the right.  With arg LEFT, move to the left."
   (interactive "P")
@@ -1415,15 +1435,18 @@ first dline below it is used.  When ABOVE is non-nil, the one above is used."
        "$LR" (list (cons (number-to-string col) (number-to-string colpos))
 		   (cons (number-to-string colpos) (number-to-string col)))))))
 
+;;;###autoload
 (defun org-table-move-row-down ()
   "Move table row down."
   (interactive)
   (org-table-move-row nil))
+;;;###autoload
 (defun org-table-move-row-up ()
   "Move table row up."
   (interactive)
   (org-table-move-row 'up))
 
+;;;###autoload
 (defun org-table-move-row (&optional up)
   "Move the current table line down.  With arg UP, move it up."
   (interactive "P")
@@ -1457,6 +1480,7 @@ first dline below it is used.  When ABOVE is non-nil, the one above is used."
        "@" (list (cons (number-to-string dline1) (number-to-string dline2))
 		 (cons (number-to-string dline2) (number-to-string dline1)))))))
 
+;;;###autoload
 (defun org-table-insert-row (&optional arg)
   "Insert a new row above the current line into the table.
 With prefix ARG, insert below the current line."
@@ -1478,6 +1502,7 @@ With prefix ARG, insert below the current line."
 	      (funcall org-table-fix-formulas-confirm "Fix formulas? "))
       (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1))))
 
+;;;###autoload
 (defun org-table-insert-hline (&optional above)
   "Insert a horizontal-line below the current line into the table.
 With prefix ABOVE, insert above the current line."
@@ -1501,6 +1526,7 @@ With prefix ABOVE, insert above the current line."
     (org-move-to-column col)
     (and org-table-overlay-coordinates (org-table-align))))
 
+;;;###autoload
 (defun org-table-hline-and-move (&optional same-column)
   "Insert a hline and move to the row below that line."
   (interactive "P")
@@ -1527,6 +1553,7 @@ In particular, this does handle wide and invisible characters."
 	       t t s)))
     s))
 
+;;;###autoload
 (defun org-table-kill-row ()
   "Delete the current row or horizontal line from the table."
   (interactive)
@@ -1542,6 +1569,7 @@ In particular, this does handle wide and invisible characters."
       (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
 			      dline -1 dline))))
 
+;;;###autoload
 (defun org-table-sort-lines (with-case &optional sorting-type)
   "Sort table lines according to the column at point.
 
@@ -1622,7 +1650,7 @@ should be done in reverse order."
     (org-table-goto-column thiscol)
     (message "%d lines sorted, based on column %d" (length lns) column)))
 
-
+;;;###autoload
 (defun org-table-cut-region (beg end)
   "Copy region in table to the clipboard and blank all relevant fields.
 If there is no active region, use just the field at point."
@@ -1631,6 +1659,7 @@ If there is no active region, use just the field at point."
 		(if (org-region-active-p) (region-end) (point))))
   (org-table-copy-region beg end 'cut))
 
+;;;###autoload
 (defun org-table-copy-region (beg end &optional cut)
   "Copy rectangular region in table to clipboard.
 A special clipboard is used which can only be accessed
@@ -1668,6 +1697,7 @@ with `org-table-paste-rectangle'."
     (if cut (org-table-align))
     org-table-clip))
 
+;;;###autoload
 (defun org-table-paste-rectangle ()
   "Paste a rectangular region into a table.
 The upper right corner ends up in the current field.  All involved fields
@@ -1698,6 +1728,7 @@ lines."
     (org-table-goto-column col)
     (org-table-align)))
 
+;;;###autoload
 (defun org-table-convert ()
   "Convert from `org-mode' table to table.el and back.
 Obviously, this only works within limits.  When an Org-mode table is
@@ -1771,6 +1802,7 @@ Note that horizontal lines disappeared."
                        contents ""))
     (org-table-align)))
 
+;;;###autoload
 (defun org-table-wrap-region (arg)
   "Wrap several fields in a column like a paragraph.
 This is useful if you'd like to spread the contents of a field over several
@@ -1841,6 +1873,7 @@ blank, and the content is appended to the field above."
 
 (defvar org-field-marker nil)
 
+;;;###autoload
 (defun org-table-edit-field (arg)
   "Edit table field in a different window.
 This is mainly useful for fields that contain hidden parts.
@@ -1944,6 +1977,7 @@ table (but see `org-table-exit-follow-field-mode-when-leaving-table')."
 
 (defvar org-timecnt) ; dynamically scoped parameter
 
+;;;###autoload
 (defun org-table-sum (&optional beg end nlast)
   "Sum numbers in region of current table column.
 The result will be displayed in the echo area, and will be available
@@ -2144,9 +2178,10 @@ When NAMED is non-nil, look for a named equation."
 	(bs (org-table-formula-make-cmp-string (car b))))
     (and as bs (string< as bs))))
 
+;;;###autoload
 (defun org-table-get-stored-formulas (&optional noerror)
   "Return an alist with the stored formulas directly after current table."
-  (interactive)
+  (interactive) ;; FIXME interactive?
   (let ((case-fold-search t) scol eq eq-alist strings string seen)
     (save-excursion
       (goto-char (org-table-end))
@@ -2283,6 +2318,7 @@ For all numbers larger than LIMIT, shift them by DELTA."
 	(setq org-table-local-parameters
 	      (append org-table-local-parameters al2))))))
 
+;;;###autoload
 (defun org-table-maybe-eval-formula ()
   "Check if the current field starts with \"=\" or \":=\".
 If yes, store the formula and apply it."
@@ -2313,6 +2349,7 @@ Will be filled automatically during use.")
     ("_" . "Names for values in row below this one.")
     ("^" . "Names for values in row above this one.")))
 
+;;;###autoload
 (defun org-table-rotate-recalc-marks (&optional newchar)
   "Rotate the recalculation mark in the first column.
 If in any row, the first field is not consistent with a mark,
@@ -2374,6 +2411,7 @@ of the new mark."
     (and (org-called-interactively-p 'interactive)
 	 (message "%s" (cdr (assoc new org-recalc-marks))))))
 
+;;;###autoload
 (defun org-table-maybe-recalculate-line ()
   "Recompute the current line if marked for it, and if we haven't just done it."
   (interactive)
@@ -2397,6 +2435,7 @@ of the new mark."
     (cons var (cons value org-tbl-calc-modes)))
   org-tbl-calc-modes)
 
+;;;###autoload
 (defun org-table-eval-formula (&optional arg equation
 					 suppress-align suppress-const
 					 suppress-store suppress-analysis)
@@ -2823,6 +2862,7 @@ LISPP means to return something appropriate for a Lisp list."
 		   elements
 		   ",") "]"))))
 
+;;;###autoload
 (defun org-table-recalculate (&optional all noalign)
   "Recalculate the current table line by applying all stored formulas.
 With prefix arg ALL, do this for all lines in the table.
@@ -2961,6 +3001,7 @@ known that the table will be realigned a little later anyway."
       (or noalign (and org-table-may-need-update (org-table-align))
 	  (and all (message "Re-applying formulas...done"))))))
 
+;;;###autoload
 (defun org-table-iterate (&optional arg)
   "Recalculate the table until it does not change anymore.
 The maximum number of iterations is 10, but you can choose a different value
@@ -3163,6 +3204,7 @@ Parameters get priority."
 
 (defvar org-pos)
 
+;;;###autoload
 (defun org-table-edit-formulas ()
   "Edit the formulas of the current table in a separate buffer."
   (interactive)
@@ -3800,6 +3842,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
 	    (org-overlay-display ov str 'org-special-keyword 'evaporate)))
 	(beginning-of-line 2)))))
 
+;;;###autoload
 (defun org-table-toggle-coordinate-overlays ()
   "Toggle the display of Row/Column numbers in tables."
   (interactive)
@@ -3812,6 +3855,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
     (mapc 'delete-overlay org-table-coordinate-overlays)
     (setq org-table-coordinate-overlays nil)))
 
+;;;###autoload
 (defun org-table-toggle-formula-debugger ()
   "Toggle the formula debugger in tables."
   (interactive)
@@ -4474,6 +4518,7 @@ First element has index 0, or I0 if given."
 			 (*orgtbl-lfmt* *orgtbl-llfmt*))
 		     (orgtbl-format-line prevline))))))
 
+;;;###autoload
 (defun orgtbl-to-generic (table params)
   "Convert the orgtbl-mode TABLE to some other format.
 This generic routine can be used for many standard cases.
@@ -4600,9 +4645,11 @@ directly by `orgtbl-send-table'.  See manual."
 			     (remq nil *orgtbl-rtn*)
 			   *orgtbl-rtn*)) "\n")))
 
+;;;###autoload
 (defun orgtbl-to-tsv (table params)
   "Convert the orgtbl-mode table to TAB separated material."
   (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params)))
+;;;###autoload
 (defun orgtbl-to-csv (table params)
   "Convert the orgtbl-mode table to CSV material.
 This does take care of the proper quoting of fields with comma or quotes."
@@ -4610,6 +4657,7 @@ This does take care of the proper quoting of fields with comma or quotes."
 			    '(:sep "," :fmt org-quote-csv-field)
 			    params)))
 
+;;;###autoload
 (defun orgtbl-to-latex (table params)
   "Convert the orgtbl-mode TABLE to LaTeX.
 TABLE is a list, each entry either the symbol `hline' for a horizontal
@@ -4648,6 +4696,7 @@ this function is called."
 	   :efmt "%s\\,(%s)" :hline "\\hline")))
     (orgtbl-to-generic table (org-combine-plists params2 params))))
 
+;;;###autoload
 (defun orgtbl-to-html (table params)
   "Convert the orgtbl-mode TABLE to HTML.
 TABLE is a list, each entry either the symbol `hline' for a horizontal
@@ -4678,6 +4727,7 @@ so you cannot specify parameters for it."
 	(setq html (replace-match "" t t html)))
     html))
 
+;;;###autoload
 (defun orgtbl-to-texinfo (table params)
   "Convert the orgtbl-mode TABLE to TeXInfo.
 TABLE is a list, each entry either the symbol `hline' for a horizontal
@@ -4716,6 +4766,7 @@ this function is called."
 	   :hlstart "@headitem ")))
     (orgtbl-to-generic table (org-combine-plists params2 params))))
 
+;;;###autoload
 (defun orgtbl-to-orgtbl (table params)
   "Convert the orgtbl-mode TABLE into another orgtbl-mode table.
 Useful when slicing one table into many.  The :hline, :sep,

+ 15 - 172
lisp/org.el

@@ -3864,30 +3864,7 @@ This works for both table types.")
 
 (eval-and-compile
   (org-autoload "org-table"
-		'(org-table-align org-table-begin org-table-blank-field
-				  org-table-convert org-table-convert-region org-table-copy-down
-				  org-table-copy-region org-table-create
-				  org-table-create-or-convert-from-region
-				  org-table-create-with-table.el org-table-current-dline
-				  org-table-cut-region org-table-delete-column org-table-edit-field
-				  org-table-edit-formulas org-table-end org-table-eval-formula
-				  org-table-export org-table-field-info
-				  org-table-get-stored-formulas org-table-goto-column
-				  org-table-hline-and-move org-table-import org-table-insert-column
-				  org-table-insert-hline org-table-insert-row org-table-iterate
-				  org-table-justify-field-maybe org-table-kill-row
-				  org-table-maybe-eval-formula org-table-maybe-recalculate-line
-				  org-table-move-column org-table-move-column-left
-				  org-table-move-column-right org-table-move-row
-				  org-table-move-row-down org-table-move-row-up
-				  org-table-next-field org-table-next-row org-table-paste-rectangle
-				  org-table-previous-field org-table-recalculate
-				  org-table-rotate-recalc-marks org-table-sort-lines org-table-sum
-				  org-table-toggle-coordinate-overlays
-				  org-table-toggle-formula-debugger org-table-wrap-region
-				  orgtbl-mode turn-on-orgtbl org-table-to-lisp
-				  orgtbl-to-generic orgtbl-to-tsv orgtbl-to-csv orgtbl-to-latex
-				  orgtbl-to-orgtbl orgtbl-to-html orgtbl-to-texinfo)))
+		'(org-table-begin org-table-blank-field org-table-end)))
 
 ;;;###autoload
 (defun turn-on-orgtbl ()
@@ -3972,62 +3949,14 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
 (declare-function org-default-export-plist "org-exp")
 (declare-function org-infile-export-plist "org-exp")
 (declare-function org-get-current-options "org-exp")
-(eval-and-compile
-  (org-autoload "org-exp"
-		'(org-export org-export-visible
-			     org-insert-export-options-template
-			     org-table-clean-before-export))
-  (org-autoload "org-ascii"
-		'(org-export-as-ascii org-export-ascii-preprocess
-				      org-export-as-ascii-to-buffer org-replace-region-by-ascii
-				      org-export-region-as-ascii))
-  (org-autoload "org-latex"
-		'(org-export-as-latex-batch org-export-as-latex-to-buffer
-					    org-replace-region-by-latex org-export-region-as-latex
-					    org-export-as-latex org-export-as-pdf
-					    org-export-as-pdf-and-open))
-  (org-autoload "org-html"
-		'(org-export-as-html-and-open
-		  org-export-as-html-batch org-export-as-html-to-buffer
-		  org-replace-region-by-html org-export-region-as-html
-		  org-export-as-html))
-  (org-autoload "org-docbook"
-		'(org-export-as-docbook-batch org-export-as-docbook-to-buffer
-					      org-replace-region-by-docbook org-export-region-as-docbook
-					      org-export-as-docbook-pdf org-export-as-docbook-pdf-and-open
-					      org-export-as-docbook))
-  (org-autoload "org-icalendar"
-		'(org-export-icalendar-this-file
-		  org-export-icalendar-all-agenda-files
-		  org-export-icalendar-combine-agenda-files))
-  (org-autoload "org-xoxo" '(org-export-as-xoxo))
-  (org-autoload "org-beamer" '(org-beamer-mode org-beamer-sectioning)))
 
 ;; Declare and autoload functions from org-agenda.el
 
 (eval-and-compile
   (org-autoload "org-agenda"
-		'(org-agenda org-agenda-list org-search-view
-			     org-todo-list org-tags-view org-agenda-list-stuck-projects
-			     org-diary org-agenda-to-appt
-			     org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))
-
-;; Autoload org-remember
-
-(eval-and-compile
-  (org-autoload "org-remember"
-		'(org-remember-insinuate org-remember-annotation
-					 org-remember-apply-template org-remember org-remember-handler)))
+		'(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))
 
-(eval-and-compile
-  (org-autoload "org-capture"
-		'(org-capture org-capture-insert-template-here
-			      org-capture-import-remember-templates)))
-
-;; Autoload org-clock.el
-
-(declare-function org-clock-save-markers-for-cut-and-paste "org-clock"
-		  (beg end))
+(declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end))
 (declare-function org-clock-update-mode-line "org-clock" ())
 (declare-function org-resolve-clocks "org-clock"
 		  (&optional also-non-dangling-p prompt last-valid))
@@ -4044,55 +3973,9 @@ The return value is actually the clock marker."
   (marker-buffer org-clock-marker))
 
 (eval-and-compile
-  (org-autoload
-   "org-clock"
-   '(org-clock-in org-clock-out org-clock-cancel
-		  org-clock-goto org-clock-sum org-clock-display
-		  org-clock-remove-overlays org-clock-report
-		  org-clocktable-shift org-dblock-write:clocktable
-		  org-get-clocktable org-resolve-clocks)))
-
-(defun org-clock-update-time-maybe ()
-  "If this is a CLOCK line, update it and return t.
-Otherwise, return nil."
-  (interactive)
-  (save-excursion
-    (beginning-of-line 1)
-    (skip-chars-forward " \t")
-    (when (looking-at org-clock-string)
-      (let ((re (concat "[ \t]*" org-clock-string
-			" *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
-			"\\([ \t]*=>.*\\)?\\)?"))
-	    ts te h m s neg)
-	(cond
-	 ((not (looking-at re))
-	  nil)
-	 ((not (match-end 2))
-	  (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
-		     (> org-clock-marker (point))
-		     (<= org-clock-marker (point-at-eol)))
-	    ;; The clock is running here
-	    (setq org-clock-start-time
-		  (apply 'encode-time
-			 (org-parse-time-string (match-string 1))))
-	    (org-clock-update-mode-line)))
-	 (t
-	  (and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
-	  (end-of-line 1)
-	  (setq ts (match-string 1)
-		te (match-string 3))
-	  (setq s (- (org-float-time
-		      (apply 'encode-time (org-parse-time-string te)))
-		     (org-float-time
-		      (apply 'encode-time (org-parse-time-string ts))))
-		neg (< s 0)
-		s (abs s)
-		h (floor (/ s 3600))
-		s (- s (* 3600 h))
-		m (floor (/ s 60))
-		s (- s (* 60 s)))
-	  (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
-	  t))))))
+  (org-autoload "org-clock" '(org-clock-remove-overlays
+			      org-clock-update-time-maybe
+			      org-clocktable-shift)))
 
 (defun org-check-running-clock ()
   "Check if the current buffer contains the running clock.
@@ -4116,44 +3999,11 @@ If yes, offer to stop it and to save the buffer with the changes."
   (add-hook 'org-mode-hook 'org-clock-load)
   (add-hook 'kill-emacs-hook 'org-clock-save))
 
-;; Autoload org-timer.el
-
-(eval-and-compile
-  (org-autoload
-   "org-timer"
-   '(org-timer-start org-timer org-timer-item
-		     org-timer-change-times-in-region
-		     org-timer-set-timer
-		     org-timer-reset-timers
-		     org-timer-show-remaining-time)))
-
-;; Autoload org-feed.el
-
-(eval-and-compile
-  (org-autoload
-   "org-feed"
-   '(org-feed-update org-feed-update-all org-feed-goto-inbox)))
-
-
-;; Autoload org-indent.el
-
 ;; Define the variable already here, to make sure we have it.
 (defvar org-indent-mode nil
   "Non-nil if Org-Indent mode is enabled.
 Use the command `org-indent-mode' to change this variable.")
 
-(eval-and-compile
-  (org-autoload
-   "org-indent"
-   '(org-indent-mode)))
-
-;; Autoload org-mobile.el
-
-(eval-and-compile
-  (org-autoload
-   "org-mobile"
-   '(org-mobile-push org-mobile-pull org-mobile-create-sumo-agenda)))
-
 ;; Autoload archiving code
 ;; The stuff that is needed for cycling and tags has to be defined here.
 
@@ -4327,10 +4177,7 @@ Otherwise, these types are allowed:
 
 (eval-and-compile
   (org-autoload "org-archive"
-		'(org-add-archive-files org-archive-subtree
-					org-archive-to-archive-sibling org-toggle-archive-tag
-					org-archive-subtree-default
-					org-archive-subtree-default-with-confirmation)))
+		'(org-add-archive-files)))
 
 ;; Autoload Column View Code
 
@@ -4339,9 +4186,10 @@ Otherwise, these types are allowed:
 (declare-function org-columns-compute "org-colview" (property))
 
 (org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview")
-	      '(org-columns-number-to-string org-columns-get-format-and-top-level
-					     org-columns-compute org-agenda-columns org-columns-remove-overlays
-					     org-columns org-insert-columns-dblock org-dblock-write:columnview))
+	      '(org-columns-number-to-string
+		org-columns-get-format-and-top-level
+		org-columns-compute
+		org-columns-remove-overlays))
 
 ;; Autoload ID code
 
@@ -4350,15 +4198,10 @@ Otherwise, these types are allowed:
 (declare-function org-id-locations-save "org-id")
 (defvar org-id-track-globally)
 (org-autoload "org-id"
-	      '(org-id-get-create org-id-new org-id-copy org-id-get
-				  org-id-get-with-outline-path-completion
-				  org-id-get-with-outline-drilling org-id-store-link
-				  org-id-goto org-id-find org-id-store-link))
-
-;; Autoload Plotting Code
-
-(org-autoload "org-plot"
-	      '(org-plot/gnuplot))
+	      '(org-id-new
+		org-id-copy
+		org-id-get-with-outline-path-completion
+		org-id-get-with-outline-drilling))
 
 ;;; Variables for pre-computed regular expressions, all buffer local