diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 9a31ef106..633fb2b34 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1798,8 +1798,8 @@ will be easy to remove." (org-move-to-column c) (unless (eolp) (skip-chars-backward "^ \t")) (skip-chars-backward " \t") - (setq ov (make-overlay (1- (point)) (point-at-eol)) - tx (concat (buffer-substring (1- (point)) (point)) + (setq ov (make-overlay (point-at-bol) (point-at-eol)) + tx (concat (buffer-substring (point-at-bol) (point)) (make-string (+ off (max 0 (- c (current-column)))) ?.) (org-add-props (if org-time-clocksum-use-fractional (format fmt diff --git a/lisp/org-exp.el b/lisp/org-exp.el index bce73bd6b..d4c45608b 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1,4 +1,4 @@ -;;; org-exp.el --- ASCII, HTML, XOXO and iCalendar export for Org-mode +;;; org-exp.el --- Export internals for Org-mode ;; Copyright (C) 2004-2012 Free Software Foundation, Inc. @@ -1318,11 +1318,8 @@ on this string to produce the exported version." ;; Remove or replace comments (org-export-handle-comments (plist-get parameters :comments)) - ;; Remove #+TBLFM and #+TBLNAME lines - (org-export-handle-table-metalines) - - ;; Remove #+results and #+name lines - (org-export-res/src-name-cleanup) + ;; Remove #+TBLFM #+TBLNAME #+NAME #+RESULTS lines + (org-export-handle-metalines) ;; Run the final hook (run-hooks 'org-export-preprocess-final-hook) @@ -2009,9 +2006,11 @@ When it is nil, all comments will be removed." (replace-match "") (goto-char (max (point-min) (1- pos)))))))) -(defun org-export-handle-table-metalines () - "Remove table specific metalines #+TBLNAME: and #+TBLFM:." - (let ((re "^[ \t]*#\\+tbl\\(name\\|fm\\):\\(.*\n?\\)") +(defun org-export-handle-metalines () + "Remove tables and source blocks metalines. +This function should only be called after all block processing +has taken place." + (let ((re "^[ \t]*#\\+\\(tbl\\(?:name\\|fm\\)\\|results\\(?:\\[[a-z0-9]+\\]\\)?\\|name\\):\\(.*\n?\\)") (case-fold-search t) pos) (goto-char (point-min)) @@ -2024,18 +2023,6 @@ When it is nil, all comments will be removed." (replace-match "") (goto-char (max (point-min) (1- pos))))))) -(defun org-export-res/src-name-cleanup () - "Clean up #+results and #+name lines for export. -This function should only be called after all block processing -has taken place." - (interactive) - (save-excursion - (goto-char (point-min)) - (let ((case-fold-search t)) - (while (org-re-search-forward-unprotected - "#\\+\\(name\\|results\\(\\[[a-z0-9]+\\]\\)?\\):" nil t) - (delete-region (match-beginning 0) (progn (forward-line) (point))))))) - (defun org-export-mark-radio-links () "Find all matches for radio targets and turn them into internal links." (let ((re-radio (and org-target-link-regexp @@ -3313,18 +3300,20 @@ If yes remove the column and the special lines." (defun org-export-cleanup-toc-line (s) "Remove tags and timestamps from lines going into the toc." - (when (memq org-export-with-tags '(not-in-toc nil)) - (if (string-match (org-re " +:[[:alnum:]_@#%:]+: *$") s) + (if (not s) + "" ; Return a string when argument is nil + (when (memq org-export-with-tags '(not-in-toc nil)) + (if (string-match (org-re " +:[[:alnum:]_@#%:]+: *$") s) + (setq s (replace-match "" t t s)))) + (when org-export-remove-timestamps-from-toc + (while (string-match org-maybe-keyword-time-regexp s) (setq s (replace-match "" t t s)))) - (when org-export-remove-timestamps-from-toc - (while (string-match org-maybe-keyword-time-regexp s) - (setq s (replace-match "" t t s)))) - (while (string-match org-bracket-link-regexp s) - (setq s (replace-match (match-string (if (match-end 3) 3 1) s) - t t s))) - (while (string-match "\\[\\([0-9]\\|fn:[^]]*\\)\\]" s) - (setq s (replace-match "" t t s))) - s) + (while (string-match org-bracket-link-regexp s) + (setq s (replace-match (match-string (if (match-end 3) 3 1) s) + t t s))) + (while (string-match "\\[\\([0-9]\\|fn:[^]]*\\)\\]" s) + (setq s (replace-match "" t t s))) + s)) (defun org-get-text-property-any (pos prop &optional object) diff --git a/lisp/org-html.el b/lisp/org-html.el index 6c1437386..b8e7557c8 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1704,7 +1704,7 @@ PUB-DIR is set, use this as the publishing directory." ;; This is a headline (setq level (org-tr-level (- (match-end 1) (match-beginning 1) level-offset)) - txt (match-string 2 org-line)) + txt (or (match-string 2 org-line) "")) (if (string-match quote-re0 txt) (setq txt (replace-match "" t t txt))) (if (<= level (max umax umax-toc)) @@ -2141,9 +2141,10 @@ for formatting. This is required for the DocBook exporter." (if colgropen (setq html (cons (car html) (cons "" (cdr html))))) ;; Since the output of HTML table formatter can also be used in - ;; DocBook document, we want to always include the caption to make - ;; DocBook XML file valid. - (push (format "