unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Reuben Thomas <rrt@sc3d.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18716@debbugs.gnu.org
Subject: bug#18716: Patch for this bug
Date: Tue, 8 Nov 2016 22:16:45 +0000	[thread overview]
Message-ID: <CAOnWdoj6Komi-CASKvURq5xSq4=y52c=2FQK8S8OeXZqRwTRaA@mail.gmail.com> (raw)
In-Reply-To: <83a8d9hh62.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1946 bytes --]

On 8 November 2016 at 20:04, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 8 Nov 2016 17:51:26 +0000
> >
> > It makes dired-mark-unmarked-files act case-insensitively.
>
> You meant case-sensitively, I presume.
>

​That's right, sorry.​ Fixed.

I don't understand what happened to the comment about *.JPG files on
> case-sensitive filesystems,


I took it into account. My experience is that on a case-insensitive system
(e.g. a GNU system), one finds occasional files like this, typically copied
from other systems or extracted from archives. These are not a problem for
dired-omit-mode. For visiting such files, treating auto-mode-alist and
similar case-insensitively is no problem.


> and how does this patch do TRT on
> case-insensitive filesystems.
>

It doesn't, I've fixed it in the same way as the usage of auto-mode-alist,
by testing the system type.


> IOW, it sounds like the right solution cannot be so simple, because
> this will most probably cause user complaints of the opposite kind.
> No?​​


​See above. The only people I can see complaining are users of
case-insensitive file systems on case-sensitive systems. The correct fix
there is in any case to use the case-sensitivity of the file system, rather
than using the operating system as an indicator of that. (The same applies
to auto-mode-alist.)

Btw, if the problem is only with COPYING.LIB, maybe a better
> heuristics would be to remove .lib from completion-ignored-extensions,
> as it is no longer so widespread where Emacs users dwell?
>

​I don't think special cases are a good idea. There are other examples,
e.g. CVS is a pattern, which will also match "cvs", which I have in e.g.
wiki CVS repositories.

​I also added a couple of additional patches to tidy up obsolete
documentation, comments and code from dired-x.el.​

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 3485 bytes --]

