aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2013-07-22 03:04:10 +0200
committerJuanma Barranquero2013-07-22 03:04:10 +0200
commit70f1b5e80dc89fae57cf7c97df915db99ca31237 (patch)
treea22a8fa391f4a968d50c7af37340203d97ddf633
parent56bc453c4aef9ef94e49ec45cea51d2d47948846 (diff)
downloademacs-70f1b5e80dc89fae57cf7c97df915db99ca31237.tar.gz
emacs-70f1b5e80dc89fae57cf7c97df915db99ca31237.zip
lisp/dired-x.el: Fix bug#14927.
(dired-mark-unmarked-files, dired-virtual, dired-guess-default) (dired-mark-sexp, dired-filename-at-point): Use string-match-p, looking-at-p.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/dired-x.el22
2 files changed, 17 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ebd7996801b..1ea7c0d3c15 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-07-22 Juanma Barranquero <lekktu@gmail.com>
2
3 * dired-x.el (dired-mark-unmarked-files, dired-virtual)
4 (dired-guess-default, dired-mark-sexp, dired-filename-at-point):
5 Use string-match-p, looking-at-p (bug#14927).
6
12013-07-21 Juanma Barranquero <lekktu@gmail.com> 72013-07-21 Juanma Barranquero <lekktu@gmail.com>
2 8
3 * desktop.el (desktop-saved-frame-states): 9 * desktop.el (desktop-saved-frame-states):
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 2a9bc167a9c..ddb632db692 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -563,10 +563,10 @@ Optional fourth argument LOCALP is as in `dired-get-filename'."
563 (dired-mark-if 563 (dired-mark-if
564 (and 564 (and
565 ;; not already marked 565 ;; not already marked
566 (looking-at " ") 566 (looking-at-p " ")
567 ;; uninteresting 567 ;; uninteresting
568 (let ((fn (dired-get-filename localp t))) 568 (let ((fn (dired-get-filename localp t)))
569 (and fn (string-match regexp fn)))) 569 (and fn (string-match-p regexp fn))))
570 msg))) 570 msg)))
571 571
572 572
@@ -610,7 +610,7 @@ you can relist single subdirs using \\[dired-do-redisplay]."
610 (interactive 610 (interactive
611 (list (read-string "Virtual Dired directory: " (dired-virtual-guess-dir)))) 611 (list (read-string "Virtual Dired directory: " (dired-virtual-guess-dir))))
612 (goto-char (point-min)) 612 (goto-char (point-min))
613 (or (looking-at " ") 613 (or (looking-at-p " ")
614 ;; if not already indented, do it now: 614 ;; if not already indented, do it now:
615 (indent-region (point-min) (point-max) 2)) 615 (indent-region (point-min) (point-max) 2))
616 (or dirname (setq dirname default-directory)) 616 (or dirname (setq dirname default-directory))
@@ -627,7 +627,7 @@ you can relist single subdirs using \\[dired-do-redisplay]."
627 ;; If raw ls listing (not a saved old dired buffer), give it a 627 ;; If raw ls listing (not a saved old dired buffer), give it a
628 ;; decent subdir headerline: 628 ;; decent subdir headerline:
629 (goto-char (point-min)) 629 (goto-char (point-min))
630 (or (looking-at dired-subdir-regexp) 630 (or (looking-at-p dired-subdir-regexp)
631 (insert " " 631 (insert " "
632 (directory-file-name (file-name-directory default-directory)) 632 (directory-file-name (file-name-directory default-directory))
633 ":\n")) 633 ":\n"))
@@ -1089,13 +1089,13 @@ See `dired-guess-shell-alist-user'."
1089 (setq elt (car alist) 1089 (setq elt (car alist)
1090 regexp (car elt) 1090 regexp (car elt)
1091 alist (cdr alist)) 1091 alist (cdr alist))
1092 (if (string-match regexp file) 1092 (if (string-match-p regexp file)
1093 (setq cmds (cdr elt) 1093 (setq cmds (cdr elt)
1094 alist nil))) 1094 alist nil)))
1095 1095
1096 ;; If more than one file, see if all of FILES match regular expression. 1096 ;; If more than one file, see if all of FILES match regular expression.
1097 (while (and flist 1097 (while (and flist
1098 (string-match regexp (car flist))) 1098 (string-match-p regexp (car flist)))
1099 (setq flist (cdr flist))) 1099 (setq flist (cdr flist)))
1100 1100
1101 ;; If flist is still non-nil, then do not guess since this means that not 1101 ;; If flist is still non-nil, then do not guess since this means that not
@@ -1500,7 +1500,7 @@ to mark all zero length files."
1500 (or 1500 (or
1501 (dired-move-to-end-of-filename t) 1501 (dired-move-to-end-of-filename t)
1502 (point))) 1502 (point)))
1503 sym (if (looking-at " -> ") 1503 sym (if (looking-at-p " -> ")
1504 (buffer-substring (progn (forward-char 4) (point)) 1504 (buffer-substring (progn (forward-char 4) (point))
1505 (line-end-position)) 1505 (line-end-position))
1506 "")) 1506 ""))
@@ -1564,12 +1564,12 @@ Point should be in or after a filename."
1564 (save-excursion 1564 (save-excursion
1565 ;; First see if just past a filename. 1565 ;; First see if just past a filename.
1566 (or (eobp) ; why? 1566 (or (eobp) ; why?
1567 (when (looking-at "[] \t\n[{}()]") ; whitespace or some parens 1567 (when (looking-at-p "[] \t\n[{}()]") ; whitespace or some parens
1568 (skip-chars-backward " \n\t\r({[]})") 1568 (skip-chars-backward " \n\t\r({[]})")
1569 (or (bobp) (backward-char 1)))) 1569 (or (bobp) (backward-char 1))))
1570 (let ((filename-chars "-.[:alnum:]_/:$+@") 1570 (let ((filename-chars "-.[:alnum:]_/:$+@")
1571 start prefix) 1571 start prefix)
1572 (if (looking-at (format "[%s]" filename-chars)) 1572 (if (looking-at-p (format "[%s]" filename-chars))
1573 (progn 1573 (progn
1574 (skip-chars-backward filename-chars) 1574 (skip-chars-backward filename-chars)
1575 (setq start (point) 1575 (setq start (point)
@@ -1577,11 +1577,11 @@ Point should be in or after a filename."
1577 ;; This is something to do with ange-ftp filenames. 1577 ;; This is something to do with ange-ftp filenames.
1578 ;; It convert foo@bar to /foo@bar. 1578 ;; It convert foo@bar to /foo@bar.
1579 ;; But when does the former occur in dired buffers? 1579 ;; But when does the former occur in dired buffers?
1580 (and (string-match 1580 (and (string-match-p
1581 "^\\w+@" 1581 "^\\w+@"
1582 (buffer-substring start (line-end-position))) 1582 (buffer-substring start (line-end-position)))
1583 "/")) 1583 "/"))
1584 (if (string-match "[/~]" (char-to-string (preceding-char))) 1584 (if (string-match-p "[/~]" (char-to-string (preceding-char)))
1585 (setq start (1- start))) 1585 (setq start (1- start)))
1586 (skip-chars-forward filename-chars)) 1586 (skip-chars-forward filename-chars))
1587 (error "No file found around point!")) 1587 (error "No file found around point!"))