From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.bugs Subject: bug#48883: [External] : bug#48883: dired marking bugs Date: Sun, 6 Jun 2021 20:50:00 -0400 Message-ID: <20210607005000.cixkurympnxphbxm@E15-2016.optimum.net> References: <20210606203356.muhmgel5m2jwmzpj@E15-2016.optimum.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nb4cqmyu3nzxf7f7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12591"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: NeoMutt/20180716 Cc: "48883@debbugs.gnu.org" <48883@debbugs.gnu.org> To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 07 03:32:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lq47g-00033M-H4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Jun 2021 03:32:12 +0200 Original-Received: from localhost ([::1]:60292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lq47f-0004AW-HK for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 21:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lq47X-00046o-Iu for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 21:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lq47X-0008Qn-C4 for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 21:32:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lq47X-00089f-Jm for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 21:32:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Boruch Baum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Jun 2021 01:32:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48883 X-GNU-PR-Package: emacs Original-Received: via spool by 48883-submit@debbugs.gnu.org id=B48883.162302951331302 (code B ref 48883); Mon, 07 Jun 2021 01:32:03 +0000 Original-Received: (at 48883) by debbugs.gnu.org; 7 Jun 2021 01:31:53 +0000 Original-Received: from localhost ([127.0.0.1]:54171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lq47N-00088o-3q for submit@debbugs.gnu.org; Sun, 06 Jun 2021 21:31:53 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:54091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lq47L-00088b-4N for 48883@debbugs.gnu.org; Sun, 06 Jun 2021 21:31:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1623029504; bh=HMRzkph+5b2Ubelbz2bWmuDZTJL3r6K4a8ozeNXZYFw=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=f8pZHyKZjcgglSGIIXDWvTaZ9drdHkwj3+nl1maFyPtAVA0Gzp2jINnSiP3iROiOM ZvbfSd2KWtgNbA4AGv44OJkp4RwksS+gdLBE6iYFbrKel1J3901HvHqTRYdR6NqVlE z7f9F1ulwLbHYD8vjx335C7j1Rf0Evaa69ArIg2Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from E15-2016.optimum.net ([96.224.230.212]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MBm1U-1lduND10kG-00CA8a; Mon, 07 Jun 2021 02:50:03 +0200 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:FuZm4Nh0+D8Xr5skvdkaaH58T3InmTux5q2xZJg563Ik0Rp5woU 4zbyxV5oxdQOuNLa7iRdHwq77WaBMeE+98OSsF3l5BuWL5m2CaqjacCxehAfZHqmcxqDaXc NfmNUqw64qBU5x8QkQG8rH4ugqElLJQNh/jBM8arCyesjHJ6dx8irFg1poprrqwFCfUpWd/ 3zfgjLdXF287JAd3NcCvA== X-UI-Out-Filterresults: notjunk:1;V03:K0:yInbnkUYmys=:WkTnt6ZZ7DoHyqIMwfH7A2 ylYj2L0VnPJ4K7dqtm4apisr72ygVXdrKNR1GLlnDjcKUA7MzKPvAnaEbMREj8BEM35SVRQH4 XsNRYCnAzt34Fp3lHmbXNqJhyWH2wrxBSFCEluswRIXemI+zPrt6UTHyq3lNiRPdMeF+9Chvt Oda8Z/fZmOZYa6z3wxKA5dQGsV99LM3B6Wdd2uG3DjrocYtCB5ZJ8H5dqSepiZ1A2ZcJHQiml dZX0QLH3vhvH/vVpyDzMJERZFy3TB4JO/eA7cUrYB2xW9S0XLp/eI5fEwitXWrqRg0t4dooaC jOy0DuRoyB3gbMlySg7FE5Jfiw/0BzUtkoqOCYfexnR1aQTvjnafDTLF1aQ387/xHfXu66RMA mMhFFQ9Ea1GSRHtUqYsr1NmQcmGvwg+6TLDF6TDsKlCyts14V6lhQtaXm3xNOukam4bg+OA8S l76jb3sEjP2xCLWbrklT4LRLDQadxEo2J57269RKiK9XPDLlXhH+fhrzjPdUODuibOvX9pkz4 3tHuSL72GwkP4lzwZLRtnPW9VLuoV7DQVNS9J451WZSf5SiRmxiSTUkZOfFcRsh0J2waqAuTd LbxJ9a8Zqe0iGXTlMNnD5Eo4nME5sAzlMKx1DgR5bW+0TSQfG4aKxUo6RAQLZkRhm+qtsxM3x bREsbEsQEK7aV7yq4IjHm+//KQswbu0F7zMHYMbpwU0bfIHI22FU96FJqcohmKmqt85nTLmAp YRMkoqftG1JHMaVRk493i5RYU/kbiSopLzmKJ7ObSVRH9OAjZ7p7xvQnlbfb9nzThz5Tim0x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208167 Archived-At: --nb4cqmyu3nzxf7f7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Attached are two updated fix files. file dired.2.patch is a slight modifcation of my first submission, to cover a case of being in an empty directory. file dired.3.patch is possibly a 'better' fix in that it addresses a deficiency in function `dired-between-lines'. The emacs developers may decide that method is undesirable and prefer the first patch. Technically, neither file is a 'patch' file, but both are simple small drop-in replacements for content of file dired.el @line ~3500. If for this, you decide you need a real patch file, fine, just tell me for which option. =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --nb4cqmyu3nzxf7f7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="dired.2.patch" (defun dired-repeat-over-lines (arg function) ;; This version skips non-file lines. (let ((pos (make-marker))) (beginning-of-line) (cond ((> arg 0) (while (and (> arg 0) (not (eobp))) (setq arg (1- arg)) (beginning-of-line) ;;(while (and (not (eobp)) (dired-between-files)) (forward-line 1)) (while (and (not (eobp)) (condition-case nil (not (dired-get-filename)) (error t))) (forward-line 1)) (save-excursion (forward-line 1) (move-marker pos (1+ (point)))) (unless (eobp) (save-excursion (funcall function)) ;; Advance to the next line--actually, to the line that *was* next. ;; (If FUNCTION inserted some new lines in between, skip them.) (goto-char pos))) (when (eobp) (forward-line -1) (dired-move-to-filename))) ((< arg 0) (while (and (< arg 0) (not (bobp))) (setq arg (1+ arg)) (forward-line -1) ;;(while (and (not (bobp)) (dired-between-files)) (forward-line -1)) (while (and (not (bobp)) (condition-case nil (not (dired-get-filename)) (error t))) (forward-line -1)) (beginning-of-line) (when (condition-case nil (dired-get-filename) (error nil)) (save-excursion (funcall function)))) (move-marker pos nil) (dired-move-to-filename))))) --nb4cqmyu3nzxf7f7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="dired.3.patch" (defun dired-repeat-over-lines (arg function) ;; This version skips non-file lines. (let ((pos (make-marker))) (beginning-of-line) (cond ((> arg 0) (while (and (> arg 0) (not (eobp))) (setq arg (1- arg)) (beginning-of-line) (while (and (not (eobp)) (dired-between-files)) (forward-line 1)) (save-excursion (forward-line 1) (move-marker pos (1+ (point)))) (unless (eobp) (save-excursion (funcall function)) ;; Advance to the next line--actually, to the line that *was* next. ;; (If FUNCTION inserted some new lines in between, skip them.) (goto-char pos))) (when (eobp) (forward-line -1) (dired-move-to-filename))) ((< arg 0) (while (and (< arg 0) (not (bobp))) (setq arg (1+ arg)) (forward-line -1) (while (and (not (bobp)) (dired-between-files)) (forward-line -1)) (beginning-of-line) (when (condition-case nil (dired-get-filename) (error nil)) (save-excursion (funcall function)))) (move-marker pos nil) (dired-move-to-filename))))) (defun dired-between-files () ;; This used to be a regexp match of the `total ...' line output by ;; ls, which is slightly faster, but that is not very robust; notably, ;; it fails for non-english locales. (not (condition-case nil (dired-get-filename) (error nil)))) --nb4cqmyu3nzxf7f7--