~ubuntu-branches/ubuntu/karmic/emacs-snapshot/karmic

« back to all changes in this revision

Viewing changes to lisp/progmodes/vhdl-mode.el

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-04-05 09:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090405091430-nw07lynn2arotjbe
Tags: upstream-20090320
ImportĀ upstreamĀ versionĀ 20090320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; vhdl-mode.el --- major mode for editing VHDL code
2
2
 
3
3
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
4
 
;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 
4
;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5
5
;;   Free Software Foundation, Inc.
6
6
 
7
7
;; Authors:     Reto Zimmermann <reto@gnu.org>
933
933
The following keywords for template generation are supported:
934
934
  <filename>    : replaced by the name of the buffer
935
935
  <author>      : replaced by the user name and email address
936
 
                  \(`user-full-name',`mail-host-address', `user-mail-address')
 
936
                  \(`user-full-name', `mail-host-address', `user-mail-address')
937
937
  <login>       : replaced by user login name (`user-login-name')
938
938
  <company>     : replaced by contents of option `vhdl-company-name'
939
939
  <date>        : replaced by the current date
2328
2328
  "Enable case insensitive search and switch to syntax table that includes '_',
2329
2329
then execute BODY, and finally restore the old environment.  Used for
2330
2330
consistent searching."
2331
 
  `(let ((case-fold-search t)           ; case insensitive search
2332
 
         (current-syntax-table (syntax-table))
2333
 
         result
2334
 
         (restore-prog                  ; program to restore enviroment
2335
 
          '(progn
2336
 
             ;; restore syntax table
2337
 
             (set-syntax-table current-syntax-table))))
 
2331
  `(let ((case-fold-search t))          ; case insensitive search
2338
2332
     ;; use extended syntax table
2339
 
     (set-syntax-table vhdl-mode-ext-syntax-table)
2340
 
     ;; execute BODY safely
2341
 
     (setq result
2342
 
           (condition-case info
2343
 
               (progn ,@body)
2344
 
             (error (eval restore-prog) ; restore environment on error
2345
 
                    (error (cadr info))))) ; pass error up
2346
 
     ;; restore environment
2347
 
     (eval restore-prog)
2348
 
     result))
 
2333
     (with-syntax-table vhdl-mode-ext-syntax-table
 
2334
       ,@body)))
2349
2335
 
2350
2336
(defmacro vhdl-prepare-search-2 (&rest body)
2351
2337
  "Enable case insensitive search, switch to syntax table that includes '_',
2352
2338
and remove `intangible' overlays, then execute BODY, and finally restore the
2353
2339
old environment.  Used for consistent searching."
 
2340
  ;; FIXME: Why not just let-bind `inhibit-point-motion-hooks'?  --Stef
2354
2341
  `(let ((case-fold-search t)           ; case insensitive search
2355
2342
         (current-syntax-table (syntax-table))
2356
 
         result overlay-all-list overlay-intangible-list overlay
2357
 
         (restore-prog                  ; program to restore enviroment
2358
 
          '(progn
2359
 
             ;; restore syntax table
2360
 
             (set-syntax-table current-syntax-table)
2361
 
             ;; restore `intangible' overlays
2362
 
             (when (fboundp 'overlay-lists)
2363
 
               (while overlay-intangible-list
2364
 
                 (overlay-put (car overlay-intangible-list) 'intangible t)
2365
 
                 (setq overlay-intangible-list
2366
 
                       (cdr overlay-intangible-list)))))))
 
2343
         overlay-all-list overlay-intangible-list overlay)
2367
2344
     ;; use extended syntax table
2368
2345
     (set-syntax-table vhdl-mode-ext-syntax-table)
