Function: idlwave-show-begin

idlwave-show-begin is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-show-begin)

Documentation

Find the start of current block and blinks to it for a second.

Also checks if the correct END statement has been used.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-show-begin ()
  "Find the start of current block and blinks to it for a second.
Also checks if the correct END statement has been used."
  ;; All end statements are reserved words
  ;; Re-indent end line
  ;;(insert-char ?\  1) ;; So indent, etc. work well
  ;;(backward-char 1)
  (let* ((pos (point-marker))
	 (last-abbrev-marker (copy-marker last-abbrev-location))
         (eol-pos (line-end-position))
	 begin-pos end-pos end end1 )
    (if idlwave-reindent-end  (idlwave-indent-line))
    (setq last-abbrev-location (marker-position last-abbrev-marker))
    (when (and (idlwave-modify-abbrev 0 t)
	       idlwave-show-block)
      (save-excursion
	;; Move inside current block
	(goto-char last-abbrev-marker)
	(idlwave-block-jump-out -1 'nomark)
	(setq begin-pos (point))
	(idlwave-block-jump-out 1 'nomark)
	(setq end-pos (point))
	(if (> end-pos eol-pos)
	    (setq end-pos pos))
	(goto-char end-pos)
	(setq end (buffer-substring
		   (progn
		     (skip-chars-backward "a-zA-Z")
		     (point))
		   end-pos))
	(goto-char begin-pos)
	(when (setq end1 (cdr (idlwave-block-master)))
	  (cond
	   ((null end1)) ; no-operation
	   ((string= (downcase end) (downcase end1))
	    (sit-for 1))
	   ((string= (downcase end) "end")
	    ;; A generic end
	    (if idlwave-expand-generic-end
		(save-excursion
		  (goto-char pos)
		  (backward-char 3)
		  (insert (if (string= end "END") (upcase end1) end1))
		  (delete-char 3)))
	    (sit-for 1))
	   (t
	    (beep)
	    (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?"
		     end1 end)
	    (sit-for 1))))))))