From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] open bookmark in other frame Date: Fri, 12 Oct 2018 16:23:25 -0500 Message-ID: <8736taoo4y.fsf@red-bean.com> References: <9d4a9ab3-d802-447e-3c74-81373b7e6101@luyten.fr> <9f2ed5a8-96c0-aa6c-b9c8-3b0f73f20aa6@luyten.fr> <357cd187-ad96-4cc6-9c01-cca87282f165@default> Reply-To: Karl Fogel NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1539379302 10108 195.159.176.226 (12 Oct 2018 21:21:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 21:21:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) Cc: Drew Adams , emacs-devel@gnu.org To: Pierre-Yves Luyten Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 23:21:38 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 1gB4sL-0002W3-EA for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 23:21:37 +0200 Original-Received: from localhost ([::1]:42622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB4uR-0000rN-VZ for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 17:23:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gB4uH-0000rH-Eu for emacs-devel@gnu.org; Fri, 12 Oct 2018 17:23:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gB4uB-0006dr-N6 for emacs-devel@gnu.org; Fri, 12 Oct 2018 17:23:37 -0400 Original-Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:39183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gB4u9-0006cT-Pc for emacs-devel@gnu.org; Fri, 12 Oct 2018 17:23:30 -0400 Original-Received: by mail-io1-xd36.google.com with SMTP id z16-v6so10248209iol.6 for ; Fri, 12 Oct 2018 14:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=Ft1XKaYrSSpWCO+8eCyl5GQ83FTkcfWdFS9oQ+mzGu4=; b=Uno0nyFAtPEdEMq0bXii0FUL/gONg3VR1xPwwYZDbjsh5MUZe/GP70Y/z9qbK5HuI2 Xt+13SBgfG6Gv8pqzr71UYzNAVocS7IJNYXayt8vzjkQ2Xns9Hdlhcto5HZY7hN5SqDA 0of9mjTBAgoSq0OMeFNnlmhPckdiWeS6UGxG1Uoxu6TSO7HHkm8z0hLI8dNkAhGZK905 evT0FdOSUCj5oaMXH0p4LZXNue4qDiakC41A1ebX1nUCUFWbLQciMZozMNgUsg8gbXQK ZHiyHVqed64H1mH9CzrEUTV4DalirrD0+Ufj22Lt0BMkrTV8PQaMgIRpTdoekp0JApgG fSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:reply-to :date:in-reply-to:message-id:user-agent:mime-version; bh=Ft1XKaYrSSpWCO+8eCyl5GQ83FTkcfWdFS9oQ+mzGu4=; b=ndvydDbopHJLxFd/5Y6VJzKjTCx3a/RAzs9foIQ3bDLh2hwzSjZHb35d+NRVjhpH9v swlgVBWY6YO0DijtAJNP1DSmAFYO/w5tTtt5owalVMQ1fp8Vo73z+QLHYoiTB2Bb1azt 2h4Hgu0kNnjRspSBJ4iwuVoNvey2wKCEbaFJcDLbuWMjQM8Wj1fd4W32uUXW3f7xfiZ+ a7IeAoMDM6Tee2t/Jwvjrxi2Qks+DuvWC3RUpQHKBAHPuOQ4hkjCzWvzgzCXOTKT4I8j +QQjmv6frl3zJR+UTbAYWL5YKqpNmNUs8w9TqkXpyLVqYb1PFZAxZCsGpHx/2NxpWJNU 2NkQ== X-Gm-Message-State: ABuFfohQ1Dz4Ku5Wex8rzHfjt+AfveYQaC+T7UfSyeJKwljdSU4v82tZ 529sJh8JE40bQ+ZZ6zVLI7H1f8I/ X-Google-Smtp-Source: ACcGV60pBib4zdxniLPDURcP2M4NkEqHJAZGLxWoL5BPRDM/+D+JY2TDg/D5amC07obqJgt9kEZDJw== X-Received: by 2002:a6b:bc41:: with SMTP id m62-v6mr5401436iof.64.1539379407514; Fri, 12 Oct 2018 14:23:27 -0700 (PDT) Original-Received: from kwork (74-92-190-114-Illinois.hfc.comcastbusiness.net. [74.92.190.114]) by smtp.gmail.com with ESMTPSA id w20-v6sm651031ioa.82.2018.10.12.14.23.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Oct 2018 14:23:26 -0700 (PDT) In-Reply-To: (Pierre-Yves Luyten's message of "Fri, 12 Oct 2018 21:45:39 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d36 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:230361 Archived-At: Pierre-Yves Luyten 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 >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 >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."