Function: bookmark-delete-all

bookmark-delete-all is an autoloaded, interactive and byte-compiled function defined in bookmark.el.gz.

Signature

(bookmark-delete-all &optional NO-CONFIRM)

Documentation

Permanently delete all bookmarks.

If optional argument NO-CONFIRM is non-nil, don't ask for confirmation.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
;;;###autoload
(defun bookmark-delete-all (&optional no-confirm)
  "Permanently delete all bookmarks.
If optional argument NO-CONFIRM is non-nil, don't ask for
confirmation."
  (interactive "P")
  ;; We don't use `bookmark-menu-confirm-deletion' here because that
  ;; variable is specifically to control confirmation prompting in a
  ;; bookmark menu buffer, where the user has the marked-for-deletion
  ;; bookmarks arrayed in front of them and might have accidentally
  ;; hit the key that executes the deletions.  The UI situation here
  ;; is quite different, by contrast: the user got to this point by a
  ;; sequence of keystrokes unlikely to be typed by chance.
  (when (or no-confirm
            (yes-or-no-p "Permanently delete all bookmarks? "))
    (bookmark-maybe-load-default-file)
    (dolist (bm bookmark-alist)
      (bookmark--remove-fringe-mark bm))
    (setq bookmark-alist-modification-count
          (+ bookmark-alist-modification-count (length bookmark-alist)))
    (setq bookmark-alist nil)
    (bookmark-bmenu-surreptitiously-rebuild-list)
    (when (bookmark-time-to-save-p)
      (bookmark-save))))