comparison lisp/progmodes/vhdl-mode.el @ 57820:5d471cc0eaab

(vhdl-fill-region, vhdl-beginning-of-statement): Don't use interactive-p.
author Richard M. Stallman <rms@gnu.org>
date Mon, 01 Nov 2004 07:37:24 +0000
parents e8824c4f5f7e
children eb98fdac5466 7a0245dd1848 e24e2e78deda
comparison
equal deleted inserted replaced
57819:cc6cd5062afb 57820:5d471cc0eaab
6118 (setq count (1- count)) 6118 (setq count (1- count))
6119 ) 6119 )
6120 (vhdl-keep-region-active) 6120 (vhdl-keep-region-active)
6121 foundp)) 6121 foundp))
6122 6122
6123 (defun vhdl-beginning-of-statement (&optional count lim) 6123 (defun vhdl-beginning-of-statement (&optional count lim interactive)
6124 "Go to the beginning of the innermost VHDL statement. 6124 "Go to the beginning of the innermost VHDL statement.
6125 With prefix arg, go back N - 1 statements. If already at the 6125 With prefix arg, go back N - 1 statements. If already at the
6126 beginning of a statement then go to the beginning of the preceding 6126 beginning of a statement then go to the beginning of the preceding
6127 one. If within a string or comment, or next to a comment (only 6127 one. If within a string or comment, or next to a comment (only
6128 whitespace between), move by sentences instead of statements. 6128 whitespace between), move by sentences instead of statements.
6129 6129
6130 When called from a program, this function takes 2 optional args: the 6130 When called from a program, this function takes 3 optional args: the
6131 prefix arg, and a buffer position limit which is the farthest back to 6131 prefix arg, and a buffer position limit which is the farthest back to
6132 search." 6132 search, and something whose meaning I don't understand."
6133 (interactive "p") 6133 (interactive "p\np")
6134 (let ((count (or count 1)) 6134 (let ((count (or count 1))
6135 (case-fold-search t) 6135 (case-fold-search t)
6136 (lim (or lim (point-min))) 6136 (lim (or lim (point-min)))
6137 (here (point)) 6137 (here (point))
6138 state) 6138 state)
6139 (save-excursion 6139 (save-excursion
6140 (goto-char lim) 6140 (goto-char lim)
6141 (setq state (parse-partial-sexp (point) here nil nil))) 6141 (setq state (parse-partial-sexp (point) here nil nil)))
6142 (if (and (interactive-p) 6142 (if (and interactive
6143 (or (nth 3 state) 6143 (or (nth 3 state)
6144 (nth 4 state) 6144 (nth 4 state)
6145 (looking-at (concat "[ \t]*" comment-start-skip)))) 6145 (looking-at (concat "[ \t]*" comment-start-skip))))
6146 (forward-sentence (- count)) 6146 (forward-sentence (- count))
6147 (while (> count 0) 6147 (while (> count 0)
7529 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7529 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7530 ;; Code filling 7530 ;; Code filling
7531 7531
7532 (defun vhdl-fill-region (beg end &optional arg) 7532 (defun vhdl-fill-region (beg end &optional arg)
7533 "Fill lines for a region of code." 7533 "Fill lines for a region of code."
7534 (interactive "r") 7534 (interactive "r\np")
7535 (save-excursion 7535 (save-excursion
7536 (goto-char beg) 7536 (goto-char beg)
7537 (let ((margin (if (interactive-p) (current-indentation) (current-column)))) 7537 (let ((margin (if interactive (current-indentation) (current-column))))
7538 (goto-char end) 7538 (goto-char end)
7539 (setq end (point-marker)) 7539 (setq end (point-marker))
7540 ;; remove inline comments, newlines and whitespace 7540 ;; remove inline comments, newlines and whitespace
7541 (vhdl-comment-kill-region beg end) 7541 (vhdl-comment-kill-region beg end)
7542 (vhdl-comment-kill-inline-region beg end) 7542 (vhdl-comment-kill-inline-region beg end)