From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: dired-mode-hook Date: Wed, 30 Apr 2014 19:50:46 +0300 Message-ID: <83sioulq1l.fsf@gnu.org> References: <155DEC68569B714B86C2C7075F5EDA9892AB0A36@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1398876787 30401 80.91.229.3 (30 Apr 2014 16:53:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2014 16:53:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 30 18:52:59 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1WfXke-0000yi-Rq for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2014 18:52:56 +0200 Original-Received: from localhost ([::1]:57935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfXke-0002UF-G3 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2014 12:52:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfXiU-0007Pr-Re for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 12:50:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfXiO-0003QR-BC for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 12:50:42 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:40772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfXiO-0003QL-3c for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 12:50:36 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N4U00O00RJAPV00@mtaout27.012.net.il> for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 19:47:06 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N4U00G5XRYIZ9A0@mtaout27.012.net.il> for help-gnu-emacs@gnu.org; Wed, 30 Apr 2014 19:47:06 +0300 (IDT) In-reply-to: <155DEC68569B714B86C2C7075F5EDA9892AB0A36@DAKIYA1.pegasus.local> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.183 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97487 Archived-At: > From: Doug Lewan > Date: Wed, 30 Apr 2014 15:48:53 +0000 > > There's a hook that I'd like to use with dired mode. It would position the cursor on a preferred file in that directory. > > When dired-mode-hooks are called the buffer isn't yet "painted" with its contents. (For example, (point-max) returns 1.) So, all those great dired-mode functions (like dired-goto-file, which I want) don't do anything. > > Am I doing something wrong? Is there some way to force the dired-mode buffer to have contents? Is it a bug in dired? I think you want dired-initial-position-hook instead.