From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pierre-Yves Luyten Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] open bookmark in other frame Date: Sun, 4 Nov 2018 22:10:12 +0100 Message-ID: References: <9d4a9ab3-d802-447e-3c74-81373b7e6101@luyten.fr> <9f2ed5a8-96c0-aa6c-b9c8-3b0f73f20aa6@luyten.fr> <357cd187-ad96-4cc6-9c01-cca87282f165@default> <8736taoo4y.fsf@red-bean.com> <6a73c984-002a-f767-6a96-3fb0822489de@luyten.fr> <87k1lv5mxf.fsf@red-bean.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------58DA732BC38B998E287C8890" X-Trace: blaine.gmane.org 1541366255 9379 195.159.176.226 (4 Nov 2018 21:17:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Nov 2018 21:17:35 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cc: emacs-devel@gnu.org To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 04 22:17:31 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJPlz-0002Kd-5o for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2018 22:17:31 +0100 Original-Received: from localhost ([::1]:60246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJPo5-0006Cd-79 for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2018 16:19:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJPnw-00066R-4I for emacs-devel@gnu.org; Sun, 04 Nov 2018 16:19:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJPfR-0001FY-8E for emacs-devel@gnu.org; Sun, 04 Nov 2018 16:10:48 -0500 Original-Received: from 4.mo4.mail-out.ovh.net ([178.32.98.131]:39703) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJPfR-0000VH-0L for emacs-devel@gnu.org; Sun, 04 Nov 2018 16:10:45 -0500 Original-Received: from player760.ha.ovh.net (unknown [10.109.159.157]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id C28761BD03C for ; Sun, 4 Nov 2018 22:10:14 +0100 (CET) Original-Received: from luyten.fr (85-170-98-108.rev.numericable.fr [85.170.98.108]) (Authenticated sender: py@luyten.fr) by player760.ha.ovh.net (Postfix) with ESMTPSA id 387E820090; Sun, 4 Nov 2018 22:10:13 +0100 (CET) In-Reply-To: <87k1lv5mxf.fsf@red-bean.com> Content-Language: en-US-large X-Ovh-Tracer-Id: 6932728677144047846 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeefgddugeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.32.98.131 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231010 Archived-At: This is a multi-part message in MIME format. --------------58DA732BC38B998E287C8890 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 02/11/2018 19:55, Karl Fogel wrote: > > It's always a good idea to test changes in a freshly-built and freshly-started Emacs. In this case, because there was no ";;;###autoload" marker before `bookmark-jump-other-frame', invoking that function in a fresh Emacs would generate an error. Hi, Oops i used to just work with eval-buffer on the lisp i needed, and i can see now this is not the right workflow for testing a patch. So now i rather build Emacs to test patch properly, and obviously as you wrote adding the autoload magic comment fixed the issue. So here is the patch with this. Regards Pierre-Yves --------------58DA732BC38B998E287C8890 Content-Type: text/x-patch; name="0001-lisp-bookmark.el-add-functions-to-open-in-other-fram.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-lisp-bookmark.el-add-functions-to-open-in-other-fram.pa"; filename*1="tch" >From 0f2d53a9646db6e054b73e7c97dfbfa9f7c05e0e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Luyten Date: Sat, 13 Oct 2018 22:06:41 +0200 Subject: [PATCH] * lisp/bookmark.el: add functions to open in other frame (bookmark-jump-other-frame): New function. Bind in bookmark-map. (bookmark-bmenu-other-frame): New function. Bind in bookmark-bmenu-mode-map. --- lisp/bookmark.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 58a279473d..15a841e208 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -209,6 +209,7 @@ bookmark-map (define-key map "j" 'bookmark-jump) (define-key map "g" 'bookmark-jump) ;"g"o (define-key map "o" 'bookmark-jump-other-window) + (define-key map "5" 'bookmark-jump-other-frame) (define-key map "i" 'bookmark-insert) (define-key map "e" 'edit-bookmarks) (define-key map "f" 'bookmark-insert-location) ;"f"ind @@ -1124,6 +1125,14 @@ bookmark-jump-other-window bookmark-current-bookmark))) (bookmark-jump bookmark 'switch-to-buffer-other-window)) +;;;###autoload +(defun bookmark-jump-other-frame (bookmark) + "Jump to BOOKMARK in another frame. See `bookmark-jump' for more." + (interactive + (list (bookmark-completing-read "Jump to bookmark (in another frame)" + bookmark-current-bookmark))) + (let ((pop-up-frames t)) + (bookmark-jump-other-window bookmark))) (defun bookmark-jump-noselect (bookmark) "Return the location pointed to by BOOKMARK (see `bookmark-jump'). @@ -1561,6 +1570,7 @@ bookmark-bmenu-mode-map (set-keymap-parent map special-mode-map) (define-key map "v" 'bookmark-bmenu-select) (define-key map "w" 'bookmark-bmenu-locate) + (define-key map "5" 'bookmark-bmenu-other-frame) (define-key map "2" 'bookmark-bmenu-2-window) (define-key map "1" 'bookmark-bmenu-1-window) (define-key map "j" 'bookmark-bmenu-this-window) @@ -1702,6 +1712,7 @@ bookmark-bmenu-mode \\[bookmark-bmenu-this-window] -- select this bookmark in place of the bookmark menu buffer. \\[bookmark-bmenu-other-window] -- select this bookmark in another window, so the bookmark menu bookmark remains visible in its window. +\\[bookmark-bmenu-other-frame] -- select this bookmark in another frame. \\[bookmark-bmenu-switch-other-window] -- switch the other window to this bookmark. \\[bookmark-bmenu-rename] -- rename this bookmark (prompts for new name). \\[bookmark-bmenu-relocate] -- relocate this bookmark's file (prompts for new file). @@ -1971,6 +1982,13 @@ bookmark-bmenu-other-window (bookmark--jump-via bookmark 'switch-to-buffer-other-window))) +(defun bookmark-bmenu-other-frame () + "Select this line's bookmark in other frame." + (interactive) + (let ((bookmark (bookmark-bmenu-bookmark)) + (pop-up-frames t)) + (bookmark-jump-other-window bookmark))) + (defun bookmark-bmenu-switch-other-window () "Make the other window select this line's bookmark. The current window remains selected." -- 2.19.1 --------------58DA732BC38B998E287C8890--