From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: dired: make dired-maybe-insert-subdir always skip trivial files Date: Thu, 25 Dec 2014 21:21:36 +0300 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419531734 31994 80.91.229.3 (25 Dec 2014 18:22:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Dec 2014 18:22:14 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 25 19:22:09 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y4D30-0003kv-WB for ged-emacs-devel@m.gmane.org; Thu, 25 Dec 2014 19:22:07 +0100 Original-Received: from localhost ([::1]:51560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4D30-0002Ia-8n for ged-emacs-devel@m.gmane.org; Thu, 25 Dec 2014 13:22:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4D2o-0002IT-6u for emacs-devel@gnu.org; Thu, 25 Dec 2014 13:21:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y4D2j-00063R-0A for emacs-devel@gnu.org; Thu, 25 Dec 2014 13:21:54 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:44764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4D2i-00062s-KK for emacs-devel@gnu.org; Thu, 25 Dec 2014 13:21:48 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7591120944 for ; Thu, 25 Dec 2014 13:21:45 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 25 Dec 2014 13:21:45 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=bwO61SVQfRun/Y+Uo7was3Z/5wo=; b=DpZK y91mQa+OV//5vsLU16P1ZNFuVUgL7yHvAdkiSaAlCJLQZHRNTVG50f3aj7IldAJK HVPIcQxRWqyjDLyq+AUUruSfz1RA6zsN+3RKGBzwXrIyXKAjZOgJNV6gsILa4EbQ cJst9r6qWfbOjSRVpFhJvYV0ESo2TScslJSDMiU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=bwO61SVQfRu n/Y+Uo7was3Z/5wo=; b=VyKkc5FZ9q+6YAqXhp0izpcdo5dzsaxmEriANCBF5NG x9nMxAEw8UQS+AcIE+tf1trbZy2jLWtyIWu92TJ//CUdam/QtX5zPpmkUGm8Lj4H 7xZxKjRyxi96FzXtwhEN8TJ6WqWRoyXBz91cRL9SiJ0ggpKj/XKm4qTVFaLMxsRQ = X-Sasl-enc: nVwBBWPwuPlJE6/uOA0VZxHNSR8Tu7SCy1i3MjY8OOTR 1419531705 Original-Received: from fgunbin.local (unknown [94.25.218.10]) by mail.messagingengine.com (Postfix) with ESMTPA id F249BC0027E for ; Thu, 25 Dec 2014 13:21:44 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180666 Archived-At: When `dired-maybe-insert-subdir' is called on a subdir not yet present in the dired buffer, it inserts that subdir and skips to a first "non-trivial" file. But when it is already present, the point jumps to the header line and stays there. Below is the fix which makes it select the first non-trivial file always. Is it ok to apply? Filipp diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index bb93cce..acc7e76 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2062,7 +2062,10 @@ See Info node `(emacs)Subdir switches' for more details." ;; inserted *after* opoint. (setq dirname (file-name-as-directory dirname)) (or (and (not switches) - (dired-goto-subdir dirname)) + (when (dired-goto-subdir dirname) + (unless (dired-subdir-hidden-p dirname) + (dired-initial-position dirname)) + t)) (dired-insert-subdir dirname switches no-error-if-not-dir-p)) ;; Push mark so that it's easy to find back. Do this after the ;; insert message so that the user sees the `Mark set' message.