diff options
author | Miles Bader <miles@gnu.org> | 2007-10-15 05:03:21 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-10-15 05:03:21 +0000 |
commit | 63655c83146b773b4ef3d9220b4a9d61545fd050 (patch) | |
tree | 2161d262bba2c99b0db2ed8b322eddcafeadd247 /lisp/progmodes | |
parent | ce8f7ca45fabe11ce32a9ced2b8e7c1987c0d997 (diff) | |
parent | b2529d56b5126319a1659dc1530d6fc102cc21d6 (diff) | |
download | emacs-63655c83146b773b4ef3d9220b4a9d61545fd050.tar.gz |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 887-889)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 116-121)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-268
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/ebrowse.el | 1 | ||||
-rw-r--r-- | lisp/progmodes/etags.el | 3 | ||||
-rw-r--r-- | lisp/progmodes/gdb-ui.el | 120 | ||||
-rw-r--r-- | lisp/progmodes/idlwave.el | 12 | ||||
-rw-r--r-- | lisp/progmodes/octave-mod.el | 41 |
5 files changed, 102 insertions, 75 deletions
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 9264bb42ba2..5acbe70a074 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -1139,6 +1139,7 @@ Tree mode key bindings: (kill-all-local-variables) (use-local-map ebrowse-tree-mode-map) + (buffer-disable-undo) (unless (zerop (buffer-size)) (goto-char (point-min)) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 96af63849a4..4148f327ecc 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1904,7 +1904,8 @@ The list of tags tables to select from is stored in `tags-table-set-list'; see the doc of that variable if you want to add names to the list." (interactive) (pop-to-buffer "*Tags Table List*") - (setq buffer-read-only nil) + (setq buffer-read-only nil + buffer-undo-list t) (erase-buffer) (let ((set-list tags-table-set-list) (desired-point nil) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 89211732e44..c6ae98c5b12 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -2120,62 +2120,72 @@ static char *magick[] = { (defun gdb-info-stack-custom () (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer) - (save-excursion - (unless (eq gdb-look-up-stack 'delete) - (let ((buffer-read-only nil) - bl el) - (goto-char (point-min)) - (while (< (point) (point-max)) - (setq bl (line-beginning-position) - el (line-end-position)) - (when (looking-at "#") - (add-text-properties bl el - '(mouse-face highlight - help-echo "mouse-2, RET: Select frame"))) - (goto-char bl) - (when (looking-at "^#\\([0-9]+\\)") - (when (string-equal (match-string 1) gdb-frame-number) - (if (> (car (window-fringes)) 0) - (progn - (or gdb-stack-position - (setq gdb-stack-position (make-marker))) - (set-marker gdb-stack-position (point))) - (put-text-property bl (+ bl 4) - 'face '(:inverse-video t)))) - (when (re-search-forward - (concat - (if (string-equal (match-string 1) "0") "" " in ") - "\\([^ ]+\\) (") el t) - (put-text-property (match-beginning 1) (match-end 1) - 'face font-lock-function-name-face) - (setq bl (match-end 0)) - (while (re-search-forward "<\\([^>]+\\)>" el t) - (put-text-property (match-beginning 1) (match-end 1) - 'face font-lock-function-name-face)) - (goto-char bl) - (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t) - (put-text-property (match-beginning 1) (match-end 1) - 'face font-lock-variable-name-face)))) - (forward-line 1)) - (forward-line -1) - (when (looking-at "(More stack frames follow...)") - (add-text-properties (match-beginning 0) (match-end 0) - '(mouse-face highlight - gdb-max-frames t - help-echo - "mouse-2, RET: customize gdb-max-frames to see more frames"))))) - (when gdb-look-up-stack + (let (move-to) + (save-excursion + (unless (eq gdb-look-up-stack 'delete) + (let ((buffer-read-only nil) + bl el) (goto-char (point-min)) - (when (re-search-forward "\\(\\S-+?\\):\\([0-9]+\\)" nil t) - (let ((start (line-beginning-position)) - (file (match-string 1)) - (line (match-string 2))) - (re-search-backward "^#*\\([0-9]+\\)" start t) - (gdb-enqueue-input - (list (concat gdb-server-prefix "frame " - (match-string 1) "\n") 'gdb-set-hollow)) - (gdb-enqueue-input - (list (concat gdb-server-prefix "frame 0\n") 'ignore))))))) + (while (< (point) (point-max)) + (setq bl (line-beginning-position) + el (line-end-position)) + (when (looking-at "#") + (add-text-properties bl el + '(mouse-face highlight + help-echo "mouse-2, RET: Select frame"))) + (goto-char bl) + (when (looking-at "^#\\([0-9]+\\)") + (when (string-equal (match-string 1) gdb-frame-number) + (if (> (car (window-fringes)) 0) + (progn + (or gdb-stack-position + (setq gdb-stack-position (make-marker))) + (set-marker gdb-stack-position (point)) + (setq move-to gdb-stack-position)) + (put-text-property bl (+ bl 4) + 'face '(:inverse-video t)) + (setq move-to bl))) + (when (re-search-forward + (concat + (if (string-equal (match-string 1) "0") "" " in ") + "\\([^ ]+\\) (") el t) + (put-text-property (match-beginning 1) (match-end 1) + 'face font-lock-function-name-face) + (setq bl (match-end 0)) + (while (re-search-forward "<\\([^>]+\\)>" el t) + (put-text-property (match-beginning 1) (match-end 1) + 'face font-lock-function-name-face)) + (goto-char bl) + (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t) + (put-text-property (match-beginning 1) (match-end 1) + 'face font-lock-variable-name-face)))) + (forward-line 1)) + (forward-line -1) + (when (looking-at "(More stack frames follow...)") + (add-text-properties (match-beginning 0) (match-end 0) + '(mouse-face highlight + gdb-max-frames t + help-echo + "mouse-2, RET: customize gdb-max-frames to see more frames"))))) + (when gdb-look-up-stack + (goto-char (point-min)) + (when (re-search-forward "\\(\\S-+?\\):\\([0-9]+\\)" nil t) + (let ((start (line-beginning-position)) + (file (match-string 1)) + (line (match-string 2))) + (re-search-backward "^#*\\([0-9]+\\)" start t) + (gdb-enqueue-input + (list (concat gdb-server-prefix "frame " + (match-string 1) "\n") 'gdb-set-hollow)) + (gdb-enqueue-input + (list (concat gdb-server-prefix "frame 0\n") 'ignore)))))) + (when move-to + (let ((window (get-buffer-window (current-buffer) 0))) + (when window + (with-selected-window window + (goto-char move-to) + (unless (pos-visible-in-window-p) + (recenter '(center))))))))) (if (eq gdb-look-up-stack 'delete) (kill-buffer (gdb-get-buffer 'gdb-stack-buffer))) (setq gdb-look-up-stack nil)) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 646f6a80d8e..abe5cfe6489 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -6785,12 +6785,12 @@ accumulate information on matching completions." (message "Making completion list...") (unless idlwave-completion-help-links ; already set somewhere? - (mapcar (lambda (x) ; Pass link prop through to highlight-linked - (let ((link (get-text-property 0 'link (car x)))) - (if link - (push (cons (car x) link) - idlwave-completion-help-links)))) - list)) + (mapc (lambda (x) ; Pass link prop through to highlight-linked + (let ((link (get-text-property 0 'link (car x)))) + (if link + (push (cons (car x) link) + idlwave-completion-help-links)))) + list)) (let* ((list all-completions) ;; "complete" means, this is already a valid completion (complete (memq spart all-completions)) diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 4630fe1856d..b7084950a09 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -581,13 +581,28 @@ to end after the end keyword." (error nil)) (< pos (point))))) +(defun octave-looking-at-kw (regexp) + "Like `looking-at', but sets `case-fold-search' nil." + (let ((case-fold-search nil)) + (looking-at regexp))) + +(defun octave-re-search-forward-kw (regexp count) + "Like `re-search-forward', but sets `case-fold-search' nil, and moves point." + (let ((case-fold-search nil)) + (re-search-forward regexp nil 'move count))) + +(defun octave-re-search-backward-kw (regexp count) + "Like `re-search-backward', but sets `case-fold-search' nil, and moves point." + (let ((case-fold-search nil)) + (re-search-backward regexp nil 'move count))) + (defun octave-in-defun-p () "Return t if point is inside an Octave function declaration. The function is taken to start at the `f' of `function' and to end after the end keyword." (let ((pos (point))) (save-excursion - (or (and (looking-at "\\<function\\>") + (or (and (octave-looking-at-kw "\\<function\\>") (octave-not-in-string-or-comment-p)) (and (octave-beginning-of-defun) (condition-case nil @@ -658,14 +673,14 @@ level." (while (< (point) eol) (if (octave-not-in-string-or-comment-p) (cond - ((looking-at "\\<switch\\>") + ((octave-looking-at-kw "\\<switch\\>") (setq icol (+ icol (* 2 octave-block-offset)))) - ((looking-at octave-block-begin-regexp) + ((octave-looking-at-kw octave-block-begin-regexp) (setq icol (+ icol octave-block-offset))) - ((looking-at octave-block-else-regexp) + ((octave-looking-at-kw octave-block-else-regexp) (if (= bot (point)) (setq icol (+ icol octave-block-offset)))) - ((looking-at octave-block-end-regexp) + ((octave-looking-at-kw octave-block-end-regexp) (if (not (= bot (point))) (setq icol (- icol (octave-block-end-offset))))))) @@ -675,10 +690,10 @@ level." (save-excursion (back-to-indentation) (cond - ((and (looking-at octave-block-else-regexp) + ((and (octave-looking-at-kw octave-block-else-regexp) (octave-not-in-string-or-comment-p)) (setq icol (- icol octave-block-offset))) - ((and (looking-at octave-block-end-regexp) + ((and (octave-looking-at-kw octave-block-end-regexp) (octave-not-in-string-or-comment-p)) (setq icol (- icol (octave-block-end-offset)))) ((or (looking-at "\\s<\\s<\\s<\\S<") @@ -854,8 +869,8 @@ an error is signaled." (save-excursion (while (/= count 0) (catch 'foo - (while (or (re-search-forward - octave-block-begin-or-end-regexp nil 'move inc) + (while (or (octave-re-search-forward-kw + octave-block-begin-or-end-regexp inc) (if (/= depth 0) (error "Unbalanced block"))) (if (octave-not-in-string-or-comment-p) @@ -974,7 +989,7 @@ Signal an error if the keywords are incompatible." (looking-at "\\>") (save-excursion (skip-syntax-backward "w") - (looking-at octave-block-else-or-end-regexp))) + (octave-looking-at-kw octave-block-else-or-end-regexp))) (save-excursion (cond ((match-end 1) @@ -1021,11 +1036,11 @@ Returns t unless search stops at the beginning or end of the buffer." (inc (if (> arg 0) 1 -1)) (found)) (and (not (eobp)) - (not (and (> arg 0) (looking-at "\\<function\\>"))) + (not (and (> arg 0) (octave-looking-at-kw "\\<function\\>"))) (skip-syntax-forward "w")) (while (and (/= arg 0) (setq found - (re-search-backward "\\<function\\>" nil 'move inc))) + (octave-re-search-backward-kw "\\<function\\>" inc))) (if (octave-not-in-string-or-comment-p) (setq arg (- arg inc)))) (if found @@ -1078,7 +1093,7 @@ otherwise." (save-excursion (beginning-of-line) (and auto-fill-inhibit-regexp - (looking-at auto-fill-inhibit-regexp)))) + (octave-looking-at-kw auto-fill-inhibit-regexp)))) nil ; Can't do anything (if (and (not (octave-in-comment-p)) (> (current-column) fc)) |