[elpa] branch master updated (590892e -> 1585aa0)

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

  from  590892e   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  1585aa0   [metar] Unify station lat/lon 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 |   35 ---
 1 files changed, 8 insertions(+), 27 deletions(-)



[elpa] 01/01: [metar] Unify station lat/lon conversion.

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

commit 1585aa024853b06815ea2da4a03cc7e7fe4dd2a7
Author: Mario Lang 
Date:   Mon Jun 2 22:26:34 2014 +0200

[metar] Unify station lat/lon conversion.
---
 packages/metar/metar.el |   35 ---
 1 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 182e805..82b83b7 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -92,39 +92,20 @@
   "Variable containing (cached) METAR station information.
 Use the function `metar-stations' to get the actual station list.")
 
-(defun metar-station-convert-latitude (string)
+(defun metar-station-convert-dms-to-deg (string)
+  "Convert degrees, minutes and optional seconds, to degrees."
   (when (string-match (rx string-start
- (group (1+ digit))
- ?-
- (group (1+ digit))
+ (group (1+ digit)) ?- (group (1+ digit))
  (optional ?- (group (1+ digit)))
- (group (char ?N ?S))
+ (group (char ?N ?E ?S ?W))
  string-end) string)
-(funcall (if (string= (match-string 4 string) "N") #'+ #'-)
+(funcall (if (memq (aref (match-string 4 string) 0) '(?N ?E)) #'+ #'-)
 (+ (string-to-number (match-string 1 string))
-   (/ (string-to-number (match-string 2 string))
-  60.0)
+   (/ (string-to-number (match-string 2 string)) 60.0)
(if (match-string 3 string)
(/ (string-to-number (match-string 3 string)) 3600.0)
  0)
 
-(defun metar-station-convert-longitude (string)
-  (when (string-match (rx string-start
- (group (1+ digit))
- ?-
- (group (1+ digit))
- (optional ?- (group (1+ digit)))
- (group (char ?E ?W))
- string-end) string)
-(funcall (if (string= (match-string 4 string) "E") #'+ #'-)
-(+ (string-to-number (match-string 1 string))
-   (/ (string-to-number (match-string 2 string))
-  60.0)
-   (if (match-string 3 string)
-   (/ (string-to-number (match-string 3 string))
-  3600.0)
- 0)
-
 (defun metar-stations ()
   "Retrieve a list of METAR stations.
 Results are cached in variable `metar-stations'.
@@ -147,9 +128,9 @@ If this variable is nil, the information is retrieved from 
the Internet."
(cons 'name (nth 3 item))
(cons 'country (nth 5 item))
(cons 'latitude
- (metar-station-convert-latitude (nth 7 item)))
+ (metar-station-convert-dms-to-deg (nth 7 
item)))
(cons 'longitude
- (metar-station-convert-longitude (nth 8 
item)))
+ (metar-station-convert-dms-to-deg (nth 8 
item)))
(cons 'altitude (string-to-number (nth 12 item))
   metar-stations)))
  (setq data (cdr data)))



[elpa] branch master updated (1585aa0 -> 9c22e41)

2014-06-02 Thread Stefan Monnier
monnier pushed a change to branch master
in repository elpa.

  from  1585aa0   [metar] Unify station lat/lon conversion.
   new  9c22e41   * sml-mode/sml-mode.el (sml-smie-grammar): Add 
include&sharing. (sml-smie-rules): Add functor rule. 
(sml-smie-definitional-equal-p): Use smie-backward-sexp.

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/sml-mode/sml-mode.el   |   38 +-
 packages/sml-mode/testcases.sml |   31 ++-
 2 files changed, 39 insertions(+), 30 deletions(-)



[elpa] 01/01: * sml-mode/sml-mode.el (sml-smie-grammar): Add include&sharing. (sml-smie-rules): Add functor rule. (sml-smie-definitional-equal-p): Use smie-backward-sexp.

2014-06-02 Thread Stefan Monnier
monnier pushed a commit to branch master
in repository elpa.

commit 9c22e416342c985bbb502848aa85bb5260cdc0df
Author: Stefan Monnier 
Date:   Tue Jun 3 00:08:53 2014 -0400

* sml-mode/sml-mode.el (sml-smie-grammar): Add include&sharing.
(sml-smie-rules): Add functor rule.
(sml-smie-definitional-equal-p): Use smie-backward-sexp.
---
 packages/sml-mode/sml-mode.el   |   38 +-
 packages/sml-mode/testcases.sml |   31 ++-
 2 files changed, 39 insertions(+), 30 deletions(-)

