From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Opening a bookmark in the init file Date: Sun, 8 Mar 2015 14:24:18 -0700 (PDT) Message-ID: <6b508f27-065d-41fe-8142-caaad9a6c59e@default> References: <87mw3uerot.fsf@robertthorpeconsulting.com> <(message> <03> <2015> <02:32:50> <+0000)> <87ioeb8fid.fsf@robertthorpeconsulting.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1425849898 32723 80.91.229.3 (8 Mar 2015 21:24:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Mar 2015 21:24:58 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Robert Thorpe Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 08 22:24:45 2015 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 1YUigk-0007n2-Jz for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Mar 2015 22:24:42 +0100 Original-Received: from localhost ([::1]:40609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUigj-0002Tf-Me for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Mar 2015 17:24:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUigZ-0002Ta-Cn for help-gnu-emacs@gnu.org; Sun, 08 Mar 2015 17:24:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUigU-0003yO-Bu for help-gnu-emacs@gnu.org; Sun, 08 Mar 2015 17:24:31 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:35571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUigU-0003yG-5k for help-gnu-emacs@gnu.org; Sun, 08 Mar 2015 17:24:26 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t28LOOFK002029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 8 Mar 2015 21:24:25 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t28LOMYo020958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Mar 2015 21:24:23 GMT Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t28LOMDv004790; Sun, 8 Mar 2015 21:24:22 GMT In-Reply-To: <87ioeb8fid.fsf@robertthorpeconsulting.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:103072 Archived-At: > In my .emacs file I put: > (bookmark-load "~/.emacs.bmk") > (add-hook 'emacs-startup-hook '(lambda () (bookmark-jump "TODO"))) >=20 > It worked for a few days but I noticed Emacs was becoming slow to > startup. Today I had to restart Emacs a few times. The last time it > took several minutes to starts. The bookmark file was the culprit. For > some reason every entry had been duplicated with the text <2> in front > of it. Then it had been duplicated again with the text <3> in front of > that, and so one. This caused by bookmark file to double in size on > every restart until it was ~50MB long. I found that the two lines above > are the cause. If you add a bookmark-jump to emacs-startup-hook then > something goes wrong somewhere. For some reason, you chose to call function `bookmark-load'. If you do that it behooves you to check its doc first ;-): ,---- | bookmark-load is an interactive autoloaded Lisp function in | `bookmark.el'. |=20 | It is bound to . |=20 | (bookmark-load FILE &optional OVERWRITE NO-MSG) |=20 | Load bookmarks from FILE (which must be in bookmark format). | Appends loaded bookmarks to the front of the list of bookmarks. If | optional second argument OVERWRITE is non-nil, existing bookmarks are | destroyed. Optional third arg NO-MSG means don't display any messages | while loading. |=20 | If you load a file that doesn't contain a proper bookmark alist, you | will corrupt Emacs's bookmark list. Generally, you should only load | in files that were created with the bookmark functions in the first | place. Your own personal bookmark file, `~/.emacs.bmk', is | maintained automatically by Emacs; you shouldn't need to load it | explicitly. |=20 | If you load a file containing bookmarks with the same names as | bookmarks already present in your Emacs, the new bookmarks will get | unique numeric suffixes "<2>", "<3>", etc. `---- See the last paragraph. You are loading your bookmark file more than once. Most likely you are doing an explicit `bookmark-load' when your bookmark file has already been loaded. Don't do that. ;-) You can use function `bookmark-maybe-load-default-file' instead of `bookmark-load'. (There is also variable `bookmarks-already-loaded', but you should not need to check it.) But before bothering to fiddle with such things, check what you are really doing, to see how/why/where else you are loading your bookmark file, and perhaps simplify your code accordingly.