Skip to content

Simplify cond ((locate-library "bbdb") ...) by using (when (require 'bbdb nil 'noerror) ...) #1

@pcrama

Description

@pcrama

(cond ((locate-library "bbdb")
(require 'bbdb)

You could consider rewriting this as

    (when (require 'bbdb nil 'noerror)

If bbdb can't be loaded, this returns nil, but if it can (or if bbdb is alreayd loaded), this return bbdb and the rest of the code will be executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions