Function: web-mode-string-suffix-p

web-mode-string-suffix-p is a natively compiled function defined in web-mode.el.

Signature

(web-mode-string-suffix-p SUFFIX STRING)

Documentation

Return t if STRING ends with SUFFIX.

Source Code

;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
;;---- COMPATIBILITY -----------------------------------------------------------

(eval-and-compile

  ;; compatibility with emacs < 23
  ;; (defun web-mode-string-match-p (regexp string &optional start)
  ;;   "Same as `string-match' except it does not change the match data."
  ;;   (save-match-data
  ;;     (string-match regexp string start)))

  ;; (unless (fboundp 'string-match-p)
  ;;   (fset 'string-match-p (symbol-function 'web-mode-string-match-p)))

  ;; compatibility with emacs < 23.3
  ;; (if (fboundp 'with-silent-modifications)
  ;;     (defalias 'web-mode-with-silent-modifications 'with-silent-modifications)
  ;;     (defmacro web-mode-with-silent-modifications (&rest body)
  ;;       `(let ((old-modified-p (buffer-modified-p))
  ;;              (inhibit-modification-hooks t)
  ;;              (buffer-undo-list t))
  ;;          (unwind-protect
  ;;               ,@body
  ;;            (restore-buffer-modified-p old-modified-p)))))

  ;; compatibility with emacs < 24.3
  (defun web-mode-buffer-narrowed-p ()
    (if (fboundp 'buffer-narrowed-p)
        (buffer-narrowed-p)
        (/= (- (point-max) (point-min)) (buffer-size))))

  ;; compatibility with emacs < 24
  (defalias 'web-mode-prog-mode
      (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))

  ;; compatibility with emacs < 24.3
  (unless (fboundp 'setq-local)
    (defmacro setq-local (var val)
      `(set (make-local-variable ',var) ,val)))

  ;; compatability with emacs < 24.4
  (defun web-mode-string-suffix-p (suffix string)
    "Return t if STRING ends with SUFFIX."
    (and (string-match (rx-to-string `(: ,suffix eos) t)
                       string)
         t))

  (unless (fboundp 'string-suffix-p)
    (fset 'string-suffix-p (symbol-function 'web-mode-string-suffix-p)))

  (unless (fboundp 'seq-some)
    (defun seq-some (pred seq)
      (unless (null seq)
        (or (funcall pred (car seq))
            (seq-some pred (cdr seq))))))
  ) ;eval-and-compile