diff options
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-styles.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-vars.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 39 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 154 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/gud.el | 85 | ||||
| -rw-r--r-- | lisp/progmodes/hideif.el | 14 | ||||
| -rw-r--r-- | lisp/progmodes/inf-lisp.el | 31 | ||||
| -rw-r--r-- | lisp/progmodes/make-mode.el | 128 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 90 |
10 files changed, 338 insertions, 208 deletions
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 6f623623535..c2b9b435e4c 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el | |||
| @@ -264,7 +264,7 @@ element of the list is added with `add-hook'. | |||
| 264 | Do not change this variable directly. Use the function `c-add-style' | 264 | Do not change this variable directly. Use the function `c-add-style' |
| 265 | to add new styles or modify existing styles (it is not a good idea to | 265 | to add new styles or modify existing styles (it is not a good idea to |
| 266 | modify existing styles -- you should create a new style that inherits | 266 | modify existing styles -- you should create a new style that inherits |
| 267 | the existing style.") | 267 | the existing style).") |
| 268 | 268 | ||
| 269 | 269 | ||
| 270 | ;; Functions that manipulate styles | 270 | ;; Functions that manipulate styles |
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 64e38be62d0..0e6738710c5 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -812,6 +812,7 @@ macro exceeds this column then the next tab stop from that line is | |||
| 812 | used as alignment column instead." | 812 | used as alignment column instead." |
| 813 | :type 'integer | 813 | :type 'integer |
| 814 | :group 'c) | 814 | :group 'c) |
| 815 | ;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp) | ||
| 815 | 816 | ||
| 816 | (defcustom-c-stylevar c-backslash-max-column 72 | 817 | (defcustom-c-stylevar c-backslash-max-column 72 |
| 817 | "*Maximum alignment column for line continuation backslashes. | 818 | "*Maximum alignment column for line continuation backslashes. |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 527624bfc4e..5da86972ec5 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -228,7 +228,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 228 | \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ | 228 | \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ |
| 229 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?:\ | 229 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?:\ |
| 230 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ | 230 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ |
| 231 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\)\\)?" | 231 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\)?" |
| 232 | 1 (2 . 5) (4 . 6) (7 . 8)) | 232 | 1 (2 . 5) (4 . 6) (7 . 8)) |
| 233 | 233 | ||
| 234 | (lcc | 234 | (lcc |
| @@ -236,7 +236,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 236 | 2 3 4 (1)) | 236 | 2 3 4 (1)) |
| 237 | 237 | ||
| 238 | (makepp | 238 | (makepp |
| 239 | "^makepp: \\(?:\\(?:warning\\(:\\).*?\\|\\(Scanning\\|[LR]e?l?oading makefile\\) \\|.*?\\)\ | 239 | "^makepp: \\(?:\\(?:warning\\(:\\).*?\\|\\(Scanning\\|[LR]e?l?oading makefile\\|Imported\\) \\|.*?\\)\ |
| 240 | `\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)['(]\\)" | 240 | `\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)['(]\\)" |
| 241 | 4 5 nil (1 . 2) 3 | 241 | 4 5 nil (1 . 2) 3 |
| 242 | ("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)['(]" nil nil | 242 | ("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)['(]" nil nil |
| @@ -293,15 +293,34 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?" | |||
| 293 | \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3)) | 293 | \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3)) |
| 294 | 294 | ||
| 295 | (gcov-file | 295 | (gcov-file |
| 296 | "^ +-: \\(0\\):Source:\\(.+\\)$" 2 1 nil 0) | 296 | "^ *-: *\\(0\\):Source:\\(.+\\)$" |
| 297 | (gcov-bb-file | 297 | 2 1 nil 0 nil |
| 298 | "^ +-: \\(0\\):Object:\\(?:.+\\)$" nil 1 nil 0) | 298 | (1 compilation-line-face prepend) (2 compilation-info-face prepend)) |
| 299 | (gcov-never-called-line | 299 | (gcov-header |
| 300 | "^ +\\(#####\\): +\\([0-9]+\\):.+$" nil 2 nil 2 nil | 300 | "^ *-: *\\(0\\):\\(?:Object\\|Graph\\|Data\\|Runs\\|Programs\\):.+$" |
| 301 | (1 compilation-error-face)) | 301 | nil 1 nil 0 nil |
| 302 | (1 compilation-line-face prepend)) | ||
| 303 | ;; Underlines over all lines of gcov output are too uncomfortable to read. | ||
| 304 | ;; However, hyperlinks embedded in the lines are useful. | ||
| 305 | ;; So I put default face on the lines; and then put | ||
| 306 | ;; compilation-*-face by manually to eliminate the underlines. | ||
| 307 | ;; The hyperlinks are still effective. | ||
| 308 | (gcov-nomark | ||
| 309 | "^ *-: *\\([1-9]\\|[0-9]\\{2,\\}\\):.*$" | ||
| 310 | nil 1 nil 0 nil | ||
| 311 | (0 'default t) | ||
| 312 | (1 compilation-line-face prepend)) | ||
| 302 | (gcov-called-line | 313 | (gcov-called-line |
| 303 | "^ +[-0-9]+: +\\([1-9]\\|[0-9]\\{2,\\}\\):.*$" nil 1 nil 0) | 314 | "^ *\\([0-9]+\\): *\\([0-9]+\\):.*$" |
| 304 | ) | 315 | nil 2 nil 0 nil |
| 316 | (0 'default t) | ||
| 317 | (1 compilation-info-face prepend) (2 compilation-line-face prepend)) | ||
| 318 | (gcov-never-called | ||
| 319 | "^ *\\(#####\\): *\\([0-9]+\\):.*$" | ||
| 320 | nil 2 nil 2 nil | ||
| 321 | (0 'default t) | ||
| 322 | (1 compilation-error-face prepend) (2 compilation-line-face prepend)) | ||
| 323 | ) | ||
| 305 | "Alist of values for `compilation-error-regexp-alist'.") | 324 | "Alist of values for `compilation-error-regexp-alist'.") |
| 306 | 325 | ||
| 307 | (defcustom compilation-error-regexp-alist | 326 | (defcustom compilation-error-regexp-alist |
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index f5d08d533fd..0f92523e306 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -71,11 +71,11 @@ | |||
| 71 | ;;; Known Bugs: | 71 | ;;; Known Bugs: |
| 72 | 72 | ||
| 73 | ;; 1) Strings that are watched don't update in the speedbar when their | 73 | ;; 1) Strings that are watched don't update in the speedbar when their |
| 74 | ;; contents change unless the first character changes. | 74 | ;; contents change unless the first character changes. |
| 75 | ;; 2) Cannot handle multiple debug sessions. | 75 | ;; 2) Cannot handle multiple debug sessions. |
| 76 | ;; 3) Initially, the assembler buffer does not display the cursor at the | 76 | ;; 3) M-x gdb doesn't work with "run" command in .gdbinit, use M-x gdba instead. |
| 77 | ;; current line if the line is not visible in the window (but when testing | 77 | ;; 4) M-x gdb doesn't work if the corefile is specified in the command in the |
| 78 | ;; gdb-assembler-custom with a lisp debugger it does!). | 78 | ;; minibuffer, use M-x gdba instead (or specify the core in the GUD buffer). |
| 79 | 79 | ||
| 80 | ;;; Problems with watch expressions, GDB/MI: | 80 | ;;; Problems with watch expressions, GDB/MI: |
| 81 | ;; 1) They go out of scope when the inferior is re-run. | 81 | ;; 1) They go out of scope when the inferior is re-run. |
| @@ -83,15 +83,10 @@ | |||
| 83 | ;; 3) VARNUM increments even when variable object is not created | 83 | ;; 3) VARNUM increments even when variable object is not created |
| 84 | ;; (maybe trivial). | 84 | ;; (maybe trivial). |
| 85 | 85 | ||
| 86 | ;; Known Bugs: | ||
| 87 | ;; 1) M-x gdb doesn't work with "run" command in .gdbinit, use M-x gdba instead. | ||
| 88 | |||
| 89 | ;;; TODO: | 86 | ;;; TODO: |
| 90 | ;; 1) Use MI command -data-read-memory for memory window. | 87 | ;; 1) Use MI command -data-read-memory for memory window. |
| 91 | ;; 2) Use tree-widget.el instead of the speedbar for watch-expressions? | 88 | ;; 2) Use tree-widget.el instead of the speedbar for watch-expressions? |
| 92 | ;; 3) Mark breakpoint locations on scroll-bar of source buffer? | 89 | ;; 3) Mark breakpoint locations on scroll-bar of source buffer? |
| 93 | ;; 4) With gud-print and gud-pstar, print the variable name in the GUD | ||
| 94 | ;; buffer instead of the value's history number. | ||
| 95 | 90 | ||
| 96 | ;;; Code: | 91 | ;;; Code: |
| 97 | 92 | ||
| @@ -130,6 +125,7 @@ and #define directives otherwise.") | |||
| 130 | (defvar gdb-source-window nil) | 125 | (defvar gdb-source-window nil) |
| 131 | (defvar gdb-inferior-status nil) | 126 | (defvar gdb-inferior-status nil) |
| 132 | (defvar gdb-continuation nil) | 127 | (defvar gdb-continuation nil) |
| 128 | (defvar gdb-look-up-stack nil) | ||
| 133 | 129 | ||
| 134 | (defvar gdb-buffer-type nil | 130 | (defvar gdb-buffer-type nil |
| 135 | "One of the symbols bound in `gdb-buffer-rules'.") | 131 | "One of the symbols bound in `gdb-buffer-rules'.") |
| @@ -493,26 +489,28 @@ With arg, use separate IO iff arg is positive." | |||
| 493 | 'gdb-mouse-set-clear-breakpoint) | 489 | 'gdb-mouse-set-clear-breakpoint) |
| 494 | (define-key gud-minor-mode-map [left-fringe mouse-1] | 490 | (define-key gud-minor-mode-map [left-fringe mouse-1] |
| 495 | 'gdb-mouse-set-clear-breakpoint) | 491 | 'gdb-mouse-set-clear-breakpoint) |
| 496 | (define-key gud-minor-mode-map [left-fringe mouse-2] | 492 | (define-key gud-minor-mode-map [left-margin C-mouse-1] |
| 497 | 'gdb-mouse-until) | 493 | 'gdb-mouse-toggle-breakpoint-margin) |
| 494 | (define-key gud-minor-mode-map [left-fringe C-mouse-1] | ||
| 495 | 'gdb-mouse-toggle-breakpoint-fringe) | ||
| 496 | |||
| 498 | (define-key gud-minor-mode-map [left-margin drag-mouse-1] | 497 | (define-key gud-minor-mode-map [left-margin drag-mouse-1] |
| 499 | 'gdb-mouse-until) | 498 | 'gdb-mouse-until) |
| 500 | (define-key gud-minor-mode-map [left-fringe drag-mouse-1] | 499 | (define-key gud-minor-mode-map [left-fringe drag-mouse-1] |
| 501 | 'gdb-mouse-until) | 500 | 'gdb-mouse-until) |
| 502 | (define-key gud-minor-mode-map [left-margin mouse-2] | 501 | (define-key gud-minor-mode-map [left-margin mouse-3] |
| 502 | 'gdb-mouse-until) | ||
| 503 | (define-key gud-minor-mode-map [left-fringe mouse-3] | ||
| 503 | 'gdb-mouse-until) | 504 | 'gdb-mouse-until) |
| 505 | |||
| 504 | (define-key gud-minor-mode-map [left-margin C-drag-mouse-1] | 506 | (define-key gud-minor-mode-map [left-margin C-drag-mouse-1] |
| 505 | 'gdb-mouse-jump) | 507 | 'gdb-mouse-jump) |
| 506 | (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1] | 508 | (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1] |
| 507 | 'gdb-mouse-jump) | 509 | 'gdb-mouse-jump) |
| 508 | (define-key gud-minor-mode-map [left-fringe C-mouse-2] | 510 | (define-key gud-minor-mode-map [left-fringe C-mouse-3] |
| 509 | 'gdb-mouse-jump) | 511 | 'gdb-mouse-jump) |
| 510 | (define-key gud-minor-mode-map [left-margin C-mouse-2] | 512 | (define-key gud-minor-mode-map [left-margin C-mouse-3] |
| 511 | 'gdb-mouse-jump) | 513 | 'gdb-mouse-jump) |
| 512 | (define-key gud-minor-mode-map [left-margin mouse-3] | ||
| 513 | 'gdb-mouse-toggle-breakpoint-margin) | ||
| 514 | (define-key gud-minor-mode-map [left-fringe mouse-3] | ||
| 515 | 'gdb-mouse-toggle-breakpoint-fringe) | ||
| 516 | 514 | ||
| 517 | (setq comint-input-sender 'gdb-send) | 515 | (setq comint-input-sender 'gdb-send) |
| 518 | 516 | ||
| @@ -543,7 +541,8 @@ With arg, use separate IO iff arg is positive." | |||
| 543 | gdb-signalled nil | 541 | gdb-signalled nil |
| 544 | gdb-source-window nil | 542 | gdb-source-window nil |
| 545 | gdb-inferior-status nil | 543 | gdb-inferior-status nil |
| 546 | gdb-continuation nil) | 544 | gdb-continuation nil |
| 545 | gdb-look-up-stack nil) | ||
| 547 | 546 | ||
| 548 | (setq gdb-buffer-type 'gdba) | 547 | (setq gdb-buffer-type 'gdba) |
| 549 | 548 | ||
| @@ -738,7 +737,7 @@ With arg, enter name of variable to be watched in the minibuffer." | |||
| 738 | `(lambda () (gdb-var-evaluate-expression-handler | 737 | `(lambda () (gdb-var-evaluate-expression-handler |
| 739 | ,(car var) nil))))) | 738 | ,(car var) nil))))) |
| 740 | (if (search-forward "Undefined command" nil t) | 739 | (if (search-forward "Undefined command" nil t) |
| 741 | (message-box "Watching expressions requires gdb 6.0 onwards") | 740 | (message-box "Watching expressions requires GDB 6.0 onwards") |
| 742 | (message-box "No symbol \"%s\" in current context." expr)))) | 741 | (message-box "No symbol \"%s\" in current context." expr)))) |
| 743 | 742 | ||
| 744 | (defun gdb-speedbar-update () | 743 | (defun gdb-speedbar-update () |
| @@ -1106,7 +1105,8 @@ This filter may simply queue input for a later time." | |||
| 1106 | (let ((item (concat string "\n"))) | 1105 | (let ((item (concat string "\n"))) |
| 1107 | (if gdb-enable-debug (push (cons 'send item) gdb-debug-ring)) | 1106 | (if gdb-enable-debug (push (cons 'send item) gdb-debug-ring)) |
| 1108 | (process-send-string proc item))) | 1107 | (process-send-string proc item))) |
| 1109 | (if (string-match "\\\\$" string) | 1108 | (if (and (string-match "\\\\$" string) |
| 1109 | (not comint-input-sender-no-newline)) ;;Try to catch C-d. | ||
| 1110 | (setq gdb-continuation (concat gdb-continuation string "\n")) | 1110 | (setq gdb-continuation (concat gdb-continuation string "\n")) |
| 1111 | (let ((item (concat gdb-continuation string "\n"))) | 1111 | (let ((item (concat gdb-continuation string "\n"))) |
| 1112 | (gdb-enqueue-input item) | 1112 | (gdb-enqueue-input item) |
| @@ -1334,9 +1334,20 @@ directives." | |||
| 1334 | It is just like `gdb-stopping', except that if we already set the output | 1334 | It is just like `gdb-stopping', except that if we already set the output |
| 1335 | sink to `user' in `gdb-stopping', that is fine." | 1335 | sink to `user' in `gdb-stopping', that is fine." |
| 1336 | (setq gud-running nil) | 1336 | (setq gud-running nil) |
| 1337 | (unless (or gud-overlay-arrow-position gud-last-frame | 1337 | (unless (or gud-overlay-arrow-position gud-last-frame) |
| 1338 | (not gud-last-last-frame)) | 1338 | ;;Pop up GUD buffer to display current frame when it doesn't have source |
| 1339 | (gud-display-line (car gud-last-last-frame) (cdr gud-last-last-frame))) | 1339 | ;;information i.e id not compiled with -g as with libc routines generally. |
| 1340 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | ||
| 1341 | (special-display-frame-alist gdb-frame-parameters) | ||
| 1342 | (same-window-regexps nil)) | ||
| 1343 | (display-buffer gud-comint-buffer)) | ||
| 1344 | ;;Try to find source further up stack e.g after signal. | ||
| 1345 | (setq gdb-look-up-stack | ||
| 1346 | (if (gdb-get-buffer 'gdb-stack-buffer) 'keep | ||
| 1347 | (progn | ||
| 1348 | (gdb-get-buffer-create 'gdb-stack-buffer) | ||
| 1349 | (gdb-invalidate-frames) | ||
| 1350 | 'delete)))) | ||
| 1340 | (unless (member gdb-inferior-status '("exited" "signal")) | 1351 | (unless (member gdb-inferior-status '("exited" "signal")) |
| 1341 | (setq gdb-inferior-status "stopped") | 1352 | (setq gdb-inferior-status "stopped") |
| 1342 | (gdb-force-mode-line-update gdb-inferior-status)) | 1353 | (gdb-force-mode-line-update gdb-inferior-status)) |
| @@ -1945,36 +1956,57 @@ static char *magick[] = { | |||
| 1945 | (defun gdb-info-stack-custom () | 1956 | (defun gdb-info-stack-custom () |
| 1946 | (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer) | 1957 | (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer) |
| 1947 | (save-excursion | 1958 | (save-excursion |
| 1948 | (let ((buffer-read-only nil) | 1959 | (unless (eq gdb-look-up-stack 'delete) |
| 1949 | bl el) | 1960 | (let ((buffer-read-only nil) |
| 1950 | (goto-char (point-min)) | 1961 | bl el) |
| 1951 | (while (< (point) (point-max)) | 1962 | (goto-char (point-min)) |
| 1952 | (setq bl (line-beginning-position) | 1963 | (while (< (point) (point-max)) |
| 1953 | el (line-end-position)) | 1964 | (setq bl (line-beginning-position) |
| 1954 | (when (looking-at "#") | 1965 | el (line-end-position)) |
| 1955 | (add-text-properties bl el | 1966 | (when (looking-at "#") |
| 1956 | '(mouse-face highlight | 1967 | (add-text-properties bl el |
| 1957 | help-echo "mouse-2, RET: Select frame"))) | 1968 | '(mouse-face highlight |
| 1958 | (goto-char bl) | 1969 | help-echo "mouse-2, RET: Select frame"))) |
| 1959 | (when (looking-at "^#\\([0-9]+\\)") | 1970 | (goto-char bl) |
| 1960 | (when (string-equal (match-string 1) gdb-frame-number) | 1971 | (when (looking-at "^#\\([0-9]+\\)") |
| 1972 | (when (string-equal (match-string 1) gdb-frame-number) | ||
| 1961 | (put-text-property bl (+ bl 4) | 1973 | (put-text-property bl (+ bl 4) |
| 1962 | 'face '(:inverse-video t))) | 1974 | 'face '(:inverse-video t))) |
| 1963 | (when (re-search-forward | 1975 | (when (re-search-forward |
| 1964 | (concat | 1976 | (concat |
| 1965 | (if (string-equal (match-string 1) "0") "" " in ") | 1977 | (if (string-equal (match-string 1) "0") "" " in ") |
| 1966 | "\\([^ ]+\\) (") el t) | 1978 | "\\([^ ]+\\) (") el t) |
| 1967 | (put-text-property (match-beginning 1) (match-end 1) | ||
| 1968 | 'face font-lock-function-name-face) | ||
| 1969 | (setq bl (match-end 0)) | ||
| 1970 | (while (re-search-forward "<\\([^>]+\\)>" el t) | ||
| 1971 | (put-text-property (match-beginning 1) (match-end 1) | 1979 | (put-text-property (match-beginning 1) (match-end 1) |
| 1980 | 'face font-lock-function-name-face) | ||
| 1981 | (setq bl (match-end 0)) | ||
| 1982 | (while (re-search-forward "<\\([^>]+\\)>" el t) | ||
| 1983 | (put-text-property (match-beginning 1) (match-end 1) | ||
| 1972 | 'face font-lock-function-name-face)) | 1984 | 'face font-lock-function-name-face)) |
| 1973 | (goto-char bl) | 1985 | (goto-char bl) |
| 1974 | (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t) | 1986 | (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t) |
| 1975 | (put-text-property (match-beginning 1) (match-end 1) | 1987 | (put-text-property (match-beginning 1) (match-end 1) |
| 1976 | 'face font-lock-variable-name-face)))) | 1988 | 'face font-lock-variable-name-face)))) |
| 1977 | (forward-line 1)))))) | 1989 | (forward-line 1)))) |
| 1990 | (when gdb-look-up-stack | ||
| 1991 | (goto-char (point-min)) | ||
| 1992 | (when (re-search-forward "\\(\\S-+?\\):\\([0-9]+\\)" nil t) | ||
| 1993 | (let ((start (line-beginning-position)) | ||
| 1994 | (file (match-string 1)) | ||
| 1995 | (line (match-string 2))) | ||
| 1996 | (re-search-backward "^#*\\([0-9]+\\)" start t) | ||
| 1997 | (gdb-enqueue-input | ||
| 1998 | (list (concat gdb-server-prefix "frame " | ||
| 1999 | (match-string 1) "\n") 'gdb-set-hollow)) | ||
| 2000 | (gdb-enqueue-input | ||
| 2001 | (list (concat gdb-server-prefix "frame 0\n") 'ignore))))))) | ||
| 2002 | (if (eq gdb-look-up-stack 'delete) | ||
| 2003 | (kill-buffer (gdb-get-buffer 'gdb-stack-buffer))) | ||
| 2004 | (setq gdb-look-up-stack nil)) | ||
| 2005 | |||
| 2006 | (defun gdb-set-hollow () | ||
| 2007 | (with-current-buffer (gud-find-file (car gud-last-last-frame)) | ||
| 2008 | (setq fringe-indicator-alist | ||
| 2009 | '((overlay-arrow . hollow-right-triangle))))) | ||
| 1978 | 2010 | ||
| 1979 | (defun gdb-stack-buffer-name () | 2011 | (defun gdb-stack-buffer-name () |
| 1980 | (with-current-buffer gud-comint-buffer | 2012 | (with-current-buffer gud-comint-buffer |
| @@ -2030,8 +2062,7 @@ static char *magick[] = { | |||
| 2030 | (if event (posn-set-point (event-end event))) | 2062 | (if event (posn-set-point (event-end event))) |
| 2031 | (gdb-enqueue-input | 2063 | (gdb-enqueue-input |
| 2032 | (list (concat gdb-server-prefix "frame " | 2064 | (list (concat gdb-server-prefix "frame " |
| 2033 | (gdb-get-frame-number) "\n") 'ignore)) | 2065 | (gdb-get-frame-number) "\n") 'ignore))) |
| 2034 | (gud-display-frame)) | ||
| 2035 | 2066 | ||
| 2036 | 2067 | ||
| 2037 | ;; Threads buffer. This displays a selectable thread list. | 2068 | ;; Threads buffer. This displays a selectable thread list. |
| @@ -2049,13 +2080,14 @@ static char *magick[] = { | |||
| 2049 | (defun gdb-info-threads-custom () | 2080 | (defun gdb-info-threads-custom () |
| 2050 | (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer) | 2081 | (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer) |
| 2051 | (let ((buffer-read-only nil)) | 2082 | (let ((buffer-read-only nil)) |
| 2052 | (goto-char (point-min)) | 2083 | (save-excursion |
| 2053 | (while (< (point) (point-max)) | 2084 | (goto-char (point-min)) |
| 2054 | (unless (looking-at "No ") | 2085 | (while (< (point) (point-max)) |
| 2055 | (add-text-properties (line-beginning-position) (line-end-position) | 2086 | (unless (looking-at "No ") |
| 2056 | '(mouse-face highlight | 2087 | (add-text-properties (line-beginning-position) (line-end-position) |
| 2088 | '(mouse-face highlight | ||
| 2057 | help-echo "mouse-2, RET: select thread"))) | 2089 | help-echo "mouse-2, RET: select thread"))) |
| 2058 | (forward-line 1))))) | 2090 | (forward-line 1)))))) |
| 2059 | 2091 | ||
| 2060 | (defun gdb-threads-buffer-name () | 2092 | (defun gdb-threads-buffer-name () |
| 2061 | (with-current-buffer gud-comint-buffer | 2093 | (with-current-buffer gud-comint-buffer |
| @@ -2868,7 +2900,11 @@ of the current session." | |||
| 2868 | gud-comint-buffer | 2900 | gud-comint-buffer |
| 2869 | (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) | 2901 | (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
| 2870 | '(gdba gdbmi))) | 2902 | '(gdba gdbmi))) |
| 2871 | (if (member buffer-file-name gdb-source-file-list) | 2903 | ;;Pre GDB 6.3 "info sources" doesn't give absolute file name. |
| 2904 | (if (member (if (string-equal gdb-version "pre-6.4") | ||
| 2905 | (file-name-nondirectory buffer-file-name) | ||
| 2906 | buffer-file-name) | ||
| 2907 | gdb-source-file-list) | ||
| 2872 | (with-current-buffer (find-buffer-visiting buffer-file-name) | 2908 | (with-current-buffer (find-buffer-visiting buffer-file-name) |
| 2873 | (set (make-local-variable 'gud-minor-mode) | 2909 | (set (make-local-variable 'gud-minor-mode) |
| 2874 | (buffer-local-value 'gud-minor-mode gud-comint-buffer)) | 2910 | (buffer-local-value 'gud-minor-mode gud-comint-buffer)) |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 410a973d1b4..d207094cafe 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -553,7 +553,7 @@ easily repeat a find command." | |||
| 553 | (read-string | 553 | (read-string |
| 554 | "compile.el: No `grep-find-command' command available. Press RET.") | 554 | "compile.el: No `grep-find-command' command available. Press RET.") |
| 555 | (list nil)))) | 555 | (list nil)))) |
| 556 | (when (and grep-find-command command-args) | 556 | (when command-args |
| 557 | (let ((null-device nil)) ; see grep | 557 | (let ((null-device nil)) ; see grep |
| 558 | (grep command-args)))) | 558 | (grep command-args)))) |
| 559 | 559 | ||
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d2e6cfc4ae4..1ce5d404a80 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -101,8 +101,8 @@ If SOFT is non-nil, returns nil if the symbol doesn't already exist." | |||
| 101 | (if (boundp sym) (symbol-value sym)))) | 101 | (if (boundp sym) (symbol-value sym)))) |
| 102 | 102 | ||
| 103 | (defvar gud-running nil | 103 | (defvar gud-running nil |
| 104 | "Non-nil if debuggee is running. | 104 | "Non-nil if debugged program is running. |
| 105 | Used to grey out relevant togolbar icons.") | 105 | Used to grey out relevant toolbar icons.") |
| 106 | 106 | ||
| 107 | ;; Use existing Info buffer, if possible. | 107 | ;; Use existing Info buffer, if possible. |
| 108 | (defun gud-goto-info () | 108 | (defun gud-goto-info () |
| @@ -130,10 +130,10 @@ Used to grey out relevant togolbar icons.") | |||
| 130 | 130 | ||
| 131 | (defun gud-stop-subjob () | 131 | (defun gud-stop-subjob () |
| 132 | (interactive) | 132 | (interactive) |
| 133 | (if (string-equal | 133 | (with-current-buffer gud-comint-buffer |
| 134 | (buffer-local-value 'gud-target-name gud-comint-buffer) "emacs") | 134 | (if (string-equal gud-target-name "emacs") |
| 135 | (comint-stop-subjob) | 135 | (comint-stop-subjob) |
| 136 | (comint-interrupt-subjob))) | 136 | (comint-interrupt-subjob)))) |
| 137 | 137 | ||
| 138 | (easy-mmode-defmap gud-menu-map | 138 | (easy-mmode-defmap gud-menu-map |
| 139 | '(([help] "Info" . gud-goto-info) | 139 | '(([help] "Info" . gud-goto-info) |
| @@ -141,13 +141,15 @@ Used to grey out relevant togolbar icons.") | |||
| 141 | :enable (and (not emacs-basic-display) | 141 | :enable (and (not emacs-basic-display) |
| 142 | (display-graphic-p) | 142 | (display-graphic-p) |
| 143 | (fboundp 'x-show-tip)) | 143 | (fboundp 'x-show-tip)) |
| 144 | :visible (memq gud-minor-mode | ||
| 145 | '(gdbmi gdba dbx sdb xdb pdb)) | ||
| 144 | :button (:toggle . gud-tooltip-mode)) | 146 | :button (:toggle . gud-tooltip-mode)) |
| 145 | ([refresh] "Refresh" . gud-refresh) | 147 | ([refresh] "Refresh" . gud-refresh) |
| 146 | ([run] menu-item "Run" gud-run | 148 | ([run] menu-item "Run" gud-run |
| 147 | :enable (and (not gud-running) | 149 | :enable (not gud-running) |
| 148 | (memq gud-minor-mode '(gdbmi gdb dbx jdb))) | 150 | :visible (and (memq gud-minor-mode '(gdbmi gdb dbx jdb)) |
| 149 | :visible (not (eq gud-minor-mode 'gdba))) | 151 | (not (eq gud-minor-mode 'gdba)))) |
| 150 | ([go] menu-item "Run/Continue" gud-go | 152 | ([go] menu-item (if gdb-active-process "Continue" "Run") gud-go |
| 151 | :visible (and (not gud-running) | 153 | :visible (and (not gud-running) |
| 152 | (eq gud-minor-mode 'gdba))) | 154 | (eq gud-minor-mode 'gdba))) |
| 153 | ([stop] menu-item "Stop" gud-stop-subjob | 155 | ([stop] menu-item "Stop" gud-stop-subjob |
| @@ -155,26 +157,27 @@ Used to grey out relevant togolbar icons.") | |||
| 155 | (and gud-running | 157 | (and gud-running |
| 156 | (eq gud-minor-mode 'gdba)))) | 158 | (eq gud-minor-mode 'gdba)))) |
| 157 | ([until] menu-item "Continue to selection" gud-until | 159 | ([until] menu-item "Continue to selection" gud-until |
| 158 | :enable (and (not gud-running) | 160 | :enable (not gud-running) |
| 159 | (memq gud-minor-mode '(gdbmi gdba gdb perldb))) | 161 | :visible (and (memq gud-minor-mode '(gdbmi gdba gdb perldb)) |
| 160 | :visible (gud-tool-bar-item-visible-no-fringe)) | 162 | (gud-tool-bar-item-visible-no-fringe))) |
| 161 | ([remove] menu-item "Remove Breakpoint" gud-remove | 163 | ([remove] menu-item "Remove Breakpoint" gud-remove |
| 162 | :enable (not gud-running) | 164 | :enable (not gud-running) |
| 163 | :visible (gud-tool-bar-item-visible-no-fringe)) | 165 | :visible (gud-tool-bar-item-visible-no-fringe)) |
| 164 | ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak | 166 | ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak |
| 165 | :enable (memq gud-minor-mode | 167 | :enable (not gud-running) |
| 168 | :visible (memq gud-minor-mode | ||
| 166 | '(gdbmi gdba gdb sdb xdb bashdb))) | 169 | '(gdbmi gdba gdb sdb xdb bashdb))) |
| 167 | ([break] menu-item "Set Breakpoint" gud-break | 170 | ([break] menu-item "Set Breakpoint" gud-break |
| 168 | :enable (not gud-running) | 171 | :enable (not gud-running) |
| 169 | :visible (gud-tool-bar-item-visible-no-fringe)) | 172 | :visible (gud-tool-bar-item-visible-no-fringe)) |
| 170 | ([up] menu-item "Up Stack" gud-up | 173 | ([up] menu-item "Up Stack" gud-up |
| 171 | :enable (and (not gud-running) | 174 | :enable (not gud-running) |
| 172 | (memq gud-minor-mode | 175 | :visible (memq gud-minor-mode |
| 173 | '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) | 176 | '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))) |
| 174 | ([down] menu-item "Down Stack" gud-down | 177 | ([down] menu-item "Down Stack" gud-down |
| 175 | :enable (and (not gud-running) | 178 | :enable (not gud-running) |
| 176 | (memq gud-minor-mode | 179 | :visible (memq gud-minor-mode |
| 177 | '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) | 180 | '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))) |
| 178 | ([pp] menu-item "Print S-expression" gud-pp | 181 | ([pp] menu-item "Print S-expression" gud-pp |
| 179 | :enable (and (not gud-running) | 182 | :enable (and (not gud-running) |
| 180 | gdb-active-process) | 183 | gdb-active-process) |
| @@ -183,23 +186,23 @@ Used to grey out relevant togolbar icons.") | |||
| 183 | 'gud-target-name gud-comint-buffer) "emacs") | 186 | 'gud-target-name gud-comint-buffer) "emacs") |
| 184 | (eq gud-minor-mode 'gdba))) | 187 | (eq gud-minor-mode 'gdba))) |
| 185 | ([print*] menu-item "Print Dereference" gud-pstar | 188 | ([print*] menu-item "Print Dereference" gud-pstar |
| 186 | :enable (and (not gud-running) | 189 | :enable (not gud-running) |
| 187 | (memq gud-minor-mode '(gdbmi gdba gdb)))) | 190 | :visible (memq gud-minor-mode '(gdbmi gdba gdb))) |
| 188 | ([print] menu-item "Print Expression" gud-print | 191 | ([print] menu-item "Print Expression" gud-print |
| 189 | :enable (not gud-running)) | 192 | :enable (not gud-running)) |
| 190 | ([watch] menu-item "Watch Expression" gud-watch | 193 | ([watch] menu-item "Watch Expression" gud-watch |
| 191 | :enable (and (not gud-running) | 194 | :enable (not gud-running) |
| 192 | (memq gud-minor-mode '(gdbmi gdba)))) | 195 | :visible (memq gud-minor-mode '(gdbmi gdba))) |
| 193 | ([finish] menu-item "Finish Function" gud-finish | 196 | ([finish] menu-item "Finish Function" gud-finish |
| 194 | :enable (and (not gud-running) | 197 | :enable (not gud-running) |
| 195 | (memq gud-minor-mode | 198 | :visible (memq gud-minor-mode |
| 196 | '(gdbmi gdba gdb xdb jdb pdb bashdb)))) | 199 | '(gdbmi gdba gdb xdb jdb pdb bashdb))) |
| 197 | ([stepi] menu-item "Step Instruction" gud-stepi | 200 | ([stepi] menu-item "Step Instruction" gud-stepi |
| 198 | :enable (and (not gud-running) | 201 | :enable (not gud-running) |
| 199 | (memq gud-minor-mode '(gdbmi gdba gdb dbx)))) | 202 | :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx))) |
| 200 | ([nexti] menu-item "Next Instruction" gud-nexti | 203 | ([nexti] menu-item "Next Instruction" gud-nexti |
| 201 | :enable (and (not gud-running) | 204 | :enable (not gud-running) |
| 202 | (memq gud-minor-mode '(gdbmi gdba gdb dbx)))) | 205 | :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx))) |
| 203 | ([step] menu-item "Step Line" gud-step | 206 | ([step] menu-item "Step Line" gud-step |
| 204 | :enable (not gud-running)) | 207 | :enable (not gud-running)) |
| 205 | ([next] menu-item "Next Line" gud-next | 208 | ([next] menu-item "Next Line" gud-next |
| @@ -2565,7 +2568,7 @@ comint mode, which see." | |||
| 2565 | (existing-buffer (get-buffer (concat "*gud" filepart "*")))) | 2568 | (existing-buffer (get-buffer (concat "*gud" filepart "*")))) |
| 2566 | (pop-to-buffer (concat "*gud" filepart "*")) | 2569 | (pop-to-buffer (concat "*gud" filepart "*")) |
| 2567 | (when (and existing-buffer (get-buffer-process existing-buffer)) | 2570 | (when (and existing-buffer (get-buffer-process existing-buffer)) |
| 2568 | (error "This program is already running under gdb")) | 2571 | (error "This program is already being debugged")) |
| 2569 | ;; Set the dir, in case the buffer already existed with a different dir. | 2572 | ;; Set the dir, in case the buffer already existed with a different dir. |
| 2570 | (setq default-directory dir) | 2573 | (setq default-directory dir) |
| 2571 | ;; Set default-directory to the file's directory. | 2574 | ;; Set default-directory to the file's directory. |
| @@ -2693,10 +2696,10 @@ It is saved for when this flag is not set.") | |||
| 2693 | ((memq (process-status proc) '(signal exit)) | 2696 | ((memq (process-status proc) '(signal exit)) |
| 2694 | ;; Stop displaying an arrow in a source file. | 2697 | ;; Stop displaying an arrow in a source file. |
| 2695 | (setq gud-overlay-arrow-position nil) | 2698 | (setq gud-overlay-arrow-position nil) |
| 2696 | (with-current-buffer gud-comint-buffer | 2699 | (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
| 2697 | (if (memq gud-minor-mode-type '(gdbmi gdba)) | 2700 | '(gdba gdbmi)) |
| 2698 | (gdb-reset) | 2701 | (gdb-reset) |
| 2699 | (gud-reset))) | 2702 | (gud-reset)) |
| 2700 | (let* ((obuf (current-buffer))) | 2703 | (let* ((obuf (current-buffer))) |
| 2701 | ;; save-excursion isn't the right thing if | 2704 | ;; save-excursion isn't the right thing if |
| 2702 | ;; process-buffer is current-buffer | 2705 | ;; process-buffer is current-buffer |
| @@ -3166,7 +3169,7 @@ class of the file (using s to separate nested class ids)." | |||
| 3166 | (defvar gdb-script-font-lock-keywords | 3169 | (defvar gdb-script-font-lock-keywords |
| 3167 | '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face)) | 3170 | '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face)) |
| 3168 | ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face)) | 3171 | ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face)) |
| 3169 | ("^\\s-*\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-keyword-face)))) | 3172 | ("^\\s-*\\(\\w\\(\\w\\|\\s_\\)*\\)" (1 font-lock-keyword-face)))) |
| 3170 | 3173 | ||
| 3171 | ;; FIXME: The keyword "end" associated with "document" | 3174 | ;; FIXME: The keyword "end" associated with "document" |
| 3172 | ;; should have font-lock-keyword-face (currently font-lock-doc-face). | 3175 | ;; should have font-lock-keyword-face (currently font-lock-doc-face). |
| @@ -3313,7 +3316,8 @@ Treats actions as defuns." | |||
| 3313 | (kill-local-variable 'gdb-define-alist) | 3316 | (kill-local-variable 'gdb-define-alist) |
| 3314 | (remove-hook 'after-save-hook 'gdb-create-define-alist t)))) | 3317 | (remove-hook 'after-save-hook 'gdb-create-define-alist t)))) |
| 3315 | 3318 | ||
| 3316 | (defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode) | 3319 | (defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode |
| 3320 | python-mode) | ||
| 3317 | "List of modes for which to enable GUD tooltips." | 3321 | "List of modes for which to enable GUD tooltips." |
| 3318 | :type 'sexp | 3322 | :type 'sexp |
| 3319 | :group 'gud | 3323 | :group 'gud |
| @@ -3427,9 +3431,8 @@ With arg, dereference expr iff arg is positive." | |||
| 3427 | (case gud-minor-mode | 3431 | (case gud-minor-mode |
| 3428 | (gdba (concat "server print " expr)) | 3432 | (gdba (concat "server print " expr)) |
| 3429 | ((dbx gdbmi) (concat "print " expr)) | 3433 | ((dbx gdbmi) (concat "print " expr)) |
| 3430 | (xdb (concat "p " expr)) | 3434 | ((xdb pdb) (concat "p " expr)) |
| 3431 | (sdb (concat expr "/")) | 3435 | (sdb (concat expr "/")))) |
| 3432 | (perldb expr))) | ||
| 3433 | 3436 | ||
| 3434 | (defun gud-tooltip-tips (event) | 3437 | (defun gud-tooltip-tips (event) |
| 3435 | "Show tip for identifier or selection under the mouse. | 3438 | "Show tip for identifier or selection under the mouse. |
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 04e44e2dac1..a100424108d 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el | |||
| @@ -928,15 +928,17 @@ Return as (TOP . BOTTOM) the extent of ifdef block." | |||
| 928 | (setq hide-ifdef-hiding t)) | 928 | (setq hide-ifdef-hiding t)) |
| 929 | (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only))) | 929 | (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only))) |
| 930 | 930 | ||
| 931 | |||
| 932 | (defun show-ifdef-block () | 931 | (defun show-ifdef-block () |
| 933 | "Show the ifdef block (true or false part) enclosing or before the cursor." | 932 | "Show the ifdef block (true or false part) enclosing or before the cursor." |
| 934 | (interactive) | 933 | (interactive) |
| 935 | (if hide-ifdef-lines | 934 | (let ((top-bottom (hif-find-ifdef-block))) |
| 936 | (save-excursion | 935 | (if hide-ifdef-lines |
| 937 | (beginning-of-line) | 936 | (hif-show-ifdef-region |
| 938 | (hif-show-ifdef-region (1- (point)) (progn (end-of-line) (point)))) | 937 | (save-excursion |
| 939 | (let ((top-bottom (hif-find-ifdef-block))) | 938 | (goto-char (car top-bottom)) (line-beginning-position)) |
| 939 | (save-excursion | ||
| 940 | (goto-char (1+ (cdr top-bottom))) | ||
| 941 | (hif-end-of-line) (point))) | ||
| 940 | (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom))))) | 942 | (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom))))) |
| 941 | 943 | ||
| 942 | 944 | ||
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 092c7736c27..4a50e00063c 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el | |||
| @@ -233,30 +233,37 @@ documentation for variable `inferior-lisp-buffer'. | |||
| 233 | 233 | ||
| 234 | \\{inferior-lisp-mode-map} | 234 | \\{inferior-lisp-mode-map} |
| 235 | 235 | ||
| 236 | Customisation: Entry to this mode runs the hooks on `comint-mode-hook' and | 236 | Customization: Entry to this mode runs the hooks on `comint-mode-hook' and |
| 237 | `inferior-lisp-mode-hook' (in that order). | 237 | `inferior-lisp-mode-hook' (in that order). |
| 238 | 238 | ||
| 239 | You can send text to the inferior Lisp process from other buffers containing | 239 | You can send text to the inferior Lisp process from other buffers containing |
| 240 | Lisp source. | 240 | Lisp source. |
| 241 | switch-to-lisp switches the current buffer to the Lisp process buffer. | 241 | `switch-to-lisp' switches the current buffer to the Lisp process buffer. |
| 242 | lisp-eval-defun sends the current defun to the Lisp process. | 242 | `lisp-eval-defun' sends the current defun to the Lisp process. |
| 243 | lisp-compile-defun compiles the current defun. | 243 | `lisp-compile-defun' compiles the current defun. |
| 244 | lisp-eval-region sends the current region to the Lisp process. | 244 | `lisp-eval-region' sends the current region to the Lisp process. |
| 245 | lisp-compile-region compiles the current region. | 245 | `lisp-compile-region' compiles the current region. |
| 246 | 246 | ||
| 247 | Prefixing the lisp-eval/compile-defun/region commands with | 247 | Prefixing the lisp-eval/compile-defun/region commands with |
| 248 | a \\[universal-argument] causes a switch to the Lisp process buffer after sending | 248 | a \\[universal-argument] causes a switch to the Lisp process buffer after sending |
| 249 | the text. | 249 | the text. |
| 250 | 250 | ||
| 251 | Commands: | 251 | Commands:\\<inferior-lisp-mode-map> |
| 252 | Return after the end of the process' output sends the text from the | 252 | \\[comint-send-input] after the end of the process' output sends the text from the |
| 253 | end of process to point. | 253 | end of process to point. |
| 254 | Return before the end of the process' output copies the sexp ending at point | 254 | \\[comint-send-input] before the end of the process' output copies the sexp ending at point |
| 255 | to the end of the process' output, and sends it. | 255 | to the end of the process' output, and sends it. |
| 256 | Delete converts tabs to spaces as it moves back. | 256 | \\[comint-copy-old-input] copies the sexp ending at point to the end of the process' output, |
| 257 | Tab indents for Lisp; with argument, shifts rest | 257 | allowing you to edit it before sending it. |
| 258 | If `comint-use-prompt-regexp' is nil (the default), \\[comint-insert-input] on old input | ||
| 259 | copies the entire old input to the end of the process' output, allowing | ||
| 260 | you to edit it before sending it. When not used on old input, or if | ||
| 261 | `comint-use-prompt-regexp' is non-nil, \\[comint-insert-input] behaves according to | ||
| 262 | its global binding. | ||
| 263 | \\[backward-delete-char-untabify] converts tabs to spaces as it moves back. | ||
| 264 | \\[lisp-indent-line] indents for Lisp; with argument, shifts rest | ||
| 258 | of expression rigidly with the current line. | 265 | of expression rigidly with the current line. |
| 259 | C-M-q does Tab on each line starting within following expression. | 266 | \\[indent-sexp] does \\[lisp-indent-line] on each line starting within following expression. |
| 260 | Paragraphs are separated only by blank lines. Semicolons start comments. | 267 | Paragraphs are separated only by blank lines. Semicolons start comments. |
| 261 | If you accidentally suspend your process, use \\[comint-continue-subjob] | 268 | If you accidentally suspend your process, use \\[comint-continue-subjob] |
| 262 | to continue it." | 269 | to continue it." |
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 3bbfeaac683..d22aedb6058 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -246,6 +246,7 @@ You will be offered to complete on one of those in the minibuffer whenever | |||
| 246 | you enter a \".\" at the beginning of a line in `makefile-mode'." | 246 | you enter a \".\" at the beginning of a line in `makefile-mode'." |
| 247 | :type '(repeat (list string)) | 247 | :type '(repeat (list string)) |
| 248 | :group 'makefile) | 248 | :group 'makefile) |
| 249 | (put 'makefile-special-targets-list 'risky-local-variable t) | ||
| 249 | 250 | ||
| 250 | (defcustom makefile-runtime-macros-list | 251 | (defcustom makefile-runtime-macros-list |
| 251 | '(("@") ("&") (">") ("<") ("*") ("^") ("+") ("?") ("%") ("$")) | 252 | '(("@") ("&") (">") ("<") ("*") ("^") ("+") ("?") ("%") ("$")) |
| @@ -290,6 +291,9 @@ not be enclosed in { } or ( )." | |||
| 290 | ;; that if you change this regexp you might have to fix the imenu index in | 291 | ;; that if you change this regexp you might have to fix the imenu index in |
| 291 | ;; makefile-imenu-generic-expression. | 292 | ;; makefile-imenu-generic-expression. |
| 292 | (defconst makefile-macroassign-regex | 293 | (defconst makefile-macroassign-regex |
| 294 | ;; We used to match not just the varname but also the whole value | ||
| 295 | ;; (spanning potentially several lines). | ||
| 296 | ;; "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)\\)" | ||
| 293 | "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)" | 297 | "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)" |
| 294 | "Regex used to find macro assignment lines in a makefile.") | 298 | "Regex used to find macro assignment lines in a makefile.") |
| 295 | 299 | ||
| @@ -544,7 +548,8 @@ This should identify a `make' command that can handle the `-q' option." | |||
| 544 | :type 'string | 548 | :type 'string |
| 545 | :group 'makefile) | 549 | :group 'makefile) |
| 546 | 550 | ||
| 547 | (defcustom makefile-query-one-target-method 'makefile-query-by-make-minus-q | 551 | (defcustom makefile-query-one-target-method-function |
| 552 | 'makefile-query-by-make-minus-q | ||
| 548 | "*Function to call to determine whether a make target is up to date. | 553 | "*Function to call to determine whether a make target is up to date. |
| 549 | The function must satisfy this calling convention: | 554 | The function must satisfy this calling convention: |
| 550 | 555 | ||
| @@ -560,6 +565,8 @@ The function must satisfy this calling convention: | |||
| 560 | makefile, any nonzero integer value otherwise." | 565 | makefile, any nonzero integer value otherwise." |
| 561 | :type 'function | 566 | :type 'function |
| 562 | :group 'makefile) | 567 | :group 'makefile) |
| 568 | (defvaralias 'makefile-query-one-target-method | ||
| 569 | 'makefile-query-one-target-method-function) | ||
| 563 | 570 | ||
| 564 | (defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*" | 571 | (defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*" |
| 565 | "*Name of the Up-to-date overview buffer." | 572 | "*Name of the Up-to-date overview buffer." |
| @@ -619,39 +626,38 @@ The function must satisfy this calling convention: | |||
| 619 | map) | 626 | map) |
| 620 | "The keymap that is used in Makefile mode.") | 627 | "The keymap that is used in Makefile mode.") |
| 621 | 628 | ||
| 622 | (defvar makefile-browser-map nil | 629 | |
| 630 | (defvar makefile-browser-map | ||
| 631 | (let ((map (make-sparse-keymap))) | ||
| 632 | (define-key map "n" 'makefile-browser-next-line) | ||
| 633 | (define-key map "\C-n" 'makefile-browser-next-line) | ||
| 634 | (define-key map "p" 'makefile-browser-previous-line) | ||
| 635 | (define-key map "\C-p" 'makefile-browser-previous-line) | ||
| 636 | (define-key map " " 'makefile-browser-toggle) | ||
| 637 | (define-key map "i" 'makefile-browser-insert-selection) | ||
| 638 | (define-key map "I" 'makefile-browser-insert-selection-and-quit) | ||
| 639 | (define-key map "\C-c\C-m" 'makefile-browser-insert-continuation) | ||
| 640 | (define-key map "q" 'makefile-browser-quit) | ||
| 641 | ;; disable horizontal movement | ||
| 642 | (define-key map "\C-b" 'undefined) | ||
| 643 | (define-key map "\C-f" 'undefined) | ||
| 644 | map) | ||
| 623 | "The keymap that is used in the macro- and target browser.") | 645 | "The keymap that is used in the macro- and target browser.") |
| 624 | (if makefile-browser-map | 646 | |
| 625 | () | 647 | |
| 626 | (setq makefile-browser-map (make-sparse-keymap)) | 648 | (defvar makefile-mode-syntax-table |
| 627 | (define-key makefile-browser-map "n" 'makefile-browser-next-line) | 649 | (let ((st (make-syntax-table))) |
| 628 | (define-key makefile-browser-map "\C-n" 'makefile-browser-next-line) | 650 | (modify-syntax-entry ?\( "() " st) |
| 629 | (define-key makefile-browser-map "p" 'makefile-browser-previous-line) | 651 | (modify-syntax-entry ?\) ")( " st) |
| 630 | (define-key makefile-browser-map "\C-p" 'makefile-browser-previous-line) | 652 | (modify-syntax-entry ?\[ "(] " st) |
| 631 | (define-key makefile-browser-map " " 'makefile-browser-toggle) | 653 | (modify-syntax-entry ?\] ")[ " st) |
| 632 | (define-key makefile-browser-map "i" 'makefile-browser-insert-selection) | 654 | (modify-syntax-entry ?\{ "(} " st) |
| 633 | (define-key makefile-browser-map "I" 'makefile-browser-insert-selection-and-quit) | 655 | (modify-syntax-entry ?\} "){ " st) |
| 634 | (define-key makefile-browser-map "\C-c\C-m" 'makefile-browser-insert-continuation) | 656 | (modify-syntax-entry ?\' "\" " st) |
| 635 | (define-key makefile-browser-map "q" 'makefile-browser-quit) | 657 | (modify-syntax-entry ?\` "\" " st) |
| 636 | ;; disable horizontal movement | 658 | (modify-syntax-entry ?# "< " st) |
| 637 | (define-key makefile-browser-map "\C-b" 'undefined) | 659 | (modify-syntax-entry ?\n "> " st) |
| 638 | (define-key makefile-browser-map "\C-f" 'undefined)) | 660 | st)) |
| 639 | |||
| 640 | |||
| 641 | (defvar makefile-mode-syntax-table nil) | ||
| 642 | (if makefile-mode-syntax-table | ||
| 643 | () | ||
| 644 | (setq makefile-mode-syntax-table (make-syntax-table)) | ||
| 645 | (modify-syntax-entry ?\( "() " makefile-mode-syntax-table) | ||
| 646 | (modify-syntax-entry ?\) ")( " makefile-mode-syntax-table) | ||
| 647 | (modify-syntax-entry ?\[ "(] " makefile-mode-syntax-table) | ||
| 648 | (modify-syntax-entry ?\] ")[ " makefile-mode-syntax-table) | ||
| 649 | (modify-syntax-entry ?\{ "(} " makefile-mode-syntax-table) | ||
| 650 | (modify-syntax-entry ?\} "){ " makefile-mode-syntax-table) | ||
| 651 | (modify-syntax-entry ?\' "\" " makefile-mode-syntax-table) | ||
| 652 | (modify-syntax-entry ?\` "\" " makefile-mode-syntax-table) | ||
| 653 | (modify-syntax-entry ?# "< " makefile-mode-syntax-table) | ||
| 654 | (modify-syntax-entry ?\n "> " makefile-mode-syntax-table)) | ||
| 655 | 661 | ||
| 656 | (defvar makefile-imake-mode-syntax-table (copy-syntax-table | 662 | (defvar makefile-imake-mode-syntax-table (copy-syntax-table |
| 657 | makefile-mode-syntax-table)) | 663 | makefile-mode-syntax-table)) |
| @@ -670,9 +676,11 @@ The function must satisfy this calling convention: | |||
| 670 | 676 | ||
| 671 | (defvar makefile-target-table nil | 677 | (defvar makefile-target-table nil |
| 672 | "Table of all target names known for this buffer.") | 678 | "Table of all target names known for this buffer.") |
| 679 | (put 'makefile-target-table 'risky-local-variable t) | ||
| 673 | 680 | ||
| 674 | (defvar makefile-macro-table nil | 681 | (defvar makefile-macro-table nil |
| 675 | "Table of all macro names known for this buffer.") | 682 | "Table of all macro names known for this buffer.") |
| 683 | (put 'makefile-macro-table 'risky-local-variable t) | ||
| 676 | 684 | ||
| 677 | (defvar makefile-browser-client | 685 | (defvar makefile-browser-client |
| 678 | "A buffer in Makefile mode that is currently using the browser.") | 686 | "A buffer in Makefile mode that is currently using the browser.") |
| @@ -724,11 +732,10 @@ The function must satisfy this calling convention: | |||
| 724 | 732 | ||
| 725 | If you are editing a file for a different make, try one of the | 733 | If you are editing a file for a different make, try one of the |
| 726 | variants `makefile-automake-mode', `makefile-gmake-mode', | 734 | variants `makefile-automake-mode', `makefile-gmake-mode', |
| 727 | `makefile-makepp-mode', `makefile-bsdmake-mode' or, | 735 | `makefile-makepp-mode', `makefile-bsdmake-mode' or, |
| 728 | `makefile-imake-mode'All but the | 736 | `makefile-imake-mode'. All but the last should be correctly |
| 729 | last should be correctly chosen based on the file name, except if | 737 | chosen based on the file name, except if it is *.mk. This |
| 730 | it is *.mk. This function ends by invoking the function(s) | 738 | function ends by invoking the function(s) `makefile-mode-hook'. |
| 731 | `makefile-mode-hook'. | ||
| 732 | 739 | ||
| 733 | It is strongly recommended to use `font-lock-mode', because that | 740 | It is strongly recommended to use `font-lock-mode', because that |
| 734 | provides additional parsing information. This is used for | 741 | provides additional parsing information. This is used for |
| @@ -1298,29 +1305,8 @@ definition and conveniently use this command." | |||
| 1298 | (beginning-of-line) | 1305 | (beginning-of-line) |
| 1299 | (cond | 1306 | (cond |
| 1300 | ((looking-at "^#+") | 1307 | ((looking-at "^#+") |
| 1301 | ;; Found a comment. Set the fill prefix, and find the paragraph | 1308 | ;; Found a comment. Return nil to let normal filling take place. |
| 1302 | ;; boundaries by searching for lines that look like comment-only | 1309 | nil) |
| 1303 | ;; lines. | ||
| 1304 | (let ((fill-prefix (match-string-no-properties 0)) | ||
| 1305 | (fill-paragraph-function nil)) | ||
| 1306 | (save-excursion | ||
| 1307 | (save-restriction | ||
| 1308 | (narrow-to-region | ||
| 1309 | ;; Search backwards. | ||
| 1310 | (save-excursion | ||
| 1311 | (while (and (zerop (forward-line -1)) | ||
| 1312 | (looking-at "^#"))) | ||
| 1313 | ;; We may have gone too far. Go forward again. | ||
| 1314 | (or (looking-at "^#") | ||
| 1315 | (forward-line 1)) | ||
| 1316 | (point)) | ||
| 1317 | ;; Search forwards. | ||
| 1318 | (save-excursion | ||
| 1319 | (while (looking-at "^#") | ||
| 1320 | (forward-line)) | ||
| 1321 | (point))) | ||
| 1322 | (fill-paragraph nil) | ||
| 1323 | t)))) | ||
| 1324 | 1310 | ||
| 1325 | ;; Must look for backslashed-region before looking for variable | 1311 | ;; Must look for backslashed-region before looking for variable |
| 1326 | ;; assignment. | 1312 | ;; assignment. |
| @@ -1349,7 +1335,9 @@ definition and conveniently use this command." | |||
| 1349 | (makefile-backslash-region (point-min) (point-max) nil) | 1335 | (makefile-backslash-region (point-min) (point-max) nil) |
| 1350 | (goto-char (point-max)) | 1336 | (goto-char (point-max)) |
| 1351 | (if (< (skip-chars-backward "\n") 0) | 1337 | (if (< (skip-chars-backward "\n") 0) |
| 1352 | (delete-region (point) (point-max)))))) | 1338 | (delete-region (point) (point-max))))) |
| 1339 | ;; Return non-nil to indicate it's been filled. | ||
| 1340 | t) | ||
| 1353 | 1341 | ||
| 1354 | ((looking-at makefile-macroassign-regex) | 1342 | ((looking-at makefile-macroassign-regex) |
| 1355 | ;; Have a macro assign. Fill just this line, and then backslash | 1343 | ;; Have a macro assign. Fill just this line, and then backslash |
| @@ -1358,10 +1346,13 @@ definition and conveniently use this command." | |||
| 1358 | (narrow-to-region (point) (line-beginning-position 2)) | 1346 | (narrow-to-region (point) (line-beginning-position 2)) |
| 1359 | (let ((fill-paragraph-function nil)) | 1347 | (let ((fill-paragraph-function nil)) |
| 1360 | (fill-paragraph nil)) | 1348 | (fill-paragraph nil)) |
| 1361 | (makefile-backslash-region (point-min) (point-max) nil))))) | 1349 | (makefile-backslash-region (point-min) (point-max) nil)) |
| 1350 | ;; Return non-nil to indicate it's been filled. | ||
| 1351 | t) | ||
| 1362 | 1352 | ||
| 1363 | ;; Always return non-nil so we don't fill anything else. | 1353 | (t |
| 1364 | t) | 1354 | ;; Return non-nil so we don't fill anything else. |
| 1355 | t)))) | ||
| 1365 | 1356 | ||
| 1366 | 1357 | ||
| 1367 | 1358 | ||
| @@ -1616,7 +1607,8 @@ with the generated name!" | |||
| 1616 | 1607 | ||
| 1617 | (defun makefile-query-targets (filename target-table prereq-list) | 1608 | (defun makefile-query-targets (filename target-table prereq-list) |
| 1618 | "Fill the up-to-date overview buffer. | 1609 | "Fill the up-to-date overview buffer. |
| 1619 | Checks each target in TARGET-TABLE using `makefile-query-one-target-method' | 1610 | Checks each target in TARGET-TABLE using |
| 1611 | `makefile-query-one-target-method-function' | ||
| 1620 | and generates the overview, one line per target name." | 1612 | and generates the overview, one line per target name." |
| 1621 | (insert | 1613 | (insert |
| 1622 | (mapconcat | 1614 | (mapconcat |
| @@ -1625,7 +1617,7 @@ and generates the overview, one line per target name." | |||
| 1625 | (no-prereqs (not (member target-name prereq-list))) | 1617 | (no-prereqs (not (member target-name prereq-list))) |
| 1626 | (needs-rebuild (or no-prereqs | 1618 | (needs-rebuild (or no-prereqs |
| 1627 | (funcall | 1619 | (funcall |
| 1628 | makefile-query-one-target-method | 1620 | makefile-query-one-target-method-function |
| 1629 | target-name | 1621 | target-name |
| 1630 | filename)))) | 1622 | filename)))) |
| 1631 | (format "\t%s%s" | 1623 | (format "\t%s%s" |
| @@ -1876,5 +1868,5 @@ If it isn't in one, return nil." | |||
| 1876 | 1868 | ||
| 1877 | (provide 'make-mode) | 1869 | (provide 'make-mode) |
| 1878 | 1870 | ||
| 1879 | ;;; arch-tag: bd23545a-de91-44fb-b1b2-feafbb2635a0 | 1871 | ;; arch-tag: bd23545a-de91-44fb-b1b2-feafbb2635a0 |
| 1880 | ;;; make-mode.el ends here | 1872 | ;;; make-mode.el ends here |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 0e73427a33c..b80fe4c0fbc 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -814,6 +814,18 @@ See `sh-feature'.") | |||
| 814 | (:weight bold))) | 814 | (:weight bold))) |
| 815 | "Face to show a here-document" | 815 | "Face to show a here-document" |
| 816 | :group 'sh-indentation) | 816 | :group 'sh-indentation) |
| 817 | |||
| 818 | ;; These colours are probably icky. It's just a placeholder though. | ||
| 819 | (defface sh-quoted-exec | ||
| 820 | '((((class color) (background dark)) | ||
| 821 | (:foreground "salmon")) | ||
| 822 | (((class color) (background light)) | ||
| 823 | (:foreground "magenta")) | ||
| 824 | (t | ||
| 825 | (:weight bold))) | ||
| 826 | "Face to show quoted execs like ``" | ||
| 827 | :group 'sh-indentation) | ||
| 828 | |||
| 817 | ;; backward-compatibility alias | 829 | ;; backward-compatibility alias |
| 818 | (put 'sh-heredoc-face 'face-alias 'sh-heredoc) | 830 | (put 'sh-heredoc-face 'face-alias 'sh-heredoc) |
| 819 | (defvar sh-heredoc-face 'sh-heredoc) | 831 | (defvar sh-heredoc-face 'sh-heredoc) |
| @@ -833,7 +845,7 @@ See `sh-feature'.") | |||
| 833 | font-lock-variable-name-face)) | 845 | font-lock-variable-name-face)) |
| 834 | 846 | ||
| 835 | (rc sh-append es) | 847 | (rc sh-append es) |
| 836 | 848 | (bash sh-append shell ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) )) | |
| 837 | (sh sh-append shell | 849 | (sh sh-append shell |
| 838 | ;; Variable names. | 850 | ;; Variable names. |
| 839 | ("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2 | 851 | ("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2 |
| @@ -967,6 +979,49 @@ Point is at the beginning of the next line." | |||
| 967 | ;; This looks silly, but it's because `sh-here-doc-re' keeps changing. | 979 | ;; This looks silly, but it's because `sh-here-doc-re' keeps changing. |
| 968 | (re-search-forward sh-here-doc-re limit t)) | 980 | (re-search-forward sh-here-doc-re limit t)) |
| 969 | 981 | ||
| 982 | (defun sh-quoted-subshell (limit) | ||
| 983 | "Search for a subshell embedded in a string. Find all the unescaped | ||
| 984 | \" characters within said subshell, remembering that subshells can nest." | ||
| 985 | (if (re-search-forward "\"\\(?:.\\|\n\\)*?\\(\\$(\\|`\\)" limit t) | ||
| 986 | ;; bingo we have a $( or a ` inside a "" | ||
| 987 | (let ((char (char-after (point))) | ||
| 988 | (continue t) | ||
| 989 | (pos (point)) | ||
| 990 | (data nil) ;; value to put into match-data (and return) | ||
| 991 | (last nil) ;; last char seen | ||
| 992 | (bq (equal (match-string 1) "`")) ;; ` state flip-flop | ||
| 993 | (seen nil) ;; list of important positions | ||
| 994 | (nest 1)) ;; subshell nesting level | ||
| 995 | (while (and continue char (<= pos limit)) | ||
| 996 | ;; unescaped " inside a $( ... ) construct. | ||
| 997 | ;; state machine time... | ||
| 998 | ;; \ => ignore next char; | ||
| 999 | ;; ` => increase or decrease nesting level based on bq flag | ||
| 1000 | ;; ) [where nesting > 0] => decrease nesting | ||
| 1001 | ;; ( [where nesting > 0] => increase nesting | ||
| 1002 | ;; ( [preceeded by $ ] => increase nesting | ||
| 1003 | ;; " [nesting <= 0 ] => terminate, we're done. | ||
| 1004 | ;; " [nesting > 0 ] => remember this, it's not a proper " | ||
| 1005 | (if (eq ?\\ last) nil | ||
| 1006 | (if (eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq)) | ||
| 1007 | (if (and (> nest 0) (eq ?\) char)) (setq nest (1- nest)) | ||
| 1008 | (if (and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest)) | ||
| 1009 | (if (and (> nest 0) (eq ?\( char)) (setq nest (1+ nest)) | ||
| 1010 | (if (eq char ?\") | ||
| 1011 | (if (>= 0 nest) (setq continue nil) | ||
| 1012 | (setq seen (cons pos seen)) ) )))))) | ||
| 1013 | ;;(message "POS: %d [%d]" pos nest) | ||
| 1014 | (setq last char | ||
| 1015 | pos (1+ pos) | ||
| 1016 | char (char-after pos)) ) | ||
| 1017 | (when seen | ||
| 1018 | ;;(message "SEEN: %S" seen) | ||
| 1019 | (setq data (list (current-buffer))) | ||
| 1020 | (mapc (lambda (P) | ||
| 1021 | (setq data (cons P (cons (1+ P) data)) ) ) seen) | ||
| 1022 | (store-match-data data)) | ||
| 1023 | data) )) | ||
| 1024 | |||
| 970 | (defun sh-is-quoted-p (pos) | 1025 | (defun sh-is-quoted-p (pos) |
| 971 | (and (eq (char-before pos) ?\\) | 1026 | (and (eq (char-before pos) ?\\) |
| 972 | (not (sh-is-quoted-p (1- pos))))) | 1027 | (not (sh-is-quoted-p (1- pos))))) |
| @@ -997,6 +1052,17 @@ Point is at the beginning of the next line." | |||
| 997 | (when (save-excursion (backward-char 2) (looking-at ";;\\|in")) | 1052 | (when (save-excursion (backward-char 2) (looking-at ";;\\|in")) |
| 998 | sh-st-punc))) | 1053 | sh-st-punc))) |
| 999 | 1054 | ||
| 1055 | (defun sh-apply-quoted-subshell () | ||
| 1056 | "Apply the `sh-st-punc' syntax to all the matches in `match-data'. | ||
| 1057 | This is used to flag quote characters in subshell constructs inside strings | ||
| 1058 | \(which should therefore not be treated as normal quote characters\)" | ||
| 1059 | (let ((m (match-data)) a b) | ||
| 1060 | (while m | ||
| 1061 | (setq a (car m) | ||
| 1062 | b (cadr m) | ||
| 1063 | m (cddr m)) | ||
| 1064 | (put-text-property a b 'syntax-table sh-st-punc))) sh-st-punc) | ||
| 1065 | |||
| 1000 | (defconst sh-font-lock-syntactic-keywords | 1066 | (defconst sh-font-lock-syntactic-keywords |
| 1001 | ;; A `#' begins a comment when it is unquoted and at the beginning of a | 1067 | ;; A `#' begins a comment when it is unquoted and at the beginning of a |
| 1002 | ;; word. In the shell, words are separated by metacharacters. | 1068 | ;; word. In the shell, words are separated by metacharacters. |
| @@ -1007,6 +1073,9 @@ Point is at the beginning of the next line." | |||
| 1007 | ("\\(\\\\\\)'" 1 ,sh-st-punc) | 1073 | ("\\(\\\\\\)'" 1 ,sh-st-punc) |
| 1008 | ;; Make sure $@ and @? are correctly recognized as sexps. | 1074 | ;; Make sure $@ and @? are correctly recognized as sexps. |
| 1009 | ("\\$\\([?@]\\)" 1 ,sh-st-symbol) | 1075 | ("\\$\\([?@]\\)" 1 ,sh-st-symbol) |
| 1076 | ;; highlight (possibly nested) subshells inside "" quoted regions correctly. | ||
| 1077 | (sh-quoted-subshell | ||
| 1078 | (1 (sh-apply-quoted-subshell) t t)) | ||
| 1010 | ;; Find HEREDOC starters and add a corresponding rule for the ender. | 1079 | ;; Find HEREDOC starters and add a corresponding rule for the ender. |
| 1011 | (sh-font-lock-here-doc | 1080 | (sh-font-lock-here-doc |
| 1012 | (2 (sh-font-lock-open-heredoc | 1081 | (2 (sh-font-lock-open-heredoc |
| @@ -1019,11 +1088,12 @@ Point is at the beginning of the next line." | |||
| 1019 | (")" 0 (sh-font-lock-paren (match-beginning 0))))) | 1088 | (")" 0 (sh-font-lock-paren (match-beginning 0))))) |
| 1020 | 1089 | ||
| 1021 | (defun sh-font-lock-syntactic-face-function (state) | 1090 | (defun sh-font-lock-syntactic-face-function (state) |
| 1022 | (if (nth 3 state) | 1091 | (let ((q (nth 3 state))) |
| 1023 | (if (characterp (nth 3 state)) | 1092 | (if q |
| 1024 | font-lock-string-face | 1093 | (if (characterp q) |
| 1025 | sh-heredoc-face) | 1094 | (if (eq q ?\`) 'sh-quoted-exec font-lock-string-face) |
| 1026 | font-lock-comment-face)) | 1095 | sh-heredoc-face) |
| 1096 | font-lock-comment-face))) | ||
| 1027 | 1097 | ||
| 1028 | (defgroup sh-indentation nil | 1098 | (defgroup sh-indentation nil |
| 1029 | "Variables controlling indentation in shell scripts. | 1099 | "Variables controlling indentation in shell scripts. |
| @@ -1390,11 +1460,11 @@ with your script for an edit-interpret-debug cycle." | |||
| 1390 | (make-local-variable 'sh-shell-file) | 1460 | (make-local-variable 'sh-shell-file) |
| 1391 | (make-local-variable 'sh-shell) | 1461 | (make-local-variable 'sh-shell) |
| 1392 | (make-local-variable 'skeleton-pair-alist) | 1462 | (make-local-variable 'skeleton-pair-alist) |
| 1393 | (make-local-variable 'skeleton-pair-filter) | 1463 | (make-local-variable 'skeleton-pair-filter-function) |
| 1394 | (make-local-variable 'comint-dynamic-complete-functions) | 1464 | (make-local-variable 'comint-dynamic-complete-functions) |
| 1395 | (make-local-variable 'comint-prompt-regexp) | 1465 | (make-local-variable 'comint-prompt-regexp) |
| 1396 | (make-local-variable 'font-lock-defaults) | 1466 | (make-local-variable 'font-lock-defaults) |
| 1397 | (make-local-variable 'skeleton-filter) | 1467 | (make-local-variable 'skeleton-filter-function) |
| 1398 | (make-local-variable 'skeleton-newline-indent-rigidly) | 1468 | (make-local-variable 'skeleton-newline-indent-rigidly) |
| 1399 | (make-local-variable 'sh-shell-variables) | 1469 | (make-local-variable 'sh-shell-variables) |
| 1400 | (make-local-variable 'sh-shell-variables-initialized) | 1470 | (make-local-variable 'sh-shell-variables-initialized) |
| @@ -1422,10 +1492,10 @@ with your script for an edit-interpret-debug cycle." | |||
| 1422 | (font-lock-syntactic-face-function | 1492 | (font-lock-syntactic-face-function |
| 1423 | . sh-font-lock-syntactic-face-function)) | 1493 | . sh-font-lock-syntactic-face-function)) |
| 1424 | skeleton-pair-alist '((?` _ ?`)) | 1494 | skeleton-pair-alist '((?` _ ?`)) |
| 1425 | skeleton-pair-filter 'sh-quoted-p | 1495 | skeleton-pair-filter-function 'sh-quoted-p |
| 1426 | skeleton-further-elements '((< '(- (min sh-indentation | 1496 | skeleton-further-elements '((< '(- (min sh-indentation |
| 1427 | (current-column))))) | 1497 | (current-column))))) |
| 1428 | skeleton-filter 'sh-feature | 1498 | skeleton-filter-function 'sh-feature |
| 1429 | skeleton-newline-indent-rigidly t | 1499 | skeleton-newline-indent-rigidly t |
| 1430 | sh-indent-supported-here nil) | 1500 | sh-indent-supported-here nil) |
| 1431 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | 1501 | (set (make-local-variable 'parse-sexp-ignore-comments) t) |