From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: bookmark.el bug report Date: Fri, 1 Jan 2010 23:51:07 -0800 Message-ID: References: <5065e2900912272219y3734fc9fsdaee41167ef99ad7@mail.gmail.com> <87r5q99jv9.fsf@red-bean.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1262418761 3453 80.91.229.12 (2 Jan 2010 07:52:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jan 2010 07:52:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Karl Fogel'" , "'Sun Yijiang'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 02 08:52:33 2010 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 1NQymk-000774-FF for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2010 08:52:32 +0100 Original-Received: from localhost ([127.0.0.1]:51271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQymj-0003YM-Ce for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2010 02:52:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQymc-0003Xx-UT for emacs-devel@gnu.org; Sat, 02 Jan 2010 02:52:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQymX-0003Vq-8Z for emacs-devel@gnu.org; Sat, 02 Jan 2010 02:52:22 -0500 Original-Received: from [199.232.76.173] (port=38600 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQymW-0003Vc-VD for emacs-devel@gnu.org; Sat, 02 Jan 2010 02:52:16 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:7563) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NQymV-0005qG-Ew for emacs-devel@gnu.org; Sat, 02 Jan 2010 02:52:16 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQymR-00080k-4L for emacs-devel@gnu.org; Sat, 02 Jan 2010 02:52:11 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by acsinet11.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o027q4fl024797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 2 Jan 2010 07:52:06 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o027q2R4026933; Sat, 2 Jan 2010 07:52:02 GMT Original-Received: from abhmt010.oracle.com by acsmt353.oracle.com with ESMTP id 1269731001262418650; Fri, 01 Jan 2010 23:50:50 -0800 Original-Received: from dradamslap1 (/24.5.185.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Jan 2010 23:50:50 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87r5q99jv9.fsf@red-bean.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcqLaUZBv8XB2d/mS2mFWWZCDtwQ4wAA7SMQ X-Source-IP: acsmt358.oracle.com [141.146.40.158] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4B3EFB24.00B2:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) 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:119260 Archived-At: > Note to Drew Adams: I took your suggestions about new constants. > However, I did not wrap the new `save-excursion' in `ignore-errors' > or `condition-case', because we should never be at eob right > after calling `bookmark-bmenu-ensure-position' (and if we are, > I want to know). Hi Karl, Do as you like, but part of my message was that there is no need to call `bookmark-bmenu-check-position' here (which you renamed `...ensure...'). Since the "check" part of that function doesn't really do anything, all it really does is move point to the nearest bookmark line. If point is already on a bookmark line, then it is a no-op. And the way to tell if point is on a bookmark line is (now) to call `bookmark-bmenu-bookmark'. So I use this simplified code (FWIW): (defun bookmark-bmenu-check-position () "Move to the beginning of the nearest bookmark line." (beginning-of-line) (unless (bookmark-bmenu-bookmark) (if (and (bolp) (eobp)) (beginning-of-line 0) (goto-char (point-min)) (forward-line bookmarkp-bmenu-header-lines))) t) ; Vanilla bookmark code depends on non-nil value. (defun bookmark-bmenu-bookmark () "Return the name of the bookmark on this line." (condition-case nil (save-excursion (forward-line 0) (forward-char (1+ bookmarkp-bmenu-marks-width)) (get-text-property (point) 'bookmarkp-bookmark-name)) (error nil))) Instead of calling `*-bmenu-bookmark' at the beginning of `ensure' to check for a no-op, the original code has it backward: it calls `ensure' at the start of each call to `*-bmenu-bookmark', to ensure that point is on a bookmark line. But for many calls to `*-bmenu-bookmark', we already know that point is on a bookmark line. If it is not called also within `*-bmenu-bookmark', then `ensure' is called much less often than `*-bmenu-bookmark'. And the original code has extra calls to `ensure', besides the one in `*-bmenu-mark'. In fact, it often calls it both at the beginning and at the end of a function (e.g. `*-bmenu-delete'). `ensure' only needs to be called before some (not all) of the calls to `*-bmenu-bookmark' - it has no use otherwise. That's why I said you can get rid of some of the calls to `ensure'. But if `ensure' is not called from within `*-bmenu-bookmark' then you need to protect the eob case (just to inhibit a msg) - hence the `condition-case'. HTH. -- I don't know what changes you actually made, since I cannot see them here: http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/ The last revision of bookmark.el shown there dates from Nov 24. Has the URL for the Emacs development source code changed, now that the repository is on BZR? If so, what is it - how does one get to the source code via HTTP? And if that URL is no longer valid, then its Web page should redirect to the proper URL, no? Personally, I do not intend to access the repository using BZR (just as I did not use CVS to access it before). I'm looking for a way to download a revision by just clicking an ordinary web-page link in my browser, as before.