[elpa] 01/01: [aa2u] New command: aa2u-mark-rectangle-as-text

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a commit to branch master
in repository elpa.

commit 11213155089e10af066994a0670d4debdd5e0713
Author: Thien-Thi Nguyen 
Date:   Thu May 29 11:04:37 2014 +0200

[aa2u] New command: aa2u-mark-rectangle-as-text

* packages/ascii-art-to-unicode/ascii-art-to-unicode.el:
Arrange to autoload "rect" for ‘apply-on-rectangle’.
(aa2u-mark-rectangle-as-text): New command, w/ autoload cookie.
---
 packages/ascii-art-to-unicode/NEWS |3 +++
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |   18 +-
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/packages/ascii-art-to-unicode/NEWS 
b/packages/ascii-art-to-unicode/NEWS
index 6978fe5..58aa282 100644
--- a/packages/ascii-art-to-unicode/NEWS
+++ b/packages/ascii-art-to-unicode/NEWS
@@ -2,6 +2,9 @@ NEWS for ascii-art-to-unicode.el
 See the end for copying conditions.
 
 
+- 1.9 | NOT YET RELEASED
+  - new command: ‘aa2u-mark-rectangle-as-text’
+
 - 1.8 | 2014-05-21
   - new command: ‘aa2u-mark-as-text’
   - package keywords added (to help discovery)
diff --git a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el 
b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
index 03f613a..a353c9e 100644
--- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
+++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
@@ -81,7 +81,6 @@
 ;; `aa2u-mark-as-text'.  A prefix arg clears the property, instead.
 ;; (You can use `describe-text-properties' to check.)  For example:
 ;;
-;;
 ;;  ┌───┐
 ;;  │   │
 ;;  │ |\/|  │
@@ -92,6 +91,8 @@
 ;;│
 ;;"
 ;;
+;; Command `aa2u-mark-rectangle-as-text' is similar, for rectangles.
+;;
 ;;
 ;; See Also
 ;; - HACKING: 

@@ -102,6 +103,8 @@
 (require 'cl-lib)
 (require 'pcase)
 
+(autoload 'apply-on-rectangle "rect")
+
 (defvar aa2u-uniform-weight 'LIGHT
   "A symbol, either `LIGHT' or `HEAVY'.
 This specifies the weight of all the lines.")
@@ -308,6 +311,19 @@ Prefix arg means to remove property `aa2u-text', instead."
start end
'(aa2u-text t)))
 
+;;;###autoload
+(defun aa2u-mark-rectangle-as-text (start end &optional unmark)
+  "Like `aa2u-mark-as-text' on the region-rectangle.
+When called from a program the rectangle's corners
+are START (top left) and END (bottom right)."
+  (interactive "r\nP")
+  (apply-on-rectangle
+   (lambda (scol ecol unmark)
+ (let ((p (point)))
+   (aa2u-mark-as-text (+ p scol) (+ p ecol) unmark)))
+   start end
+   unmark))
+
 ;;;---
 ;;; that's it
 



[elpa] branch master updated (f989832 -> 1121315)

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a change to branch master
in repository elpa.

  from  f989832   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  1121315   [aa2u] New command: aa2u-mark-rectangle-as-text

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/ascii-art-to-unicode/NEWS |3 +++
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |   18 +-
 2 files changed, 20 insertions(+), 1 deletions(-)



[elpa] branch master updated (1121315 -> a6e098b)

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a change to branch master
in repository elpa.

  from  1121315   [aa2u] New command: aa2u-mark-rectangle-as-text
   new  a6e098b   [aa2u] Update homepage; drop other links.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/ascii-art-to-unicode/NEWS |1 +
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |6 +-
 2 files changed, 2 insertions(+), 5 deletions(-)



[elpa] 01/01: [aa2u] Update homepage; drop other links.

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a commit to branch master
in repository elpa.

