GNU bug report logs - #27899
26.0.50; dired-align-file forget about text properties

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Tue, 1 Aug 2017 07:28:02 UTC

Severity: minor

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27899 in the body.
You can then email your comments to 27899 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27899; Package emacs. (Tue, 01 Aug 2017 07:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 01 Aug 2017 07:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; dired-align-file forget about text properties
Date: Tue, 01 Aug 2017 16:27:04 +0900
The addes spaces must inherit the nearby text properties: for instance,
the 'invisible' property.

--8<-----------------------------cut here---------------start------------->8---
commit 556c5281d3b5056b9bf636b88ae3baf57a1d2f48
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date:   Tue Aug 1 16:24:00 2017 +0900

    dired-align-file: Inherit text properties in inserted spaces
    
    * lisp/dired.el (dired-align-file): Inherit text
    properties in inserted spaces (Bug#27899).
    * test/lisp/dired-tests.el (dired-test-bug27899): Add test.

diff --git a/lisp/dired.el b/lisp/dired.el
index c502dd8a50..f31993f367 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1162,7 +1162,7 @@ dired-align-file
 	      (setq file-col (+ spaces file-col))
 	      (if (> file-col other-col)
 		  (setq spaces (- spaces (- file-col other-col))))
-	      (insert-char ?\s spaces)
+	      (insert-char ?\s spaces 'inherit)
 	      ;; Let's just make really sure we did not mess up.
 	      (unless (save-excursion
 			(eq (dired-move-to-filename) (marker-position file)))
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index d6fe839708..313381f22c 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -319,6 +319,19 @@
       (delete-directory dir 'recursive)
       (when (buffer-live-p buf) (kill-buffer buf)))))
 
+(ert-deftest dired-test-bug27899 ()
+  "Test for http://debbugs.gnu.org/27899 ."
+  :expected-result :failed
+  (let* ((dir (expand-file-name "src" source-directory))
+	 (buf (dired (list dir "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c")))
+         (orig dired-hide-details-mode))
+    (dired-goto-file (expand-file-name "cygw32.c"))
+    (forward-line 0)
+    (let ((inhibit-read-only t))
+      (dired-align-file (point) (point-max)))
+    (dired-hide-details-mode t)
+    (dired-move-to-filename)
+    (should (eq 2 (current-column)))))
 
 (provide 'dired-tests)
 ;; dired-tests.el ends here
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-07-31
Repository revision: 3a8d0cc825635e07da2a90c4ac987b476fc9b05d




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27899; Package emacs. (Tue, 01 Aug 2017 07:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 27899 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 27899 <at> debbugs.gnu.org
Subject: Re: bug#27899: 26.0.50; dired-align-file forget about text properties
Date: Tue, 01 Aug 2017 16:33:18 +0900
Tino Calancha <tino.calancha <at> gmail.com> writes:

> +(ert-deftest dired-test-bug27899 ()
> +  "Test for http://debbugs.gnu.org/27899 ."
> +  :expected-result :failed
> +  (let* ((dir (expand-file-name "src" source-directory))
> +	 (buf (dired (list dir "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c")))
> +         (orig dired-hide-details-mode))
> +    (dired-goto-file (expand-file-name "cygw32.c"))
> +    (forward-line 0)
> +    (let ((inhibit-read-only t))
> +      (dired-align-file (point) (point-max)))
> +    (dired-hide-details-mode t)
> +    (dired-move-to-filename)
> +    (should (eq 2 (current-column)))))
>  
>  (provide 'dired-tests)
>  ;; dired-tests.el ends here
The test must pass and set dired-hide-details-mode to orig at the end:

diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index d6fe839708..937386de78 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -319,6 +319,21 @@
       (delete-directory dir 'recursive)
       (when (buffer-live-p buf) (kill-buffer buf)))))
 
+(ert-deftest dired-test-bug27899 ()
+  "Test for http://debbugs.gnu.org/27899 ."
+  (let* ((dir (expand-file-name "src" source-directory))
+	 (buf (dired (list dir "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c")))
+         (orig dired-hide-details-mode))
+    (dired-goto-file (expand-file-name "cygw32.c"))
+    (forward-line 0)
+    (unwind-protect
+        (progn
+          (let ((inhibit-read-only t))
+            (dired-align-file (point) (point-max)))
+          (dired-hide-details-mode t)
+          (dired-move-to-filename)
+          (should (eq 2 (current-column))))
+      (dired-hide-details-mode orig))))
 
 (provide 'dired-tests)
 ;; dired-tests.el ends here




Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Sun, 06 Aug 2017 04:20:02 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Sun, 06 Aug 2017 04:20:02 GMT) Full text and rfc822 format available.

Message #13 received at 27899-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 27899-done <at> debbugs.gnu.org
Subject: Re: bug#27899: 26.0.50; dired-align-file forget about text properties
Date: Sun, 06 Aug 2017 13:19:21 +0900
Tino Calancha <tino.calancha <at> gmail.com> writes:

> The addes spaces must inherit the nearby text properties: for instance,
> the 'invisible' property.
Pushed fix into master branch as commit ae055834a99b26bf46180b6c78fe7ca24b7c8194




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Sep 2017 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.