all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Drew Adams <drew.adams@oracle.com>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: One more string functions change
Date: Sat, 28 Jun 2014 07:48:39 +0400	[thread overview]
Message-ID: <53AE3B17.4030100@yandex.ru> (raw)
In-Reply-To: <6cf80ae5-a4ad-4839-adfd-14bf973f056f@default>

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




  reply	other threads:[~2014-06-28  3:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 15:27 One more string functions change Dmitry Antipov
2014-06-27 15:35 ` Andreas Schwab
2014-06-27 16:46 ` Paul Eggert
2014-06-27 19:46   ` Eli Zaretskii
2014-06-27 20:46     ` Paul Eggert
2014-06-27 20:53       ` Eli Zaretskii
2014-06-28 16:21     ` Dmitry Antipov
2014-06-28 17:19       ` Eli Zaretskii
2014-06-29  2:53         ` Dmitry Antipov
2014-06-29 15:13           ` Eli Zaretskii
2014-06-29 16:38             ` Dmitry Antipov
2014-06-29 16:48               ` Eli Zaretskii
2014-06-30  6:21                 ` Internationalize Emacs's messages [Was: Re: One more string functions change] Dmitry Antipov
2014-06-28 17:26       ` One more string functions change Yuri Khan
2014-06-27 22:46 ` Drew Adams
2014-06-28  3:48   ` Dmitry Antipov [this message]
2014-06-28 13:48     ` Drew Adams
2014-06-28 16:32       ` Dmitry Antipov
2014-06-30 13:18     ` Stefan Monnier

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=53AE3B17.4030100@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=drew.adams@oracle.com \
    --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.