[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/osm adc8156a70 37/77: README: Add more examples
From: |
ELPA Syncer |
Subject: |
[elpa] externals/osm adc8156a70 37/77: README: Add more examples |
Date: |
Mon, 7 Mar 2022 08:58:06 -0500 (EST) |
branch: externals/osm
commit adc8156a708263ddf202aef5622fcf74bb8e2564
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
README: Add more examples
---
README.org | 2 ++
osm.el | 29 ++++++++++++++++-------------
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/README.org b/README.org
index 58e4cdee18..98adeaebac 100644
--- a/README.org
+++ b/README.org
@@ -34,6 +34,8 @@ Examples:
- [[osm:opentopomap:44.00862011541535,9.99755859375,6][Italia, 44.01° 10.00°
OpenTopoMap]]
- [[osm:51.48950698022105,-0.144195556640625,11][London, England, 51.49°
-0.14°]]
- [[osm:cyclosm:55.686875255964424,12.569732666015625,12][København, Danmark,
55.69° 12.57° CyclOSM]]
+- [[osm:stamen-watercolor:40.72956780913898,-73.97918701171875,12][New York,
United States, 40.73° -73.98° Stamen Watercolor]]
+- [[osm:opentopomap:27.961656050984658,86.89224243164062,13][Mount Everest,
27.96° 86.89° OpenTopoMap]]
In order to retrieve a meaningful name for the current location press ~n~ in
the
~org-mode~ buffer first. Then the buffer is renamed. The links and bookmarks
will
diff --git a/osm.el b/osm.el
index 965b2ebd23..aee90ed706 100644
--- a/osm.el
+++ b/osm.el
@@ -660,26 +660,29 @@ We need two distinct images which are not `eq' for the
display properties.")
(car bm)
(format "*%s*" (car bm))))))
-(defun osm--description ()
+(defun osm--location-name ()
"Return descriptive string for current map."
(message "Fetching location name...")
- (alist-get
- 'display_name
- (json-parse-string
- (shell-command-to-string
- (concat
- "curl -s "
- (shell-quote-argument
- (format
"https://nominatim.openstreetmap.org/reverse?format=json&zoom=%s&lon=%s&lat=%s"
- (min 18 (max 3 osm--zoom)) (osm--lon) (osm--lat)))))
- :array-type 'list
- :object-type 'alist)))
+ (let ((name
+ (alist-get
+ 'display_name
+ (json-parse-string
+ (shell-command-to-string
+ (concat
+ "curl -s "
+ (shell-quote-argument
+ (format
"https://nominatim.openstreetmap.org/reverse?format=json&zoom=%s&lon=%s&lat=%s"
+ (min 18 (max 3 osm--zoom)) (osm--lon) (osm--lat)))))
+ :array-type 'list
+ :object-type 'alist))))
+ (message "%s" (or name "No name found"))
+ name))
;;;###autoload
(defun osm-rename ()
"Rename buffer, use name of current location."
(interactive)
- (when-let (desc (osm--description))
+ (when-let (desc (osm--location-name))
(rename-buffer
(format "*osm: %s, %.2f° %.2f° %s*"
desc (osm--lat) (osm--lon)
- [elpa] externals/osm 5b82b32201 28/77: Add server descriptions, (continued)
- [elpa] externals/osm 5b82b32201 28/77: Add server descriptions, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 832bce78f8 72/77: Implement proper map dragging with the mouse, ELPA Syncer, 2022/03/07
- [elpa] externals/osm df844cd56b 30/77: Add osm-rename command, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 458257fa1f 19/77: Improve tile loading, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 699aae27b1 20/77: Rename osm-new to osm-home, ELPA Syncer, 2022/03/07
- [elpa] externals/osm d830691585 61/77: README: Remove wishlist, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 25621bb80e 41/77: curl add --fail argument, ELPA Syncer, 2022/03/07
- [elpa] externals/osm b300e42d9f 68/77: Add transient pin, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 28d3305bef 32/77: Improve handling of generated names, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 833793ed6c 77/77: Use grid placeholder, ELPA Syncer, 2022/03/07
- [elpa] externals/osm adc8156a70 37/77: README: Add more examples,
ELPA Syncer <=
- [elpa] externals/osm 7ac6f60b90 39/77: README update, ELPA Syncer, 2022/03/07
- [elpa] externals/osm ff5c089087 52/77: Update completion predicates, ELPA Syncer, 2022/03/07
- [elpa] externals/osm d5c5dc6ffd 75/77: Mouse dragging: Check window, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 162f883f80 35/77: Reuse existing buffer, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 9053d8a930 16/77: Indentation, ELPA Syncer, 2022/03/07
- [elpa] externals/osm f2fba2ebdf 43/77: Auto rename the buffers, ELPA Syncer, 2022/03/07
- [elpa] externals/osm b991de6e89 54/77: Rename server, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 03d4ceb553 57/77: Add tile memory cache, ELPA Syncer, 2022/03/07
- [elpa] externals/osm f6c16a4cc4 63/77: Improve keybindings, ELPA Syncer, 2022/03/07
- [elpa] externals/osm 2a0bd8c7eb 50/77: Improve header line, ELPA Syncer, 2022/03/07