unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Liu Hui <liuhui1610@gmail.com>
Cc: 66982@debbugs.gnu.org
Subject: bug#66982: 30.0.50; Cannot delete bookmark of inaccessible remote file
Date: Wed, 08 Nov 2023 09:40:05 +0100	[thread overview]
Message-ID: <874jhweize.fsf@gmx.de> (raw)
In-Reply-To: <CAOQTW-P=iNhuEXEDTzOaR6Z9Q3CVy+Kqnb9DzOby=VsQmzmOWA@mail.gmail.com> (Liu Hui's message of "Tue, 7 Nov 2023 18:18:57 +0800")

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

Liu Hui <liuhui1610@gmail.com> writes:

Hi,

> Recipe:
>
> 1. Save the following text as the test bookmark file
>
> ;;;; Emacs Bookmark Format Version 1;;;; -*- coding: utf-8-emacs;
> mode: lisp-data -*-
> ;;; This format is meant to be slightly human-readable;
> ;;; nevertheless, you probably don't want to edit it.
> ;;; -*- End Of Bookmark File Format Version Stamp -*-
> (("test" (filename . "/ssh:192.168.0.100:~/") (front-context-string)
>  (rear-context-string . "g-style=literal\n") (position . 68)
>  (last-modified 25595 64776 373828 978000)))
>
> 2. emacs -Q --eval '(setq bookmark-default-file xxx)' -f list-bookmarks
>
> 3. press d, then x.
>
> However, the bookmark cannot be deleted because Emacs hangs or displays
> tramp error message/popup window after several seconds.

Thank you for the recipe, I can reproduce the problem. It happens,
because in `bookmark--remove-fringe-mark' there is a call of
`expand-file-name', which blocks if a remote file is not reachable.

Could you pls check the appended patch? It fixes your recipe for me, and
shouldn't harm other use cases.

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 522 bytes --]

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 10ff2f5ebbf..71d76cb4291 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -511,6 +511,8 @@ bookmark--remove-fringe-mark
 See user option `bookmark-fringe-mark'."
   (let ((filename (cdr (assq 'filename bm)))
         (pos (cdr (assq 'position bm)))
+        ;; Don't expand file names for non-existing remote connections.
+        (non-essential t)
         overlays found temp)
     (when (and pos filename)
       (setq filename (expand-file-name filename))

  reply	other threads:[~2023-11-08  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 10:18 bug#66982: 30.0.50; Cannot delete bookmark of inaccessible remote file Liu Hui
2023-11-08  8:40 ` Michael Albinus [this message]
2023-11-10  4:29   ` Liu Hui
2023-11-10 10:24     ` Michael Albinus

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=874jhweize.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=66982@debbugs.gnu.org \
    --cc=liuhui1610@gmail.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).