all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Emacs developers <emacs-devel@gnu.org>
Subject: A mess in kill-region?
Date: Mon, 19 Oct 2015 19:53:15 +0200	[thread overview]
Message-ID: <87a8reagok.fsf@mbork.pl> (raw)

Hi there,

I don't have the time now to study this deeper, but if this something
non-obvious, I can try to dig into it (maybe in a few days).

Here's the problem.  This is taken from `kill-region':

(if region
    (funcall region-extract-function 'delete)
  (filter-buffer-substring beg end 'delete))

But this is the definition of `region-extract-function':

(defvar region-extract-function
  (lambda (delete)
    (when (region-beginning)
      (if (eq delete 'delete-only)
          (delete-region (region-beginning) (region-end))
        (filter-buffer-substring (region-beginning) (region-end) delete))))
  "Function to get the region's content.
Called with one argument DELETE.
If DELETE is `delete-only', then only delete the region and the return value
is undefined.  If DELETE is nil, just return the content as a string.
If anything else, delete the region and return its content as a string.")

So I guess that the argument of 'delete in `kill-region' is misleading
at least and maybe buggy.

And btw: what exactly is the meaning of the third argument to
`kill-region'?  The "explanation" is the docstring looks like a joke to
me;-).

PS. GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-01-02

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



             reply	other threads:[~2015-10-19 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 17:53 Marcin Borkowski [this message]
2015-10-19 17:58 ` A mess in kill-region? Marcin Borkowski
2015-10-19 18:05   ` Kaushal Modi
2015-10-19 18:20   ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8reagok.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.