Function: eca-config--create-buffer

eca-config--create-buffer is a natively compiled function defined in eca-config.el.

Signature

(eca-config--create-buffer TAB-KEY SESSION PATH)

Documentation

Create a file-visiting settings buffer for TAB-KEY.

SESSION is the current ECA session. PATH is the config file.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-config.el
(defun eca-config--create-buffer (tab-key session path)
  "Create a file-visiting settings buffer for TAB-KEY.
SESSION is the current ECA session.  PATH is the config file."
  (let ((buf (eca-settings--create-buffer tab-key session))
        (abs-path (expand-file-name path)))
    (with-current-buffer buf
      (if (file-exists-p abs-path)
          (insert-file-contents abs-path nil nil nil t)
        (insert "{}\n"))
      (setq buffer-file-name abs-path)
      (setq buffer-file-truename (file-truename abs-path))
      (add-hook 'before-save-hook #'eca-config--ensure-directory nil t)
      (eca-config--json-mode)
      (local-set-key (kbd "C-c C-,") (lambda () (interactive) (eca)))
      (local-set-key (kbd "C-c .") #'eca-transient-menu)
      (set-buffer-modified-p nil)
      (setq-local mode-line-buffer-identification
                  (list (propertize (abbreviate-file-name abs-path)
                                    'face 'mode-line-buffer-id)))
      (eca-settings--setup-tab-line tab-key session))
    buf))