unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre-Yves Luyten <py@luyten.fr>
To: Karl Fogel <kfogel@red-bean.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] open bookmark in other frame
Date: Sun, 4 Nov 2018 22:10:12 +0100	[thread overview]
Message-ID: <b881467e-48cc-77b8-f4e3-23609f2eb5af@luyten.fr> (raw)
In-Reply-To: <87k1lv5mxf.fsf@red-bean.com>

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

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

[-- Attachment #2: 0001-lisp-bookmark.el-add-functions-to-open-in-other-fram.patch --]
[-- Type: text/x-patch, Size: 3100 bytes --]

From 0f2d53a9646db6e054b73e7c97dfbfa9f7c05e0e Mon Sep 17 00:00:00 2001
From: Pierre-Yves Luyten <py@luyten.fr>
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


  reply	other threads:[~2018-11-04 21:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 20:14 [PATCH] open bookmark in other frame Pierre-Yves Luyten
2018-10-10 20:16 ` Marcin Borkowski
2018-10-10 21:35   ` Karl Fogel
2018-10-11 11:42     ` Pierre-Yves Luyten
2018-10-10 22:06 ` Drew Adams
2018-10-11  7:19   ` Karl Fogel
2018-10-11 11:30     ` Pierre-Yves Luyten
2018-10-11 13:35     ` Drew Adams
2018-10-11 21:50   ` Pierre-Yves Luyten
2018-10-11 22:04     ` Drew Adams
2018-10-12 19:45       ` Pierre-Yves Luyten
2018-10-12 21:23         ` Karl Fogel
2018-10-14 19:45           ` Pierre-Yves Luyten
2018-10-16  2:09             ` Karl Fogel
2018-10-16  9:51               ` Pierre-Yves Luyten
2018-10-16  2:10             ` Karl Fogel
2018-11-02 18:55             ` Karl Fogel
2018-11-04 21:10               ` Pierre-Yves Luyten [this message]
2018-11-09  0:54                 ` Karl Fogel
2018-10-13 15:04 ` Stephen Leake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b881467e-48cc-77b8-f4e3-23609f2eb5af@luyten.fr \
    --to=py@luyten.fr \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).