From db1c3f6a3ea5d9cb25c8fad5aae434fc1d424152 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Thu, 16 Jun 2011 21:32:54 -0700 Subject: [PATCH] Revert "replacing calls to now-defunct function `interactive-p'" This reverts commit 4f084e14672d4768bbff1614857ca9218230df69. --- lisp/org-agenda.el | 6 +++--- lisp/org-ascii.el | 16 ++++++++-------- lisp/org-docbook.el | 4 ++-- lisp/org-html.el | 4 ++-- lisp/org-latex.el | 4 ++-- lisp/org-macs.el | 4 ++-- lisp/org-table.el | 23 ++++++++++------------- lisp/org.el | 20 ++++++++++---------- 8 files changed, 39 insertions(+), 42 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index a9be175cd..0c7eabbdf 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6082,7 +6082,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 (called-interactively-p 'any) (org-agenda-columns)) + (and cols (interactive-p) (org-agenda-columns)) (org-goto-line line) (recenter window-line))) @@ -7033,7 +7033,7 @@ if it was hidden in the outline." (org-back-to-heading) (run-hook-with-args 'org-cycle-hook 'folded)) (message "Remote: FOLDED")) - ((and (called-interactively-p 'any) (= more 1)) + ((and (interactive-p) (= more 1)) (message "Remote: show with default settings")) ((= more 2) (show-entry) @@ -7334,7 +7334,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) (called-interactively-p 'any)) + (if (and (org-region-active-p) (interactive-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 fa0c98320..46d75e788 100644 --- a/lisp/org-ascii.el +++ b/lisp/org-ascii.el @@ -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 (called-interactively-p 'any) + (org-export-as-encoding 'org-export-as-ascii (interactive-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 - (called-interactively-p 'any) 'latin1 args)) + (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-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 (called-interactively-p 'any) + (org-export-as-encoding 'org-export-as-ascii (interactive-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 - (called-interactively-p 'any) 'utf8 args)) + (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p) + '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 (called-interactively-p 'any) + (when (interactive-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 (called-interactively-p 'any) (bufferp rtn)) + (if (and (interactive-p) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 0c233c9f9..124e1dc7b 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -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 (called-interactively-p 'any) + (when (interactive-p) (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 (called-interactively-p 'any) (bufferp rtn)) + (if (and (interactive-p) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) diff --git a/lisp/org-html.el b/lisp/org-html.el index 669382a86..f6108fca4 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -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 (called-interactively-p 'any) + (when (interactive-p) (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 (called-interactively-p 'any) (bufferp rtn)) + (if (and (interactive-p) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 68ec1dd41..d95913491 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -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 (called-interactively-p 'any) + (when (interactive-p) (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 (called-interactively-p 'any) (bufferp rtn)) + (if (and (interactive-p) (bufferp rtn)) (switch-to-buffer-other-window rtn) rtn))) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 210959bdc..860d08714 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -49,12 +49,12 @@ (defmacro org-called-interactively-p (&optional kind) `(if (featurep 'xemacs) - (called-interactively-p 'any) + (interactive-p) (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 - (called-interactively-p 'any)))) + (interactive-p)))) (if (and (not (fboundp 'with-silent-modifications)) (or (< emacs-major-version 23) diff --git a/lisp/org-table.el b/lisp/org-table.el index 90291e6f1..155a972de 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 (called-interactively-p 'any) (org-region-active-p)) + (if (and (interactive-p) (org-region-active-p)) (let (org-table-clip) (org-table-cut-region (region-beginning) (region-end))) (skip-chars-backward "^|") @@ -1193,29 +1193,27 @@ is always the old value." (defun org-table-current-column () "Find out which column we are in." (interactive) - (if (called-interactively-p 'any) (org-table-check-inside-data-field)) + (if (interactive-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))) - (when (called-interactively-p 'interactive) - (message "In table column %d" cnt)) + (if (interactive-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) - (when (called-interactively-p 'any) - (org-table-check-inside-data-field)) + (if (interactive-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 (called-interactively-p 'any) (message "This is table line %d" cnt)) + (if (interactive-p) (message "This is table line %d" cnt)) cnt))) (defun org-table-goto-column (n &optional on-delim force) @@ -1542,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 (called-interactively-p 'any) + (if (interactive-p) (setq thiscol (string-to-number (read-string "Use column N for sorting: "))) @@ -1935,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 (called-interactively-p 'interactive) + (if (interactive-p) (message "%s" (substitute-command-keys (format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)" @@ -2305,8 +2303,7 @@ of the new mark." (org-goto-line l1))) (if (not (= epos (point-at-eol))) (org-table-align)) (org-goto-line l) - (and (called-interactively-p 'interactive) - (message "%s" (cdr (assoc new org-recalc-marks)))))) + (and (interactive-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." @@ -2524,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 (called-interactively-p 'any) (not ndown)) + (unless (and (interactive-p) (not ndown)) (unless (let (inhibit-redisplay) (y-or-n-p "Debugging Formula. Continue to next? ")) (org-table-align) @@ -4152,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 (called-interactively-p 'any) (org-table-align)) + (when (interactive-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 ade1f256e..fee317441 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 - (called-interactively-p 'any) + (interactive-p) (= (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 (called-interactively-p 'any) + (if (interactive-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) @@ -7561,7 +7561,7 @@ the inserted text when done." (setq shift (+ delta shift))) (goto-char (point-min)) (setq newend (point-max)))) - (when (or (called-interactively-p 'interactive) for-yank) + (when (or (interactive-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 @@ -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 (called-interactively-p 'any) + (if (interactive-p) (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) - (called-interactively-p 'any)) + (interactive-p)) (and (eq org-link-to-org-use-id 'create-if-interactive-and-no-custom-id) - (called-interactively-p 'any) + (interactive-p) (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))) - ((called-interactively-p 'interactive) + ((interactive-p) (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 (called-interactively-p 'any) executing-kbd-macro) link) + (if (and (or (interactive-p) executing-kbd-macro) link) (progn (setq org-stored-links (cons (list link desc) org-stored-links)) @@ -11010,7 +11010,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 (called-interactively-p 'interactive) + (if (interactive-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) @@ -12157,7 +12157,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 (called-interactively-p 'interactive) + (if (interactive-p) (message "%d match(es) for regexp %s" cnt regexp)) cnt))