2369
2346
     ;; remove `intangible' overlays
2379
2356
           (overlay-put overlay 'intangible nil))
2380
2357
         (setq overlay-all-list (cdr overlay-all-list))))
2381
2358
     ;; execute BODY safely
2382
 
     (setq result
2383
 
           (condition-case info
2384
 
               (progn ,@body)
2385
 
             (error (eval restore-prog) ; restore environment on error
2386
 
                    (error (cadr info))))) ; pass error up
2387
 
     ;; restore environment
2388
 
     (eval restore-prog)
2389
 
     result))
 
2359
     (unwind-protect
 
2360
         (progn ,@body)
 
2361
       ;; restore syntax table
 
2362
       (set-syntax-table current-syntax-table)
 
2363
       ;; restore `intangible' overlays
 
2364
       (when (fboundp 'overlay-lists)
 
2365
         (while overlay-intangible-list
 
2366
           (overlay-put (car overlay-intangible-list) 'intangible t)
 
2367
           (setq overlay-intangible-list
 
2368
                 (cdr overlay-intangible-list)))))))
2390
2369
 
2391
2370
(defmacro vhdl-visit-file (file-name issue-error &rest body)
2392
2371
  "Visit file FILE-NAME and execute BODY."
2898
2877
    (append
2899
2878
     (when (memq 'vhdl vhdl-electric-keywords)
2900
2879
       ;; VHDL'93 keywords
2901
 
       '(
2902
 
         ("--"            "" vhdl-template-display-comment-hook 0)
2903
 
         ("abs"           "" vhdl-template-default-hook 0)
2904
 
         ("access"        "" vhdl-template-default-hook 0)
2905
 
         ("after"         "" vhdl-template-default-hook 0)
2906
 
         ("alias"         "" vhdl-template-alias-hook 0)
2907
 
         ("all"           "" vhdl-template-default-hook 0)
2908
 
         ("and"           "" vhdl-template-default-hook 0)
2909
 
         ("arch"          "" vhdl-template-architecture-hook 0)
2910
 
         ("architecture"  "" vhdl-template-architecture-hook 0)
2911
 
         ("array"         "" vhdl-template-default-hook 0)
2912
 
         ("assert"        "" vhdl-template-assert-hook 0)
2913
 
         ("attr"          "" vhdl-template-attribute-hook 0)
2914
 
         ("attribute"     "" vhdl-template-attribute-hook 0)
2915
 
         ("begin"         "" vhdl-template-default-indent-hook 0)
2916
 
         ("block"         "" vhdl-template-block-hook 0)
2917
 
         ("body"          "" vhdl-template-default-hook 0)
2918
 
         ("buffer"        "" vhdl-template-default-hook 0)
2919
 
         ("bus"           "" vhdl-template-default-hook 0)
2920
 
         ("case"          "" vhdl-template-case-hook 0)
2921
 
         ("comp"          "" vhdl-template-component-hook 0)
2922
 
         ("component"     "" vhdl-template-component-hook 0)
2923
 
         ("cond"          "" vhdl-template-conditional-signal-asst-hook 0)
2924
 
         ("conditional"   "" vhdl-template-conditional-signal-asst-hook 0)
2925
 
         ("conf"          "" vhdl-template-configuration-hook 0)
2926
 
         ("configuration" "" vhdl-template-configuration-hook 0)
2927
 
         ("cons"          "" vhdl-template-constant-hook 0)
2928
 
         ("constant"      "" vhdl-template-constant-hook 0)
2929
 
         ("disconnect"    "" vhdl-template-disconnect-hook 0)
2930
 
         ("downto"        "" vhdl-template-default-hook 0)
2931
 
         ("else"          "" vhdl-template-else-hook 0)
2932
 
         ("elseif"        "" vhdl-template-elsif-hook 0)
2933
 
         ("elsif"         "" vhdl-template-elsif-hook 0)
2934
 
         ("end"           "" vhdl-template-default-indent-hook 0)
2935
 
         ("entity"        "" vhdl-template-entity-hook 0)
2936
 
         ("exit"          "" vhdl-template-exit-hook 0)
2937
 
         ("file"          "" vhdl-template-file-hook 0)
2938
 
         ("for"           "" vhdl-template-for-hook 0)
2939
 
         ("func"          "" vhdl-template-function-hook 0)
2940
 
         ("function"      "" vhdl-template-function-hook 0)
2941
 
         ("generic"       "" vhdl-template-generic-hook 0)
2942
 
         ("group"         "" vhdl-template-group-hook 0)
2943
 
         ("guarded"       "" vhdl-template-default-hook 0)
2944
 
         ("if"            "" vhdl-template-if-hook 0)
2945
 
         ("impure"        "" vhdl-template-default-hook 0)
2946
 
         ("in"            "" vhdl-template-default-hook 0)
2947
 
         ("inertial"      "" vhdl-template-default-hook 0)
2948
 
         ("inout"         "" vhdl-template-default-hook 0)
2949
 
         ("inst"          "" vhdl-template-instance-hook 0)
2950
 
         ("instance"      "" vhdl-template-instance-hook 0)
2951
 
         ("is"            "" vhdl-template-default-hook 0)
2952
 
         ("label"         "" vhdl-template-default-hook 0)
2953
 
         ("library"       "" vhdl-template-library-hook 0)
2954
 
         ("linkage"       "" vhdl-template-default-hook 0)
2955
 
         ("literal"       "" vhdl-template-default-hook 0)
2956
 
         ("loop"          "" vhdl-template-bare-loop-hook 0)
2957
 
         ("map"           "" vhdl-template-map-hook 0)
2958
 
         ("mod"           "" vhdl-template-default-hook 0)
2959
 
         ("nand"          "" vhdl-template-default-hook 0)
2960
 
         ("new"           "" vhdl-template-default-hook 0)
2961
 
         ("next"          "" vhdl-template-next-hook 0)
2962
 
         ("nor"           "" vhdl-template-default-hook 0)
2963
 
         ("not"           "" vhdl-template-default-hook 0)
2964
 
         ("null"          "" vhdl-template-default-hook 0)
2965
 
         ("of"            "" vhdl-template-default-hook 0)
2966
 
         ("on"            "" vhdl-template-default-hook 0)
2967
 
         ("open"          "" vhdl-template-default-hook 0)
2968
 
         ("or"            "" vhdl-template-default-hook 0)
2969
 
         ("others"        "" vhdl-template-others-hook 0)
2970
 
         ("out"           "" vhdl-template-default-hook 0)
2971
 
         ("pack"          "" vhdl-template-package-hook 0)
2972
 
         ("package"       "" vhdl-template-package-hook 0)
2973
 
         ("port"          "" vhdl-template-port-hook 0)
2974
 
         ("postponed"     "" vhdl-template-default-hook 0)
2975
 
         ("procedure"     "" vhdl-template-procedure-hook 0)
2976
 
         ("process"       "" vhdl-template-process-hook 0)
2977
 
         ("pure"          "" vhdl-template-default-hook 0)
2978
 
         ("range"         "" vhdl-template-default-hook 0)
2979
 
         ("record"        "" vhdl-template-default-hook 0)
2980
 
         ("register"      "" vhdl-template-default-hook 0)
2981
 
         ("reject"        "" vhdl-template-default-hook 0)
2982
 
         ("rem"           "" vhdl-template-default-hook 0)
2983
 
         ("report"        "" vhdl-template-report-hook 0)
2984
 
         ("return"        "" vhdl-template-return-hook 0)
2985
 
         ("rol"           "" vhdl-template-default-hook 0)
2986
 
         ("ror"           "" vhdl-template-default-hook 0)
2987
 
         ("select"        "" vhdl-template-selected-signal-asst-hook 0)
2988
 
         ("severity"      "" vhdl-template-default-hook 0)
2989
 
         ("shared"        "" vhdl-template-default-hook 0)
2990
 
         ("sig"           "" vhdl-template-signal-hook 0)
2991
 
         ("signal"        "" vhdl-template-signal-hook 0)
2992
 
         ("sla"           "" vhdl-template-default-hook 0)
2993
 
         ("sll"           "" vhdl-template-default-hook 0)
2994
 
         ("sra"           "" vhdl-template-default-hook 0)
2995
 
         ("srl"           "" vhdl-template-default-hook 0)
2996
 
         ("subtype"       "" vhdl-template-subtype-hook 0)
2997
 
         ("then"          "" vhdl-template-default-hook 0)
2998
 
         ("to"            "" vhdl-template-default-hook 0)
2999
 
         ("transport"     "" vhdl-template-default-hook 0)
3000
 
         ("type"          "" vhdl-template-type-hook 0)
3001
 
         ("unaffected"    "" vhdl-template-default-hook 0)
3002
 
         ("units"         "" vhdl-template-default-hook 0)
3003
 
         ("until"         "" vhdl-template-default-hook 0)
3004
 
         ("use"           "" vhdl-template-use-hook 0)
3005
 
         ("var"           "" vhdl-template-variable-hook 0)
3006
 
         ("variable"      "" vhdl-template-variable-hook 0)
3007
 
         ("wait"          "" vhdl-template-wait-hook 0)
3008
 
         ("when"          "" vhdl-template-when-hook 0)
3009
 
         ("while"         "" vhdl-template-while-loop-hook 0)
3010
 
         ("with"          "" vhdl-template-with-hook 0)
3011
 
         ("xnor"          "" vhdl-template-default-hook 0)
3012
 
         ("xor"           "" vhdl-template-default-hook 0)
3013
 
         ))
 
2880
       (mapcar (lambda (x) (list (car x) "" (cdr x) 0 'system))
 
2881
               '(
 
2882
                 ("--"            . vhdl-template-display-comment-hook)
 
2883
                 ("abs"           . vhdl-template-default-hook)
 
2884
                 ("access"        . vhdl-template-default-hook)
 
2885
                 ("after"         . vhdl-template-default-hook)
 
2886
                 ("alias"         . vhdl-template-alias-hook)
 
2887
                 ("all"           . vhdl-template-default-hook)
 
2888
                 ("and"           . vhdl-template-default-hook)
 
2889
                 ("arch"          . vhdl-template-architecture-hook)
 
2890
                 ("architecture"  . vhdl-template-architecture-hook)
 
2891
                 ("array"         . vhdl-template-default-hook)
 
2892
                 ("assert"        . vhdl-template-assert-hook)
 
2893
                 ("attr"          . vhdl-template-attribute-hook)
 
2894
                 ("attribute"     . vhdl-template-attribute-hook)
 
2895
                 ("begin"         . vhdl-template-default-indent-hook)
 
2896
                 ("block"         . vhdl-template-block-hook)
 
2897
                 ("body"          . vhdl-template-default-hook)
 
2898
                 ("buffer"        . vhdl-template-default-hook)
 
2899
                 ("bus"           . vhdl-template-default-hook)
 
2900
                 ("case"          . vhdl-template-case-hook)
 
2901
                 ("comp"          . vhdl-template-component-hook)
 
2902
                 ("component"     . vhdl-template-component-hook)
 
2903
                 ("cond"          . vhdl-template-conditional-signal-asst-hook)
 
2904
                 ("conditional"   . vhdl-template-conditional-signal-asst-hook)
 
2905
                 ("conf"          . vhdl-template-configuration-hook)
 
2906
                 ("configuration" . vhdl-template-configuration-hook)
 
2907
                 ("cons"          . vhdl-template-constant-hook)
 
2908
                 ("constant"      . vhdl-template-constant-hook)
 
2909
                 ("disconnect"    . vhdl-template-disconnect-hook)
 
2910
                 ("downto"        . vhdl-template-default-hook)
 
2911
                 ("else"          . vhdl-template-else-hook)
 
2912
                 ("elseif"        . vhdl-template-elsif-hook)
 
2913
                 ("elsif"         . vhdl-template-elsif-hook)
 
2914
                 ("end"           . vhdl-template-default-indent-hook)
 
2915
                 ("entity"        . vhdl-template-entity-hook)
 
2916
                 ("exit"          . vhdl-template-exit-hook)
 
2917
                 ("file"          . vhdl-template-file-hook)
 
2918
                 ("for"           . vhdl-template-for-hook)
 
2919
                 ("func"          . vhdl-template-function-hook)
 
2920
                 ("function"      . vhdl-template-function-hook)
 
2921
                 ("generic"       . vhdl-template-generic-hook)
 
2922
                 ("group"         . vhdl-template-group-hook)
 
2923
                 ("guarded"       . vhdl-template-default-hook)
 
2924
                 ("if"            . vhdl-template-if-hook)
 
2925
                 ("impure"        . vhdl-template-default-hook)
 
2926
                 ("in"            . vhdl-template-default-hook)
 
2927
                 ("inertial"      . vhdl-template-default-hook)
 
2928
                 ("inout"         . vhdl-template-default-hook)
 
2929
                 ("inst"          . vhdl-template-instance-hook)
 
2930
                 ("instance"      . vhdl-template-instance-hook)
 
2931
                 ("is"            . vhdl-template-default-hook)
 
2932
                 ("label"         . vhdl-template-default-hook)
 
2933
                 ("library"       . vhdl-template-library-hook)
 
2934
                 ("linkage"       . vhdl-template-default-hook)
 
2935
                 ("literal"       . vhdl-template-default-hook)
 
2936
                 ("loop"          . vhdl-template-bare-loop-hook)
 
2937
                 ("map"           . vhdl-template-map-hook)
 
2938
                 ("mod"           . vhdl-template-default-hook)
 
2939
                 ("nand"          . vhdl-template-default-hook)
 
2940
                 ("new"           . vhdl-template-default-hook)
 
2941
                 ("next"          . vhdl-template-next-hook)
 
2942
                 ("nor"           . vhdl-template-default-hook)
 
2943
                 ("not"           . vhdl-template-default-hook)
 
2944
                 ("null"          . vhdl-template-default-hook)
 
2945
                 ("of"            . vhdl-template-default-hook)
 
2946
                 ("on"            . vhdl-template-default-hook)
 
2947
                 ("open"          . vhdl-template-default-hook)
 
2948
                 ("or"            . vhdl-template-default-hook)
 
2949
                 ("others"        . vhdl-template-others-hook)
 
2950
                 ("out"           . vhdl-template-default-hook)
 
2951
                 ("pack"          . vhdl-template-package-hook)
 
2952
                 ("package"       . vhdl-template-package-hook)
 
2953
                 ("port"          . vhdl-template-port-hook)
 
2954
                 ("postponed"     . vhdl-template-default-hook)
 
2955
                 ("procedure"     . vhdl-template-procedure-hook)
 
2956
                 ("process"       . vhdl-template-process-hook)
 
2957
                 ("pure"          . vhdl-template-default-hook)
 
2958
                 ("range"         . vhdl-template-default-hook)
 
2959
                 ("record"        . vhdl-template-default-hook)
 
2960
                 ("register"      . vhdl-template-default-hook)
 
2961
                 ("reject"        . vhdl-template-default-hook)
 
2962
                 ("rem"           . vhdl-template-default-hook)
 
2963
                 ("report"        . vhdl-template-report-hook)
 
2964
                 ("return"        . vhdl-template-return-hook)
 
2965
                 ("rol"           . vhdl-template-default-hook)
 
2966
                 ("ror"           . vhdl-template-default-hook)
 
2967
                 ("select"        . vhdl-template-selected-signal-asst-hook)
 
2968
                 ("severity"      . vhdl-template-default-hook)
 
2969
                 ("shared"        . vhdl-template-default-hook)
 
2970
                 ("sig"           . vhdl-template-signal-hook)
 
2971
                 ("signal"        . vhdl-template-signal-hook)
 
2972
                 ("sla"           . vhdl-template-default-hook)
 
2973
                 ("sll"           . vhdl-template-default-hook)
 
2974
                 ("sra"           . vhdl-template-default-hook)
 
2975
                 ("srl"           . vhdl-template-default-hook)
 
2976
                 ("subtype"       . vhdl-template-subtype-hook)
 
2977
                 ("then"          . vhdl-template-default-hook)
 
2978
                 ("to"            . vhdl-template-default-hook)
 
2979
                 ("transport"     . vhdl-template-default-hook)
 
2980
                 ("type"          . vhdl-template-type-hook)
 
2981
                 ("unaffected"    . vhdl-template-default-hook)
 
2982
                 ("units"         . vhdl-template-default-hook)
 
2983
                 ("until"         . vhdl-template-default-hook)
 
2984
                 ("use"           . vhdl-template-use-hook)
 
2985
                 ("var"           . vhdl-template-variable-hook)
 
2986
                 ("variable"      . vhdl-template-variable-hook)
 
2987
                 ("wait"          . vhdl-template-wait-hook)
 
2988
                 ("when"          . vhdl-template-when-hook)
 
2989
                 ("while"         . vhdl-template-while-loop-hook)
 
2990
                 ("with"          . vhdl-template-with-hook)
 
2991
                 ("xnor"          . vhdl-template-default-hook)
 
2992
                 ("xor"           . vhdl-template-default-hook)
 
2993
                 )))
3014
2994
     ;; VHDL-AMS keywords
3015
2995
     (when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams))
3016
 
       '(
3017
 
         ("across"     "" vhdl-template-default-hook 0)
3018
 
         ("break"      "" vhdl-template-break-hook 0)
3019
 
         ("limit"      "" vhdl-template-limit-hook 0)
3020
 
         ("nature"     "" vhdl-template-nature-hook 0)
3021
 
         ("noise"      "" vhdl-template-default-hook 0)
3022
 
         ("procedural" "" vhdl-template-procedural-hook 0)
3023
 
         ("quantity"   "" vhdl-template-quantity-hook 0)
3024
 
         ("reference"  "" vhdl-template-default-hook 0)
3025
 
         ("spectrum"   "" vhdl-template-default-hook 0)
3026
 
         ("subnature"  "" vhdl-template-subnature-hook 0)
3027
 
         ("terminal"   "" vhdl-template-terminal-hook 0)
3028
 
         ("through"    "" vhdl-template-default-hook 0)
3029
 
         ("tolerance"  "" vhdl-template-default-hook 0)
3030
 
         ))
 
