[nongnu] elpa/cider 02ca530216 1/2: Release CIDER 1.3 ("Ukraine")

2022-03-07 Thread ELPA Syncer
branch: elpa/cider
commit 02ca53021682f426323dc7bb4e6b28e6c8f5eb30
Author: Bozhidar Batsov 
Commit: Bozhidar Batsov 

Release CIDER 1.3 ("Ukraine")
---
 CHANGELOG.md   | 2 ++
 doc/antora.yml | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 91c5680da0..f378918ab6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
 
 ## master (unreleased)
 
+## 1.3.0 (2021-03-07)
+
 ### New features
 
 * [#3148](https://github.com/clojure-emacs/cider/pull/3148): Display error 
messages in multiline comment eval results, and in result overlays when 
`cider-show-error-buffer` is set to `nil`.
diff --git a/doc/antora.yml b/doc/antora.yml
index e0fdfc22bb..5c143ec226 100644
--- a/doc/antora.yml
+++ b/doc/antora.yml
@@ -2,6 +2,6 @@ name: cider
 title: CIDER
 # We always provide version without patch here (e.g. 1.1),
 # as patch versions should not appear in the docs.
-version: "master"
+version: "1.3"
 nav:
 - modules/ROOT/nav.adoc



[nongnu] elpa/cider 64cdcd468b 2/2: Switch back the docs version

2022-03-07 Thread ELPA Syncer
branch: elpa/cider
commit 64cdcd468b72d7ffad398e0cdfcec30181e01608
Author: Bozhidar Batsov 
Commit: Bozhidar Batsov 

Switch back the docs version
---
 doc/antora.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/antora.yml b/doc/antora.yml
index 5c143ec226..fd9dacd593 100644
--- a/doc/antora.yml
+++ b/doc/antora.yml
@@ -2,6 +2,6 @@ name: cider
 title: CIDER
 # We always provide version without patch here (e.g. 1.1),
 # as patch versions should not appear in the docs.
-version: "1.3"
+version: ~
 nav:
 - modules/ROOT/nav.adoc



[elpa] externals/compat updated (bff40c376e -> 8157a68136)

2022-03-07 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  bff40c376e Include compat-defvar in the merged compat.el compilation
   new  1604b929be Improve parsing of RGBi color specification
   new  8157a68136 Use should-error in compat--expect instead of 
condition-case


Summary of changes:
 compat-28.el| 108 +++-
 compat-tests.el |  13 ++-
 2 files changed, 63 insertions(+), 58 deletions(-)



[elpa] externals/compat 8157a68136 2/2: Use should-error in compat--expect instead of condition-case

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 8157a681365b1913ad02efeed43917c364770fbb
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Use should-error in compat--expect instead of condition-case
---
 compat-tests.el | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 24fb5b50a4..accad4cb8a 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -88,11 +88,7 @@ being compared against."
   :name ',real-test
   :tags '(,name)
   :body (lambda ()
-  (condition-case nil
-  (progn
-(,name ,@args)
-(ert-fail :fail-reason "did not signal an 
error"))
-(,code t)))
+  (should-error (,name ,@args) :type ,code))
  (and (fboundp compat)
   `(ert-set-test
 ',comp-test
@@ -100,11 +96,7 @@ being compared against."
  :name ',comp-test
  :tags '(,name)
  :body (lambda ()
- (condition-case nil
- (progn
-   (,compat ,@args)
-   (ert-fail :fail-reason "did not signal an 
error"))
-   (,code t)))
+ (should-error (,compat ,@args) :type 
,code))
 
 (defmacro compat-deftest (name &rest body)
   "Test NAME in BODY."



[elpa] externals/compat 1604b929be 1/2: Improve parsing of RGBi color specification

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 1604b929be0bad0368b6e47fe12d0e3d00879731
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Improve parsing of RGBi color specification
---
 compat-28.el| 108 +++-
 compat-tests.el |   1 +
 2 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/compat-28.el b/compat-28.el
index 895136b106..b31dbb0b42 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -260,54 +260,66 @@ If SPEC is not in one of the above forms, return nil.
 
 Each of the 3 integer members of the resulting list, RED, GREEN,
 and BLUE, is normalized to have its value in [0,65535]."
-  (save-match-data
-(cond
- ((string-match
-   ;; (rx bos "#"
-   ;; (or (: (group-n 1 (= 1 hex)) (group-n 2 (= 1 hex)) (group-n 3 (= 
1 hex)))
-   ;; (: (group-n 1 (= 2 hex)) (group-n 2 (= 2 hex)) (group-n 3 (= 
2 hex)))
-   ;; (: (group-n 1 (= 3 hex)) (group-n 2 (= 3 hex)) (group-n 3 (= 
3 hex)))
-   ;; (: (group-n 1 (= 4 hex)) (group-n 2 (= 4 hex)) (group-n 3 (= 
4 hex
-   ;; eos)
-   
"\\`#\\(?:\\(?1:[[:xdigit:]]\\{1\\}\\)\\(?2:[[:xdigit:]]\\{1\\}\\)\\(?3:[[:xdigit:]]\\{1\\}\\)\\|\\(?1:[[:xdigit:]]\\{2\\}\\)\\(?2:[[:xdigit:]]\\{2\\}\\)\\(?3:[[:xdigit:]]\\{2\\}\\)\\|\\(?1:[[:xdigit:]]\\{3\\}\\)\\(?2:[[:xdigit:]]\\{3\\}\\)\\(?3:[[:xdigit:]]\\{3\\}\\)\\|\\(?1:[[:xdigit:]]\\{4\\}\\)\\(?2:[[:xdigit:]]\\{4\\}\\)\\(?3:[[:xdigit:]]\\{4\\}\\)\\)\\'"
-   spec)
-  (let ((max (1- (ash 1 (* (- (match-end 1) (match-beginning 1)) 4)
-(list (/ (* (string-to-number (match-string 1 spec) 16) 65535) max)
-  (/ (* (string-to-number (match-string 2 spec) 16) 65535) max)
-  (/ (* (string-to-number (match-string 3 spec) 16) 65535) max
- ((string-match
-   ;; (rx bos "rgb:"
-   ;; (group (** 1 4 hex)) "/"
-   ;; (group (** 1 4 hex)) "/"
-   ;; (group (** 1 4 hex))
-   ;; eos)
-   
"\\`rgb:\\([[:xdigit:]]\\{1,4\\}\\)/\\([[:xdigit:]]\\{1,4\\}\\)/\\([[:xdigit:]]\\{1,4\\}\\)\\'"
-   spec)
-  (list (/ (* (string-to-number (match-string 1 spec) 16) 65535)
-   (1- (ash 1 (* (- (match-end 1) (match-beginning 1)) 4
-(/ (* (string-to-number (match-string 2 spec) 16) 65535)
-   (1- (ash 1 (* (- (match-end 2) (match-beginning 2)) 4
-(/ (* (string-to-number (match-string 3 spec) 16) 65535)
-   (1- (ash 1 (* (- (match-end 3) (match-beginning 3)) 4))
- ((string-match
-   ;; (rx bos "rgbi:" (* space)
-   ;; (group (or (: "0" (? "." (* digit)))
-   ;;(: "." (+ digit))
-   ;;(: "1" (? "." (* "0")
-   ;; "/" (* space)
-   ;; (group (or (: "0" (? "." (* digit)))
-   ;;(: "." (+ digit))
-   ;;(: "1" (? "." (* "0")
-   ;; "/" (* space)
-   ;; (group (or (: "0" (? "." (* digit)))
-   ;;(: "." (+ digit))
-   ;;(: "1" (? "." (* "0")
-   ;; eos)
-   
"\\`rgbi:[[:space:]]*\\(0\\(?:\\.[[:digit:]]*\\)?\\|\\.[[:digit:]]+\\|1\\(?:\\.0*\\)?\\)/[[:space:]]*\\(0\\(?:\\.[[:digit:]]*\\)?\\|\\.[[:digit:]]+\\|1\\(?:\\.0*\\)?\\)/[[:space:]]*\\(0\\(?:\\.[[:digit:]]*\\)?\\|\\.[[:digit:]]+\\|1\\(?:\\.0*\\)?\\)\\'"
-   spec)
-  (list (round (* (string-to-number (match-string 1 spec)) 65535))
-(round (* (string-to-number (match-string 2 spec)) 65535))
-(round (* (string-to-number (match-string 3 spec)) 65535)))
+  (let ((case-fold-search nil))
+(save-match-data
+  (cond
+   ((string-match
+ ;; (rx bos "#"
+ ;; (or (: (group-n 1 (= 1 hex)) (group-n 2 (= 1 hex)) (group-n 3 
(= 1 hex)))
+ ;; (: (group-n 1 (= 2 hex)) (group-n 2 (= 2 hex)) (group-n 3 
(= 2 hex)))
+ ;; (: (group-n 1 (= 3 hex)) (group-n 2 (= 3 hex)) (group-n 3 
(= 3 hex)))
+ ;; (: (group-n 1 (= 4 hex)) (group-n 2 (= 4 hex)) (group-n 3 
(= 4 hex
+ ;; eos)
+ 
"\\`#\\(?:\\(?1:[[:xdigit:]]\\{1\\}\\)\\(?2:[[:xdigit:]]\\{1\\}\\)\\(?3:[[:xdigit:]]\\{1\\}\\)\\|\\(?1:[[:xdigit:]]\\{2\\}\\)\\(?2:[[:xdigit:]]\\{2\\}\\)\\(?3:[[:xdigit:]]\\{2\\}\\)\\|\\(?1:[[:xdigit:]]\\{3\\}\\)\\(?2:[[:xdigit:]]\\{3\\}\\)\\(?3:[[:xdigit:]]\\{3\\}\\)\\|\\(?1:[[:xdigit:]]\\{4\\}\\)\\(?2:[[:xdigit:]]\\{4\\}\\)\\(?3:[[:xdigit:]]\\{4\\}\\)\\)\\'"
+ spec)
+(let ((max (1- (ash 1 (* (- (match-end 1) (match-beginning 1)) 4)
+  (list (/ (* (string-to-number (match-string 1 spec) 16) 65535) max)
+(/ (* (string-to-number (match-string 2 spec) 16) 65535) max)
+(/ (* (string-to-number (match-string 3 spec) 16) 65535) 
max
+   ((string-match
+ ;; (rx bos "rgb:"
+ ;; (group (** 1 4 hex)) "/"
+ ;; (group (** 1 4 hex)) "/"
+ ;; (group (*

[elpa] externals/compat 088067747c: Exclude compat.texi from ELPA package

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 088067747c6fe56728dadf4ff735b6ad9c8c4cb7
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Exclude compat.texi from ELPA package
---
 .elpaignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.elpaignore b/.elpaignore
index 0767134b2a..3c4929e1a0 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -5,3 +5,4 @@ Makefile
 .elpaignore
 COPYING
 README.md
+compat.texi
\ No newline at end of file



[elpa] externals/compat updated (088067747c -> 7065f2d077)

2022-03-07 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  088067747c Exclude compat.texi from ELPA package
   new  302085d0b3 Change Maintainer name
   new  59a7dad8a2 Add "Maintainer" and "URL" headers to remaining files
   new  7065f2d077 Improve quality of the exported manual


Summary of changes:
 MANUAL   | 23 +--
 compat-24.el |  2 ++
 compat-25.el |  2 ++
 compat-26.el |  2 ++
 compat-27.el |  2 ++
 compat-28.el |  2 ++
 compat.el|  2 +-
 7 files changed, 28 insertions(+), 7 deletions(-)



[elpa] externals/compat 7065f2d077 3/3: Improve quality of the exported manual

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 7065f2d077aa50c0bfddfdc1d1b668a955ac4d39
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Improve quality of the exported manual
---
 MANUAL | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/MANUAL b/MANUAL
index b4577489ac..63a308daf6 100644
--- a/MANUAL
+++ b/MANUAL
@@ -1,11 +1,18 @@
-#  -*- mode: org; -*-
-#+title:   "compat" Manual
-#+author:  Philip Kaludercic
-#+texinfo_filename:compat.info
+#   -*- mode: org; -*-
+#+title:"compat" Manual
+#+subtitle: For version {{{version}}}
+#+author:   Philip Kaludercic
+#+email:~pkal/compat-de...@lists.sr.ht
+#+texinfo_filename: compat.info
+#+texinfo_dir_category: Emacs
+#+texinfo_dir_title:compat: (compat)
+#+texinfo_dir_desc: Compatibility Library for Emacs Lisp
+
+#+macro: version 28.1.0.0
 
 This manual documents the usage of the "compat" Emacs lisp library,
 the forward-compatibility library for Emacs Lisp, corresponding to
-version 28.1.0.0.
+version {{{version}}}.
 
 #+texinfo: @insertcopying
 
@@ -429,7 +436,11 @@ to have signed the 
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/C
 contribution (roughly 15 lines of code) can be applied.
 
 * Distribution
-Copyright (C) 2022  Free Software Foundation, Inc.
+:PROPERTIES:
+:COPYING: t
+:END:
+
+Copyright \copy 2022  Free Software Foundation, Inc.
 
 #+begin_quote
 Permission is granted to copy, distribute and/or modify this document



[elpa] externals/compat 59a7dad8a2 2/3: Add "Maintainer" and "URL" headers to remaining files

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 59a7dad8a2e27d074568a62ce2efd3873a0d90e5
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add "Maintainer" and "URL" headers to remaining files
---
 compat-24.el | 2 ++
 compat-25.el | 2 ++
 compat-26.el | 2 ++
 compat-27.el | 2 ++
 compat-28.el | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/compat-24.el b/compat-24.el
index 933d9c741d..ec4f08d695 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -3,6 +3,8 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
+;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
+;; URL: https://git.sr.ht/~pkal/compat/
 ;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify
diff --git a/compat-25.el b/compat-25.el
index d7297b38fa..713ebf2766 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -3,6 +3,8 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
+;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
+;; URL: https://git.sr.ht/~pkal/compat/
 ;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify
diff --git a/compat-26.el b/compat-26.el
index 07a338c286..097842b7b5 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -3,6 +3,8 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
+;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
+;; URL: https://git.sr.ht/~pkal/compat/
 ;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify
diff --git a/compat-27.el b/compat-27.el
index 2106d6924e..94cf2d4eae 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -3,6 +3,8 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
+;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
+;; URL: https://git.sr.ht/~pkal/compat/
 ;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify
diff --git a/compat-28.el b/compat-28.el
index b31dbb0b42..60e3fa4999 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -3,6 +3,8 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
+;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
+;; URL: https://git.sr.ht/~pkal/compat/
 ;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify



[elpa] externals/compat 302085d0b3 1/3: Change Maintainer name

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 302085d0b38b4e455cfa5ff084fe91810976615b
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Change Maintainer name
---
 compat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat.el b/compat.el
index 0e44a19ed5..8f54c6b591 100644
--- a/compat.el
+++ b/compat.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Kaludercic 
-;; Maintainer: Philip Kaludercic <~pkal/compat-de...@lists.sr.ht>
+;; Maintainer: Compat Development <~pkal/compat-de...@lists.sr.ht>
 ;; Version: 28.1.0.0-rc
 ;; URL: https://git.sr.ht/~pkal/compat/
 ;; Package-Requires: ((emacs "24.1") (nadvice "0.3"))



[elpa] main df11c7dccf: * elpa-packages (osm): New package

2022-03-07 Thread Stefan Monnier via
branch: main
commit df11c7dccfe9cffc453522f5bc2af6c9db937aaf
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (osm): New package
---
 elpa-packages | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index c0358a72f6..feb77af987 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -428,6 +428,9 @@
  ("orgalist":url nil)
  ("org-edna"   :url "bzr::https://bzr.savannah.gnu.org/r/org-edna-el";) 
;URL?
  ("osc":url nil)
+ ("osm":url "https://github.com/minad/osm";
+  :auto-sync t
+  :ignored-files ("LICENSE"))
  ("other-frame-window" :url nil)
  ("paced"  :url 
"bzr::bzr://bzr.savannah.nongnu.org/paced-el/trunk")
  ("pabbrev" :url "https://github.com/phillord/pabbrev.git";)



[elpa] externals/osm 42b9222e93 06/77: Make download slightly more robust

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 42b9222e932ef929a056d0d70fdcfd9e80ae6611
Author: Daniel Mendler 
Commit: Daniel Mendler 

Make download slightly more robust
---
 osm.el | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/osm.el b/osm.el
index dc4ab977d7..9c220063b8 100644
--- a/osm.el
+++ b/osm.el
@@ -194,26 +194,28 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (osm--server-property :max-connections)))
   (pop osm--queue))
 (`(,x ,y . ,zoom)
- (let ((buffer (current-buffer)))
+ (let* ((buffer (current-buffer))
+(dst (osm--tile-file x y zoom))
+(tmp (concat dst ".tmp")))
(push
 (make-process
  :name (format "osm %s %s %s" x y zoom)
  :connection-type 'pipe
  :noquery t
  :command
- (list "curl" "-s" "-o"
-   (osm--tile-file x y zoom)
-   (osm--tile-url x y zoom))
+ (list "curl" "-s" "-o" tmp (osm--tile-url x y zoom))
  :filter #'ignore
  :sentinel
  (lambda (proc status)
(when (buffer-live-p buffer)
  (with-current-buffer buffer
-   (setq osm--active (delq proc osm--active))
(when (and (string-match-p "finished" status)
   (eq osm--zoom zoom))
+ (rename-file tmp dst t)
  (osm--put x y))
+   (delete-file tmp)
(force-mode-line-update)
+   (setq osm--active (delq proc osm--active))
(osm--download)
 osm--active)
(osm--download)
@@ -327,7 +329,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (run-with-idle-timer
  30 nil
  (lambda ()
-   (dolist (file (directory-files-recursively osm-tile-cache "\\.png\\'" 
nil))
+   (dolist (file (directory-files-recursively osm-tile-cache 
"\\.png\\(?:\\.tmp\\)?\\'" nil))
  (when (> (float-time
(time-since
 (file-attribute-modification-time



[elpa] externals/osm 21e59942a9 15/77: Handle mouse drag event

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 21e59942a9dcbfdbb790341798bec79bec898710
Author: Daniel Mendler 
Commit: Daniel Mendler 

Handle mouse drag event
---
 osm.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/osm.el b/osm.el
index a281c2feff..0cc50e41e4 100644
--- a/osm.el
+++ b/osm.el
@@ -121,6 +121,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "+" #'osm-larger)
 (define-key map "-" #'osm-smaller)
 (define-key map [mouse-1] #'osm-click)
+(define-key map [drag-mouse-1] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
 (define-key map [left] #'osm-left)
@@ -300,6 +301,15 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (cl-incf osm--y (- y osm--wy))
   (osm-larger
 
+(defun osm-drag (event)
+  "Handle drag EVENT."
+  (interactive "e")
+  (pcase-let ((`(,sx . ,sy) (posn-x-y (event-start event)))
+  (`(,ex . ,ey) (posn-x-y (event-end event
+(cl-incf osm--x (- sx ex))
+(cl-incf osm--y (- sy ey))
+(osm--update)))
+
 (defun osm-larger (&optional n)
   "Zoom N times into the map."
   (interactive "p")



[elpa] externals/osm e7f38427ca 05/77: Document all variables

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit e7f38427caf242fb675f5c03d8edc5064f8657a4
Author: Daniel Mendler 
Commit: Daniel Mendler 

Document all variables
---
 osm.el | 50 --
 1 file changed, 36 insertions(+), 14 deletions(-)

diff --git a/osm.el b/osm.el
index d2fcbe2feb..dc4ab977d7 100644
--- a/osm.el
+++ b/osm.el
@@ -84,20 +84,42 @@ Should be at least 7 days according to the server usage 
policies."
 
 (defconst osm--placeholder1
   `(image :type xbm :width 256 :height 256 :background nil
-  :data ,(make-bool-vector (* 256 256) nil)))
-(defconst osm--placeholder2 (copy-sequence osm--placeholder1))
-
-(defvar osm--search-history nil)
-
-(defvar osm--clean-cache 0)
-(defvar-local osm--url-index 0)
-(defvar-local osm--queue nil)
-(defvar-local osm--active nil)
-(defvar-local osm--width 0)
-(defvar-local osm--height 0)
-(defvar-local osm--zoom nil)
-(defvar-local osm--x nil)
-(defvar-local osm--y nil)
+  :data ,(make-bool-vector (* 256 256) nil))
+  "First placeholder image for tiles.")
+
+(defconst osm--placeholder2 `(image ,@(cdr osm--placeholder1))
+  "Second placeholder image for tiles.
+We need two distinct images which are not `eq' for the display properties.")
+
+(defvar osm--search-history nil
+  "Minibuffer search history used by `osm-search'.")
+
+(defvar osm--clean-cache 0
+  "Last time the tile cache was cleaned.")
+
+(defvar-local osm--url-index 0
+  "Current url index to query the servers in a round-robin fashion.")
+
+(defvar-local osm--queue nil
+  "Download queue of tiles.")
+
+(defvar-local osm--active nil
+  "Active download jobs.")
+
+(defvar-local osm--width 0
+  "Window width in units of the tile size.")
+
+(defvar-local osm--height 0
+  "Window height in units of the tile size.")
+
+(defvar-local osm--zoom nil
+  "Zoom level of the map.")
+
+(defvar-local osm--x nil
+  "Y coordinate on the map in pixel.")
+
+(defvar-local osm--y nil
+  "X coordinate on the map in pixel.")
 
 (defun osm--bb-to-zoom (lat1 lat2 lon1 lon2)
   "Compute zoom level from boundingbox LAT1 to LAT2 and LON1 to LON2."



[elpa] externals/osm 85aa864f25 14/77: Zoom with mouse click

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 85aa864f25d6a8689d2bb48560c5395996ef6ea3
Author: Daniel Mendler 
Commit: Daniel Mendler 

Zoom with mouse click
---
 README.org |  2 +-
 osm.el | 59 ++-
 2 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/README.org b/README.org
index 9e66c6efde..5d0d3de2c8 100644
--- a/README.org
+++ b/README.org
@@ -15,7 +15,7 @@
 
 - Parallel fetching of tiles via curl
 - Scrolling in large and small steps
-- Zooming
+- Zooming with keys or with mouse click
 - Map scale indicator
 - Jump to coordinate
 - Search for location by name
diff --git a/osm.el b/osm.el
index 7426e0c15a..a281c2feff 100644
--- a/osm.el
+++ b/osm.el
@@ -120,6 +120,7 @@ Should be at least 7 days according to the server usage 
policies."
   (let ((map (make-sparse-keymap)))
 (define-key map "+" #'osm-larger)
 (define-key map "-" #'osm-smaller)
+(define-key map [mouse-1] #'osm-click)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
 (define-key map [left] #'osm-left)
@@ -171,11 +172,17 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defvar-local osm--active nil
   "Active download jobs.")
 
-(defvar-local osm--width 0
-  "Window width in units of the tile size.")
+(defvar-local osm--wx 0
+  "Half window width in pixel.")
 
-(defvar-local osm--height 0
-  "Window height in units of the tile size.")
+(defvar-local osm--wy 0
+  "Half window height in pixel.")
+
+(defvar-local osm--nx 0
+  "Number of tiles in x diretion.")
+
+(defvar-local osm--ny 0
+  "Number of tiles in y direction.")
 
 (defvar-local osm--zoom nil
   "Zoom level of the map.")
@@ -186,7 +193,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defvar-local osm--y nil
   "X coordinate on the map in pixel.")
 
-(defun osm--bb-to-zoom (lat1 lat2 lon1 lon2)
+(defun osm--boundingbox-to-zoom (lat1 lat2 lon1 lon2)
   "Compute zoom level from boundingbox LAT1 to LAT2 and LON1 to LON2."
   (let ((w (/ (frame-pixel-width) 256))
 (h (/ (frame-pixel-height) 256)))
@@ -284,6 +291,15 @@ We need two distinct images which are not `eq' for the 
display properties.")
 osm--active)
(osm--download)
 
+(defun osm-click (event)
+  "Handle click EVENT."
+  (interactive "e")
+  (pcase-let ((`(,x . ,y) (posn-x-y (event-start event
+(when (< osm--zoom (osm--server-property :max-zoom))
+  (cl-incf osm--x (- x osm--wx))
+  (cl-incf osm--y (- y osm--wy))
+  (osm-larger
+
 (defun osm-larger (&optional n)
   "Zoom N times into the map."
   (interactive "p")
@@ -397,13 +413,12 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--put (x y &optional image)
   "Put tile IMAGE at X/Y."
-  (let* ((i (+ x (- (/ osm--x 256)) (/ (1- osm--width) 2)))
- (j (+ y (- (/ osm--y 256)) (/ (1- osm--height) 2)))
- (mx (if (= 0 i) (mod osm--x 256) 0))
- (my (if (= 0 j) (mod osm--y 256) 0))
- (pos (+ (point-min) (* j (1+ osm--width)) i)))
-(when (and (>= i 0) (< i osm--width)
-   (>= j 0) (< j osm--height))
+  (let* ((i (- x (/ (- osm--x osm--wx) 256)))
+ (j (- y (/ (- osm--y osm--wy) 256)))
+ (mx (if (= 0 i) (mod (- osm--x osm--wx) 256) 0))
+ (my (if (= 0 j) (mod (- osm--y osm--wy) 256) 0))
+ (pos (+ (point-min) (* j (1+ osm--nx)) i)))
+(when (and (>= i 0) (< i osm--nx) (>= j 0) (< j osm--ny))
   (unless image
 (let ((file (osm--tile-file x y osm--zoom)))
   (setq image
@@ -466,16 +481,18 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (if (>= meter 1000) (/ meter 1000) meter)
 (if (>= meter 1000) "km" "m"))
 '(:eval (osm--queue-info
-  (setq osm--height (1+ (ceiling (window-pixel-height) 256))
-osm--width (1+ (ceiling (window-pixel-width) 256)))
+  (setq osm--wx (/ (window-pixel-width) 2)
+osm--wy (/ (window-pixel-height) 2)
+osm--nx (1+ (ceiling (window-pixel-width) 256))
+osm--ny (1+ (ceiling (window-pixel-height) 256)))
   (erase-buffer)
-  (dotimes (_j osm--height)
-(insert (concat (make-string osm--width ?\s) "\n")))
+  (dotimes (_j osm--ny)
+(insert (concat (make-string osm--nx ?\s) "\n")))
   (goto-char (point-min))
-  (dotimes (j osm--height)
-(dotimes (i osm--width)
-  (let ((x (+ i (/ osm--x 256) (- (/ (1- osm--width) 2
-(y (+ j (/ osm--y 256) (- (/ (1- osm--height) 2
+  (dotimes (j osm--ny)
+(dotimes (i osm--nx)
+  (let ((x (+ i (/ (- osm--x osm--wx) 256)))
+(y (+ j (/ (- osm--y osm--wy) 256)))
 (placeholder (if (= 0 (mod i 2)) osm--placeholder1 
osm--placeholder2)))
 (if (and (>= x 0) (>= y 0) (< x size) (< y size))
 (if (file-exis

[elpa] externals/osm b259afaed2 18/77: Add osm-server to switch the server

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit b259afaed2b5541e1b6195db223068e3e2e7d4c1
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add osm-server to switch the server
---
 README.org |  3 +++
 osm.el | 81 +++---
 2 files changed, 59 insertions(+), 25 deletions(-)

diff --git a/README.org b/README.org
index 5d0d3de2c8..68bab80c9e 100644
--- a/README.org
+++ b/README.org
@@ -21,6 +21,7 @@
 - Search for location by name
 - Org link support (Example: [[osm:44,10,6][Toscana, Italia 44° 10°]])
 - Bookmarks
+- Multiple preconfigured servers
 
 * Commands and Key Bindings
 
@@ -28,6 +29,7 @@ Commands:
 - =osm-new=: Open new map at home coordinates
 - =osm-search=: Search and jump to location
 - =osm-goto=: Go to coordinates
+- =osm-server=: Select server
 
 Key bindings:
 - ~+~ and ~-~: Zooming
@@ -35,6 +37,7 @@ Key bindings:
 - ~C-~, ~M-~: Large step scrolling
 - ~g~: =osm-goto=
 - ~s~: =osm-search=
+- ~S~: =osm-server=
 - ~b~: =bookmark-set=
 - ~B~: =bookmark-jump=
 - ~q~: =quit-window=
diff --git a/osm.el b/osm.el
index f1149fe823..e5a6c14e8f 100644
--- a/osm.el
+++ b/osm.el
@@ -39,31 +39,31 @@
   :prefix "osm-")
 
 (defcustom osm-server-list
-  '((openstreetmap-org
+  '((default
  :name "OpenStreetMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url ("https://a.tile.openstreetmap.org/%s/%s/%s.png";
"https://b.tile.openstreetmap.org/%s/%s/%s.png";
"https://c.tile.openstreetmap.org/%s/%s/%s.png";))
-(openstreetmap-de
+(de
  :name "OSM Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url ("https://a.tile.openstreetmap.de/%s/%s/%s.png";
"https://b.tile.openstreetmap.de/%s/%s/%s.png";
"https://c.tile.openstreetmap.de/%s/%s/%s.png";))
-(openstreetmap-fr
+(fr
  :name "OSM France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url ("https://a.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";
"https://b.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";
"https://c.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";))
-(openstreetmap-humanitarian
+(humanitarian
  :name "OSM Humanitarian"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url ("https://a.tile.openstreetmap.fr/hot/%s/%s/%s.png";
"https://b.tile.openstreetmap.fr/hot/%s/%s/%s.png";
"https://c.tile.openstreetmap.fr/hot/%s/%s/%s.png";))
-(opentopomap-org
+(opentopomap
  :name "OpenTopoMap"
  :min-zoom 2 :max-zoom 17 :max-connections 2
  :url ("https://a.tile.opentopomap.org/%s/%s/%s.png";
@@ -108,10 +108,6 @@
   "List of tile servers."
   :type '(alist :key-type symbol :value-type plist))
 
-(defcustom osm-buffer-name "*osm*"
-  "Default buffer name."
-  :type 'string)
-
 (defcustom osm-large-step 256
   "Movement step in pixel."
   :type 'integer)
@@ -120,7 +116,7 @@
   "Movement step in pixel."
   :type 'integer)
 
-(defcustom osm-server 'openstreetmap-org
+(defcustom osm-server 'default
   "Tile server name."
   :type 'symbol)
 
@@ -155,6 +151,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "c" #'clone-buffer)
 (define-key map "g" #'osm-goto)
 (define-key map "s" #'osm-search)
+(define-key map "S" #'osm-server)
 (define-key map "b" #'bookmark-set)
 (define-key map "B" #'bookmark-jump)
 (define-key map [remap scroll-down-command] #'osm-down)
@@ -266,10 +263,13 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--cache-directory ()
   "Return tile cache directory."
-  (expand-file-name
-   (file-name-concat osm-cache-directory
- (symbol-name osm-server)
- "/")))
+  (let ((dir (expand-file-name
+  (file-name-concat osm-cache-directory
+(symbol-name osm-server)
+"/"
+(unless (file-exists-p dir)
+  (make-directory dir t))
+dir))
 
 (defun osm--enqueue (x y)
   "Enqueue tile X/Y for download."
@@ -406,9 +406,11 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (run-with-idle-timer
  30 nil
  (lambda ()
-   (dolist (file (directory-files-recursively
-  osm-cache-directory
-  "\\.\\(?:png\\|jpe?g\\)\\(?:\\.tmp\\)?\\'" nil))
+   (dolist (file
+(ignore-errors
+  (directory-files-recursively
+   osm-cache-directory
+   "\\.\\(?:png\\|jpe?g\\)\\(?:\\.tmp\\)?\\'" nil)))
  (when (> (float-time
(time-since
 (file-attribute-modification-time
@@ -419,11 +421,9 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (define-derived-mode osm-mode special-mode "Osm"
   "Open Street Map mode."
   :interactive nil
-  (let ((cache (osm--cache-directory)))
-(unless (file-exists-p 

[elpa] externals/osm 640c885460 48/77: README: Add example configuration

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 640c885460d9b753410b68d59ff33ad753524a74
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Add example configuration
---
 README.org | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/README.org b/README.org
index 1f41d9d00c..937484866d 100644
--- a/README.org
+++ b/README.org
@@ -23,6 +23,20 @@
 - Bookmarks
 - Multiple preconfigured servers
 
+* Configuration
+
+#+begin_src emacs-lisp
+  (use-package osm
+:bind (("C-c m h" . osm-home)
+   ("C-c m s" . osm-search)
+   ("C-c m S" . osm-server)
+   ("C-c m g" . osm-goto))
+:init
+;; Load Org link support
+(with-eval-after-load 'org
+  (require 'osm-ol)))
+#+end_src
+
 * Bookmarks and Org links
 
 To store a bookmark press the key ~b~, to store Org links press the key ~l~. 
You can



[elpa] externals/osm d490ac4013 08/77: Add French server

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit d490ac4013781f8483ffec26e97f107a0bc61cdc
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add French server
---
 osm.el | 31 ---
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/osm.el b/osm.el
index 20491ee140..4ca5b53ebf 100644
--- a/osm.el
+++ b/osm.el
@@ -39,21 +39,29 @@
   :prefix "osm-")
 
 (defcustom osm-tile-server-list
-  '((openstreetmap-de
- :url ("https://a.tile.openstreetmap.de/";
-   "https://b.tile.openstreetmap.de/";
-   "https://c.tile.openstreetmap.de/";)
- :min-zoom 2 :max-zoom 19 :max-connections 2)
-(openstreetmap-org
+  '((openstreetmap-org
+ :min-zoom 2 :max-zoom 19 :max-connections 2
  :url ("https://a.tile.openstreetmap.org/";
"https://b.tile.openstreetmap.org/";
-   "https://c.tile.openstreetmap.org/";)
- :min-zoom 2 :max-zoom 19 :max-connections 2)
+   "https://c.tile.openstreetmap.org/";))
+(openstreetmap-de
+ :name "OpenStreetMap Deutschland"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://a.tile.openstreetmap.de/";
+   "https://b.tile.openstreetmap.de/";
+   "https://c.tile.openstreetmap.de/";))
+(openstreetmap-fr
+ :name "OpenStreetMap France"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://a.tile.openstreetmap.fr/osmfr/";
+   "https://b.tile.openstreetmap.fr/osmfr/";
+   "https://c.tile.openstreetmap.fr/osmfr/";))
 (opentopomap-org
+ :name "OpenTopoMap"
+ :min-zoom 2 :max-zoom 17 :max-connections 2
  :url ("https://a.tile.opentopomap.org/";
"https://b.tile.opentopomap.org/";
-   "https://c.tile.opentopomap.org/";)
- :min-zoom 2 :max-zoom 17 :max-connections 2))
+   "https://c.tile.opentopomap.org/";)))
   "List of tile servers."
   :type '(alist :key-type symbol :value-type plist))
 
@@ -407,7 +415,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (setq-local
header-line-format
(list
-(format " OpenStreetMap %s %sZ%-2d%s%s%s %s %s"
+(format " %s %s %sZ%-2d%s%s%s %s %s"
+(osm--server-property :name)
 (format #("%7.2f°" 0 5 (face bold)) (osm--lat))
 (format #("%7.2f°" 0 5 (face bold)) (osm--lon))
 osm--zoom



[elpa] externals/osm 9053d8a930 16/77: Indentation

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 9053d8a93042483d5eb1430e71e5527193241eb5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Indentation
---
 ol-osm.el | 4 ++--
 osm.el| 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ol-osm.el b/ol-osm.el
index 2186f48233..c7db90692f 100644
--- a/ol-osm.el
+++ b/ol-osm.el
@@ -38,8 +38,8 @@
   "Open osm LINK."
   (setq link (split-string link ","))
   (osm-goto (string-to-number (nth 0 link))
- (string-to-number (nth 1 link))
- (string-to-number (nth 2 link
+(string-to-number (nth 1 link))
+(string-to-number (nth 2 link
 
 (defun ol-osm-store ()
   "Store osm link."
diff --git a/osm.el b/osm.el
index 0cc50e41e4..68d8b23296 100644
--- a/osm.el
+++ b/osm.el
@@ -622,7 +622,7 @@ The buffer is optionally assigned a UNIQUE name."
  results))
(error "No selection"
 (osm-goto (car selected) (cadr selected)
-   (apply #'osm--boundingbox-to-zoom (cddr selected)
+  (apply #'osm--boundingbox-to-zoom (cddr selected)
 
 (dolist (sym (list #'osm-up #'osm-down #'osm-left #'osm-right
#'osm-up-large #'osm-down-large #'osm-left-large 
#'osm-right-large



[elpa] externals/osm b991de6e89 54/77: Rename server

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit b991de6e89e98f68a51453705c17058911a5e8aa
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename server
---
 osm.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index ff22173f7d..ec2c19196b 100644
--- a/osm.el
+++ b/osm.el
@@ -46,7 +46,7 @@
  :url "https://[abc].tile.openstreetmap.org/%z/%x/%y.png";)
 (de
  :name "Mapnik(de)"
- :description "Localized Mapnik map provided by OpenStreetMap Deutschland"
+ :description "Localized Mapnik map provided by OpenStreetMap Germany"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.de/%z/%x/%y.png";)
 (fr



[elpa] externals/osm 7a1d920492 59/77: Display bookmarks in map

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 7a1d920492440123fe6187e53669426d9292a78c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Display bookmarks in map
---
 README.org |  6 +++---
 osm.el | 68 ++
 2 files changed, 58 insertions(+), 16 deletions(-)

diff --git a/README.org b/README.org
index 4190c84fe2..40a74866d5 100644
--- a/README.org
+++ b/README.org
@@ -42,7 +42,7 @@
 To store a bookmark press the key ~b~, to store Org links press the key ~l~. 
You can
 also use a custom binding, e.g., ~C-c l~. Then the link can be inserted into 
an Org
 buffer with ~C-c C-l~. Bookmarks and Org links can be created at point with the
-mouse, see ~osm-bookmark-click~ and ~osm-org-link-click~.
+mouse, see ~osm-bookmark-set-click~ and ~osm-org-link-click~.
 
 Examples:
 
@@ -67,13 +67,13 @@ Key bindings in =osm-mode= buffer:
 - ~-~, ~S-SPC~: =osm-zoom-out= - Zoom out
 - ~~: =osm-zoom-click= - Zoom to point
 - ~~: =osm-org-link-click= - Store point as Org link
-- ~~: =osm-bookmark-click= - Store point as bookmark
+- ~~: =osm-bookmark-set-click= - Store point as bookmark
 - ~g~: =osm-goto= - Go to location
 - ~h~: =osm-home= - Go to home location
 - ~s~: =osm-search= - Search for location
 - ~S~: =osm-server= - Select server
 - ~l~: =org-store-link= - Store org link
-- ~b~: =osm-bookmark= - Set bookmark
+- ~b~: =osm-bookmark-set= - Set bookmark
 - ~B~: =osm-bookmark-jump= - Jump to bookmark
 - ~q~: =quit-window= - Close buffer and window
 - ~c~: =clone-buffer= - Clone buffer
diff --git a/osm.el b/osm.el
index 8bdd572e2e..9753c7e700 100644
--- a/osm.el
+++ b/osm.el
@@ -137,7 +137,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "\d" #'osm-zoom-out)
 (define-key map [mouse-1] #'osm-zoom-click)
 (define-key map [mouse-2] #'osm-org-link-click)
-(define-key map [mouse-3] #'osm-bookmark-click)
+(define-key map [mouse-3] #'osm-bookmark-set-click)
 (define-key map [drag-mouse-1] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
@@ -157,7 +157,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "s" #'osm-search)
 (define-key map "S" #'osm-server)
 (define-key map "l" 'org-store-link)
-(define-key map "b" #'osm-bookmark)
+(define-key map "b" #'osm-bookmark-set)
 (define-key map "B" #'osm-bookmark-jump)
 (define-key map [remap scroll-down-command] #'osm-down)
 (define-key map [remap scroll-up-command] #'osm-up)
@@ -213,6 +213,9 @@ Should be at least 7 days according to the server usage 
policies."
 (defvar-local osm--y nil
   "X coordinate on the map in pixel.")
 
+(defvar-local osm--bookmark-positions
+  "Bookmark positions.")
+
 (defun osm--boundingbox-to-zoom (lat1 lat2 lon1 lon2)
   "Compute zoom level from boundingbox LAT1 to LAT2 and LON1 to LON2."
   (let ((w (/ (frame-pixel-width) 256))
@@ -358,13 +361,13 @@ Should be at least 7 days according to the server usage 
policies."
   (cl-incf osm--y (- y osm--wy))
   (osm-zoom-in
 
-(defun osm-bookmark-click (event)
+(defun osm-bookmark-set-click (event)
   "Create bookmark at position of click EVENT."
   (interactive "@e")
   (pcase-let* ((`(,x . ,y) (posn-x-y (event-start event)))
(osm--x (+ osm--x (- x osm--wx)))
(osm--y (+ osm--y (- y osm--wy
-(osm-bookmark)))
+(osm-bookmark-set)))
 
 (defun osm-org-link-click (event)
   "Store link at position of click EVENT."
@@ -489,6 +492,27 @@ Should be at least 7 days according to the server usage 
policies."
   bookmark-make-record-function #'osm--make-bookmark)
   (add-hook 'window-size-change-functions #'osm--resize nil 'local))
 
+(defun osm--bookmark-positions ()
+  "Compute bookmark positions."
+  (setq osm--bookmark-positions
+(cl-loop
+ for bm in bookmark-alist
+ if (eq (bookmark-prop-get bm 'handler) #'osm-bookmark-jump)
+ collect
+ (let* ((coord (bookmark-prop-get bm 'coordinates))
+(px (osm--lon-to-x (cadr coord) osm--zoom))
+(py (osm--lat-to-y (car coord) osm--zoom)))
+   (cons px py)
+
+(defun osm--bookmarks-at (x y)
+  "Get bookmarks at X/Y."
+  ;; TODO Optimized k2 tree?
+  (setq x (* x 256) y (* y 256))
+  (cl-loop for (p . q) in (osm--bookmark-positions)
+   if (and (>= p (- x 100)) (< p (+ x 256 100))
+   (>= q (- y 100)) (< q (+ y 256 100)))
+   collect (cons (- p x) (- q y
+
 (defun osm--get-tile (x y)
   "Get tile at X/Y."
   (let* ((key `(,osm-server ,osm--zoom ,x . ,y))
@@ -500,9 +524,25 @@ Should be at least 7 days according to the server usage 
policies."
   (when (and osm-max-tiles (not osm--tiles))
 (setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles)))
   (setq tile
-`(,osm--cookie
-  image :type ,(if (member (file-name-exte

[elpa] externals/osm 699aae27b1 20/77: Rename osm-new to osm-home

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 699aae27b13abe52884f1478767c1ad62c85580c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename osm-new to osm-home
---
 README.org |  3 ++-
 osm.el | 27 +--
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/README.org b/README.org
index 68bab80c9e..2975cea138 100644
--- a/README.org
+++ b/README.org
@@ -26,7 +26,7 @@
 * Commands and Key Bindings
 
 Commands:
-- =osm-new=: Open new map at home coordinates
+- =osm-home=: Open new map at home coordinates
 - =osm-search=: Search and jump to location
 - =osm-goto=: Go to coordinates
 - =osm-server=: Select server
@@ -36,6 +36,7 @@ Key bindings:
 - ~~: Small step scrolling
 - ~C-~, ~M-~: Large step scrolling
 - ~g~: =osm-goto=
+- ~h~: =osm-home=
 - ~s~: =osm-search=
 - ~S~: =osm-server=
 - ~b~: =bookmark-set=
diff --git a/osm.el b/osm.el
index 11eece996b..573b94353d 100644
--- a/osm.el
+++ b/osm.el
@@ -149,6 +149,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map [M-left] #'osm-left-large)
 (define-key map [M-right] #'osm-right-large)
 (define-key map "c" #'clone-buffer)
+(define-key map "h" #'osm-home)
 (define-key map "g" #'osm-goto)
 (define-key map "s" #'osm-search)
 (define-key map "S" #'osm-server)
@@ -464,15 +465,15 @@ We need two distinct images which are not `eq' for the 
display properties.")
  image)))
 
 ;;;###autoload
-(defun osm-new (&optional unique)
-  "New OSM buffer, optionally UNIQUE."
-  (interactive "P")
+(defun osm-home ()
+  "New OSM buffer."
+  (interactive)
   (let ((lat (bound-and-true-p calendar-latitude))
 (lon (bound-and-true-p calendar-longitude))
 (zoom 11))
 (unless (and lat lon)
   (setq lat 0 lon 0 zoom 2))
-(osm-goto lat lon zoom nil unique)))
+(osm-goto lat lon zoom)))
 
 (defun osm--queue-info ()
   "Return queue info string."
@@ -547,9 +548,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (handler . ,#'osm-bookmark-jump)))
 
 ;;;###autoload
-(defun osm-goto (lat lon zoom &optional name unique)
-  "Goto LAT/LON/ZOOM in buffer NAME.
-The buffer is optionally assigned a UNIQUE name."
+(defun osm-goto (lat lon zoom &optional name)
+  "Goto LAT/LON/ZOOM in buffer NAME."
   (interactive
(pcase-let ((`(,lat ,lon ,zoom) (mapcar #'string-to-number (split-string 
(read-string "Lat Lon (Zoom): ") nil t
  (setq zoom (or zoom 11))
@@ -557,11 +557,9 @@ The buffer is optionally assigned a UNIQUE name."
(error "Invalid coordindate"))
  (list lat lon zoom)))
   (with-current-buffer
-  (cond
-   ((and (not name) (not unique) (derived-mode-p #'osm-mode))
-(current-buffer))
-   (unique (generate-new-buffer (or name (osm--buffer-name
-   (t (get-buffer-create (or name (osm--buffer-name)
+  (if (and (not name) (derived-mode-p #'osm-mode))
+  (current-buffer)
+(generate-new-buffer (or name (osm--buffer-name
 (unless (derived-mode-p #'osm-mode)
   (osm-mode))
 (setq osm--zoom zoom)
@@ -581,7 +579,8 @@ The buffer is optionally assigned a UNIQUE name."
(alist-get 'lat bm)
(alist-get 'lon bm)
(alist-get 'zoom bm)
-   (alist-get 'name bm)))
+   (unless (derived-mode-p #'osm-mode)
+ (alist-get 'name bm
 
 (defun osm--bookmark-name ()
   "Return bookmark name for current map."
@@ -661,7 +660,7 @@ The buffer is optionally assigned a UNIQUE name."
   (with-current-buffer
   (if (derived-mode-p #'osm-mode)
   (current-buffer)
-(osm-new))
+(osm-home))
 (unless (eq osm-server server)
   (let ((rename (string-match-p
  (format "\\`\\*osm: %s\\*\\(?:<[0-9]+>\\)?\\'"



[elpa] externals/osm d830691585 61/77: README: Remove wishlist

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit d830691585a48a3be39d52b5d96a89ba1309c0cc
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Remove wishlist
---
 README.org | 6 --
 1 file changed, 6 deletions(-)

diff --git a/README.org b/README.org
index 0154fc4edd..9cf7f77851 100644
--- a/README.org
+++ b/README.org
@@ -79,12 +79,6 @@ Key bindings in =osm-mode= buffer:
 - ~q~: =quit-window= - Close buffer and window
 - ~c~: =clone-buffer= - Clone buffer
 
-* Wishlist
-
-It would be nice to have overlays on top of the map, location markers, routes,
-GPS tracks, etc. In the [[https://github.com/minad/osm/tree/svg][svg branch]] 
I experiment with SVG tiles, composed of the
-bitmap background and markers on top.
-
 * Related projects
 
 There have been other attempts at map viewers in Emacs before.



[elpa] externals/osm ee64b96509 56/77: Add map variant

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit ee64b96509828e214cba1984a6a681e846c0e66e
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add map variant
---
 osm.el | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/osm.el b/osm.el
index 3b50827c47..d12fed13e2 100644
--- a/osm.el
+++ b/osm.el
@@ -89,11 +89,16 @@
  :description "Map with hill shading provided by Stamen"
  :min-zoom 2 :max-zoom 18 :max-connections 2
  :url "https://stamen-tiles-[abc].a.ssl.fastly.net/terrain/%z/%x/%y.png";)
-(stamen-toner
- :name "Stamen Toner"
+(stamen-toner-dark
+ :name "Stamen Toner Dark"
  :description "Artistic map in toner style provided by Stamen"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url "https://stamen-tiles-[abc].a.ssl.fastly.net/toner/%z/%x/%y.png";))
+ :url "https://stamen-tiles-[abc].a.ssl.fastly.net/toner/%z/%x/%y.png";)
+(stamen-toner-light
+ :name "Stamen Toner Lite"
+ :description "Artistic map in toner style provided by Stamen"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url 
"https://stamen-tiles-[abc].a.ssl.fastly.net/toner-lite/%z/%x/%y.png";))
   "List of tile servers."
   :type '(alist :key-type symbol :value-type plist))
 



[elpa] externals/osm 1bd4751bcf 34/77: Better link names

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 1bd4751bcf83ee006a85eaf132f2e2147111e34c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Better link names
---
 README.org |  4 ++--
 osm.el | 23 +--
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/README.org b/README.org
index 0202dfa198..f98a194654 100644
--- a/README.org
+++ b/README.org
@@ -13,7 +13,7 @@
 
 * Features
 
-- Parallel fetching of tiles via curl
+- Parallel fetching of tiles with curl
 - Scrolling in large and small steps
 - Zooming with keys or with mouse click
 - Map scale indicator
@@ -31,7 +31,7 @@ Top-level commands:
 - =osm-goto=: Go to coordinates
 - =osm-server=: Select server
 
-Key bindings:
+Key bindings in =osm-mode= buffer:
 - ~+~ and ~-~: Zooming
 - ~~: Small step scrolling
 - ~C-~, ~M-~: Large step scrolling
diff --git a/osm.el b/osm.el
index c3ebd2eef9..78447e6e88 100644
--- a/osm.el
+++ b/osm.el
@@ -553,13 +553,13 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm--make-bookmark ()
   "Make OSM bookmark."
   (setq bookmark-current-bookmark nil) ;; Reset bookmark to use new name
-  `(,(osm--buffer-name-with-coordinates)
+  `(,(osm--bookmark-name)
 (coordinate ,(osm--lat) ,(osm--lon) ,osm--zoom)
 (server . ,osm-server)
 (handler . ,#'osm-bookmark-jump)))
 
-(defun osm--buffer-name-with-coordinates ()
-  "Return buffer description."
+(defun osm--bookmark-name ()
+  "Return default bookmark name."
   (if (osm--generated-name-p)
   (format "osm: %.2f° %.2f° %s"
   (osm--lat) (osm--lon)
@@ -568,6 +568,15 @@ We need two distinct images which are not `eq' for the 
display properties.")
  "\\`\\*\\|\\*\\(?:<[0-9]+>\\)?\\'"
  "" (buffer-name
 
+(defun osm--link-data ()
+  "Return link data."
+  (list (osm--lat) (osm--lon) osm--zoom
+(and (not (eq osm-server (default-value 'osm-server))) osm-server)
+(let ((name (string-remove-prefix "osm: " (osm--bookmark-name
+  (if (eq osm-server (default-value 'osm-server))
+  (string-remove-suffix (concat " " (osm--server-property :name)) 
name)
+name
+
 (defun osm--default-buffer-name ()
   "Return default buffer name."
   (format "*osm: %s*" (osm--server-property :name)))
@@ -631,12 +640,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (car bm)
   (format "*%s*" (car bm))
 
-(defun osm--link-data ()
-  "Return link data."
-  (list (osm--lat) (osm--lon) osm--zoom
-(and (not (eq osm-server (default-value 'osm-server))) osm-server)
-(osm--buffer-name-with-coordinates)))
-
 (defun osm--description ()
   "Return descriptive string for current map."
   (message "Fetching location name...")
@@ -658,7 +661,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (interactive)
   (when-let (desc (osm--description))
 (rename-buffer
- (format "*osm: %s %.2f° %.2f° %s*"
+ (format "*osm: %s, %.2f° %.2f° %s*"
  desc (osm--lat) (osm--lon)
  (osm--server-property :name))
  'unique)))



[elpa] externals/osm b300e42d9f 68/77: Add transient pin

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit b300e42d9f03d6ae6b7c494b79be6a452835ae01
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add transient pin
---
 osm.el | 92 +-
 1 file changed, 57 insertions(+), 35 deletions(-)

diff --git a/osm.el b/osm.el
index fb0e51473a..1832d6236d 100644
--- a/osm.el
+++ b/osm.el
@@ -217,6 +217,9 @@ Should be at least 7 days according to the server usage 
policies."
 (defvar-local osm--bookmark-positions
   "Bookmark positions.")
 
+(defvar-local osm--transient-pin nil
+  "Transient pin.")
+
 (defun osm--boundingbox-to-zoom (lat1 lat2 lon1 lon2)
   "Compute zoom level from boundingbox LAT1 to LAT2 and LON1 to LON2."
   (let ((w (/ (frame-pixel-width) 256))
@@ -522,52 +525,63 @@ Should be at least 7 days according to the server usage 
policies."
 (py (osm--lat-to-y (car coord) osm--zoom)))
`(,px ,py . ,(car bm))
 
-(defun osm--bookmarks-at (x y)
-  "Get bookmarks at X/Y."
-  ;; TODO Optimized k2 tree?
+(defun osm--pin-position (x y p q)
+  "Return position of pin P/Q in tile X/Y."
   (setq x (* x 256) y (* y 256))
-  (cl-loop for (p q . _name) in osm--bookmark-positions
-   if (and (>= p (- x 100)) (< p (+ x 256 100))
-   (>= q (- y 100)) (< q (+ y 256 100)))
-   collect (cons (- p x) (- q y
+  (and (>= p (- x 100)) (< p (+ x 256 100))
+   (>= q (- y 100)) (< q (+ y 256 100))
+   (cons (- p x) (- q y
 
-(defun osm--make-tile (x y file)
+(defun osm--pins-at (x y)
+  "Get pins at X/Y."
+  ;; TODO Optimized k2 tree?
+  (let ((pins (cl-loop for (p q . _name) in osm--bookmark-positions
+   for pin = (osm--pin-position x y p q)
+   if pin collect (cons "#ff8800" pin
+(if-let (pin (and osm--transient-pin
+  (osm--pin-position x y osm--x osm--y)))
+(nconc pins (list (cons "#aa" pin)))
+  pins)))
+
+(defun osm--make-tile (x y)
   "Make tile at X/Y from FILE."
-  `(image
-:width 256 :height 256
-,@(if-let (positions (osm--bookmarks-at x y))
-  (list :type 'svg :base-uri file
-:data (concat "
 "
 (mapconcat
- (lambda (pos)
-   (format "
+ (pcase-lambda (`(,color ,x . ,y))
+   (format "
 
 
-"
-   (car pos) (cdr pos)))
- positions "")
+" color x y))
+ pins "")
 ""))
-(list :type
-  (if (member (file-name-extension file) '("jpg" "jpeg"))
-  'jpeg 'png)
-  :file file
+(list :type
+  (if (member (file-name-extension file) '("jpg" "jpeg"))
+  'jpeg 'png)
+  :file file))
 
 (defun osm--get-tile (x y)
   "Get tile at X/Y."
-  (let* ((key `(,osm-server ,osm--zoom ,x . ,y))
- (tile (and osm--tiles (gethash key osm--tiles
-(if tile
-(progn (setcar tile osm--cookie) (cdr tile))
-  (let ((file (osm--tile-file x y osm--zoom)))
-(when (file-exists-p file)
-  (when (and osm-max-tiles (not osm--tiles))
-(setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles)))
-  (setq tile (cons osm--cookie (osm--make-tile x y file)))
-  (when osm--tiles
-(puthash key tile osm--tiles))
-  (cdr tile))
+  (if (and osm--transient-pin (osm--pin-position x y osm--x osm--y))
+  (osm--make-tile x y)
+(let* ((key `(,osm-server ,osm--zoom ,x . ,y))
+   (tile (and osm--tiles (gethash key osm--tiles
+  (if tile
+  (progn (setcar tile osm--cookie) (cdr tile))
+(setq tile (osm--make-tile x y))
+(when tile
+  (when osm-max-tiles
+(unless osm--tiles
+  (setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles))
+  (puthash key (cons osm--cookie tile) osm--tiles)))
+  tile)
 
 (defun osm--display-tile (x y tile)
   "Display TILE at X/Y."
@@ -741,10 +755,18 @@ xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>
 osm--active nil
 osm--queue nil))
 (when (or (not (and osm--x osm--y)) at)
+  (let ((buffer (current-buffer))
+(sym (make-symbol "osm--remove-transient-pin")))
+(fset sym (lambda ()
+(with-current-buffer buffer
+  (setq osm--transient-pin nil)
+  (remove-hook 'pre-command-hook sym
+(add-hook 'pre-command-hook sym))
   (setq at (or at (osm--home-coordinates))
 osm--zoom (nth 2 at)
 osm--x (osm--lon-to-x (nth 1 at) osm--zoom)
-osm--y (osm--lat-to-y (nth 0 at) osm--zoom)))
+osm--y (osm--lat-to-y (nth 0 at) osm--zoom)
+osm--transient-pin t))
 (prog1 (pop-to-buffer (current-buffer))
   (osm--update
 



[elpa] externals/osm e78a337477 44/77: Rename commands

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit e78a337477268dfa1887bdd99b587406b72692d5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename commands
---
 README.org |  1 +
 osm.el | 48 
 2 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/README.org b/README.org
index df02910ef6..e7aefb2cb0 100644
--- a/README.org
+++ b/README.org
@@ -47,6 +47,7 @@ Top-level commands:
 
 Key bindings in =osm-mode= buffer:
 - ~+~ and ~-~: Zooming
+- ~~: Zoom to point
 - ~~: Small step scrolling
 - ~C-~, ~M-~: Large step scrolling
 - ~g~: =osm-goto=
diff --git a/osm.el b/osm.el
index 4a689de25c..192c785cfd 100644
--- a/osm.el
+++ b/osm.el
@@ -121,22 +121,22 @@ Should be at least 7 days according to the server usage 
policies."
 
 (defvar osm-mode-map
   (let ((map (make-sparse-keymap)))
-(define-key map "+" #'osm-larger)
-(define-key map "-" #'osm-smaller)
-(define-key map [mouse-1] #'osm-click)
+(define-key map "+" #'osm-zoom-in)
+(define-key map "-" #'osm-zoom-out)
+(define-key map [mouse-1] #'osm-zoom-click)
 (define-key map [drag-mouse-1] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
 (define-key map [left] #'osm-left)
 (define-key map [right] #'osm-right)
-(define-key map [C-up] #'osm-up-large)
-(define-key map [C-down] #'osm-down-large)
-(define-key map [C-left] #'osm-left-large)
-(define-key map [C-right] #'osm-right-large)
-(define-key map [M-up] #'osm-up-large)
-(define-key map [M-down] #'osm-down-large)
-(define-key map [M-left] #'osm-left-large)
-(define-key map [M-right] #'osm-right-large)
+(define-key map [C-up] #'osm-up-up)
+(define-key map [C-down] #'osm-down-down)
+(define-key map [C-left] #'osm-left-left)
+(define-key map [C-right] #'osm-right-right)
+(define-key map [M-up] #'osm-up-up)
+(define-key map [M-down] #'osm-down-down)
+(define-key map [M-left] #'osm-left-left)
+(define-key map [M-right] #'osm-right-right)
 (define-key map "c" #'clone-buffer)
 (define-key map "h" #'osm-home)
 (define-key map "g" #'osm-goto)
@@ -326,14 +326,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (osm--download)
   (osm--download
 
-(defun osm-click (event)
+(defun osm-zoom-click (event)
   "Handle click EVENT."
   (interactive "e")
   (pcase-let ((`(,x . ,y) (posn-x-y (event-start event
 (when (< osm--zoom (osm--server-property :max-zoom))
   (cl-incf osm--x (- x osm--wx))
   (cl-incf osm--y (- y osm--wy))
-  (osm-larger
+  (osm-zoom-in
 
 (defun osm-drag (event)
   "Handle drag EVENT."
@@ -344,7 +344,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (cl-incf osm--y (- sy ey))
 (osm--update)))
 
-(defun osm-larger (&optional n)
+(defun osm-zoom-in (&optional n)
   "Zoom N times into the map."
   (interactive "p")
   (setq n (or n 1))
@@ -360,10 +360,10 @@ We need two distinct images which are not `eq' for the 
display properties.")
  osm--y (/ osm--y 2)))
   (osm--update))
 
-(defun osm-smaller (&optional n)
+(defun osm-zoom-out (&optional n)
   "Zoom N times out of the map."
   (interactive "p")
-  (osm-larger (- (or n 1
+  (osm-zoom-in (- (or n 1
 
 (defun osm--move (dx dy step)
   "Move by DX/DY with STEP size."
@@ -394,25 +394,25 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (interactive "p")
   (osm-right (- (or n 1
 
-(defun osm-right-large (&optional n)
+(defun osm-right-right (&optional n)
   "Move N large stepz to the right."
   (interactive "p")
   (osm--move (or n 1) 0 osm-large-step))
 
-(defun osm-down-large (&optional n)
+(defun osm-down-down (&optional n)
   "Move N large stepz down."
   (interactive "p")
   (osm--move 0 (or n 1) osm-large-step))
 
-(defun osm-up-large (&optional n)
+(defun osm-up-up (&optional n)
   "Move N large stepz up."
   (interactive "p")
-  (osm-down-large (- (or n 1
+  (osm-down-down (- (or n 1
 
-(defun osm-left-large (&optional n)
+(defun osm-left-left (&optional n)
   "Move N large stepz to the left."
   (interactive "p")
-  (osm-right-large (- (or n 1
+  (osm-right-right (- (or n 1
 
 (defun osm--clean-cache ()
   "Clean tile cache."
@@ -721,8 +721,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (osm--setup nil server))
 
 (dolist (sym (list #'osm-up #'osm-down #'osm-left #'osm-right
-   #'osm-up-large #'osm-down-large #'osm-left-large 
#'osm-right-large
-   #'osm-smaller #'osm-larger))
+   #'osm-up-up #'osm-down-down #'osm-left-left 
#'osm-right-right
+   #'osm-zoom-out #'osm-zoom-in))
   (put sym 'command-modes '(osm-mode)))
 
 (provide 'osm)



[elpa] externals/osm 1b7f4020b3 73/77: Fix caching

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 1b7f4020b3f0801f6303780635f553362386e23f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Fix caching
---
 osm.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/osm.el b/osm.el
index e764cfe937..9a49869c26 100644
--- a/osm.el
+++ b/osm.el
@@ -602,8 +602,8 @@ xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>
 (when tile
   (when osm-max-tiles
 (unless osm--tiles
-  (setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles))
-  (puthash key (cons osm--cookie tile) osm--tiles)))
+  (setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles)))
+(puthash key (cons osm--cookie tile) osm--tiles))
   tile)
 
 (defun osm--display-tile (x y tile)



[elpa] externals/osm 5b82b32201 28/77: Add server descriptions

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 5b82b322010e0bc4a5e8d696842f34bd4b53aac3
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add server descriptions
---
 osm.el | 59 ++-
 1 file changed, 38 insertions(+), 21 deletions(-)

diff --git a/osm.el b/osm.el
index cfc96a4264..611c54c105 100644
--- a/osm.el
+++ b/osm.el
@@ -40,47 +40,58 @@
 
 (defcustom osm-server-list
   '((default
- :name "OpenStreetMap"
+ :name "Mapnik"
+ :description "Standard Mapnik map provided by OpenStreetMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.org/%z/%x/%y.png";)
 (de
- :name "OSM Deutschland"
+ :name "Mapnik (de)"
+ :description "Localized Mapnik map provided by OpenStreetMap Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.de/%z/%x/%y.png";)
 (fr
- :name "OSM France"
+ :name "Mapnik (fr)"
+ :description "Localized Mapnik map by OpenStreetMap France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.fr/osmfr/%z/%x/%y.png";)
 (humanitarian
- :name "OSM Humanitarian"
+ :name "Humanitarian"
+ :description "Humanitarian map provided by OpenStreetMap France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.fr/hot/%z/%x/%y.png";)
-(opentopomap
- :name "OpenTopoMap"
- :min-zoom 2 :max-zoom 17 :max-connections 2
- :url "https://[abc].tile.opentopomap.org/%z/%x/%y.png";)
-(opvnkarte
- :name "ÖPNVKarte"
- :min-zoom 2 :max-zoom 18 :max-connections 2
- :url "http://[abc].tile.memomaps.de/tilegen/%z/%x/%y.png";)
 (cyclosm
  :name "CyclOSM"
+ :description "Bicycle-oriented map provided by OpenStreetMap France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";)
 (openriverboatmap
  :name "OpenRiverBoatMap"
+ :description "Waterways map provided by OpenStreetMap France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";)
+(opentopomap
+ :name "OpenTopoMap"
+ :description "Topographical map provided by OpenTopoMap"
+ :min-zoom 2 :max-zoom 17 :max-connections 2
+ :url "https://[abc].tile.opentopomap.org/%z/%x/%y.png";)
+(opvn
+ :name "ÖPNV"
+ :description "Base layer with public transport information"
+ :min-zoom 2 :max-zoom 18 :max-connections 2
+ :url "http://[abc].tile.memomaps.de/tilegen/%z/%x/%y.png";)
 (stamen-watercolor
  :name "Stamen Watercolor"
+ :description "Artistic map in watercolor style provided by Stamen"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url 
"https://stamen-tiles-[abc].a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";)
 (stamen-terrain
  :name "Stamen Terrain"
+ :description "Map with hill shading provided by Stamen"
  :min-zoom 2 :max-zoom 18 :max-connections 2
  :url "https://stamen-tiles-[abc].a.ssl.fastly.net/terrain/%z/%x/%y.png";)
 (stamen-toner
  :name "Stamen Toner"
+ :description "Artistic map in toner style provided by Stamen"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://stamen-tiles-[abc].a.ssl.fastly.net/toner/%z/%x/%y.png";))
   "List of tile servers."
@@ -639,17 +650,23 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm-server (server)
   "Select SERVER."
   (interactive
-   (list
-(let ((servers
+   (let* ((fmt #("%-20s %s" 6 8 (face font-lock-comment-face)))
+  (servers
(mapcar
 (lambda (x)
-  (cons (plist-get (cdr x) :name) (car x)))
-osm-server-list)))
-  (or (cdr (assoc (completing-read
-   "Server: " servers nil t nil nil
-   (osm--server-property :name))
-  servers))
-  (error "No server selected")
+  (cons
+   (format fmt
+   (plist-get (cdr x) :name)
+   (or (plist-get (cdr x) :description) ""))
+   (car x)))
+osm-server-list))
+  (selected (completing-read
+ "Server: " servers nil t nil nil
+ (format fmt
+ (osm--server-property :name)
+ (or (osm--server-property :description) "")
+ (list (or (cdr (assoc selected servers))
+   (error "No server selected")
   (with-current-buffer
   (if (derived-mode-p #'osm-mode)
   (current-buffer)



[elpa] externals/osm df844cd56b 30/77: Add osm-rename command

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit df844cd56b130243b9f434f1fa8d77a57550c6ad
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add osm-rename command
---
 README.org |  3 ++-
 ol-osm.el  |  9 +
 osm.el | 62 --
 3 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/README.org b/README.org
index 2975cea138..0202dfa198 100644
--- a/README.org
+++ b/README.org
@@ -25,7 +25,7 @@
 
 * Commands and Key Bindings
 
-Commands:
+Top-level commands:
 - =osm-home=: Open new map at home coordinates
 - =osm-search=: Search and jump to location
 - =osm-goto=: Go to coordinates
@@ -39,6 +39,7 @@ Key bindings:
 - ~h~: =osm-home=
 - ~s~: =osm-search=
 - ~S~: =osm-server=
+- ~n~: =osm-rename=
 - ~b~: =bookmark-set=
 - ~B~: =bookmark-jump=
 - ~q~: =quit-window=
diff --git a/ol-osm.el b/ol-osm.el
index 17b1bdaba4..4234b84518 100644
--- a/ol-osm.el
+++ b/ol-osm.el
@@ -53,10 +53,11 @@
 (pcase-let ((`(,lat ,lon ,zoom ,server ,desc) (osm--link-data)))
   (org-link-store-props
:type "osm"
-   :description (and desc (format "%s %.2f° %.2f°" desc lat lon))
-   :link (format "osm:%s%s,%s,%s"
- (if server (format "%s:" server) "")
- lat lon zoom)
+   :description desc
+   :link (format
+  "osm:%s%s,%s,%s"
+  (if server (format "%s:" server) "")
+  lat lon zoom)
 
 (provide 'ol-osm)
 ;;; ol-osm.el ends here
diff --git a/osm.el b/osm.el
index 601267b82c..371eb5ca2d 100644
--- a/osm.el
+++ b/osm.el
@@ -144,6 +144,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "S" #'osm-server)
 (define-key map "b" #'bookmark-set)
 (define-key map "B" #'bookmark-jump)
+(define-key map "n" #'osm-rename)
 (define-key map [remap scroll-down-command] #'osm-down)
 (define-key map [remap scroll-up-command] #'osm-up)
 (define-key map "\d" nil)
@@ -545,20 +546,26 @@ We need two distinct images which are not `eq' for the 
display properties.")
  #'< osm--queue))
   (osm--download
 
-(declare-function bookmark-make-record-default "boomark")
+(defvar bookmark-current-bookmark)
 (defun osm--make-bookmark ()
   "Make OSM bookmark."
-  `(,(osm--bookmark-name)
-,@(bookmark-make-record-default t)
+  (setq bookmark-current-bookmark nil) ;; Reset bookmark to use new name
+  `(,(osm--buffer-description)
 (coordinate ,(osm--lat) ,(osm--lon) ,osm--zoom)
 (server . ,osm-server)
 (buffer . ,(buffer-name))
 (handler . ,#'osm-bookmark-jump)))
 
-(defun osm--buffer-name ()
+(defun osm--default-buffer-name ()
   "Return default buffer name."
   (format "*osm: %s*" (osm--server-property :name)))
 
+(defun osm--default-buffer-name-p ()
+  "Return non-nil if the buffer has a default name."
+  (string-match-p
+   (format "\\`%s\\(?:<[0-9]+>\\)?\\'" (regexp-quote 
(osm--default-buffer-name)))
+   (buffer-name)))
+
 (cl-defun osm--setup (&key at server buffer)
   "Setup BUFFER with SERVER at coordinates AT."
   ;; Server not found
@@ -569,11 +576,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (generate-new-buffer
  (or buffer
  (let ((osm-server (or server osm-server)))
-   (osm--buffer-name)
-(let ((auto-rename
-   (string-match-p
-(format "\\`%s\\(?:<[0-9]+>\\)?\\'" (regexp-quote 
(osm--buffer-name)))
-(buffer-name
+   (osm--default-buffer-name)
+(let ((auto-rename (osm--default-buffer-name-p)))
   (unless (derived-mode-p #'osm-mode)
 (osm-mode))
   (when (and server (not (eq osm-server server)))
@@ -581,7 +585,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   osm--active nil
   osm--queue nil))
   (when auto-rename
-(setq buffer (or buffer (osm--buffer-name)))
+(setq buffer (or buffer (osm--default-buffer-name)))
 (unless (equal buffer (buffer-name))
   (rename-buffer buffer 'unique)))
   (when (or (not (and osm--x osm--y)) at)
@@ -605,26 +609,29 @@ We need two distinct images which are not `eq' for the 
display properties.")
 ;;;###autoload
 (defun osm-bookmark-jump (bm)
   "Jump to OSM bookmark BM."
-  (osm--setup
-   :at (alist-get 'coordinate bm)
-   :server (alist-get 'server bm)
-   :buffer (alist-get 'buffer bm)))
-
-(defun osm--bookmark-name ()
-  "Return bookmark name for current map."
-  (format "OSM: %s%.2f° %.2f°"
-  (concat (osm--description) " ")
-  (osm--lat)
-  (osm--lon)))
+  (set-buffer (osm--setup
+   :at (alist-get 'coordinate bm)
+   :server (alist-get 'server bm)
+   :buffer (alist-get 'buffer bm
 
 (defun osm--link-data ()
   "Return link data."
   (list (osm--lat) (osm--lon) osm--zoom
 (and (not (eq osm-server (default-value 'osm-server))) 

[elpa] branch externals/osm created (now 833793ed6c)

2022-03-07 Thread ELPA Syncer
elpasync pushed a change to branch externals/osm.

at  833793ed6c Use grid placeholder

This branch includes the following new commits:

   new  ad12c93f57 Initial commit
   new  24d369d9c0 Configurable cache cleaning
   new  305aea000b Use cl-loop
   new  809b371219 Add customizable osm-buffer-name
   new  e7f38427ca Document all variables
   new  42b9222e93 Make download slightly more robust
   new  a9d0ec74e3 Simplify placeholder
   new  d490ac4013 Add French server
   new  d065db8615 Add humanitarian base map
   new  5af320c57f Add Stamen servers, support jpeg tiles
   new  e8ed76566a Rename settings
   new  b30d48f7cb Move code around
   new  0edc1c77db Overwrite more settings
   new  85aa864f25 Zoom with mouse click
   new  21e59942a9 Handle mouse drag event
   new  9053d8a930 Indentation
   new  593b95a50c Add more maps
   new  b259afaed2 Add osm-server to switch the server
   new  458257fa1f Improve tile loading
   new  699aae27b1 Rename osm-new to osm-home
   new  ebf47f15f4 Use format-spec
   new  c2c7dff887 Compact server configuration
   new  ec97b1d1c0 Add separate hook function
   new  5f002af18c Fix file extraction
   new  548dc8c47c Minor cleanup
   new  6f1406 add mwheel scroll functions
   new  db20223911 Minor cleanup
   new  5b82b32201 Add server descriptions
   new  5815de2a73 Store server as part in bookmark and Org link
   new  df844cd56b Add osm-rename command
   new  3c0950a24b Simplify bookmark handling
   new  28d3305bef Improve handling of generated names
   new  a6335090e9 Handle multiple windows
   new  1bd4751bcf Better link names
   new  162f883f80 Reuse existing buffer
   new  591d783065 README: Improve documentation
   new  adc8156a70 README: Add more examples
   new  e546671a0e Minor cleanup
   new  7ac6f60b90 README update
   new  d27892f63a Add some utility functions
   new  25621bb80e curl add --fail argument
   new  d776cdb343 Fix melpa issues (See 
https://github.com/melpa/melpa/pull/7936)
   new  f2fba2ebdf Auto rename the buffers
   new  e78a337477 Rename commands
   new  5f47b77d20 Move predeclared variables
   new  2fbf12f0ef seq is not needed
   new  28afc293f9 Improve bookmark and Org link support
   new  640c885460 README: Add example configuration
   new  88e7e36e43 Rename function
   new  2a0bd8c7eb Improve header line
   new  76b41f5fb5 Add keybindings
   new  ff5c089087 Update completion predicates
   new  585346b5e0 Improve bookmark command
   new  b991de6e89 Rename server
   new  9ffe9592ba Simplify code
   new  ee64b96509 Add map variant
   new  03d4ceb553 Add tile memory cache
   new  7a5e1e Add separate resize function, revert tile cache
   new  7a1d920492 Display bookmarks in map
   new  fce584fbae Add osm-bookmark-delete-click
   new  d830691585 README: Remove wishlist
   new  92fb0c72dd Add osm-bookmark-delete
   new  f6c16a4cc4 Improve keybindings
   new  5d8959d9ad Improve keybindings
   new  ff8ff68b4d Check if bookmarks are present
   new  11a04bb5b9 osm-server: Improve completion command
   new  7ce1d26c88 Extract osm--make-tile
   new  b300e42d9f Add transient pin
   new  4c9337bf79 Update README
   new  25d891088f Emacs 27 base64 encoding fallback
   new  7657cb1b3b Add check for image format support
   new  832bce78f8 Implement proper map dragging with the mouse
   new  1b7f4020b3 Fix caching
   new  8e8e4583f5 More robust mouse dragging
   new  d5c5dc6ffd Mouse dragging: Check window
   new  cb191d426f Version 0.2
   new  833793ed6c Use grid placeholder




[elpa] externals/osm db20223911 27/77: Minor cleanup

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit db2022391149e09afc556527d26ed3bede021674
Author: Daniel Mendler 
Commit: Daniel Mendler 

Minor cleanup
---
 osm.el | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/osm.el b/osm.el
index 279cb53542..cfc96a4264 100644
--- a/osm.el
+++ b/osm.el
@@ -34,8 +34,8 @@
 (eval-when-compile (require 'cl-lib))
 
 (defgroup osm nil
-  "OpenStreetMap."
-  :group 'network
+  "OpenStreetMap viewer."
+  :group 'web
   :prefix "osm-")
 
 (defcustom osm-server-list
@@ -87,11 +87,11 @@
   :type '(alist :key-type symbol :value-type plist))
 
 (defcustom osm-large-step 256
-  "Movement step in pixel."
+  "Scroll step in pixel."
   :type 'integer)
 
 (defcustom osm-small-step 16
-  "Movement step in pixel."
+  "Scroll step in pixel."
   :type 'integer)
 
 (defcustom osm-server 'default
@@ -103,8 +103,8 @@
   "Tile cache directory."
   :type 'string)
 
-(defcustom osm-max-age (* 60 60 24 14)
-  "Maximum tile age.
+(defcustom osm-max-age 14
+  "Maximum tile age in days.
 Should be at least 7 days according to the server usage policies."
   :type '(choice (const nil) integer))
 
@@ -386,7 +386,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm--clean-cache ()
   "Clean tile cache."
   (when (and (integerp osm-max-age)
- (> (- (float-time) osm--clean-cache) osm-max-age))
+ (> (- (float-time) osm--clean-cache) (* 60 60 24)))
 (setq osm--clean-cache (float-time))
 (run-with-idle-timer
  30 nil
@@ -400,11 +400,11 @@ We need two distinct images which are not `eq' for the 
display properties.")
(time-since
 (file-attribute-modification-time
  (file-attributes file
-  osm-max-age)
+  (* 60 60 24 osm-max-age))
(delete-file file)))
 
 (define-derived-mode osm-mode special-mode "Osm"
-  "Open Street Map mode."
+  "OpenStreetMap viewer mode."
   :interactive nil
   (osm--clean-cache)
   (setq-local osm-server osm-server



[elpa] externals/osm 2a0bd8c7eb 50/77: Improve header line

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 2a0bd8c7eb23dc33cdcc23dfc07cc7d8defe0f19
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve header line
---
 osm.el | 95 +++---
 1 file changed, 50 insertions(+), 45 deletions(-)

diff --git a/osm.el b/osm.el
index 624f785578..e093b47421 100644
--- a/osm.el
+++ b/osm.el
@@ -514,53 +514,58 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm--queue-info ()
   "Return queue info string."
   (let ((n (length osm--queue)))
-(when (> n 0)
-  (format "(%s/%s)" (length osm--active) n
+(if (> n 0)
+(format "%10s " (format "(%s/%s)" (length osm--active) n))
+  "  ")))
 
 (defun osm--revert (&rest _)
   "Revert buffer."
   (when (eq major-mode #'osm-mode)
 (osm--update)))
 
+(defun osm--header ()
+  "Update header line."
+  (let* ((meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi (expt 2 osm--zoom)))
+ (meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))
+ (server (osm--server-property :name))
+ (idx 0))
+(while (and (< idx (1- (length meter))) (< (/ (nth (1+ idx) meter) 
meter-per-pixel) 100))
+  (cl-incf idx))
+(setq meter (nth idx meter))
+(setq-local
+ header-line-format
+ (list
+  (format "%s %sZ%-2d%s %5s %s %s%s%s %s"
+  (format #("%7.2f°" 0 5 (face bold)) (osm--lat))
+  (format #("%7.2f°" 0 5 (face bold)) (osm--lon))
+  osm--zoom
+  (propertize " " 'display '(space :align-to (- center 10)))
+  (if (>= meter 1000) (/ meter 1000) meter)
+  (if (>= meter 1000) "km" "m")
+  (propertize " " 'face '(:inverse-video t)
+  'display '(space :width (3)))
+  (propertize " " 'face '(:strike-through t)
+  'display `(space :width (,(floor (/ meter 
meter-per-pixel)
+  (propertize " " 'face '(:inverse-video t)
+  'display '(space :width (3)))
+  (propertize " " 'display `(space :align-to (- right ,(+ (length 
server) 12)
+  '(:eval (osm--queue-info))
+  server
+
 (defun osm--update ()
   "Update map display."
   (unless (eq major-mode #'osm-mode)
 (error "Not an osm-mode buffer"))
   (rename-buffer (osm--buffer-name) 'unique)
-  (with-silent-modifications
-(let* ((meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi (expt 2 osm--zoom)))
-   (meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))
-   (windows (or (get-buffer-window-list) (list (frame-root-window
-   (win-width (cl-loop for w in windows maximize (window-pixel-width 
w)))
-   (win-height (cl-loop for w in windows maximize (window-pixel-height 
w)))
-   (idx 0))
-  (setq osm--wx (/ win-width 2)
-osm--wy (/ win-height 2)
-osm--nx (1+ (ceiling win-width 256))
-osm--ny (1+ (ceiling win-height 256)))
-  (while (and (< idx (1- (length meter))) (< (/ (nth (1+ idx) meter) 
meter-per-pixel) 100))
-(cl-incf idx))
-  (setq meter (nth idx meter))
-  (setq-local
-   header-line-format
-   (list
-(format "%s %sZ%-2d%s%s%s %s %s"
-(format #("%7.2f°" 0 5 (face bold)) (osm--lat))
-(format #("%7.2f°" 0 5 (face bold)) (osm--lon))
-osm--zoom
-(propertize " " 'face '(:inverse-video t)
-'display '(space :width (3)))
-(propertize " " 'face '(:strike-through t)
-'display `(space :width (,(floor (/ meter 
meter-per-pixel)
-(propertize " " 'face '(:inverse-video t)
-'display '(space :width (3)))
-(if (>= meter 1000) (/ meter 1000) meter)
-(if (>= meter 1000) "km" "m"))
-'(:eval (osm--queue-info))
-(let ((server (osm--server-property :name)))
-  (concat
-   (propertize " " 'display `(space :align-to (- right ,(length 
server) 2)))
-   server
+  (osm--header)
+  (let* ((windows (or (get-buffer-window-list) (list (frame-root-window
+ (win-width (cl-loop for w in windows maximize (window-pixel-width w)))
+ (win-height (cl-loop for w in windows maximize (window-pixel-height 
w
+(setq osm--wx (/ win-width 2)
+  osm--wy (/ win-height 2)
+  osm--nx (1+ (ceiling win-width 256))
+  osm--ny (1+ (ceiling win-height 256)))
+(with-silent-modifications
   (erase-buffer)
   (dotimes (_j osm--ny)
 (insert (make-string osm--nx ?\s) "\n"))
@@ -571,14 +576,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (y (+ j (/ (- osm--y osm--w

[elpa] externals/osm 5f47b77d20 45/77: Move predeclared variables

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 5f47b77d20ce4988af355addfc08540dfe939aa5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Move predeclared variables
---
 osm.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/osm.el b/osm.el
index 192c785cfd..53ad847661 100644
--- a/osm.el
+++ b/osm.el
@@ -33,6 +33,9 @@
 (require 'seq)
 (eval-when-compile (require 'cl-lib))
 
+(defvar bookmark-current-bookmark)
+(defvar bookmark-make-record-function)
+
 (defgroup osm nil
   "OpenStreetMap viewer."
   :group 'web
@@ -434,7 +437,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (* 60 60 24 osm-max-age))
(delete-file file)))
 
-(defvar bookmark-make-record-function)
 (define-derived-mode osm-mode special-mode "Osm"
   "OpenStreetMap viewer mode."
   :interactive nil
@@ -560,7 +562,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
  #'< osm--queue))
   (osm--download
 
-(defvar bookmark-current-bookmark)
 (defun osm--make-bookmark ()
   "Make OSM bookmark."
   (setq bookmark-current-bookmark nil) ;; Reset bookmark to use new name



[elpa] externals/osm 28afc293f9 47/77: Improve bookmark and Org link support

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 28afc293f9fa17a9fabe45c31b3d9ec0c8bfc024
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve bookmark and Org link support
---
 README.org |  33 ---
 osm-ol.el  |   4 +-
 osm.el | 140 -
 3 files changed, 113 insertions(+), 64 deletions(-)

diff --git a/README.org b/README.org
index e7aefb2cb0..1f41d9d00c 100644
--- a/README.org
+++ b/README.org
@@ -23,11 +23,12 @@
 - Bookmarks
 - Multiple preconfigured servers
 
-* Org links
+* Bookmarks and Org links
 
-Bind =org-store-link= to some key binding, e.g., ~C-c o l~. After pressing 
this key
-binding inside an =osm-mode= buffer the link is stored. Then you can insert 
into
-an Org buffer with ~C-c C-l~.
+To store a bookmark press the key ~b~, to store Org links press the key ~l~. 
You can
+also use a custom binding, e.g., ~C-c l~. Then the link can be inserted into 
an Org
+buffer with ~C-c C-l~. Bookmarks and Org links can be created at point with the
+mouse, see ~osm-bookmark-click~ and ~osm-org-link-click~.
 
 Examples:
 
@@ -46,18 +47,22 @@ Top-level commands:
 - =osm-server=: Select server
 
 Key bindings in =osm-mode= buffer:
-- ~+~ and ~-~: Zooming
-- ~~: Zoom to point
 - ~~: Small step scrolling
 - ~C-~, ~M-~: Large step scrolling
-- ~g~: =osm-goto=
-- ~h~: =osm-home=
-- ~s~: =osm-search=
-- ~S~: =osm-server=
-- ~b~: =bookmark-set=
-- ~B~: =bookmark-jump=
-- ~q~: =quit-window=
-- ~c~: =clone-buffer=
+- ~+~: =osm-zoom-out= - Zoom out
+- ~-~: =osm-zoom-in= - Zoom in
+- ~~: =osm-zoom-click= - Zoom to point
+- ~~: =osm-org-link-click= - Store point as Org link
+- ~~: =osm-bookmark-click= - Store point as bookmark
+- ~g~: =osm-goto= - Go to location
+- ~h~: =osm-home= - Go to home location
+- ~s~: =osm-search= - Search for location
+- ~S~: =osm-server= - Select server
+- ~l~: =org-store-link= - Store org link
+- ~b~: =osm-bookmark= - Set bookmark
+- ~B~: =osm-bookmark-jump= - Jump to bookmark
+- ~q~: =quit-window= - Close buffer and window
+- ~c~: =clone-buffer= - Clone buffer
 
 * Wishlist
 
diff --git a/osm-ol.el b/osm-ol.el
index b18b4aed0e..9a93c2b026 100644
--- a/osm-ol.el
+++ b/osm-ol.el
@@ -27,7 +27,7 @@
 
 ;; Only load osm on demand
 (autoload 'osm--setup "osm")
-(declare-function osm--link-data "osm")
+(declare-function osm--org-link-data "osm")
 
 (org-link-set-parameters
  "osm"
@@ -50,7 +50,7 @@
 (defun osm-ol-store ()
   "Store osm link."
   (when (derived-mode-p 'osm-mode)
-(pcase-let ((`(,lat ,lon ,zoom ,server ,desc) (osm--link-data)))
+(pcase-let ((`(,lat ,lon ,zoom ,server ,desc) (osm--org-link-data)))
   (org-link-store-props
:type "osm"
:description desc
diff --git a/osm.el b/osm.el
index 7c3c6f669c..724c1f19c3 100644
--- a/osm.el
+++ b/osm.el
@@ -30,11 +30,9 @@
 
 ;;; Code:
 
+(require 'bookmark)
 (eval-when-compile (require 'cl-lib))
 
-(defvar bookmark-current-bookmark)
-(defvar bookmark-make-record-function)
-
 (defgroup osm nil
   "OpenStreetMap viewer."
   :group 'web
@@ -47,12 +45,12 @@
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.org/%z/%x/%y.png";)
 (de
- :name "Mapnik:de"
+ :name "Mapnik(de)"
  :description "Localized Mapnik map provided by OpenStreetMap Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.de/%z/%x/%y.png";)
 (fr
- :name "Mapnik:fr"
+ :name "Mapnik(fr)"
  :description "Localized Mapnik map by OpenStreetMap France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.fr/osmfr/%z/%x/%y.png";)
@@ -126,6 +124,8 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "+" #'osm-zoom-in)
 (define-key map "-" #'osm-zoom-out)
 (define-key map [mouse-1] #'osm-zoom-click)
+(define-key map [mouse-2] #'osm-org-link-click)
+(define-key map [mouse-3] #'osm-bookmark-click)
 (define-key map [drag-mouse-1] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
@@ -144,8 +144,9 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "g" #'osm-goto)
 (define-key map "s" #'osm-search)
 (define-key map "S" #'osm-server)
-(define-key map "b" #'bookmark-set)
-(define-key map "B" #'bookmark-jump)
+(define-key map "l" 'org-store-link)
+(define-key map "b" #'osm-bookmark)
+(define-key map "B" #'osm-bookmark-jump)
 (define-key map [remap scroll-down-command] #'osm-down)
 (define-key map [remap scroll-up-command] #'osm-up)
 (define-key map "\d" nil)
@@ -171,6 +172,9 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defvar osm--clean-cache 0
   "Last time the tile cache was cleaned.")
 
+(defvar osm--location-name nil
+  "Location name used by `osm--bookmark-name'.")
+
 (defvar-local osm--url-index 0
   "Current url index to query 

[elpa] externals/osm 458257fa1f 19/77: Improve tile loading

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 458257fa1f402bb5398073f0e5cd74745fd20b78
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve tile loading
---
 osm.el | 122 -
 1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/osm.el b/osm.el
index e5a6c14e8f..11eece996b 100644
--- a/osm.el
+++ b/osm.el
@@ -274,41 +274,40 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm--enqueue (x y)
   "Enqueue tile X/Y for download."
   (let ((job `(,x ,y . ,osm--zoom)))
-(unless (member job osm--queue)
+(unless (or (member job osm--queue) (member job osm--active))
   (setq osm--queue (nconc osm--queue (list job))
 
 (defun osm--download ()
   "Download next tile in queue."
-  (pcase (and (< (length osm--active)
- (* (length (osm--server-property :url))
-(osm--server-property :max-connections)))
-  (pop osm--queue))
-(`(,x ,y . ,zoom)
- (let* ((buffer (current-buffer))
-(dst (osm--tile-file x y zoom))
-(tmp (concat dst ".tmp")))
-   (push
-(make-process
- :name (format "osm %s %s %s" x y zoom)
- :connection-type 'pipe
- :noquery t
- :command
- (list "curl" "-s" "-o" tmp (osm--tile-url x y zoom))
- :filter #'ignore
- :sentinel
- (lambda (proc status)
-   (when (buffer-live-p buffer)
- (with-current-buffer buffer
-   (when (and (string-match-p "finished" status)
-  (eq osm--zoom zoom))
- (ignore-errors (rename-file tmp dst t))
- (osm--put x y))
-   (delete-file tmp)
-   (force-mode-line-update)
-   (setq osm--active (delq proc osm--active))
-   (osm--download)
-osm--active)
-   (osm--download)
+  (when-let (job (and (< (length osm--active)
+ (* (length (osm--server-property :url))
+(osm--server-property :max-connections)))
+  (pop osm--queue)))
+(push job osm--active)
+(pcase-let* ((`(,x ,y . ,zoom) job)
+ (buffer (current-buffer))
+ (dst (osm--tile-file x y zoom))
+ (tmp (concat dst ".tmp")))
+  (make-process
+   :name (format "osm %s %s %s" x y zoom)
+   :connection-type 'pipe
+   :noquery t
+   :command
+   (list "curl" "-s" "-o" tmp (osm--tile-url x y zoom))
+   :filter #'ignore
+   :sentinel
+   (lambda (_proc status)
+ (when (buffer-live-p buffer)
+   (with-current-buffer buffer
+ (when (and (string-match-p "finished" status)
+(eq osm--zoom zoom))
+   (ignore-errors (rename-file tmp dst t))
+   (osm--display-tile x y))
+ (delete-file tmp)
+ (force-mode-line-update)
+ (setq osm--active (delq job osm--active))
+ (osm--download)
+  (osm--download
 
 (defun osm-click (event)
   "Handle click EVENT."
@@ -439,28 +438,30 @@ We need two distinct images which are not `eq' for the 
display properties.")
   fringe-indicator-alist '((truncation . nil)))
   (add-hook 'window-size-change-functions #'osm--update nil 'local))
 
-(defun osm--put (x y &optional image)
-  "Put tile IMAGE at X/Y."
-  (let* ((i (- x (/ (- osm--x osm--wx) 256)))
- (j (- y (/ (- osm--y osm--wy) 256)))
- (mx (if (= 0 i) (mod (- osm--x osm--wx) 256) 0))
- (my (if (= 0 j) (mod (- osm--y osm--wy) 256) 0))
- (pos (+ (point-min) (* j (1+ osm--nx)) i)))
+(defun osm--display-tile (x y)
+  "Display tile at X/Y."
+  (let ((i (- x (/ (- osm--x osm--wx) 256)))
+(j (- y (/ (- osm--y osm--wy) 256
 (when (and (>= i 0) (< i osm--nx) (>= j 0) (< j osm--ny))
-  (unless image
-(let ((file (osm--tile-file x y osm--zoom)))
-  (setq image
-`(image :type
-,(if (member (file-name-extension file) '("jpg" 
"jpeg"))
- 'jpeg 'png)
-:file ,file
-:width 256 :height 256
-  (with-silent-modifications
-(put-text-property
- pos (1+ pos) 'display
- (if (or (/= 0 mx) (/= 0 my))
- `((slice ,mx ,my ,(- 256 mx) ,(- 256 my)) ,image)
-   image))
+  (let* ((mx (if (= 0 i) (mod (- osm--x osm--wx) 256) 0))
+ (my (if (= 0 j) (mod (- osm--y osm--wy) 256) 0))
+ (pos (+ (point-min) (* j (1+ osm--nx)) i))
+ (file (osm--tile-file x y osm--zoom))
+ (image (cond
+ ((file-exists-p file)
+  `(image :type
+  ,(if (member (file-name-extension file) '("jpg" 
"jpeg"))
+   'jpeg 'png)
+   

[elpa] externals/osm 24d369d9c0 02/77: Configurable cache cleaning

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 24d369d9c01a0ad97a27d5b9b7c2f3cb799b9d23
Author: Daniel Mendler 
Commit: Daniel Mendler 

Configurable cache cleaning
---
 osm.el | 31 ++-
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/osm.el b/osm.el
index ff552647e6..df44d9c753 100644
--- a/osm.el
+++ b/osm.el
@@ -73,6 +73,11 @@
   "Tile cache directory."
   :type 'string)
 
+(defcustom osm-tile-max-age (* 60 60 24 14)
+  "Maximum tile age.
+Should be at least 7 days according to the server usage policies."
+  :type '(choice (const nil) integer))
+
 (defconst osm--placeholder1
   `(image :type xbm :width 256 :height 256 :background nil
   :data ,(make-bool-vector (* 256 256) nil)))
@@ -80,6 +85,7 @@
 
 (defvar osm--search-history nil)
 
+(defvar osm--clean-cache 0)
 (defvar-local osm--url-index 0)
 (defvar-local osm--queue nil)
 (defvar-local osm--active nil)
@@ -289,22 +295,29 @@
 map)
   "Keymap used by `osm-mode'.")
 
-(define-derived-mode osm-mode special-mode "Osm"
-  "Open Street Map mode."
-  :interactive nil
-  (let ((cache (osm--tile-cache)))
-(unless (file-exists-p cache)
-  (make-directory cache t))
+(defun osm--clean-cache ()
+  "Clean tile cache."
+  (when (and (integerp osm-tile-max-age)
+ (> (- (float-time) osm--clean-cache) osm-tile-max-age))
+(setq osm--clean-cache (float-time))
 (run-with-idle-timer
  30 nil
  (lambda ()
-   (dolist (file (directory-files cache 'full "\\.png\\'" 'nosort))
+   (dolist (file (directory-files-recursively osm-tile-cache "\\.png\\'" 
nil))
  (when (> (float-time
(time-since
 (file-attribute-modification-time
  (file-attributes file
-  (* 60 60 24 7))
-   (delete-file file))
+  osm-tile-max-age)
+   (delete-file file)))
+
+(define-derived-mode osm-mode special-mode "Osm"
+  "Open Street Map mode."
+  :interactive nil
+  (let ((cache (osm--tile-cache)))
+(unless (file-exists-p cache)
+  (make-directory cache t)))
+  (osm--clean-cache)
   (setq-local line-spacing nil
   cursor-type nil
   left-fringe-width 1



[elpa] externals/osm b30d48f7cb 12/77: Move code around

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit b30d48f7cb6fb67953676a6a7caca70c4e686822
Author: Daniel Mendler 
Commit: Daniel Mendler 

Move code around
---
 ol-osm.el |  2 +-
 osm.el| 86 ++-
 2 files changed, 47 insertions(+), 41 deletions(-)

diff --git a/ol-osm.el b/ol-osm.el
index 7baace2e8d..2186f48233 100644
--- a/ol-osm.el
+++ b/ol-osm.el
@@ -26,7 +26,7 @@
 (require 'ol)
 
 ;; Only load osm on demand
-(autoload 'osm-goto "osm")
+(declare-function osm-goto "osm")
 (declare-function osm--link-data "osm")
 
 (org-link-set-parameters
diff --git a/osm.el b/osm.el
index a08ae24ae6..1c96230aa5 100644
--- a/osm.el
+++ b/osm.el
@@ -106,7 +106,8 @@
   "Tile server name."
   :type 'symbol)
 
-(defcustom osm-cache-directory (file-name-concat user-emacs-directory 
"var/osm/")
+(defcustom osm-cache-directory
+  (file-name-concat user-emacs-directory "var/osm/")
   "Tile cache directory."
   :type 'string)
 
@@ -115,8 +116,40 @@
 Should be at least 7 days according to the server usage policies."
   :type '(choice (const nil) integer))
 
+(defvar osm-mode-map
+  (let ((map (make-sparse-keymap)))
+(define-key map "+" #'osm-larger)
+(define-key map "-" #'osm-smaller)
+(define-key map [up] #'osm-up)
+(define-key map [down] #'osm-down)
+(define-key map [left] #'osm-left)
+(define-key map [right] #'osm-right)
+(define-key map [C-up] #'osm-up-large)
+(define-key map [C-down] #'osm-down-large)
+(define-key map [C-left] #'osm-left-large)
+(define-key map [C-right] #'osm-right-large)
+(define-key map [M-up] #'osm-up-large)
+(define-key map [M-down] #'osm-down-large)
+(define-key map [M-left] #'osm-left-large)
+(define-key map [M-right] #'osm-right-large)
+(define-key map "c" #'clone-buffer)
+(define-key map "g" #'osm-goto)
+(define-key map "s" #'osm-search)
+(define-key map "b" #'bookmark-set)
+(define-key map "B" #'bookmark-jump)
+(define-key map [remap scroll-down-command] #'osm-down)
+(define-key map [remap scroll-up-command] #'osm-up)
+(define-key map "\d" nil)
+(define-key map (kbd "S-SPC") nil)
+(define-key map " " nil)
+(define-key map "<" nil)
+(define-key map ">" nil)
+map)
+  "Keymap used by `osm-mode'.")
+
 (defconst osm--placeholder1
-  `(image :type xbm :width 256 :height 256 :data ,(make-bool-vector (* 256 
256) nil))
+  `(image :type xbm :width 256 :height 256
+  :data ,(make-bool-vector (* 256 256) nil))
   "First placeholder image for tiles.")
 
 (defconst osm--placeholder2 `(image ,@(cdr osm--placeholder1))
@@ -321,37 +354,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (interactive "p")
   (osm-right-large (- (or n 1
 
-(defvar osm-mode-map
-  (let ((map (make-sparse-keymap)))
-(define-key map "+" #'osm-larger)
-(define-key map "-" #'osm-smaller)
-(define-key map [up] #'osm-up)
-(define-key map [down] #'osm-down)
-(define-key map [left] #'osm-left)
-(define-key map [right] #'osm-right)
-(define-key map [C-up] #'osm-up-large)
-(define-key map [C-down] #'osm-down-large)
-(define-key map [C-left] #'osm-left-large)
-(define-key map [C-right] #'osm-right-large)
-(define-key map [M-up] #'osm-up-large)
-(define-key map [M-down] #'osm-down-large)
-(define-key map [M-left] #'osm-left-large)
-(define-key map [M-right] #'osm-right-large)
-(define-key map "c" #'clone-buffer)
-(define-key map "g" #'osm-goto)
-(define-key map "s" #'osm-search)
-(define-key map "b" #'bookmark-set)
-(define-key map "B" #'bookmark-jump)
-(define-key map [remap scroll-down-command] #'osm-down)
-(define-key map [remap scroll-up-command] #'osm-up)
-(define-key map "\d" nil)
-(define-key map (kbd "S-SPC") nil)
-(define-key map " " nil)
-(define-key map "<" nil)
-(define-key map ">" nil)
-map)
-  "Keymap used by `osm-mode'.")
-
 (defun osm--clean-cache ()
   "Clean tile cache."
   (when (and (integerp osm-max-age)
@@ -401,11 +403,12 @@ We need two distinct images which are not `eq' for the 
display properties.")
(>= j 0) (< j osm--height))
   (unless image
 (let ((file (osm--tile-file x y osm--zoom)))
-  (setq image `(image :type
-  ,(if (member (file-name-extension file) '("jpg" 
"jpeg"))
-   'jpeg 'png)
-  :file ,file
-  :width 256 :height 256
+  (setq image
+`(image :type
+,(if (member (file-name-extension file) '("jpg" 
"jpeg"))
+ 'jpeg 'png)
+:file ,file
+:width 256 :height 256
   (with-silent-modifications
 (put-text-property
  pos (1+ pos) 'display
@@ -497,6 +500,7 @@ We need two distinct images which are not `eq' for the 
disp

[elpa] externals/osm 305aea000b 03/77: Use cl-loop

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 305aea000bcf6a09c5148feabd1ca72c7b7e1a30
Author: Daniel Mendler 
Commit: Daniel Mendler 

Use cl-loop
---
 osm.el | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/osm.el b/osm.el
index df44d9c753..19f4141c89 100644
--- a/osm.el
+++ b/osm.el
@@ -196,18 +196,16 @@ Should be at least 7 days according to the server usage 
policies."
   "Zoom N times into the map."
   (interactive "p")
   (setq n (or n 1))
-  (while (> n 0)
-(when (< osm--zoom (osm--server-property :max-zoom))
-  (setq osm--zoom (1+ osm--zoom)
-osm--x (* osm--x 2)
-osm--y (* osm--y 2)))
-(cl-decf n))
-  (while (< n 0)
-(when (> osm--zoom (osm--server-property :min-zoom))
-  (setq osm--zoom (1- osm--zoom)
-osm--x (/ osm--x 2)
-osm--y (/ osm--y 2)))
-(cl-incf n))
+  (cl-loop for i from n above 0
+   if (< osm--zoom (osm--server-property :max-zoom)) do
+   (setq osm--zoom (1+ osm--zoom)
+ osm--x (* osm--x 2)
+ osm--y (* osm--y 2)))
+  (cl-loop for i from n below 0
+   if (> osm--zoom (osm--server-property :min-zoom)) do
+   (setq osm--zoom (1- osm--zoom)
+ osm--x (/ osm--x 2)
+ osm--y (/ osm--y 2)))
   (osm--update))
 
 (defun osm-smaller (&optional n)



[elpa] externals/osm 5f002af18c 24/77: Fix file extraction

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 5f002af18cb61a80dc11913d2f9d871f52311470
Author: Daniel Mendler 
Commit: Daniel Mendler 

Fix file extraction
---
 osm.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index 8494b6f8af..e78c6c4c2c 100644
--- a/osm.el
+++ b/osm.el
@@ -243,7 +243,9 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm--tile-file (x y zoom)
   "Return tile file name for coordinate X, Y and ZOOM."
   (format "%s%d-%d-%d.%s" (osm--cache-directory) zoom x y
-  (file-name-extension (osm--server-property :url
+  (file-name-extension
+   (url-file-nondirectory
+(osm--server-property :url)
 
 (defun osm--cache-directory ()
   "Return tile cache directory."



[elpa] externals/osm ad12c93f57 01/77: Initial commit

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit ad12c93f577723865a5a0135336d1ed5dbd38639
Author: Daniel Mendler 
Commit: Daniel Mendler 

Initial commit
---
 LICENSE| 674 +
 README.org |  59 ++
 ol-osm.el  |  54 +
 osm.el | 521 +++
 4 files changed, 1308 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00..94a9ed024d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Pr

[elpa] externals/osm ff8ff68b4d 65/77: Check if bookmarks are present

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit ff8ff68b4dc395ea7545e9b669cefc94ee44c249
Author: Daniel Mendler 
Commit: Daniel Mendler 

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)



[elpa] externals/osm 25d891088f 70/77: Emacs 27 base64 encoding fallback

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 25d891088f5ad07d4753309cfb7f240f84f74229
Author: Daniel Mendler 
Commit: Daniel Mendler 

Emacs 27 base64 encoding fallback
---
 osm.el | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/osm.el b/osm.el
index e684770fb6..411e056ce6 100644
--- a/osm.el
+++ b/osm.el
@@ -543,6 +543,7 @@ Should be at least 7 days according to the server usage 
policies."
 (nconc pins (list (cons "#ff0088" pin)))
   pins)))
 
+(autoload 'svg--image-data "svg")
 (defun osm--make-tile (x y)
   "Make tile at X/Y from FILE."
   (let ((file (osm--tile-file x y osm--zoom)))
@@ -553,15 +554,26 @@ Should be at least 7 days according to the server usage 
policies."
   (list :type 'svg :base-uri file
 :data (concat "
-"
-(mapconcat
- (pcase-lambda (`(,color ,x . ,y))
-   (format "
+"
+  (mapconcat
+   (pcase-lambda (`(,color ,x . ,y))
+ (format "
+
 
 
 " color x y))
- pins "")
-""))
+   pins "")
+  ""))
 (list :type
   (if (member (file-name-extension file) '("jpg" "jpeg"))
   'jpeg 'png)



[elpa] externals/osm 03d4ceb553 57/77: Add tile memory cache

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 03d4ceb553744a28db67b4ed3a7245a23b215f07
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add tile memory cache
---
 osm.el | 36 
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/osm.el b/osm.el
index d12fed13e2..0dd3b9084c 100644
--- a/osm.el
+++ b/osm.el
@@ -124,6 +124,10 @@
 Should be at least 7 days according to the server usage policies."
   :type '(choice (const nil) integer))
 
+(defcustom osm-max-tiles 256
+  "Size of tile memory cache."
+  :type '(choice (const nil) integer))
+
 (defvar osm-mode-map
   (let ((map (make-sparse-keymap)))
 (define-key map "+" #'osm-zoom-in)
@@ -173,6 +177,12 @@ Should be at least 7 days according to the server usage 
policies."
 (defvar osm--clean-cache 0
   "Last time the tile cache was cleaned.")
 
+(defvar osm--tiles nil
+  "Global tile memory cache.")
+
+(defvar osm--cookie 0
+  "Tile cache cookie.")
+
 (defvar-local osm--url-index 0
   "Current url index to query the servers in a round-robin fashion.")
 
@@ -481,10 +491,21 @@ Should be at least 7 days according to the server usage 
policies."
 
 (defun osm--get-tile (x y)
   "Get tile at X/Y."
-  (let ((file (osm--tile-file x y osm--zoom)))
-(when (file-exists-p file)
-  `(image :type ,(if (member (file-name-extension file) '("jpg" "jpeg")) 
'jpeg 'png)
-  :width 256 :height 256 :file ,file
+  (let* ((key `(,osm-server ,osm--zoom ,x . ,y))
+ (tile (and osm--tiles (gethash key osm--tiles
+(if tile
+(progn (setcar tile osm--cookie) (cdr tile))
+  (let ((file (osm--tile-file x y osm--zoom)))
+(when (file-exists-p file)
+  (when (and osm-max-tiles (not osm--tiles))
+(setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles)))
+  (setq tile
+`(,osm--cookie
+  image :type ,(if (member (file-name-extension file) '("jpg" 
"jpeg")) 'jpeg 'png)
+  :width 256 :height 256 :file ,file))
+  (when osm--tiles
+(puthash key tile osm--tiles))
+  (cdr tile))
 
 (defun osm--display-tile (x y tile)
   "Display TILE at X/Y."
@@ -575,6 +596,13 @@ Should be at least 7 days according to the server usage 
policies."
  (tile (osm--get-tile x y)))
 (osm--display-tile x y tile)
 (unless tile (osm--enqueue x y))
+(cl-incf osm--cookie)
+(when (and osm--tiles (> (hash-table-count osm--tiles) osm-max-tiles))
+  (let (items)
+(maphash (lambda (k v) (push (cons (car v) k) items)) osm--tiles)
+(setq items (sort items #'car-less-than-car))
+(dotimes (_ (- (hash-table-count osm--tiles) osm-max-tiles))
+  (remhash (cdr (pop items)) osm--tiles
 (setq osm--queue
   (sort osm--queue
 (pcase-lambda (`(,x1 ,y1 . ,_z1) `(,x2 ,y2 . ,_z2))



[elpa] externals/osm f6c16a4cc4 63/77: Improve keybindings

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit f6c16a4cc4b323a85c4d1b576d1ce23e925b129d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve keybindings
---
 README.org | 4 ++--
 osm.el | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 9cf7f77851..b73a0d77ec 100644
--- a/README.org
+++ b/README.org
@@ -29,7 +29,7 @@
   (use-package osm
 :bind (("C-c m h" . osm-home)
("C-c m s" . osm-search)
-   ("C-c m S" . osm-server)
+   ("C-c m t" . osm-server)
("C-c m g" . osm-goto))
 :init
 ;; Load Org link support
@@ -72,7 +72,7 @@ Key bindings in =osm-mode= buffer:
 - ~g~: =osm-goto= - Go to location
 - ~h~: =osm-home= - Go to home location
 - ~s~: =osm-search= - Search for location
-- ~S~: =osm-server= - Select server
+- ~t~: =osm-server= - Select tile server
 - ~l~: =org-store-link= - Store org link
 - ~b~: =osm-bookmark-set= - Set bookmark
 - ~B~: =osm-bookmark-jump= - Jump to bookmark
diff --git a/osm.el b/osm.el
index 561e273b3e..bb97a00690 100644
--- a/osm.el
+++ b/osm.el
@@ -156,7 +156,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "h" #'osm-home)
 (define-key map "g" #'osm-goto)
 (define-key map "s" #'osm-search)
-(define-key map "S" #'osm-server)
+(define-key map "t" #'osm-server)
 (define-key map "l" 'org-store-link)
 (define-key map "b" #'osm-bookmark-set)
 (define-key map "B" #'osm-bookmark-jump)
@@ -848,7 +848,7 @@ MSG is a message prefix string."
 
 ;;;###autoload
 (defun osm-server (server)
-  "Select SERVER."
+  "Select tile SERVER."
   (interactive
(let* ((fmt #("%-20s %s" 6 8 (face font-lock-comment-face)))
   (servers



[elpa] externals/osm ec97b1d1c0 23/77: Add separate hook function

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit ec97b1d1c0f10f82494277a7928123b1310b44a0
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add separate hook function
---
 osm.el | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/osm.el b/osm.el
index 1dd77fa9c3..8494b6f8af 100644
--- a/osm.el
+++ b/osm.el
@@ -420,10 +420,10 @@ We need two distinct images which are not `eq' for the 
display properties.")
   show-trailing-whitespace nil
   display-line-numbers nil
   buffer-read-only t
-  revert-buffer-function #'osm--update
+  revert-buffer-function #'osm--revert
   bookmark-make-record-function #'osm--make-bookmark
   fringe-indicator-alist '((truncation . nil)))
-  (add-hook 'window-size-change-functions #'osm--update nil 'local))
+  (add-hook 'window-size-change-functions #'osm--revert nil 'local))
 
 (defun osm--display-tile (x y)
   "Display tile at X/Y."
@@ -467,7 +467,12 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (when (> n 0)
   (format "(%s/%s)" (length osm--active) n
 
-(defun osm--update (&rest _)
+(defun osm--revert (&rest _)
+  "Revert buffer."
+  (when (derived-mode-p #'osm-mode)
+(osm--update)))
+
+(defun osm--update ()
   "Update map display."
   (unless (derived-mode-p #'osm-mode)
 (error "Not an osm-mode buffer"))



[elpa] externals/osm e546671a0e 38/77: Minor cleanup

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit e546671a0ed87cae748ced499442b98980d3a0e1
Author: Daniel Mendler 
Commit: Daniel Mendler 

Minor cleanup
---
 osm.el | 52 +---
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/osm.el b/osm.el
index aee90ed706..3da392f61d 100644
--- a/osm.el
+++ b/osm.el
@@ -276,9 +276,10 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--enqueue (x y)
   "Enqueue tile X/Y for download."
-  (let ((job `(,x ,y . ,osm--zoom)))
-(unless (or (member job osm--queue) (member job osm--active))
-  (setq osm--queue (nconc osm--queue (list job))
+  (when (let ((n (expt 2 osm--zoom))) (and (>= x 0) (>= y 0) (< x n) (< y n)))
+(let ((job `(,x ,y . ,osm--zoom)))
+  (unless (or (member job osm--queue) (member job osm--active))
+(setq osm--queue (nconc osm--queue (list job)))
 
 (defun osm--download ()
   "Download next tile in queue."
@@ -311,7 +312,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (when (and (string-match-p "finished" status)
 (eq osm--zoom zoom))
(ignore-errors (rename-file tmp dst t))
-   (osm--display-tile x y))
+   (osm--display-tile x y (osm--get-tile x y)))
  (delete-file tmp)
  (force-mode-line-update)
  (setq osm--active (delq job osm--active))
@@ -451,30 +452,29 @@ We need two distinct images which are not `eq' for the 
display properties.")
   bookmark-make-record-function #'osm--make-bookmark)
   (add-hook 'window-size-change-functions #'osm--revert nil 'local))
 
-(defun osm--display-tile (x y)
-  "Display tile at X/Y."
+(defun osm--get-tile (x y)
+  "Get tile at X/Y."
+  (let ((file (osm--tile-file x y osm--zoom)))
+(when (file-exists-p file)
+  `(image :type ,(if (member (file-name-extension file) '("jpg" "jpeg")) 
'jpeg 'png)
+  :width 256 :height 256 :file ,file
+
+(defun osm--display-tile (x y tile)
+  "Display TILE at X/Y."
   (let ((i (- x (/ (- osm--x osm--wx) 256)))
 (j (- y (/ (- osm--y osm--wy) 256
 (when (and (>= i 0) (< i osm--nx) (>= j 0) (< j osm--ny))
   (let* ((mx (if (= 0 i) (mod (- osm--x osm--wx) 256) 0))
  (my (if (= 0 j) (mod (- osm--y osm--wy) 256) 0))
- (pos (+ (point-min) (* j (1+ osm--nx)) i))
- (file (osm--tile-file x y osm--zoom))
- (image (cond
- ((file-exists-p file)
-  `(image :type
-  ,(if (member (file-name-extension file) '("jpg" 
"jpeg"))
-   'jpeg 'png)
-  :file ,file
-  :width 256 :height 256))
- ((= 0 (mod i 2)) osm--placeholder1)
- (t osm--placeholder2
+ (pos (+ (point-min) (* j (1+ osm--nx)) i)))
+(unless tile
+  (setq tile (if (= 0 (mod i 2)) osm--placeholder1 osm--placeholder2)))
 (with-silent-modifications
   (put-text-property
pos (1+ pos) 'display
(if (or (/= 0 mx) (/= 0 my))
-   `((slice ,mx ,my ,(- 256 mx) ,(- 256 my)) ,image)
- image)))
+   `((slice ,mx ,my ,(- 256 mx) ,(- 256 my)) ,tile)
+ tile)))
 
 ;;;###autoload
 (defun osm-home ()
@@ -498,8 +498,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (unless (eq major-mode #'osm-mode)
 (error "Not an osm-mode buffer"))
   (with-silent-modifications
-(let* ((size (expt 2 osm--zoom))
-   (meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi size))
+(let* ((meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi (expt 2 osm--zoom)))
(meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))
(windows (or (get-buffer-window-list) (list (frame-root-window
(win-width (cl-loop for w in windows maximize (window-pixel-width 
w)))
@@ -535,12 +534,11 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (goto-char (point-min))
   (dotimes (j osm--ny)
 (dotimes (i osm--nx)
-  (let ((x (+ i (/ (- osm--x osm--wx) 256)))
-(y (+ j (/ (- osm--y osm--wy) 256
-(osm--display-tile x y)
-(when (and (>= x 0) (>= y 0) (< x size) (< y size)
-   (not (file-exists-p (osm--tile-file x y osm--zoom
-  (osm--enqueue x y)
+  (let* ((x (+ i (/ (- osm--x osm--wx) 256)))
+ (y (+ j (/ (- osm--y osm--wy) 256)))
+ (tile (osm--get-tile x y)))
+(osm--display-tile x y tile)
+(unless tile (osm--enqueue x y)
   (setq osm--queue
 (seq-sort-b

[elpa] externals/osm 25621bb80e 41/77: curl add --fail argument

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 25621bb80e1cccf68efea69ddf95aba9f5a1edcd
Author: Daniel Mendler 
Commit: Daniel Mendler 

curl add --fail argument
---
 osm.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/osm.el b/osm.el
index 413b080246..e864e0e469 100644
--- a/osm.el
+++ b/osm.el
@@ -311,7 +311,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
:connection-type 'pipe
:noquery t
:command
-   (list "curl" "-s" "-o" tmp (osm--tile-url x y zoom))
+   (list "curl" "-f" "-s" "-o" tmp (osm--tile-url x y zoom))
:filter #'ignore
:sentinel
(lambda (_proc status)
@@ -675,7 +675,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (json-parse-string
(shell-command-to-string
 (concat
- "curl -s "
+ "curl -f -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)
@@ -705,7 +705,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   nil nil nil 'osm--search-history))
  (json (json-parse-string
 (shell-command-to-string
- (concat "curl -s "
+ (concat "curl -f -s "
  (shell-quote-argument
   (concat 
"https://nominatim.openstreetmap.org/search?format=json&q=";
   (url-encode-url search)



[elpa] externals/osm 7ac6f60b90 39/77: README update

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 7ac6f60b90bb1c57a7be2b50c1dc69cc727e6b06
Author: Daniel Mendler 
Commit: Daniel Mendler 

README update
---
 README.org | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index 98adeaebac..0454772f0b 100644
--- a/README.org
+++ b/README.org
@@ -66,12 +66,8 @@ Key bindings in =osm-mode= buffer:
 * Wishlist
 
 It would be nice to have overlays on top of the map, location markers, routes,
-GPS tracks, etc. Emacs does not have the ability to place different images on
-top of each other, except via SVG. Therefore this requires us to use SVG tiles
-instead of the current PNG tiles. The PNG tiles can be used as backgrounds of
-the corresponding SVG tiles. Alternatively don't use SVG tiles but render
-everything as one large SVG or off load the entire map rendering to an external
-Image Magick process. Maybe that's still efficient enough?
+GPS tracks, etc. In the [[https://github.com/minad/osm/tree/svg][svg branch]] 
I experiment with SVG tiles, composed of the
+bitmap background and markers on top.
 
 * Related projects
 



[elpa] externals/osm ff5c089087 52/77: Update completion predicates

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit ff5c089087d9f1dca1172b2f1ebb40a8c2924c0c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Update completion predicates
---
 osm.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index 89f8e9d269..e6b9e23cb6 100644
--- a/osm.el
+++ b/osm.el
@@ -770,8 +770,10 @@ MSG is a message prefix string."
 
 (dolist (sym (list #'osm-up #'osm-down #'osm-left #'osm-right
#'osm-up-up #'osm-down-down #'osm-left-left 
#'osm-right-right
-   #'osm-zoom-out #'osm-zoom-in))
+   #'osm-zoom-out #'osm-zoom-in #'osm-bookmark 
#'osm-bookmark-jump))
   (put sym 'command-modes '(osm-mode)))
+(dolist (sym (list #'osm-drag #'osm-zoom-click #'osm-bookmark-click 
#'osm-org-link-click))
+  (put sym 'completion-predicate #'ignore))
 
 (provide 'osm)
 ;;; osm.el ends here



[elpa] externals/osm 8e8e4583f5 74/77: More robust mouse dragging

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 8e8e4583f57a4fd00415d63c967af3d7868effcd
Author: Daniel Mendler 
Commit: Daniel Mendler 

More robust mouse dragging
---
 README.org | 2 +-
 osm.el | 9 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 0faaa05271..03ca23fb60 100644
--- a/README.org
+++ b/README.org
@@ -72,7 +72,7 @@ Key bindings in =osm-mode= buffer:
 - ~~: =osm-org-link-click= - Store point as Org link
 - ~~: =osm-bookmark-set-click= - Store point as bookmark
 - ~~: =osm-bookmark-delete-click= - Delete bookmark at point
-- ~~: =osm-drag= - Drag the map with the mouse
+- ~~: =osm-drag= - Drag the map with the mouse
 - ~g~: =osm-goto= - Go to location
 - ~h~: =osm-home= - Go to home location
 - ~s~: =osm-search= - Search for location
diff --git a/osm.el b/osm.el
index 9a49869c26..470e71b25d 100644
--- a/osm.el
+++ b/osm.el
@@ -140,6 +140,8 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map [mouse-3] #'osm-bookmark-set-click)
 (define-key map [S-mouse-3] #'osm-bookmark-delete-click)
 (define-key map [down-mouse-1] #'osm-drag)
+(define-key map [down-mouse-2] #'osm-drag)
+(define-key map [down-mouse-3] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
 (define-key map [left] #'osm-left)
@@ -357,12 +359,17 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map [mouse-movement]
   (lambda (event)
 (interactive "@e")
+(define-key map [mouse-1] #'ignore)
+(define-key map [mouse-2] #'ignore)
+(define-key map [mouse-3] #'ignore)
 (pcase-let ((`(,ex . ,ey) (posn-x-y (event-start event
   (setq osm--x (- sx ex)
 osm--y (- sy ey))
   (osm--update
 (setq track-mouse 'dragging)
-(set-transient-map map t (lambda () (setq track-mouse nil)
+(set-transient-map map
+   (lambda () (eq (car-safe last-input-event) 
'mouse-movement))
+   (lambda () (setq track-mouse nil)
 
 (defun osm-zoom-click (event)
   "Zoom to the location of the click EVENT."



[elpa] externals/osm 76b41f5fb5 51/77: Add keybindings

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 76b41f5fb5e53aa349d5698d7ba67c4d346dee8f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add keybindings
---
 README.org | 4 ++--
 osm.el | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 937484866d..4190c84fe2 100644
--- a/README.org
+++ b/README.org
@@ -63,8 +63,8 @@ Top-level commands:
 Key bindings in =osm-mode= buffer:
 - ~~: Small step scrolling
 - ~C-~, ~M-~: Large step scrolling
-- ~+~: =osm-zoom-out= - Zoom out
-- ~-~: =osm-zoom-in= - Zoom in
+- ~+~, ~SPC~: =osm-zoom-in= - Zoom in
+- ~-~, ~S-SPC~: =osm-zoom-out= - Zoom out
 - ~~: =osm-zoom-click= - Zoom to point
 - ~~: =osm-org-link-click= - Store point as Org link
 - ~~: =osm-bookmark-click= - Store point as bookmark
diff --git a/osm.el b/osm.el
index e093b47421..89f8e9d269 100644
--- a/osm.el
+++ b/osm.el
@@ -123,6 +123,9 @@ Should be at least 7 days according to the server usage 
policies."
   (let ((map (make-sparse-keymap)))
 (define-key map "+" #'osm-zoom-in)
 (define-key map "-" #'osm-zoom-out)
+(define-key map " " #'osm-zoom-in)
+(define-key map (kbd "S-SPC") #'osm-zoom-out)
+(define-key map "\d" #'osm-zoom-out)
 (define-key map [mouse-1] #'osm-zoom-click)
 (define-key map [mouse-2] #'osm-org-link-click)
 (define-key map [mouse-3] #'osm-bookmark-click)
@@ -149,9 +152,6 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "B" #'osm-bookmark-jump)
 (define-key map [remap scroll-down-command] #'osm-down)
 (define-key map [remap scroll-up-command] #'osm-up)
-(define-key map "\d" nil)
-(define-key map (kbd "S-SPC") nil)
-(define-key map " " nil)
 (define-key map "<" nil)
 (define-key map ">" nil)
 map)



[elpa] externals/osm 585346b5e0 53/77: Improve bookmark command

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 585346b5e001fb32847f51cf8c1043f57396f90a
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve bookmark command
---
 osm.el | 56 ++--
 1 file changed, 26 insertions(+), 30 deletions(-)

diff --git a/osm.el b/osm.el
index e6b9e23cb6..ff22173f7d 100644
--- a/osm.el
+++ b/osm.el
@@ -172,9 +172,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defvar osm--clean-cache 0
   "Last time the tile cache was cleaned.")
 
-(defvar osm--location-name nil
-  "Location name used by `osm--bookmark-name'.")
-
 (defvar-local osm--url-index 0
   "Current url index to query the servers in a round-robin fashion.")
 
@@ -595,13 +592,13 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--org-link-data ()
   "Return Org link data."
-  (let ((osm--location-name (osm--location-name "Org link")))
-(list (osm--lat) (osm--lon) osm--zoom
-  (and (not (eq osm-server (default-value 'osm-server))) osm-server)
-  (let ((name (string-remove-prefix "osm: " (osm--bookmark-name
-(if (eq osm-server (default-value 'osm-server))
-(string-remove-suffix (concat " " (osm--server-property 
:name)) name)
-  name)
+  (list (osm--lat) (osm--lon) osm--zoom
+(and (not (eq osm-server (default-value 'osm-server))) osm-server)
+(let ((name (string-remove-prefix
+ "osm: " (osm--bookmark-name (osm--location-name "Org 
link")
+  (if (eq osm-server (default-value 'osm-server))
+  (string-remove-suffix (concat " " (osm--server-property :name)) 
name)
+name
 
 (defun osm--buffer-name ()
   "Return buffer name."
@@ -609,10 +606,10 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (osm--lat) (osm--lon) osm--zoom
   (osm--server-property :name)))
 
-(defun osm--bookmark-name ()
-  "Return bookmark name."
+(defun osm--bookmark-name (&optional loc)
+  "Return bookmark name with optional LOC name."
   (format "osm: %s%.2f° %.2f° Z%s %s"
-  (if osm--location-name (concat osm--location-name ", ") "")
+  (if loc (concat loc ", ") "")
   (osm--lat) (osm--lon) osm--zoom
   (osm--server-property :name)))
 
@@ -687,28 +684,27 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm-bookmark ()
   "Create osm bookmark."
   (interactive)
-  (let ((osm--location-name (osm--location-name "Bookmark")))
-(call-interactively #'bookmark-set)))
+  (let* ((def (osm--bookmark-name (osm--location-name "Bookmark")))
+ (name (read-from-minibuffer "Bookmark name: " def nil nil nil def)))
+(bookmark-set name)
+(message "Stored bookmark: %s" name)))
 
 (defun osm--location-name (msg)
   "Fetch location name of current position.
 MSG is a message prefix string."
   (message "%s: Fetching name of %.2f %.2f..." msg (osm--lat) (osm--lon))
-  (let ((name
- (ignore-errors
-   (alist-get
-'display_name
-(json-parse-string
- (shell-command-to-string
-  (concat
-   "curl -f -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))
+  (ignore-errors
+(alist-get
+ 'display_name
+ (json-parse-string
+  (shell-command-to-string
+   (concat
+"curl -f -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
 
 ;;;###autoload
 (defun osm-search ()



[elpa] externals/osm 11a04bb5b9 66/77: osm-server: Improve completion command

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 11a04bb5b95f10c9e77b3e55bab3485d8f5e5533
Author: Daniel Mendler 
Commit: Daniel Mendler 

osm-server: Improve completion command
---
 osm.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index d522bc7d81..906c9314fb 100644
--- a/osm.el
+++ b/osm.el
@@ -852,7 +852,12 @@ MSG is a message prefix string."
 (defun osm-server (server)
   "Select tile SERVER."
   (interactive
-   (let* ((fmt #("%-20s %s" 6 8 (face font-lock-comment-face)))
+   (let* ((max-name (cl-loop for (_ . x) in osm-server-list
+ maximize (length (plist-get x :name
+  (fmt (concat
+(propertize (format "%%-%ds " max-name)
+'face 'font-lock-comment-face)
+" %s"))
   (servers
(mapcar
 (lambda (x)



[elpa] externals/osm 2fbf12f0ef 46/77: seq is not needed

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 2fbf12f0ef096cca0402f681d44c8d3fb04abfc9
Author: Daniel Mendler 
Commit: Daniel Mendler 

seq is not needed
---
 osm.el | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/osm.el b/osm.el
index 53ad847661..7c3c6f669c 100644
--- a/osm.el
+++ b/osm.el
@@ -30,7 +30,6 @@
 
 ;;; Code:
 
-(require 'seq)
 (eval-when-compile (require 'cl-lib))
 
 (defvar bookmark-current-bookmark)
@@ -554,12 +553,11 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (osm--display-tile x y tile)
 (unless tile (osm--enqueue x y)
   (setq osm--queue
-(seq-sort-by
- (pcase-lambda (`(,x ,y . ,_z))
-   (setq x (- x (/ osm--x 256))
- y (- y (/ osm--y 256)))
-   (+ (* x x) (* y y)))
- #'< osm--queue))
+(sort osm--queue
+  (pcase-lambda (`(,x1 ,y1 . ,_z1) `(,x2 ,y2 . ,_z2))
+(setq x1 (- x1 (/ osm--x 256)) y1 (- y1 (/ osm--y 256))
+  x2 (- x2 (/ osm--x 256)) y2 (- y2 (/ osm--y 256)))
+(< (+ (* x1 x1) (* y1 y1)) (+ (* x2 x2) (* y2 y2))
   (osm--download
 
 (defun osm--make-bookmark ()



[elpa] externals/osm 88e7e36e43 49/77: Rename function

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 88e7e36e431a401fc3779a827de124d6b81ba4d4
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename function
---
 osm-ol.el |  4 ++--
 osm.el| 12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/osm-ol.el b/osm-ol.el
index 9a93c2b026..96a4e4fed4 100644
--- a/osm-ol.el
+++ b/osm-ol.el
@@ -26,7 +26,7 @@
 (require 'ol)
 
 ;; Only load osm on demand
-(autoload 'osm--setup "osm")
+(autoload 'osm--goto "osm")
 (declare-function osm--org-link-data "osm")
 
 (org-link-set-parameters
@@ -41,7 +41,7 @@
  "\\`\\(?:\\([^:]+\\):\\)?\\([^,]+\\),\\([^,]+\\),\\([^,]+\\)\\'"
  link)
   (error "Invalid osm link"))
-(osm--setup
+(osm--goto
  (list (string-to-number (match-string 2 link))
(string-to-number (match-string 3 link))
(string-to-number (match-string 4 link)))
diff --git a/osm.el b/osm.el
index 724c1f19c3..624f785578 100644
--- a/osm.el
+++ b/osm.el
@@ -509,7 +509,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm-home ()
   "Go to home coordinates."
   (interactive)
-  (osm--setup (osm--home-coordinates) nil))
+  (osm--goto (osm--home-coordinates) nil))
 
 (defun osm--queue-info ()
   "Return queue info string."
@@ -611,8 +611,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (osm--lat) (osm--lon) osm--zoom
   (osm--server-property :name)))
 
-(defun osm--setup (at server)
-  "Setup buffer with SERVER at coordinates AT."
+(defun osm--goto (at server)
+  "Go to AT, change SERVER."
   ;; Server not found
   (when (and server (not (assq server osm-server-list))) (setq server nil))
   (with-current-buffer
@@ -657,7 +657,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (unless (and (numberp lat) (numberp lon) (numberp zoom))
(error "Invalid coordinate"))
  (list lat lon zoom)))
-  (osm--setup (list lat lon zoom) nil))
+  (osm--goto (list lat lon zoom) nil))
 
 ;;;###autoload
 (defun osm-bookmark-jump (bm)
@@ -675,7 +675,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 nil t nil 'bookmark-history)
bookmark-alist)
   (error "No bookmark selected")
-  (set-buffer (osm--setup (bookmark-prop-get bm 'coordinate)
+  (set-buffer (osm--goto (bookmark-prop-get bm 'coordinate)
   (bookmark-prop-get bm 'server
 
 ;;;###autoload
@@ -761,7 +761,7 @@ MSG is a message prefix string."
  (or (osm--server-property :description) "")
  (list (or (cdr (assoc selected servers))
(error "No server selected")
-  (osm--setup nil server))
+  (osm--goto nil server))
 
 (dolist (sym (list #'osm-up #'osm-down #'osm-left #'osm-right
#'osm-up-up #'osm-down-down #'osm-left-left 
#'osm-right-right



[elpa] externals/osm fce584fbae 60/77: Add osm-bookmark-delete-click

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit fce584fbaeb243477815d280544d711d9b5b02b7
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add osm-bookmark-delete-click
---
 README.org |  1 +
 osm.el | 35 ---
 2 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index 40a74866d5..0154fc4edd 100644
--- a/README.org
+++ b/README.org
@@ -68,6 +68,7 @@ Key bindings in =osm-mode= buffer:
 - ~~: =osm-zoom-click= - Zoom to point
 - ~~: =osm-org-link-click= - Store point as Org link
 - ~~: =osm-bookmark-set-click= - Store point as bookmark
+- ~~: =osm-bookmark-delete-click= - Delete bookmark at point
 - ~g~: =osm-goto= - Go to location
 - ~h~: =osm-home= - Go to home location
 - ~s~: =osm-search= - Search for location
diff --git a/osm.el b/osm.el
index 9753c7e700..55e0d2efc7 100644
--- a/osm.el
+++ b/osm.el
@@ -138,6 +138,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map [mouse-1] #'osm-zoom-click)
 (define-key map [mouse-2] #'osm-org-link-click)
 (define-key map [mouse-3] #'osm-bookmark-set-click)
+(define-key map [S-mouse-3] #'osm-bookmark-delete-click)
 (define-key map [drag-mouse-1] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
@@ -369,6 +370,23 @@ Should be at least 7 days according to the server usage 
policies."
(osm--y (+ osm--y (- y osm--wy
 (osm-bookmark-set)))
 
+(defun osm-bookmark-delete-click (event)
+  "Delete bookmark at position of click EVENT."
+  (interactive "@e")
+  (pcase-let* ((`(,x . ,y) (posn-x-y (event-start event)))
+   (x (+ osm--x (- x osm--wx)))
+   (y (+ osm--y (- y osm--wy)))
+   (min most-positive-fixnum)
+   (found nil))
+(cl-loop for (p q . name) in osm--bookmark-positions
+ for d = (+ (* (- p x) (- p x)) (* (- q y) (- q y)))
+ if (and (< d 2500) (< d min)) do
+ (setq min d found name))
+(unless found
+  (error "No bookmark at point"))
+(bookmark-delete found)
+(osm--revert)))
+
 (defun osm-org-link-click (event)
   "Store link at position of click EVENT."
   (interactive "@e")
@@ -502,13 +520,13 @@ Should be at least 7 days according to the server usage 
policies."
  (let* ((coord (bookmark-prop-get bm 'coordinates))
 (px (osm--lon-to-x (cadr coord) osm--zoom))
 (py (osm--lat-to-y (car coord) osm--zoom)))
-   (cons px py)
+   `(,px ,py . ,(car bm))
 
 (defun osm--bookmarks-at (x y)
   "Get bookmarks at X/Y."
   ;; TODO Optimized k2 tree?
   (setq x (* x 256) y (* y 256))
-  (cl-loop for (p . q) in (osm--bookmark-positions)
+  (cl-loop for (p q . _name) in osm--bookmark-positions
if (and (>= p (- x 100)) (< p (+ x 256 100))
(>= q (- y 100)) (< q (+ y 256 100)))
collect (cons (- p x) (- q y
@@ -578,10 +596,12 @@ xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>
   "  ")))
 
 (defun osm--revert (&rest _)
-  "Revert buffer."
-  (when (eq major-mode #'osm-mode)
-(when osm--tiles (clrhash osm--tiles))
-(osm--update)))
+  "Revert osm buffers."
+  (dolist (buf (buffer-list))
+(when (eq (buffer-local-value 'major-mode buf) #'osm-mode)
+  (with-current-buffer buf
+(when osm--tiles (clrhash osm--tiles))
+(osm--update)
 
 (defun osm--resize (&rest _)
   "Resize buffer."
@@ -845,7 +865,8 @@ MSG is a message prefix string."
#'osm-up-up #'osm-down-down #'osm-left-left 
#'osm-right-right
#'osm-zoom-out #'osm-zoom-in #'osm-bookmark-set 
#'osm-bookmark-jump))
   (put sym 'command-modes '(osm-mode)))
-(dolist (sym (list #'osm-drag #'osm-zoom-click #'osm-bookmark-set-click 
#'osm-org-link-click))
+(dolist (sym (list #'osm-drag #'osm-zoom-click #'osm-org-link-click
+#'osm-bookmark-set-click #'osm-bookmark-delete-click))
   (put sym 'completion-predicate #'ignore))
 
 (provide 'osm)



[elpa] externals/compat updated (7065f2d077 -> c4aefbed75)

2022-03-07 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  7065f2d077 Improve quality of the exported manual
   new  27be28227a Add color-values-from-color-spec tests from xfaces-tests
   new  c4aefbed75 Add trailing newline to .elpaignore


Summary of changes:
 .elpaignore |  2 +-
 compat-tests.el | 14 +-
 2 files changed, 14 insertions(+), 2 deletions(-)



[elpa] externals/compat 27be28227a 1/2: Add color-values-from-color-spec tests from xfaces-tests

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 27be28227a68ad67a0cba5e6832c524816516ce5
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add color-values-from-color-spec tests from xfaces-tests
---
 compat-tests.el | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/compat-tests.el b/compat-tests.el
index accad4cb8a..07086bb2aa 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1567,6 +1567,9 @@ being compared against."
   (ought '(0 0 65535) "#00fff")
   (ought '(0 0 65535) "#")
   (ought '(0 0 65535) "#ffFF")
+  (ought '(#x #x #x) "#f05")
+  (ought '(#x1f1f #xb0b0 #xc5c5) "#1fb0C5")
+  (ought '(#x1f83 #xb0ad #xc5e2) "#1f83b0ADC5e2")
   (ought nil "")
   (ought nil "#")
   (ought nil "#0")
@@ -1580,6 +1583,9 @@ being compared against."
   (ought nil " #00")
   (ought nil "#00 ")
   (ought nil " #00 ")
+  (ought nil "#1f83b0ADC5e2g")
+  (ought nil "#1f83b0ADC5e20")
+  (ought nil "#12345")
   ;; rgb: notation
   (ought '(0 0 0) "rgb:0/0/0")
   (ought '(0 0 0) "rgb:0/0/00")
@@ -1590,6 +1596,8 @@ being compared against."
   (ought '(65535 0 65535) "rgb:FFF//F")
   (ought '(65535 0 65535) "rgb://")
   (ought '(0 255 65535) "rgb:0/00FF/")
+  (ought '(#x #x2323 #x28a2) "rgb:f/23/28a")
+  (ought '(#x1234 #x5678 #x09ab) "rgb:1234/5678/09ab")
   (ought nil "rgb://")
   (ought nil "rgb://FFFG")
   (ought nil "rgb://F")
@@ -1602,6 +1610,7 @@ being compared against."
   (ought nil "  rgb://")
   (ought nil "rgb:/  /")
   (ought nil "rgb:  / /")
+  (ought nil "rgb:0//0")
   ;; rgbi: notation
   (ought '(0 0 0) "rgbi:0/0/0")
   (ought '(0 0 0) "rgbi:0.0/0.0/0.0")
@@ -1616,6 +1625,8 @@ being compared against."
   (ought '(65535 0 0) "rgbi:1.0/0/0.")
   (ought '(65535 32768 0) "rgbi:1.0/0.5/0.")
   (ought '(6554 21843 65469) "rgbi:0.1/0./0.999")
+  (ought '(0 32768 6554) "rgbi:0/0.5/0.1")
+  (ought '(66 655 65535) "rgbi:1e-3/1.0e-2/1e0")
   (ought '(6554 21843 65469) "rgbi:1e-1/+0./0.00999e2")
   (ought nil "rgbi:1.0001/0/0")
   (ought nil "rgbi:2/0/0")
@@ -1634,7 +1645,8 @@ being compared against."
   ;;
   ;; (ought nil "rgbi: 0/0/0")
   ;; (ought nil "rgbi: 0/ 0/ 0")
-  (ought nil "rgbi : 0/0/0"))
+  (ought nil "rgbi : 0/0/0")
+  (ought nil "rgbi:0/0.5/10"))
 
 (compat-deftest file-modes-number-to-symbolic
   (ought "-rwx--" #o700)



[elpa] externals/osm ebf47f15f4 21/77: Use format-spec

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit ebf47f15f46b2a3e277535b8d98729a28cfeacdf
Author: Daniel Mendler 
Commit: Daniel Mendler 

Use format-spec
---
 osm.el | 68 +-
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/osm.el b/osm.el
index 573b94353d..5977b25b59 100644
--- a/osm.el
+++ b/osm.el
@@ -42,69 +42,69 @@
   '((default
  :name "OpenStreetMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.org/%s/%s/%s.png";
-   "https://b.tile.openstreetmap.org/%s/%s/%s.png";
-   "https://c.tile.openstreetmap.org/%s/%s/%s.png";))
+ :url ("https://a.tile.openstreetmap.org/%z/%x/%y.png";
+   "https://b.tile.openstreetmap.org/%z/%x/%y.png";
+   "https://c.tile.openstreetmap.org/%z/%x/%y.png";))
 (de
  :name "OSM Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.de/%s/%s/%s.png";
-   "https://b.tile.openstreetmap.de/%s/%s/%s.png";
-   "https://c.tile.openstreetmap.de/%s/%s/%s.png";))
+ :url ("https://a.tile.openstreetmap.de/%z/%x/%y.png";
+   "https://b.tile.openstreetmap.de/%z/%x/%y.png";
+   "https://c.tile.openstreetmap.de/%z/%x/%y.png";))
 (fr
  :name "OSM France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";
-   "https://b.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";
-   "https://c.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";))
+ :url ("https://a.tile.openstreetmap.fr/osmfr/%z/%x/%y.png";
+   "https://b.tile.openstreetmap.fr/osmfr/%z/%x/%y.png";
+   "https://c.tile.openstreetmap.fr/osmfr/%z/%x/%y.png";))
 (humanitarian
  :name "OSM Humanitarian"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/hot/%s/%s/%s.png";
-   "https://b.tile.openstreetmap.fr/hot/%s/%s/%s.png";
-   "https://c.tile.openstreetmap.fr/hot/%s/%s/%s.png";))
+ :url ("https://a.tile.openstreetmap.fr/hot/%z/%x/%y.png";
+   "https://b.tile.openstreetmap.fr/hot/%z/%x/%y.png";
+   "https://c.tile.openstreetmap.fr/hot/%z/%x/%y.png";))
 (opentopomap
  :name "OpenTopoMap"
  :min-zoom 2 :max-zoom 17 :max-connections 2
- :url ("https://a.tile.opentopomap.org/%s/%s/%s.png";
-   "https://b.tile.opentopomap.org/%s/%s/%s.png";
-   "https://c.tile.opentopomap.org/%s/%s/%s.png";))
+ :url ("https://a.tile.opentopomap.org/%z/%x/%y.png";
+   "https://b.tile.opentopomap.org/%z/%x/%y.png";
+   "https://c.tile.opentopomap.org/%z/%x/%y.png";))
 (opvnkarte
  :name "ÖPNVKarte"
  :min-zoom 2 :max-zoom 18 :max-connections 2
- :url ("http://a.tile.memomaps.de/tilegen/%s/%s/%s.png";
-   "http://b.tile.memomaps.de/tilegen/%s/%s/%s.png";
-   "http://c.tile.memomaps.de/tilegen/%s/%s/%s.png";))
+ :url ("http://a.tile.memomaps.de/tilegen/%z/%x/%y.png";
+   "http://b.tile.memomaps.de/tilegen/%z/%x/%y.png";
+   "http://c.tile.memomaps.de/tilegen/%z/%x/%y.png";))
 (cyclosm
  :name "CyclOSM"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/cyclosm/%s/%s/%s.png";
-   "https://b.tile.openstreetmap.fr/cyclosm/%s/%s/%s.png";
-   "https://c.tile.openstreetmap.fr/cyclosm/%s/%s/%s.png";))
+ :url ("https://a.tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";
+   "https://b.tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";
+   "https://c.tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";))
 (openriverboatmap
  :name "OpenRiverBoatMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/openriverboatmap/%s/%s/%s.png";
-   "https://b.tile.openstreetmap.fr/openriverboatmap/%s/%s/%s.png";
-   "https://c.tile.openstreetmap.fr/openriverboatmap/%s/%s/%s.png";))
+ :url ("https://a.tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";
+   "https://b.tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";
+   "https://c.tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";))
 (stamen-watercolor
  :name "Stamen Watercolor"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://stamen-tiles-a.a.ssl.fastly.net/watercolor/%s/%s/%s.jpg";
-   "https://stamen-tiles-b.a.ssl.fastly.net/watercolor/%s/%s/%s.jpg";
-   "https://stamen-tiles-c.a.ssl.fastly.net/watercolor/%s/%s/%s.jpg";))
+ :url ("https://stamen-tiles-a.a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";
+   "https://stamen-tiles-b.a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";
+   "https://stamen-tiles-c.a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";))
 (stamen-terrain
  :name "Stamen Terrain"
  :min-zoom 2 :max-zoom 18 :max-connections 2
- :url ("https://stamen-tiles-a.a.ssl.fastly.net/ter

[elpa] externals/osm e8ed76566a 11/77: Rename settings

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit e8ed76566aa51331578c4683a1b013a75fe8f983
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename settings
---
 osm.el | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/osm.el b/osm.el
index a0c46aed74..a08ae24ae6 100644
--- a/osm.el
+++ b/osm.el
@@ -38,7 +38,7 @@
   :group 'network
   :prefix "osm-")
 
-(defcustom osm-tile-server-list
+(defcustom osm-server-list
   '((openstreetmap-org
  :name "OpenStreetMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
@@ -102,15 +102,15 @@
   "Movement step in pixel."
   :type 'integer)
 
-(defcustom osm-tile-server 'openstreetmap-org
+(defcustom osm-server 'openstreetmap-org
   "Tile server name."
   :type 'symbol)
 
-(defcustom osm-tile-cache (file-name-concat user-emacs-directory "var/osm/")
+(defcustom osm-cache-directory (file-name-concat user-emacs-directory 
"var/osm/")
   "Tile cache directory."
   :type 'string)
 
-(defcustom osm-tile-max-age (* 60 60 24 14)
+(defcustom osm-max-age (* 60 60 24 14)
   "Maximum tile age.
 Should be at least 7 days according to the server usage policies."
   :type '(choice (const nil) integer))
@@ -189,7 +189,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--server-property (prop)
   "Return server property PROP."
-  (plist-get (alist-get osm-tile-server osm-tile-server-list) prop))
+  (plist-get (alist-get osm-server osm-server-list) prop))
 
 (defun osm--tile-url (x y zoom)
   "Return tile url for coordinate X, Y and ZOOM."
@@ -202,14 +202,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--tile-file (x y zoom)
   "Return tile file name for coordinate X, Y and ZOOM."
-  (format "%s%d-%d-%d.%s" (osm--tile-cache) zoom x y
+  (format "%s%d-%d-%d.%s" (osm--cache-directory) zoom x y
   (file-name-extension (car (osm--server-property :url)
 
-(defun osm--tile-cache ()
+(defun osm--cache-directory ()
   "Return tile cache directory."
   (expand-file-name
-   (file-name-concat osm-tile-cache
- (symbol-name osm-tile-server)
+   (file-name-concat osm-cache-directory
+ (symbol-name osm-server)
  "/")))
 
 (defun osm--enqueue (x y)
@@ -354,24 +354,26 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--clean-cache ()
   "Clean tile cache."
-  (when (and (integerp osm-tile-max-age)
- (> (- (float-time) osm--clean-cache) osm-tile-max-age))
+  (when (and (integerp osm-max-age)
+ (> (- (float-time) osm--clean-cache) osm-max-age))
 (setq osm--clean-cache (float-time))
 (run-with-idle-timer
  30 nil
  (lambda ()
-   (dolist (file (directory-files-recursively osm-tile-cache 
"\\.png\\(?:\\.tmp\\)?\\'" nil))
+   (dolist (file (directory-files-recursively
+  osm-cache-directory
+  "\\.\\(?:png\\|jpe?g\\)\\(?:\\.tmp\\)?\\'" nil))
  (when (> (float-time
(time-since
 (file-attribute-modification-time
  (file-attributes file
-  osm-tile-max-age)
+  osm-max-age)
(delete-file file)))
 
 (define-derived-mode osm-mode special-mode "Osm"
   "Open Street Map mode."
   :interactive nil
-  (let ((cache (osm--tile-cache)))
+  (let ((cache (osm--cache-directory)))
 (unless (file-exists-p cache)
   (make-directory cache t)))
   (osm--clean-cache)
@@ -433,7 +435,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (unless (derived-mode-p #'osm-mode)
 (error "Not an osm-mode buffer"))
   (with-silent-modifications
-(let* ((default-directory (osm--tile-cache))
+(let* ((default-directory (osm--cache-directory))
(size (expt 2 osm--zoom))
(meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi size))
(meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))



[elpa] externals/osm 5815de2a73 29/77: Store server as part in bookmark and Org link

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 5815de2a73eaa10e657bd2e03db0b0a697a30dd2
Author: Daniel Mendler 
Commit: Daniel Mendler 

Store server as part in bookmark and Org link
---
 ol-osm.el |  22 +++
 osm.el| 125 ++
 2 files changed, 84 insertions(+), 63 deletions(-)

diff --git a/ol-osm.el b/ol-osm.el
index c7db90692f..17b1bdaba4 100644
--- a/ol-osm.el
+++ b/ol-osm.el
@@ -26,7 +26,7 @@
 (require 'ol)
 
 ;; Only load osm on demand
-(declare-function osm-goto "osm")
+(autoload 'osm--setup "osm")
 (declare-function osm--link-data "osm")
 
 (org-link-set-parameters
@@ -36,19 +36,27 @@
 
 (defun ol-osm-open (link _)
   "Open osm LINK."
-  (setq link (split-string link ","))
-  (osm-goto (string-to-number (nth 0 link))
-(string-to-number (nth 1 link))
-(string-to-number (nth 2 link
+  (save-match-data
+(unless (string-match
+ "\\`\\(?:\\([^:]+\\):\\)?\\([^,]+\\),\\([^,]+\\),\\([^,]+\\)\\'"
+ link)
+  (error "Invalid osm link"))
+(osm--setup
+ :at (list (string-to-number (match-string 2 link))
+   (string-to-number (match-string 3 link))
+   (string-to-number (match-string 4 link)))
+ :server (and (match-end 1) (intern (match-string 1 link))
 
 (defun ol-osm-store ()
   "Store osm link."
   (when (derived-mode-p 'osm-mode)
-(pcase-let ((`(,lat ,lon ,zoom ,desc) (osm--link-data)))
+(pcase-let ((`(,lat ,lon ,zoom ,server ,desc) (osm--link-data)))
   (org-link-store-props
:type "osm"
:description (and desc (format "%s %.2f° %.2f°" desc lat lon))
-   :link (format "osm:%s,%s,%s" lat lon zoom)
+   :link (format "osm:%s%s,%s,%s"
+ (if server (format "%s:" server) "")
+ lat lon zoom)
 
 (provide 'ol-osm)
 ;;; ol-osm.el ends here
diff --git a/osm.el b/osm.el
index 611c54c105..601267b82c 100644
--- a/osm.el
+++ b/osm.el
@@ -218,12 +218,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (setq lat (* lat (/ float-pi 180.0)))
   (- 0.5 (/ (log (+ (tan lat) (/ 1 (cos lat float-pi 2)))
 
-(defun osm--set-lat-lon (lat lon)
-  "Set longitude LON and latitude LAT."
-  (let ((n (* 256 (expt 2.0 osm--zoom
-(setq osm--x (floor (* n (osm--lon-to-x lon)))
-  osm--y (floor (* n (osm--lat-to-y lat))
-
 (defun osm--lon ()
   "Return longitude in degrees."
   (- (/ (* osm--x 360.0) 256.0 (expt 2.0 osm--zoom)) 180.0))
@@ -233,6 +227,22 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (let ((y (* float-pi (- 1 (* 2 (/ osm--y 256.0 (expt 2.0 osm--zoom)))
 (/ (* 180 (atan (/ (- (exp y) (exp (- y))) 2))) float-pi)))
 
+(defun osm--set-coordinates (coord)
+  "Set coordinate triple COORD."
+  (let ((n (* 256 (expt 2.0 (nth 2 coord)
+(setq osm--zoom (nth 2 coord)
+  osm--x (floor (* n (osm--lon-to-x (nth 1 coord
+  osm--y (floor (* n (osm--lat-to-y (nth 0 coord)))
+
+(defun osm--home-coordinates ()
+  "Return home coordinate triple."
+  (let ((lat (bound-and-true-p calendar-latitude))
+(lon (bound-and-true-p calendar-longitude))
+(zoom 11))
+(unless (and lat lon)
+  (setq lat 0 lon 0 zoom 2))
+(list lat lon zoom)))
+
 (defun osm--server-property (prop)
   "Return server property PROP."
   (plist-get (alist-get osm-server osm-server-list) prop))
@@ -466,14 +476,9 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 ;;;###autoload
 (defun osm-home ()
-  "New OSM buffer."
+  "Go to home coordinates."
   (interactive)
-  (let ((lat (bound-and-true-p calendar-latitude))
-(lon (bound-and-true-p calendar-longitude))
-(zoom 11))
-(unless (and lat lon)
-  (setq lat 0 lon 0 zoom 2))
-(osm-goto lat lon zoom)))
+  (osm--setup :at (osm--home-coordinates)))
 
 (defun osm--queue-info ()
   "Return queue info string."
@@ -545,46 +550,65 @@ We need two distinct images which are not `eq' for the 
display properties.")
   "Make OSM bookmark."
   `(,(osm--bookmark-name)
 ,@(bookmark-make-record-default t)
-(lon . ,(osm--lon))
-(lat . ,(osm--lat))
-(zoom . ,osm--zoom)
-(name . ,(buffer-name))
+(coordinate ,(osm--lat) ,(osm--lon) ,osm--zoom)
+(server . ,osm-server)
+(buffer . ,(buffer-name))
 (handler . ,#'osm-bookmark-jump)))
 
+(defun osm--buffer-name ()
+  "Return default buffer name."
+  (format "*osm: %s*" (osm--server-property :name)))
+
+(cl-defun osm--setup (&key at server buffer)
+  "Setup BUFFER with SERVER at coordinates AT."
+  ;; Server not found
+  (when (and server (not (assq server osm-server-list))) (setq server nil))
+  (with-current-buffer
+  (if (derived-mode-p #'osm-mode)
+  (current-buffer)
+(generate-new-buffer
+ (or buffer
+ (let ((osm-server (or server osm-server)))
+   (osm--buffer-name)
+

[elpa] externals/osm a9d0ec74e3 07/77: Simplify placeholder

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit a9d0ec74e3e6e04e2989c4b396e26b42b73deed4
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify placeholder
---
 osm.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/osm.el b/osm.el
index 9c220063b8..20491ee140 100644
--- a/osm.el
+++ b/osm.el
@@ -83,8 +83,7 @@ Should be at least 7 days according to the server usage 
policies."
   :type '(choice (const nil) integer))
 
 (defconst osm--placeholder1
-  `(image :type xbm :width 256 :height 256 :background nil
-  :data ,(make-bool-vector (* 256 256) nil))
+  `(image :type xbm :width 256 :height 256 :data ,(make-bool-vector (* 256 
256) nil))
   "First placeholder image for tiles.")
 
 (defconst osm--placeholder2 `(image ,@(cdr osm--placeholder1))
@@ -423,8 +422,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
 '(:eval (osm--queue-info
   (setq osm--height (1+ (ceiling (window-pixel-height) 256))
 osm--width (1+ (ceiling (window-pixel-width) 256)))
-  (plist-put (cdr osm--placeholder1) :background (face-attribute 'default 
:background))
-  (plist-put (cdr osm--placeholder2) :background (face-attribute 'default 
:background))
   (erase-buffer)
   (dotimes (_j osm--height)
 (insert (concat (make-string osm--width ?\s) "\n")))



[elpa] externals/osm d065db8615 09/77: Add humanitarian base map

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit d065db8615ba4bb1a70785ff2a0ad1af7066cc0d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add humanitarian base map
---
 osm.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index 4ca5b53ebf..984db67566 100644
--- a/osm.el
+++ b/osm.el
@@ -56,6 +56,12 @@
  :url ("https://a.tile.openstreetmap.fr/osmfr/";
"https://b.tile.openstreetmap.fr/osmfr/";
"https://c.tile.openstreetmap.fr/osmfr/";))
+(openstreetmap-humanitarian
+ :name "OpenStreetMap Humanitarian"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://a.tile.openstreetmap.fr/hot/";
+   "https://b.tile.openstreetmap.fr/hot/";
+   "https://c.tile.openstreetmap.fr/hot/";))
 (opentopomap-org
  :name "OpenTopoMap"
  :min-zoom 2 :max-zoom 17 :max-connections 2
@@ -218,7 +224,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (with-current-buffer buffer
(when (and (string-match-p "finished" status)
   (eq osm--zoom zoom))
- (rename-file tmp dst t)
+ (ignore-errors (rename-file tmp dst t))
  (osm--put x y))
(delete-file tmp)
(force-mode-line-update)



[elpa] externals/osm 92fb0c72dd 62/77: Add osm-bookmark-delete

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 92fb0c72ddb3b2682e54ce023784eceeb9e4fbd5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add osm-bookmark-delete
---
 osm.el | 41 +
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/osm.el b/osm.el
index 55e0d2efc7..561e273b3e 100644
--- a/osm.el
+++ b/osm.el
@@ -384,8 +384,7 @@ Should be at least 7 days according to the server usage 
policies."
  (setq min d found name))
 (unless found
   (error "No bookmark at point"))
-(bookmark-delete found)
-(osm--revert)))
+(osm-bookmark-delete found)))
 
 (defun osm-org-link-click (event)
   "Store link at position of click EVENT."
@@ -512,6 +511,7 @@ Should be at least 7 days according to the server usage 
policies."
 
 (defun osm--bookmark-positions ()
   "Compute bookmark positions."
+  (bookmark-maybe-load-default-file)
   (setq osm--bookmark-positions
 (cl-loop
  for bm in bookmark-alist
@@ -760,22 +760,30 @@ xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>
 ;;;###autoload
 (defun osm-bookmark-jump (bm)
   "Jump to osm bookmark BM."
-  (interactive
-   (list
-(progn
-  (bookmark-maybe-load-default-file)
-  (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))
-nil t nil 'bookmark-history)
-   bookmark-alist)
-  (error "No bookmark selected")
+  (interactive (list (osm--bookmark-read)))
   (set-buffer (osm--goto (bookmark-prop-get bm 'coordinates)
  (bookmark-prop-get bm 'server
 
+;;;###autoload
+(defun osm-bookmark-delete (bm)
+  "Delete osm bookmark BM."
+  (interactive (list (osm--bookmark-read)))
+  (bookmark-delete bm)
+  (osm--revert))
+
+(defun osm--bookmark-read ()
+  "Read bookmark name."
+  (bookmark-maybe-load-default-file)
+  (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))
+nil t nil 'bookmark-history)
+   bookmark-alist)
+  (error "No bookmark selected")))
+
 ;;;###autoload
 (defun osm-bookmark-set ()
   "Create osm bookmark."
@@ -863,7 +871,8 @@ MSG is a message prefix string."
 
 (dolist (sym (list #'osm-up #'osm-down #'osm-left #'osm-right
#'osm-up-up #'osm-down-down #'osm-left-left 
#'osm-right-right
-   #'osm-zoom-out #'osm-zoom-in #'osm-bookmark-set 
#'osm-bookmark-jump))
+   #'osm-zoom-out #'osm-zoom-in #'osm-bookmark-set 
#'osm-bookmark-jump
+   #'osm-bookmark-delete))
   (put sym 'command-modes '(osm-mode)))
 (dolist (sym (list #'osm-drag #'osm-zoom-click #'osm-org-link-click
 #'osm-bookmark-set-click #'osm-bookmark-delete-click))



[elpa] externals/osm 5af320c57f 10/77: Add Stamen servers, support jpeg tiles

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 5af320c57f3ec47f8ed12d6b6f5778313c9f609c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add Stamen servers, support jpeg tiles
---
 osm.el | 71 --
 1 file changed, 47 insertions(+), 24 deletions(-)

diff --git a/osm.el b/osm.el
index 984db67566..a0c46aed74 100644
--- a/osm.el
+++ b/osm.el
@@ -40,34 +40,53 @@
 
 (defcustom osm-tile-server-list
   '((openstreetmap-org
+ :name "OpenStreetMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.org/";
-   "https://b.tile.openstreetmap.org/";
-   "https://c.tile.openstreetmap.org/";))
+ :url ("https://a.tile.openstreetmap.org/%s/%s/%s.png";
+   "https://b.tile.openstreetmap.org/%s/%s/%s.png";
+   "https://c.tile.openstreetmap.org/%s/%s/%s.png";))
 (openstreetmap-de
- :name "OpenStreetMap Deutschland"
+ :name "OSM Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.de/";
-   "https://b.tile.openstreetmap.de/";
-   "https://c.tile.openstreetmap.de/";))
+ :url ("https://a.tile.openstreetmap.de/%s/%s/%s.png";
+   "https://b.tile.openstreetmap.de/%s/%s/%s.png";
+   "https://c.tile.openstreetmap.de/%s/%s/%s.png";))
 (openstreetmap-fr
- :name "OpenStreetMap France"
+ :name "OSM France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/osmfr/";
-   "https://b.tile.openstreetmap.fr/osmfr/";
-   "https://c.tile.openstreetmap.fr/osmfr/";))
+ :url ("https://a.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";
+   "https://b.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";
+   "https://c.tile.openstreetmap.fr/osmfr/%s/%s/%s.png";))
 (openstreetmap-humanitarian
- :name "OpenStreetMap Humanitarian"
+ :name "OSM Humanitarian"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/hot/";
-   "https://b.tile.openstreetmap.fr/hot/";
-   "https://c.tile.openstreetmap.fr/hot/";))
+ :url ("https://a.tile.openstreetmap.fr/hot/%s/%s/%s.png";
+   "https://b.tile.openstreetmap.fr/hot/%s/%s/%s.png";
+   "https://c.tile.openstreetmap.fr/hot/%s/%s/%s.png";))
 (opentopomap-org
  :name "OpenTopoMap"
  :min-zoom 2 :max-zoom 17 :max-connections 2
- :url ("https://a.tile.opentopomap.org/";
-   "https://b.tile.opentopomap.org/";
-   "https://c.tile.opentopomap.org/";)))
+ :url ("https://a.tile.opentopomap.org/%s/%s/%s.png";
+   "https://b.tile.opentopomap.org/%s/%s/%s.png";
+   "https://c.tile.opentopomap.org/%s/%s/%s.png";))
+(stamen-watercolor
+ :name "Stamen Watercolor"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://stamen-tiles-a.a.ssl.fastly.net/watercolor/%s/%s/%s.jpg";
+   "https://stamen-tiles-b.a.ssl.fastly.net/watercolor/%s/%s/%s.jpg";
+   "https://stamen-tiles-c.a.ssl.fastly.net/watercolor/%s/%s/%s.jpg";))
+(stamen-terrain
+ :name "Stamen Terrain"
+ :min-zoom 2 :max-zoom 18 :max-connections 2
+ :url ("https://stamen-tiles-a.a.ssl.fastly.net/terrain/%s/%s/%s.png";
+   "https://stamen-tiles-b.a.ssl.fastly.net/terrain/%s/%s/%s.png";
+   "https://stamen-tiles-c.a.ssl.fastly.net/terrain/%s/%s/%s.png";))
+(stamen-toner
+ :name "Stamen Toner"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://stamen-tiles-a.a.ssl.fastly.net/toner/%s/%s/%s.png";
+   "https://stamen-tiles-b.a.ssl.fastly.net/toner/%s/%s/%s.png";
+   "https://stamen-tiles-c.a.ssl.fastly.net/toner/%s/%s/%s.png";)))
   "List of tile servers."
   :type '(alist :key-type symbol :value-type plist))
 
@@ -176,16 +195,15 @@ We need two distinct images which are not `eq' for the 
display properties.")
   "Return tile url for coordinate X, Y and ZOOM."
   (let ((url (osm--server-property :url)))
 (prog1
-(format "%s%d/%d/%d.png"
-(nth osm--url-index url)
-zoom x y)
+(format (nth osm--url-index url) zoom x y)
   (setq osm--url-index
 (mod (1+ osm--url-index)
  (length url))
 
 (defun osm--tile-file (x y zoom)
   "Return tile file name for coordinate X, Y and ZOOM."
-  (format "%s%d-%d-%d.png" (osm--tile-cache) zoom x y))
+  (format "%s%d-%d-%d.%s" (osm--tile-cache) zoom x y
+  (file-name-extension (car (osm--server-property :url)
 
 (defun osm--tile-cache ()
   "Return tile cache directory."
@@ -379,8 +397,13 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (pos (+ (point-min) (* j (1+ osm--width)) i)))
 (when (and (>= i 0) (< i osm--width)
(>= j 0) (< j osm--height))
-  (setq image (or image `(image :type png :file ,(osm--tile-file x y 
osm--zoom)
-   

[elpa] externals/osm c2c7dff887 22/77: Compact server configuration

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit c2c7dff887dd24f37fbc3e6dde775cc057400ae9
Author: Daniel Mendler 
Commit: Daniel Mendler 

Compact server configuration
---
 osm.el | 66 ++
 1 file changed, 26 insertions(+), 40 deletions(-)

diff --git a/osm.el b/osm.el
index 5977b25b59..1dd77fa9c3 100644
--- a/osm.el
+++ b/osm.el
@@ -42,69 +42,47 @@
   '((default
  :name "OpenStreetMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.org/%z/%x/%y.png";
-   "https://b.tile.openstreetmap.org/%z/%x/%y.png";
-   "https://c.tile.openstreetmap.org/%z/%x/%y.png";))
+ :url "https://[abc].tile.openstreetmap.org/%z/%x/%y.png";)
 (de
  :name "OSM Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.de/%z/%x/%y.png";
-   "https://b.tile.openstreetmap.de/%z/%x/%y.png";
-   "https://c.tile.openstreetmap.de/%z/%x/%y.png";))
+ :url "https://[abc].tile.openstreetmap.de/%z/%x/%y.png";)
 (fr
  :name "OSM France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/osmfr/%z/%x/%y.png";
-   "https://b.tile.openstreetmap.fr/osmfr/%z/%x/%y.png";
-   "https://c.tile.openstreetmap.fr/osmfr/%z/%x/%y.png";))
+ :url "https://[abc].tile.openstreetmap.fr/osmfr/%z/%x/%y.png";)
 (humanitarian
  :name "OSM Humanitarian"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/hot/%z/%x/%y.png";
-   "https://b.tile.openstreetmap.fr/hot/%z/%x/%y.png";
-   "https://c.tile.openstreetmap.fr/hot/%z/%x/%y.png";))
+ :url "https://[abc].tile.openstreetmap.fr/hot/%z/%x/%y.png";)
 (opentopomap
  :name "OpenTopoMap"
  :min-zoom 2 :max-zoom 17 :max-connections 2
- :url ("https://a.tile.opentopomap.org/%z/%x/%y.png";
-   "https://b.tile.opentopomap.org/%z/%x/%y.png";
-   "https://c.tile.opentopomap.org/%z/%x/%y.png";))
+ :url "https://[abc].tile.opentopomap.org/%z/%x/%y.png";)
 (opvnkarte
  :name "ÖPNVKarte"
  :min-zoom 2 :max-zoom 18 :max-connections 2
- :url ("http://a.tile.memomaps.de/tilegen/%z/%x/%y.png";
-   "http://b.tile.memomaps.de/tilegen/%z/%x/%y.png";
-   "http://c.tile.memomaps.de/tilegen/%z/%x/%y.png";))
+ :url "http://[abc].tile.memomaps.de/tilegen/%z/%x/%y.png";)
 (cyclosm
  :name "CyclOSM"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";
-   "https://b.tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";
-   "https://c.tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";))
+ :url "https://[abc].tile.openstreetmap.fr/cyclosm/%z/%x/%y.png";)
 (openriverboatmap
  :name "OpenRiverBoatMap"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://a.tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";
-   "https://b.tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";
-   "https://c.tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";))
+ :url "https://[abc].tile.openstreetmap.fr/openriverboatmap/%z/%x/%y.png";)
 (stamen-watercolor
  :name "Stamen Watercolor"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://stamen-tiles-a.a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";
-   "https://stamen-tiles-b.a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";
-   "https://stamen-tiles-c.a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";))
+ :url 
"https://stamen-tiles-[abc].a.ssl.fastly.net/watercolor/%z/%x/%y.jpg";)
 (stamen-terrain
  :name "Stamen Terrain"
  :min-zoom 2 :max-zoom 18 :max-connections 2
- :url ("https://stamen-tiles-a.a.ssl.fastly.net/terrain/%z/%x/%y.png";
-   "https://stamen-tiles-b.a.ssl.fastly.net/terrain/%z/%x/%y.png";
-   "https://stamen-tiles-c.a.ssl.fastly.net/terrain/%z/%x/%y.png";))
+ :url "https://stamen-tiles-[abc].a.ssl.fastly.net/terrain/%z/%x/%y.png";)
 (stamen-toner
  :name "Stamen Toner"
  :min-zoom 2 :max-zoom 19 :max-connections 2
- :url ("https://stamen-tiles-a.a.ssl.fastly.net/toner/%z/%x/%y.png";
-   "https://stamen-tiles-b.a.ssl.fastly.net/toner/%z/%x/%y.png";
-   "https://stamen-tiles-c.a.ssl.fastly.net/toner/%z/%x/%y.png";)))
+ :url "https://stamen-tiles-[abc].a.ssl.fastly.net/toner/%z/%x/%y.png";))
   "List of tile servers."
   :type '(alist :key-type symbol :value-type plist))
 
@@ -250,17 +228,22 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--tile-url (x y zoom)
   "Return tile url for coordinate X, Y and ZOOM."
-  (let ((url (osm--server-property :url)))
+  (let ((url (osm--server-property :url))
+(count 1))
+(save-match-data
+  (when (string-match "\\`\\(.*\\)\\[\\(.*\\)\\]\\(.*\\)\\'" url)
+(setq count (- (match-end 2)

[elpa] externals/osm 7ce1d26c88 67/77: Extract osm--make-tile

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 7ce1d26c88ac108a2a2a2a189bc237761234885f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Extract osm--make-tile
---
 osm.el | 42 +++---
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/osm.el b/osm.el
index 906c9314fb..fb0e51473a 100644
--- a/osm.el
+++ b/osm.el
@@ -531,20 +531,13 @@ Should be at least 7 days according to the server usage 
policies."
(>= q (- y 100)) (< q (+ y 256 100)))
collect (cons (- p x) (- q y
 
-(defun osm--get-tile (x y)
-  "Get tile at X/Y."
-  (let* ((key `(,osm-server ,osm--zoom ,x . ,y))
- (tile (and osm--tiles (gethash key osm--tiles
-(if tile
-(progn (setcar tile osm--cookie) (cdr tile))
-  (let ((file (osm--tile-file x y osm--zoom)))
-(when (file-exists-p file)
-  (when (and osm-max-tiles (not osm--tiles))
-(setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles)))
-  (setq tile
-(if-let (positions (osm--bookmarks-at x y))
-(list :type 'svg :base-uri file
-  :data (concat "
 "
 (mapconcat
@@ -556,11 +549,22 @@ xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>
(car pos) (cdr pos)))
  positions "")
 ""))
-  (list :type
-(if (member (file-name-extension file) '("jpg" "jpeg"))
-'jpeg 'png)
-:file file)))
-  (setq tile `(,osm--cookie image :width 256 :height 256 ,@tile))
+(list :type
+  (if (member (file-name-extension file) '("jpg" "jpeg"))
+  'jpeg 'png)
+  :file file
+
+(defun osm--get-tile (x y)
+  "Get tile at X/Y."
+  (let* ((key `(,osm-server ,osm--zoom ,x . ,y))
+ (tile (and osm--tiles (gethash key osm--tiles
+(if tile
+(progn (setcar tile osm--cookie) (cdr tile))
+  (let ((file (osm--tile-file x y osm--zoom)))
+(when (file-exists-p file)
+  (when (and osm-max-tiles (not osm--tiles))
+(setq osm--tiles (make-hash-table :test #'equal :size 
osm-max-tiles)))
+  (setq tile (cons osm--cookie (osm--make-tile x y file)))
   (when osm--tiles
 (puthash key tile osm--tiles))
   (cdr tile))



[elpa] externals/osm 7657cb1b3b 71/77: Add check for image format support

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 7657cb1b3b3c339a538ba803536db4fc385bc19e
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add check for image format support
---
 osm.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/osm.el b/osm.el
index 411e056ce6..baf26a1598 100644
--- a/osm.el
+++ b/osm.el
@@ -490,6 +490,9 @@ Should be at least 7 days according to the server usage 
policies."
 (define-derived-mode osm-mode special-mode "Osm"
   "OpenStreetMap viewer mode."
   :interactive nil
+  (dolist (type '(svg jpeg png))
+(unless (image-type-available-p type)
+  (warn "osm: Support for %s images is missing" type)))
   (osm--clean-cache)
   (setq-local osm-server osm-server
   line-spacing nil



[elpa] externals/osm 833793ed6c 77/77: Use grid placeholder

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 833793ed6ca0e3eb4418255c5c3b2c01bc2156f1
Author: Daniel Mendler 
Commit: Daniel Mendler 

Use grid placeholder
---
 osm.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/osm.el b/osm.el
index 43ac22bd3b..7096cf8db1 100644
--- a/osm.el
+++ b/osm.el
@@ -170,8 +170,15 @@ Should be at least 7 days according to the server usage 
policies."
   "Keymap used by `osm-mode'.")
 
 (defconst osm--placeholder
-  (list :type 'xbm :width 256 :height 256
-:data (make-bool-vector (* 256 256) nil))
+  '(:type svg :width 256 :height 256
+:data "
+  
+
+  
+
+  
+  
+")
   "Placeholder image for tiles.")
 
 (defvar osm--search-history nil



[elpa] externals/osm 7a50000e1e 58/77: Add separate resize function, revert tile cache

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 7a5e1ee01eff4c18a7221fcd2d1e31cc7b3d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add separate resize function, revert tile cache
---
 osm.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index 0dd3b9084c..8bdd572e2e 100644
--- a/osm.el
+++ b/osm.el
@@ -487,7 +487,7 @@ Should be at least 7 days according to the server usage 
policies."
   mwheel-scroll-left-function #'osm-left
   mwheel-scroll-right-function #'osm-right
   bookmark-make-record-function #'osm--make-bookmark)
-  (add-hook 'window-size-change-functions #'osm--revert nil 'local))
+  (add-hook 'window-size-change-functions #'osm--resize nil 'local))
 
 (defun osm--get-tile (x y)
   "Get tile at X/Y."
@@ -539,6 +539,12 @@ Should be at least 7 days according to the server usage 
policies."
 
 (defun osm--revert (&rest _)
   "Revert buffer."
+  (when (eq major-mode #'osm-mode)
+(when osm--tiles (clrhash osm--tiles))
+(osm--update)))
+
+(defun osm--resize (&rest _)
+  "Resize buffer."
   (when (eq major-mode #'osm-mode)
 (osm--update)))
 



[elpa] externals/osm d27892f63a 40/77: Add some utility functions

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit d27892f63a5356ba1a406de0b26af1185e096131
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add some utility functions
---
 osm.el | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/osm.el b/osm.el
index 3da392f61d..413b080246 100644
--- a/osm.el
+++ b/osm.el
@@ -219,14 +219,22 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (setq lat (* lat (/ float-pi 180.0)))
   (- 0.5 (/ (log (+ (tan lat) (/ 1 (cos lat float-pi 2)))
 
+(defun osm--x-to-lon (x zoom)
+  "Return longitude in degrees for X/ZOOM."
+  (- (/ (* x 360.0) 256.0 (expt 2.0 zoom)) 180.0))
+
+(defun osm--y-to-lat (y zoom)
+  "Return latitude in degrees for Y/ZOOM."
+  (setq y (* float-pi (- 1 (* 2 (/ y 256.0 (expt 2.0 zoom))
+  (/ (* 180 (atan (/ (- (exp y) (exp (- y))) 2))) float-pi))
+
 (defun osm--lon ()
   "Return longitude in degrees."
-  (- (/ (* osm--x 360.0) 256.0 (expt 2.0 osm--zoom)) 180.0))
+  (osm--x-to-lon osm--x osm--zoom))
 
 (defun osm--lat ()
   "Return latitude in degrees."
-  (let ((y (* float-pi (- 1 (* 2 (/ osm--y 256.0 (expt 2.0 osm--zoom)))
-(/ (* 180 (atan (/ (- (exp y) (exp (- y))) 2))) float-pi)))
+  (osm--y-to-lat osm--y osm--zoom))
 
 (defun osm--lon-to-x (lon zoom)
   "Convert LON/ZOOM to x coordinate in pixel."



[elpa] externals/osm 591d783065 36/77: README: Improve documentation

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 591d783065a7dd939f92f048cda02ac46050e797
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Improve documentation
---
 README.org | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index f98a194654..58e4cdee18 100644
--- a/README.org
+++ b/README.org
@@ -19,10 +19,26 @@
 - Map scale indicator
 - Jump to coordinate
 - Search for location by name
-- Org link support (Example: [[osm:44,10,6][Toscana, Italia 44° 10°]])
+- Org link support
 - Bookmarks
 - Multiple preconfigured servers
 
+* Org links
+
+Bind =org-store-link= to some key binding, e.g., ~C-c o l~. After pressing 
this key
+binding inside an =osm-mode= buffer the link is stored. Then you can insert 
into
+an Org buffer with ~C-c C-l~.
+
+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]]
+
+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
+reuse the buffer name for their description.
+
 * Commands and Key Bindings
 
 Top-level commands:



[elpa] externals/osm a6335090e9 33/77: Handle multiple windows

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit a6335090e9287976a187d3b2159279af44b02b89
Author: Daniel Mendler 
Commit: Daniel Mendler 

Handle multiple windows
---
 osm.el | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/osm.el b/osm.el
index 8563258a2e..c3ebd2eef9 100644
--- a/osm.el
+++ b/osm.el
@@ -500,7 +500,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (let* ((size (expt 2 osm--zoom))
(meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi size))
(meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))
+   (windows (or (get-buffer-window-list) (list (frame-root-window
+   (win-width (cl-loop for w in windows maximize (window-pixel-width 
w)))
+   (win-height (cl-loop for w in windows maximize (window-pixel-height 
w)))
(idx 0))
+  (setq osm--wx (/ win-width 2)
+osm--wy (/ win-height 2)
+osm--nx (1+ (ceiling win-width 256))
+osm--ny (1+ (ceiling win-height 256)))
   (while (and (< idx (1- (length meter))) (< (/ (nth (1+ idx) meter) 
meter-per-pixel) 100))
 (cl-incf idx))
   (setq meter (nth idx meter))
@@ -521,10 +528,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (if (>= meter 1000) (/ meter 1000) meter)
 (if (>= meter 1000) "km" "m"))
 '(:eval (osm--queue-info
-  (setq osm--wx (/ (window-pixel-width) 2)
-osm--wy (/ (window-pixel-height) 2)
-osm--nx (1+ (ceiling (window-pixel-width) 256))
-osm--ny (1+ (ceiling (window-pixel-height) 256)))
   (erase-buffer)
   (dotimes (_j osm--ny)
 (insert (concat (make-string osm--nx ?\s) "\n")))
@@ -600,8 +603,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (rename-buffer name 'unique)))
   (when (or (not (and osm--x osm--y)) at)
 (osm--set-coordinates (or at (osm--home-coordinates
-  (osm--update)
-  (pop-to-buffer (current-buffer)
+  (prog1 (pop-to-buffer (current-buffer))
+(osm--update)
 
 ;;;###autoload
 (defun osm-goto (lat lon zoom)



[elpa] externals/osm d5c5dc6ffd 75/77: Mouse dragging: Check window

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit d5c5dc6ffd72ece296ccc4b3c89a697ca2ed4c77
Author: Daniel Mendler 
Commit: Daniel Mendler 

Mouse dragging: Check window
---
 osm.el | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/osm.el b/osm.el
index 470e71b25d..7682b072af 100644
--- a/osm.el
+++ b/osm.el
@@ -353,19 +353,22 @@ Should be at least 7 days according to the server usage 
policies."
   "Handle drag EVENT."
   (interactive "@e")
   (pcase-let ((`(,sx . ,sy) (posn-x-y (event-start event)))
+  (win (selected-window))
   (map (make-sparse-keymap)))
 (cl-incf sx osm--x)
 (cl-incf sy osm--y)
 (define-key map [mouse-movement]
   (lambda (event)
-(interactive "@e")
-(define-key map [mouse-1] #'ignore)
-(define-key map [mouse-2] #'ignore)
-(define-key map [mouse-3] #'ignore)
-(pcase-let ((`(,ex . ,ey) (posn-x-y (event-start event
-  (setq osm--x (- sx ex)
-osm--y (- sy ey))
-  (osm--update
+(interactive "e")
+(setq event (event-start event))
+(when (eq win (posn-window event))
+  (define-key map [mouse-1] #'ignore)
+  (define-key map [mouse-2] #'ignore)
+  (define-key map [mouse-3] #'ignore)
+  (pcase-let ((`(,ex . ,ey) (posn-x-y event)))
+(setq osm--x (- sx ex)
+  osm--y (- sy ey))
+(osm--update)
 (setq track-mouse 'dragging)
 (set-transient-map map
(lambda () (eq (car-safe last-input-event) 
'mouse-movement))



[elpa] externals/compat c4aefbed75 2/2: Add trailing newline to .elpaignore

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit c4aefbed75cf510e71b31e8a1e62e251257c021c
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Add trailing newline to .elpaignore
---
 .elpaignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.elpaignore b/.elpaignore
index 3c4929e1a0..2fe0af53a7 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -5,4 +5,4 @@ Makefile
 .elpaignore
 COPYING
 README.md
-compat.texi
\ No newline at end of file
+compat.texi



[elpa] externals/osm 0edc1c77db 13/77: Overwrite more settings

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 0edc1c77dbd6aa6e83e51daf4c91b39af81a2979
Author: Daniel Mendler 
Commit: Daniel Mendler 

Overwrite more settings
---
 osm.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/osm.el b/osm.el
index 1c96230aa5..7426e0c15a 100644
--- a/osm.el
+++ b/osm.el
@@ -381,11 +381,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (osm--clean-cache)
   (setq-local line-spacing nil
   cursor-type nil
+  cursor-in-non-selected-windows nil
   left-fringe-width 1
   right-fringe-width 1
   left-margin-width 0
   right-margin-width 0
   truncate-lines t
+  show-trailing-whitespace nil
+  display-line-numbers nil
   buffer-read-only t
   revert-buffer-function #'osm--update
   bookmark-make-record-function #'osm--make-bookmark



[elpa] externals/osm 809b371219 04/77: Add customizable osm-buffer-name

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 809b371219f54dde3183b5c5912d16310dd0cff8
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add customizable osm-buffer-name
---
 osm.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/osm.el b/osm.el
index 19f4141c89..d2fcbe2feb 100644
--- a/osm.el
+++ b/osm.el
@@ -57,6 +57,10 @@
   "List of tile servers."
   :type '(alist :key-type symbol :value-type plist))
 
+(defcustom osm-buffer-name "*osm*"
+  "Default buffer name."
+  :type 'string)
+
 (defcustom osm-large-step 256
   "Movement step in pixel."
   :type 'integer)
@@ -444,8 +448,8 @@ The buffer is optionally assigned a UNIQUE name."
   (with-current-buffer
   (cond
((and (not name) (not unique) (derived-mode-p #'osm-mode)) 
(current-buffer))
-   (unique (generate-new-buffer (or name "*osm*")))
-   (t (get-buffer-create (or name "*osm*"
+   (unique (generate-new-buffer (or name osm-buffer-name)))
+   (t (get-buffer-create (or name osm-buffer-name
 (unless (derived-mode-p #'osm-mode)
   (osm-mode))
 (setq osm--zoom zoom)



[elpa] externals/osm 593b95a50c 17/77: Add more maps

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 593b95a50c0c8b0049749666b6a3ca1dc0ce7e2c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add more maps
---
 osm.el | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/osm.el b/osm.el
index 68d8b23296..f1149fe823 100644
--- a/osm.el
+++ b/osm.el
@@ -69,6 +69,24 @@
  :url ("https://a.tile.opentopomap.org/%s/%s/%s.png";
"https://b.tile.opentopomap.org/%s/%s/%s.png";
"https://c.tile.opentopomap.org/%s/%s/%s.png";))
+(opvnkarte
+ :name "ÖPNVKarte"
+ :min-zoom 2 :max-zoom 18 :max-connections 2
+ :url ("http://a.tile.memomaps.de/tilegen/%s/%s/%s.png";
+   "http://b.tile.memomaps.de/tilegen/%s/%s/%s.png";
+   "http://c.tile.memomaps.de/tilegen/%s/%s/%s.png";))
+(cyclosm
+ :name "CyclOSM"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://a.tile.openstreetmap.fr/cyclosm/%s/%s/%s.png";
+   "https://b.tile.openstreetmap.fr/cyclosm/%s/%s/%s.png";
+   "https://c.tile.openstreetmap.fr/cyclosm/%s/%s/%s.png";))
+(openriverboatmap
+ :name "OpenRiverBoatMap"
+ :min-zoom 2 :max-zoom 19 :max-connections 2
+ :url ("https://a.tile.openstreetmap.fr/openriverboatmap/%s/%s/%s.png";
+   "https://b.tile.openstreetmap.fr/openriverboatmap/%s/%s/%s.png";
+   "https://c.tile.openstreetmap.fr/openriverboatmap/%s/%s/%s.png";))
 (stamen-watercolor
  :name "Stamen Watercolor"
  :min-zoom 2 :max-zoom 19 :max-connections 2



[elpa] externals/osm 6f14067777 26/77: add mwheel scroll functions

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 6f1406e1d8d687851f9daa1cbcdf267cec30
Author: Daniel Mendler 
Commit: Daniel Mendler 

add mwheel scroll functions
---
 osm.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/osm.el b/osm.el
index cba4104738..279cb53542 100644
--- a/osm.el
+++ b/osm.el
@@ -419,9 +419,13 @@ We need two distinct images which are not `eq' for the 
display properties.")
   show-trailing-whitespace nil
   display-line-numbers nil
   buffer-read-only t
+  fringe-indicator-alist '((truncation . nil))
   revert-buffer-function #'osm--revert
-  bookmark-make-record-function #'osm--make-bookmark
-  fringe-indicator-alist '((truncation . nil)))
+  mwheel-scroll-up-function #'osm-down
+  mwheel-scroll-down-function #'osm-up
+  mwheel-scroll-left-function #'osm-left
+  mwheel-scroll-right-function #'osm-right
+  bookmark-make-record-function #'osm--make-bookmark)
   (add-hook 'window-size-change-functions #'osm--revert nil 'local))
 
 (defun osm--display-tile (x y)



[elpa] externals/osm 5d8959d9ad 64/77: Improve keybindings

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 5d8959d9ad0e1dd02b5512e55ff527975bb41efb
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve keybindings
---
 README.org | 4 +++-
 osm.el | 7 +++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index b73a0d77ec..0a6d29eff4 100644
--- a/README.org
+++ b/README.org
@@ -30,7 +30,8 @@
 :bind (("C-c m h" . osm-home)
("C-c m s" . osm-search)
("C-c m t" . osm-server)
-   ("C-c m g" . osm-goto))
+   ("C-c m g" . osm-goto)
+   ("C-c m b" . osm-bookmark-jump))
 :init
 ;; Load Org link support
 (with-eval-after-load 'org
@@ -59,6 +60,7 @@ Top-level commands:
 - =osm-search=: Search and jump to location
 - =osm-goto=: Go to coordinates
 - =osm-server=: Select server
+- =osm-bookmark-jump=: Jump to bookmark
 
 Key bindings in =osm-mode= buffer:
 - ~~: Small step scrolling
diff --git a/osm.el b/osm.el
index bb97a00690..a03b75719a 100644
--- a/osm.el
+++ b/osm.el
@@ -158,8 +158,8 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "s" #'osm-search)
 (define-key map "t" #'osm-server)
 (define-key map "l" 'org-store-link)
-(define-key map "b" #'osm-bookmark-set)
-(define-key map "B" #'osm-bookmark-jump)
+(define-key map "B" #'osm-bookmark-set)
+(define-key map "b" #'osm-bookmark-jump)
 (define-key map [remap scroll-down-command] #'osm-down)
 (define-key map [remap scroll-up-command] #'osm-up)
 (define-key map "<" nil)
@@ -871,8 +871,7 @@ MSG is a message prefix string."
 
 (dolist (sym (list #'osm-up #'osm-down #'osm-left #'osm-right
#'osm-up-up #'osm-down-down #'osm-left-left 
#'osm-right-right
-   #'osm-zoom-out #'osm-zoom-in #'osm-bookmark-set 
#'osm-bookmark-jump
-   #'osm-bookmark-delete))
+   #'osm-zoom-out #'osm-zoom-in #'osm-bookmark-set))
   (put sym 'command-modes '(osm-mode)))
 (dolist (sym (list #'osm-drag #'osm-zoom-click #'osm-org-link-click
 #'osm-bookmark-set-click #'osm-bookmark-delete-click))



[elpa] externals/osm 548dc8c47c 25/77: Minor cleanup

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 548dc8c47cc0751ce9668c6057446e01d381c0dd
Author: Daniel Mendler 
Commit: Daniel Mendler 

Minor cleanup
---
 osm.el | 30 +-
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/osm.el b/osm.el
index e78c6c4c2c..cba4104738 100644
--- a/osm.el
+++ b/osm.el
@@ -242,20 +242,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--tile-file (x y zoom)
   "Return tile file name for coordinate X, Y and ZOOM."
-  (format "%s%d-%d-%d.%s" (osm--cache-directory) zoom x y
-  (file-name-extension
-   (url-file-nondirectory
-(osm--server-property :url)
-
-(defun osm--cache-directory ()
-  "Return tile cache directory."
-  (let ((dir (expand-file-name
-  (file-name-concat osm-cache-directory
-(symbol-name osm-server)
-"/"
-(unless (file-exists-p dir)
-  (make-directory dir t))
-dir))
+  (expand-file-name
+   (format "%s%s/%d-%d-%d.%s"
+   osm-cache-directory
+   (symbol-name osm-server)
+   zoom x y
+   (file-name-extension
+(url-file-nondirectory
+ (osm--server-property :url))
 
 (defun osm--enqueue (x y)
   "Enqueue tile X/Y for download."
@@ -276,7 +270,10 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (pcase-let* ((`(,x ,y . ,zoom) job)
  (buffer (current-buffer))
  (dst (osm--tile-file x y zoom))
- (tmp (concat dst ".tmp")))
+ (tmp (concat dst ".tmp"))
+ (dir (file-name-directory tmp)))
+  (unless (file-exists-p dir)
+(make-directory dir t))
   (make-process
:name (format "osm %s %s %s" x y zoom)
:connection-type 'pipe
@@ -479,8 +476,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (unless (derived-mode-p #'osm-mode)
 (error "Not an osm-mode buffer"))
   (with-silent-modifications
-(let* ((default-directory (osm--cache-directory))
-   (size (expt 2 osm--zoom))
+(let* ((size (expt 2 osm--zoom))
(meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi size))
(meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))
(idx 0))



[elpa] externals/osm f2fba2ebdf 43/77: Auto rename the buffers

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit f2fba2ebdf6b00031400658baf610e6ad877f2ea
Author: Daniel Mendler 
Commit: Daniel Mendler 

Auto rename the buffers
---
 README.org |   5 ---
 osm-ol.el  |   8 ++--
 osm.el | 138 +++--
 3 files changed, 56 insertions(+), 95 deletions(-)

diff --git a/README.org b/README.org
index 0454772f0b..df02910ef6 100644
--- a/README.org
+++ b/README.org
@@ -37,10 +37,6 @@ Examples:
 - [[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
-reuse the buffer name for their description.
-
 * Commands and Key Bindings
 
 Top-level commands:
@@ -57,7 +53,6 @@ Key bindings in =osm-mode= buffer:
 - ~h~: =osm-home=
 - ~s~: =osm-search=
 - ~S~: =osm-server=
-- ~n~: =osm-rename=
 - ~b~: =bookmark-set=
 - ~B~: =bookmark-jump=
 - ~q~: =quit-window=
diff --git a/osm-ol.el b/osm-ol.el
index b4ae528155..b18b4aed0e 100644
--- a/osm-ol.el
+++ b/osm-ol.el
@@ -42,10 +42,10 @@
  link)
   (error "Invalid osm link"))
 (osm--setup
- :at (list (string-to-number (match-string 2 link))
-   (string-to-number (match-string 3 link))
-   (string-to-number (match-string 4 link)))
- :server (and (match-end 1) (intern (match-string 1 link))
+ (list (string-to-number (match-string 2 link))
+   (string-to-number (match-string 3 link))
+   (string-to-number (match-string 4 link)))
+ (and (match-end 1) (intern (match-string 1 link))
 
 (defun osm-ol-store ()
   "Store osm link."
diff --git a/osm.el b/osm.el
index 02bbce9c10..4a689de25c 100644
--- a/osm.el
+++ b/osm.el
@@ -45,12 +45,12 @@
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.org/%z/%x/%y.png";)
 (de
- :name "Mapnik (de)"
+ :name "Mapnik:de"
  :description "Localized Mapnik map provided by OpenStreetMap Deutschland"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.de/%z/%x/%y.png";)
 (fr
- :name "Mapnik (fr)"
+ :name "Mapnik:fr"
  :description "Localized Mapnik map by OpenStreetMap France"
  :min-zoom 2 :max-zoom 19 :max-connections 2
  :url "https://[abc].tile.openstreetmap.fr/osmfr/%z/%x/%y.png";)
@@ -144,7 +144,6 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map "S" #'osm-server)
 (define-key map "b" #'bookmark-set)
 (define-key map "B" #'bookmark-jump)
-(define-key map "n" #'osm-rename)
 (define-key map [remap scroll-down-command] #'osm-down)
 (define-key map [remap scroll-up-command] #'osm-up)
 (define-key map "\d" nil)
@@ -489,7 +488,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm-home ()
   "Go to home coordinates."
   (interactive)
-  (osm--setup :at (osm--home-coordinates)))
+  (osm--setup (osm--home-coordinates) nil))
 
 (defun osm--queue-info ()
   "Return queue info string."
@@ -506,6 +505,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   "Update map display."
   (unless (eq major-mode #'osm-mode)
 (error "Not an osm-mode buffer"))
+  (rename-buffer (osm--buffer-name) 'unique)
   (with-silent-modifications
 (let* ((meter-per-pixel (/ (* 156543.03 (cos (/ (osm--lat) (/ 180.0 
float-pi (expt 2 osm--zoom)))
(meter '(1 5 10 50 100 500 1000 5000 1 5 10 50 
100 500 1000))
@@ -523,8 +523,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (setq-local
header-line-format
(list
-(format " %s %s %sZ%-2d%s%s%s %s %s"
-(osm--server-property :name)
+(format "%s %sZ%-2d%s%s%s %s %s"
 (format #("%7.2f°" 0 5 (face bold)) (osm--lat))
 (format #("%7.2f°" 0 5 (face bold)) (osm--lon))
 osm--zoom
@@ -536,7 +535,11 @@ We need two distinct images which are not `eq' for the 
display properties.")
 'display '(space :width (3)))
 (if (>= meter 1000) (/ meter 1000) meter)
 (if (>= meter 1000) "km" "m"))
-'(:eval (osm--queue-info
+'(:eval (osm--queue-info))
+(let ((server (osm--server-property :name)))
+  (concat
+   (propertize " " 'display `(space :align-to (- right ,(length 
server) 2)))
+   server
   (erase-buffer)
   (dotimes (_j osm--ny)
 (insert (make-string osm--nx ?\s) "\n"))
@@ -568,13 +571,9 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (de

[elpa] externals/osm cb191d426f 76/77: Version 0.2

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit cb191d426f1ac387e6d1895cd7fb4a79ad81762b
Author: Daniel Mendler 
Commit: Daniel Mendler 

Version 0.2
---
 README.org | 9 +
 osm-ol.el  | 2 +-
 osm.el | 6 +++---
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 03ca23fb60..154db05848 100644
--- a/README.org
+++ b/README.org
@@ -7,6 +7,10 @@
 #+texinfo_dir_desc: OpenStreetMap viewer for Emacs
 
 #+html: https://www.gnu.org/software/emacs/";>https://github.com/minad/corfu/blob/screenshots/emacs.svg?raw=true"/>
+#+html: http://elpa.gnu.org/packages/osm.html";>https://elpa.gnu.org/packages/osm.svg"/>
+#+html: http://elpa.gnu.org/devel/osm.html";>https://elpa.gnu.org/devel/osm.svg"/>
+#+html: https://melpa.org/#/osm";>https://melpa.org/packages/osm-badge.svg"/>
+#+html: https://stable.melpa.org/#/osm";>https://stable.melpa.org/packages/osm-badge.svg"/>
 
 [[https://github.com/minad/osm/blob/screenshots/osm.png?raw=true]]
 (Map tiles © https://opentopomap.org,  https://openstreetmap.org)
@@ -90,3 +94,8 @@ There have been other attempts at map viewers in Emacs before.
 - https://github.com/ruediger/osm-mode
 - https://github.com/svenssonjoel/Emacs-OSM
 - https://github.com/jd/google-maps.el
+
+* Contributions
+
+Since this package is part of [[http://elpa.gnu.org/packages/osm.html][GNU 
ELPA]] contributions require a copyright
+assignment to the FSF.
diff --git a/osm-ol.el b/osm-ol.el
index 96a4e4fed4..b3f586924a 100644
--- a/osm-ol.el
+++ b/osm-ol.el
@@ -1,6 +1,6 @@
 ;;; osm-ol.el --- Org links for `osm-mode' -*- lexical-binding: t -*-
 
-;; Copyright (C) 2022 Daniel Mendler
+;; Copyright (C) 2022  Free Software Foundation, Inc.
 
 ;; This file is not part of GNU Emacs.
 
diff --git a/osm.el b/osm.el
index 7682b072af..43ac22bd3b 100644
--- a/osm.el
+++ b/osm.el
@@ -1,11 +1,11 @@
 ;;; osm.el --- OpenStreetMap viewer -*- lexical-binding: t -*-
 
-;; Copyright (C) 2022 Daniel Mendler
+;; Copyright (C) 2022  Free Software Foundation, Inc.
 
 ;; Author: Daniel Mendler 
+;; Maintainer: Daniel Mendler 
 ;; Created: 2022
-;; License: GPL-3.0-or-later
-;; Version: 0.1
+;; Version: 0.2
 ;; Package-Requires: ((emacs "27.1"))
 ;; Homepage: https://github.com/minad/osm
 



[elpa] externals/osm 9ffe9592ba 55/77: Simplify code

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 9ffe9592bae226dcb3ebddede2978b9c6ec5557a
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify code
---
 osm.el | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/osm.el b/osm.el
index ec2c19196b..3b50827c47 100644
--- a/osm.el
+++ b/osm.el
@@ -157,14 +157,10 @@ Should be at least 7 days according to the server usage 
policies."
 map)
   "Keymap used by `osm-mode'.")
 
-(defconst osm--placeholder1
-  `(image :type xbm :width 256 :height 256
-  :data ,(make-bool-vector (* 256 256) nil))
-  "First placeholder image for tiles.")
-
-(defconst osm--placeholder2 `(image ,@(cdr osm--placeholder1))
-  "Second placeholder image for tiles.
-We need two distinct images which are not `eq' for the display properties.")
+(defconst osm--placeholder
+  (list :type 'xbm :width 256 :height 256
+:data (make-bool-vector (* 256 256) nil))
+  "Placeholder image for tiles.")
 
 (defvar osm--search-history nil
   "Minibuffer search history used by `osm-search'.")
@@ -494,7 +490,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (my (if (= 0 j) (mod (- osm--y osm--wy) 256) 0))
  (pos (+ (point-min) (* j (1+ osm--nx)) i)))
 (unless tile
-  (setq tile (if (= 0 (mod i 2)) osm--placeholder1 osm--placeholder2)))
+  (setq tile (cons 'image osm--placeholder)))
 (with-silent-modifications
   (put-text-property
pos (1+ pos) 'display



[elpa] externals/osm 162f883f80 35/77: Reuse existing buffer

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 162f883f809c184c058de75eb50018ca06c8493f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Reuse existing buffer
---
 osm.el | 62 +-
 1 file changed, 41 insertions(+), 21 deletions(-)

diff --git a/osm.el b/osm.el
index 78447e6e88..965b2ebd23 100644
--- a/osm.el
+++ b/osm.el
@@ -207,15 +207,15 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (max (osm--server-property :min-zoom)
  (min
   (osm--server-property :max-zoom)
-  (min (logb (/ w (abs (- (osm--lon-to-x lon1) (osm--lon-to-x lon2)
-   (logb (/ h (abs (- (osm--lat-to-y lat1) (osm--lat-to-y 
lat2))
+  (min (logb (/ w (abs (- (osm--lon-to-normalized-x lon1) 
(osm--lon-to-normalized-x lon2)
+   (logb (/ h (abs (- (osm--lat-to-normalized-y lat1) 
(osm--lat-to-normalized-y lat2))
 
-(defun osm--lon-to-x (lon)
-  "Convert LON to x coordinate (unscaled)."
+(defun osm--lon-to-normalized-x (lon)
+  "Convert LON to normalized x coordinate."
   (/ (+ lon 180.0) 360.0))
 
-(defun osm--lat-to-y (lat)
-  "Convert LAT to y coordiate (unscaled)."
+(defun osm--lat-to-normalized-y (lat)
+  "Convert LAT to normalized y coordinate."
   (setq lat (* lat (/ float-pi 180.0)))
   (- 0.5 (/ (log (+ (tan lat) (/ 1 (cos lat float-pi 2)))
 
@@ -228,12 +228,13 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (let ((y (* float-pi (- 1 (* 2 (/ osm--y 256.0 (expt 2.0 osm--zoom)))
 (/ (* 180 (atan (/ (- (exp y) (exp (- y))) 2))) float-pi)))
 
-(defun osm--set-coordinates (coord)
-  "Set coordinate triple COORD."
-  (let ((n (* 256 (expt 2.0 (nth 2 coord)
-(setq osm--zoom (nth 2 coord)
-  osm--x (floor (* n (osm--lon-to-x (nth 1 coord
-  osm--y (floor (* n (osm--lat-to-y (nth 0 coord)))
+(defun osm--lon-to-x (lon zoom)
+  "Convert LON/ZOOM to x coordinate in pixel."
+  (floor (* 256 (expt 2.0 zoom) (osm--lon-to-normalized-x lon
+
+(defun osm--lat-to-y (lat zoom)
+  "Convert LAT/ZOOM to y coordinate in pixel."
+  (floor (* 256 (expt 2.0 zoom) (osm--lat-to-normalized-y lat
 
 (defun osm--home-coordinates ()
   "Return home coordinate triple."
@@ -489,12 +490,12 @@ We need two distinct images which are not `eq' for the 
display properties.")
 
 (defun osm--revert (&rest _)
   "Revert buffer."
-  (when (derived-mode-p #'osm-mode)
+  (when (eq major-mode #'osm-mode)
 (osm--update)))
 
 (defun osm--update ()
   "Update map display."
-  (unless (derived-mode-p #'osm-mode)
+  (unless (eq major-mode #'osm-mode)
 (error "Not an osm-mode buffer"))
   (with-silent-modifications
 (let* ((size (expt 2 osm--zoom))
@@ -593,14 +594,30 @@ We need two distinct images which are not `eq' for the 
display properties.")
   ;; Server not found
   (when (and server (not (assq server osm-server-list))) (setq server nil))
   (with-current-buffer
-  (if (derived-mode-p #'osm-mode)
+  (if (eq major-mode #'osm-mode)
   (current-buffer)
-(generate-new-buffer
- (or name
- (let ((osm-server (or server osm-server)))
-   (osm--default-buffer-name)
+(pcase-let* ((def-name (or name
+   (let ((osm-server (or server osm-server)))
+ (osm--default-buffer-name
+ (`(,def-lat ,def-lon ,def-zoom) (or at 
(osm--home-coordinates)))
+ (def-x (osm--lon-to-x def-lon def-zoom))
+ (def-y (osm--lat-to-y def-lat def-zoom))
+ (def-server (or server osm-server))
+ (def-name-regexp (format "\\`%s\\(?:<[0-9]+>\\)?\\'"
+  (regexp-quote def-name
+  (or (cl-loop
+   ;; Search for existing buffer
+   for buf in (buffer-list) thereis
+   (and (eq (buffer-local-value 'major-mode buf) #'osm-mode)
+(eq (buffer-local-value 'osm-server buf) def-server)
+(eq (buffer-local-value 'osm--zoom buf) def-zoom)
+(eq (buffer-local-value 'osm--x buf) def-x)
+(eq (buffer-local-value 'osm--y buf) def-y)
+(string-match-p def-name-regexp (buffer-name buf))
+buf))
+  (generate-new-buffer def-name
 (let ((auto-rename (or name (osm--generated-name-p
-  (unless (derived-mode-p #'osm-mode)
+  (unless (eq major-mode #'osm-mode)
 (osm-mode))
   (when (and server (not (eq osm-server server)))
 (setq osm-server server
@@ -611,7 +628,10 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (unless (equal name (buffer-name))
   (rename-buffer name 'unique)))
   (when (or (not (and osm--x osm--y)) at)
-(osm--set-coordinates 

[elpa] externals/osm 28d3305bef 32/77: Improve handling of generated names

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 28d3305bef8ed078fe79ae389401a09a11eeaef3
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve handling of generated names
---
 osm.el | 38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/osm.el b/osm.el
index 58ce3fbfc8..8563258a2e 100644
--- a/osm.el
+++ b/osm.el
@@ -550,19 +550,30 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (defun osm--make-bookmark ()
   "Make OSM bookmark."
   (setq bookmark-current-bookmark nil) ;; Reset bookmark to use new name
-  `(,(osm--buffer-description)
+  `(,(osm--buffer-name-with-coordinates)
 (coordinate ,(osm--lat) ,(osm--lon) ,osm--zoom)
 (server . ,osm-server)
 (handler . ,#'osm-bookmark-jump)))
 
+(defun osm--buffer-name-with-coordinates ()
+  "Return buffer description."
+  (if (osm--generated-name-p)
+  (format "osm: %.2f° %.2f° %s"
+  (osm--lat) (osm--lon)
+  (osm--server-property :name))
+(replace-regexp-in-string
+ "\\`\\*\\|\\*\\(?:<[0-9]+>\\)?\\'"
+ "" (buffer-name
+
 (defun osm--default-buffer-name ()
   "Return default buffer name."
   (format "*osm: %s*" (osm--server-property :name)))
 
-(defun osm--default-buffer-name-p ()
-  "Return non-nil if the buffer has a default name."
+(defun osm--generated-name-p ()
+  "Return non-nil if the buffer has a generated name."
   (string-match-p
-   (format "\\`%s\\(?:<[0-9]+>\\)?\\'" (regexp-quote 
(osm--default-buffer-name)))
+   (format "\\`\\*osm:\\(?: [0-9.-]+° [0-9.-]+°\\)? %s\\*\\(?:<[0-9]+>\\)?\\'"
+   (regexp-quote (osm--server-property :name)))
(buffer-name)))
 
 (cl-defun osm--setup (&key at server name)
@@ -576,7 +587,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
  (or name
  (let ((osm-server (or server osm-server)))
(osm--default-buffer-name)
-(let ((auto-rename (or name (osm--default-buffer-name-p
+(let ((auto-rename (or name (osm--generated-name-p
   (unless (derived-mode-p #'osm-mode)
 (osm-mode))
   (when (and server (not (eq osm-server server)))
@@ -601,7 +612,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 (split-string (read-string "Lat Lon (Zoom): ") nil 
t
  (setq zoom (or zoom 11))
  (unless (and (numberp lat) (numberp lon) (numberp zoom))
-   (error "Invalid coordindate"))
+   (error "Invalid coordinate"))
  (list lat lon zoom)))
   (osm--setup :at (list lat lon zoom)))
 
@@ -621,16 +632,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   "Return link data."
   (list (osm--lat) (osm--lon) osm--zoom
 (and (not (eq osm-server (default-value 'osm-server))) osm-server)
-(osm--buffer-description)))
-
-(defun osm--buffer-description ()
-  "Return buffer description."
-  (if (osm--default-buffer-name-p)
-  (format "osm: %s %.2f° %.2f°"
-  (osm--server-property :name) (osm--lat) (osm--lon))
-(replace-regexp-in-string
- "\\`\\*\\|\\*\\(?:<[0-9]+>\\)?\\'"
- "" (buffer-name
+(osm--buffer-name-with-coordinates)))
 
 (defun osm--description ()
   "Return descriptive string for current map."
@@ -653,8 +655,8 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (interactive)
   (when-let (desc (osm--description))
 (rename-buffer
- (format "*osm: %s %.2f° %.2f° %s*" desc
- (osm--lat) (osm--lon)
+ (format "*osm: %s %.2f° %.2f° %s*"
+ desc (osm--lat) (osm--lon)
  (osm--server-property :name))
  'unique)))
 



[elpa] externals/osm 4c9337bf79 69/77: Update README

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 4c9337bf79741452ceb234b9beb3eeccd344d091
Author: Daniel Mendler 
Commit: Daniel Mendler 

Update README
---
 README.org | 4 ++--
 osm.el | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index 0a6d29eff4..680287f213 100644
--- a/README.org
+++ b/README.org
@@ -20,7 +20,7 @@
 - Jump to coordinate
 - Search for location by name
 - Org link support
-- Bookmarks
+- Bookmarked positions with pins
 - Multiple preconfigured servers
 
 * Configuration
@@ -47,7 +47,7 @@ mouse, see ~osm-bookmark-set-click~ and ~osm-org-link-click~.
 
 Examples:
 
-- [[osm:opentopomap:44.00862011541535,9.99755859375,6][Italia, 44.01° 10.00° 
OpenTopoMap]]
+- [[osm:opentopomap:41.869560826994544,12.45849609375,6][Italia, 41.87° 12.46° 
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]]
diff --git a/osm.el b/osm.el
index 1832d6236d..e684770fb6 100644
--- a/osm.el
+++ b/osm.el
@@ -540,7 +540,7 @@ Should be at least 7 days according to the server usage 
policies."
if pin collect (cons "#ff8800" pin
 (if-let (pin (and osm--transient-pin
   (osm--pin-position x y osm--x osm--y)))
-(nconc pins (list (cons "#aa" pin)))
+(nconc pins (list (cons "#ff0088" pin)))
   pins)))
 
 (defun osm--make-tile (x y)



[elpa] externals/osm adc8156a70 37/77: README: Add more examples

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit adc8156a708263ddf202aef5622fcf74bb8e2564
Author: Daniel Mendler 
Commit: Daniel Mendler 

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 d776cdb343 42/77: Fix melpa issues (See https://github.com/melpa/melpa/pull/7936)

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit d776cdb343d52ce6d712f7f13c3153060fc01f27
Author: Daniel Mendler 
Commit: Daniel Mendler 

Fix melpa issues (See https://github.com/melpa/melpa/pull/7936)
---
 ol-osm.el => osm-ol.el | 14 +++---
 osm.el |  5 +++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/ol-osm.el b/osm-ol.el
similarity index 89%
rename from ol-osm.el
rename to osm-ol.el
index 4234b84518..b4ae528155 100644
--- a/ol-osm.el
+++ b/osm-ol.el
@@ -1,4 +1,4 @@
-;;; ol-osm.el --- Org links for `osm-mode' -*- lexical-binding: t -*-
+;;; osm-ol.el --- Org links for `osm-mode' -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2022 Daniel Mendler
 
@@ -31,10 +31,10 @@
 
 (org-link-set-parameters
  "osm"
- :follow #'ol-osm-open
- :store #'ol-osm-store)
+ :follow #'osm-ol-open
+ :store #'osm-ol-store)
 
-(defun ol-osm-open (link _)
+(defun osm-ol-open (link _)
   "Open osm LINK."
   (save-match-data
 (unless (string-match
@@ -47,7 +47,7 @@
(string-to-number (match-string 4 link)))
  :server (and (match-end 1) (intern (match-string 1 link))
 
-(defun ol-osm-store ()
+(defun osm-ol-store ()
   "Store osm link."
   (when (derived-mode-p 'osm-mode)
 (pcase-let ((`(,lat ,lon ,zoom ,server ,desc) (osm--link-data)))
@@ -59,5 +59,5 @@
   (if server (format "%s:" server) "")
   lat lon zoom)
 
-(provide 'ol-osm)
-;;; ol-osm.el ends here
+(provide 'osm-ol)
+;;; osm-ol.el ends here
diff --git a/osm.el b/osm.el
index e864e0e469..02bbce9c10 100644
--- a/osm.el
+++ b/osm.el
@@ -110,7 +110,7 @@
   :type 'symbol)
 
 (defcustom osm-cache-directory
-  (file-name-concat user-emacs-directory "var/osm/")
+  (expand-file-name "var/osm/" user-emacs-directory)
   "Tile cache directory."
   :type 'string)
 
@@ -435,6 +435,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
   (* 60 60 24 osm-max-age))
(delete-file file)))
 
+(defvar bookmark-make-record-function)
 (define-derived-mode osm-mode special-mode "Osm"
   "OpenStreetMap viewer mode."
   :interactive nil
@@ -538,7 +539,7 @@ We need two distinct images which are not `eq' for the 
display properties.")
 '(:eval (osm--queue-info
   (erase-buffer)
   (dotimes (_j osm--ny)
-(insert (concat (make-string osm--nx ?\s) "\n")))
+(insert (make-string osm--nx ?\s) "\n"))
   (goto-char (point-min))
   (dotimes (j osm--ny)
 (dotimes (i osm--nx)



[elpa] externals/osm 3c0950a24b 31/77: Simplify bookmark handling

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 3c0950a24b14c1eeceff566f73719bab74a827ce
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify bookmark handling
---
 osm.el | 27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/osm.el b/osm.el
index 371eb5ca2d..58ce3fbfc8 100644
--- a/osm.el
+++ b/osm.el
@@ -553,7 +553,6 @@ We need two distinct images which are not `eq' for the 
display properties.")
   `(,(osm--buffer-description)
 (coordinate ,(osm--lat) ,(osm--lon) ,osm--zoom)
 (server . ,osm-server)
-(buffer . ,(buffer-name))
 (handler . ,#'osm-bookmark-jump)))
 
 (defun osm--default-buffer-name ()
@@ -566,18 +565,18 @@ We need two distinct images which are not `eq' for the 
display properties.")
(format "\\`%s\\(?:<[0-9]+>\\)?\\'" (regexp-quote 
(osm--default-buffer-name)))
(buffer-name)))
 
-(cl-defun osm--setup (&key at server buffer)
-  "Setup BUFFER with SERVER at coordinates AT."
+(cl-defun osm--setup (&key at server name)
+  "Setup buffer NAME with SERVER at coordinates AT."
   ;; Server not found
   (when (and server (not (assq server osm-server-list))) (setq server nil))
   (with-current-buffer
   (if (derived-mode-p #'osm-mode)
   (current-buffer)
 (generate-new-buffer
- (or buffer
+ (or name
  (let ((osm-server (or server osm-server)))
(osm--default-buffer-name)
-(let ((auto-rename (osm--default-buffer-name-p)))
+(let ((auto-rename (or name (osm--default-buffer-name-p
   (unless (derived-mode-p #'osm-mode)
 (osm-mode))
   (when (and server (not (eq osm-server server)))
@@ -585,9 +584,9 @@ We need two distinct images which are not `eq' for the 
display properties.")
   osm--active nil
   osm--queue nil))
   (when auto-rename
-(setq buffer (or buffer (osm--default-buffer-name)))
-(unless (equal buffer (buffer-name))
-  (rename-buffer buffer 'unique)))
+(setq name (or name (osm--default-buffer-name)))
+(unless (equal name (buffer-name))
+  (rename-buffer name 'unique)))
   (when (or (not (and osm--x osm--y)) at)
 (osm--set-coordinates (or at (osm--home-coordinates
   (osm--update)
@@ -609,10 +608,14 @@ We need two distinct images which are not `eq' for the 
display properties.")
 ;;;###autoload
 (defun osm-bookmark-jump (bm)
   "Jump to OSM bookmark BM."
-  (set-buffer (osm--setup
-   :at (alist-get 'coordinate bm)
-   :server (alist-get 'server bm)
-   :buffer (alist-get 'buffer bm
+  (set-buffer
+   (osm--setup
+:at (alist-get 'coordinate bm)
+:server (alist-get 'server bm)
+:name
+(if (string-match-p "\\`\\*.*\\*\\'" (car bm))
+(car bm)
+  (format "*%s*" (car bm))
 
 (defun osm--link-data ()
   "Return link data."



[elpa] externals/osm 832bce78f8 72/77: Implement proper map dragging with the mouse

2022-03-07 Thread ELPA Syncer
branch: externals/osm
commit 832bce78f8cff93d4c9505ebddd9ac34eb4f44be
Author: Daniel Mendler 
Commit: Daniel Mendler 

Implement proper map dragging with the mouse
---
 README.org |  4 +++-
 osm.el | 18 +-
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index 680287f213..0faaa05271 100644
--- a/README.org
+++ b/README.org
@@ -15,7 +15,8 @@
 
 - Parallel fetching of tiles with curl
 - Scrolling in large and small steps
-- Zooming with keys or with mouse click
+- Zooming
+- Mouse support (dragging, clicking)
 - Map scale indicator
 - Jump to coordinate
 - Search for location by name
@@ -71,6 +72,7 @@ Key bindings in =osm-mode= buffer:
 - ~~: =osm-org-link-click= - Store point as Org link
 - ~~: =osm-bookmark-set-click= - Store point as bookmark
 - ~~: =osm-bookmark-delete-click= - Delete bookmark at point
+- ~~: =osm-drag= - Drag the map with the mouse
 - ~g~: =osm-goto= - Go to location
 - ~h~: =osm-home= - Go to home location
 - ~s~: =osm-search= - Search for location
diff --git a/osm.el b/osm.el
index baf26a1598..e764cfe937 100644
--- a/osm.el
+++ b/osm.el
@@ -139,7 +139,7 @@ Should be at least 7 days according to the server usage 
policies."
 (define-key map [mouse-2] #'osm-org-link-click)
 (define-key map [mouse-3] #'osm-bookmark-set-click)
 (define-key map [S-mouse-3] #'osm-bookmark-delete-click)
-(define-key map [drag-mouse-1] #'osm-drag)
+(define-key map [down-mouse-1] #'osm-drag)
 (define-key map [up] #'osm-up)
 (define-key map [down] #'osm-down)
 (define-key map [left] #'osm-left)
@@ -351,10 +351,18 @@ Should be at least 7 days according to the server usage 
policies."
   "Handle drag EVENT."
   (interactive "@e")
   (pcase-let ((`(,sx . ,sy) (posn-x-y (event-start event)))
-  (`(,ex . ,ey) (posn-x-y (event-end event
-(cl-incf osm--x (- sx ex))
-(cl-incf osm--y (- sy ey))
-(osm--update)))
+  (map (make-sparse-keymap)))
+(cl-incf sx osm--x)
+(cl-incf sy osm--y)
+(define-key map [mouse-movement]
+  (lambda (event)
+(interactive "@e")
+(pcase-let ((`(,ex . ,ey) (posn-x-y (event-start event
+  (setq osm--x (- sx ex)
+osm--y (- sy ey))
+  (osm--update
+(setq track-mouse 'dragging)
+(set-transient-map map t (lambda () (setq track-mouse nil)
 
 (defun osm-zoom-click (event)
   "Zoom to the location of the click EVENT."



[elpa] externals/compat 2b7780a496 2/4: Delete compat-maxargs-/=

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 2b7780a4966ef17e9f506c3cf5a8f42ce31d2db2
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Delete compat-maxargs-/=

As this function was only used by the deleted advice compatibility
code, it can be deleted.
---
 compat.el | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/compat.el b/compat.el
index 307bd638cf..a92102d29b 100644
--- a/compat.el
+++ b/compat.el
@@ -43,13 +43,6 @@
 
  Core functionality
 
-(eval-and-compile
-  (defun compat-maxargs-/= (func n)
-"Non-nil when FUNC doesn't accept at most N arguments."
-(condition-case nil
-(not (eq (cdr (compat-func-arity func)) n))
-  (void-function t
-
 ;; To accelerate the loading process, we insert the contents of
 ;; compat-N.M.el directly into the compat.elc.
 (eval-when-compile



[elpa] externals/compat 5b48dfcc76 1/4: Move compat-func-arity to compat-26.el

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit 5b48dfcc7650eb599c22a29a1c3bc37edd04d34f
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Move compat-func-arity to compat-26.el
---
 compat-26.el | 64 +++-
 compat.el| 68 
 2 files changed, 63 insertions(+), 69 deletions(-)

diff --git a/compat-26.el b/compat-26.el
index 097842b7b5..5759b6310a 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -40,7 +40,69 @@ FUNC must be a function of some kind.
 The returned value is a cons cell (MIN . MAX).  MIN is the minimum number
 of args.  MAX is the maximum number, or the symbol ‘many’, for a
 function with ‘&rest’ args, or ‘unevalled’ for a special form."
-  (compat-func-arity func))
+  (cond
+   ((or (null func) (and (symbolp func) (not (fboundp func
+(signal 'void-function func))
+   ((and (symbolp func) (not (null func)))
+(compat-func-arity (symbol-function func)))
+   ((eq (car-safe func) 'macro)
+(compat-func-arity (cdr func)))
+   ((subrp func)
+(subr-arity func))
+   ((memq (car-safe func) '(closure lambda))
+;; See lambda_arity from eval.c
+(when (eq (car func) 'closure)
+  (setq func (cdr func)))
+(let ((syms-left (if (consp func)
+ (car func)
+   (signal 'invalid-function func)))
+  (min-args 0) (max-args 0) optional)
+  (catch 'many
+(dolist (next syms-left)
+  (cond
+   ((not (symbolp next))
+(signal 'invalid-function func))
+   ((eq next '&rest)
+(throw 'many (cons min-args 'many)))
+   ((eq next '&optional)
+(setq optional t))
+   (t (unless optional
+(setq min-args (1+ min-args)))
+  (setq max-args (1+ max-args)
+(cons min-args max-args
+   ((and (byte-code-function-p func) (numberp (aref func 0)))
+;; See get_byte_code_arity from bytecode.c
+(let ((at (aref func 0)))
+  (cons (logand at 127)
+(if (= (logand at 128) 0)
+(ash at -8)
+  'many
+   ((and (byte-code-function-p func) (numberp (aref func 0)))
+;; See get_byte_code_arity from bytecode.c
+(let ((at (aref func 0)))
+  (cons (logand at 127)
+(if (= (logand at 128) 0)
+(ash at -8)
+  'many
+   ((and (byte-code-function-p func) (listp (aref func 0)))
+;; Based on `byte-compile-make-args-desc', this is required for
+;; old versions of Emacs that don't use a integer for the argument
+;; list description, per e2abe5a13dffb08d6371b6a611bc39c3a9ac2bc6.
+(let ((arglist (aref func 0)) (mandatory 0) nonrest)
+  (while (and arglist (not (memq (car arglist) '(&optional &rest
+(setq mandatory (1+ mandatory))
+(setq arglist (cdr arglist)))
+  (setq nonrest mandatory)
+  (when (eq (car arglist) '&optional)
+(setq arglist (cdr arglist))
+(while (and arglist (not (eq (car arglist) '&rest)))
+  (setq nonrest (1+ nonrest))
+  (setq arglist (cdr arglist
+  (cons mandatory (if arglist 'many nonrest
+   ((autoloadp func)
+(autoload-do-load func)
+(compat-func-arity func))
+   ((signal 'invalid-function func
 
  Defined in fns.c
 
diff --git a/compat.el b/compat.el
index 8f54c6b591..307bd638cf 100644
--- a/compat.el
+++ b/compat.el
@@ -43,74 +43,6 @@
 
  Core functionality
 
-;; The implementation is extracted here so that compatibility advice
-;; can check if the right number of arguments are being handled.
-(defun compat-func-arity (func)
-  "A reimplementation of `func-arity' for FUNC."
-  (cond
-   ((or (null func) (and (symbolp func) (not (fboundp func
-(signal 'void-function func))
-   ((and (symbolp func) (not (null func)))
-(compat-func-arity (symbol-function func)))
-   ((eq (car-safe func) 'macro)
-(compat-func-arity (cdr func)))
-   ((subrp func)
-(subr-arity func))
-   ((memq (car-safe func) '(closure lambda))
-;; See lambda_arity from eval.c
-(when (eq (car func) 'closure)
-  (setq func (cdr func)))
-(let ((syms-left (if (consp func)
- (car func)
-   (signal 'invalid-function func)))
-  (min-args 0) (max-args 0) optional)
-  (catch 'many
-(dolist (next syms-left)
-  (cond
-   ((not (symbolp next))
-(signal 'invalid-function func))
-   ((eq next '&rest)
-(throw 'many (cons min-args 'many)))
-   ((eq next '&optional)
-(setq optional t))
-   (t (unless optional
-(setq min-args (1+ min-args)))
-  (setq max-args (1+ max-args)
-(cons min-args max-args
-   ((and (byte-code-function-p func) (numberp (aref func 0)))
-;; See get_byte_code_arity from bytecode.c
-(let ((at (aref func 0)))
-  (cons

[elpa] externals/compat updated (c4aefbed75 -> ed462dab08)

2022-03-07 Thread ELPA Syncer
elpasync pushed a change to branch externals/compat.

  from  c4aefbed75 Add trailing newline to .elpaignore
   new  5b48dfcc76 Move compat-func-arity to compat-26.el
   new  2b7780a496 Delete compat-maxargs-/=
   new  e4cc83840b Fix handling of unknown declare properties before Emacs 
25
   new  ed462dab08 Require nadvice without trying to install it


Summary of changes:
 compat-26.el| 64 +++-
 compat-macs.el  |  2 +-
 compat-tests.el |  5 +---
 compat.el   | 75 -
 4 files changed, 65 insertions(+), 81 deletions(-)



[elpa] externals/compat ed462dab08 4/4: Require nadvice without trying to install it

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit ed462dab0812810cc299ee516de9e4aad5a26688
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Require nadvice without trying to install it
---
 compat-tests.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 07086bb2aa..93621c33f2 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -33,10 +33,7 @@
 ;;; Code:
 
 (require 'ert)
-
-(unless (fboundp 'advice-add)
-  (require 'package)
-  (package-install 'nadvice))
+(require 'nadvice)
 
 (require 'compat-macs)
 (defvar compat-testing)



[elpa] externals/compat e4cc83840b 3/4: Fix handling of unknown declare properties before Emacs 25

2022-03-07 Thread ELPA Syncer
branch: externals/compat
commit e4cc83840b0cc2cd65315b5a37343cc27736120e
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Fix handling of unknown declare properties before Emacs 25
---
 compat-macs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat-macs.el b/compat-macs.el
index 6a9a7b7fb1..1b762d8428 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -202,7 +202,7 @@ attributes (see `compat-generate-common')."
 ;; It might be possible to set these properties otherwise.  That
 ;; should be looked into and implemented if it is the case.
 (when (and (listp (car-safe body)) (eq (caar body) 'declare))
-  (when (version<= "25" emacs-version)
+  (when (version<= emacs-version "25")
 (delq (assq 'side-effect-free (car body)) (car body))
 (delq (assq 'pure (car body)) (car body
 ;; Check if we want an explicitly prefixed function



[elpa] externals/nano-modeline 709d0f770f 1/3: Added marker for dedicated window

2022-03-07 Thread ELPA Syncer
branch: externals/nano-modeline
commit 709d0f770ffb3a05f46400749d627241cf23e19f
Author: Nicolas P. Rougier 
Commit: Nicolas P. Rougier 

Added marker for dedicated window
---
 nano-modeline.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/nano-modeline.el b/nano-modeline.el
index 7b1cdf30b6..9a1c5ae6e1 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -377,9 +377,13 @@ KEY mode name, for reference only. Easier to do lookups 
and/or replacements.
 (t (if active 'nano-modeline-active
  'nano-modeline-inactive
  (left (concat (if (stringp prefix)
-   (propertize (format " %s " prefix)
-   'face `(:inherit ,prefix-face)))
-   (propertize " " 'display `(raise 
,nano-modeline-space-top))
+   (concat
+(propertize (if (window-dedicated-p) "•" " ")
+'face `(:inherit ,prefix-face))
+(propertize (format "%s" prefix)
+'face `(:inherit ,prefix-face))
+(propertize " " 'face `(:inherit ,prefix-face
+ (propertize " " 'display `(raise 
,nano-modeline-space-top))
(propertize name 'face (if active 
'nano-modeline-active-name
 'nano-modeline-inactive-name))
(if (length name) " ")



[elpa] externals/nano-modeline updated (c5bf2a977f -> 806254f415)

2022-03-07 Thread ELPA Syncer
elpasync pushed a change to branch externals/nano-modeline.

  from  c5bf2a977f Merge pull request #29 from 
aaronjensen/obsolete-variable-usage
   new  709d0f770f Added marker for dedicated window
   new  c1bb684958 Minor cosmetic for elfeed mode
   new  806254f415 Bumped version to 0.5.1


Summary of changes:
 nano-modeline.el | 33 +
 1 file changed, 21 insertions(+), 12 deletions(-)



[elpa] externals/nano-modeline 806254f415 3/3: Bumped version to 0.5.1

2022-03-07 Thread ELPA Syncer
branch: externals/nano-modeline
commit 806254f415dd5d19db1ae5d8f5585ff5dc334295
Author: Nicolas P. Rougier 
Commit: Nicolas P. Rougier 

Bumped version to 0.5.1
---
 nano-modeline.el | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/nano-modeline.el b/nano-modeline.el
index 75b8cd7e3a..0404e76da7 100644
--- a/nano-modeline.el
+++ b/nano-modeline.el
@@ -47,6 +47,10 @@
 ;;
 ;;; NEWS:
 ;;
+;; Version 0.5.1
+;; - Bug fix (make-obsolete-variable)
+;; - Added marker for dedicated window
+;;
 ;; Version 0.5
 ;; - Dynamic version that is now configurable thanks to the wonderful
 ;;   contribution of Hans Donner (@hans-d)
@@ -922,14 +926,14 @@ depending on the version of mu4e."
   (nano-modeline-default-mode))
 
 (defun nano-modeline-default-mode ()
-(let ((buffer-name (format-mode-line "%b"))
-  (mode-name   (nano-modeline-mode-name))
-  (branch  (nano-modeline-vc-branch))
-  (position(format-mode-line "%l:%c")))
-  (nano-modeline-render nil ;; (upcase  mode-name)
-buffer-name
-(if branch (concat "(" branch ")") "")
-position)))
+  (let ((buffer-name (format-mode-line "%b"))
+(mode-name   (nano-modeline-mode-name))
+(branch  (nano-modeline-vc-branch))
+(position(format-mode-line "%l:%c")))
+(nano-modeline-render nil ;; (upcase  mode-name)
+  buffer-name
+  (if branch (concat "(" branch ")") "")
+  position)))
 
 ;; -
 (defun nano-modeline-face-clear (face)
@@ -972,6 +976,7 @@ depending on the version of mu4e."
 (setq mode-line-format format)
 (setq-default mode-line-format format)
 
+
 (defun nano-modeline-update-windows ()
   "Hide the mode line depending on the presence of a window
 below or a buffer local variable 'no-mode-line'."



  1   2   3   >