From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#5550: 23.1.92; bookmark stops relocating Date: Tue, 09 Feb 2010 09:09:07 +0100 Organization: ThierryVolpiatto Message-ID: <87vde64yqk.fsf@tux.homenetwork> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1265705585 18400 80.91.229.12 (9 Feb 2010 08:53:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2010 08:53:05 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 09 09:53:02 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nelq9-00049q-0A for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2010 09:53:01 +0100 Original-Received: from localhost ([127.0.0.1]:53026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nelq8-0000Oj-Br for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2010 03:53:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NelpW-00008r-7O for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:52:22 -0500 Original-Received: from [199.232.76.173] (port=42557 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NelpU-00007n-S7 for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:52:20 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NelpT-0000qK-5n for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:52:20 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36543) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NelpS-0000qB-RH for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:52:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NelTv-0001K3-K8; Tue, 09 Feb 2010 03:30:03 -0500 X-Loop: bug-gnu-emacs@gnu.org In-Reply-To: Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Feb 2010 08:30:03 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5550 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.12657041565046 (code B ref -1); Tue, 09 Feb 2010 08:30:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Feb 2010 08:29:16 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NelT9-0001JK-N2 for submit@debbugs.gnu.org; Tue, 09 Feb 2010 03:29:16 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NelT6-0001Iv-Mz for submit@debbugs.gnu.org; Tue, 09 Feb 2010 03:29:13 -0500 Original-Received: from mail.gnu.org ([199.232.76.166]:54767 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NelSx-0007rV-TJ for submit@debbugs.gnu.org; Tue, 09 Feb 2010 03:29:06 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NelEf-0004TS-5J for submit@debbugs.gnu.org; Tue, 09 Feb 2010 03:14:18 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:40878) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NelEe-0004TE-Vg for submit@debbugs.gnu.org; Tue, 09 Feb 2010 03:14:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NelEd-0004e0-2m for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:14:15 -0500 Original-Received: from [199.232.76.173] (port=46962 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NelEY-0004dS-QY for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:14:11 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NelEW-0004SY-Qm for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:14:10 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:44685) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NelEW-0004SU-9u for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 03:14:08 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NelEU-0008Lp-Lo for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 09:14:06 +0100 Original-Received: from 228.211.85-79.rev.gaoland.net ([79.85.211.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Feb 2010 09:14:06 +0100 Original-Received: from thierry.volpiatto by 228.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Feb 2010 09:14:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 123 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 228.211.85-79.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwB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 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 09 Feb 2010 03:30:03 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34971 Archived-At: --=-=-= Find here the patch that fix bug#5476 and bug#5550. (patch sent to Stefan also) Leo writes: > It seems this is the third bug report from me regarding bookmark. I > wonder what has happened to it. > > Previously if I 'C-x r b' and choose a bookmark whose target no longer > exists, for example, a directory, I am offered to relocate the target. > > Now emacs just opens a blank buffer. I recently upgraded to snow leopard > and so I ran into lots of such cases. > > > In GNU Emacs 23.1.92.2 (x86_64-apple-darwin10.2.0, Carbon Version 1.6.0 AppKit 1038.25) > of 2010-02-03 on Victoria.local > Windowing system distributor `Apple Inc.', version 10.6.2 > configured using `configure '--prefix=/usr/local/unix/emacs' '--with-mac'' > > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: nil > value of $XMODIFIERS: nil > locale-coding-system: iso-latin-1-unix > default enable-multibyte-characters: t > > Major mode: Bookmark Menu > > > > > > -- Thierry Volpiatto --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=SingleInitial-patchToTip.patch ##Merge of all patches applied from revision 107108 ## Initial-patch: bookmark.el (bookmark-default-handler): bugfix 5476:Use buffer entry of bookmark if some instead of filename. ## patch-r107110: bookmark.el (bookmark-handle-bookmark):Fix bug 5550 fail to relocate non--existent bookmark. ## diff --git a/lisp/bookmark.el b/lisp/bookmark.el --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1068,7 +1068,7 @@ (funcall (or (bookmark-get-handler bookmark) 'bookmark-default-handler) (bookmark-get-bookmark bookmark)) - (file-error + ('bookmark-error-no-filename ;file-error ;; We were unable to find the marked file, so ask if user wants to ;; relocate the bookmark, else remind them to consider deletion. (when (stringp bookmark) @@ -1116,24 +1116,26 @@ BMK-RECORD is a bookmark record, not a bookmark name (i.e., not a string). Changes current buffer and point and returns nil, or signals a `file-error'." (let ((file (bookmark-get-filename bmk-record)) + (buf (bookmark-prop-get bmk-record 'buffer)) (forward-str (bookmark-get-front-context-string bmk-record)) (behind-str (bookmark-get-rear-context-string bmk-record)) (place (bookmark-get-position bmk-record))) - (if (not file) - (signal 'bookmark-error-no-filename (list 'stringp file)) - (set-buffer (find-file-noselect file)) - (if place (goto-char place)) - ;; Go searching forward first. Then, if forward-str exists and - ;; was found in the file, we can search backward for behind-str. - ;; Rationale is that if text was inserted between the two in the - ;; file, it's better to be put before it so you can read it, - ;; rather than after and remain perhaps unaware of the changes. - (if forward-str - (if (search-forward forward-str (point-max) t) - (goto-char (match-beginning 0)))) - (if behind-str - (if (search-backward behind-str (point-min) t) - (goto-char (match-end 0))))) + (if (and file (file-readable-p file) (not (buffer-live-p buf))) + (with-current-buffer (find-file-noselect file) (setq buf (buffer-name))) + ;; No file found. See if buffer BUF have been created. If not, raise error. + (unless (and buf (get-buffer buf)) + (signal 'bookmark-error-no-filename (list 'stringp file)))) + (set-buffer buf) + (if place (goto-char place)) + ;; Go searching forward first. Then, if forward-str exists and + ;; was found in the file, we can search backward for behind-str. + ;; Rationale is that if text was inserted between the two in the + ;; file, it's better to be put before it so you can read it, + ;; rather than after and remain perhaps unaware of the changes. + (when (and forward-str (search-forward forward-str (point-max) t)) + (goto-char (match-beginning 0))) + (when (and behind-str (search-backward behind-str (point-min) t)) + (goto-char (match-end 0))) nil)) ;;;###autoload diff --git a/lisp/info.el b/lisp/info.el --- a/lisp/info.el +++ b/lisp/info.el @@ -4797,7 +4797,7 @@ ;; Use bookmark-default-handler to move to the appropriate location ;; within the node. (bookmark-default-handler - (list* "" `(buffer . ,buf) (bookmark-get-bookmark-record bmk))))) + `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) (provide 'info) --=-=-=--