From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: How to run code after a dired buffer is fully initialized? Date: Tue, 07 Apr 2009 00:17:19 +0200 Message-ID: References: <878wmd5xze.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1239056299 4848 80.91.229.12 (6 Apr 2009 22:18:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Apr 2009 22:18:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 07 00:19:38 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lqx9w-0004LB-3x for ged-emacs-devel@m.gmane.org; Tue, 07 Apr 2009 00:19:16 +0200 Original-Received: from localhost ([127.0.0.1]:35902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lqx8X-0004Oh-FN for ged-emacs-devel@m.gmane.org; Mon, 06 Apr 2009 18:17:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lqx8R-0004N2-Jj for emacs-devel@gnu.org; Mon, 06 Apr 2009 18:17:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lqx8M-0004IY-Ox for emacs-devel@gnu.org; Mon, 06 Apr 2009 18:17:42 -0400 Original-Received: from [199.232.76.173] (port=46529 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lqx8M-0004IR-AP for emacs-devel@gnu.org; Mon, 06 Apr 2009 18:17:38 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:48283 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lqx8L-0001C9-Qv for emacs-devel@gnu.org; Mon, 06 Apr 2009 18:17:38 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lqx8G-0006Gf-Bm for emacs-devel@gnu.org; Mon, 06 Apr 2009 22:17:32 +0000 Original-Received: from remote2.student.chalmers.se ([129.16.29.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Apr 2009 22:17:32 +0000 Original-Received: from bojohan+news by remote2.student.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Apr 2009 22:17:32 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 17 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: remote2.student.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.90 (gnu/linux) Cancel-Lock: sha1:zaLDR/LufNXgcomO2UQaF9VlcDk= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:110102 Archived-At: Tassilo Horn writes: > This works quite well, but I would like dired to remember the line > point was on the last time I visited that directory, and to go to that > line when I come back. I tried to use a hashtable > (`th-dired-dir-line-map') mapping the directory to the line number. > The remembering part works (`th-dired-save-line'), but I cannot find > out where I should call `th-dired-goto-line'. [dired.el] (defun dired-initial-position (dirname) ;; Where point should go in a new listing of DIRNAME. ;; Point assumed at beginning of new subdir line. ;; You may redefine this function as you wish, e.g. like in dired-x.el. (end-of-line) (if dired-trivial-filenames (dired-goto-next-nontrivial-file)))