home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / packages / dmacro-2.0 / dm-compat.el < prev    next >
Encoding:
Text File  |  1991-11-15  |  2.4 KB  |  90 lines

  1. ;;; Copyright (c) 1991 Wayne Mesard.  May be redistributed only under the
  2. ;;; terms of the GNU Emacs General Public License.
  3.  
  4. ;;;
  5. ;;; DM-COMPAT  :  Dynamic Macro COMPATibility
  6. ;;;
  7.  
  8. ;;; HISTORY
  9. ;;    2.0 wmesard - Oct 18, 1991: Freeze.
  10.  
  11. ;; You are urged to convert your old templates to the new dmacro format.  But
  12. ;; for you lazy folk out there this file defines some aliases to make Template
  13. ;; v1.5 files more compatible with Dmacro v2.0.  It doesn't produce complete 
  14. ;; compatibility.  Specifically:
  15. ;;
  16. ;;  o You should change the ~s# directives by hand to the new ~(prompt)
  17. ;;    syntax and get rid of those ridiculous lambda expressions.
  18. ;;    The old syntax will sort of work, except your prompt will be replaced
  19. ;;    by a default one.
  20. ;;  o The ~pC directive is no longer supported.  You must now use
  21. ;;    the pad modifier.
  22. ;;  o ~>> and ~>@ are not supported.  You must use the new ~(dmacro) function.
  23. ;;  o Not every single v1.5 directive is supported.  For example, ~u# is
  24. ;;    supported only if # is less than 4.  ~fd is supported, but ~Fd is not.
  25. ;;    If I left out your favorite, you should be able to add it by using
  26. ;;    the others as a model.
  27. ;;
  28. ;; Note that ~@ and ~~ will work without modification.
  29.  
  30. (def-dmacro-alias
  31.   dy ((chron) 22)
  32.   dY year
  33.   dm ((mon) :down)
  34.   Dm ((mon) :down :cap)
  35.   DM ((mon) :down :up)
  36.   dn ((month-num) :pad nil)
  37.   dN ((month-num) :pad ?0)
  38.   dd ((chron) 8 10 :pad nil)
  39.   dd ((chron) 8 10 :pad ?0)
  40.   dw ((day) :down)
  41.   Dw ((day) :cap)
  42.   DW ((day) :up)
  43.   ta ampm
  44.   Ta ((ampm) :cap)
  45.   TA ((ampm) :up)
  46.   th ((hour) :pad nil)
  47.   tH ((hour) :pad ?0)
  48.   te ((hour24) :pad nil)
  49.   tE ((hour24) :pad ?0)
  50.   tm min
  51.   ts sec
  52.   ui user-id
  53.   Ui ((user-id) :cap)
  54.   UI ((user-id) :up)
  55.   u1 ((user-id) 0 1)
  56.   u2 ((user-id) 0 2)
  57.   u3 ((user-id) 0 3)
  58.   U1 ((user-id) :up 0 1)
  59.   U2 ((user-id) :up 0 2)
  60.   U3 ((user-id) :up 0 3)
  61.   un ((user-name) :down)
  62.   Un ((user-name) :cap)
  63.   fn file
  64.   FN ((file) :up)
  65.   fd (file-dir)
  66.   fp file-name
  67.   FP ((file-name) :up)
  68.   fe file-ext
  69.   FE ((file-ext) :up)
  70.   s0 prompt
  71.   S0 ((prompt) :up)
  72.   s1 (prompt string-two)
  73.   S1 ((prompt string-two) :up)
  74.   s2 (prompt string-three)
  75.   S2 ((prompt string-three) :up)
  76.   s3 (prompt string-four)
  77.   S3 ((prompt string-four) :up)
  78.   )
  79.  
  80. (defun template-prompt (&rest ignore)
  81.   (dmacro-expand))
  82.  
  83. (defun template-prompt-indent (&rest ignore)
  84.   (dmacro-indent))
  85.  
  86. (fset 'template-indent 'dmacro-indent)
  87. (fset 'template-expand 'dmacro-expand)
  88. (fset 'add-templates   'add-dmacros)
  89.  
  90.