[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ELPA-diffs] ELPA branch, master, updated. b83c372487dda45c3a515df31c057
From: |
Stefan Monnier |
Subject: |
[ELPA-diffs] ELPA branch, master, updated. b83c372487dda45c3a515df31c05738dd9f8ce6e |
Date: |
Wed, 21 Aug 2013 17:34:00 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ELPA".
The branch, master has been updated
via b83c372487dda45c3a515df31c05738dd9f8ce6e (commit)
via 411619a6870018e1ee31b0b6e19594b60e923385 (commit)
via bbfb1304244b7e7894bb2ebb4355c347323ee9e8 (commit)
via 706bcd239438946a06b790541c53337146835f4e (commit)
via f8679b401979ab73ff6829b62fc72ef94b02207c (commit)
from f56b573a4fe7147827c3fe33139c12271ec65799 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b83c372487dda45c3a515df31c05738dd9f8ce6e
Author: Stefan Monnier <address@hidden>
Date: Wed Aug 21 13:30:52 2013 -0400
* packages/f90-interface-browser/f90-interface-browser.el: Don't require CL
at runtime since it's not needed.
(f90-approx-arglist-match): Remove unused var `match'.
(f90-parse-single-type-declaration): Don't use `add-to-list' on a local var.
* packages/f90-interface-browser/f90-tests.el: Require `cl-lib'.
(test-check, test-combine-results, parse-declaration): Fix up
names accordingly.
diff --git a/externals-list b/externals-list
index ac809e6..f3cce41 100644
--- a/externals-list
+++ b/externals-list
@@ -24,7 +24,7 @@
("dismal" :external nil)
("eldoc-eval" :subtree
"https://github.com/thierryvolpiatto/eldoc-eval.git")
("enwc" :subtree
"bzr::bzr://bzr.savannah.nongnu.org/enwc/trunk")
- ("f90-interface-browser" :subtree "http://github.com/wence-/f90-iface")
+ ("f90-interface-browser" :subtree "https://github.com/wence-/f90-iface")
("ggtags" :subtree "https://github.com/leoliu/ggtags")
("ioccur" :subtree
"https://github.com/thierryvolpiatto/ioccur.git")
("js2-mode" :subtree "https://github.com/mooz/js2-mode.git")
diff --git a/packages/f90-interface-browser/f90-interface-browser.el
b/packages/f90-interface-browser/f90-interface-browser.el
index afa8fa2..8956400 100644
--- a/packages/f90-interface-browser/f90-interface-browser.el
+++ b/packages/f90-interface-browser/f90-interface-browser.el
@@ -1,6 +1,6 @@
;;; f90-interface-browser.el --- Parse and browse f90 interfaces
-;; Copyright (C) 2011, 2012 Free Software Foundation, Inc
+;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc
;; Author: Lawrence Mitchell <address@hidden>
;; Created: 2011-07-06
@@ -103,7 +103,7 @@
;;; Code:
;;; Preamble
-(require 'cl)
+(eval-when-compile (require 'cl))
(require 'thingatpt)
(require 'f90)
(require 'etags)
@@ -593,7 +593,6 @@ first (length ARGLIST) args of SPECIALISER."
(<= n-passed-args n-spec-args)))
(loop for arg in arglist
for spec-arg in spec-arglist
- with match = nil
unless (or (null arg)
(string= (f90-get-parsed-type-typename arg)
(f90-get-parsed-type-typename spec-arg)))
@@ -1029,13 +1028,12 @@ dealt with correctly."
(setcdr (assoc "dimension" dec)
(1+ (f90-count-commas
(match-string 2 name))))
- (add-to-list 'dec
- (cons "dimension"
- (1+ (f90-count-commas
- (match-string 2 name))))
- t))
+ (push (cons "dimension"
+ (1+ (f90-count-commas
+ (match-string 2 name))))
+ dec))
(setq name (match-string 1 name)))
- collect (cons name dec)))))
+ collect (cons name (nreverse dec))))))
(defun f90-split-declaration (dec)
"Split and parse a type declaration DEC.
diff --git a/packages/f90-interface-browser/f90-tests.el
b/packages/f90-interface-browser/f90-tests.el
index d55308b..74c0dee 100644
--- a/packages/f90-interface-browser/f90-tests.el
+++ b/packages/f90-interface-browser/f90-tests.el
@@ -17,6 +17,10 @@
;;; Code:
+(require 'cl-lib)
+
+;; FIXME: Convert to use ERT.
+
(defvar *test-name* nil)
(defvar *test-tests* (make-hash-table :test 'eq))
@@ -35,17 +39,18 @@
(defmacro test-check (&rest forms)
"Run each expression in 'forms' as a test case."
`(test-combine-results
- ,@(loop for (expr res) in forms
- collect `(test-report-result (equal (condition-case err
- ,expr
- (error (gensym))) ',res)
- ',expr ',res))))
+ ,@(cl-loop for (expr res) in forms
+ collect `(test-report-result (equal (condition-case _
+ ,expr
+ (error (cl-gensym)))
+ ',res)
+ ',expr ',res))))
(defmacro test-combine-results (&rest forms)
"Combine the results (as booleans) of evaluating 'forms' in order."
(let ((result (make-symbol "result")))
`(let ((,result t))
- ,@(loop for f in forms collect `(unless ,f (setf ,result nil)))
+ ,@(cl-loop for f in forms collect `(unless ,f (setf ,result nil)))
,result)))
(defun test-report-result (result res req)
@@ -80,10 +85,10 @@
("integer" ("dimension" . 1)))))
(deftest parse-declaration ()
- (flet ((fun (str) (with-temp-buffer
- (insert str)
- (goto-char (point-min))
- (f90-parse-single-type-declaration))))
+ (cl-flet ((fun (str) (with-temp-buffer
+ (insert str)
+ (goto-char (point-min))
+ (f90-parse-single-type-declaration))))
(test-check
((fun "integer :: name") (("name" "integer")))
((fun "integer :: name1, name2") (("name1" "integer")
commit 411619a6870018e1ee31b0b6e19594b60e923385
Merge: f56b573 bbfb130
Author: Stefan Monnier <address@hidden>
Date: Wed Aug 21 13:17:06 2013 -0400
Sync from f90-iface
diff --cc packages/f90-interface-browser/README.org
index 0000000,e620b49..e620b49
mode 000000,100644..100644
--- a/packages/f90-interface-browser/README.org
+++ b/packages/f90-interface-browser/README.org
commit bbfb1304244b7e7894bb2ebb4355c347323ee9e8
Author: Lawrence Mitchell <address@hidden>
Date: Sun Sep 9 20:10:42 2012 +0100
Require cl at runtime
c42b4f3 incorrectly wrapped the (require 'cl) form in
eval-when-compile. But we need defstruct at runtime, so revert that
part of the change.
diff --git a/f90-interface-browser.el b/f90-interface-browser.el
index 1a8626e..458577d 100644
--- a/f90-interface-browser.el
+++ b/f90-interface-browser.el
@@ -102,8 +102,7 @@
;;; Code:
;;; Preamble
-(eval-when-compile
- (require 'cl))
+(require 'cl)
(require 'thingatpt)
(require 'f90)
(require 'etags)
commit 706bcd239438946a06b790541c53337146835f4e
Author: Lawrence Mitchell <address@hidden>
Date: Sun Sep 9 20:04:46 2012 +0100
Move f90-merge-into-tags-completion-table definition before use
diff --git a/f90-interface-browser.el b/f90-interface-browser.el
index c33996c..1a8626e 100644
--- a/f90-interface-browser.el
+++ b/f90-interface-browser.el
@@ -206,18 +206,6 @@ level. For example, a LEVEL of 0 counts top-level commas."
(when fn
(funcall fn (f90-get-type type)))))
-(defun f90-lazy-completion-table ()
- "Lazily produce a completion table of all interfaces and tag names."
- (lexical-let ((buf (current-buffer)))
- (lambda (string pred action)
- (with-current-buffer buf
- (save-excursion
- ;; If we need to ask for the tag table, allow that.
- (let ((enable-recursive-minibuffers t))
- (visit-tags-table-buffer))
- (complete-with-action action (f90-merge-into-tags-completion-table
f90-all-interfaces) string pred))))))
-
-
(defsubst f90-merge-into-tags-completion-table (ctable)
"Merge completions in CTABLE into the tags completion table."
(if (or tags-file-name tags-table-list)
@@ -229,6 +217,17 @@ level. For example, a LEVEL of 0 counts top-level commas."
table)
ctable))
+(defun f90-lazy-completion-table ()
+ "Lazily produce a completion table of all interfaces and tag names."
+ (lexical-let ((buf (current-buffer)))
+ (lambda (string pred action)
+ (with-current-buffer buf
+ (save-excursion
+ ;; If we need to ask for the tag table, allow that.
+ (let ((enable-recursive-minibuffers t))
+ (visit-tags-table-buffer))
+ (complete-with-action action (f90-merge-into-tags-completion-table
f90-all-interfaces) string pred))))))
+
(defsubst f90-extract-type-name (name)
"Return the typename from NAME.
commit f8679b401979ab73ff6829b62fc72ef94b02207c
Author: Lawrence Mitchell <address@hidden>
Date: Sun Sep 9 18:46:40 2012 +0100
Add README
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..e620b49
--- /dev/null
+++ b/README.org
@@ -0,0 +1,82 @@
+* Fortran editing helpers for Emacs
+
+** Overview
+
+You write (or work on) large, modern fortran code bases. These make
+heavy use of function overloading and generic interfaces. Your brain
+is too small to remember what all the specialisers are called.
+Therefore, your editor should help you. This is an attempt to do
+this for Emacs.
+
+f90-interface-browser.el is a (simple-minded) parser of fortran that
+understands a little about generic interfaces and derived types.
+
+** External functions
+
+- =f90-parse-interfaces-in-dir= :: Parse all the fortran files in a
+ directory
+- =f90-parse-all-interfaces= :: Parse all the fortran files in a
+ directory and recursively in its subdirectories
+- =f90-browse-interface-specialisers= :: Pop up a buffer showing all
+ the specialisers for a particular generic interface (prompted
+ for with completion)
+- =f90-find-tag-interface= :: On a procedure call, show a list of the
+ interfaces that match the (possibly typed) argument list. If no
+ interface is found, this falls back to =find-tag=.
+- =f90-list-in-scope-vars= :: List all variables in local scope. This
+ just goes to the top of the current procedure and collects named
+ variables, so it doesn't work with module or global scope
+ variables or local procedures.
+- =f90-show-type-definition= :: Pop up a buffer showing a derived type
+ definition.
+
+** Customisable variables
+
+- =f90-file-extensions= :: A list of extensions that the parser will
+ use to decide if a file is a fortran file.
+
+** Details and caveats
+
+The parser assumes you write fortran in the style espoused in Metcalf,
+Reid and Cohen. Particularly, variable declarations use a double
+colon to separate the type from the name list.
+
+Here's an example of a derived type definition:
+#+BEGIN_SRC f90
+type foo
+ real, allocatable, dimension(:) :: a
+ integer, pointer :: b, c(:)
+ type(bar) :: d
+end type foo
+#+END_SRC
+
+Here's a subroutine declaration:
+#+BEGIN_SRC f90
+subroutine foo(a, b)
+ integer, intent(in) :: a
+ real, intent(inout), dimension(:,:) :: b
+ ...
+end subroutine foo
+#+END_SRC
+
+Local procedures whose names conflict with global ones will likely
+confuse the parser. For example:
+#+BEGIN_SRC f90
+subroutine foo(a, b)
+ ...
+end subroutine foo
+
+subroutine bar(a, b)
+ ...
+ call subroutine foo
+ ...
+ contains
+ subroutine foo
+ ...
+ end subroutine foo
+end subroutine bar
+#+END_SRC
+
+Also not handled are overloaded operators, scalar precision modifiers,
+like =integer(kind=c_int)=, for which the precision is just ignored, and
+many other of the hairier aspects of the fortran language.
-----------------------------------------------------------------------
Summary of changes:
externals-list | 2 +-
packages/f90-interface-browser/README.org | 82 ++++++++++++++++++++
.../f90-interface-browser/f90-interface-browser.el | 40 ++++-----
packages/f90-interface-browser/f90-tests.el | 25 ++++---
4 files changed, 116 insertions(+), 33 deletions(-)
create mode 100644 packages/f90-interface-browser/README.org
hooks/post-receive
--
ELPA
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ELPA-diffs] ELPA branch, master, updated. b83c372487dda45c3a515df31c05738dd9f8ce6e,
Stefan Monnier <=