Mercurial > emacs
comparison lisp/textmodes/org.el @ 77935:acf3084ae2af
(org-cycle): Fix typo in docstring.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Wed, 06 Jun 2007 22:03:06 +0000 |
parents | 08f39efbb4c2 |
children | 390c97b648af |
comparison
equal
deleted
inserted
replaced
77934:fc20957a3166 | 77935:acf3084ae2af |
---|---|
1929 Used by the daily/weekly agenda and by the timeline. This should be | 1929 Used by the daily/weekly agenda and by the timeline. This should be |
1930 a format string understood by `format-time-string'. | 1930 a format string understood by `format-time-string'. |
1931 FIXME: Not used currently, because of timezone problem." | 1931 FIXME: Not used currently, because of timezone problem." |
1932 :group 'org-agenda-daily/weekly | 1932 :group 'org-agenda-daily/weekly |
1933 :type 'string) | 1933 :type 'string) |
1934 | 1934 |
1935 (defcustom org-agenda-include-diary nil | 1935 (defcustom org-agenda-include-diary nil |
1936 "If non-nil, include in the agenda entries from the Emacs Calendar's diary." | 1936 "If non-nil, include in the agenda entries from the Emacs Calendar's diary." |
1937 :group 'org-agenda-daily/weekly | 1937 :group 'org-agenda-daily/weekly |
1938 :type 'boolean) | 1938 :type 'boolean) |
1939 | 1939 |
2565 :group 'org-export-html | 2565 :group 'org-export-html |
2566 :type '(choice (const :tag "Never" nil) | 2566 :type '(choice (const :tag "Never" nil) |
2567 (const :tag "Always" t) | 2567 (const :tag "Always" t) |
2568 (const :tag "When there is no description" maybe))) | 2568 (const :tag "When there is no description" maybe))) |
2569 | 2569 |
2570 ;; FIXME: rename | 2570 ;; FIXME: rename |
2571 (defcustom org-export-html-expand t | 2571 (defcustom org-export-html-expand t |
2572 "Non-nil means, for HTML export, treat @<...> as HTML tag. | 2572 "Non-nil means, for HTML export, treat @<...> as HTML tag. |
2573 When nil, these tags will be exported as plain text and therefore | 2573 When nil, these tags will be exported as plain text and therefore |
2574 not be interpreted by a browser. | 2574 not be interpreted by a browser. |
2575 | 2575 |
3677 | 3677 |
3678 (defconst org-any-link-re | 3678 (defconst org-any-link-re |
3679 (concat "\\(" org-bracket-link-regexp "\\)\\|\\(" | 3679 (concat "\\(" org-bracket-link-regexp "\\)\\|\\(" |
3680 org-angle-link-re "\\)\\|\\(" | 3680 org-angle-link-re "\\)\\|\\(" |
3681 org-plain-link-re "\\)") | 3681 org-plain-link-re "\\)") |
3682 "Regular expression matching any link.") | 3682 "Regular expression matching any link.") |
3683 | 3683 |
3684 (defconst org-ts-lengths | 3684 (defconst org-ts-lengths |
3685 (cons (length (format-time-string (car org-time-stamp-formats))) | 3685 (cons (length (format-time-string (car org-time-stamp-formats))) |
3686 (length (format-time-string (cdr org-time-stamp-formats)))) | 3686 (length (format-time-string (cdr org-time-stamp-formats)))) |
3687 "This holds the lengths of the two different time formats.") | 3687 "This holds the lengths of the two different time formats.") |
4020 | 4020 |
4021 - When point is not at the beginning of a headline, execute | 4021 - When point is not at the beginning of a headline, execute |
4022 `indent-relative', like TAB normally does. See the option | 4022 `indent-relative', like TAB normally does. See the option |
4023 `org-cycle-emulate-tab' for details. | 4023 `org-cycle-emulate-tab' for details. |
4024 | 4024 |
4025 - Special case: if point is the the beginning of the buffer and there is | 4025 - Special case: if point is the beginning of the buffer and there is no |
4026 no headline in line 1, this function will act as if called with prefix arg." | 4026 headline in line 1, this function will act as if called with prefix arg." |
4027 (interactive "P") | 4027 (interactive "P") |
4028 (let* ((outline-regexp | 4028 (let* ((outline-regexp |
4029 (if (and (org-mode-p) org-cycle-include-plain-lists) | 4029 (if (and (org-mode-p) org-cycle-include-plain-lists) |
4030 "\\(?:\\*+\\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)" | 4030 "\\(?:\\*+\\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)" |
4031 outline-regexp)) | 4031 outline-regexp)) |
6331 (forward-char 1) "")) | 6331 (forward-char 1) "")) |
6332 | 6332 |
6333 | 6333 |
6334 (defun org-table-field-info (arg) | 6334 (defun org-table-field-info (arg) |
6335 "Show info about the current field, and highlight any reference at point." | 6335 "Show info about the current field, and highlight any reference at point." |
6336 (interactive "P") | 6336 (interactive "P") |
6337 (org-table-get-specials) | 6337 (org-table-get-specials) |
6338 (save-excursion | 6338 (save-excursion |
6339 (let* ((pos (point)) | 6339 (let* ((pos (point)) |
6340 (col (org-table-current-column)) | 6340 (col (org-table-current-column)) |
6341 (cname (car (rassoc (int-to-string col) org-table-column-names))) | 6341 (cname (car (rassoc (int-to-string col) org-table-column-names))) |
6571 (beginning-of-line 2)) | 6571 (beginning-of-line 2)) |
6572 (move-marker end nil) | 6572 (move-marker end nil) |
6573 (goto-line linepos) | 6573 (goto-line linepos) |
6574 (org-table-goto-column colpos) | 6574 (org-table-goto-column colpos) |
6575 (org-table-align) | 6575 (org-table-align) |
6576 (org-table-fix-formulas | 6576 (org-table-fix-formulas |
6577 "$" (list (cons (number-to-string col) (number-to-string colpos)) | 6577 "$" (list (cons (number-to-string col) (number-to-string colpos)) |
6578 (cons (number-to-string colpos) (number-to-string col)))))) | 6578 (cons (number-to-string colpos) (number-to-string col)))))) |
6579 | 6579 |
6580 (defun org-table-move-row-down () | 6580 (defun org-table-move-row-down () |
6581 "Move table row down." | 6581 "Move table row down." |
6589 (defun org-table-move-row (&optional up) | 6589 (defun org-table-move-row (&optional up) |
6590 "Move the current table line down. With arg UP, move it up." | 6590 "Move the current table line down. With arg UP, move it up." |
6591 (interactive "P") | 6591 (interactive "P") |
6592 (let* ((col (current-column)) | 6592 (let* ((col (current-column)) |
6593 (pos (point)) | 6593 (pos (point)) |
6594 (hline1p (save-excursion (beginning-of-line 1) | 6594 (hline1p (save-excursion (beginning-of-line 1) |
6595 (looking-at org-table-hline-regexp))) | 6595 (looking-at org-table-hline-regexp))) |
6596 (dline1 (org-table-current-dline)) | 6596 (dline1 (org-table-current-dline)) |
6597 (dline2 (+ dline1 (if up -1 1))) | 6597 (dline2 (+ dline1 (if up -1 1))) |
6598 (tonew (if up 0 2)) | 6598 (tonew (if up 0 2)) |
6599 txt hline2p) | 6599 txt hline2p) |
6610 (beginning-of-line tonew) | 6610 (beginning-of-line tonew) |
6611 (insert txt) | 6611 (insert txt) |
6612 (beginning-of-line 0) | 6612 (beginning-of-line 0) |
6613 (move-to-column col) | 6613 (move-to-column col) |
6614 (unless (or hline1p hline2p) | 6614 (unless (or hline1p hline2p) |
6615 (org-table-fix-formulas | 6615 (org-table-fix-formulas |
6616 "@" (list (cons (number-to-string dline1) (number-to-string dline2)) | 6616 "@" (list (cons (number-to-string dline1) (number-to-string dline2)) |
6617 (cons (number-to-string dline2) (number-to-string dline1))))))) | 6617 (cons (number-to-string dline2) (number-to-string dline1))))))) |
6618 | 6618 |
6619 (defun org-table-insert-row (&optional arg) | 6619 (defun org-table-insert-row (&optional arg) |
6620 "Insert a new row above the current line into the table. | 6620 "Insert a new row above the current line into the table. |
7250 (goto-char (org-table-end)) | 7250 (goto-char (org-table-end)) |
7251 (when (looking-at "\\([ \t]*\n\\)*#\\+TBLFM: *\\(.*\\)") | 7251 (when (looking-at "\\([ \t]*\n\\)*#\\+TBLFM: *\\(.*\\)") |
7252 (setq strings (org-split-string (match-string 2) " *:: *")) | 7252 (setq strings (org-split-string (match-string 2) " *:: *")) |
7253 (while (setq string (pop strings)) | 7253 (while (setq string (pop strings)) |
7254 (when (string-match "\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*[^ \t]\\)" string) | 7254 (when (string-match "\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*[^ \t]\\)" string) |
7255 (setq scol (if (match-end 2) | 7255 (setq scol (if (match-end 2) |
7256 (match-string 2 string) | 7256 (match-string 2 string) |
7257 (match-string 1 string)) | 7257 (match-string 1 string)) |
7258 eq (match-string 3 string) | 7258 eq (match-string 3 string) |
7259 eq-alist (cons (cons scol eq) eq-alist)) | 7259 eq-alist (cons (cons scol eq) eq-alist)) |
7260 (if (member scol seen) | 7260 (if (member scol seen) |
7261 (error "Double definition `$%s=' in TBLFM line, please fix by hand" scol) | 7261 (error "Double definition `$%s=' in TBLFM line, please fix by hand" scol) |
7295 c v l line col types dlines hlines) | 7295 c v l line col types dlines hlines) |
7296 (setq org-table-column-names nil | 7296 (setq org-table-column-names nil |
7297 org-table-local-parameters nil | 7297 org-table-local-parameters nil |
7298 org-table-named-field-locations nil | 7298 org-table-named-field-locations nil |
7299 org-table-current-begin-line nil | 7299 org-table-current-begin-line nil |
7300 org-table-current-line-types nil) | 7300 org-table-current-line-types nil) |
7301 (goto-char beg) | 7301 (goto-char beg) |
7302 (when (re-search-forward "^[ \t]*| *! *\\(|.*\\)" end t) | 7302 (when (re-search-forward "^[ \t]*| *! *\\(|.*\\)" end t) |
7303 (setq names (org-split-string (match-string 1) " *| *") | 7303 (setq names (org-split-string (match-string 1) " *| *") |
7304 cnt 1) | 7304 cnt 1) |
7305 (while (setq name (pop names)) | 7305 (while (setq name (pop names)) |
7332 (push (cons field v) org-table-local-parameters) | 7332 (push (cons field v) org-table-local-parameters) |
7333 (push (list field line col) org-table-named-field-locations)))) | 7333 (push (list field line col) org-table-named-field-locations)))) |
7334 ;; Analyse the line types | 7334 ;; Analyse the line types |
7335 (goto-char beg) | 7335 (goto-char beg) |
7336 (setq org-table-current-begin-line (org-current-line) | 7336 (setq org-table-current-begin-line (org-current-line) |
7337 l org-table-current-begin-line) | 7337 l org-table-current-begin-line) |
7338 (while (looking-at "[ \t]*|\\(-\\)?") | 7338 (while (looking-at "[ \t]*|\\(-\\)?") |
7339 (push (if (match-end 1) 'hline 'dline) types) | 7339 (push (if (match-end 1) 'hline 'dline) types) |
7340 (if (match-end 1) (push l hlines) (push l dlines)) | 7340 (if (match-end 1) (push l hlines) (push l dlines)) |
7341 (beginning-of-line 2) | 7341 (beginning-of-line 2) |
7342 (setq l (1+ l))) | 7342 (setq l (1+ l))) |
7575 ;; Check for old vertical references | 7575 ;; Check for old vertical references |
7576 (setq form (org-rewrite-old-row-references form)) | 7576 (setq form (org-rewrite-old-row-references form)) |
7577 ;; Insert complex ranges | 7577 ;; Insert complex ranges |
7578 (while (string-match org-table-range-regexp form) | 7578 (while (string-match org-table-range-regexp form) |
7579 (setq form | 7579 (setq form |
7580 (replace-match | 7580 (replace-match |
7581 (save-match-data | 7581 (save-match-data |
7582 (org-table-make-reference | 7582 (org-table-make-reference |
7583 (org-table-get-range (match-string 0 form) nil n0) | 7583 (org-table-get-range (match-string 0 form) nil n0) |
7584 keep-empty numbers lispp)) | 7584 keep-empty numbers lispp)) |
7585 t t form))) | 7585 t t form))) |
7586 ;; Insert simple ranges | 7586 ;; Insert simple ranges |
7587 (while (string-match "\\$\\([0-9]+\\)\\.\\.\\$\\([0-9]+\\)" form) | 7587 (while (string-match "\\$\\([0-9]+\\)\\.\\.\\$\\([0-9]+\\)" form) |
7588 (setq form | 7588 (setq form |
7589 (replace-match | 7589 (replace-match |
7590 (save-match-data | 7590 (save-match-data |
7591 (org-table-make-reference | 7591 (org-table-make-reference |
7592 (org-sublist | 7592 (org-sublist |
7593 fields (string-to-number (match-string 1 form)) | 7593 fields (string-to-number (match-string 1 form)) |
7614 ev (if (numberp ev) (number-to-string ev) ev)) | 7614 ev (if (numberp ev) (number-to-string ev) ev)) |
7615 (or (fboundp 'calc-eval) | 7615 (or (fboundp 'calc-eval) |
7616 (error "Calc does not seem to be installed, and is needed to evaluate the formula")) | 7616 (error "Calc does not seem to be installed, and is needed to evaluate the formula")) |
7617 (setq ev (calc-eval (cons form modes) | 7617 (setq ev (calc-eval (cons form modes) |
7618 (if numbers 'num)))) | 7618 (if numbers 'num)))) |
7619 | 7619 |
7620 (when org-table-formula-debug | 7620 (when org-table-formula-debug |
7621 (with-output-to-temp-buffer "*Substitution History*" | 7621 (with-output-to-temp-buffer "*Substitution History*" |
7622 (princ (format "Substitution history of formula | 7622 (princ (format "Substitution history of formula |
7623 Orig: %s | 7623 Orig: %s |
7624 $xyz-> %s | 7624 $xyz-> %s |
7856 (while (setq eq (pop eqlname)) | 7856 (while (setq eq (pop eqlname)) |
7857 (setq name (car eq) | 7857 (setq name (car eq) |
7858 a (assoc name org-table-named-field-locations)) | 7858 a (assoc name org-table-named-field-locations)) |
7859 (and (not a) | 7859 (and (not a) |
7860 (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" name) | 7860 (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" name) |
7861 (setq a | 7861 (setq a |
7862 (list | 7862 (list |
7863 name | 7863 name |
7864 (aref org-table-dlines | 7864 (aref org-table-dlines |
7865 (string-to-number (match-string 1 name))) | 7865 (string-to-number (match-string 1 name))) |
7866 (string-to-number (match-string 2 name))))) | 7866 (string-to-number (match-string 2 name))))) |
7874 (message "Re-applying formulas...done") | 7874 (message "Re-applying formulas...done") |
7875 (goto-line thisline) | 7875 (goto-line thisline) |
7876 (org-table-goto-column thiscol) | 7876 (org-table-goto-column thiscol) |
7877 (or noalign (and org-table-may-need-update (org-table-align)) | 7877 (or noalign (and org-table-may-need-update (org-table-align)) |
7878 (and all (message "Re-applying formulas...done")))))) | 7878 (and all (message "Re-applying formulas...done")))))) |
7879 | 7879 |
7880 (defun org-table-iterate (&optional arg) | 7880 (defun org-table-iterate (&optional arg) |
7881 "Recalculate the table until it does not change anymore." | 7881 "Recalculate the table until it does not change anymore." |
7882 (interactive "P") | 7882 (interactive "P") |
7883 (let ((imax (if arg (prefix-numeric-value arg) 10)) | 7883 (let ((imax (if arg (prefix-numeric-value arg) 10)) |
7884 (i 0) | 7884 (i 0) |
7885 (lasttbl (buffer-substring (org-table-begin) (org-table-end))) | 7885 (lasttbl (buffer-substring (org-table-begin) (org-table-end))) |
7886 thistbl) | 7886 thistbl) |
7887 (catch 'exit | 7887 (catch 'exit |
7888 (while (< i imax) | 7888 (while (< i imax) |
7889 (setq i (1+ i)) | 7889 (setq i (1+ i)) |
8236 (defun org-table-edit-scroll-down (N) | 8236 (defun org-table-edit-scroll-down (N) |
8237 (interactive "p") | 8237 (interactive "p") |
8238 (org-table-edit-scroll (- N))) | 8238 (org-table-edit-scroll (- N))) |
8239 | 8239 |
8240 (defvar org-table-rectangle-overlays nil) | 8240 (defvar org-table-rectangle-overlays nil) |
8241 | 8241 |
8242 (defun org-table-add-rectangle-overlay (beg end &optional face) | 8242 (defun org-table-add-rectangle-overlay (beg end &optional face) |
8243 "Add a new overlay." | 8243 "Add a new overlay." |
8244 (let ((ov (org-make-overlay beg end))) | 8244 (let ((ov (org-make-overlay beg end))) |
8245 (org-overlay-put ov 'face (or face 'secondary-selection)) | 8245 (org-overlay-put ov 'face (or face 'secondary-selection)) |
8246 (push ov org-table-rectangle-overlays))) | 8246 (push ov org-table-rectangle-overlays))) |
8720 (org-remove-by-index (funcall fun org-table-last-alignment) | 8720 (org-remove-by-index (funcall fun org-table-last-alignment) |
8721 skipcols i0)) | 8721 skipcols i0)) |
8722 (org-table-last-column-widths | 8722 (org-table-last-column-widths |
8723 (org-remove-by-index (funcall fun org-table-last-column-widths) | 8723 (org-remove-by-index (funcall fun org-table-last-column-widths) |
8724 skipcols i0))) | 8724 skipcols i0))) |
8725 | 8725 |
8726 (unless (fboundp transform) | 8726 (unless (fboundp transform) |
8727 (error "No such transformation function %s" transform)) | 8727 (error "No such transformation function %s" transform)) |
8728 (setq txt (funcall transform table params)) | 8728 (setq txt (funcall transform table params)) |
8729 ;; Find the insertion place | 8729 ;; Find the insertion place |
8730 (save-excursion | 8730 (save-excursion |
8752 (setq i0 (1- (or i0 0))) | 8752 (setq i0 (1- (or i0 0))) |
8753 (delq :rm (mapcar (lambda (x) | 8753 (delq :rm (mapcar (lambda (x) |
8754 (setq i0 (1+ i0)) | 8754 (setq i0 (1+ i0)) |
8755 (if (memq i0 indices) :rm x)) | 8755 (if (memq i0 indices) :rm x)) |
8756 list)))) | 8756 list)))) |
8757 | 8757 |
8758 (defun orgtbl-toggle-comment () | 8758 (defun orgtbl-toggle-comment () |
8759 "Comment or uncomment the orgtbl at point." | 8759 "Comment or uncomment the orgtbl at point." |
8760 (interactive) | 8760 (interactive) |
8761 (let* ((re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp)) | 8761 (let* ((re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp)) |
8762 (re2 (concat "^" orgtbl-line-start-regexp)) | 8762 (re2 (concat "^" orgtbl-line-start-regexp)) |
8848 (interactive) | 8848 (interactive) |
8849 (let* ((p params) | 8849 (let* ((p params) |
8850 (splicep (plist-get p :splice)) | 8850 (splicep (plist-get p :splice)) |
8851 (hline (plist-get p :hline)) | 8851 (hline (plist-get p :hline)) |
8852 rtn line i fm efm lfmt h) | 8852 rtn line i fm efm lfmt h) |
8853 | 8853 |
8854 ;; Do we have a header? | 8854 ;; Do we have a header? |
8855 (if (and (not splicep) (listp (car table)) (memq 'hline table)) | 8855 (if (and (not splicep) (listp (car table)) (memq 'hline table)) |
8856 (setq h t)) | 8856 (setq h t)) |
8857 | 8857 |
8858 ;; Put header | 8858 ;; Put header |
8859 (unless splicep | 8859 (unless splicep |
8860 (push (or (plist-get p :tstart) "ERROR: no :tstart") rtn)) | 8860 (push (or (plist-get p :tstart) "ERROR: no :tstart") rtn)) |
8861 | 8861 |
8862 ;; Now loop over all lines | 8862 ;; Now loop over all lines |
8863 (while (setq line (pop table)) | 8863 (while (setq line (pop table)) |
8864 (if (eq line 'hline) | 8864 (if (eq line 'hline) |
8865 ;; A horizontal separator line | 8865 ;; A horizontal separator line |
8866 (progn (if hline (push hline rtn)) | 8866 (progn (if hline (push hline rtn)) |
8884 (push (concat | 8884 (push (concat |
8885 (org-get-param p h i :lstart :hlstart) | 8885 (org-get-param p h i :lstart :hlstart) |
8886 (mapconcat 'identity line (org-get-param p h i :sep :hsep)) | 8886 (mapconcat 'identity line (org-get-param p h i :sep :hsep)) |
8887 (org-get-param p h i :lend :hlend)) | 8887 (org-get-param p h i :lend :hlend)) |
8888 rtn)))) | 8888 rtn)))) |
8889 | 8889 |
8890 (unless splicep | 8890 (unless splicep |
8891 (push (or (plist-get p :tend) "ERROR: no :tend") rtn)) | 8891 (push (or (plist-get p :tend) "ERROR: no :tend") rtn)) |
8892 | 8892 |
8893 (mapconcat 'identity (nreverse rtn) "\n"))) | 8893 (mapconcat 'identity (nreverse rtn) "\n"))) |
8894 | 8894 |
8895 (defun orgtbl-to-latex (table params) | 8895 (defun orgtbl-to-latex (table params) |
8896 "Convert the orgtbl-mode TABLE to LaTeX. | 8896 "Convert the orgtbl-mode TABLE to LaTeX. |
8897 TABLE is a list, each entry either the symbol `hline' for a horizontal | 8897 TABLE is a list, each entry either the symbol `hline' for a horizontal |
9039 (let ((name (bbdb-record-name (bbdb-current-record))) | 9039 (let ((name (bbdb-record-name (bbdb-current-record))) |
9040 (company (bbdb-record-company (bbdb-current-record)))) | 9040 (company (bbdb-record-company (bbdb-current-record)))) |
9041 (setq cpltxt (concat "bbdb:" (or name company)) | 9041 (setq cpltxt (concat "bbdb:" (or name company)) |
9042 link (org-make-link cpltxt)) | 9042 link (org-make-link cpltxt)) |
9043 (org-store-link-props :type "bbdb" :name name :company company))) | 9043 (org-store-link-props :type "bbdb" :name name :company company))) |
9044 | 9044 |
9045 ((eq major-mode 'Info-mode) | 9045 ((eq major-mode 'Info-mode) |
9046 (setq link (org-make-link "info:" | 9046 (setq link (org-make-link "info:" |
9047 (file-name-nondirectory Info-current-file) | 9047 (file-name-nondirectory Info-current-file) |
9048 ":" Info-current-node)) | 9048 ":" Info-current-node)) |
9049 (setq cpltxt (concat (file-name-nondirectory Info-current-file) | 9049 (setq cpltxt (concat (file-name-nondirectory Info-current-file) |
9217 (concat cpltxt "::" (org-make-org-heading-search-string txt)) | 9217 (concat cpltxt "::" (org-make-org-heading-search-string txt)) |
9218 desc "NONE")))) | 9218 desc "NONE")))) |
9219 (if (string-match "::\\'" cpltxt) | 9219 (if (string-match "::\\'" cpltxt) |
9220 (setq cpltxt (substring cpltxt 0 -2))) | 9220 (setq cpltxt (substring cpltxt 0 -2))) |
9221 (setq link (org-make-link cpltxt))) | 9221 (setq link (org-make-link cpltxt))) |
9222 | 9222 |
9223 (buffer-file-name | 9223 (buffer-file-name |
9224 ;; Just link to this file here. | 9224 ;; Just link to this file here. |
9225 (setq cpltxt (concat "file:" | 9225 (setq cpltxt (concat "file:" |
9226 (abbreviate-file-name buffer-file-name))) | 9226 (abbreviate-file-name buffer-file-name))) |
9227 ;; Add a context string | 9227 ;; Add a context string |
11141 (if (not (equal (char-before) ?\ )) " " "") | 11141 (if (not (equal (char-before) ?\ )) " " "") |
11142 (cond ((eq what 'scheduled) org-scheduled-string) | 11142 (cond ((eq what 'scheduled) org-scheduled-string) |
11143 ((eq what 'deadline) org-deadline-string) | 11143 ((eq what 'deadline) org-deadline-string) |
11144 ((eq what 'closed) org-closed-string)) | 11144 ((eq what 'closed) org-closed-string)) |
11145 " ") | 11145 " ") |
11146 (org-insert-time-stamp time | 11146 (org-insert-time-stamp time |
11147 (or org-time-was-given (eq what 'closed)) | 11147 (or org-time-was-given (eq what 'closed)) |
11148 (eq what 'closed)) | 11148 (eq what 'closed)) |
11149 (end-of-line 1)) | 11149 (end-of-line 1)) |
11150 (goto-char (point-min)) | 11150 (goto-char (point-min)) |
11151 (widen) | 11151 (widen) |
11639 (setq tags (replace-match ":" t t tags)))) | 11639 (setq tags (replace-match ":" t t tags)))) |
11640 (if (string-match "\\`[\t ]*\\'" tags) | 11640 (if (string-match "\\`[\t ]*\\'" tags) |
11641 (setq tags "") | 11641 (setq tags "") |
11642 (unless (string-match ":$" tags) (setq tags (concat tags ":"))) | 11642 (unless (string-match ":$" tags) (setq tags (concat tags ":"))) |
11643 (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) | 11643 (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) |
11644 | 11644 |
11645 ;; Insert new tags at the correct column | 11645 ;; Insert new tags at the correct column |
11646 (beginning-of-line 1) | 11646 (beginning-of-line 1) |
11647 (if (re-search-forward | 11647 (if (re-search-forward |
11648 (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$") | 11648 (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$") |
11649 (point-at-eol) t) | 11649 (point-at-eol) t) |
13646 (setq re (concat "^\\*+ +" org-comment-string "\\>")) | 13646 (setq re (concat "^\\*+ +" org-comment-string "\\>")) |
13647 (while (re-search-forward re nil t) | 13647 (while (re-search-forward re nil t) |
13648 (add-text-properties | 13648 (add-text-properties |
13649 (match-beginning 0) (org-end-of-subtree t) pc))) | 13649 (match-beginning 0) (org-end-of-subtree t) pc))) |
13650 (set-buffer-modified-p bmp)))))) | 13650 (set-buffer-modified-p bmp)))))) |
13651 | 13651 |
13652 (defvar org-agenda-skip-function nil | 13652 (defvar org-agenda-skip-function nil |
13653 "Function to be called at each match during agenda construction. | 13653 "Function to be called at each match during agenda construction. |
13654 If this function return nil, the current match should not be skipped. | 13654 If this function return nil, the current match should not be skipped. |
13655 Otherwise, the function must return a position from where the search | 13655 Otherwise, the function must return a position from where the search |
13656 should be continued. | 13656 should be continued. |
15654 tags))) | 15654 tags))) |
15655 (or org-use-tag-inheritance (error "")) | 15655 (or org-use-tag-inheritance (error "")) |
15656 (org-up-heading-all 1)) | 15656 (org-up-heading-all 1)) |
15657 (error nil)))) | 15657 (error nil)))) |
15658 tags))) | 15658 tags))) |
15659 | 15659 |
15660 ;; FIXME: should fix the tags property of the agenda line. | 15660 ;; FIXME: should fix the tags property of the agenda line. |
15661 (defun org-agenda-set-tags () | 15661 (defun org-agenda-set-tags () |
15662 "Set tags for the current headline." | 15662 "Set tags for the current headline." |
15663 (interactive) | 15663 (interactive) |
15664 (org-agenda-check-no-diary) | 15664 (org-agenda-check-no-diary) |
16794 '(org-protected t))) | 16794 '(org-protected t))) |
16795 (when htmlp | 16795 (when htmlp |
16796 (goto-char (point-min)) | 16796 (goto-char (point-min)) |
16797 (while (re-search-forward "^#\\+HTML:[ \t]*\\(.*\\)" nil t) | 16797 (while (re-search-forward "^#\\+HTML:[ \t]*\\(.*\\)" nil t) |
16798 (replace-match "\\1" t) | 16798 (replace-match "\\1" t) |
16799 (add-text-properties | 16799 (add-text-properties |
16800 (point-at-bol) (min (1+ (point-at-eol)) (point-max)) | 16800 (point-at-bol) (min (1+ (point-at-eol)) (point-max)) |
16801 '(org-protected t)))) | 16801 '(org-protected t)))) |
16802 (goto-char (point-min)) | 16802 (goto-char (point-min)) |
16803 (while (re-search-forward | 16803 (while (re-search-forward |
16804 "^#\\+BEGIN_HTML\\>.*\\(\n.*\\)*?\n#\\+END_HTML\\>.*\n?" nil t) | 16804 "^#\\+BEGIN_HTML\\>.*\\(\n.*\\)*?\n#\\+END_HTML\\>.*\n?" nil t) |
17937 (setq tbopen t) | 17937 (setq tbopen t) |
17938 (while (setq line (pop lines)) | 17938 (while (setq line (pop lines)) |
17939 (catch 'next-line | 17939 (catch 'next-line |
17940 (if (string-match "^[ \t]*|-" line) | 17940 (if (string-match "^[ \t]*|-" line) |
17941 (progn | 17941 (progn |
17942 (unless splice | 17942 (unless splice |
17943 (push (if head "</thead>" "</tbody>") html) | 17943 (push (if head "</thead>" "</tbody>") html) |
17944 (if lines (push "<tbody>" html) (setq tbopen nil))) | 17944 (if lines (push "<tbody>" html) (setq tbopen nil))) |
17945 (setq head nil) ;; head ends here, first time around | 17945 (setq head nil) ;; head ends here, first time around |
17946 ;; ignore this line | 17946 ;; ignore this line |
17947 (throw 'next-line t))) | 17947 (throw 'next-line t))) |
19470 (eol (point-at-eol (+ 1 (or nlines 0)))) | 19470 (eol (point-at-eol (+ 1 (or nlines 0)))) |
19471 (inc (if visually 1 0))) | 19471 (inc (if visually 1 0))) |
19472 (save-excursion | 19472 (save-excursion |
19473 (beginning-of-line (- 1 (or nlines 0))) | 19473 (beginning-of-line (- 1 (or nlines 0))) |
19474 (while (re-search-forward re eol t) | 19474 (while (re-search-forward re eol t) |
19475 (if (and (<= (match-beginning 0) pos) | 19475 (if (and (<= (match-beginning 0) pos) |
19476 (>= (+ inc (match-end 0)) pos)) | 19476 (>= (+ inc (match-end 0)) pos)) |
19477 (throw 'exit (cons (match-beginning 0) (match-end 0))))))))) | 19477 (throw 'exit (cons (match-beginning 0) (match-end 0))))))))) |
19478 | 19478 |
19479 (defun org-point-in-group (point group &optional context) | 19479 (defun org-point-in-group (point group &optional context) |
19480 "Check if POINT is in match-group GROUP. | 19480 "Check if POINT is in match-group GROUP. |
19533 TABLE is an association list with keys line \"%a\" and string values. | 19533 TABLE is an association list with keys line \"%a\" and string values. |
19534 The sequences in STRING may contain normal field width and padding information, | 19534 The sequences in STRING may contain normal field width and padding information, |
19535 for example \"%-5s\". Replacements happen in the sequence given by TABLE, | 19535 for example \"%-5s\". Replacements happen in the sequence given by TABLE, |
19536 so values can contain further %-escapes if they are define later in TABLE." | 19536 so values can contain further %-escapes if they are define later in TABLE." |
19537 (let ((case-fold-search nil) | 19537 (let ((case-fold-search nil) |
19538 e re rpl) | 19538 e re rpl) |
19539 (while (setq e (pop table)) | 19539 (while (setq e (pop table)) |
19540 (setq re (concat "%-?[0-9.]*" (substring (car e) 1))) | 19540 (setq re (concat "%-?[0-9.]*" (substring (car e) 1))) |
19541 (while (string-match re string) | 19541 (while (string-match re string) |
19542 (setq rpl (format (concat (substring (match-string 0 string) 0 -1) "s") | 19542 (setq rpl (format (concat (substring (match-string 0 string) 0 -1) "s") |
19543 (cdr e))) | 19543 (cdr e))) |