Function: idlwave-custom-ampersand-surround

idlwave-custom-ampersand-surround is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-custom-ampersand-surround &optional IS-ACTION)

Documentation

Surround &, leaving room for && (which surround as well).

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-custom-ampersand-surround (&optional is-action)
  "Surround &, leaving room for && (which surround as well)."
  (let* ((prev-char (char-after (- (point) 2)))
	 (next-char (char-after (point)))
	 (amp-left (eq prev-char ?&))
	 (amp-right (eq next-char ?&))
	 (len (if amp-left 2 1)))
    (unless amp-right ;no need to do it twice, amp-left will catch it.
      (idlwave-surround -1 (if (or is-action amp-left) -1) len))))