all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59212: 29.0.50; [PATCH] Set default value of bookmark Type
@ 2022-11-12  8:56 Gabriel
  2022-11-12  9:03 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Gabriel @ 2022-11-12  8:56 UTC (permalink / raw)
  To: 59212

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

Description:
Not a bug per se, but a suggestion for improvement in how Bookmark
displays the Type (added by commit 7c995264359824cc1aca40ca37201db5ed44e659).

Currently, bookmark-bmenu-list (C-x r l) displays a column named Type,
which has a proper value for all handlers (e.g.: Eshell, VC, EWW etc)
except for regular files, in which an empty string is displayed. I
believe the current behavior could be improved by displaying a default
value ("Files") to make the interface more uniform, explicit and to
avoid confusion.

Steps:
1) emacs -Q
2) M-x eshell
3) C-x r m <RET>
4) C-x C-f ~/foo.bar
5) C-x r m <RET>
6) C-x r b

These steps will add two bookmarks (eshell and foo.bar) and will open
the Bookmarks list. The Type column will have values "" and
"Eshell". After the patch below is applied, the Type column will have
values "File" and "Eshell".


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-default-value-of-bookmark-Type.patch --]
[-- Type: text/x-diff, Size: 1507 bytes --]

From 0d9379e2d470239e2da6369d27979672ab10a719 Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
Date: Sat, 12 Nov 2022 05:13:36 -0300
Subject: [PATCH 1/1] Set default value of bookmark Type

* lisp/bookmark.el (bookmark-type-from-full-record): Return default
  value "File" when type handler is missing.
  (bookmark-bmenu--revert): Remove conditional around type.
---
 lisp/bookmark.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index b57ad12986..ad1a1f1acf 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -372,9 +372,9 @@ bookmark-type-from-full-record
   (let ((handler (bookmark-get-handler bookmark-record)))
     (when (autoloadp (symbol-function handler))
       (autoload-do-load (symbol-function handler)))
-    (if (symbolp handler)
-        (get handler 'bookmark-handler-type)
-     "")))
+    (or (and (symbolp handler)
+             (get handler 'bookmark-handler-type))
+        "File")))
 
 (defun bookmark-all-names ()
   "Return a list of all current bookmark names."
@@ -1889,7 +1889,7 @@ bookmark-bmenu--revert
                                   'follow-link t
                                   'help-echo "mouse-2: go to this bookmark in other window")
                     name)
-                 ,(or type "")
+                 ,type
                  ,@(if bookmark-bmenu-toggle-filenames
                        (list location))])
               entries)))
-- 
2.34.1


[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


---
Gabriel


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-12 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12  8:56 bug#59212: 29.0.50; [PATCH] Set default value of bookmark Type Gabriel
2022-11-12  9:03 ` Eli Zaretskii
2022-11-12 10:10   ` Stefan Kangas
2022-11-12 20:55     ` Gabriel

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.