aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMiles Bader <[email protected]>2006-05-10 20:42:41 +0000
committerMiles Bader <[email protected]>2006-05-10 20:42:41 +0000
commit3bcf2b084a0dd1ff0399480d57b87e01cfe061dc (patch)
tree355c68cda5a5c9c73824840df3cdae6320017283 /lisp/progmodes
parent0ea38cf9dca8f2b148d78f638eed17e8896984af (diff)
parentd105bfecce2288cd99f591382586a22a4ce1b6f2 (diff)
Revision: [email protected]/emacs--unicode--0--patch-60
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 259-273) - Update from CVS - lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t - Merge from gnus--rel--5.10 - Rename "field-at-point" to "field-at-pos" - (comint-insert-input): Remove redundant calls to setq and goto-char * gnus--rel--5.10 (patch 99-100) - Merge from emacs--devo--0 - Update from CVS
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/gdb-ui.el69
-rw-r--r--lisp/progmodes/grep.el46
-rw-r--r--lisp/progmodes/gud.el114
-rw-r--r--lisp/progmodes/idlw-shell.el6
-rw-r--r--lisp/progmodes/idlwave.el67
-rw-r--r--lisp/progmodes/perl-mode.el5
-rw-r--r--lisp/progmodes/vhdl-mode.el3
-rw-r--r--lisp/progmodes/xscheme.el9
8 files changed, 165 insertions, 154 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index a5163319fb..a20f11e0aa 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -114,8 +114,6 @@ Set to \"main\" at start if gdb-show-main is t.")
Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP)
where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame
address for root variables.")
-(defvar gdb-force-update t
- "Non-nil means that view of watch expressions will be updated in the speedbar.")
(defvar gdb-main-file nil "Source file from which program execution begins.")
(defvar gdb-overlay-arrow-position nil)
(defvar gdb-server-prefix nil)
@@ -527,7 +525,6 @@ With arg, use separate IO iff arg is positive."
gdb-current-language nil
gdb-frame-number nil
gdb-var-list nil
- gdb-force-update t
gdb-main-file nil
gdb-first-post-prompt t
gdb-prompting nil
@@ -690,10 +687,14 @@ With arg, enter name of variable to be watched in the minibuffer."
(if event (posn-set-point (event-end event)))
(require 'tooltip)
(save-selected-window
- (let ((expr (if arg
- (completing-read "Name of variable: "
- 'gud-gdb-complete-command)
- (tooltip-identifier-from-point (point)))))
+ (let ((expr
+ (if arg
+ (completing-read "Name of variable: "
+ 'gud-gdb-complete-command)
+ (if (and transient-mark-mode mark-active)
+ (buffer-substring (region-beginning) (region-end))
+ (tooltip-identifier-from-point (point))))))
+ (speedbar 1)
(catch 'already-watched
(dolist (var gdb-var-list)
(unless (string-match "\\." (car var))
@@ -725,7 +726,6 @@ With arg, enter name of variable to be watched in the minibuffer."
(match-string 3)
nil nil gdb-frame-address)))
(push var gdb-var-list)
- (speedbar 1)
(unless (string-equal
speedbar-initial-expansion-list-name "GUD")
(speedbar-change-initial-expansion-list "GUD"))
@@ -741,13 +741,26 @@ With arg, enter name of variable to be watched in the minibuffer."
(message-box "Watching expressions requires gdb 6.0 onwards")
(message-box "No symbol \"%s\" in current context." expr))))
+(defun gdb-speedbar-update ()
+ (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
+ ;; Dummy command to update speedbar even when idle.
+ (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
+ ;; Keep gdb-pending-triggers non-nil till end.
+ (push 'gdb-speedbar-timer gdb-pending-triggers)))
+
+(defun gdb-speedbar-timer-fn ()
+ (setq gdb-pending-triggers
+ (delq 'gdb-speedbar-timer gdb-pending-triggers))
+ (speedbar-timer-fn))
+
(defun gdb-var-evaluate-expression-handler (varnum changed)
(goto-char (point-min))
(re-search-forward ".*value=\\(\".*\"\\)" nil t)
(let ((var (assoc varnum gdb-var-list)))
(when var
(if changed (setcar (nthcdr 5 var) 'changed))
- (setcar (nthcdr 4 var) (read (match-string 1))))))
+ (setcar (nthcdr 4 var) (read (match-string 1)))))
+ (gdb-speedbar-update))
(defun gdb-var-list-children (varnum)
(gdb-enqueue-input
@@ -811,21 +824,7 @@ type_changed=\".*?\".*?}")
varnum "\"\n")
`(lambda () (gdb-var-evaluate-expression-handler ,varnum t)))))))
(setq gdb-pending-triggers
- (delq 'gdb-var-update gdb-pending-triggers))
- (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
- ;; Dummy command to update speedbar at right time.
- (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
- ;; Keep gdb-pending-triggers non-nil till end.
- (push 'gdb-speedbar-refresh gdb-pending-triggers)))
-
-(defun gdb-speedbar-refresh ()
- (setq gdb-pending-triggers
- (delq 'gdb-speedbar-refresh gdb-pending-triggers))
- (with-current-buffer gud-comint-buffer
- (let ((speedbar-verbosity-level 0)
- (speedbar-shown-directories nil))
- (save-excursion
- (speedbar-refresh)))))
+ (delq 'gdb-var-update gdb-pending-triggers)))
(defun gdb-var-delete ()
"Delete watch expression at point from the speedbar."
@@ -1378,7 +1377,6 @@ happens to be appropriate."
;; FIXME: with GDB-6 on Darwin, this might very well work.
;; Only needed/used with speedbar/watch expressions.
(when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
- (setq gdb-force-update t)
(if (string-equal gdb-version "pre-6.4")
(gdb-var-update)
(gdb-var-update-1)))))
@@ -1913,7 +1911,7 @@ static char *magick[] = {
(let* ((buffer (find-file-noselect
(if (file-exists-p file) file
(cdr (assoc bptno gdb-location-alist)))))
- (window (unless (gdb-display-source-buffer buffer)
+ (window (or (gdb-display-source-buffer buffer)
(display-buffer buffer))))
(setq gdb-source-window window)
(with-current-buffer buffer
@@ -2691,7 +2689,7 @@ corresponding to the mode line clicked."
'(menu-item "Inferior IO" gdb-frame-separate-io-buffer
:enable gdb-use-separate-io-buffer))
(define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
- (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer))
+ (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
(define-key menu [breakpoints]
'("Breakpoints" . gdb-frame-breakpoints-buffer))
(define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
@@ -2755,6 +2753,7 @@ corresponding to the mode line clicked."
;; Put buffer list in window if we
;; can't find a source file.
(list-buffers-noselect))))
+ (setq gdb-source-window (selected-window))
(when gdb-use-separate-io-buffer
(split-window-horizontally)
(other-window 1)
@@ -2782,6 +2781,7 @@ This arrangement depends on the value of `gdb-many-windows'."
(if gud-last-last-frame
(gud-find-file (car gud-last-last-frame))
(gud-find-file gdb-main-file)))
+ (setq gdb-source-window (selected-window))
(other-window 1))))
(defun gdb-reset ()
@@ -2803,8 +2803,6 @@ Kills the gdb buffers, and resets variables and the source buffers."
(setq overlay-arrow-variable-list
(delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
(setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
- (if (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
- (speedbar-refresh))
(setq gud-running nil)
(setq gdb-active-process nil)
(setq gdb-var-list nil)
@@ -3163,7 +3161,9 @@ BUFFER nil or omitted means use the current buffer."
(if (and (match-string 3) gud-overlay-arrow-position)
(let ((buffer (marker-buffer gud-overlay-arrow-position))
(position (marker-position gud-overlay-arrow-position)))
- (when (and buffer (string-equal (buffer-name buffer) (match-string 3)))
+ (when (and buffer
+ (string-equal (buffer-name buffer)
+ (file-name-nondirectory (match-string 3))))
(with-current-buffer buffer
(setq fringe-indicator-alist
(if (string-equal gdb-frame-number "0")
@@ -3230,7 +3230,8 @@ numchild=\"\\(.+?\\)\",.*?value=\\(\".*?\"\\),.*?type=\"\\(.+?\\)\".*?}")
(throw 'child-already-watched nil))
(push varchild var-list))))
(push var var-list)))
- (setq gdb-var-list (nreverse var-list)))))
+ (setq gdb-var-list (nreverse var-list))))
+ (gdb-speedbar-update))
; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
(defun gdb-var-update-1 ()
@@ -3263,11 +3264,7 @@ in_scope=\"\\(.*?\\)\".*?}")
(read (match-string 2)))))))
(setq gdb-pending-triggers
(delq 'gdb-var-update gdb-pending-triggers))
- (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
- ;; dummy command to update speedbar at right time
- (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
- ;; keep gdb-pending-triggers non-nil till end
- (push 'gdb-speedbar-refresh gdb-pending-triggers)))
+ (gdb-speedbar-update))
;; Registers buffer.
;;
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 0aba9d42b8..410a973d1b 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -584,7 +584,7 @@ substitution string. Note dynamic scoping of variables.")
(setq command
(replace-match
(or (if (symbolp (cdr kw))
- (eval (cdr kw))
+ (symbol-value (cdr kw))
(save-match-data (eval (cdr kw))))
"")
t t command))))))
@@ -639,9 +639,9 @@ The search is limited to file names matching shell pattern FILES.
FILES may use abbreviations defined in `grep-files-aliases', e.g.
entering `ch' is equivalent to `*.[ch]'.
-With \\[universal-argument] prefix, allow user to edit the constructed
-shell command line before it is executed.
-With two \\[universal-argument] prefixes, edit and run grep shell command.
+With \\[universal-argument] prefix, you can edit the constructed shell command line
+before it is executed.
+With two \\[universal-argument] prefixes, directly edit and run `grep-command'.
Collect output in a buffer. While grep runs asynchronously, you
can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
@@ -676,7 +676,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
(setq command
(read-from-minibuffer "Confirm: "
command nil nil 'grep-history))
- (push command grep-history))))
+ (add-to-history 'grep-history command))))
(when command
;; Setting process-setup-function makes exit-message-function work
;; even when async processes aren't supported.
@@ -687,14 +687,14 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
;;;###autoload
(defun rgrep (regexp &optional files dir)
- "Recusively grep for REGEXP in FILES in directory tree rooted at DIR.
+ "Recursively grep for REGEXP in FILES in directory tree rooted at DIR.
The search is limited to file names matching shell pattern FILES.
FILES may use abbreviations defined in `grep-files-aliases', e.g.
entering `ch' is equivalent to `*.[ch]'.
-With \\[universal-argument] prefix, allow user to edit the constructed
-shell command line before it is executed.
-With two \\[universal-argument] prefixes, edit and run grep-find shell command.
+With \\[universal-argument] prefix, you can edit the constructed shell command line
+before it is executed.
+With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'.
Collect output in a buffer. While find runs asynchronously, you
can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
@@ -721,16 +721,16 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
(if (null files)
(if (not (string= regexp grep-find-command))
(compilation-start regexp 'grep-mode))
- (let* ((default-directory (file-name-as-directory (expand-file-name dir)))
- (command (grep-expand-template
- grep-find-template
- regexp
- (concat "\\( -name "
- (mapconcat #'shell-quote-argument
- (split-string files)
- " -o -name ")
- " \\)")
- default-directory
+ (setq dir (file-name-as-directory (expand-file-name dir)))
+ (let ((command (grep-expand-template
+ grep-find-template
+ regexp
+ (concat "\\( -name "
+ (mapconcat #'shell-quote-argument
+ (split-string files)
+ " -o -name ")
+ " \\)")
+ dir
(and grep-find-ignored-directories
(concat "\\( -path '*/"
(mapconcat #'identity
@@ -742,8 +742,12 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
(setq command
(read-from-minibuffer "Confirm: "
command nil nil 'grep-find-history))
- (push command grep-find-history))
- (compilation-start command 'grep-mode))))))
+ (add-to-history 'grep-find-history command))
+ (let ((default-directory dir))
+ (compilation-start command 'grep-mode))
+ ;; Set default-directory if we started rgrep in the *grep* buffer.
+ (if (eq next-error-last-buffer (current-buffer))
+ (setq default-directory dir)))))))
(provide 'grep)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 11259aa396..5be8866835 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -49,7 +49,6 @@
(defvar gdb-macro-info)
(defvar gdb-server-prefix)
(defvar gdb-show-changed-values)
-(defvar gdb-force-update)
(defvar gdb-var-list)
(defvar gdb-speedbar-auto-raise)
(defvar tool-bar-map)
@@ -442,37 +441,55 @@ required by the caller."
(buffer-name gud-comint-buffer))
(let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
(window (get-buffer-window (current-buffer) 0))
+ (start (window-start window))
(p (window-point window)))
(cond
((memq minor-mode '(gdbmi gdba))
- (when (or gdb-force-update
- (not (save-excursion
- (goto-char (point-min))
- (looking-at "Watch Expressions:"))))
- (erase-buffer)
- (insert "Watch Expressions:\n")
- (if gdb-speedbar-auto-raise
- (raise-frame speedbar-frame))
- (let ((var-list gdb-var-list) parent)
- (while var-list
- (let* (char (depth 0) (start 0) (var (car var-list))
- (varnum (car var)) (expr (nth 1 var))
- (type (nth 3 var)) (value (nth 4 var))
- (status (nth 5 var)))
- (put-text-property
- 0 (length expr) 'face font-lock-variable-name-face expr)
- (put-text-property
- 0 (length type) 'face font-lock-type-face type)
- (while (string-match "\\." varnum start)
- (setq depth (1+ depth)
- start (1+ (match-beginning 0))))
- (if (eq depth 0) (setq parent nil))
- (if (or (equal (nth 2 var) "0")
- (and (equal (nth 2 var) "1")
- (string-match "char \\*$" type)))
+ (erase-buffer)
+ (insert "Watch Expressions:\n")
+ (if gdb-speedbar-auto-raise
+ (raise-frame speedbar-frame))
+ (let ((var-list gdb-var-list) parent)
+ (while var-list
+ (let* (char (depth 0) (start 0) (var (car var-list))
+ (varnum (car var)) (expr (nth 1 var))
+ (type (nth 3 var)) (value (nth 4 var))
+ (status (nth 5 var)))
+ (put-text-property
+ 0 (length expr) 'face font-lock-variable-name-face expr)
+ (put-text-property
+ 0 (length type) 'face font-lock-type-face type)
+ (while (string-match "\\." varnum start)
+ (setq depth (1+ depth)
+ start (1+ (match-beginning 0))))
+ (if (eq depth 0) (setq parent nil))
+ (if (or (equal (nth 2 var) "0")
+ (and (equal (nth 2 var) "1")
+ (string-match "char \\*$" type)))
+ (speedbar-make-tag-line
+ 'bracket ?? nil nil
+ (concat expr "\t" value)
+ (if (or parent (eq status 'out-of-scope))
+ nil 'gdb-edit-value)
+ nil
+ (if gdb-show-changed-values
+ (or parent (case status
+ (changed 'font-lock-warning-face)
+ (out-of-scope 'shadow)
+ (t t)))
+ t)
+ depth)
+ (if (eq status 'out-of-scope) (setq parent 'shadow))
+ (if (and (nth 1 var-list)
+ (string-match (concat varnum "\\.")
+ (car (nth 1 var-list))))
+ (setq char ?-)
+ (setq char ?+))
+ (if (string-match "\\*$" type)
(speedbar-make-tag-line
- 'bracket ?? nil nil
- (concat expr "\t" value)
+ 'bracket char
+ 'gdb-speedbar-expand-node varnum
+ (concat expr "\t" type "\t" value)
(if (or parent (eq status 'out-of-scope))
nil 'gdb-edit-value)
nil
@@ -483,37 +500,15 @@ required by the caller."
(t t)))
t)
depth)
- (if (eq status 'out-of-scope) (setq parent 'shadow))
- (if (and (nth 1 var-list)
- (string-match (concat varnum "\\.")
- (car (nth 1 var-list))))
- (setq char ?-)
- (setq char ?+))
- (if (string-match "\\*$" type)
- (speedbar-make-tag-line
- 'bracket char
- 'gdb-speedbar-expand-node varnum
- (concat expr "\t" type "\t" value)
- (if (or parent (eq status 'out-of-scope))
- nil 'gdb-edit-value)
- nil
- (if gdb-show-changed-values
- (or parent (case status
- (changed 'font-lock-warning-face)
- (out-of-scope 'shadow)
- (t t)))
- t)
- depth)
- (speedbar-make-tag-line
- 'bracket char
- 'gdb-speedbar-expand-node varnum
- (concat expr "\t" type)
- nil nil
- (if (and (or parent status) gdb-show-changed-values)
- 'shadow t)
- depth))))
- (setq var-list (cdr var-list))))
- (setq gdb-force-update nil)))
+ (speedbar-make-tag-line
+ 'bracket char
+ 'gdb-speedbar-expand-node varnum
+ (concat expr "\t" type)
+ nil nil
+ (if (and (or parent status) gdb-show-changed-values)
+ 'shadow t)
+ depth))))
+ (setq var-list (cdr var-list)))))
(t (unless (and (save-excursion
(goto-char (point-min))
(looking-at "Current Stack:"))
@@ -544,6 +539,7 @@ required by the caller."
(t (error "Should never be here")))
frame t))))
(setq gud-last-speedbar-stackframe gud-last-last-frame))))
+ (set-window-start window start)
(set-window-point window p))))
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 410875f200..bdc8161c80 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1471,11 +1471,7 @@ Otherwise just move the line. Move down unless UP is non-nil."
(if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos))
(if (and idlwave-shell-arrows-do-history
(>= (1+ (save-excursion (end-of-line) (point))) proc-pos))
- (progn
- ;;(goto-char proc-pos)
- (goto-char (point-max))
- ;;(and (not (eolp)) (kill-line nil))
- (comint-previous-input arg))
+ (comint-previous-input arg)
(previous-line arg))))
(defun idlwave-shell-up-or-history (&optional arg)
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 7a77876682..2f26c90ac2 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1208,8 +1208,8 @@ As a user, you should not set this to t.")
;; Treats continuation lines, works only during whole buffer
;; fontification. Slow, use it only in fancy fontification.
(keyword-parameters
- '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\\(\n[ \t]*;.*\\)*\n[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"
- (5 font-lock-reference-face)))
+ '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\([ \t]*\\(;.*\\)?\n\\)*[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"
+ (6 font-lock-reference-face)))
;; System variables start with a bang.
(system-variables
@@ -1915,6 +1915,7 @@ The main features of this mode are
(set (make-local-variable 'comment-start-skip) ";+[ \t]*")
(set (make-local-variable 'comment-start) ";")
+ (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions
(set (make-local-variable 'require-final-newline) t)
(set (make-local-variable 'abbrev-all-caps) t)
(set (make-local-variable 'indent-tabs-mode) nil)
@@ -1947,6 +1948,10 @@ The main features of this mode are
;; Following line is for Emacs - XEmacs uses the corresponding property
;; on the `idlwave-mode' symbol.
(set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
+ (set (make-local-variable 'font-lock-mark-block-function)
+ 'idlwave-mark-subprogram)
+ (set (make-local-variable 'font-lock-fontify-region-function)
+ 'idlwave-font-lock-fontify-region)
;; Imenu setup
(set (make-local-variable 'imenu-create-index-function)
@@ -1956,6 +1961,15 @@ The main features of this mode are
(set (make-local-variable 'imenu-prev-index-position-function)
'idlwave-prev-index-position)
+ ;; HideShow setup
+ (add-to-list 'hs-special-modes-alist
+ (list 'idlwave-mode
+ idlwave-begin-block-reg
+ idlwave-end-block-reg
+ ";"
+ 'idlwave-forward-block nil))
+
+
;; Make a local post-command-hook and add our hook to it
;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
;; (make-local-hook 'post-command-hook)
@@ -2000,16 +2014,22 @@ The main features of this mode are
(idlwave-read-paths) ; we may need these early
(setq idlwave-setup-done t)))
+(defun idlwave-font-lock-fontify-region (beg end &optional verbose)
+ "Fontify continuation lines correctly."
+ (let (pos)
+ (save-excursion
+ (goto-char beg)
+ (forward-line -1)
+ (when (setq pos (idlwave-is-continuation-line))
+ (goto-char pos)
+ (idlwave-beginning-of-statement)
+ (setq beg (point)))))
+ (font-lock-default-fontify-region beg end verbose))
+
;;
;; Code Formatting ----------------------------------------------------
;;
-(defun idlwave-push-mark (&rest rest)
- "Push mark for compatibility with Emacs 18/19."
- (if (fboundp 'iconify-frame)
- (apply 'push-mark rest)
- (push-mark)))
-
(defun idlwave-hard-tab ()
"Inserts TAB in buffer in current position."
(interactive)
@@ -2403,7 +2423,7 @@ non-nil."
(idlwave-end-of-statement)
(let ((end (point)))
(idlwave-beginning-of-statement)
- (idlwave-push-mark end nil t)))
+ (push-mark end nil t)))
(defun idlwave-mark-block ()
"Mark containing block."
@@ -2414,7 +2434,7 @@ non-nil."
(let ((end (point)))
(idlwave-backward-block)
(idlwave-beginning-of-statement)
- (idlwave-push-mark end nil t)))
+ (push-mark end nil t)))
(defun idlwave-mark-subprogram ()
@@ -2425,7 +2445,7 @@ The marks are pushed."
(idlwave-beginning-of-subprogram)
(let ((beg (point)))
(idlwave-forward-block)
- (idlwave-push-mark beg nil t))
+ (push-mark beg nil t))
(exchange-point-and-mark))
(defun idlwave-backward-up-block (&optional arg)
@@ -2446,11 +2466,12 @@ If prefix ARG < 0 then move forward to enclosing block end."
(idlwave-block-jump-out 1 'nomark)
(backward-word 1))
-(defun idlwave-forward-block ()
+(defun idlwave-forward-block (&optional arg)
"Move across next nested block."
(interactive)
- (if (idlwave-down-block 1)
- (idlwave-block-jump-out 1 'nomark)))
+ (let ((arg (or arg 1)))
+ (if (idlwave-down-block arg)
+ (idlwave-block-jump-out arg 'nomark))))
(defun idlwave-backward-block ()
"Move backward across previous nested block."
@@ -2496,12 +2517,11 @@ The marks are pushed."
(if (re-search-forward idlwave-doclib-end nil t)
(progn
(forward-line 1)
- (idlwave-push-mark beg nil t)
+ (push-mark beg nil t)
(message "Could not find end of doc library header.")))
(message "Could not find doc library header start.")
(goto-char here)))))
-
(defun idlwave-current-routine ()
"Return (NAME TYPE CLASS) of current routine."
(idlwave-routines)
@@ -3194,13 +3214,14 @@ Skips any whitespace. Returns 0 if the end-of-line follows the whitespace."
"Tests if current line is continuation line.
Blank or comment-only lines following regular continuation lines (with
`$') count as continuations too."
- (save-excursion
- (or
- (idlwave-look-at "\\<\\$")
- (catch 'loop
- (while (and (looking-at "^[ \t]*\\(;.*\\)?$")
- (eq (forward-line -1) 0))
- (if (idlwave-look-at "\\<\\$") (throw 'loop t)))))))
+ (let (p)
+ (save-excursion
+ (or
+ (idlwave-look-at "\\<\\$")
+ (catch 'loop
+ (while (and (looking-at "^[ \t]*\\(;.*\\)?$")
+ (eq (forward-line -1) 0))
+ (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p))))))))
(defun idlwave-is-comment-line ()
"Tests if the current line is a comment line."
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 43b33aa39a..4d63b07d87 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -923,8 +923,9 @@ Returns new value of point in all cases."
(or arg (setq arg 1))
(if (< arg 0) (forward-char 1))
(and (/= arg 0)
- (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
- nil 'move arg)
+ (re-search-backward
+ "^\\s(\\|^\\s-*sub\\b[ \t\n]*\\_<[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
+ nil 'move arg)
(goto-char (1- (match-end 0))))
(point))
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index d81a5fcf47..987b37cf2c 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -16723,8 +16723,7 @@ specified by a target."
(progn (save-buffer)
(kill-buffer (current-buffer))
(set-buffer orig-buffer)
- (setq file-name-history
- (cons makefile-path-name file-name-history)))
+ (add-to-history 'file-name-history makefile-path-name))
(vhdl-warning-when-idle
(format "File not writable: \"%s\""
(abbreviate-file-name makefile-path-name)))
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index 4f1cd37a9f..0f55c71ac7 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -580,12 +580,9 @@ The strings are concatenated and terminated by a newline."
;;;; Scheme expressions ring
(defun xscheme-insert-expression (string)
- (setq xscheme-expressions-ring (cons string xscheme-expressions-ring))
- (if (> (length xscheme-expressions-ring) xscheme-expressions-ring-max)
- (setcdr (nthcdr (1- xscheme-expressions-ring-max)
- xscheme-expressions-ring)
- nil))
- (setq xscheme-expressions-ring-yank-pointer xscheme-expressions-ring))
+ (setq xscheme-expressions-ring-yank-pointer
+ (add-to-history 'xscheme-expressions-ring string
+ xscheme-expressions-ring-max)))
(defun xscheme-rotate-yank-pointer (arg)
"Rotate the yanking point in the kill ring."