[-- Attachment #2: 0001-Match-files-case-sensitively-in-dired-x.patch --]
[-- Type: text/x-patch, Size: 988 bytes --]

From df718d0c292c761b808746c210519569a31be1a0 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Tue, 8 Nov 2016 17:42:24 +0000
Subject: [PATCH 1/3] Match files case-sensitively in dired-x

* lisp/dired-x.el (dired-mark-unmarked-files): Match the regex
case-sensitively on case-sensitive systems (Bug#18716).
---
 lisp/dired-x.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 8313905..5adf781 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -594,7 +594,10 @@ dired-mark-unmarked-files
       ;; not already marked
       (looking-at-p " ")
       ;; uninteresting
-      (let ((fn (dired-get-filename localp t)))
+      (let ((fn (dired-get-filename localp t))
+            ;; Match patterns case-insensitively on case-insensitive
+            ;; systems
+            (case-fold-search (memq system-type '(windows-nt cygwin))))
         (and fn (string-match-p regexp fn))))
      msg)))
 
-- 
2.7.4


[-- Attachment #3: 0002-Remove-pre-customize-dired-x.el-documentation.patch --]
[-- Type: text/x-patch, Size: 2206 bytes --]

From b351ba71ddc352ebfee8f08882299bc9b41a6b78 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Tue, 8 Nov 2016 22:01:59 +0000
Subject: [PATCH 2/3] Remove pre-customize dired-x.el documentation

* lisp/dired-x.el (Commentary): Remove USAGE section explaining how to
use dired-x from .emacs.  It is now fully customizable.
* lisp/dired-x.el (dired-guess-shell-alist-user): Remove explanation of
how to set this custom variable in .emacs.  It should be customized.
---
 lisp/dired-x.el | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 5adf781..30cfaf4 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -29,20 +29,6 @@
 ;; This is based on Sebastian Kremer's excellent dired-x.el (Dired Extra),
 ;; version 1.191, adapted for GNU Emacs.  See the `dired-x' info pages.
 
-;; USAGE: In your ~/.emacs,
-;;
-;; (add-hook 'dired-load-hook
-;;           (lambda ()
-;;                       (load "dired-x")
-;;                       ;; Set global variables here.  For example:
-;;                       ;; (setq dired-guess-shell-gnutar "gtar")
-;;                       ))
-;; (add-hook 'dired-mode-hook
-;;           (lambda ()
-;;                       ;; Set buffer-local variables here.  For example:
-;;                       ;; (dired-omit-mode 1)
-;;                       ))
-;;
 ;; At load time dired-x.el will install itself and bind some dired keys.
 ;; Some dired.el and dired-aux.el functions have extra features if
 ;; dired-x is loaded.
@@ -1082,17 +1068,7 @@ dired-guess-shell-alist-user
 with \\[previous-history-element] (M-p) .
 
 The variable `dired-guess-shell-case-fold-search' controls whether
-REGEXP is matched case-sensitively.
-
-You can set this variable in your ~/.emacs.  For example, to add rules for
-`.foo' and `.bar' files, write
-
- (setq dired-guess-shell-alist-user
-        '((\"\\\\.foo\\\\'\" \"FOO-COMMAND\")
-          (\"\\\\.bar\\\\'\"
-           (if condition
-              \"BAR-COMMAND-1\"
-            \"BAR-COMMAND-2\"))))"
+REGEXP is matched case-sensitively."
   :group 'dired-x
   :type '(alist :key-type regexp :value-type (repeat sexp)))
 
-- 
2.7.4


[-- Attachment #4: 0003-Remove-obsolete-comments-and-commented-code-from-dir.patch --]
[-- Type: text/x-patch, Size: 2452 bytes --]

From c9ec6bc3187cb3a90ae748ec08cb0f3c000ba353 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Tue, 8 Nov 2016 22:04:52 +0000
Subject: [PATCH 3/3] Remove obsolete comments and commented code from
 dired-x.el

* lisp/dired-x.el (dired-mark-sexp): Remove a query from 1993 and its
1997 answer about whether dired-mark-sexp is used.
* lisp/dired-x.el (dired-buffers-for-dir-exact): Remove this function
commented out since before dired-x.el was added to RCS in 1994.
---
 lisp/dired-x.el | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 30cfaf4..e5957b4 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1376,29 +1376,6 @@ dired-buffer-more-recently-used-p
        (memq buffer1 (buffer-list))
        (not (memq buffer1 (memq buffer2 (buffer-list))))))
 
-;; Same thing as `dired-buffers-for-dir' of dired.el? - lrd 11/23/93
-;; (defun dired-buffers-for-dir-exact (dir)
-;; ;; Return a list of buffers that dired DIR (a directory or wildcard)
-;; ;; at top level, or as subdirectory.
-;; ;; Top level matches must match the wildcard part too, if any.
-;; ;; The list is in reverse order of buffer creation, most recent last.
-;; ;; As a side effect, killed dired buffers for DIR are removed from
-;; ;; dired-buffers.
-;;   (let ((alist dired-buffers) result elt)
-;;     (while alist
-;;       (setq elt (car alist)
-;;             alist (cdr alist))
-;;       (let ((buf (cdr elt)))
-;;         (if (buffer-name buf)
-;;             ;; Top level must match exactly against dired-directory in
-;;             ;; case one of them is a wildcard.
-;;             (if (or (equal dir (with-current-buffer buf dired-directory))
-;;                     (assoc dir (with-current-buffer buf dired-subdir-alist)))
-;;                 (setq result (cons buf result)))
-;;           ;; else buffer is killed - clean up:
-;;           (setq dired-buffers (delq elt dired-buffers)))))
-;;     result))
-
 \f
 ;; Needed if ls -lh is supported and also for GNU ls -ls.
 (defun dired-x--string-to-number (str)
@@ -1416,9 +1393,6 @@ dired-x--string-to-number
           (setq val (* 1024.0 val)))))
     val))
 
-;; Does anyone use this? - lrd 6/29/93.
-;; Apparently people do use it. - lrd 12/22/97.
-
 (defun dired-mark-sexp (predicate &optional unflag-p)
   "Mark files for which PREDICATE returns non-nil.
 With a prefix arg, unmark or unflag those files instead.
-- 
2.7.4


  reply	other threads:[~2016-11-08 22:16 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 14:50 bug#18716: 24.3; dired-omit-extensions's default value omits COPYING.LIB Reuben Thomas
2014-10-14 23:41 ` Stefan Monnier
2014-10-14 23:51   ` Reuben Thomas
2014-10-15  7:56   ` Andreas Schwab
2014-10-15 14:21     ` Stefan Monnier
2014-10-15 14:26       ` Reuben Thomas
2014-10-15 14:27         ` Reuben Thomas
2014-10-15 17:59         ` Stefan Monnier
2014-10-15 19:05           ` Reuben Thomas
2014-10-15 22:42             ` Stefan Monnier
2014-10-15 23:00               ` Reuben Thomas
2014-10-16  3:10                 ` Stefan Monnier
2014-10-15 14:26       ` Andreas Schwab
2014-10-15 17:57         ` Stefan Monnier
2014-10-15 20:57           ` Andreas Schwab
2014-10-15 22:44             ` Stefan Monnier
2014-10-15 22:54               ` Glenn Morris
2014-10-16  3:06                 ` Stefan Monnier
2014-10-16  7:13                   ` Andreas Schwab
2014-10-16 13:15                     ` Stefan Monnier
2014-10-16  2:01   ` Richard Stallman
2014-10-16  3:09     ` Stefan Monnier
2014-10-16 18:14       ` Richard Stallman
2014-10-16 20:17         ` Stefan Monnier
2016-11-08 17:51 ` bug#18716: Patch for this bug Reuben Thomas
2016-11-08 20:04   ` Eli Zaretskii
2016-11-08 22:16     ` Reuben Thomas [this message]
2016-11-09 19:36       ` Eli Zaretskii
2016-11-09 22:00         ` Reuben Thomas
2016-11-09 22:52           ` Drew Adams
2016-11-09 23:29             ` Reuben Thomas
2016-11-10 17:38           ` Eli Zaretskii
2016-11-26 17:54             ` Reuben Thomas
2016-11-26 18:29               ` Ken Brown
2016-11-28 21:32                 ` Reuben Thomas
2016-12-02  9:40                   ` Eli Zaretskii
2016-12-02 16:10                     ` Reuben Thomas
2016-12-02 16:16                       ` Eli Zaretskii
2016-12-02 16:31                         ` Reuben Thomas
2016-12-03  0:22 ` bug#18716: Reuben Thomas

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAOnWdoj6Komi-CASKvURq5xSq4=y52c=2FQK8S8OeXZqRwTRaA@mail.gmail.com' \
    --to=rrt@sc3d.org \
    --cc=18716@debbugs.gnu.org \
    --cc=eliz@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).