summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-06-29 18:24:08 +0200
committerBastien Guerry <bzg@altern.org>2011-06-29 18:24:08 +0200
commit2b7dbee193c2846035dce373b786392d109f30b3 (patch)
tree052206672d502d19ff70d396babc67b2d2511624
parent560804b4d85ceb80d947e6f8f148215438e637bd (diff)
downloadorg-mode-2b7dbee193c2846035dce373b786392d109f30b3.tar.gz
Replace interactive-p with the org-called-interactively-p macro.
Interactive-p is an obsolete function as of Emacs 23.2. `org-called-interactively-p' takes care of the current (x)Emacs version and use either `interactive-p' (for XEmacs and Emacs<23.2) or `called-interactively-p'.
-rw-r--r--contrib/lisp/org-expiry.el12
-rw-r--r--lisp/ob.el2
-rw-r--r--lisp/org-agenda.el6
-rw-r--r--lisp/org-ascii.el12
-rw-r--r--lisp/org-docbook.el4
-rw-r--r--lisp/org-html.el4
-rw-r--r--lisp/org-latex.el4
-rw-r--r--lisp/org-table.el20
-rw-r--r--lisp/org.el20
9 files changed, 42 insertions, 42 deletions
diff --git a/contrib/lisp/org-expiry.el b/contrib/lisp/org-expiry.el
index 930b921..8b0eb15 100644
--- a/contrib/lisp/org-expiry.el
+++ b/contrib/lisp/org-expiry.el
@@ -186,7 +186,7 @@ restart `org-mode' if necessary."
;; need this to refresh org-mode hooks
(when (org-mode-p)
(org-mode)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(message "Org-expiry insinuated, `org-mode' restarted.")))))
(defun org-expiry-deinsinuate (&optional arg)
@@ -207,7 +207,7 @@ and restart `org-mode' if necessary."
;; need this to refresh org-mode hooks
(when (org-mode-p)
(org-mode)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(message "Org-expiry de-insinuated, `org-mode' restarted.")))))
;;; org-expiry-expired-p:
@@ -238,7 +238,7 @@ If FORCE is non-nil, don't require confirmation from the user.
Otherwise rely on `org-expiry-confirm-flag' to decide."
(interactive "P")
(save-excursion
- (when (interactive-p) (org-reveal))
+ (when (org-called-interactively-p) (org-reveal))
(when (org-expiry-expired-p)
(org-back-to-heading)
(looking-at org-complex-heading-regexp)
@@ -270,7 +270,7 @@ The expiry process will run the function defined by
(while (and (outline-next-heading) (< (point) end))
(when (org-expiry-expired-p)
(setq expired (1+ expired))
- (if (if (interactive-p)
+ (if (if (org-called-interactively-p)
(call-interactively 'org-expiry-process-entry)
(org-expiry-process-entry))
(setq processed (1+ processed)))))
@@ -338,7 +338,7 @@ and insert today's date."
(save-excursion
(if (org-expiry-expired-p)
(org-archive-subtree)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(message "Entry at point is not expired.")))))
(defun org-expiry-add-keyword (&optional keyword)
@@ -349,7 +349,7 @@ and insert today's date."
(save-excursion
(if (org-expiry-expired-p)
(org-todo keyword)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(message "Entry at point is not expired."))))
(error "\"%s\" is not a to-do keyword in this buffer" keyword)))
diff --git a/lisp/ob.el b/lisp/ob.el
index 9999323..e28c3d0 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -749,7 +749,7 @@ the current subtree."
(setf (nth 2 info)
(sort (copy-sequence (nth 2 info))
(lambda (a b) (string< (car a) (car b)))))
- ((lambda (hash) (when (interactive-p) (message hash)) hash)
+ ((lambda (hash) (when (org-called-interactively-p) (message hash)) hash)
(sha1 (format "%s-%s"
(mapconcat
#'identity
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 5f01848..11be25f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6083,7 +6083,7 @@ When this is the global TODO list, a prefix argument will be interpreted."
(message "Rebuilding agenda buffer...done")
(put 'org-agenda-filter :preset-filter preset)
(and (or filter preset) (org-agenda-filter-apply filter))
- (and cols (interactive-p) (org-agenda-columns))
+ (and cols (org-called-interactively-p) (org-agenda-columns))
(org-goto-line line)
(recenter window-line)))
@@ -7034,7 +7034,7 @@ if it was hidden in the outline."
(org-back-to-heading)
(run-hook-with-args 'org-cycle-hook 'folded))
(message "Remote: FOLDED"))
- ((and (interactive-p) (= more 1))
+ ((and (org-called-interactively-p) (= more 1))
(message "Remote: show with default settings"))
((= more 2)
(show-entry)
@@ -7335,7 +7335,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
"Set tags for the current headline."
(interactive)
(org-agenda-check-no-diary)
- (if (and (org-region-active-p) (interactive-p))
+ (if (and (org-region-active-p) (org-called-interactively-p))
(call-interactively 'org-change-tag-in-region)
(let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
(org-agenda-error)))
diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el
index 680c930..abc28f3 100644
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -96,28 +96,28 @@ utf8 Use all UTF-8 characters")
(defun org-export-as-latin1 (&rest args)
"Like `org-export-as-ascii', use latin1 encoding for special symbols."
(interactive)
- (org-export-as-encoding 'org-export-as-ascii (interactive-p)
+ (org-export-as-encoding 'org-export-as-ascii (org-called-interactively-p)
'latin1 args))
;;;###autoload
(defun org-export-as-latin1-to-buffer (&rest args)
"Like `org-export-as-ascii-to-buffer', use latin1 encoding for symbols."
(interactive)
- (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
+ (org-export-as-encoding 'org-export-as-ascii-to-buffer (org-called-interactively-p)
'latin1 args))
;;;###autoload
(defun org-export-as-utf8 (&rest args)
"Like `org-export-as-ascii', use use encoding for special symbols."
(interactive)
- (org-export-as-encoding 'org-export-as-ascii (interactive-p)
+ (org-export-as-encoding 'org-export-as-ascii (org-called-interactively-p)
'utf8 args))
;;;###autoload
(defun org-export-as-utf8-to-buffer (&rest args)
"Like `org-export-as-ascii-to-buffer', use utf8 encoding for symbols."
(interactive)
- (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
+ (org-export-as-encoding 'org-export-as-ascii-to-buffer (org-called-interactively-p)
'utf8 args))
(defun org-export-as-encoding (command interactivep encoding &rest args)
@@ -176,7 +176,7 @@ a Lisp program could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
- (when (interactive-p)
+ (when (org-called-interactively-p)
(setq buffer "*Org ASCII Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@@ -188,7 +188,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil ext-plist
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
+ (if (and (org-called-interactively-p) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index a622056..ceb7d93 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -325,7 +325,7 @@ could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
- (when (interactive-p)
+ (when (org-called-interactively-p)
(setq buffer "*Org DocBook Export*"))
(let ((transient-mark-mode t)
(zmacs-regions t)
@@ -337,7 +337,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
+ (if (and (org-called-interactively-p) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))
diff --git a/lisp/org-html.el b/lisp/org-html.el
index a343647..af6207d 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -724,7 +724,7 @@ a Lisp program could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
- (when (interactive-p)
+ (when (org-called-interactively-p)
(setq buffer "*Org HTML Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@@ -736,7 +736,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil ext-plist
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
+ (if (and (org-called-interactively-p) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index ede3275..4263835 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -717,7 +717,7 @@ a Lisp program could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
- (when (interactive-p)
+ (when (org-called-interactively-p)
(setq buffer "*Org LaTeX Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@@ -729,7 +729,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil ext-plist
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
+ (if (and (org-called-interactively-p) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index a57295f..3824ff4 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1117,7 +1117,7 @@ Return t when the line exists, nil if it does not exist."
"Blank the current table field or active region."
(interactive)
(org-table-check-inside-data-field)
- (if (and (interactive-p) (org-region-active-p))
+ (if (and (org-called-interactively-p) (org-region-active-p))
(let (org-table-clip)
(org-table-cut-region (region-beginning) (region-end)))
(skip-chars-backward "^|")
@@ -1193,27 +1193,27 @@ is always the old value."
(defun org-table-current-column ()
"Find out which column we are in."
(interactive)
- (if (interactive-p) (org-table-check-inside-data-field))
+ (if (org-called-interactively-p) (org-table-check-inside-data-field))
(save-excursion
(let ((cnt 0) (pos (point)))
(beginning-of-line 1)
(while (search-forward "|" pos t)
(setq cnt (1+ cnt)))
- (if (interactive-p) (message "In table column %d" cnt))
+ (if (org-called-interactively-p) (message "In table column %d" cnt))
cnt)))
(defun org-table-current-dline ()
"Find out what table data line we are in.
Only data lines count for this."
(interactive)
- (if (interactive-p) (org-table-check-inside-data-field))
+ (if (org-called-interactively-p) (org-table-check-inside-data-field))
(save-excursion
(let ((cnt 0) (pos (point)))
(goto-char (org-table-begin))
(while (<= (point) pos)
(if (looking-at org-table-dataline-regexp) (setq cnt (1+ cnt)))
(beginning-of-line 2))
- (if (interactive-p) (message "This is table line %d" cnt))
+ (if (org-called-interactively-p) (message "This is table line %d" cnt))
cnt)))
(defun org-table-goto-column (n &optional on-delim force)
@@ -1540,7 +1540,7 @@ should be done in reverse order."
(thiscol (org-table-current-column))
beg end bcol ecol tend tbeg column lns pos)
(when (equal thiscol 0)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(setq thiscol
(string-to-number
(read-string "Use column N for sorting: ")))
@@ -1933,7 +1933,7 @@ If NLAST is a number, only the NLAST fields will actually be summed."
s diff)
(format "%d:%02d:%02d" h m s))))
(kill-new sres)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(message "%s"
(substitute-command-keys
(format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)"
@@ -2303,7 +2303,7 @@ of the new mark."
(org-goto-line l1)))
(if (not (= epos (point-at-eol))) (org-table-align))
(org-goto-line l)
- (and (interactive-p) (message "%s" (cdr (assoc new org-recalc-marks))))))
+ (and (org-called-interactively-p) (message "%s" (cdr (assoc new org-recalc-marks))))))
(defun org-table-maybe-recalculate-line ()
"Recompute the current line if marked for it, and if we haven't just done it."
@@ -2521,7 +2521,7 @@ $1-> %s\n" orig formula form0 form))
(if fmt (format fmt (string-to-number ev)) ev)))))
(setq bw (get-buffer-window "*Substitution History*"))
(org-fit-window-to-buffer bw)
- (unless (and (interactive-p) (not ndown))
+ (unless (and (org-called-interactively-p) (not ndown))
(unless (let (inhibit-redisplay)
(y-or-n-p "Debugging Formula. Continue to next? "))
(org-table-align)
@@ -4149,7 +4149,7 @@ this table."
(catch 'exit
(unless (org-at-table-p) (error "Not at a table"))
;; when non-interactive, we assume align has just happened.
- (when (interactive-p) (org-table-align))
+ (when (org-called-interactively-p) (org-table-align))
(let ((dests (orgtbl-gather-send-defs))
(txt (buffer-substring-no-properties (org-table-begin)
(org-table-end)))
diff --git a/lisp/org.el b/lisp/org.el
index 827008d..8a03e94 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4830,7 +4830,7 @@ The following commands are available:
;; If empty file that did not turn on org-mode automatically, make it to.
(if (and org-insert-mode-line-in-empty-file
- (interactive-p)
+ (org-called-interactively-p)
(= (point-min) (point-max)))
(insert "# -*- mode: org -*-\n\n"))
(unless org-inhibit-startup
@@ -7437,7 +7437,7 @@ of some markers in the region, even if CUT is non-nil. This is
useful if the caller implements cut-and-paste as copy-then-paste-then-cut."
(interactive "p")
(let (beg end folded (beg0 (point)))
- (if (interactive-p)
+ (if (org-called-interactively-p)
(org-back-to-heading nil) ; take what looks like a subtree
(org-back-to-heading t)) ; take what is really there
(org-back-over-empty-lines)
@@ -7566,7 +7566,7 @@ the inserted text when done."
(setq shift (+ delta shift)))
(goto-char (point-min))
(setq newend (point-max))))
- (when (or (interactive-p) for-yank)
+ (when (or (org-called-interactively-p) for-yank)
(message "Clipboard pasted as level %d subtree" new-level))
(if (and (not for-yank) ; in this case, org-yank will decide about folding
kill-ring
@@ -8443,7 +8443,7 @@ For file links, arg negates `org-context-in-file-links'."
(when m
(org-with-point-at m
(setq agenda-link
- (if (interactive-p)
+ (if (org-called-interactively-p)
(call-interactively 'org-store-link)
(org-store-link nil)))))))
@@ -8506,9 +8506,9 @@ For file links, arg negates `org-context-in-file-links'."
((and (featurep 'org-id)
(or (eq org-link-to-org-use-id t)
(and (eq org-link-to-org-use-id 'create-if-interactive)
- (interactive-p))
+ (org-called-interactively-p))
(and (eq org-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
- (interactive-p)
+ (org-called-interactively-p)
(not custom-id))
(and org-link-to-org-use-id
(org-entry-get nil "ID"))))
@@ -8563,7 +8563,7 @@ For file links, arg negates `org-context-in-file-links'."
desc "NONE")))
(setq link (org-make-link cpltxt)))
- ((interactive-p)
+ ((org-called-interactively-p)
(error "Cannot link to a buffer which is not visiting a file"))
(t (setq link nil)))
@@ -8573,7 +8573,7 @@ For file links, arg negates `org-context-in-file-links'."
desc (or desc cpltxt))
(if (equal desc "NONE") (setq desc nil))
- (if (and (or (interactive-p) executing-kbd-macro) link)
+ (if (and (or (org-called-interactively-p) executing-kbd-macro) link)
(progn
(setq org-stored-links
(cons (list link desc) org-stored-links))
@@ -11015,7 +11015,7 @@ For calling through lisp, arg is also interpreted in the following way:
(org-with-wide-buffer
(run-hook-with-args-until-failure
'org-blocker-hook change-plist))))
- (if (interactive-p)
+ (if (org-called-interactively-p)
(error "TODO state change from %s to %s blocked" this state)
;; fail silently
(message "TODO state change from %s to %s blocked" this state)
@@ -12162,7 +12162,7 @@ that the match should indeed be shown."
(unless org-sparse-tree-open-archived-trees
(org-hide-archived-subtrees (point-min) (point-max)))
(run-hooks 'org-occur-hook)
- (if (interactive-p)
+ (if (org-called-interactively-p)
(message "%d match(es) for regexp %s" cnt regexp))
cnt))