2996
       (mapcar (lambda (x) (list (car x) "" (cdr x) 0 'system))
 
2997
               '(
 
2998
                 ("across"     . vhdl-template-default-hook)
 
2999
                 ("break"      . vhdl-template-break-hook)
 
3000
                 ("limit"      . vhdl-template-limit-hook)
 
3001
                 ("nature"     . vhdl-template-nature-hook)
 
3002
                 ("noise"      . vhdl-template-default-hook)
 
3003
                 ("procedural" . vhdl-template-procedural-hook)
 
3004
                 ("quantity"   . vhdl-template-quantity-hook)
 
3005
                 ("reference"  . vhdl-template-default-hook)
 
3006
                 ("spectrum"   . vhdl-template-default-hook)
 
3007
                 ("subnature"  . vhdl-template-subnature-hook)
 
3008
                 ("terminal"   . vhdl-template-terminal-hook)
 
3009
                 ("through"    . vhdl-template-default-hook)
 
3010
                 ("tolerance"  . vhdl-template-default-hook)
 
3011
                 )))
3031
3012
     ;; user model keywords
3032
3013
     (when (memq 'user vhdl-electric-keywords)
3033
 
       (let ((alist vhdl-model-alist)
3034
 
             abbrev-list keyword)
3035
 
         (while alist
3036
 
           (setq keyword (nth 3 (car alist)))
 
3014
       (let (abbrev-list keyword)
 
3015
         (dolist (elem vhdl-model-alist)
 
3016
           (setq keyword (nth 3 elem))
3037
3017
           (unless (equal keyword "")
3038
 
             (setq abbrev-list
3039
 
                   (cons (list keyword ""
3040
 
                               (vhdl-function-name
3041
 
                                "vhdl-model" (nth 0 (car alist)) "hook") 0)
3042
 
                         abbrev-list)))
3043
 
           (setq alist (cdr alist)))
 
3018
             (push (list keyword ""
 
3019
                         (vhdl-function-name
 
3020
                          "vhdl-model" (nth 0 elem) "hook") 0 'system)
 
3021
                   abbrev-list)))
3044
3022
         abbrev-list)))))
