Function: custom-dirlocals-with-buffer

custom-dirlocals-with-buffer is a macro defined in cus-edit.el.gz.

Signature

(custom-dirlocals-with-buffer &rest BODY)

Documentation

Arrange to execute BODY in a "*Customize Dirlocals*" buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defmacro custom-dirlocals-with-buffer (&rest body)
  "Arrange to execute BODY in a \"*Customize Dirlocals*\" buffer."
  ;; We don't use `custom-buffer-create' because the settings here
  ;; don't go into the `custom-file'.
  `(progn
     (switch-to-buffer "*Customize Dirlocals*")
     (kill-all-local-variables)
     (let ((inhibit-read-only t))
       (erase-buffer))
     (remove-overlays)
     (custom-dirlocals--set-widget-vars)
     ,@body
     (setq-local tool-bar-map
                 (or custom-dirlocals-tool-bar-map
                     ;; Set up `custom-dirlocals-tool-bar-map'.
                     (let ((map (make-sparse-keymap)))
                       (mapc
                        (lambda (arg)
                          (tool-bar-local-item-from-menu
                           (nth 1 arg) (nth 4 arg) map custom-dirlocals-map
                           :label (nth 5 arg)))
                        custom-dirlocals-commands)
                       (setq custom-dirlocals-tool-bar-map map))))
     (setq-local revert-buffer-function #'Custom-dirlocals-revert-buffer)
     (use-local-map custom-dirlocals-map)
     (widget-setup)))