commit a6e098b4d87bc5f98cf5c0ef00b5d847326dcdd8
Author: Thien-Thi Nguyen 
Date:   Thu May 29 12:12:42 2014 +0200

[aa2u] Update homepage; drop other links.

* packages/ascii-art-to-unicode/ascii-art-to-unicode.el [URL]: New header.
[Commentary]: Remove the HACKING and Tip Jar links.
---
 packages/ascii-art-to-unicode/NEWS |1 +
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |6 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/packages/ascii-art-to-unicode/NEWS 
b/packages/ascii-art-to-unicode/NEWS
index 58aa282..bad7296 100644
--- a/packages/ascii-art-to-unicode/NEWS
+++ b/packages/ascii-art-to-unicode/NEWS
@@ -4,6 +4,7 @@ See the end for copying conditions.
 
 - 1.9 | NOT YET RELEASED
   - new command: ‘aa2u-mark-rectangle-as-text’
+  - new homepage: http://www.gnuvola.org/software/aa2u/
 
 - 1.8 | 2014-05-21
   - new command: ‘aa2u-mark-as-text’
diff --git a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el 
b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
index a353c9e..db3f19a 100644
--- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
+++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
@@ -6,6 +6,7 @@
 ;; Maintainer: Thien-Thi Nguyen 
 ;; Version: 1.8
 ;; Keywords: ascii, unicode, box-drawing
+;; URL: http://www.gnuvola.org/software/aa2u/
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -92,11 +93,6 @@
 ;;"
 ;;
 ;; Command `aa2u-mark-rectangle-as-text' is similar, for rectangles.
-;;
-;;
-;; See Also
-;; - HACKING: 

-;; - Tip Jar: 
 
 ;;; Code:
 



[elpa] 01/02: [aa2u] Mention TAB infelicity.

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a commit to branch master
in repository elpa.

commit 282530150dda7bd19c9f504274f34b661b4b7c09
Author: Thien-Thi Nguyen 
Date:   Thu May 29 12:25:37 2014 +0200

[aa2u] Mention TAB infelicity.

* packages/ascii-art-to-unicode/ascii-art-to-unicode.el [Commentary]: 
...here.
---
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el 
b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
index db3f19a..8b3e534 100644
--- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
+++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
@@ -93,6 +93,9 @@
 ;;"
 ;;
 ;; Command `aa2u-mark-rectangle-as-text' is similar, for rectangles.
+;;
+;; Tip: For best results, you should make sure all the tab characaters
+;; are converted to spaces.  See: `untabify', `indent-tabs-mode'.
 
 ;;; Code:
 



[elpa] 02/02: [aa2u] Release: 1.9

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a commit to branch master
in repository elpa.

commit 970f2b017e4e87c51f9db3ea7040ca9ee643affb
Author: Thien-Thi Nguyen 
Date:   Thu May 29 12:27:40 2014 +0200

[aa2u] Release: 1.9

* packages/ascii-art-to-unicode/ascii-art-to-unicode.el [Version]: Bump to 
"1.9".
---
 packages/ascii-art-to-unicode/NEWS |2 +-
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/ascii-art-to-unicode/NEWS 
b/packages/ascii-art-to-unicode/NEWS
index bad7296..a4c3f52 100644
--- a/packages/ascii-art-to-unicode/NEWS
+++ b/packages/ascii-art-to-unicode/NEWS
@@ -2,7 +2,7 @@ NEWS for ascii-art-to-unicode.el
 See the end for copying conditions.
 
 
-- 1.9 | NOT YET RELEASED
+- 1.9 | 2014-05-29
   - new command: ‘aa2u-mark-rectangle-as-text’
   - new homepage: http://www.gnuvola.org/software/aa2u/
 
diff --git a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el 
b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
index 8b3e534..05cf38c 100644
--- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
+++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
@@ -4,7 +4,7 @@
 
 ;; Author: Thien-Thi Nguyen 
 ;; Maintainer: Thien-Thi Nguyen 
