all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gabriel <gabriel376@hotmail.com>
To: 59212@debbugs.gnu.org
Subject: bug#59212: 29.0.50; [PATCH] Set default value of bookmark Type
Date: Sat, 12 Nov 2022 05:56:22 -0300	[thread overview]
Message-ID: <SJ0PR06MB8609CD4B8715E9DA35BA90AF8B039@SJ0PR06MB8609.namprd06.prod.outlook.com> (raw)

[-- 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


             reply	other threads:[~2022-11-12  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12  8:56 Gabriel [this message]
2022-11-12  9:03 ` bug#59212: 29.0.50; [PATCH] Set default value of bookmark Type Eli Zaretskii
2022-11-12 10:10   ` Stefan Kangas
2022-11-12 20:55     ` Gabriel

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=SJ0PR06MB8609CD4B8715E9DA35BA90AF8B039@SJ0PR06MB8609.namprd06.prod.outlook.com \
    --to=gabriel376@hotmail.com \
    --cc=59212@debbugs.gnu.org \
    /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.