all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Pierre-Yves Luyten <py@luyten.fr>
Cc: Drew Adams <drew.adams@oracle.com>, emacs-devel@gnu.org
Subject: Re: [PATCH] open bookmark in other frame
Date: Fri, 12 Oct 2018 16:23:25 -0500	[thread overview]
Message-ID: <8736taoo4y.fsf@red-bean.com> (raw)
In-Reply-To: <f0ec9f25-4ae6-1163-3d8c-945ecca516dd@luyten.fr> (Pierre-Yves Luyten's message of "Fri, 12 Oct 2018 21:45:39 +0200")

Pierre-Yves Luyten <py@luyten.fr> writes:
>On 10/12/18 12:04 AM, Drew Adams wrote
>>>
>>> So here is the new version of the patch
>>> 1. Use pop-up-frames variable to avoid a read-only mode on new frame.
>>>      I also had to use (other-frame 1) to ensure new frame is raised.
>>
>> 1. `pop-up-frames' has nothing to do with read-only. 
>
>Sure, i meant i now use pop-up-frames instead of
>view-buffer-other-frame, which was the issue.
>
>> If you use `bookmark-jump-other-window' instead of `bookmark-jump' then you don't need to also use `(other-frame 1)'. See the code I sent.
>
>Great, so i attach a new version of the patch that get rid of
>(other-frame 1) and still works. Thanks for the help.
>
>
>> 2. I don't think you need to include this in the doc string:
>>
>>      , so the bookmark menu bookmark remains visible in its window.
>
>I agree this might be too obvious. So i also removed useless verbiage
>in this version.

Thanks, Pierre-Yves.  Would you mind combining this into one patch, since this is conceptually one change, and using the commit message guidelines as given in CONTRIBUTE (see the section "** Commit messages")?  It would be easier to review that way, and would provide a cleaner audit trail from mailing list post through to commit.

Best regards,
-Karl

>>From 9c3f6774413f9c9316eceafde98f1829e5c06dbd Mon Sep 17 00:00:00 2001
>From: Pierre-Yves Luyten <py@luyten.fr>
>Date: Fri, 12 Oct 2018 21:32:45 +0200
>Subject: [PATCH 1/2] * lisp/bookmark.el (bookmark-jump-other-frame): new
> function
>
> Add bookmark-jump-other-frame
> Bind to bookmark-map
>---
> lisp/bookmark.el | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/lisp/bookmark.el b/lisp/bookmark.el
>index 58a279473d..9d55c4aada 100644
>--- a/lisp/bookmark.el
>+++ b/lisp/bookmark.el
>@@ -209,6 +209,7 @@ A non-nil value may result in truncated bookmark names."
>     (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,13 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
>                                    bookmark-current-bookmark)))
>   (bookmark-jump bookmark 'switch-to-buffer-other-window))
> 
>+(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').
>-- 
>2.19.0
>
>
>>From 31ede454672c727c079b5576053e52639ba94fcc Mon Sep 17 00:00:00 2001
>From: Pierre-Yves Luyten <py@luyten.fr>
>Date: Fri, 12 Oct 2018 21:35:45 +0200
>Subject: [PATCH 2/2] * lisp/bookmark.el (bookmark-bmenu-other-frame):new
> function
>
> Add bookmark-bmenu-other-frame
> Bind to bookmark-bmenu-mode-map
>---
> lisp/bookmark.el | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
>diff --git a/lisp/bookmark.el b/lisp/bookmark.el
>index 9d55c4aada..7f73c22267 100644
>--- a/lisp/bookmark.el
>+++ b/lisp/bookmark.el
>@@ -1569,6 +1569,7 @@ unique numeric suffixes \"<2>\", \"<3>\", etc."
>     (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)
>@@ -1710,6 +1711,7 @@ Bookmark names preceded by a \"*\" have annotations.
> \\[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).
>@@ -1979,6 +1981,13 @@ With a prefix arg, prompts for a file to save them in."
>     (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."



  reply	other threads:[~2018-10-12 21:23 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=8736taoo4y.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=py@luyten.fr \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.