summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2004-05-18 19:12:15 +0000
committerKaroly Lorentey <lorentey@elte.hu>2004-05-18 19:12:15 +0000
commitc23670f81e059ebe645c88575f4ddfa67f26bf6b (patch)
tree71667a6ceaa877ccf3953abedfa7b0fd5f0f5369 /lisp/progmodes
parentd9858e4f1889a61b216ae1f99053846362067ccc (diff)
parenta7f7f2540f02834ad128d0c9357a4dbd8222dff4 (diff)
downloademacs-c23670f81e059ebe645c88575f4ddfa67f26bf6b.tar.gz
emacs-c23670f81e059ebe645c88575f4ddfa67f26bf6b.tar.bz2
emacs-c23670f81e059ebe645c88575f4ddfa67f26bf6b.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-301 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-302 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-303 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-304 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-305 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-306 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-307 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-308 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-309 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-310 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-311 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-312 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-313 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-314 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-315 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-316 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-317 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-318 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-319 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-320 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-321 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-322 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-323 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-324 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-163
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/compile.el44
-rw-r--r--lisp/progmodes/f90.el49
-rw-r--r--lisp/progmodes/gdb-ui.el1
-rw-r--r--lisp/progmodes/gud.el11
-rw-r--r--lisp/progmodes/python.el19
5 files changed, 92 insertions, 32 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index ec381ad8a15..da43b7b7098 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -171,8 +171,15 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
"^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\
\\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 3 (4))
+ (edg-1
+ "^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)"
+ 1 2 nil (3 . 4))
+ (edg-2
+ "at line \\([0-9]+\\) of \"\\([^ \n]+\\)\"$"
+ 2 1 nil 0)
+
(epc
- "^Error [0-9]+ at (\\([0-9]*\\):\\([^)\n]+\\))" 2 1)
+ "^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1)
(iar
"^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:"
@@ -265,10 +272,6 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
(sun-ada
"^\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
- ;; Redundant with `mips'
-;; (ultrix
-;; "^\\(?:cfe\\|fort\\): \\(Warning\\)?[^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3 nil (1))
-
(4bsd
"\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
\\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3)))
@@ -445,17 +448,19 @@ starting the compilation process.")
(defvar compile-history nil)
(defface compilation-warning-face
- '((((type tty) (class color)) (:foreground "cyan" :weight bold))
- (((class color)) (:foreground "Orange" :weight bold))
+ '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold))
+ (((class color)) (:foreground "cyan" :weight bold))
(t (:weight bold)))
"Face used to highlight compiler warnings."
:group 'font-lock-highlighting-faces
:version "21.4")
(defface compilation-info-face
- '((((type tty) (class color)) (:foreground "green" :weight bold))
- (((class color) (background light)) (:foreground "Green3" :weight bold))
- (((class color) (background dark)) (:foreground "Green" :weight bold))
+ '((((class color) (min-colors 16) (background light))
+ (:foreground "Green3" :weight bold))
+ (((class color) (min-colors 16) (background dark))
+ (:foreground "Green" :weight bold))
+ (((class color)) (:foreground "green" :weight bold))
(t (:weight bold)))
"Face used to highlight compiler warnings."
:group 'font-lock-highlighting-faces
@@ -749,6 +754,8 @@ and move to the source code that caused it.
Interactively, prompts for the command if `compilation-read-command' is
non-nil; otherwise uses `compile-command'. With prefix arg, always prompts.
+Additionally, with universal prefix arg, compilation buffer will be in
+comint mode, i.e. interactive.
To run more than one compilation at once, start one and rename
the \`*compilation*' buffer to some other name with
@@ -760,11 +767,13 @@ The name used for the buffer is actually whatever is returned by
the function in `compilation-buffer-name-function', so you can set that
to a function that generates a unique name."
(interactive
- (if (or compilation-read-command current-prefix-arg)
- (list (read-from-minibuffer "Compile command: "
- (eval compile-command) nil nil
- '(compile-history . 1)))
- (list (eval compile-command))))
+ (list
+ (if (or compilation-read-command current-prefix-arg)
+ (read-from-minibuffer "Compile command: "
+ (eval compile-command) nil nil
+ '(compile-history . 1))
+ (eval compile-command))
+ (consp current-prefix-arg)))
(unless (equal command (eval compile-command))
(setq compile-command command))
(save-some-buffers (not compilation-ask-about-save) nil)
@@ -983,8 +992,9 @@ exited abnormally with code %d\n"
;; buffer, which might not be the same as the selected window's buffer.
(save-current-buffer
(save-selected-window
- (select-window window)
- (enlarge-window (- height (window-height))))))))
+ (save-excursion
+ (select-window window)
+ (enlarge-window (- height (window-height)))))))))
(defvar compilation-menu-map
(let ((map (make-sparse-keymap "Errors")))
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index aada9be16dc..53165fbecb7 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -153,7 +153,7 @@
;;; Code:
;; TODO
-;; Support for hideshow, align.
+;; Support for align.
;; OpenMP, preprocessor highlighting.
(defvar comment-auto-fill-only-comments)
@@ -589,6 +589,53 @@ characters long.")
(make-variable-buffer-local 'f90-cache-position)
+;; Hideshow support.
+(defconst f90-end-block-re
+ (concat "^[ \t0-9]*\\<end\\>[ \t]*"
+ (regexp-opt '("do" "if" "forall" "function" "interface"
+ "module" "program" "select" "subroutine"
+ "type" "where" ) t)
+ "[ \t]*\\sw*")
+ "Regexp matching the end of a \"block\" of F90 code.
+Used in the F90 entry in `hs-special-modes-alist'.")
+
+;; Ignore the fact that FUNCTION, SUBROUTINE, WHERE, FORALL have a
+;; following "(". DO, CASE, IF can have labels; IF must be
+;; accompanied by THEN.
+;; A big problem is that many of these statements can be broken over
+;; lines, even with embedded comments. We only try to handle this for
+;; IF ... THEN statements, assuming and hoping it will be less common
+;; for other constructs. We match up to one new-line, provided ")
+;; THEN" appears on one line. Matching on just ") THEN" is no good,
+;; since that includes ELSE branches.
+;; For a fully accurate solution, hideshow would probably have to be
+;; modified to allow functions as well as regexps to be used to
+;; specify block start and end positions.
+(defconst f90-start-block-re
+ (concat
+ "^[ \t0-9]*" ; statement number
+ "\\(\\("
+ "\\(\\sw+[ \t]*:[ \t]*\\)?" ; structure label
+ "\\(do\\|select[ \t]*case\\|if[ \t]*(.*\n?.*)[ \t]*then\\|"
+ ;; Distinguish WHERE block from isolated WHERE.
+ "\\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)\\)\\)"
+ "\\|"
+ "program\\|interface\\|module\\|type\\|function\\|subroutine"
+ ;; ") THEN" at line end. Problem - also does ELSE.
+;;; "\\|.*)[ \t]*then[ \t]*\\($\\|!\\)"
+ "\\)"
+ "[ \t]*")
+ "Regexp matching the start of a \"block\" of F90 code.
+A simple regexp cannot do this in fully correct fashion, so this
+tries to strike a compromise between complexity and flexibility.
+Used in the F90 entry in `hs-special-modes-alist'.")
+
+;; hs-special-modes-alist is autoloaded.
+(add-to-list 'hs-special-modes-alist
+ `(f90-mode ,f90-start-block-re ,f90-end-block-re
+ "!" f90-end-of-block nil))
+
+
;; Imenu support.
(defvar f90-imenu-generic-expression
(let ((good-char "[^!\"\&\n \t]") (not-e "[^e!\n\"\& \t]")
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index fc3196cdb4f..19c57979130 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -664,6 +664,7 @@ This filter may simply queue output for a later time."
("commands" gdb-subprompt)
("overload-choice" gdb-subprompt)
("query" gdb-subprompt)
+ ("nquery" gdb-subprompt)
("prompt-for-continue" gdb-subprompt)
("post-prompt" gdb-post-prompt)
("source" gdb-source)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 035b5da875a..84dec78d895 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2339,7 +2339,8 @@ comint mode, which see."
;; Don't put repeated commands in command history many times.
(set (make-local-variable 'comint-input-ignoredups) t)
(make-local-variable 'paragraph-start)
- (set (make-local-variable 'gud-delete-prompt-marker) (make-marker)))
+ (set (make-local-variable 'gud-delete-prompt-marker) (make-marker))
+ (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook nil t))
;; Cause our buffers to be displayed, by default,
;; in the selected window.
@@ -2546,10 +2547,10 @@ It is saved for when this flag is not set.")
(set-buffer obuf))))))
(defun gud-kill-buffer-hook ()
- (if gud-minor-mode
- (setq gud-minor-mode-type gud-minor-mode)))
-
-(add-hook 'kill-buffer-hook 'gud-kill-buffer-hook)
+ (setq gud-minor-mode-type gud-minor-mode)
+ (condition-case nil
+ (kill-process (get-buffer-process gud-comint-buffer))
+ (error nil)))
(defun gud-reset ()
(dolist (buffer (buffer-list))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 214b6f0e24c..cee59a6e3e1 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -297,10 +297,9 @@ comments and strings, or that the bracket/paren nesting depth is nonzero."
(syntax-ppss (line-beginning-position)))))))
(defun python-comment-line-p ()
- "Return non-nil if current line has only a comment or is blank."
+ "Return non-nil iff current line has only a comment."
(save-excursion
(end-of-line)
- ;; FIXME: This looks wrong because it returns nil for empty lines. --Stef
(when (eq 'comment (syntax-ppss-context (syntax-ppss)))
(back-to-indentation)
(looking-at (rx (or (syntax comment-start) line-end))))))
@@ -1025,7 +1024,6 @@ et al.")
(let ((map (make-sparse-keymap)))
;; This will inherit from comint-mode-map.
(define-key map "\C-c\C-l" 'python-load-file)
- (define-key map "\C-c\C-z" 'python-switch-to-python) ;What for? --Stef
(define-key map "\C-c\C-v" 'python-check)
;; Note that we _can_ still use these commands which send to the
;; Python process even at the prompt iff we have a normal prompt,
@@ -1140,10 +1138,12 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook'
;; (not a name) in Python buffers from which `run-python' &c is
;; invoked. Would support multiple processes better.
(unless (comint-check-proc python-buffer)
- (let ((cmdlist (append (python-args-to-list cmd) '("-i")))
- (process-environment ; to import emacs.py
- (push (concat "PYTHONPATH=" data-directory)
- process-environment)))
+ (let* ((cmdlist (append (python-args-to-list cmd) '("-i")))
+ (path (getenv "PYTHONPATH"))
+ (process-environment ; to import emacs.py
+ (push (concat "PYTHONPATH=" data-directory
+ (if path (concat ":" path)))
+ process-environment)))
(set-buffer (apply 'make-comint "Python" (car cmdlist) nil
(cdr cmdlist)))
(setq python-buffer "*Python*"))
@@ -1278,7 +1278,6 @@ module-qualified names."
;; Fixme: I'm not convinced by this logic from python-mode.el.
(python-send-command
(if (string-match "\\.py\\'" file-name)
- ;; Fixme: make sure the directory is in the path list
(let ((module (file-name-sans-extension
(file-name-nondirectory file-name))))
(format "emacs.eimport(%S,%S)"
@@ -1309,6 +1308,7 @@ See variable `python-buffer'. Starts a new process if necessary."
Otherwise inherits from `python-mode-syntax-table'.")
(defvar view-return-to-alist)
+(eval-when-compile (autoload 'help-buffer "help-fns"))
;; Fixme: Should this actually be used instead of info-look, i.e. be
;; bound to C-h S? Can we use other pydoc stuff before python 2.2?
@@ -1394,7 +1394,8 @@ Used with `eval-after-load'."
;; Don't use `info' because it would pop-up a *info* buffer.
(with-no-warnings
(Info-goto-node (format "(python%s-lib)Miscellaneous Index"
- version)))
+ version))
+ t)
(error nil)))))
(info-lookup-maybe-add-help
:mode 'python-mode