branch: externals/osm commit ff8ff68b4dc395ea7545e9b669cefc94ee44c249 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Check if bookmarks are present --- osm.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osm.el b/osm.el index a03b75719a..d522bc7d81 100644 --- a/osm.el +++ b/osm.el @@ -777,17 +777,19 @@ xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> (or (assoc (completing-read "Bookmark: " - (cl-loop for bm in bookmark-alist - if (eq (bookmark-prop-get bm 'handler) #'osm-bookmark-jump) - collect (car bm)) + (or (cl-loop for bm in bookmark-alist + if (eq (bookmark-prop-get bm 'handler) #'osm-bookmark-jump) + collect (car bm)) + (error "No bookmarks found")) nil t nil 'bookmark-history) bookmark-alist) (error "No bookmark selected"))) -;;;###autoload (defun osm-bookmark-set () "Create osm bookmark." (interactive) + (unless (eq major-mode #'osm-mode) + (error "Not an osm-mode buffer")) (let* ((def (osm--bookmark-name (osm--location-name "Bookmark"))) (name (read-from-minibuffer "Bookmark name: " def nil nil nil def))) (bookmark-set name)