summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-cmds.el28
-rw-r--r--lisp/progmodes/cc-mode.el5
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/progmodes/cperl-mode.el1
-rw-r--r--lisp/progmodes/ebnf2ps.el4
-rw-r--r--lisp/progmodes/gud.el8
-rw-r--r--lisp/progmodes/idlw-shell.el23
-rw-r--r--lisp/progmodes/mantemp.el18
-rw-r--r--lisp/progmodes/perl-mode.el5
-rw-r--r--lisp/progmodes/python.el8
-rw-r--r--lisp/progmodes/vhdl-mode.el22
11 files changed, 78 insertions, 46 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 79043c87b63..079ebb02622 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -856,8 +856,8 @@ is inhibited."
(narrow-to-region (point-min) (point))
(back-to-indentation)
(looking-at (concat c-current-comment-prefix "[ \t]*$")))))
- (kill-region (progn (forward-line 0) (point))
- (progn (end-of-line) (point)))
+ (delete-region (progn (forward-line 0) (point))
+ (progn (end-of-line) (point)))
(insert-char ?* 1)) ; the / comes later. ; Do I need a t (retain sticky properties) here?
(setq indentp (and (not arg)
@@ -1360,10 +1360,24 @@ No indentation or other \"electric\" behavior is performed."
(and c-opt-block-decls-with-vars-key
(save-excursion
(c-syntactic-skip-backward "^;}" lim)
- (and (eq (char-before) ?\})
- (eq (car (c-beginning-of-decl-1 lim)) 'previous)
- (looking-at c-opt-block-decls-with-vars-key)
- (point)))))
+ (let ((eo-block (point))
+ bod)
+ (and (eq (char-before) ?\})
+ (eq (car (c-beginning-of-decl-1 lim)) 'previous)
+ (setq bod (point))
+ ;; Look for struct or union or ... If we find one, it might
+ ;; be the return type of a function, or the like. Exclude
+ ;; this case.
+ (c-syntactic-re-search-forward
+ (concat "[;=\(\[{]\\|\\("
+ c-opt-block-decls-with-vars-key
+ "\\)")
+ eo-block t t t)
+ (match-beginning 1) ; Is there a "struct" etc., somewhere?
+ (not (eq (char-before) ?_))
+ (c-syntactic-re-search-forward "[;=\(\[{]" eo-block t t t)
+ (eq (char-before) ?\{)
+ bod)))))
(defun c-where-wrt-brace-construct ()
;; Determine where we are with respect to functions (or other brace
@@ -1531,7 +1545,7 @@ defun."
(setq arg (c-forward-to-nth-EOF-} (- arg) where)))
;; Move forward to the next opening brace....
(when (and (= arg 0)
- (c-syntactic-re-search-forward "{" nil t))
+ (c-syntactic-re-search-forward "{" nil 'eob))
(backward-char)
;; ... and backward to the function header.
(c-beginning-of-decl-1)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index f5da0eecc2e..c3c17a6f3c5 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -820,7 +820,7 @@ compatible with old code; callers should always specify it."
"$")
nil t)
(beginning-of-line)
- (kill-line 1)))
+ (delete-region (point) (progn (end-of-line) (point)))))
;; Delete the first line, if we've got one, in case it contains a mode spec.
(unless (and lv-point
@@ -828,8 +828,7 @@ compatible with old code; callers should always specify it."
(forward-line 0)
(bobp)))
(goto-char (point-min))
- (unless (eobp)
- (kill-line 1)))))
+ (delete-region (point) (progn (end-of-line) (point))))))
(defun c-postprocess-file-styles ()
"Function that post processes relevant file local variables in CC Mode.
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 7fd5f83ea78..ce933cb13d5 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1042,7 +1042,7 @@ Returns the compilation buffer created."
highlight-regexp))
;; Output a mode setter, for saving and later reloading this buffer.
(insert "-*- mode: " name-of-mode
- "; compilation-directory: " (prin1-to-string compilation-directory)
+ "; default-directory: " (prin1-to-string default-directory)
" -*-\n"
(format "%s started at %s\n\n"
mode-name
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 96c94591531..a07fb5ee44f 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -233,6 +233,7 @@ for constructs with multiline if/unless/while/until/for/foreach condition."
"*Indentation of CPerl statements with respect to containing block."
:type 'integer
:group 'cperl-indentation-details)
+(put 'cperl-indent-level 'safe-local-variable 'integerp)
(defcustom cperl-lineup-step nil
"*`cperl-lineup' will always lineup at multiple of this number.
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 77d20792442..7ba4ffdc749 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -2830,7 +2830,7 @@ See `ebnf-style-database' documentation."
(and (assoc name ebnf-style-database)
(error "Style name already exists: %s" name))
(or (assoc inherits ebnf-style-database)
- (error "Style inheritance name does'nt exist: %s" inherits))
+ (error "Style inheritance name doesn't exist: %s" inherits))
(setq ebnf-style-database
(cons (cons name (cons inherits (ebnf-check-style-values values)))
ebnf-style-database)))
@@ -2860,7 +2860,7 @@ See `ebnf-style-database' documentation."
See `ebnf-style-database' documentation."
(interactive "SStyle name: \nXStyle values: ")
(let ((style (or (assoc name ebnf-style-database)
- (error "Style name does'nt exist: %s" name)))
+ (error "Style name doesn't exist: %s" name)))
(merge (ebnf-check-style-values values))
val elt new check)
;; modify value of existing variables
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 1ec9e978229..3d252190eff 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -238,7 +238,7 @@ Used to grey out relevant toolbar icons.")
,(propertize "run" 'face 'font-lock-doc-face) gud-run
:visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
([menu-bar go] menu-item
- ,(propertize "go" 'face 'font-lock-doc-face) gud-go
+ ,(propertize " go " 'face 'font-lock-doc-face) gud-go
:visible (and (not gud-running)
(eq gud-minor-mode 'gdba)))
([menu-bar stop] menu-item
@@ -2304,6 +2304,8 @@ gud, see `gud-mode'."
(gud-def gud-up "up\C-Mwhere" "<" "Up one stack frame.")
(gud-def gud-down "down\C-Mwhere" ">" "Up one stack frame.")
(gud-def gud-run "run" nil "Run the program.") ;if VM start using jdb
+ (gud-def gud-print "print %e" "\C-p" "Evaluate Java expression at point.")
+
(setq comint-prompt-regexp "^> \\|^[^ ]+\\[[0-9]+\\] ")
(setq paragraph-start comint-prompt-regexp)
@@ -2853,7 +2855,9 @@ Obeying it means displaying in another window the specified file and line."
(when (looking-at comint-prompt-regexp)
(set-marker gud-delete-prompt-marker (point))
(set-marker-insertion-type gud-delete-prompt-marker t))
- (insert (concat expr " = ")))))
+ (unless (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'jdb)
+ (insert (concat expr " = "))))))
expr))
;; The next eight functions are hacked from gdbsrc.el by
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index bcecdeafa0f..3b9fb5a896a 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -2586,7 +2586,7 @@ breakpoint can not be set."
(if (idlwave-shell-hide-p 'debug) 'mostly)
nil t))
-(defun idlwave-shell-clear-bp (bp)
+(defun idlwave-shell-clear-bp (bp &optional no-query)
"Clear breakpoint BP.
Clears in IDL and in `idlwave-shell-bp-alist'."
(let ((index (idlwave-shell-bp-get bp)))
@@ -2595,7 +2595,7 @@ Clears in IDL and in `idlwave-shell-bp-alist'."
(idlwave-shell-send-command
(concat "breakpoint,/clear," (int-to-string index))
nil (idlwave-shell-hide-p 'breakpoint) nil t)
- (idlwave-shell-bp-query)))))
+ (unless no-query (idlwave-shell-bp-query))))))
(defun idlwave-shell-current-frame ()
"Return a list containing the current file name and line point is in.
@@ -3722,17 +3722,22 @@ Existing overlays are recycled, in order to minimize consumption."
(setq old-buffers (delq (current-buffer) old-buffers)))
(if (fboundp 'set-specifier) ;; XEmacs
(set-specifier left-margin-width (cons (current-buffer) 2))
- (setq left-margin-width 2))
- (if (setq win (get-buffer-window (current-buffer) t))
- (set-window-buffer win (current-buffer))))))
+ (if (< left-margin-width 2)
+ (setq left-margin-width 2)))
+ (let ((window (get-buffer-window (current-buffer) 0)))
+ (if window
+ (set-window-margins
+ window left-margin-width right-margin-width))))))
(if use-glyph
(while (setq buf (pop old-buffers))
(with-current-buffer buf
(if (fboundp 'set-specifier) ;; XEmacs
(set-specifier left-margin-width (cons (current-buffer) 0))
(setq left-margin-width 0))
- (if (setq win (get-buffer-window buf t))
- (set-window-buffer win buf))))))))
+ (let ((window (get-buffer-window buf 0)))
+ (if window
+ (set-window-margins
+ window left-margin-width right-margin-width)))))))))
(defun idlwave-shell-make-new-bp-overlay (&optional type disabled)
"Make a new overlay for highlighting breakpoints.
@@ -4055,7 +4060,9 @@ list elements of the form:
idlwave-shell-bp-query
'(progn
(idlwave-shell-filter-bp)
- (mapcar 'idlwave-shell-clear-bp idlwave-shell-bp-alist))
+ (mapcar (lambda (x) (idlwave-shell-clear-bp x 'no-query))
+ idlwave-shell-bp-alist)
+ (idlwave-shell-bp-query))
'hide))
(defun idlwave-shell-list-all-bp ()
diff --git a/lisp/progmodes/mantemp.el b/lisp/progmodes/mantemp.el
index 61b8d3d4d3d..2084f364d55 100644
--- a/lisp/progmodes/mantemp.el
+++ b/lisp/progmodes/mantemp.el
@@ -105,14 +105,14 @@
"^[A-z :&*<>~=,0-9+]*>::operator " nil t nil)
(progn
(backward-char 11)
- (kill-line)))
+ (delete-region (point) (line-end-position))))
;; Remove other member function extensions.
(goto-char (point-min))
(message "Removing member function extensions")
(while (re-search-forward "^[A-z :&*<>~=,0-9+]*>::" nil t nil)
(progn
(backward-char 2)
- (kill-line)))))
+ (delete-region (point) (line-end-position))))))
(defun mantemp-sort-and-unique-lines ()
"Eliminate all consecutive duplicate lines in the buffer."
@@ -127,7 +127,7 @@
(progn
(forward-line -1)
(beginning-of-line)
- (kill-line 1)))))
+ (delete-region (point) (progn (forward-line 1) (point)))))))
(defun mantemp-insert-cxx-syntax ()
"Insert C++ syntax around each template class and function.
@@ -161,7 +161,7 @@ the lines."
(progn
(beginning-of-line)
(forward-word 1)
- (kill-word 1)))))
+ (delete-region (point) (progn (forward-word 1) (point)))))))
(defun mantemp-make-mantemps ()
"Gathering interface to the functions modifying the buffer."
@@ -189,16 +189,16 @@ This function does the same thing as `mantemp-make-mantemps-buffer',
but operates on the region."
(interactive)
(let ((cur-buf (current-buffer))
- (mantemp-buffer (generate-new-buffer "*mantemp*")))
+ (mantemp-buffer (generate-new-buffer "*mantemp*"))
+ (str (buffer-substring (mark) (point))))
;; Copy the region to a temporary buffer, make the C++ code there
;; and copy the result back to the current buffer.
- (kill-region (mark) (point))
(set-buffer mantemp-buffer)
- (yank)
+ (insert str)
(mantemp-make-mantemps)
- (kill-region (point-min) (point-max))
+ (setq str (buffer-string))
(set-buffer cur-buf)
- (yank)
+ (insert str)
(kill-buffer mantemp-buffer))
(message "Done"))
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 8b6bc4462d6..35ae6b80901 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -391,6 +391,7 @@ The expansion is entirely correct because it uses the C preprocessor."
"*Indentation of Perl statements with respect to containing block."
:type 'integer
:group 'perl)
+(put 'perl-indent-level 'safe-local-variable 'integerp)
(defcustom perl-continued-statement-offset 4
"*Extra indent for lines not starting new statements."
:type 'integer
@@ -646,10 +647,10 @@ possible action from the following list:
(if (and comment-start-skip
(re-search-forward comment-start-skip eol 'move))
(if (eolp)
- (progn ; kill existing comment
+ (progn ; delete existing comment
(goto-char (match-beginning 0))
(skip-chars-backward " \t")
- (kill-region (point) eol))
+ (delete-region (point) eol))
(if (or (< oldpnt (point)) (= oldpnt eol))
(indent-for-comment) ; indent existing comment
(end-of-line)))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 1709428a611..e57c7e639c9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -981,11 +981,15 @@ don't move and return nil. Otherwise return t."
(_ (if (python-comment-line-p)
(python-skip-comments/blanks t)))
(ci (current-indentation))
- (open (python-open-block-statement-p)))
+ (open (python-open-block-statement-p))
+ opoint)
(if (and (zerop ci) (not open))
(not (goto-char point))
(catch 'done
- (while (zerop (python-next-statement))
+ (setq opoint (point))
+ (while (and (zerop (python-next-statement))
+ (not (= opoint (point))))
+ (setq opoint (point))
(when (or (and open (<= (current-indentation) ci))
(< (current-indentation) ci))
(python-skip-comments/blanks t)
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 2d7bbd79c6b..c549d066b64 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -7028,7 +7028,7 @@ else indent `correctly'."
(indent-to comment-column)
(indent-according-to-mode))
(t ; inline comment indent
- (kill-line -0))))
+ (delete-region (line-beginning-position) (point)))))
;; dedent
((and (>= (current-indentation) vhdl-basic-offset)
(or (eq last-command 'vhdl-electric-tab)
@@ -7161,7 +7161,7 @@ ENDPOS is encountered."
(when (not (looking-at "^\\s-*\\(--.*\\)?$"))
(end-of-line)
(if (search-backward " -- ((" (vhdl-point 'bol) t)
- (kill-line))
+ (delete-region (point) (line-end-position)))
(insert " -- ")
(insert (format "%s" expurgated))))))
(vhdl-keep-region-active))
@@ -8346,7 +8346,9 @@ Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil."
(progn (vhdl-insert-keyword "FOR ")
(if (vhdl-template-field "[quantity name]" " USE " t)
(progn (vhdl-template-field "quantity name" " => ") t)
- (kill-word -1) nil))
+ (delete-region (point)
+ (progn (forward-word -1) (point)))
+ nil))
(vhdl-template-field "[quantity name]" " => " t))
(vhdl-template-field "expression")
(setq position (point))
@@ -8482,7 +8484,7 @@ since these are almost equivalent)."
(setq position (point))
(vhdl-insert-keyword "PORT ")
(unless (vhdl-template-map position t t)
- (kill-line -0)
+ (delete-region (line-beginning-position) (point))
(delete-char -1))
(insert ";"))))
@@ -8573,7 +8575,7 @@ a configuration declaration if not within a design unit."
(setq position (point))
(vhdl-insert-keyword "PORT ")
(unless (vhdl-template-map position t t)
- (kill-line -0)
+ (delete-region (line-beginning-position) (point))
(delete-char -1))
(insert ";")
t)
@@ -9116,11 +9118,11 @@ otherwise."
(cond ((equal definition "")
(insert ";"))
((equal definition "ARRAY")
- (kill-word -1)
+ (delete-region (point) (progn (forward-word -1) (point)))
(vhdl-template-array 'nature t))
((equal definition "RECORD")
(setq mid-pos (point-marker))
- (kill-word -1)
+ (delete-region (point) (progn (forward-word -1) (point)))
(vhdl-template-record 'nature name t))
(t
(vhdl-insert-keyword " ACROSS ")
@@ -9435,7 +9437,7 @@ otherwise."
(insert "\n")
(indent-to (+ margin vhdl-basic-offset))
(setq first nil))
- (kill-line -0)
+ (delete-region (line-beginning-position) (point))
(indent-to margin)
(vhdl-insert-keyword "END RECORD")
(unless (vhdl-standard-p '87) (and name (insert " " name)))
@@ -9600,11 +9602,11 @@ otherwise."
(delete-backward-char 4)
(insert ";"))
((equal definition "ARRAY")
- (kill-word -1)
+ (delete-region (point) (progn (forward-word -1) (point)))
(vhdl-template-array 'type t))
((equal definition "RECORD")
(setq mid-pos (point-marker))
- (kill-word -1)
+ (delete-region (point) (progn (forward-word -1) (point)))
(vhdl-template-record 'type name t))
((equal definition "ACCESS")
(insert " ")