diff --git a/packages/sml-mode/sml-mode.el b/packages/sml-mode/sml-mode.el
index 1c06f16..e9c2477 100644
--- a/packages/sml-mode/sml-mode.el
+++ b/packages/sml-mode/sml-mode.el
@@ -1,6 +1,6 @@
 ;;; sml-mode.el --- Major mode for editing (Standard) ML  -*- lexical-binding: 
t; coding: utf-8 -*-
 
-;; Copyright (C) 1989,1999,2000,2004,2007,2010-2013  Free Software Foundation, 
Inc.
+;; Copyright (C) 1989,1999,2000,2004,2007,2010-2014  Free Software Foundation, 
Inc.
 
 ;; Maintainer: (Stefan Monnier) 
 ;; Version: 6.4
@@ -446,6 +446,8 @@ Regexp match data 0 points to the chars."
   (decls "nonfix" decls)
   (decls "abstype" decls)
   (decls "datatype" decls)
+  (decls "include" decls)
+  (decls "sharing" decls)
   (decls "exception" decls)
   (decls "fun" decls)
   (decls "val" decls))
@@ -466,7 +468,7 @@ Regexp match data 0 points to the chars."
  '((assoc "->") (assoc "*"))
  '((assoc "val" "fun" "type" "datatype" "abstype" "open" "infix" "infixr"
   "nonfix" "functor" "signature" "structure" "exception"
-  ;; "local"
+  "include" "sharing" "local"
   )
(assoc "and"))
  '((assoc "orelse") (assoc "andalso") (nonassoc ":"))
@@ -515,7 +517,7 @@ Regexp match data 0 points to the chars."
   ((member token '("|" "d|" ";" ",")) (smie-rule-separator kind))
   ;; Treat purely syntactic block-constructs as being part of their parent,
   ;; when the opening statement is hanging.
-  ((member token '("let" "(" "[" "{"))
+  ((member token '("let" "(" "[" "{")) ; "struct"? "sig"?
(if (smie-rule-hanging-p) (smie-rule-parent)))
   ;; Treat if ... else if ... as a single long syntactic construct.
   ;; Similarly, treat fn a => fn b => ... as a single construct.
@@ -531,7 +533,7 @@ Regexp match data 0 points to the chars."
   ((equal token "d=")
(cond
 ((smie-rule-parent-p "datatype") (if (smie-rule-bolp) 2))
-((smie-rule-parent-p "structure" "signature") 0)))
+((smie-rule-parent-p "structure" "signature" "functor") 0)))
   ;; Indent an expression starting with "local" as if it were starting
   ;; with "fun".
   ((equal token "local") (smie-indent-keyword "fun"))
@@ -563,31 +565,9 @@ Assumes point is right before the = sign."
   ;; One known problem case is code like:
   ;; "functor foo (structure s : S) where type t = s.t ="
   ;; where the "type t = s.t" is mistaken for a type definition.
-  (let ((re (concat "\\(" sml-=-starter-re "\\)\\|=")))
-(save-excursion
-  (and (re-search-backward re nil t)
-   (or (match-beginning 1)
-   ;; If we first hit a "=", then that = is probably definitional
-   ;; and  we're an equality, but not necessarily.  One known
-   ;; problem case is code like:
-   ;; "functor foo (structure s : S) where type t = s.t ="
-   ;; where the first = is more like an equality (tho it doesn't
-   ;; matter much) and the second is definitional.
-   ;;
-   ;; FIXME: The test below could be used to recognize that the
-   ;; second = is not a mere equality, but that's not enough to
-   ;; parse the construct properly: we'd need something
-   ;; like a third kind of = token for structure definitions, in
-   ;; order for the parser to be able to skip the "type t = s.t"
-   ;; as a sub-expression.
-   ;;
-   ;; (and (not (looking-at "=>"))
-   ;;  (not (eq ?< (char-before))) ;Not a <=
-   ;;  (re-search-backward re nil t)
-   ;;  (match-beginning 1)
-   ;;  (equal "type" (buffer-substring (- (match-end 1) 4)
-   ;;  (match-end 1
-   )
+  (save-excursion
+(let ((res (smie-backward-sexp "=")))
+  (member (nth 2 res) `(":" ,@sml-=-starter-syms)
 
 (defun sml-smie-non-nested-of-p ()
   ;; FIXME: Maybe datatype-|-p makes this nested-of business unnecessary.
diff --git a/packages/sml-mode/testcases.sml b/packages/sml-mode/testcases.sml
index adab3e2..0e98ed6 100644
--- a/packages/sml-mode/testcases.sml
+++ b/packages/sml-mode/testcases.sml
@@ -1,4 +1,4 @@
-(* Copyright 1999,2004,2007,2010-2012 Stefan M