Function: hui:kill-ring-save
hui:kill-ring-save is an autoloaded, interactive and byte-compiled
function defined in hui.el.
Signature
(hui:kill-ring-save BEG END &optional REGION)
Documentation
Save the active region or thing at point as if killed, but don't kill it.
In Transient Mark mode, deactivate the mark.
If interprogram-cut-function is non-nil, also save the text for a window
system cut and paste.
If called interactively, transient-mark-mode(var)/transient-mark-mode(fun) is non-nil, and
there is no active region, copy any delimited selectable thing at
point; see hui:delimited-selectable-thing.
If you want to append the killed region to the last killed text,
use C-M-w (append-next-kill) before M-w (kill-ring-save).
The copied text is filtered by filter-buffer-substring before it is
saved in the kill ring, so the actual saved text might be different
from what was in the buffer.
When called from Lisp, save in the kill ring the stretch of text between BEG and END, unless the optional argument REGION is non-nil, in which case ignore BEG and END, and save the current region instead.
This command is similar to copy-region-as-kill, except that it gives
visual feedback indicating the extent of the region being copied.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui.el
;; In "hyperbole.el", use this to override the {M-w} command from
;; "simple.el" when hyperbole-mode is active to allow copying kcell
;; references, active regions and delimited areas (like sexpressions).
;;;###autoload
(defun hui:kill-ring-save (beg end &optional region)
"Save the active region or thing at point as if killed, but don't kill it.
In Transient Mark mode, deactivate the mark.
If `interprogram-cut-function' is non-nil, also save the text for a window
system cut and paste.
If called interactively, `transient-mark-mode' is non-nil, and
there is no active region, copy any delimited selectable thing at
point; see `hui:delimited-selectable-thing'.
If you want to append the killed region to the last killed text,
use \\[append-next-kill] before \\[kill-ring-save].
The copied text is filtered by `filter-buffer-substring' before it is
saved in the kill ring, so the actual saved text might be different
from what was in the buffer.
When called from Lisp, save in the kill ring the stretch of text
between BEG and END, unless the optional argument REGION is
non-nil, in which case ignore BEG and END, and save the current
region instead.
This command is similar to `copy-region-as-kill', except that it gives
visual feedback indicating the extent of the region being copied."
;; Pass mark first, then point, because the order matters when
;; calling `kill-append'.
(interactive (list (when mark-active (mark))
(when mark-active (point))
(prefix-numeric-value current-prefix-arg)))
(setq this-command 'kill-ring-save)
(let (thing)
(if (or (use-region-p)
(null transient-mark-mode)
(not (called-interactively-p 'interactive)))
(if (derived-mode-p 'kotl-mode)
(kotl-mode:copy-region-as-kill beg end)
(when (and (called-interactively-p 'interactive)
(or (null beg) (null end)))
(setq beg (mark)
end (point)))
(hui:validate-region beg end region)
(copy-region-as-kill beg end region))
(if (derived-mode-p 'kotl-mode)
(kotl-mode:copy-region-as-kill beg end)
;; Setting the major mode prevents hui-select from
;; suppressing use of `hui-select-syntax-table'
;; if in one of `hui-select-ignore-quoted-sexp-modes'.
(let ((major-mode 'fundamental-mode))
(setq thing (nth 1 (hui:selectable-thing-and-bounds))))
(if (stringp thing)
(progn (kill-new thing)
(setq deactivate-mark t))
(when (and (called-interactively-p 'interactive)
(or (null beg) (null end)))
(setq beg (mark)
end (point)))
(hui:validate-region beg end region)
(copy-region-as-kill beg end region))))
;; This use of `called-interactively-p' is correct because the
;; code it controls just gives the user visual feedback.
(when (called-interactively-p 'interactive)
(cond (thing
(message "Saved selectable thing: %s" thing))
((mark t)
(indicate-copied-region))))))