replacing calls to now-defunct function `interactive-p'

* lisp/org-agenda.el (org-agenda-redo): Replacing call to now-defunct
  function `interactive-p'.
  (org-agenda-show-1): Replacing call to now-defunct function
  `interactive-p'.
  (org-agenda-set-tags): Replacing call to now-defunct function `interactive-p'.
* lisp/org-ascii.el: Replacing call to now-defunct function
  `interactive-p'.
  (org-export-as-latin1): Replacing call to now-defunct function
  `interactive-p'.
  (org-export-as-latin1-to-buffer): Replacing call to now-defunct
  function `interactive-p'.
  (org-export-as-utf8): Replacing call to now-defunct function
  `interactive-p'.
  (org-export-as-utf8-to-buffer): Replacing call to now-defunct function
  `interactive-p'.
  (org-export-region-as-ascii): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-docbook.el: Replacing call to now-defunct function
  `interactive-p'.
  (org-export-region-as-docbook): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-html.el: Replacing call to now-defunct function
  `interactive-p'.
  (org-export-region-as-html): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-latex.el: Replacing call to now-defunct function
  `interactive-p'.
  (org-export-region-as-latex): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-macs.el: Replacing call to now-defunct function
  `interactive-p'.
  (org-called-interactively-p): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-table.el: Replacing call to now-defunct function
  `interactive-p'.
  (org-table-blank-field): Replacing call to now-defunct function
  `interactive-p'.
  (org-table-current-column): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function
  `interactive-p'.
  (org-table-current-dline): Replacing call to now-defunct function
  `interactive-p'.Replacing call to now-defunct function
  `interactive-p'.
  (org-table-sort-lines): Replacing call to now-defunct function
  `interactive-p'.
  (org-table-sum): Replacing call to now-defunct function
  `interactive-p'.
  (org-table-rotate-recalc-marks): Replacing call to now-defunct
  function `interactive-p'.
  (org-table-eval-formula): Replacing call to now-defunct function
  `interactive-p'.
  (orgtbl-send-table): Replacing call to now-defunct function `interactive-p'.
* lisp/org.el: Replacing call to now-defunct function `interactive-p'.
  (org-mode): Replacing call to now-defunct function `interactive-p'.
  (org-copy-subtree): Replacing call to now-defunct function
  `interactive-p'.
  (org-paste-subtree): Replacing call to now-defunct function
  `interactive-p'.
  (org-store-link): Replacing call to now-defunct function
  `interactive-p'.
  (org-todo): Replacing call to now-defunct function `interactive-p'.
  (org-occur): Replacing call to now-defunct function `interactive-p'.
This commit is contained in:
Eric Schulte 2011-06-14 11:37:59 -07:00
parent 95f9aa5ff5
commit 4f084e1467
8 changed files with 42 additions and 39 deletions

View File

@ -6039,7 +6039,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 (called-interactively-p 'any) (org-agenda-columns))
(org-goto-line line)
(recenter window-line)))
@ -6990,7 +6990,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 (called-interactively-p 'any) (= more 1))
(message "Remote: show with default settings"))
((= more 2)
(show-entry)
@ -7291,7 +7291,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) (called-interactively-p 'any))
(call-interactively 'org-change-tag-in-region)
(let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
(org-agenda-error)))

View File

@ -96,29 +96,29 @@ 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 (called-interactively-p 'any)
'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)
'latin1 args))
(org-export-as-encoding 'org-export-as-ascii-to-buffer
(called-interactively-p 'any) '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 (called-interactively-p 'any)
'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)
'utf8 args))
(org-export-as-encoding 'org-export-as-ascii-to-buffer
(called-interactively-p 'any) 'utf8 args))
(defun org-export-as-encoding (command interactivep encoding &rest args)
(let ((org-export-ascii-entities encoding))
@ -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 (called-interactively-p 'any)
(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 (called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -320,7 +320,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 (called-interactively-p 'any)
(setq buffer "*Org DocBook Export*"))
(let ((transient-mark-mode t)
(zmacs-regions t)
@ -332,7 +332,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 (called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -718,7 +718,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 (called-interactively-p 'any)
(setq buffer "*Org HTML Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@ -730,7 +730,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 (called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -710,7 +710,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 (called-interactively-p 'any)
(setq buffer "*Org LaTeX Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@ -722,7 +722,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 (called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -49,12 +49,12 @@
(defmacro org-called-interactively-p (&optional kind)
`(if (featurep 'xemacs)
(interactive-p)
(called-interactively-p 'any)
(if (or (> emacs-major-version 23)
(and (>= emacs-major-version 23)
(>= emacs-minor-version 2)))
(with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1
(interactive-p))))
(called-interactively-p 'any))))
(if (and (not (fboundp 'with-silent-modifications))
(or (< emacs-major-version 23)

View File

@ -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 (called-interactively-p 'any) (org-region-active-p))
(let (org-table-clip)
(org-table-cut-region (region-beginning) (region-end)))
(skip-chars-backward "^|")
@ -1193,27 +1193,29 @@ 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 (called-interactively-p 'any) (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))
(when (called-interactively-p 'interactive)
(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))
(when (called-interactively-p 'any)
(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 (called-interactively-p 'any) (message "This is table line %d" cnt))
cnt)))
(defun org-table-goto-column (n &optional on-delim force)
@ -1540,7 +1542,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 (called-interactively-p 'any)
(setq thiscol
(string-to-number
(read-string "Use column N for sorting: ")))
@ -1933,7 +1935,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 (called-interactively-p 'interactive)
(message "%s"
(substitute-command-keys
(format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)"
@ -2303,7 +2305,8 @@ 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 (called-interactively-p 'interactive)
(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 +2524,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 (called-interactively-p 'any) (not ndown))
(unless (let (inhibit-redisplay)
(y-or-n-p "Debugging Formula. Continue to next? "))
(org-table-align)
@ -4149,7 +4152,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 (called-interactively-p 'any) (org-table-align))
(let ((dests (orgtbl-gather-send-defs))
(txt (buffer-substring-no-properties (org-table-begin)
(org-table-end)))

View File

@ -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)
(called-interactively-p 'any)
(= (point-min) (point-max)))
(insert "# -*- mode: org -*-\n\n"))
(unless org-inhibit-startup
@ -7432,7 +7432,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 (called-interactively-p 'any)
(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)
@ -7561,7 +7561,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 (called-interactively-p 'interactive) 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
@ -8438,7 +8438,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 (called-interactively-p 'any)
(call-interactively 'org-store-link)
(org-store-link nil)))))))
@ -8501,9 +8501,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))
(called-interactively-p 'any))
(and (eq org-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
(interactive-p)
(called-interactively-p 'any)
(not custom-id))
(and org-link-to-org-use-id
(org-entry-get nil "ID"))))
@ -8558,7 +8558,7 @@ For file links, arg negates `org-context-in-file-links'."
desc "NONE")))
(setq link (org-make-link cpltxt)))
((interactive-p)
((called-interactively-p 'interactive)
(error "Cannot link to a buffer which is not visiting a file"))
(t (setq link nil)))
@ -8568,7 +8568,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 (called-interactively-p 'any) executing-kbd-macro) link)
(progn
(setq org-stored-links
(cons (list link desc) org-stored-links))
@ -11006,7 +11006,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 (called-interactively-p 'interactive)
(error "TODO state change from %s to %s blocked" this state)
;; fail silently
(message "TODO state change from %s to %s blocked" this state)
@ -12153,7 +12153,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 (called-interactively-p 'interactive)
(message "%d match(es) for regexp %s" cnt regexp))
cnt))