diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2015-01-22 01:39:37 -0500 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2015-01-22 01:52:49 -0500 |
commit | 9f75cea40d6d4e0344c10e6538d0fcf5f3f0a476 (patch) | |
tree | 952ea5a14aee9ddc3b9cd4ce01ae707aea6b45d9 | |
parent | fda70440f49292197d76ce4c2727dbf426bc65f3 (diff) | |
download | org-mode-9f75cea40d6d4e0344c10e6538d0fcf5f3f0a476.tar.gz |
Obsolete ‘org-at-regexp-p’.
* lisp/org.el (org-at-regexp-p): Remove, adding an obsolete function
alias.
(org-in-regexp): Tidy docstring.
(org-open-at-point):
(org-between-regexps-p):
* lisp/org-table.el (org-table-fedit-shift-reference):
(org-table-show-reference): Call ‘org-in-regexp’ instead.
-rw-r--r-- | lisp/org-table.el | 18 | ||||
-rwxr-xr-x | lisp/org.el | 30 |
2 files changed, 19 insertions, 29 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el index dd054d8..175208c 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3730,16 +3730,16 @@ minutes or seconds." (defun org-table-fedit-shift-reference (dir) (cond - ((org-at-regexp-p "\\(\\<[a-zA-Z]\\)&") + ((org-in-regexp "\\(\\<[a-zA-Z]\\)&") (if (memq dir '(left right)) (org-rematch-and-replace 1 (eq dir 'left)) (user-error "Cannot shift reference in this direction"))) - ((org-at-regexp-p "\\(\\<[a-zA-Z]\\{1,2\\}\\)\\([0-9]+\\)") + ((org-in-regexp "\\(\\<[a-zA-Z]\\{1,2\\}\\)\\([0-9]+\\)") ;; A B3-like reference (if (memq dir '(up down)) (org-rematch-and-replace 2 (eq dir 'up)) (org-rematch-and-replace 1 (eq dir 'left)))) - ((org-at-regexp-p + ((org-in-regexp "\\(@\\|\\.\\.\\)\\([-+]?\\(I+\\>\\|[0-9]+\\)\\)\\(\\$\\([-+]?[0-9]+\\)\\)?") ;; An internal reference (if (memq dir '(up down)) @@ -3896,21 +3896,21 @@ With prefix ARG, apply the new formulas to the table." var name e what match dest) (if local (org-table-get-specials)) (setq what (cond - ((org-at-regexp-p "^@[0-9]+[ \t=]") + ((org-in-regexp "^@[0-9]+[ \t=]") (setq match (concat (substring (match-string 0) 0 -1) "$1.." (substring (match-string 0) 0 -1) "$100")) 'range) - ((or (org-at-regexp-p org-table-range-regexp2) - (org-at-regexp-p org-table-translate-regexp) - (org-at-regexp-p org-table-range-regexp)) + ((or (org-in-regexp- org-table-range-regexp2) + (org-in-regexp- org-table-translate-regexp) + (org-in-regexp- org-table-range-regexp)) (setq match (save-match-data (org-table-convert-refs-to-rc (match-string 0)))) 'range) - ((org-at-regexp-p "\\$[a-zA-Z][a-zA-Z0-9]*") 'name) - ((org-at-regexp-p "\\$[0-9]+") 'column) + ((org-in-regexp "\\$[a-zA-Z][a-zA-Z0-9]*") 'name) + ((org-in-regexp "\\$[0-9]+") 'column) ((not local) nil) (t (user-error "No reference at point"))) match (and what (or match (match-string 0)))) diff --git a/lisp/org.el b/lisp/org.el index 249582b..db2b6c0 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -10700,7 +10700,7 @@ link in a property drawer line." ;; Exception: open timestamps and links in properties drawers ;; and comments. ((memq type '(comment comment-block node-property)) - (cond ((org-at-regexp-p org-any-link-re) + (cond ((org-in-regexp org-any-link-re) (org-open-link-from-string (match-string-no-properties 0))) ((or (org-at-timestamp-p t) (org-at-date-range-p t)) (org-follow-timestamp-link)) @@ -22147,13 +22147,13 @@ and :keyword." (setq clist (nreverse (delq nil clist))) clist)) -;; FIXME: Compare with at-regexp-p Do we need both? (defun org-in-regexp (re &optional nlines visually) - "Check if point is inside a match of regexp. -Normally only the current line is checked, but you can include NLINES extra -lines both before and after point into the search. -If VISUALLY is set, require that the cursor is not after the match but -really on, so that the block visually is on the match." + "Check if point is inside a match of RE. + +Normally only the current line is checked, but you can include +NLINES extra lines after point into the search. If VISUALLY is +set, require that the cursor is not after the match but really +on, so that the block visually is on the match." (catch 'exit (let ((pos (point)) (eol (point-at-eol (+ 1 (or nlines 0)))) @@ -22164,18 +22164,8 @@ really on, so that the block visually is on the match." (if (and (<= (match-beginning 0) pos) (>= (+ inc (match-end 0)) pos)) (throw 'exit (cons (match-beginning 0) (match-end 0))))))))) - -(defun org-at-regexp-p (regexp) - "Is point inside a match of REGEXP in the current line?" - (catch 'exit - (save-excursion - (let ((pos (point)) (end (point-at-eol))) - (beginning-of-line 1) - (while (re-search-forward regexp end t) - (if (and (<= (match-beginning 0) pos) - (>= (match-end 0) pos)) - (throw 'exit t))) - nil)))) +(define-obsolete-function-alias 'org-at-regexp-p 'org-in-regexp + "Org mode 8.3") (defun org-between-regexps-p (start-re end-re &optional lim-up lim-down) "Non-nil when point is between matches of START-RE and END-RE. @@ -22196,7 +22186,7 @@ position before START-RE (resp. after END-RE)." (save-excursion ;; Point is on a block when on START-RE or if START-RE can be ;; found before it... - (and (or (org-at-regexp-p start-re) + (and (or (org-in-regexp start-re) (re-search-backward start-re limit-up t)) (setq beg (match-beginning 0)) ;; ... and END-RE after it... |