Function: hywconfig-add-by-name

hywconfig-add-by-name is an autoloaded, interactive and byte-compiled function defined in hywconfig.el.

Signature

(hywconfig-add-by-name NAME)

Documentation

Save the current window configuration under the string NAME.

When called interactively and a window configuration already exists under NAME, confirm whether or not to replace it.

Return t if name is added or replaced, else nil.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywconfig.el
;;; ************************************************************************
;;; Public functions
;;; ************************************************************************

;;; Handling of name associations with each stored window configuration.
;;;###autoload
(defun hywconfig-add-by-name (name)
  "Save the current window configuration under the string NAME.
When called interactively and a window configuration already exists under
NAME, confirm whether or not to replace it.

Return t if name is added or replaced, else nil."
  (interactive "sName for current window configuration: ")
  (unless (stringp name)
    (error "(hywconfig-add-by-name): `name' argument is not a string: %s" name))
  (when (or (not (called-interactively-p 'interactive))
	    (not (member name (hywconfig-named-get-names)))
	    (y-or-n-p
	     (format "Replace existing `%s' window configuration? " name)))
    (hywconfig-named-put name (current-window-configuration))
    (when (called-interactively-p 'interactive)
      (message
       (substitute-command-keys
	(format "Window configuration `%s' saved.  Use {\\[hywconfig-restore-by-name]} to restore." name))))
    t))