emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/osm 5c9cbdc655 2/4: Truncate coordinates (See #7)


From: ELPA Syncer
Subject: [elpa] externals/osm 5c9cbdc655 2/4: Truncate coordinates (See #7)
Date: Wed, 16 Mar 2022 22:57:39 -0400 (EDT)

branch: externals/osm
commit 5c9cbdc655ab28c6b44c6600607fd60e3f7dfcfa
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Truncate coordinates (See #7)
---
 README.org | 10 +++++-----
 osm-ol.el  |  2 +-
 osm.el     |  8 +++++---
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index b6e60edc05..8b8d18efbd 100644
--- a/README.org
+++ b/README.org
@@ -74,11 +74,11 @@ Org link examples:
 Elisp link examples:
 
 #+begin_src emacs-lisp
-  (osm 41.869560826994544 12.45849609375 6 opentopomap "Lazio, Italia")
-  (osm 51.48950698022105 -0.144195556640625 11 "London, Greater London, 
England, SW1A 2DX, United Kingdom")
-  (osm 55.686875255964424 12.569732666015625 12 cyclosm "København, Københavns 
Kommune, Region Hovedstaden, 1357, Danmark")
-  (osm 40.72956780913898 -73.97918701171875 12 stamen-watercolor "New York 
County, New York, United States")
-  (osm 27.961656050984658 86.89224243164062 13 opentopomap "Khumjung, 
Khumbupasanglahmu, सोलुखुम्बु, Province #1, Nepal")
+  (osm 41.869561 12.458496 6 opentopomap "Lazio, Italia")
+  (osm 51.489507 -0.144196 11 "London, Greater London, England, SW1A 2DX, 
United Kingdom")
+  (osm 55.686875 12.569733 12 cyclosm "København, Københavns Kommune, Region 
Hovedstaden, 1357, Danmark")
+  (osm 40.729568 -73.979187 12 stamen-watercolor "New York County, New York, 
United States")
+  (osm 27.961656 86.892242 13 opentopomap "Khumjung, Khumbupasanglahmu, 
सोलुखुम्बु, Province #1, Nepal")
 #+end_src
 
 * Commands and Key Bindings
diff --git a/osm-ol.el b/osm-ol.el
index c2f5dee755..6e80e4a06b 100644
--- a/osm-ol.el
+++ b/osm-ol.el
@@ -55,7 +55,7 @@
        :type "osm"
        :description desc
        :link (format
-              "osm:%s%s,%s,%s"
+              "osm:%s%.6f,%.6f,%s"
               (if server (format "%s:" server) "")
               lat lon zoom)))))
 
diff --git a/osm.el b/osm.el
index e78d1a211e..cd164b3301 100644
--- a/osm.el
+++ b/osm.el
@@ -1163,7 +1163,9 @@ xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>
 Optionally specify a SERVER and a COMMENT."
   (ignore comment)
   (when (stringp server) (setq server nil)) ;; Ignore comment
-  `(osm--goto (list ,lat ,lon ,zoom) ,(and (symbolp server) `',server)))
+  `(progn
+    (osm--goto (list ,lat ,lon ,zoom) ,(and server (symbolp server) `',server))
+    '(osm ,lat ,lon ,zoom ,@(and server (symbolp server) (list server)))))
 
 ;;;###autoload
 (defun osm-bookmark-jump (bm)
@@ -1399,11 +1401,11 @@ Optionally specify a SERVER and a COMMENT."
   "Store coordinates as an Elisp link in the kill ring."
   (interactive)
   (pcase-let* ((`(,lat ,lon ,name) (osm--location-data 'osm-org-link "Elisp 
link"))
-               (link (format "(osm %s %s %s%s%s)"
+               (link (format "(osm %.6f %.6f %s%s%s)"
                              lat lon osm--zoom
                              (if (eq osm-server (default-value 'osm-server))
                                  ""
-                               (format " '%s" osm-server))
+                               (format " %s" osm-server))
                              (if name (format " %S" name) ""))))
     (kill-new link)
     (message "Stored link in the kill ring")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]