GNU bug report logs -
#65039
30.0.50; [PATCH] Add bookmark handler for M-x shell
Previous Next
Reported by: Protesilaos Stavrou <info <at> protesilaos.com>
Date: Thu, 3 Aug 2023 14:42:01 UTC
Severity: wishlist
Tags: patch
Found in version 30.0.50
Fixed in version 31.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Ship Mints <shipmints <at> gmail.com> writes:
Hi,
> I cc'd Michael Albinus on this since it touches remote features and he
> may want to scrutinize what's in this patch. Testing this patch is
> what led me to help fix the bug in ansi-osc-directory-tracker.
>
> Let me know what you all think.
I gave it a cursory view. Nothing problematic; just some minor remarks.
> +(defcustom shell-bookmark-name-function #'shell-bookmark-name-from-default-directory
> + "Function to generate a shell bookmark name.
> +The default is `shell-bookmark-name', which see."
> + :group 'shell
> + :type `(choice (function-item ,#'shell-bookmark-name-from-default-directory)
> + (function-item ,#'shell-bookmark-name-from-buffer-name)
> + function)
Wouldn't this be sufficient?
--8<---------------cut here---------------start------------->8---
:type '(choice (function-item shell-bookmark-name-from-default-directory)
(function-item shell-bookmark-name-from-buffer-name)
function)
--8<---------------cut here---------------end--------------->8---
> + (replace-regexp-in-string "\\(.*\\)<[[:digit:]]+>\\'"
> + "\\1"
> + (buffer-name)))
--8<---------------cut here---------------start------------->8---
(replace-regexp-in-string "<[[:digit:]]+>\\'" "" (buffer-name)))
--8<---------------cut here---------------end--------------->8---
A further remark (don't know where to do it in your code): If you
bookmark a remote file name, I recommend to keep multi-hop file names
(let-bind tramp-show-ad-hoc-proxies to t). Otherwise, a remote file name
like "/ssh:host|sudo:host:/" would be saved in your bookmark-default-file
as "/sudo:host:/", which doesn't work in the next Emacs session.
> -Stephane
Best regards, Michael.
This bug report was last modified 64 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.