all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#36391: [PATCH] Improve an error message in bookmark.el
@ 2019-06-26 10:50 Stefan Kangas
  2019-07-06 14:36 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kangas @ 2019-06-26 10:50 UTC (permalink / raw)
  To: 36391

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

The attached patch improves the error message when trying to run
bookmark-load on an invalid file or buffer.

Thanks,
Stefan Kangas

[-- Attachment #2: 0001-Improve-an-error-message-in-bookmark.el.patch --]
[-- Type: application/octet-stream, Size: 952 bytes --]

From 9d99b4737dc7c163fd9f7673315bcd4e92a4239a Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Wed, 26 Jun 2019 12:33:43 +0200
Subject: [PATCH] Improve an error message in bookmark.el

* lisp/bookmark.el (bookmark-alist-from-buffer): Improve error
message.
---
 lisp/bookmark.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 5563ea646c..401e7e04a1 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -655,7 +655,9 @@ bookmark-alist-from-buffer
             (forward-char -1)
             (read (current-buffer)))
         ;; Else no hope of getting information here.
-        (error "Not bookmark format")))))
+        (if buffer-file-name
+            (error "File not in bookmark format: %s" buffer-file-name)
+          (error "Buffer not in bookmark format: %s" (buffer-name)))))))
 
 
 (defun bookmark-upgrade-version-0-alist (old-list)
-- 
2.21.0


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

* bug#36391: [PATCH] Improve an error message in bookmark.el
  2019-06-26 10:50 bug#36391: [PATCH] Improve an error message in bookmark.el Stefan Kangas
@ 2019-07-06 14:36 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-06 14:36 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 36391

Stefan Kangas <stefan@marxist.se> writes:

> The attached patch improves the error message when trying to run
> bookmark-load on an invalid file or buffer.

Makes sense; I've applied it to the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-07-06 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-26 10:50 bug#36391: [PATCH] Improve an error message in bookmark.el Stefan Kangas
2019-07-06 14:36 ` Lars Ingebrigtsen

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.