From bc5da2c3fb882a2df9d358e5b82869ab48a04d9a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 8 Aug 2020 05:32:37 +0200 Subject: [PATCH] Avoid some uses of obsolete function interactive-p * doc/lispref/help.texi (Accessing Documentation): * lisp/cedet/data-debug.el: * lisp/emacs-lisp/edebug.el (edebug-wrap-def-body): * lisp/simple.el (append-next-kill): * test/manual/cedet/cedet-utests.el (cedet-utest, pulse-test): * test/manual/cedet/semantic-tests.el (semantic-lex-spp-write-utest) (semantic-symref-test-count-hits-in-tag): Use 'called-interactively-p' instead of obsolete function 'interactive-p'. --- doc/lispref/help.texi | 3 ++- lisp/cedet/data-debug.el | 2 +- lisp/emacs-lisp/edebug.el | 2 +- test/manual/cedet/cedet-utests.el | 12 ++++++------ test/manual/cedet/semantic-tests.el | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 9b3c4fcb23d..d4505d5c3ff 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -220,7 +220,8 @@ in the *Help* buffer." @group ;; @r{Display the data.} - (help-setup-xref (list 'describe-symbols pattern) (interactive-p)) + (help-setup-xref (list 'describe-symbols pattern) + (called-interactively-p 'interactive)) (with-help-window (help-buffer) (mapcar describe-func (sort sym-list 'string<))))) @end group diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 604fc40926c..44cce389cb3 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -38,7 +38,7 @@ ;; "Calculate something complicated at point, and return it." ;; (interactive) ;; function not normally interactive ;; (let ((stuff (do-stuff))) -;; (when (interactive-p) +;; (when (called-interactively-p 'interactive) ;; (data-debug-show-stuff stuff "myStuff")) ;; stuff)) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index d9bbf6129c6..7ff6d68c3ec 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1229,7 +1229,7 @@ purpose by adding an entry to this alist, and setting "Wrap the FORMS of a definition body." (if edebug-def-interactive `(let ((,(edebug-interactive-p-name) - (interactive-p))) + (called-interactively-p 'interactive))) ,(edebug-make-enter-wrapper forms)) (edebug-make-enter-wrapper forms))) diff --git a/test/manual/cedet/cedet-utests.el b/test/manual/cedet/cedet-utests.el index 124b49907d8..ee6be438dd3 100644 --- a/test/manual/cedet/cedet-utests.el +++ b/test/manual/cedet/cedet-utests.el @@ -150,7 +150,7 @@ of just logging the error." ;; Cleanup stray input and events that are in the way. ;; Not doing this causes sit-for to not refresh the screen. ;; Doing this causes the user to need to press keys more frequently. - (when (and (interactive-p) (input-pending-p)) + (when (and (called-interactively-p 'interactive) (input-pending-p)) (if (fboundp 'read-event) (read-event) (read-char))) @@ -497,11 +497,11 @@ When optional NO-ERROR don't throw an error if we can't run tests." (error (concat "Pulse test only works on versions of Emacs" " that support pulsing"))) ;; Run the tests - (when (interactive-p) + (when (called-interactively-p 'interactive) (message " Pulse one line.") (read-char)) (pulse-momentary-highlight-one-line (point)) - (when (interactive-p) + (when (called-interactively-p 'interactive) (message " Pulse a region.") (read-char)) (pulse-momentary-highlight-region (point) @@ -510,11 +510,11 @@ When optional NO-ERROR don't throw an error if we can't run tests." (forward-char 30) (error nil)) (point))) - (when (interactive-p) + (when (called-interactively-p 'interactive) (message " Pulse line a specific color.") (read-char)) (pulse-momentary-highlight-one-line (point) 'mode-line) - (when (interactive-p) + (when (called-interactively-p 'interactive) (message " Pulse a pre-existing overlay.") (read-char)) (let* ((start (point-at-bol)) @@ -530,7 +530,7 @@ When optional NO-ERROR don't throw an error if we can't run tests." (delete-overlay o) (error "Non-temporary overlay was deleted!")) ) - (when (interactive-p) + (when (called-interactively-p 'interactive) (message "Done!")))) (provide 'cedet-utests) diff --git a/test/manual/cedet/semantic-tests.el b/test/manual/cedet/semantic-tests.el index 53552be06b2..a0899cb9326 100644 --- a/test/manual/cedet/semantic-tests.el +++ b/test/manual/cedet/semantic-tests.el @@ -235,7 +235,7 @@ Analyze the area between BEG and END." (set-buffer buff) (semantic-lex-spp-write-test) (kill-buffer buff) - (when (not (interactive-p)) + (when (not (called-interactively-p 'interactive)) (kill-buffer "*SPP Write Test*")) ))) @@ -276,7 +276,7 @@ tag that contains point, and return that." target (lambda (start end prefix) (setq Lcount (1+ Lcount))) (semantic-tag-start tag) (semantic-tag-end tag)) - (when (interactive-p) + (when (called-interactively-p 'interactive) (message "Found %d occurrences of %s in %.2f seconds" Lcount (semantic-tag-name target) (semantic-elapsed-time start nil))) -- 2.39.2