From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: Notify region-extract-function change in NEWS? Date: Sat, 06 Feb 2016 04:08:28 +0000 Message-ID: References: <87r3gqso64.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013a2a265bdd92052b121fe8 X-Trace: ger.gmane.org 1454731738 5069 80.91.229.3 (6 Feb 2016 04:08:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2016 04:08:58 +0000 (UTC) Cc: Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 06 05:08:46 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aRuAv-0004tH-KJ for ged-emacs-devel@m.gmane.org; Sat, 06 Feb 2016 05:08:45 +0100 Original-Received: from localhost ([::1]:51507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRuAu-0006Kz-Pz for ged-emacs-devel@m.gmane.org; Fri, 05 Feb 2016 23:08:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRuAq-0006Kb-Qp for emacs-devel@gnu.org; Fri, 05 Feb 2016 23:08:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRuAp-0005zi-PU for emacs-devel@gnu.org; Fri, 05 Feb 2016 23:08:40 -0500 Original-Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:34365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRuAp-0005zZ-Jh for emacs-devel@gnu.org; Fri, 05 Feb 2016 23:08:39 -0500 Original-Received: by mail-ob0-x22e.google.com with SMTP id wb13so106907546obb.1 for ; Fri, 05 Feb 2016 20:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=IJBODJ2TLxm5zLwoWT5m4HrnFo0uQWcUsE5bsFK4xV4=; b=fYkR71us7at/XN2yNjIgR/dPQ08wq3jJGOapWWsazrnD2WbbGYNqfZ7Xx6+7xflO3K xWH0XnG/EyTx/UecIqb8F0oREGndFMR/yzxM6NUZHWidzIgIIMZSwcOOpcdB1Odnpk0B 1VVDYKD1fraLhuccMi51HTJlc8MjxKJtf8+4wFKZJDUfurDimWJPg9jGHSQQrnlYdxiF 5CXSlk2bL1cN8KLCONiVPLoOke+5Yih0MUpOtmEPjvf8KYAeMc+LeRsUQVkvlReBUvkF o3Eif4h9Auj92+Wb1FtDfdTiN6hHrE6oqWd18LVQyeNewgPwlfWmiJTpt8o5By65a/oo h4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; bh=IJBODJ2TLxm5zLwoWT5m4HrnFo0uQWcUsE5bsFK4xV4=; b=e5wP8Z6NQkLSp3IZuco66u81YUg/I0xFZnYd5r3iC74BzhRBzwunCeyDipbJv2X6Q/ 1uhfymdpU4Nnd2ko0qp5w0evdQSyijIRKInOkyHpg6Ajb3/JYRspIioebhysL6t8e38b 0EsLp7KkiuT5fB5TBM8CzkICLFV57ZaXgDn9zjqvoqZ77yFVe6Qf2W4HayHgS1fCmzwi KODuKg/+zGGqb8nduULkpjQOak8GRp5vCSTDjOKfrBDZWL8ik5vu2ouG/j9CK0R2kOAt oqKpQ5wGVytzgNfPp8qoSYBfrMXGLwT6gPGr9YbLqGsZAhGi9GhnJtNxXUcEqzpoazE2 KIsg== X-Gm-Message-State: AG10YORign8AgjE+8EpU9/6TtN2NmYN0hnVIIuOvJByfmZT23sD5O1EsU6+POoUJ5zBbJ1U38ukKwnO80ko5Yw== X-Received: by 10.60.57.134 with SMTP id i6mr14931915oeq.11.1454731719066; Fri, 05 Feb 2016 20:08:39 -0800 (PST) In-Reply-To: <87r3gqso64.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c01::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199397 Archived-At: --089e013a2a265bdd92052b121fe8 Content-Type: text/plain; charset=UTF-8 Thanks Juri. On Fri, Feb 5, 2016 at 8:13 PM Juri Linkov wrote: > A better way to do that is to override the default value of > region-extract-function using add-function. > You could find some examples of add-function usages in > > http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=31f6e939334180add7bc11240343615a2e6350f6 I have reimplemented my earlier redefinition of region-extract-function using add-function: https://github.com/kaushalmodi/.emacs.d/blob/78ed92f384bac8ef2f3a4ec2faf61a21814475cd/setup-files/setup-editing.el#L744-L766 and it seems to work fine as before, but with lesser lines of code! :) So just to be clear, using add-function makes the region-extract-function tweaks a bit concise. But I would still need to update this if and when the region-extract-function default value changes in future. For instance, here I needed to have the "(not (eq delete 'bounds))" condition to match what was recently added to that var. Kaushal --089e013a2a265bdd92052b121fe8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks Juri.

On Fri, Feb 5, 2016 at 8:1= 3 PM Juri Linkov <juri@linkov.net= > wrote:
A better way to do that is to override the default value of
region-extract-function using add-function.
You could find some examples of add-function usages in
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=3Demacs-2= 5&id=3D31f6e939334180add7bc11240343615a2e6350f6
I have reimplemented my earlier redefinition of region-extract= -function using add-function:=C2=A0https://github.com/kaushalmodi/.emacs.d/blob/78ed92f3= 84bac8ef2f3a4ec2faf61a21814475cd/setup-files/setup-editing.el#L744-L766=

and it seems to work fine as before, but with les= ser lines of code! :)

So just to be clear, using a= dd-function makes the region-extract-function tweaks a bit concise. But I w= ould still need to update this if and when the region-extract-function defa= ult value changes in future. For instance, here I needed to have the "= (not (eq delete 'bounds))" condition to match what was recently ad= ded to that var.

Kaushal=C2=A0
--089e013a2a265bdd92052b121fe8--