Function: textsec-suspicious-p

textsec-suspicious-p is an autoloaded and byte-compiled function defined in textsec-check.el.gz.

Signature

(textsec-suspicious-p OBJECT TYPE)

Documentation

Say whether OBJECT is suspicious for use as TYPE.

If OBJECT is suspicious, return a string explaining the reason for considering it suspicious, otherwise return nil.

Available values of TYPE and corresponding OBJECTs are:

 url -- a URL; OBJECT should be a URL string.

 link -- an HTML link; OBJECT should be a cons cell
                           of the form (URL . LINK-TEXT).

 domain -- a Web domain; OBJECT should be a string.

 local-address -- the local part of an email address; OBJECT
                           should be a string.
 name -- the "display name" part of an email address;
                           OBJECT should be a string.

email-address -- a full email address; OBJECT should be a string.

 email-address-header -- a raw email address header in RFC 2822 format;
                           OBJECT should be a string.

If the user option textsec-check is nil, these checks are disabled, and this function always returns nil.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/international/textsec-check.el.gz
;;;###autoload
(defun textsec-suspicious-p (object type)
  "Say whether OBJECT is suspicious for use as TYPE.
If OBJECT is suspicious, return a string explaining the reason
for considering it suspicious, otherwise return nil.

Available values of TYPE and corresponding OBJECTs are:

 `url'                   -- a URL; OBJECT should be a URL string.

 `link'                 -- an HTML link; OBJECT should be a cons cell
                           of the form (URL . LINK-TEXT).

 `domain'               -- a Web domain; OBJECT should be a string.

 `local-address'        -- the local part of an email address; OBJECT
                           should be a string.
 `name'                 -- the \"display name\" part of an email address;
                           OBJECT should be a string.

`email-address'         -- a full email address; OBJECT should be a string.

 `email-address-header' -- a raw email address header in RFC 2822 format;
                           OBJECT should be a string.

If the user option `textsec-check' is nil, these checks are
disabled, and this function always returns nil."
  (if (not textsec-check)
      nil
    (require 'textsec)
    (let ((func (intern (format "textsec-%s-suspicious-p" type))))
      (unless (fboundp func)
        (error "%s is not a valid function" func))
      (funcall func object))))