branch: externals/activities
commit 235387745673bbcd8a1b9eccd9d211fdc53cc548
Author: Adam Porter <a...@alphapapa.net>
Commit: Adam Porter <a...@alphapapa.net>

    Change: (activities--bookmark-buffer) Improve error
    
    This is much better.
---
 README.org    | 1 +
 activities.el | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 81eb4333df..fdbfb6a4d1 100644
--- a/README.org
+++ b/README.org
@@ -151,6 +151,7 @@ When option ~activities-bookmark-store~ is enabled, an 
Emacs bookmark is stored
 
 *Changes*
 + Command ~activities-new~ renamed to ~activities-define~, with new binding 
~C-x C-a C-d~.  (See 
[[https://github.com/alphapapa/activities.el/issues/46][#46]].)
++ Improve error message when jumping to a buffer's bookmark signals an error.
 
 *Fixes*
 + Suspending/killing an activity when only one frame/tab is open.
diff --git a/activities.el b/activities.el
index 34443a2334..2e591718c3 100644
--- a/activities.el
+++ b/activities.el
@@ -750,6 +750,7 @@ activity's name is NAME."
   (with-temp-buffer
     (pcase-let* (((cl-struct activities-buffer bookmark) struct)
                  (temp-buffer (current-buffer))
+                 (error)
                  (jumped-to-buffer
                   (save-window-excursion
                     (condition-case err
@@ -759,8 +760,7 @@ activity's name is NAME."
                                       (bookmark-prop-get bookmark 
'activities-buffer-local-variables)))
                             (cl-loop for (variable . value) in 
local-variable-map
                                      do (setf (buffer-local-value variable 
(current-buffer)) value))))
-                      (error (delay-warning 'activity
-                                            (format "Error while opening 
bookmark: ERROR:%S  RECORD:%S" err struct))))
+                      (error (setf error (format "Error while opening 
bookmark: ERROR:%S  RECORD:%S" err struct))))
                     (current-buffer))))
       (if (not (eq temp-buffer jumped-to-buffer))
           ;; Bookmark appears to have been jumped to: return that buffer.
@@ -770,6 +770,7 @@ activity's name is NAME."
          (format "%s:%s" (car bookmark) (bookmark-prop-get bookmark 'filename))
          (list "Activities was unable to get a buffer for bookmark:\n\n"
               (prin1-to-string bookmark) "\n\n"
+               "Error: " (prin1-to-string error) "\n\n"
               "It's likely that the bookmark's file no longer exists, in which 
case you may need to relocate it and redefine this activity.\n\n"
                "If this is not the case, please report this error to the 
`activities' maintainer.\n\n"
                "In the meantime, you may ignore this error and use the other 
buffers in the activity.\n\n"))))))

Reply via email to