 ;;          (strg  (replace-regexp-in-string "\\([$]\\)" "" strg 'FIXEDCASE nil))) ; Remove $'s
 ;;     strg))
 
-(defcustom diredp-omit-files-regexp "\\.?#.*#\\|\\.\\|\\.\\."
+(diredp-make-obsolete-variable 'diredp-omit-files-regexp 'diredp-omit-files-font-lock-regexp "2021-03-03")
+(defcustom diredp-omit-files-font-lock-regexp "\\.?#.*#\\|\\.\\|\\.\\."
   ;;
   ;; This was no good for `#...#'.  There's no rule good enough to work generally.
   ;; Can't just transform `dired-omit-files'.

                              (list "Files in Region"
                                    (list ""
                                          '("Mark" . diredp-mark-region-files)
                                          '("Unmark" . diredp-unmark-region-files)
                                          '("Toggle Marked/Unmarked" .
                                            diredp-toggle-marks-in-region)

                                                     (concat "^" (regexp-quote (char-to-string mark-char)))))
                                             (diredp-looking-at-p "^ ")))))

(put 'diredp-mark 'interactive-only t)
;;;###autoload
(defun diredp-mark (arg &optional char) ; Bound to `m', `* m'
  "Mark current line, lines in active region, or lines in a listing.
If the region is active and nonempty:
 * Mark the lines in the region.
 * With a prefix arg, you are prompted for the CHAR to mark with.

If cursor is on a listing header line (main dir or a subdir):
 * Mark all lines in that listing except dirs `.' and `..'.
 * With a prefix arg, you are prompted for the CHAR to mark with.

Otherwise, with numeric prefix arg N, mark the next N lines.

Use \\<dired-mode-map>`\\[dired-unmark-all-files]' to remove marks everywhere, \
or `\\[dired-unmark]' on a listing header
line to remove marks in the listing."
  (interactive "P")
  (let ((dired-marker-char  dired-marker-char))
    (cond ((diredp-nonempty-region-p)
           (when arg
             (when (< emacs-major-version 28) (message nil)) ; Workaround for bug #46243.
             (setq dired-marker-char  (read-char "Mark region lines with char: ")))
           (diredp-mark-region-files))
          ((dired-get-subdir)
           (when arg
             (when (< emacs-major-version 28) (message nil)) ; Workaround for bug #46243.
             (setq dired-marker-char  (read-char "Mark subdir lines with char: ")))
           (save-excursion (dired-mark-subdir-files)))
          (t
           (let ((inhibit-read-only  t))
             (dired-repeat-over-lines
              (prefix-numeric-value arg)
              (lambda () (delete-char 1) (insert dired-marker-char))))))))

;;;###autoload
(defun diredp-mark-with-char (char &optional arg) ; Not bound, except in menus
  "Mark this line with CHAR.
With numeric prefix arg N, mark the next N lines."
  ;; Need workaround for Emacs < 28 - see Emacs bug #46243.
  ;; (interactive "cMark this line with char: \np")
  (interactive
   (progn (when (< emacs-major-version 28) (message nil)) ; Workaround for bug #46243.
          (list (read-char "Mark this line with char: ")
                (prefix-numeric-value current-prefix-arg))))
  (let ((dired-marker-char  char)) (dired-mark arg)))

;;;###autoload
(defun diredp-mark-region-files-with-char (char &optional unmark-p) ; Not bound, except in menus
  "Mark lines in active region with CHAR.
With non-nil prefix arg, unmark CHAR instead."
  ;; Need workaround for Emacs < 28 - see Emacs bug #46243.
  ;;(interactive "cMark region with char: \nP")
  (interactive
   (progn (when (< emacs-major-version 28) (message nil)) ; Workaround for bug #46243.
          (list (read-char "Mark region with char: ") current-prefix-arg)))
  (let ((dired-marker-char  char)
        (beg                        (min (point) (mark)))
        (end                        (max (point) (mark)))
        (inhibit-field-text-motion  t)) ; Just in case.
    (setq beg  (save-excursion (goto-char beg) (line-beginning-position))
          end  (save-excursion (goto-char end) (when (and (bolp) (> end beg)) (backward-char)) (line-end-position)))
    (let ((dired-marker-char  (if unmark-p ?\040 dired-marker-char)))
      (diredp-mark-if (and (<= (point) end)  (>= (point) beg)  (diredp-this-file-unmarked-p)) "region file"))))

;;;###autoload
(defun diredp-mark-region-files (&optional unmark-p) ; Not bound, except in menus
  "Mark all of the files in the current region (if it is active).
With non-nil prefix arg, unmark them instead."
  (interactive "P")
