aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorKaroly Lorentey2005-04-04 16:43:15 +0000
committerKaroly Lorentey2005-04-04 16:43:15 +0000
commitee00ea6e18c2aeae86e262fae703f67f4705032a (patch)
tree9e7fc6bfb33de2b2f861589a2f7674ad35de85a8 /lisp/progmodes
parent4a932511428a2b61ec51deebd6e16ec1efbda800 (diff)
parent8c6ef2ca34c444c1dea1f11b999b4b2ec16cdea3 (diff)
downloademacs-ee00ea6e18c2aeae86e262fae703f67f4705032a.tar.gz
emacs-ee00ea6e18c2aeae86e262fae703f67f4705032a.zip
Merged from miles@gnu.org--gnu-2005 (patch 45-55, 214-231)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-214 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-215 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-216 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-217 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-218 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-219 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-221 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-222 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-223 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-224 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-225 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-226 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-227 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-228 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-229 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-230 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-231 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-45 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-46 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-47 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-48 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-49 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-50 Update from CVS: texi Makefile.in CVS keyw cruft * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-51 Update from CVS: ChangeLog tweaks * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-52 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-53 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-54 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-55 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-324
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/compile.el9
-rw-r--r--lisp/progmodes/cwarn.el4
-rw-r--r--lisp/progmodes/f90.el29
-rw-r--r--lisp/progmodes/flymake.el4
-rw-r--r--lisp/progmodes/fortran.el183
-rw-r--r--lisp/progmodes/glasses.el4
-rw-r--r--lisp/progmodes/gud.el22
-rw-r--r--lisp/progmodes/hideif.el4
-rw-r--r--lisp/progmodes/python.el44
-rw-r--r--lisp/progmodes/scheme.el4
-rw-r--r--lisp/progmodes/tcl.el10
-rw-r--r--lisp/progmodes/which-func.el7
12 files changed, 251 insertions, 73 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 457177d7c4c..bafc901d3d1 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1613,6 +1613,8 @@ and overlay is highlighted between MK and END-MK."
1613 (compilation-set-window-height w) 1613 (compilation-set-window-height w)
1614 1614
1615 (when highlight-regexp 1615 (when highlight-regexp
1616 (if (timerp next-error-highlight-timer)
1617 (cancel-timer next-error-highlight-timer))
1616 (unless compilation-highlight-overlay 1618 (unless compilation-highlight-overlay
1617 (setq compilation-highlight-overlay 1619 (setq compilation-highlight-overlay
1618 (make-overlay (point-min) (point-min))) 1620 (make-overlay (point-min) (point-min)))
@@ -1632,8 +1634,11 @@ and overlay is highlighted between MK and END-MK."
1632 (move-overlay compilation-highlight-overlay 1634 (move-overlay compilation-highlight-overlay
1633 (point) end (current-buffer))) 1635 (point) end (current-buffer)))
1634 (if (numberp next-error-highlight) 1636 (if (numberp next-error-highlight)
1635 (sit-for next-error-highlight)) 1637 (setq next-error-highlight-timer
1636 (if (not (eq next-error-highlight t)) 1638 (run-at-time next-error-highlight nil 'delete-overlay
1639 compilation-highlight-overlay)))
1640 (if (not (or (eq next-error-highlight t)
1641 (numberp next-error-highlight)))
1637 (delete-overlay compilation-highlight-overlay)))))) 1642 (delete-overlay compilation-highlight-overlay))))))
1638 (when (and (eq next-error-highlight 'fringe-arrow)) 1643 (when (and (eq next-error-highlight 'fringe-arrow))
1639 (set (make-local-variable 'overlay-arrow-position) 1644 (set (make-local-variable 'overlay-arrow-position)
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el
index b16381cd2c7..9dfd4dd9e26 100644
--- a/lisp/progmodes/cwarn.el
+++ b/lisp/progmodes/cwarn.el
@@ -1,6 +1,6 @@
1;;; cwarn.el --- highlight suspicious C and C++ constructions 1;;; cwarn.el --- highlight suspicious C and C++ constructions
2 2
3;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Anders Lindgren <andersl@andersl.com> 5;; Author: Anders Lindgren <andersl@andersl.com>
6;; Keywords: c, languages, faces 6;; Keywords: c, languages, faces
@@ -193,7 +193,7 @@ be included in the variable `cwarn-configuration'. By default C and
193C++ modes are included. 193C++ modes are included.
194 194
195With ARG, turn CWarn mode on if and only if arg is positive." 195With ARG, turn CWarn mode on if and only if arg is positive."
196 nil cwarn-mode-text nil 196 :group 'cwarn :lighter cwarn-mode-text
197 (cwarn-font-lock-keywords cwarn-mode) 197 (cwarn-font-lock-keywords cwarn-mode)
198 (if font-lock-mode (font-lock-fontify-buffer))) 198 (if font-lock-mode (font-lock-fontify-buffer)))
199 199
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index fdb7fffac6c..4c8b847b7cd 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -597,41 +597,32 @@ characters long.")
597 597
598;; Hideshow support. 598;; Hideshow support.
599(defconst f90-end-block-re 599(defconst f90-end-block-re
600 (concat "^[ \t0-9]*\\<end\\>[ \t]*" 600 (concat "^[ \t0-9]*\\<end[ \t]*"
601 (regexp-opt '("do" "if" "forall" "function" "interface" 601 (regexp-opt '("do" "if" "forall" "function" "interface"
602 "module" "program" "select" "subroutine" 602 "module" "program" "select" "subroutine"
603 "type" "where" ) t) 603 "type" "where" ) t)
604 "[ \t]*\\sw*") 604 "[ \t]*\\sw*")
605 "Regexp matching the end of a \"block\" of F90 code. 605 "Regexp matching the end of an F90 \"block\", from the line start.
606Used in the F90 entry in `hs-special-modes-alist'.") 606Used in the F90 entry in `hs-special-modes-alist'.")
607 607
608;; Ignore the fact that FUNCTION, SUBROUTINE, WHERE, FORALL have a 608;; Ignore the fact that FUNCTION, SUBROUTINE, WHERE, FORALL have a
609;; following "(". DO, CASE, IF can have labels; IF must be 609;; following "(". DO, CASE, IF can have labels.
610;; accompanied by THEN.
611;; A big problem is that many of these statements can be broken over
612;; lines, even with embedded comments. We only try to handle this for
613;; IF ... THEN statements, assuming and hoping it will be less common
614;; for other constructs. We match up to one new-line, provided ")
615;; THEN" appears on one line. Matching on just ") THEN" is no good,
616;; since that includes ELSE branches.
617;; For a fully accurate solution, hideshow would probably have to be
618;; modified to allow functions as well as regexps to be used to
619;; specify block start and end positions.
620(defconst f90-start-block-re 610(defconst f90-start-block-re
621 (concat 611 (concat
622 "^[ \t0-9]*" ; statement number 612 "^[ \t0-9]*" ; statement number
623 "\\(\\(" 613 "\\(\\("
624 "\\(\\sw+[ \t]*:[ \t]*\\)?" ; structure label 614 "\\(\\sw+[ \t]*:[ \t]*\\)?" ; structure label
625 "\\(do\\|select[ \t]*case\\|if[ \t]*(.*\n?.*)[ \t]*then\\|" 615 "\\(do\\|select[ \t]*case\\|"
616 ;; See comments in fortran-start-block-re for the problems of IF.
617 "if[ \t]*(\\(.*\\|"
618 ".*\n\\([^if]*\\([^i].\\|.[^f]\\|.\\>\\)\\)\\)\\<then\\|"
626 ;; Distinguish WHERE block from isolated WHERE. 619 ;; Distinguish WHERE block from isolated WHERE.
627 "\\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)\\)\\)" 620 "\\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)\\)\\)"
628 "\\|" 621 "\\|"
629 "program\\|interface\\|module\\|type\\|function\\|subroutine" 622 "program\\|interface\\|module\\|type\\|function\\|subroutine"
630 ;; ") THEN" at line end. Problem - also does ELSE.
631;;; "\\|.*)[ \t]*then[ \t]*\\($\\|!\\)"
632 "\\)" 623 "\\)"
633 "[ \t]*") 624 "[ \t]*")
634 "Regexp matching the start of a \"block\" of F90 code. 625 "Regexp matching the start of an F90 \"block\", from the line start.
635A simple regexp cannot do this in fully correct fashion, so this 626A simple regexp cannot do this in fully correct fashion, so this
636tries to strike a compromise between complexity and flexibility. 627tries to strike a compromise between complexity and flexibility.
637Used in the F90 entry in `hs-special-modes-alist'.") 628Used in the F90 entry in `hs-special-modes-alist'.")
@@ -1305,12 +1296,12 @@ Checks for consistency of block types and labels (if present).
1305Does not check the outermost block, because it may be incomplete. 1296Does not check the outermost block, because it may be incomplete.
1306Interactively, pushes mark before moving point." 1297Interactively, pushes mark before moving point."
1307 (interactive "p") 1298 (interactive "p")
1299 (if (interactive-p) (push-mark (point) t))
1308 (and num (< num 0) (f90-end-of-block (- num))) 1300 (and num (< num 0) (f90-end-of-block (- num)))
1309 (let ((case-fold-search t) 1301 (let ((case-fold-search t)
1310 (count (or num 1)) 1302 (count (or num 1))
1311 end-list end-this end-type end-label 1303 end-list end-this end-type end-label
1312 start-this start-type start-label) 1304 start-this start-type start-label)
1313 (if (interactive-p) (push-mark (point) t))
1314 (beginning-of-line) ; probably want this 1305 (beginning-of-line) ; probably want this
1315 (while (and (> count 0) (re-search-backward f90-blocks-re nil 'move)) 1306 (while (and (> count 0) (re-search-backward f90-blocks-re nil 'move))
1316 (beginning-of-line) 1307 (beginning-of-line)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 70150111a86..7067ddca21c 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -964,7 +964,7 @@ Convert it to flymake internal format."
964 (if (consp file) (setq file (car file))) 964 (if (consp file) (setq file (car file)))
965 (if (consp line) (setq line (car line))) 965 (if (consp line) (setq line (car line)))
966 (if (consp col) (setq col (car col))) 966 (if (consp col) (setq col (car col)))
967 967
968 (when (not (functionp line)) 968 (when (not (functionp line))
969 (setq converted-list (cons (list regexp file line col) converted-list))))) 969 (setq converted-list (cons (list regexp file line col) converted-list)))))
970 converted-list)) 970 converted-list))
@@ -1508,7 +1508,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1508 "Minor mode to do on-the-fly syntax checking. 1508 "Minor mode to do on-the-fly syntax checking.
1509When called interactively, toggles the minor mode. 1509When called interactively, toggles the minor mode.
1510With arg, turn Flymake mode on if and only if arg is positive." 1510With arg, turn Flymake mode on if and only if arg is positive."
1511 :lighter flymake-mode-line 1511 :group 'flymake :lighter flymake-mode-line
1512 (if flymake-mode 1512 (if flymake-mode
1513 (if (flymake-can-syntax-check-file (buffer-file-name)) 1513 (if (flymake-can-syntax-check-file (buffer-file-name))
1514 (flymake-mode-on) 1514 (flymake-mode-on)
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 768012c736c..30e1977d28d 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1,7 +1,7 @@
1;;; fortran.el --- Fortran mode for GNU Emacs 1;;; fortran.el --- Fortran mode for GNU Emacs
2 2
3;; Copyright (c) 1986, 93, 94, 95, 97, 98, 99, 2000, 01, 03, 04 3;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
4;; Free Software Foundation, Inc. 4;; 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Michael D. Prange <prange@erl.mit.edu> 6;; Author: Michael D. Prange <prange@erl.mit.edu>
7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk> 7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
@@ -95,7 +95,7 @@ with a character in column 6."
95 :group 'fortran-indent) 95 :group 'fortran-indent)
96 96
97(defcustom fortran-if-indent 3 97(defcustom fortran-if-indent 3
98 "*Extra indentation applied to IF blocks." 98 "*Extra indentation applied to IF, SELECT CASE and WHERE blocks."
99 :type 'integer 99 :type 'integer
100 :group 'fortran-indent) 100 :group 'fortran-indent)
101 101
@@ -321,7 +321,8 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?"
321 "while" "inquire" "stop" "return" 321 "while" "inquire" "stop" "return"
322 "include" "open" "close" "read" 322 "include" "open" "close" "read"
323 "write" "format" "print" "select" "case" 323 "write" "format" "print" "select" "case"
324 "cycle" "exit" "rewind" "backspace") 324 "cycle" "exit" "rewind" "backspace"
325 "where" "elsewhere")
325 'paren) "\\>") 326 'paren) "\\>")
326 ;; Builtin operators. 327 ;; Builtin operators.
327 (concat "\\." (regexp-opt 328 (concat "\\." (regexp-opt
@@ -370,6 +371,29 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?"
370 fortran-font-lock-keywords-2))) 371 fortran-font-lock-keywords-2)))
371 "Gaudy level highlighting for Fortran mode.") 372 "Gaudy level highlighting for Fortran mode.")
372 373
374(defvar fortran-font-lock-keywords-4
375 (append fortran-font-lock-keywords-3
376 (list (list
377 (concat "\\<"
378 (regexp-opt
379 '("int" "ifix" "idint" "real" "float" "sngl"
380 "dble" "cmplx" "ichar" "char" "aint" "dint"
381 "anint" "dnint" "nint" "idnint" "iabs" "abs"
382 "dabs" "cabs" "mod" "amod" "dmod" "isign"
383 "sign" "dsign" "idim" "dim" "ddim" "dprod"
384 "max" "max0" "amax1" "dmax1" "amax0" "max1"
385 "min0" "amin1" "dmin1" "amin0" "min1" "len"
386 "index" "lge" "lgt" "lle" "llt" "aimag"
387 "conjg" "sqrt" "dsqrt" "csqrt" "exp" "dexp"
388 "cexp" "log" "alog" "dlog" "clog" "log10"
389 "alog10" "dlog10" "sin" "dsin" "csin" "cos"
390 "dcos" "ccos" "tan" "dtan" "asin" "dasin"
391 "acos" "dacos" "atan" "datan" "atan2" "datan2"
392 "sinh" "dsinh" "cosh" "dcosh" "tanh" "dtanh")
393 'paren) "[ \t]*(") '(1 font-lock-builtin-face))))
394 "Maximum highlighting for Fortran mode.
395Consists of level 3 plus all other intrinsics not already highlighted.")
396
373;; Comments are real pain in Fortran because there is no way to 397;; Comments are real pain in Fortran because there is no way to
374;; represent the standard comment syntax in an Emacs syntax table. 398;; represent the standard comment syntax in an Emacs syntax table.
375;; (We can do so for F90-style). Therefore an unmatched quote in a 399;; (We can do so for F90-style). Therefore an unmatched quote in a
@@ -409,6 +433,64 @@ These get fixed-format comments fontified.")
409 "Value for `imenu-generic-expression' in Fortran mode.") 433 "Value for `imenu-generic-expression' in Fortran mode.")
410 434
411 435
436;; Hideshow support.
437(defconst fortran-blocks-re
438 (concat "block[ \t]*data\\|select[ \t]*case\\|"
439 (regexp-opt '("do" "if" "interface" "function" "map" "program"
440 "structure" "subroutine" "union" "where")))
441 "Regexp potentially indicating the start or end of a Fortran \"block\".
442Omits naked END statements, and DO-loops closed by anything other
443than ENDDO.")
444
445(defconst fortran-end-block-re
446 ;; Do-loops terminated by things other than ENDDO cannot be handled
447 ;; with a regexp. This omission does not seem to matter to hideshow...
448 (concat "^[ \t0-9]*\\<end[ \t]*\\("
449 fortran-blocks-re
450 ;; Naked END statement.
451 "\\|!\\|$\\)")
452 "Regexp matching the end of a Fortran \"block\", from the line start.
453Note that only ENDDO is handled for the end of a DO-loop. Used
454in the Fortran entry in `hs-special-modes-alist'.")
455
456(defconst fortran-start-block-re
457 (concat
458 "^[ \t0-9]*\\(" ; statement number
459 ;; Structure label for DO, IF, SELECT, WHERE.
460 "\\(\\(\\sw+[ \t]*:[ \t]*\\)?"
461 ;; IF blocks are a nuisance:
462 ;; IF ( ... ) foo is not a block, but a single statement.
463 ;; IF ( ... ) THEN can be split over multiple lines.
464 ;; [So can, eg, a DO WHILE (... ), but that is less common, I hope.]
465 ;; The regexp below allows for it to be split over at most 2 lines.
466 ;; That leads to the problem of not matching two consecutive IF
467 ;; statements as one, eg:
468 ;; IF ( ... ) foo
469 ;; IF ( ... ) THEN
470 ;; It simply is not possible to do this in a 100% correct fashion
471 ;; using a regexp - see the functions fortran-end-if,
472 ;; fortran-beginning-if for the hoops we have to go through.
473 ;; An alternative is to match on THEN at a line end, eg:
474 ;; ".*)[ \t]*then[ \t]*\\($\\|!\\)"
475 ;; This would also match ELSE branches, though. This does not seem
476 ;; right to me, because then one has neighbouring blocks that are
477 ;; not nested in each other.
478 "\\(if[ \t]*(\\(.*\\|"
479 ".*\n\\([^if]*\\([^i].\\|.[^f]\\|.\\>\\)\\)\\)\\<then\\|"
480 "do\\|select[ \t]*case\\|where\\)\\)\\|"
481 (regexp-opt '("interface" "function" "map" "program"
482 "structure" "subroutine" "union"))
483 "\\|block[ \t]*data\\)[ \t]*")
484 "Regexp matching the start of a Fortran \"block\", from the line start.
485A simple regexp cannot do this in fully correct fashion, so this
486tries to strike a compromise between complexity and flexibility.
487Used in the Fortran entry in `hs-special-modes-alist'.")
488
489(add-to-list 'hs-special-modes-alist
490 `(fortran-mode ,fortran-start-block-re ,fortran-end-block-re
491 "^[cC*!]" fortran-end-of-block nil))
492
493
412(defvar fortran-mode-syntax-table 494(defvar fortran-mode-syntax-table
413 (let ((table (make-syntax-table))) 495 (let ((table (make-syntax-table)))
414 ;; We might like `;' to be punctuation (g77 multi-statement 496 ;; We might like `;' to be punctuation (g77 multi-statement
@@ -422,7 +504,8 @@ These get fixed-format comments fontified.")
422 (modify-syntax-entry ?/ "." table) 504 (modify-syntax-entry ?/ "." table)
423 (modify-syntax-entry ?\' "\"" table) 505 (modify-syntax-entry ?\' "\"" table)
424 (modify-syntax-entry ?\" "\"" table) 506 (modify-syntax-entry ?\" "\"" table)
425 ;; Consistent with GNU Fortran -- see the manual. 507 ;; Consistent with GNU Fortran's default -- see the manual.
508 ;; The F77 standard imposes no rule on this issue.
426 (modify-syntax-entry ?\\ "\\" table) 509 (modify-syntax-entry ?\\ "\\" table)
427 ;; This might be better as punctuation, as for C, but this way you 510 ;; This might be better as punctuation, as for C, but this way you
428 ;; can treat floating-point numbers as symbols. 511 ;; can treat floating-point numbers as symbols.
@@ -446,6 +529,8 @@ These get fixed-format comments fontified.")
446 (define-key map "\C-c;" 'fortran-comment-region) 529 (define-key map "\C-c;" 'fortran-comment-region)
447 (define-key map "\M-;" 'fortran-indent-comment) 530 (define-key map "\M-;" 'fortran-indent-comment)
448 (define-key map "\M-\n" 'fortran-split-line) 531 (define-key map "\M-\n" 'fortran-split-line)
532 (define-key map "\M-\C-n" 'fortran-end-of-block)
533 (define-key map "\M-\C-p" 'fortran-beginning-of-block)
449 (define-key map "\M-\C-q" 'fortran-indent-subprogram) 534 (define-key map "\M-\C-q" 'fortran-indent-subprogram)
450 (define-key map "\C-c\C-w" 'fortran-window-create-momentarily) 535 (define-key map "\C-c\C-w" 'fortran-window-create-momentarily)
451 (define-key map "\C-c\C-r" 'fortran-column-ruler) 536 (define-key map "\C-c\C-r" 'fortran-column-ruler)
@@ -606,7 +691,7 @@ Key definitions:
606 691
607Variables controlling indentation style and extra features: 692Variables controlling indentation style and extra features:
608 693
609`comment-start' 694`fortran-comment-line-start'
610 To use comments starting with `!', set this to the string \"!\". 695 To use comments starting with `!', set this to the string \"!\".
611`fortran-do-indent' 696`fortran-do-indent'
612 Extra indentation within DO blocks (default 3). 697 Extra indentation within DO blocks (default 3).
@@ -696,7 +781,8 @@ with no args, if that value is non-nil."
696 '((fortran-font-lock-keywords 781 '((fortran-font-lock-keywords
697 fortran-font-lock-keywords-1 782 fortran-font-lock-keywords-1
698 fortran-font-lock-keywords-2 783 fortran-font-lock-keywords-2
699 fortran-font-lock-keywords-3) 784 fortran-font-lock-keywords-3
785 fortran-font-lock-keywords-4)
700 nil t ((?/ . "$/") ("_$" . "w")) 786 nil t ((?/ . "$/") ("_$" . "w"))
701 fortran-beginning-of-subprogram)) 787 fortran-beginning-of-subprogram))
702 (set (make-local-variable 'font-lock-syntactic-keywords) 788 (set (make-local-variable 'font-lock-syntactic-keywords)
@@ -1059,6 +1145,84 @@ Directive lines are treated as comments."
1059 (if (not not-last-statement) 1145 (if (not not-last-statement)
1060 'last-statement))) 1146 'last-statement)))
1061 1147
1148(defun fortran-looking-at-if-then ()
1149 "Return non-nil if at the start of a line with an IF ... THEN statement."
1150 ;; cf f90-looking-at-if-then.
1151 (let ((p (point))
1152 (i (fortran-beginning-if)))
1153 (if i
1154 (save-excursion
1155 (goto-char i)
1156 (beginning-of-line)
1157 (= (point) p)))))
1158
1159;; Used in hs-special-modes-alist.
1160(defun fortran-end-of-block (&optional num)
1161 "Move point forward to the end of the current code block.
1162With optional argument NUM, go forward that many balanced blocks.
1163If NUM is negative, go backward to the start of a block. Does
1164not check for consistency of block types. Interactively, pushes
1165mark before moving point."
1166 (interactive "p")
1167 (if (interactive-p) (push-mark (point) t))
1168 (and num (< num 0) (fortran-beginning-of-block (- num)))
1169 (let ((case-fold-search t)
1170 (count (or num 1)))
1171 (end-of-line)
1172 (while (and (> count 0)
1173 (re-search-forward
1174 (concat "\\(" fortran-blocks-re
1175 (if fortran-check-all-num-for-matching-do
1176 "\\|^[ \t]*[0-9]+" "")
1177 "\\|continue\\|end\\)\\>")
1178 nil 'move))
1179 (beginning-of-line)
1180 (if (if (looking-at (concat "^[0-9 \t]*" fortran-if-start-re))
1181 (fortran-looking-at-if-then)
1182 (looking-at fortran-start-block-re))
1183 (setq count (1+ count))
1184 (if (or (looking-at fortran-end-block-re)
1185 (and (or (looking-at "^[0-9 \t]*continue")
1186 (and fortran-check-all-num-for-matching-do
1187 (looking-at "[ \t]*[0-9]+")))
1188 (fortran-check-for-matching-do)))
1189 (setq count (1- count))))
1190 (end-of-line))
1191 (if (> count 0) (error "Missing block end"))))
1192
1193(defun fortran-beginning-of-block (&optional num)
1194 "Move point backwards to the start of the current code block.
1195With optional argument NUM, go backward that many balanced
1196blocks. If NUM is negative, go forward to the end of a block.
1197Does not check for consistency of block types. Interactively,
1198pushes mark before moving point."
1199 (interactive "p")
1200 (if (interactive-p) (push-mark (point) t))
1201 (and num (< num 0) (fortran-end-of-block (- num)))
1202 (let ((case-fold-search t)
1203 (count (or num 1)))
1204 (beginning-of-line)
1205 (while (and (> count 0)
1206 (re-search-backward
1207 (concat "\\(" fortran-blocks-re
1208 (if fortran-check-all-num-for-matching-do
1209 "\\|^[ \t]*[0-9]+" "")
1210 "\\|continue\\|end\\)\\>")
1211 nil 'move))
1212 (beginning-of-line)
1213 (if (if (looking-at (concat "^[0-9 \t]*" fortran-if-start-re))
1214 (fortran-looking-at-if-then)
1215 (looking-at fortran-start-block-re))
1216 (setq count (1- count))
1217 (if (or (looking-at fortran-end-block-re)
1218 (and (or (looking-at "^[0-9 \t]*continue")
1219 (and fortran-check-all-num-for-matching-do
1220 (looking-at "[ \t]*[0-9]+")))
1221 (fortran-check-for-matching-do)))
1222 (setq count (1+ count)))))
1223 ;; Includes an un-named main program block.
1224 (if (> count 0) (error "Missing block start"))))
1225
1062 1226
1063(defun fortran-blink-match (regex keyword find-begin) 1227(defun fortran-blink-match (regex keyword find-begin)
1064 "From a line matching REGEX, blink matching KEYWORD statement line. 1228 "From a line matching REGEX, blink matching KEYWORD statement line.
@@ -1679,8 +1843,9 @@ If ALL is nil, only match comments that start in column > 0."
1679 (1+ (point))))) 1843 (1+ (point)))))
1680 (if (re-search-forward "\\S\"\\s\"\\S\"" eol t) 1844 (if (re-search-forward "\\S\"\\s\"\\S\"" eol t)
1681 (backward-char 2)) 1845 (backward-char 2))
1682 ;; If the current string is longer than 72 - 6 chars, 1846 ;; If the current string is longer than (fill-column
1683 ;; break it at the fill column (else infinite loop). 1847 ;; - 6) chars, break it at the fill column (else
1848 ;; infinite loop).
1684 (if (> (- (point) start) 1849 (if (> (- (point) start)
1685 (- fill-column 6 fortran-continuation-indent)) 1850 (- fill-column 6 fortran-continuation-indent))
1686 fcpoint 1851 fcpoint
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index dea40b8db19..7aff14ec608 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -1,6 +1,6 @@
1;;; glasses.el --- make cantReadThis readable 1;;; glasses.el --- make cantReadThis readable
2 2
3;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Milan Zamazal <pdm@zamazal.org> 5;; Author: Milan Zamazal <pdm@zamazal.org>
6;; Maintainer: Milan Zamazal <pdm@zamazal.org> 6;; Maintainer: Milan Zamazal <pdm@zamazal.org>
@@ -251,7 +251,7 @@ recognized according to the current value of the variable `glasses-separator'."
251 "Minor mode for making identifiers likeThis readable. 251 "Minor mode for making identifiers likeThis readable.
252When this mode is active, it tries to add virtual separators (like underscores) 252When this mode is active, it tries to add virtual separators (like underscores)
253at places they belong to." 253at places they belong to."
254 nil " o^o" nil 254 :group 'glasses :lighter " o^o"
255 (save-excursion 255 (save-excursion
256 (save-restriction 256 (save-restriction
257 (widen) 257 (widen)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 0988599ed54..1f9284db9cb 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -531,6 +531,9 @@ off the specialized speedbar mode."
531 531
532(defvar gdb-first-prompt t) 532(defvar gdb-first-prompt t)
533 533
534(defvar gud-filter-pending-text nil
535 "Non-nil means this is text that has been saved for later in `gud-filter'.")
536
534;;;###autoload 537;;;###autoload
535(defun gdb (command-line) 538(defun gdb (command-line)
536 "Run gdb on program FILE in buffer *gud-FILE*. 539 "Run gdb on program FILE in buffer *gud-FILE*.
@@ -562,6 +565,7 @@ and source-file directory for your debugger."
562 (setq comint-prompt-regexp "^(.*gdb[+]?) *") 565 (setq comint-prompt-regexp "^(.*gdb[+]?) *")
563 (setq paragraph-start comint-prompt-regexp) 566 (setq paragraph-start comint-prompt-regexp)
564 (setq gdb-first-prompt t) 567 (setq gdb-first-prompt t)
568 (setq gud-filter-pending-text nil)
565 (run-hooks 'gdb-mode-hook)) 569 (run-hooks 'gdb-mode-hook))
566 570
567;; One of the nice features of GDB is its impressive support for 571;; One of the nice features of GDB is its impressive support for
@@ -2445,9 +2449,6 @@ comint mode, which see."
2445 "Non-nil means don't process anything from the debugger right now. 2449 "Non-nil means don't process anything from the debugger right now.
2446It is saved for when this flag is not set.") 2450It is saved for when this flag is not set.")
2447 2451
2448(defvar gud-filter-pending-text nil
2449 "Non-nil means this is text that has been saved for later in `gud-filter'.")
2450
2451;; These functions are responsible for inserting output from your debugger 2452;; These functions are responsible for inserting output from your debugger
2452;; into the buffer. The hard work is done by the method that is 2453;; into the buffer. The hard work is done by the method that is
2453;; the value of gud-marker-filter. 2454;; the value of gud-marker-filter.
@@ -2516,19 +2517,22 @@ It is saved for when this flag is not set.")
2516 (gud-filter proc "")))))) 2517 (gud-filter proc ""))))))
2517 2518
2518(defvar gud-minor-mode-type nil) 2519(defvar gud-minor-mode-type nil)
2520(defvar gud-overlay-arrow-position nil)
2521(put 'gud-overlay-arrow-position 'overlay-arrow-string "=>")
2522(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
2519 2523
2520(defun gud-sentinel (proc msg) 2524(defun gud-sentinel (proc msg)
2521 (cond ((null (buffer-name (process-buffer proc))) 2525 (cond ((null (buffer-name (process-buffer proc)))
2522 ;; buffer killed 2526 ;; buffer killed
2523 ;; Stop displaying an arrow in a source file. 2527 ;; Stop displaying an arrow in a source file.
2524 (setq overlay-arrow-position nil) 2528 (setq gud-overlay-arrow-position nil)
2525 (set-process-buffer proc nil) 2529 (set-process-buffer proc nil)
2526 (if (memq gud-minor-mode-type '(gdbmi gdba)) 2530 (if (memq gud-minor-mode-type '(gdbmi gdba))
2527 (gdb-reset) 2531 (gdb-reset)
2528 (gud-reset))) 2532 (gud-reset)))
2529 ((memq (process-status proc) '(signal exit)) 2533 ((memq (process-status proc) '(signal exit))
2530 ;; Stop displaying an arrow in a source file. 2534 ;; Stop displaying an arrow in a source file.
2531 (setq overlay-arrow-position nil) 2535 (setq gud-overlay-arrow-position nil)
2532 (with-current-buffer gud-comint-buffer 2536 (with-current-buffer gud-comint-buffer
2533 (if (memq gud-minor-mode-type '(gdbmi gdba)) 2537 (if (memq gud-minor-mode-type '(gdbmi gdba))
2534 (gdb-reset) 2538 (gdb-reset)
@@ -2611,13 +2615,13 @@ Obeying it means displaying in another window the specified file and line."
2611 (goto-line line) 2615 (goto-line line)
2612 (setq pos (point)) 2616 (setq pos (point))
2613 (setq overlay-arrow-string "=>") 2617 (setq overlay-arrow-string "=>")
2614 (or overlay-arrow-position 2618 (or gud-overlay-arrow-position
2615 (setq overlay-arrow-position (make-marker))) 2619 (setq gud-overlay-arrow-position (make-marker)))
2616 (set-marker overlay-arrow-position (point) (current-buffer))) 2620 (set-marker gud-overlay-arrow-position (point) (current-buffer)))
2617 (cond ((or (< pos (point-min)) (> pos (point-max))) 2621 (cond ((or (< pos (point-min)) (> pos (point-max)))
2618 (widen) 2622 (widen)
2619 (goto-char pos)))) 2623 (goto-char pos))))
2620 (if window (set-window-point window overlay-arrow-position)))))) 2624 (if window (set-window-point window gud-overlay-arrow-position))))))
2621 2625
2622;; The gud-call function must do the right thing whether its invoking 2626;; The gud-call function must do the right thing whether its invoking
2623;; keystroke is from the GUD buffer itself (via major-mode binding) 2627;; keystroke is from the GUD buffer itself (via major-mode binding)
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index da6b6f772b6..23031c5bcda 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -1,6 +1,6 @@
1;;; hideif.el --- hides selected code within ifdef 1;;; hideif.el --- hides selected code within ifdef
2 2
3;; Copyright (C) 1988,1994,2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1988, 1994, 2001, 2002, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Daniel LaLiberte <liberte@holonexus.org> 5;; Author: Daniel LaLiberte <liberte@holonexus.org>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -197,7 +197,7 @@ how the hiding is done:
197 After `show-ifdefs', read-only status is restored to previous value. 197 After `show-ifdefs', read-only status is restored to previous value.
198 198
199\\{hide-ifdef-mode-map}" 199\\{hide-ifdef-mode-map}"
200 nil " Ifdef" nil 200 :group 'hide-ifdef :lighter " Ifdef"
201 (if hide-ifdef-mode 201 (if hide-ifdef-mode
202 (progn 202 (progn
203 ;; inherit global values 203 ;; inherit global values
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 20af0aaf96e..5073f2bc23a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1098,28 +1098,40 @@ Don't save anything for STR matching `inferior-python-filter-regexp'."
1098(defvar python-preoutput-continuation nil 1098(defvar python-preoutput-continuation nil
1099 "If non-nil, funcall this when `python-preoutput-filter' sees `_emacs_ok'.") 1099 "If non-nil, funcall this when `python-preoutput-filter' sees `_emacs_ok'.")
1100 1100
1101(defvar python-preoutput-leftover nil)
1102
1101;; Using this stops us getting lines in the buffer like 1103;; Using this stops us getting lines in the buffer like
1102;; >>> ... ... >>> 1104;; >>> ... ... >>>
1103;; Also look for (and delete) an `_emacs_ok' string and call 1105;; Also look for (and delete) an `_emacs_ok' string and call
1104;; `python-preoutput-continuation' if we get it. 1106;; `python-preoutput-continuation' if we get it.
1105(defun python-preoutput-filter (s) 1107(defun python-preoutput-filter (s)
1106 "`comint-preoutput-filter-functions' function: ignore prompts not at bol." 1108 "`comint-preoutput-filter-functions' function: ignore prompts not at bol."
1109 (when python-preoutput-leftover
1110 (setq s (concat python-preoutput-leftover s))
1111 (setq python-preoutput-leftover nil))
1107 (cond ((and (string-match (rx (and string-start (repeat 3 (any ".>")) 1112 (cond ((and (string-match (rx (and string-start (repeat 3 (any ".>"))
1108 " " string-end)) 1113 " " string-end))
1109 s) 1114 s)
1110 (/= (let ((inhibit-field-text-motion t)) 1115 (/= (let ((inhibit-field-text-motion t))
1111 (line-beginning-position)) 1116 (line-beginning-position))
1112 (point))) 1117 (point)))
1113 "") 1118 "")
1114 ((string= s "_emacs_ok\n") 1119 ((string= s "_emacs_ok\n")
1115 (when python-preoutput-continuation 1120 (when python-preoutput-continuation
1116 (funcall python-preoutput-continuation) 1121 (funcall python-preoutput-continuation)
1117 (setq python-preoutput-continuation nil)) 1122 (setq python-preoutput-continuation nil))
1118 "") 1123 "")
1119 ((string-match "_emacs_out \\(.*\\)\n" s) 1124 ((string-match "_emacs_out \\(.*\\)\n" s)
1120 (setq python-preoutput-result (match-string 1 s)) 1125 (setq python-preoutput-result (match-string 1 s))
1126 "")
1127 ((string-match ".*\n" s)
1128 s)
1129 ((or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s)))
1130 (let ((end (min (length "_emacs_out ") (length s))))
1131 (eq t (compare-strings s nil end "_emacs_out " nil end))))
1132 (setq python-preoutput-leftover s)
1121 "") 1133 "")
1122 (t s))) 1134 (t s)))
1123 1135
1124;;;###autoload 1136;;;###autoload
1125(defun run-python (&optional cmd noshow) 1137(defun run-python (&optional cmd noshow)
@@ -1359,7 +1371,9 @@ The result is what follows `_emacs_out' in the output (or nil)."
1359 (let ((proc (python-proc))) 1371 (let ((proc (python-proc)))
1360 (python-send-string string) 1372 (python-send-string string)
1361 (setq python-preoutput-result nil) 1373 (setq python-preoutput-result nil)
1362 (accept-process-output proc 5) 1374 (while (progn
1375 (accept-process-output proc 5)
1376 python-preoutput-leftover))
1363 python-preoutput-result)) 1377 python-preoutput-result))
1364 1378
1365;; Fixme: try to make it work with point in the arglist. Also, is 1379;; Fixme: try to make it work with point in the arglist. Also, is
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index d9ffea852d1..c792b59ad87 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -90,7 +90,7 @@
90 (modify-syntax-entry ?\] ")[ " st) 90 (modify-syntax-entry ?\] ")[ " st)
91 (modify-syntax-entry ?{ "(} " st) 91 (modify-syntax-entry ?{ "(} " st)
92 (modify-syntax-entry ?} "){ " st) 92 (modify-syntax-entry ?} "){ " st)
93 (modify-syntax-entry ?\| " 23" st) 93 (modify-syntax-entry ?\| "\" 23b" st)
94 94
95 ;; Other atom delimiters 95 ;; Other atom delimiters
96 (modify-syntax-entry ?\( "() " st) 96 (modify-syntax-entry ?\( "() " st)
@@ -103,7 +103,7 @@
103 ;; Special characters 103 ;; Special characters
104 (modify-syntax-entry ?, "' " st) 104 (modify-syntax-entry ?, "' " st)
105 (modify-syntax-entry ?@ "' " st) 105 (modify-syntax-entry ?@ "' " st)
106 (modify-syntax-entry ?# "' 14" st) 106 (modify-syntax-entry ?# "' 14bn" st)
107 (modify-syntax-entry ?\\ "\\ " st) 107 (modify-syntax-entry ?\\ "\\ " st)
108 st)) 108 st))
109 109
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index 4dba6b61a56..24ae19b0ad4 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -1,6 +1,7 @@
1;;; tcl.el --- Tcl code editing commands for Emacs 1;;; tcl.el --- Tcl code editing commands for Emacs
2 2
3;; Copyright (C) 1994,98,1999,2000,01,02,2003,2004 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Maintainer: FSF 6;; Maintainer: FSF
6;; Author: Tom Tromey <tromey@redhat.com> 7;; Author: Tom Tromey <tromey@redhat.com>
@@ -469,10 +470,7 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'."
469 ;; Keywords. Only recognized if surrounded by whitespace. 470 ;; Keywords. Only recognized if surrounded by whitespace.
470 ;; FIXME consider using "not word or symbol", not 471 ;; FIXME consider using "not word or symbol", not
471 ;; "whitespace". 472 ;; "whitespace".
472 (cons (concat "\\(\\s-\\|^\\)" 473 (cons (concat "\\_<" (regexp-opt tcl-keyword-list t) "\\_>")
473 ;; FIXME Use regexp-quote?
474 (regexp-opt tcl-keyword-list t)
475 "\\(\\s-\\|$\\)")
476 2)))) 474 2))))
477 475
478(if tcl-proc-regexp 476(if tcl-proc-regexp
@@ -1507,5 +1505,5 @@ The first line is assumed to look like \"#!.../program ...\"."
1507 1505
1508(provide 'tcl) 1506(provide 'tcl)
1509 1507
1510;;; arch-tag: 8a032554-c3ef-422e-b84c-acec0522179d 1508;; arch-tag: 8a032554-c3ef-422e-b84c-acec0522179d
1511;;; tcl.el ends here 1509;;; tcl.el ends here
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index dae5722d430..d329e234025 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -1,6 +1,7 @@
1;;; which-func.el --- print current function in mode line 1;;; which-func.el --- print current function in mode line
2 2
3;; Copyright (C) 1994, 1997, 1998, 2001, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1997, 1998, 2001, 2003, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Alex Rezinsky <alexr@msil.sps.mot.com> 6;; Author: Alex Rezinsky <alexr@msil.sps.mot.com>
6;; (doesn't seem to be responsive any more) 7;; (doesn't seem to be responsive any more)
@@ -251,7 +252,7 @@ If no function name is found, return nil."
251 (when (and (null name) 252 (when (and (null name)
252 (boundp 'imenu--index-alist) (null imenu--index-alist) 253 (boundp 'imenu--index-alist) (null imenu--index-alist)
253 (null which-function-imenu-failed)) 254 (null which-function-imenu-failed))
254 (imenu--make-index-alist) 255 (imenu--make-index-alist t)
255 (unless imenu--index-alist 256 (unless imenu--index-alist
256 (make-local-variable 'which-function-imenu-failed) 257 (make-local-variable 'which-function-imenu-failed)
257 (setq which-function-imenu-failed t))) 258 (setq which-function-imenu-failed t)))
@@ -291,5 +292,5 @@ If no function name is found, return nil."
291 292
292(provide 'which-func) 293(provide 'which-func)
293 294
294;;; arch-tag: fa8a55c7-bfe3-4ffc-95ab-01bf21796827 295;; arch-tag: fa8a55c7-bfe3-4ffc-95ab-01bf21796827
295;;; which-func.el ends here 296;;; which-func.el ends here