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

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

[elpa] externals/osm 161782da07: Introduce osm-prefix-map to simplify co


From: ELPA Syncer
Subject: [elpa] externals/osm 161782da07: Introduce osm-prefix-map to simplify configuration
Date: Wed, 17 May 2023 22:59:30 -0400 (EDT)

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

    Introduce osm-prefix-map to simplify configuration
---
 CHANGELOG.org |  4 ++++
 README.org    | 29 +++++++++--------------------
 osm.el        | 19 +++++++++++++------
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index 16f8970d7e..82345b4a16 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -2,6 +2,10 @@
 #+author: Daniel Mendler
 #+language: en
 
+* Development
+
+- Provide =osm-prefix-map=.
+
 * Version 0.12 (2023-05-01)
 
 - Autoload bugfix for Emacs 27
diff --git a/README.org b/README.org
index c45705a002..a653cf4697 100644
--- a/README.org
+++ b/README.org
@@ -47,12 +47,7 @@ Please take a look at the 
[[https://github.com/minad/osm/wiki][wiki]] for additi
 
 #+begin_src emacs-lisp
   (use-package osm
-    :bind (("C-c m h" . osm-home)
-           ("C-c m s" . osm-search)
-           ("C-c m v" . osm-server)
-           ("C-c m t" . osm-goto)
-           ("C-c m x" . osm-gpx-show)
-           ("C-c m j" . osm-bookmark-jump))
+    :bind ("C-c m" . osm-prefix-map) ;; Alternative: `osm-home'
 
     :custom
     ;; Take a look at the customization group `osm' for more options.
@@ -113,15 +108,15 @@ Elisp s-expressions they can be easily manipulated 
programatically.
 
 * Commands and Key Bindings
 
-Top-level commands:
-- =osm-home=: Open new map at home coordinates
-- =osm-search=: Search and jump to location
-- =osm-goto=: Go to coordinates
-- =osm-server=: Select server
-- =osm-bookmark-jump=: Jump to bookmark
-- =osm-gpx-show=: Show GPX file in map viewer
+Top-level commands in =osm-prefix-map=:
+- ~h~: =osm-home= - Open new map at home coordinates
+- ~s~: =osm-search= - Search and jump to location
+- ~t~: =osm-goto= - Go to coordinates
+- ~v~: =osm-server= - Select server
+- ~j~: =osm-bookmark-jump= - Jump to bookmark
+- ~x~: =osm-gpx-show= - Show GPX file in map viewer
 
-Key bindings in =osm-mode= buffer:
+Additional key bindings in =osm-mode= buffer:
 - ~<arrow>~: Small step scrolling
 - ~C-<arrow>~, ~M-<arrow>~: Large step scrolling
 - ~+~, ~SPC~: =osm-zoom-in= - Zoom in
@@ -132,18 +127,12 @@ Key bindings in =osm-mode= buffer:
 - ~<osm-bookmark mouse-*>~: =osm-bookmark-delete-click= - Click on bookmark at 
point to delete
 - ~<down-mouse-*>~: =osm-mouse-drag= - Drag the map with the mouse
 - ~d~, ~DEL~: =osm-bookmark-delete= - Delete selected bookmark
-- ~t~: =osm-goto= - Go to location
 - ~c~: =osm-center= - Center to currently marked pin
-- ~h~: =osm-home= - Go to home location
-- ~s~: =osm-search= - Search for location
-- ~v~: =osm-server= - Select tile server
-- ~x~: =osm-gpx-show= - Show tracks and POIs from GPX file
 - ~X~: =osm-gpx-hide= - Hide overlays from GPX file
 - ~l~: =org-store-link= - Store Org link
 - ~u~: =osm-save-url= - Save geo url in the kill ring
 - ~b~: =osm-bookmark-set= - Set bookmark
 - ~n~: =osm-bookmark-rename= - Rename selected bookmark
-- ~j~: =osm-bookmark-jump= - Jump to bookmark
 - ~q~: =quit-window= - Close buffer and window
 - ~o~: =clone-buffer= - Clone buffer
 
diff --git a/osm.el b/osm.el
index 8601b5f1c3..81d6167ca5 100644
--- a/osm.el
+++ b/osm.el
@@ -245,8 +245,21 @@ Should be at least 7 days according to the server usage 
policies."
           menu)
         name))))
 
+(defvar-keymap osm-prefix-map
+  :doc "Global prefix map of OSM entry points."
+  "h" #'osm-home
+  "s" #'osm-search
+  "v" #'osm-server
+  "t" #'osm-goto
+  "x" #'osm-gpx-show
+  "j" #'osm-bookmark-jump)
+
+;;;###autoload (autoload 'osm-prefix-map "osm" nil t 'keymap)
+(defalias 'osm-prefix-map osm-prefix-map)
+
 (defvar-keymap osm-mode-map
   :doc "Keymap used by `osm-mode'."
+  :parent (make-composed-keymap osm-prefix-map special-mode-map)
   "<osm-home>" #'ignore
   "<osm-link>" #'ignore
   "<osm-transient>" #'ignore
@@ -289,15 +302,9 @@ Should be at least 7 days according to the server usage 
policies."
   "DEL" #'osm-bookmark-delete
   "c" #'osm-center
   "o" #'clone-buffer
-  "h" #'osm-home
-  "t" #'osm-goto
-  "s" #'osm-search
-  "v" #'osm-server
   "u" #'osm-save-url
   "l" 'org-store-link
   "b" #'osm-bookmark-set
-  "j" #'osm-bookmark-jump
-  "x" #'osm-gpx-show
   "X" #'osm-gpx-hide
   "<remap> <scroll-down-command>" #'osm-down
   "<remap> <scroll-up-command>" #'osm-up



reply via email to

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