-;; Version: 1.8
+;; Version: 1.9
 ;; Keywords: ascii, unicode, box-drawing
 ;; URL: http://www.gnuvola.org/software/aa2u/
 



[elpa] branch master updated (a6e098b -> 970f2b0)

2014-05-29 Thread Thien-Thi Nguyen
ttn pushed a change to branch master
in repository elpa.

  from  a6e098b   [aa2u] Update homepage; drop other links.
   new  2825301   [aa2u] Mention TAB infelicity.
   new  970f2b0   [aa2u] Release: 1.9

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/ascii-art-to-unicode/NEWS |2 +-
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |5 -
 2 files changed, 5 insertions(+), 2 deletions(-)



[elpa] branch master updated (970f2b0 -> d08069b)

2014-05-29 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  970f2b0   [aa2u] Release: 1.9
   new  d08069b   [metar] Make the length unit configurable (clouds) and 
simplify pressure conversion

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/metar/metar.el |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)



[elpa] 01/01: [metar] Make the length unit configurable (clouds) and simplify pressure conversion

2014-05-29 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit d08069bc34c129b5a4be2e8c90271eb2f6bffd50
Author: Mario Lang 
Date:   Thu May 29 14:40:32 2014 +0200

[metar] Make the length unit configurable (clouds) and simplify pressure 
conversion
---
 packages/metar/metar.el |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 5c4410a..60bc129 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -43,7 +43,9 @@
 (require 'solar)
 (require 'url)
 
-(defvar metar-units '((speed . kph) (pressure . bar)))
+(defvar metar-units '((length . m)
+ (pressure . bar)
+ (speed . kph)))
 
 (defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
   "URL to use for retrieving station meta information.")
@@ -247,7 +249,9 @@ If no record was found for STATION, nil is returned."
 (while (string-match metar-could-regexp info from)
   (setq from (match-end 0)
clouds (push (append (list (match-string 1 info)
-  (string-to-number (match-string 2 info)))
+  (metar-convert-unit
+   (concat (match-string 2 info) " ft")
+   (cdr (assq 'length metar-units
 (when (match-string 3 info)
   (list (match-string 3 info
 clouds)))
@@ -369,12 +373,12 @@ If no record was found for STATION, nil is returned."
 
 (defun metar-pressure (info)
   (when (string-match metar-pressure-regexp info)
-(metar-convert-unit (cond
-((string= (match-string 1 info) "Q")
- (concat "(" (match-string 2 info) " / 1000) bar"))
-((string= (match-string 1 info) "A")
- (concat "(" (match-string 2 info) " / 100) inHg")))
-   (cdr (assq 'pressure metar-units)
+(metar-convert-unit
+ (concat (match-string 2 info)
+(cond
+ ((string= (match-string 1 info) "Q") "hPa")
+ ((string= (match-string 1 info) "A") "cinHg")))
+ (cdr (assq 'pressure metar-units)
 
 (defun metar-decode (record)
   "Return a lisp structure describing the weather information in RECORD."



[elpa] branch master updated (d08069b -> 9a44292)

2014-05-29 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  d08069b   [metar] Make the length unit configurable (clouds) and 
simplify pressure conversion
   new  9a44292   [metar] defcustom for metar-units

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/metar/metar.el |   96 +++---
 1 files changed, 65 insertions(+), 31 deletions(-)



[elpa] 01/01: [metar] defcustom for metar-units

2014-05-29 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 9a44292c89fede1a68f2b2ba196474f0190a5851
Author: Mario Lang 
Date:   Fri May 30 00:16:08 2014 +0200

[metar] defcustom for metar-units
---
 packages/metar/metar.el |   96 +++---
 1 files changed, 65 insertions(+), 31 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 60bc129..4909f00 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -43,9 +43,37 @@
 (require 'solar)
 (require 'url)
 
-(defvar metar-units '((length . m)
- (pressure . bar)
- (speed . kph)))
+(defcustom metar-units '((length . m)
+(pressure . hPa)
+(speed . kph)
+(temperature . degC))
+  "Default measurement units to use when reporting weather information."
+  :type '(list (cons :format "%v"
+(const :tag "Length: " length)
+(choice (const :tag "Meter" m)
+(const :tag "Inch" in)
+(const :tag "Foot" ft)
+(const :tag "Yard" yd)
+(const :tag "Mile" mi)))
+  (cons :format "%v"
+(const :tag "Pressure:" pressure)
+(choice (const :tag "Pascal" Pa)
+(const :tag "Hecto pascal" hPa)
+(const :tag "Bar" bar)
+(const :tag "Inch of mercury" inHg)
+(const :tag "Standard atmosphere" atm)
+(const :tag "Meter of mercury" mHg)
+(const :tag "Punds per square inch" psi)))
+  (cons :format "%v"
+(const :tag "Speed:" speed)
+(choice (const :tag "Kilometers per hour" kph)
+(const :tag "Miles per hour" mph)
+(const :tag "Knot" knot)))
+  (cons :format "%v"
+(const :tag "Temperature:" temperature)
+(choice (const :tag "Degree Celsius" degC)
+(const :tag "Degree Kelvin" degK)
+(const :tag "Degree Fahrenheit" degF)
 
 (defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
   "URL to use for retrieving station meta information.")
@@ -193,13 +221,34 @@ If no match if found, nil is returned."
   (when station-code
(cons station-code (round best-distance))
 
-(defun metar-temp-to-number (string)
-  "Convert a METAR temperature to a number."
-  (if (= (aref string 0) ?M)
-  (- (string-to-number (substring string 1)))
-(string-to-number string)))
+(defun metar-convert-unit (value new-unit)
+  "Convert VALUE to NEW-UNIT.
+VALUE is a string with the value followed by the unit, like \"5 knot\"
+and NEW-UNIT should be a unit name like \"kph\" or similar."
+  (cl-check-type value string)
+  (cl-check-type new-unit (or string symbol))
+  (cl-multiple-value-bind (value unit)
+  (split-string
+   (math-format-value
+   (math-convert-units (math-simplify (math-read-expr value))
+   (math-read-expr
+(cl-etypecase new-unit
+  (string new-unit)
+  (symbol (symbol-name new-unit))
+   " ")
+(cons (string-to-number value) (intern unit
 
-(defvar metar-url 
"http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT";
+(defun metar-convert-temperature (string)
+  "Convert a METAR temperature."
+  (metar-convert-unit
+   (concat (if (= (aref string 0) ?M)
+  (concat "-" (substring string 1))
+string)
+  "degC")
+   (cdr (assq 'temperature metar-units
+
+(defvar metar-url
+  "http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT";
   "URL used to fetch station specific information.
 %s is replaced with the 4 letter station code.")
 
@@ -354,18 +403,19 @@ If no record was found for STATION, nil is returned."
 
 (defun metar-temperature (info)
   (when (string-match metar-temperature-and-dewpoint-regexp info)
-(cons (metar-temp-to-number (match-string 1 info)) 'celsius)))
+(metar-convert-temperature (match-string 1 info
 
 (defun metar-dewpoint (info)
   (when (string-match metar-temperature-and-dewpoint-regexp info)
-(cons (metar-temp-to-number (match-string 3 info)) 'celsius)))
+(metar-convert-temperature (match-string 3 info
 
 (defun metar-humidity (info)
   (when (string-match metar-temperature-and-dewpoint-regexp info)
 (cons (round
   (metar-magnus-formula-humidity-from-dewpoint
-   (metar-temp-to-number (match-string 1 info))
-   (metar-temp-to-number (match-string 3 info 'percent)))
+   (save-match-data (car (meta