From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16090: 24.3.50; [PATCH] error when jumping to a doc-view bookmark Date: Wed, 02 Apr 2014 10:43:34 -0400 Message-ID: References: <87a9gbb7wi.fsf@hochschule-trier.de> <87txe4j6jy.fsf@thinkpad.tsdh.org> <877gb0hqol.fsf@hochschule-trier.de> <87lhzfd69p.fsf@thinkpad.tsdh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1396525336 18641 80.91.229.3 (3 Apr 2014 11:42:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2014 11:42:16 +0000 (UTC) Cc: 16090@debbugs.gnu.org, Andreas Politz To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 03 13:42:09 2014 Return-path: Envelope-to: geb-bug-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 1WVeKh-0001eo-0l for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Apr 2014 11:53:15 +0200 Original-Received: from localhost ([::1]:39023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVMOr-0002ka-4d for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Apr 2014 10:44:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVMOg-0002kS-0q for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 10:44:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVMOY-000447-GE for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 10:44:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVMOY-000443-CI for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 10:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WVMOX-0002MI-RQ for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 10:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Apr 2014 14:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16090 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 16090-submit@debbugs.gnu.org id=B16090.13964498199023 (code B ref 16090); Wed, 02 Apr 2014 14:44:01 +0000 Original-Received: (at 16090) by debbugs.gnu.org; 2 Apr 2014 14:43:39 +0000 Original-Received: from localhost ([127.0.0.1]:33044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVMOA-0002LS-Tu for submit@debbugs.gnu.org; Wed, 02 Apr 2014 10:43:39 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:33823) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVMO8-0002LK-S1 for 16090@debbugs.gnu.org; Wed, 02 Apr 2014 10:43:37 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s32EhYq6021307; Wed, 2 Apr 2014 10:43:35 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id BA11660251; Wed, 2 Apr 2014 10:43:34 -0400 (EDT) In-Reply-To: <87lhzfd69p.fsf@thinkpad.tsdh.org> (Tassilo Horn's message of "Fri, 20 Dec 2013 14:02:58 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4900=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4900> : inlines <684> : streams <1150324> : uri <1718066> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87680 Archived-At: > No, I haven't looked into the differences yet. But I think I've come up > with a quite good solution for the general problem right now. The patch > below allows bookmark handlers to return a function that accepts the > window showing the buffer and then may act on it. When the > display-function has been run, that function is called and in the > doc-view case sets the page for that window. Sounds good. > Until now, return values of handlers where simply ignored. It shouldn't > break existing handlers, except if there's some handler that does > something like If we're worried about such corner cases, we can do the same we do with completion-boundaries and completion-metadata: require that the function return (post-display-function . FUN) instead of just FUN. The probability that some pre-existing bookmark handler returns something of the form (post-display-function . FUN) is sufficiently small. Another option is to use a new bookmark property `post-display-function'. > I've tested it with bookmarks to docs that had to be converted anew and > bookmarks to docs that were already cached, and it seems to DTRT in all > cases. I think the current behavior in the "already cached" case demonstrates that we have a bug in there and I'm not sure that your patch fixes that bug (i.e. maybe it just works around it). I don't have time to dig into it, sadly. For emacs-24, your patch is too intrusive, so I think a patch along the lines of Andreas's might be acceptable, but it should use bookmark-after-jump-hook instead of using a timer. As for trunk, your patch is mostly OK. I think it should be pushed a bit further, tho: make it so that `display-function' returns the window (and fall back on calling get-buffer-window), and make it so that win-fn *replaces* the set-window-point (and receives the bookmark as additional argument, since it's likely that the function may like to use data from the bookmark, such as the page). After all, this get-buffer-window + set-window-point thingy in bookmark--jump-via is a hack to try and solve the same problem we're having (tho for "point in normal buffers", instead of for "current page in doc-view buffers"). Stefan