3045
3023
 
3046
3024
;; initialize abbrev table for VHDL Mode
8158
8136
(defun vhdl-electric-quote (count) "'' --> \""
8159
8137
  (interactive "p")
8160
8138
  (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8161
 
      (if (= (preceding-char) last-input-char)
 
8139
      (if (= (preceding-char) last-input-event)
8162
8140
          (progn (delete-backward-char 1) (insert-char ?\" 1))
8163
8141
        (insert-char ?\' 1))
8164
8142
    (self-insert-command count)))
8166
8144
(defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '"
8167
8145
  (interactive "p")
8168
8146
  (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8169
 
      (cond ((= (preceding-char) last-input-char)
 
8147
      (cond ((= (preceding-char) last-input-event)
8170
8148
             (progn (delete-char -1)
8171
8149
                    (unless (eq (preceding-char) ? ) (insert " "))
8172
8150
                    (insert ": ")
8180
8158
(defun vhdl-electric-comma (count) "',,' --> ' <= '"
8181
8159
  (interactive "p")
8182
8160
  (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8183
 
      (cond ((= (preceding-char) last-input-char)
 
8161
      (cond ((= (preceding-char) last-input-event)
8184
8162
             (progn (delete-char -1)
8185
8163
                    (unless (eq (preceding-char) ? ) (insert " "))
8186
8164
                    (insert "<= ")))
8190
8168
(defun vhdl-electric-period (count) "'..' --> ' => '"
8191
8169
  (interactive "p")
8192
8170
  (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8193
 
      (cond ((= (preceding-char) last-input-char)
 
8171
      (cond ((= (preceding-char) last-input-event)
8194
8172
             (progn (delete-char -1)
8195
8173
                    (unless (eq (preceding-char) ? ) (insert " "))
8196
8174
                    (insert "=> ")))
8200
8178
(defun vhdl-electric-equal (count) "'==' --> ' == '"
8201
8179
  (interactive "p")
8202
8180
  (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8203
 
      (cond ((= (preceding-char) last-input-char)
 
8181
      (cond ((= (preceding-char) last-input-event)
8204
8182
             (progn (delete-char -1)
8205
8183
                    (unless (eq (preceding-char) ? ) (insert " "))
8206
8184
                    (insert "== ")))
10612
10590
          (backward-word 1)
10613
10591
          (vhdl-case-word 1)
10614
10592
          (delete-char 1))
10615
 
      (let ((invoke-char last-command-char)
 
10593
      (let ((invoke-char last-command-event)
10616
10594
            (abbrev-mode -1)
10617
10595
            (vhdl-template-invoked-by-hook t))
10618
10596
        (let ((caught (catch 'abort
12164
12142
    (widen)
12165
12143
    (save-excursion
12166
12144
      (beginning-of-line)
12167
 
      (1+ (count-lines 1 (point))))))
 
12145
      (1+ (count-lines (point-min) (point))))))
12168
12146
 
12169
12147
(defun vhdl-line-kill-entire (&optional arg)
12170
12148
  "Delete entire line."