Skip to main content

You just test with featurep:

(require 'projectile nil t)
(when (featurep 'projectile)
 (do-some-stuff-that-needs-projectile))
(require 'projectile nil t)
(when (featurep 'projectile)
 (do-some-stuff-that-needs-projectile))

or you use that the require returns nil if it is not possible to load:

(when (require 'projectile nil t)
  (do-some-stuff-that-needs-projectile)
(when (require 'projectile nil t)
  (do-some-stuff-that-needs-projectile)

You just test with featurep:

(require 'projectile nil t)
(when (featurep 'projectile)
 (do-some-stuff-that-needs-projectile))

or you use that the require returns nil if it is not possible to load:

(when (require 'projectile nil t)
  (do-some-stuff-that-needs-projectile)

You just test with featurep:

(require 'projectile nil t)
(when (featurep 'projectile)
 (do-some-stuff-that-needs-projectile))

or you use that the require returns nil if it is not possible to load:

(when (require 'projectile nil t)
  (do-some-stuff-that-needs-projectile)
Source Link
Andrew Swann
  • 3.6k
  • 2
  • 17
  • 44

You just test with featurep:

(require 'projectile nil t)
(when (featurep 'projectile)
 (do-some-stuff-that-needs-projectile))

or you use that the require returns nil if it is not possible to load:

(when (require 'projectile nil t)
  (do-some-stuff-that-needs-projectile)