unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: 27899@debbugs.gnu.org
Subject: bug#27899: 26.0.50; dired-align-file forget about text properties
Date: Tue, 01 Aug 2017 16:33:18 +0900	[thread overview]
Message-ID: <871sovkaip.fsf@calancha-pc> (raw)
In-Reply-To: <8760e7kat3.fsf@calancha-pc> (Tino Calancha's message of "Tue, 01 Aug 2017 16:27:04 +0900")

Tino Calancha <tino.calancha@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	other threads:[~2017-08-01  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01  7:27 bug#27899: 26.0.50; dired-align-file forget about text properties Tino Calancha
2017-08-01  7:33 ` Tino Calancha [this message]
2017-08-06  4:19 ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sovkaip.fsf@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=27899@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).