emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ae05583: dired-align-file: Inherit text properties


From: Tino Calancha
Subject: [Emacs-diffs] master ae05583: dired-align-file: Inherit text properties in inserted spaces
Date: Wed, 2 Aug 2017 04:55:24 -0400 (EDT)

branch: master
commit ae055834a99b26bf46180b6c78fe7ca24b7c8194
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    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.
---
 lisp/dired.el            |  2 +-
 test/lisp/dired-tests.el | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lisp/dired.el b/lisp/dired.el
index e1bedb6..24759c6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1205,7 +1205,7 @@ BEG..END is the line where the file info is located."
              (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 4ab6b37..c67f379 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -260,6 +260,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 via email to

[Prev in Thread] Current Thread [Next in Thread]