Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/sml-mode/sml-util.el
ViewVC logotype

Diff of /sml/trunk/sml-mode/sml-util.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 535, Fri Feb 18 16:49:10 2000 UTC revision 541, Fri Feb 18 20:35:43 2000 UTC
# Line 1  Line 1 
1  ;;; sml-util.el  ;;; sml-util.el --- Utility functions for sml-mode
2    
3  (defconst rcsid-sml-util "@(#)$Name$:$Id$")  ;; Copyright (C) 1999-2000  Stefan Monnier <monnier@cs.yale.edu>
   
 ;; Copyright (C) 1999-1999  Stefan Monnier <monnier@cs.yale.edu>  
4  ;;  ;;
5  ;; This program is free software; you can redistribute it and/or modify  ;; This program is free software; you can redistribute it and/or modify
6  ;; it under the terms of the GNU General Public License as published by  ;; it under the terms of the GNU General Public License as published by
# Line 18  Line 16 
16  ;; along with this program; if not, write to the Free Software  ;; along with this program; if not, write to the Free Software
17  ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18    
19  (require 'cl)  
20    ;;; Commentary:
21    
22    ;;; Code:
23    
24    (require 'cl)                           ;for `reduce'
25  (require 'sml-compat)  (require 'sml-compat)
26    
27  ;;  ;;
28    
 (defmacro concatq (&rest ss)  
   "Concatenate all the arguments and make the result a string.  
 As opposed to `concat', `concatq' does not evaluate its arguments  
 and is hence executed at macro-expansion-time."  
   (apply 'concat ss))  
   
29  (defun flatten (ls &optional acc)  (defun flatten (ls &optional acc)
30    (if (null ls) acc    (if (null ls) acc
31      (let ((rest (flatten (cdr ls) acc))      (let ((rest (flatten (cdr ls) acc))
# Line 38  Line 35 
35          (cons head rest)))))          (cons head rest)))))
36    
37  (defun sml-preproc-alist (al)  (defun sml-preproc-alist (al)
38    "Expand an alist where keys can be lists of keys into a normal one."    "Expand an alist AL where keys can be lists of keys into a normal one."
39    (reduce (lambda (x al)    (reduce (lambda (x al)
40              (let ((k (car x))              (let ((k (car x))
41                    (v (cdr x)))                    (v (cdr x)))
# Line 115  Line 112 
112                    (modify-syntax-entry ?\* ". 23n" st) st)                    (modify-syntax-entry ?\* ". 23n" st) st)
113                  (let ((st (make-syntax-table)))                  (let ((st (make-syntax-table)))
114                    (modify-syntax-entry ?\* ". 23" st) st))))                    (modify-syntax-entry ?\* ". 23" st) st))))
115    "Whether this Emacs understands the `n' in syntax entries.")    "Non-nil means this Emacs understands the `n' in syntax entries.")
116    
 ;;  
117  (provide 'sml-util)  (provide 'sml-util)
118    
119    ;;; sml-util.el ends here

Legend:
Removed from v.535  
changed lines
  Added in v.541

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0