From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification Date: Tue, 02 May 2017 19:11:48 -0400 Message-ID: <87vapij1l7.fsf@holos> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493766753 25386 195.159.176.226 (2 May 2017 23:12:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 May 2017 23:12:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 03 01:12:30 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5gy5-0006VK-OE for ged-emacs-devel@m.gmane.org; Wed, 03 May 2017 01:12:29 +0200 Original-Received: from localhost ([::1]:34051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5gy9-00047L-Np for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 19:12:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5gxW-00046d-QO for emacs-devel@gnu.org; Tue, 02 May 2017 19:11:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5gxT-0000XC-LQ for emacs-devel@gnu.org; Tue, 02 May 2017 19:11:54 -0400 Original-Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:36714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5gxT-0000WQ-G3 for emacs-devel@gnu.org; Tue, 02 May 2017 19:11:51 -0400 Original-Received: by mail-qt0-x243.google.com with SMTP id t52so22492053qtb.3 for ; Tue, 02 May 2017 16:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0/EmOW0s38O7LXUjR1yAuXseVqFJQmVMTYwtU/p4sdA=; b=LdXLvka2YFFNoE/JUpaEw5rrnM3Efw6ix233jF5ewnQMwH9Mi3hoxkxaD+PfSjb1FD GCXz+GNVAOhg6RmxS8GU+6Pxsaz84DQMlReKGFhpi4Io4kvPKqlPVl2eKlOTIURdyoFd +4dw67atIhRGMZeT+0x8xZkEB/tLFVQIsvObgSWrkX2ND6YG1wpTuuRT6WMW+wWZs22r FrtcZMuPtn1gnY9g5NjfMFxEqhjUwdUgYM8bLsVdVvKDkla54X5rzJpmx49Ls+sOH8pG hlc0PpN++J2WrAjDoEtRrH5hrtccYZp4vCSEz4yzap8NjPCyy9/N5Ev6ZlWVKZWU1wB4 zLFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=0/EmOW0s38O7LXUjR1yAuXseVqFJQmVMTYwtU/p4sdA=; b=G57diOKvxcUsWXGw13Vy2s8Y5itjFdPdx52sjYWEELGM97gt7+hgQEgAZ14l0gDWTi +kkAicbOvRXC3LYW/ASqc/DXUm3RY+ezIaFasS0tVIq290L1P+EFZ327+tJZCmNs8QIK BUSTaTub5Rs26x6fOUY0Wzs2xAI/fCRPb+KDf/O7lSNxOXNWA8YYZv0EZRvvbx8sGZsy J3oMtJ9fIehASeTwKLTFTxcG1F9RrpkjdGk0br6A8q4Vd55n4A+9vuax4ZhWjbA7NbKO 61v+0GFZ3OBMl66yb7qlEe9z3cSPRmlQEJyiyclAxcwHV5FiosYC5RrJLUR62NBu4iv4 8lMw== X-Gm-Message-State: AN3rC/61+fvCHzq3vKTeZ55SlzobIxFrhHC73Xb5ftuiJFtD0kNdrOdN kSlHI2E0DA5M2fsn X-Received: by 10.200.35.73 with SMTP id b9mr28803979qtb.268.1493766710280; Tue, 02 May 2017 16:11:50 -0700 (PDT) Original-Received: from holos.localdomain (pool-173-64-125-158.bltmmd.fios.verizon.net. [173.64.125.158]) by smtp.gmail.com with ESMTPSA id p48sm16309839qte.4.2017.05.02.16.11.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 May 2017 16:11:49 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 9821668E57; Tue, 2 May 2017 19:11:48 -0400 (EDT) In-Reply-To: (Jean-Christophe Helary's message of "Tue, 2 May 2017 18:34:17 +0900") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:214533 Archived-At: Jean-Christophe Helary writes: > Following the discussion about how trimming in subr-x.el did not allow > for non-default regex, I have this small modification to the 3 > trimming functions found therein. > > Basically: > 1) I extracted the default regex and assigned it to string-trim-default-regex > 2) I declared optional "trim-left" and "trim-right" arguments > respectively for the string-trim-left and string-trim-right functions, > and declared both optional for the general string-trim function > > The documentation strings are pretty much taken from subr.el so maybe > the wording is not the best. > > Please advise. Basically everything in subr-x is either a macro or a defsubst, except for read-multiple-choice (aside: why is this not in its own library?). As such, most uses of subr-x are done with (eval-when-compile (require 'subr-x)). Won't the use of a global variable break these?