Function: vhdl-electric-dash

vhdl-electric-dash is an interactive and byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-electric-dash COUNT)

Documentation

-- starts a comment, --- draws a horizontal line,
---- starts a display comment.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Stuttering

(defun vhdl-electric-dash (count)
  "-- starts a comment, --- draws a horizontal line,
---- starts a display comment."
  (interactive "p")
  (if (and vhdl-stutter-mode (not (vhdl-in-literal)))
      (cond
       ((and abbrev-start-location (= abbrev-start-location (point)))
	(setq abbrev-start-location nil)
	(goto-char last-abbrev-location)
	(beginning-of-line nil)
	(vhdl-comment-display))
       ((/= (preceding-char) ?-)	; standard dash (minus)
	(self-insert-command count))
       (t (self-insert-command count)
	  (message "Enter `-' for horiz. line, RET for commenting-out code, else enter comment")
	  (let ((next-input (read-char)))
	    (if (= next-input ?-)	; triple dash
		(progn
		  (vhdl-comment-display-line)
		  (message
		   "Enter `-' for display comment, else continue coding")
		  (let ((next-input (read-char)))
		    (if (= next-input ?-) ; four dashes
			(vhdl-comment-display t)
		      (push (vhdl-character-to-event next-input)
                                        ; pushback the char
                            unread-command-events))))
              (push (vhdl-character-to-event next-input) ; pushback the char
                    unread-command-events)
	      (vhdl-comment-insert)))))
    (self-insert-command count)))