Function: send-to--collect-items

send-to--collect-items is a byte-compiled function defined in send-to.el.gz.

Signature

(send-to--collect-items)

Documentation

Build a list of items to send based on default context.

From a dired buffer, chosen items are based on either of these being active:

  - Marked files
  - Files in region.
  - File at point.

From any other buffer, either of these two, in order of preference:

  - Active region text.
  - Thing at point (via existing-filename).
  - Buffer file.

Source Code

;; Defined in /usr/src/emacs/lisp/send-to.el.gz
(defun send-to--collect-items ()
  "Build a list of items to send based on default context.

From a `dired' buffer, chosen items are based on either of these being
active:

  - Marked files
  - Files in region.
  - File at point.

From any other buffer, either of these two, in order of preference:

  - Active region text.
  - Thing at point (via `existing-filename').
  - Buffer file."
  (cond ((derived-mode-p 'dired-mode)
         (or
          (send-to--dired-filenames-in-region)
          (dired-get-marked-files)))
        ((use-region-p)
         (list (buffer-substring-no-properties
                (region-beginning)
                (region-end))))
        ((thing-at-point 'existing-filename)
         (list (thing-at-point 'existing-filename)))
        ((buffer-file-name)
         (list (buffer-file-name)))))