From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: One more string functions change Date: Sat, 28 Jun 2014 07:48:39 +0400 Message-ID: <53AE3B17.4030100@yandex.ru> References: <53AD8D59.5000207@yandex.ru> <6cf80ae5-a4ad-4839-adfd-14bf973f056f@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1403927351 20600 80.91.229.3 (28 Jun 2014 03:49:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Jun 2014 03:49:11 +0000 (UTC) Cc: Emacs development discussions To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 28 05:49:03 2014 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 1X0jdO-0001FV-T4 for ged-emacs-devel@m.gmane.org; Sat, 28 Jun 2014 05:49:03 +0200 Original-Received: from localhost ([::1]:53451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0jdO-0008Uq-AO for ged-emacs-devel@m.gmane.org; Fri, 27 Jun 2014 23:49:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0jdE-0008Ul-C3 for emacs-devel@gnu.org; Fri, 27 Jun 2014 23:48:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0jd7-0007Yj-9a for emacs-devel@gnu.org; Fri, 27 Jun 2014 23:48:52 -0400 Original-Received: from forward1l.mail.yandex.net ([84.201.143.144]:51447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0jd6-0007Ya-UR for emacs-devel@gnu.org; Fri, 27 Jun 2014 23:48:45 -0400 Original-Received: from smtp3h.mail.yandex.net (smtp3h.mail.yandex.net [84.201.186.20]) by forward1l.mail.yandex.net (Yandex) with ESMTP id 4BEFA152124E; Sat, 28 Jun 2014 07:48:43 +0400 (MSK) Original-Received: from smtp3h.mail.yandex.net (localhost [127.0.0.1]) by smtp3h.mail.yandex.net (Yandex) with ESMTP id DD1C41B44B30; Sat, 28 Jun 2014 07:48:42 +0400 (MSK) Original-Received: from 171.gprs.mts.ru (171.gprs.mts.ru [213.87.135.171]) by smtp3h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2zhvCQGaLC-mgSSHMfr; Sat, 28 Jun 2014 07:48:42 +0400 (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 3493db73-033d-4b6a-aac0-d6903b4caf0d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1403927322; bh=PAf2zrpQjhxjdzqmjvc+kD5ofI+OH3FQVfjMJkjheKM=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=tjapAhJ9ril5QArtecB28s1h/vePmpncpQkL/4hPJDwH+LlX6/zm+mBbAMFkg1csJ hyqp2sItmfR77ORW0YIbDOOOEXB30h7qqxSh/rFkh2hhWqRrnJGhbxMoyknCbulIze pmpZlwBs7Ju85fXOV+EnnbvSh4Pd9PJj+CbohLXk= Authentication-Results: smtp3h.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <6cf80ae5-a4ad-4839-adfd-14bf973f056f@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.144 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:172787 Archived-At: On 06/28/2014 02:46 AM, Drew Adams wrote: > Why? Is (string-lessp s1 s2 t) really that much handier than being > explicit? > > (let ((case-fold-search t)) (string-lessp s1 s2)) > > or > > (string-lessp (upper s1) (upper s2)) > > We already have a global variable for this. Why add an argument for it? Value of case-fold-search doesn't affect string-lessp and string-equal. > How many occurrences of such a programming cliche for `string-lessp' > do you find in the Emacs sources, for example? One? Zero? Just ask grep: lisp/textmodes/flyspell.el-1016- (while (and (not r) (setq p (search-backward word bound t))) lisp/textmodes/flyspell.el-1017- (let ((lw (flyspell-get-word))) lisp/textmodes/flyspell.el-1018- (if (and (consp lw) lisp/textmodes/flyspell.el-1019- (if ignore-case lisp/textmodes/flyspell.el:1020: (string-equal (downcase (car lw)) (downcase word)) lisp/textmodes/flyspell.el:1021: (string-equal (car lw) word))) lisp/gnus/gnus-util.el-1437- "Like `string-equal', except it compares case-insensitively." lisp/gnus/gnus-util.el-1438- (and (= (length x) (length y)) lisp/gnus/gnus-util.el:1439: (or (string-equal x y) lisp/gnus/gnus-util.el:1440: (string-equal (downcase x) (downcase y))))) lisp/gnus/gnus-util.el-1972- (if ignore-case lisp/gnus/gnus-util.el:1973: (string-equal (downcase str1) (downcase prefix)) lisp/gnus/gnus-util.el:1974: (string-equal str1 prefix)))))) lisp/info.el-2882- ;; Use string-equal, not equal, lisp/info.el-2883- ;; to ignore text properties. lisp/info.el:2884: (string-equal (downcase prevnode) lisp/info.el-2885- (downcase upnode)))) lisp/recentf.el-312- (if recentf-case-fold-search lisp/recentf.el:313: (string-equal (downcase s1) (downcase s2)) lisp/recentf.el:314: (string-equal s1 s2))) lisp/emacs-lisp/cl-extra.el:72: (or (string-equal x y) lisp/emacs-lisp/cl-extra.el:73: (string-equal (downcase x) (downcase y))))) ;Lazy but simple! lisp/ibuf-ext.el:1128: (string-lessp (downcase lisp/ibuf-ext.el-1129- (symbol-name (buffer-local-value 'major-mode (car a)))) lisp/ibuf-ext.el-1130- (downcase lisp/ibuf-ext.el-1131- (symbol-name (buffer-local-value 'major-mode (car b)))))) lisp/ibuf-ext.el:1138: (string-lessp (downcase lisp/ibuf-ext.el-1139- (with-current-buffer lisp/ibuf-ext.el-1140- (car a) lisp/ibuf-ext.el-1141- (format-mode-line mode-name))) lisp/ibuf-ext.el-1142- (downcase lisp/ibuf-ext.el-1143- (with-current-buffer etc. Dmitry