diff options
| author | Karoly Lorentey | 2006-07-29 09:59:12 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-07-29 09:59:12 +0000 |
| commit | 251bc578cc636223d618d06cf2a2bb7d07db9cce (patch) | |
| tree | 58e1c6b0a35bb4a77e6cb77876e4bc6a9d3f2ab2 /lisp/progmodes | |
| parent | 99715bbc447eb633e45ffa23b87284771ce3ac74 (diff) | |
| parent | 0ed0527cb02180a50f6744086ce3a487740c73e4 (diff) | |
| download | emacs-251bc578cc636223d618d06cf2a2bb7d07db9cce.tar.gz emacs-251bc578cc636223d618d06cf2a2bb7d07db9cce.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-351
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-352
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-353
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-354
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-355
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-356
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-357
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-358
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-359
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-360
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-361
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-362
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-363
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-364
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-365
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-366
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-367
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-368
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-369
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-370
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-115
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-116
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-117
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-118
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-119
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-120
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-573
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/ada-mode.el | 82 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 71 | ||||
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 76 | ||||
| -rw-r--r-- | lisp/progmodes/delphi.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 24 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/idlw-shell.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/ld-script.el | 55 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 90 | ||||
| -rw-r--r-- | lisp/progmodes/which-func.el | 4 |
11 files changed, 250 insertions, 168 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 9dc74264da8..bc00d859c2d 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el | |||
| @@ -1208,60 +1208,36 @@ If you use ada-xref.el: | |||
| 1208 | ff-file-created-hook 'ada-make-body) | 1208 | ff-file-created-hook 'ada-make-body) |
| 1209 | (add-hook 'ff-pre-load-hook 'ada-which-function-are-we-in) | 1209 | (add-hook 'ff-pre-load-hook 'ada-which-function-are-we-in) |
| 1210 | 1210 | ||
| 1211 | ;; Some special constructs for find-file.el | 1211 | ;; Some special constructs for find-file.el. |
| 1212 | ;; We do not need to add the construction for 'with', which is in the | ||
| 1213 | ;; standard find-file.el | ||
| 1214 | (make-local-variable 'ff-special-constructs) | 1212 | (make-local-variable 'ff-special-constructs) |
| 1215 | 1213 | (mapc (lambda (pair) | |
| 1216 | ;; Go to the parent package : | 1214 | (add-to-list 'ff-special-constructs pair)) |
| 1217 | (add-to-list 'ff-special-constructs | 1215 | `( |
| 1218 | (cons (eval-when-compile | 1216 | ;; Go to the parent package. |
| 1219 | (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+" | 1217 | (,(eval-when-compile |
| 1220 | "\\(body[ \t]+\\)?" | 1218 | (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+" |
| 1221 | "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is")) | 1219 | "\\(body[ \t]+\\)?" |
| 1222 | (lambda () | 1220 | "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is")) |
| 1223 | (if (fboundp 'ff-get-file) | 1221 | . ,(lambda () |
| 1224 | (if (boundp 'fname) | 1222 | (ff-get-file |
| 1225 | (set 'fname (ff-get-file | 1223 | ada-search-directories-internal |
| 1226 | ada-search-directories-internal | 1224 | (ada-make-filename-from-adaname (match-string 3)) |
| 1227 | (ada-make-filename-from-adaname | 1225 | ada-spec-suffixes))) |
| 1228 | (match-string 3)) | 1226 | ;; A "separate" clause. |
| 1229 | ada-spec-suffixes))))))) | 1227 | ("^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))" |
| 1230 | ;; Another special construct for find-file.el : when in a separate clause, | 1228 | . ,(lambda () |
| 1231 | ;; go to the correct package. | 1229 | (ff-get-file |
| 1232 | (add-to-list 'ff-special-constructs | 1230 | ada-search-directories-internal |
| 1233 | (cons "^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))" | 1231 | (ada-make-filename-from-adaname (match-string 1)) |
| 1234 | (lambda () | 1232 | ada-spec-suffixes))) |
| 1235 | (if (fboundp 'ff-get-file) | 1233 | ;; A "with" clause. |
| 1236 | (if (boundp 'fname) | 1234 | ("^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" |
| 1237 | (setq fname (ff-get-file | 1235 | . ,(lambda () |
| 1238 | ada-search-directories-internal | 1236 | (ff-get-file |
| 1239 | (ada-make-filename-from-adaname | 1237 | ada-search-directories-internal |
| 1240 | (match-string 1)) | 1238 | (ada-make-filename-from-adaname (match-string 1)) |
| 1241 | ada-spec-suffixes))))))) | 1239 | ada-spec-suffixes))) |
| 1242 | 1240 | )) | |
| 1243 | ;; Another special construct, that redefines the one in find-file.el. The | ||
| 1244 | ;; old one can handle only one possible type of extension for Ada files | ||
| 1245 | ;; remove from the list the standard "with..." that is put by find-file.el, | ||
| 1246 | ;; since it uses the old ada-spec-suffix variable | ||
| 1247 | ;; This one needs to replace the standard one defined in find-file.el (with | ||
| 1248 | ;; Emacs <= 20.4), since that one uses the old variable ada-spec-suffix | ||
| 1249 | (let ((old-construct | ||
| 1250 | (assoc "^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" ff-special-constructs)) | ||
| 1251 | (new-cdr | ||
| 1252 | (lambda () | ||
| 1253 | (if (fboundp 'ff-get-file) | ||
| 1254 | (if (boundp 'fname) | ||
| 1255 | (set 'fname (ff-get-file | ||
| 1256 | ada-search-directories-internal | ||
| 1257 | (ada-make-filename-from-adaname | ||
| 1258 | (match-string 1)) | ||
| 1259 | ada-spec-suffixes))))))) | ||
| 1260 | (if old-construct | ||
| 1261 | (setcdr old-construct new-cdr) | ||
| 1262 | (add-to-list 'ff-special-constructs | ||
| 1263 | (cons "^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" | ||
| 1264 | new-cdr)))) | ||
| 1265 | 1241 | ||
| 1266 | ;; Support for outline-minor-mode | 1242 | ;; Support for outline-minor-mode |
| 1267 | (set (make-local-variable 'outline-regexp) | 1243 | (set (make-local-variable 'outline-regexp) |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index e7a0d03cc55..d29e75e92f0 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -134,12 +134,18 @@ | |||
| 134 | 134 | ||
| 135 | (eval-and-compile | 135 | (eval-and-compile |
| 136 | ;; These are used to collect the init forms from the subsequent | 136 | ;; These are used to collect the init forms from the subsequent |
| 137 | ;; `c-lang-defvar'. They are used to build the lambda in | 137 | ;; `c-lang-defvar' and `c-lang-setvar'. They are used to build the |
| 138 | ;; `c-make-init-lang-vars-fun' below. | 138 | ;; lambda in `c-make-init-lang-vars-fun' below, and to build `defvar's |
| 139 | ;; and `make-variable-buffer-local's in cc-engine and | ||
| 140 | ;; `make-local-variable's in `c-init-language-vars-for'. | ||
| 139 | (defvar c-lang-variable-inits nil) | 141 | (defvar c-lang-variable-inits nil) |
| 140 | (defvar c-lang-variable-inits-tail nil) | 142 | (defvar c-lang-variable-inits-tail nil) |
| 141 | (setq c-lang-variable-inits (list nil) | 143 | (setq c-lang-variable-inits (list nil) |
| 142 | c-lang-variable-inits-tail c-lang-variable-inits)) | 144 | c-lang-variable-inits-tail c-lang-variable-inits) |
| 145 | (defvar c-emacs-variable-inits nil) | ||
| 146 | (defvar c-emacs-variable-inits-tail nil) | ||
| 147 | (setq c-emacs-variable-inits (list nil) | ||
| 148 | c-emacs-variable-inits-tail c-emacs-variable-inits)) | ||
| 143 | 149 | ||
| 144 | (defmacro c-lang-defvar (var val &optional doc) | 150 | (defmacro c-lang-defvar (var val &optional doc) |
| 145 | "Declares the buffer local variable VAR to get the value VAL. VAL is | 151 | "Declares the buffer local variable VAR to get the value VAL. VAL is |
| @@ -172,6 +178,25 @@ the evaluated constant value at compile time." | |||
| 172 | ;; Return the symbol, like the other def* forms. | 178 | ;; Return the symbol, like the other def* forms. |
| 173 | `',var) | 179 | `',var) |
| 174 | 180 | ||
| 181 | (defmacro c-lang-setvar (var val) | ||
| 182 | "Causes the variable VAR to be made buffer local and to get set to the | ||
| 183 | value VAL. VAL is evaluated and assigned at mode initialization. More | ||
| 184 | precisely, VAL is evaluated and bound to VAR when the result from the | ||
| 185 | macro `c-init-language-vars' is evaluated. VAR is typically a standard | ||
| 186 | Emacs variable like `comment-start'. | ||
| 187 | |||
| 188 | `c-lang-const' is typically used in VAL to get the right value for the | ||
| 189 | language being initialized, and such calls will be macro expanded to | ||
| 190 | the evaluated constant value at compile time." | ||
| 191 | (let ((elem (assq var (cdr c-emacs-variable-inits)))) | ||
| 192 | (if elem | ||
| 193 | (setcdr elem (list val)) ; Maybe remove "list", sometime. 2006-07-19 | ||
| 194 | (setcdr c-emacs-variable-inits-tail (list (list var val))) | ||
| 195 | (setq c-emacs-variable-inits-tail (cdr c-emacs-variable-inits-tail)))) | ||
| 196 | |||
| 197 | ;; Return the symbol, like the other def* forms. | ||
| 198 | `',var) | ||
| 199 | |||
| 175 | (put 'c-lang-defvar 'lisp-indent-function 'defun) | 200 | (put 'c-lang-defvar 'lisp-indent-function 'defun) |
| 176 | ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. | 201 | ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. |
| 177 | ; ' | 202 | ; ' |
| @@ -1103,8 +1128,7 @@ properly." | |||
| 1103 | ;; In C we still default to the block comment style since line | 1128 | ;; In C we still default to the block comment style since line |
| 1104 | ;; comments aren't entirely portable. | 1129 | ;; comments aren't entirely portable. |
| 1105 | c "/* ") | 1130 | c "/* ") |
| 1106 | (c-lang-defvar comment-start (c-lang-const comment-start) | 1131 | (c-lang-setvar comment-start (c-lang-const comment-start)) |
| 1107 | 'dont-doc) | ||
| 1108 | 1132 | ||
| 1109 | (c-lang-defconst comment-end | 1133 | (c-lang-defconst comment-end |
| 1110 | "String that ends comments inserted with M-; etc. | 1134 | "String that ends comments inserted with M-; etc. |
| @@ -1117,8 +1141,7 @@ properly." | |||
| 1117 | (c-lang-const comment-start)) | 1141 | (c-lang-const comment-start)) |
| 1118 | (concat " " (c-lang-const c-block-comment-ender)) | 1142 | (concat " " (c-lang-const c-block-comment-ender)) |
| 1119 | "")) | 1143 | "")) |
| 1120 | (c-lang-defvar comment-end (c-lang-const comment-end) | 1144 | (c-lang-setvar comment-end (c-lang-const comment-end)) |
| 1121 | 'dont-doc) | ||
| 1122 | 1145 | ||
| 1123 | (c-lang-defconst comment-start-skip | 1146 | (c-lang-defconst comment-start-skip |
| 1124 | "Regexp to match the start of a comment plus everything up to its body. | 1147 | "Regexp to match the start of a comment plus everything up to its body. |
| @@ -1134,8 +1157,7 @@ properly." | |||
| 1134 | (c-lang-const c-block-comment-starter))) | 1157 | (c-lang-const c-block-comment-starter))) |
| 1135 | "\\|") | 1158 | "\\|") |
| 1136 | "\\)\\s *")) | 1159 | "\\)\\s *")) |
| 1137 | (c-lang-defvar comment-start-skip (c-lang-const comment-start-skip) | 1160 | (c-lang-setvar comment-start-skip (c-lang-const comment-start-skip)) |
| 1138 | 'dont-doc) | ||
| 1139 | 1161 | ||
| 1140 | (c-lang-defconst c-syntactic-ws-start | 1162 | (c-lang-defconst c-syntactic-ws-start |
| 1141 | ;; Regexp matching any sequence that can start syntactic whitespace. | 1163 | ;; Regexp matching any sequence that can start syntactic whitespace. |
| @@ -2806,9 +2828,10 @@ way." | |||
| 2806 | ;;; Wrap up the `c-lang-defvar' system. | 2828 | ;;; Wrap up the `c-lang-defvar' system. |
| 2807 | 2829 | ||
| 2808 | ;; Compile in the list of language variables that has been collected | 2830 | ;; Compile in the list of language variables that has been collected |
| 2809 | ;; with the `c-lang-defvar' macro. Note that the first element is | 2831 | ;; with the `c-lang-defvar' and `c-lang-setvar' macros. Note that the |
| 2810 | ;; nil. | 2832 | ;; first element of each is nil. |
| 2811 | (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits)) | 2833 | (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits)) |
| 2834 | (defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits)) | ||
| 2812 | 2835 | ||
| 2813 | (defun c-make-init-lang-vars-fun (mode) | 2836 | (defun c-make-init-lang-vars-fun (mode) |
| 2814 | "Create a function that initializes all the language dependent variables | 2837 | "Create a function that initializes all the language dependent variables |
| @@ -2841,12 +2864,16 @@ accomplish that conveniently." | |||
| 2841 | ;; `c-lang-const' will expand to the evaluated | 2864 | ;; `c-lang-const' will expand to the evaluated |
| 2842 | ;; constant immediately in `cl-macroexpand-all' | 2865 | ;; constant immediately in `cl-macroexpand-all' |
| 2843 | ;; below. | 2866 | ;; below. |
| 2844 | (mapcan | 2867 | (mapcan |
| 2845 | (lambda (init) | 2868 | (lambda (init) |
| 2846 | `(current-var ',(car init) | 2869 | `(current-var ',(car init) |
| 2847 | ,(car init) ,(cl-macroexpand-all | 2870 | ,(car init) ,(cl-macroexpand-all |
| 2848 | (elt init 1)))) | 2871 | (elt init 1)))) |
| 2849 | (cdr c-lang-variable-inits)))) | 2872 | ;; Note: The following `append' copies the |
| 2873 | ;; first argument. That list is small, so | ||
| 2874 | ;; this doesn't matter too much. | ||
| 2875 | (append (cdr c-emacs-variable-inits) | ||
| 2876 | (cdr c-lang-variable-inits))))) | ||
| 2850 | 2877 | ||
| 2851 | ;; This diagnostic message isn't useful for end | 2878 | ;; This diagnostic message isn't useful for end |
| 2852 | ;; users, so it's disabled. | 2879 | ;; users, so it's disabled. |
| @@ -2859,7 +2886,8 @@ accomplish that conveniently." | |||
| 2859 | 2886 | ||
| 2860 | (require 'cc-langs) | 2887 | (require 'cc-langs) |
| 2861 | (setq source-eval t) | 2888 | (setq source-eval t) |
| 2862 | (let ((init (cdr c-lang-variable-inits))) | 2889 | (let ((init (append (cdr c-emacs-variable-inits) |
| 2890 | (cdr c-lang-variable-inits)))) | ||
| 2863 | (while init | 2891 | (while init |
| 2864 | (setq current-var (caar init)) | 2892 | (setq current-var (caar init)) |
| 2865 | (set (caar init) (eval (cadar init))) | 2893 | (set (caar init) (eval (cadar init))) |
| @@ -2867,7 +2895,7 @@ accomplish that conveniently." | |||
| 2867 | 2895 | ||
| 2868 | (error | 2896 | (error |
| 2869 | (if current-var | 2897 | (if current-var |
| 2870 | (message "Eval error in the `c-lang-defvar' for `%s'%s: %S" | 2898 | (message "Eval error in the `c-lang-defvar' or `c-lang-setvar' for `%s'%s: %S" |
| 2871 | current-var | 2899 | current-var |
| 2872 | (if source-eval | 2900 | (if source-eval |
| 2873 | (format "\ | 2901 | (format "\ |
| @@ -2883,7 +2911,8 @@ accomplish that conveniently." | |||
| 2883 | `(lambda () | 2911 | `(lambda () |
| 2884 | (require 'cc-langs) | 2912 | (require 'cc-langs) |
| 2885 | (let ((c-buffer-is-cc-mode ',mode) | 2913 | (let ((c-buffer-is-cc-mode ',mode) |
| 2886 | (init (cdr c-lang-variable-inits)) | 2914 | (init (append (cdr c-emacs-variable-inits) |
| 2915 | (cdr c-lang-variable-inits))) | ||
| 2887 | current-var) | 2916 | current-var) |
| 2888 | (condition-case err | 2917 | (condition-case err |
| 2889 | 2918 | ||
| @@ -2895,7 +2924,7 @@ accomplish that conveniently." | |||
| 2895 | (error | 2924 | (error |
| 2896 | (if current-var | 2925 | (if current-var |
| 2897 | (message | 2926 | (message |
| 2898 | "Eval error in the `c-lang-defvar' for `%s' (source eval): %S" | 2927 | "Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S" |
| 2899 | current-var err) | 2928 | current-var err) |
| 2900 | (signal (car err) (cdr err))))))) | 2929 | (signal (car err) (cdr err))))))) |
| 2901 | )) | 2930 | )) |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 7343ec735ea..eb5ae4b63b6 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -153,12 +153,21 @@ | |||
| 153 | (defun c-leave-cc-mode-mode () | 153 | (defun c-leave-cc-mode-mode () |
| 154 | (setq c-buffer-is-cc-mode nil)) | 154 | (setq c-buffer-is-cc-mode nil)) |
| 155 | 155 | ||
| 156 | ;; Make the `c-lang-setvar' variables buffer local in the current buffer. | ||
| 157 | ;; These are typically standard emacs variables such as `comment-start'. | ||
| 158 | (defmacro c-make-emacs-variables-local () | ||
| 159 | `(progn | ||
| 160 | ,@(mapcan (lambda (init) | ||
| 161 | `((make-local-variable ',(car init)))) | ||
| 162 | (cdr c-emacs-variable-inits)))) | ||
| 163 | |||
| 156 | (defun c-init-language-vars-for (mode) | 164 | (defun c-init-language-vars-for (mode) |
| 157 | "Initialize the language variables for one of the language modes | 165 | "Initialize the language variables for one of the language modes |
| 158 | directly supported by CC Mode. This can be used instead of the | 166 | directly supported by CC Mode. This can be used instead of the |
| 159 | `c-init-language-vars' macro if the language you want to use is one of | 167 | `c-init-language-vars' macro if the language you want to use is one of |
| 160 | those, rather than a derived language defined through the language | 168 | those, rather than a derived language defined through the language |
| 161 | variable system (see \"cc-langs.el\")." | 169 | variable system (see \"cc-langs.el\")." |
| 170 | (c-make-emacs-variables-local) | ||
| 162 | (cond ((eq mode 'c-mode) (c-init-language-vars c-mode)) | 171 | (cond ((eq mode 'c-mode) (c-init-language-vars c-mode)) |
| 163 | ((eq mode 'c++-mode) (c-init-language-vars c++-mode)) | 172 | ((eq mode 'c++-mode) (c-init-language-vars c++-mode)) |
| 164 | ((eq mode 'objc-mode) (c-init-language-vars objc-mode)) | 173 | ((eq mode 'objc-mode) (c-init-language-vars objc-mode)) |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 3c63d5f01b1..e8c09113d39 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -226,14 +226,19 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 226 | ;; I have no idea what this first line is supposed to match, but it | 226 | ;; I have no idea what this first line is supposed to match, but it |
| 227 | ;; makes things ambiguous with output such as "foo:344:50:blabla" since | 227 | ;; makes things ambiguous with output such as "foo:344:50:blabla" since |
| 228 | ;; the "foo" part can match this first line (in which case the file | 228 | ;; the "foo" part can match this first line (in which case the file |
| 229 | ;; name as "344"). To avoid this, we disallow filenames exclusively | 229 | ;; name as "344"). To avoid this, the second line disallows filenames |
| 230 | ;; composed of digits. --Stef | 230 | ;; exclusively composed of digits. --Stef |
| 231 | ;; Similarly, we get lots of false positives with messages including | ||
| 232 | ;; times of the form "HH:MM:SS" where MM is taken as a line number, so | ||
| 233 | ;; the last line tries to rule out message where the info after the | ||
| 234 | ;; line number starts with "SS". --Stef | ||
| 231 | "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\ | 235 | "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\ |
| 232 | \\([0-9]*[^0-9\n].*?\\): ?\ | 236 | \\([0-9]*[^0-9\n].*?\\): ?\ |
| 233 | \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\ | 237 | \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\ |
| 234 | \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\ | 238 | \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\ |
| 235 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ | 239 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ |
| 236 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\)?" | 240 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\|\ |
| 241 | \[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" | ||
| 237 | 1 (2 . 5) (4 . 6) (7 . 8)) | 242 | 1 (2 . 5) (4 . 6) (7 . 8)) |
| 238 | 243 | ||
| 239 | (lcc | 244 | (lcc |
| @@ -405,10 +410,7 @@ you may also want to change `compilation-page-delimiter'.") | |||
| 405 | "Value of `page-delimiter' in Compilation mode.") | 410 | "Value of `page-delimiter' in Compilation mode.") |
| 406 | 411 | ||
| 407 | (defvar compilation-mode-font-lock-keywords | 412 | (defvar compilation-mode-font-lock-keywords |
| 408 | '(;; Don't highlight this as a compilation message. | 413 | '(;; configure output lines. |
| 409 | ("^Compilation started at.*" | ||
| 410 | (0 '(face nil message nil help-echo nil mouse-face nil) t)) | ||
| 411 | ;; configure output lines. | ||
| 412 | ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" | 414 | ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" |
| 413 | (1 font-lock-variable-name-face) | 415 | (1 font-lock-variable-name-face) |
| 414 | (2 (compilation-face '(4 . 3)))) | 416 | (2 (compilation-face '(4 . 3)))) |
| @@ -419,7 +421,7 @@ you may also want to change `compilation-page-delimiter'.") | |||
| 419 | ("^Compilation \\(finished\\).*" | 421 | ("^Compilation \\(finished\\).*" |
| 420 | (0 '(face nil message nil help-echo nil mouse-face nil) t) | 422 | (0 '(face nil message nil help-echo nil mouse-face nil) t) |
| 421 | (1 compilation-info-face)) | 423 | (1 compilation-info-face)) |
| 422 | ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*" | 424 | ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\|segmentation fault\\)\\(?:.*with code \\([0-9]+\\)\\)?.*" |
| 423 | (0 '(face nil message nil help-echo nil mouse-face nil) t) | 425 | (0 '(face nil message nil help-echo nil mouse-face nil) t) |
| 424 | (1 compilation-error-face) | 426 | (1 compilation-error-face) |
| 425 | (2 compilation-error-face nil t))) | 427 | (2 compilation-error-face nil t))) |
| @@ -1823,28 +1825,44 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." | |||
| 1823 | (find-file-noselect name)) | 1825 | (find-file-noselect name)) |
| 1824 | fmts (cdr fmts))) | 1826 | fmts (cdr fmts))) |
| 1825 | (setq dirs (cdr dirs))) | 1827 | (setq dirs (cdr dirs))) |
| 1826 | (or buffer | 1828 | (while (null buffer) ;Repeat until the user selects an existing file. |
| 1827 | ;; The file doesn't exist. Ask the user where to find it. | 1829 | ;; The file doesn't exist. Ask the user where to find it. |
| 1828 | (save-excursion ;This save-excursion is probably not right. | 1830 | (save-excursion ;This save-excursion is probably not right. |
| 1829 | (let ((pop-up-windows t)) | 1831 | (let ((pop-up-windows t)) |
| 1830 | (compilation-set-window (display-buffer (marker-buffer marker)) | 1832 | (compilation-set-window (display-buffer (marker-buffer marker)) |
| 1831 | marker) | 1833 | marker) |
| 1832 | (let ((name (expand-file-name | 1834 | (let* ((name (read-file-name |
| 1833 | (read-file-name | 1835 | (format "Find this %s in (default %s): " |
| 1834 | (format "Find this %s in (default %s): " | 1836 | compilation-error filename) |
| 1835 | compilation-error filename) | 1837 | spec-dir filename t nil |
| 1836 | spec-dir filename t)))) | 1838 | ;; Try to make sure the user can only select |
| 1837 | (if (file-directory-p name) | 1839 | ;; a valid answer. This predicate may be ignored, |
| 1838 | (setq name (expand-file-name filename name))) | 1840 | ;; tho, so we still have to double-check afterwards. |
| 1839 | (setq buffer (and (file-exists-p name) | 1841 | ;; TODO: We should probably fix read-file-name so |
| 1840 | (find-file-noselect name))))))) | 1842 | ;; that it never ignores this predicate, even when |
| 1843 | ;; using popup dialog boxes. | ||
| 1844 | (lambda (name) | ||
| 1845 | (if (file-directory-p name) | ||
| 1846 | (setq name (expand-file-name filename name))) | ||
| 1847 | (file-exists-p name)))) | ||
| 1848 | (origname name)) | ||
| 1849 | (cond | ||
| 1850 | ((not (file-exists-p name)) | ||
| 1851 | (message "Cannot find file `%s'" name) | ||
| 1852 | (ding) (sit-for 2)) | ||
| 1853 | ((and (file-directory-p name) | ||
| 1854 | (not (file-exists-p | ||
| 1855 | (setq name (expand-file-name filename name))))) | ||
| 1856 | (message "No `%s' in directory %s" filename origname) | ||
| 1857 | (ding) (sit-for 2)) | ||
| 1858 | (t | ||
| 1859 | (setq buffer (find-file-noselect name)))))))) | ||
| 1841 | ;; Make intangible overlays tangible. | 1860 | ;; Make intangible overlays tangible. |
| 1842 | ;; This is very weird: it's not even clear which is the current buffer, | 1861 | ;; This is weird: it's not even clear which is the current buffer, |
| 1843 | ;; so the code below can't be expected to DTRT here. --Stef | 1862 | ;; so the code below can't be expected to DTRT here. -- Stef |
| 1844 | (mapcar (function (lambda (ov) | 1863 | (dolist (ov (overlays-in (point-min) (point-max))) |
| 1845 | (when (overlay-get ov 'intangible) | 1864 | (when (overlay-get ov 'intangible) |
| 1846 | (overlay-put ov 'intangible nil)))) | 1865 | (overlay-put ov 'intangible nil))) |
| 1847 | (overlays-in (point-min) (point-max))) | ||
| 1848 | buffer)) | 1866 | buffer)) |
| 1849 | 1867 | ||
| 1850 | (defun compilation-get-file-structure (file &optional fmt) | 1868 | (defun compilation-get-file-structure (file &optional fmt) |
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el index 03ab24adf47..44a192ab772 100644 --- a/lisp/progmodes/delphi.el +++ b/lisp/progmodes/delphi.el | |||
| @@ -1767,6 +1767,7 @@ it is a routine." | |||
| 1767 | An error is raised if not in a comment." | 1767 | An error is raised if not in a comment." |
| 1768 | (interactive) | 1768 | (interactive) |
| 1769 | (save-excursion | 1769 | (save-excursion |
| 1770 | (save-restriction | ||
| 1770 | (let* ((comment (delphi-current-token)) | 1771 | (let* ((comment (delphi-current-token)) |
| 1771 | (comment-kind (delphi-token-kind comment))) | 1772 | (comment-kind (delphi-token-kind comment))) |
| 1772 | (if (not (delphi-is comment-kind delphi-comments)) | 1773 | (if (not (delphi-is comment-kind delphi-comments)) |
| @@ -1845,7 +1846,7 @@ An error is raised if not in a comment." | |||
| 1845 | ;; React to the entire fill change as a whole. | 1846 | ;; React to the entire fill change as a whole. |
| 1846 | (delphi-progress-start) | 1847 | (delphi-progress-start) |
| 1847 | (delphi-parse-region comment-start comment-end) | 1848 | (delphi-parse-region comment-start comment-end) |
| 1848 | (delphi-progress-done)))))) | 1849 | (delphi-progress-done))))))) |
| 1849 | 1850 | ||
| 1850 | (defun delphi-new-comment-line () | 1851 | (defun delphi-new-comment-line () |
| 1851 | "If in a // comment, does a newline, indented such that one is still in the | 1852 | "If in a // comment, does a newline, indented such that one is still in the |
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 810a7b3e973..dca6fa16df0 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -434,7 +434,8 @@ With arg, use separate IO iff arg is positive." | |||
| 434 | (make-local-variable 'gdb-define-alist) | 434 | (make-local-variable 'gdb-define-alist) |
| 435 | (gdb-create-define-alist) | 435 | (gdb-create-define-alist) |
| 436 | (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))) | 436 | (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))) |
| 437 | (gdb-force-mode-line-update "ready")) | 437 | (gdb-force-mode-line-update |
| 438 | (propertize "ready" 'face font-lock-variable-name-face))) | ||
| 438 | 439 | ||
| 439 | (defun gdb-find-watch-expression () | 440 | (defun gdb-find-watch-expression () |
| 440 | (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)) | 441 | (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)) |
| @@ -1209,7 +1210,8 @@ This filter may simply queue input for a later time." | |||
| 1209 | (defun gdb-resync() | 1210 | (defun gdb-resync() |
| 1210 | (setq gdb-flush-pending-output t) | 1211 | (setq gdb-flush-pending-output t) |
| 1211 | (setq gud-running nil) | 1212 | (setq gud-running nil) |
| 1212 | (gdb-force-mode-line-update "stopped") | 1213 | (gdb-force-mode-line-update |
| 1214 | (propertize "stopped"'face font-lock-warning-face)) | ||
| 1213 | (setq gdb-output-sink 'user) | 1215 | (setq gdb-output-sink 'user) |
| 1214 | (setq gdb-input-queue nil) | 1216 | (setq gdb-input-queue nil) |
| 1215 | (setq gdb-pending-triggers nil) | 1217 | (setq gdb-pending-triggers nil) |
| @@ -1249,7 +1251,8 @@ happens to be in effect." | |||
| 1249 | "An annotation handler for `prompt'. | 1251 | "An annotation handler for `prompt'. |
| 1250 | This sends the next command (if any) to gdb." | 1252 | This sends the next command (if any) to gdb." |
| 1251 | (when gdb-first-prompt | 1253 | (when gdb-first-prompt |
| 1252 | (gdb-force-mode-line-update "initializing...") | 1254 | (gdb-force-mode-line-update |
| 1255 | (propertize "initializing..." 'face font-lock-variable-name-face)) | ||
| 1253 | (gdb-init-1) | 1256 | (gdb-init-1) |
| 1254 | (setq gdb-first-prompt nil)) | 1257 | (setq gdb-first-prompt nil)) |
| 1255 | (let ((sink gdb-output-sink)) | 1258 | (let ((sink gdb-output-sink)) |
| @@ -1287,7 +1290,8 @@ not GDB." | |||
| 1287 | (progn | 1290 | (progn |
| 1288 | (setq gud-running t) | 1291 | (setq gud-running t) |
| 1289 | (setq gdb-inferior-status "running") | 1292 | (setq gdb-inferior-status "running") |
| 1290 | (gdb-force-mode-line-update gdb-inferior-status) | 1293 | (gdb-force-mode-line-update |
| 1294 | (propertize gdb-inferior-status 'face font-lock-type-face)) | ||
| 1291 | (gdb-remove-text-properties) | 1295 | (gdb-remove-text-properties) |
| 1292 | (setq gud-old-arrow gud-overlay-arrow-position) | 1296 | (setq gud-old-arrow gud-overlay-arrow-position) |
| 1293 | (setq gud-overlay-arrow-position nil) | 1297 | (setq gud-overlay-arrow-position nil) |
| @@ -1300,7 +1304,8 @@ not GDB." | |||
| 1300 | 1304 | ||
| 1301 | (defun gdb-signal (ignored) | 1305 | (defun gdb-signal (ignored) |
| 1302 | (setq gdb-inferior-status "signal") | 1306 | (setq gdb-inferior-status "signal") |
| 1303 | (gdb-force-mode-line-update gdb-inferior-status) | 1307 | (gdb-force-mode-line-update |
| 1308 | (propertize gdb-inferior-status 'face font-lock-warning-face)) | ||
| 1304 | (gdb-stopping ignored)) | 1309 | (gdb-stopping ignored)) |
| 1305 | 1310 | ||
| 1306 | (defun gdb-stopping (ignored) | 1311 | (defun gdb-stopping (ignored) |
| @@ -1327,7 +1332,8 @@ directives." | |||
| 1327 | (setq gdb-overlay-arrow-position nil) | 1332 | (setq gdb-overlay-arrow-position nil) |
| 1328 | (setq gud-old-arrow nil) | 1333 | (setq gud-old-arrow nil) |
| 1329 | (setq gdb-inferior-status "exited") | 1334 | (setq gdb-inferior-status "exited") |
| 1330 | (gdb-force-mode-line-update gdb-inferior-status) | 1335 | (gdb-force-mode-line-update |
| 1336 | (propertize gdb-inferior-status 'face font-lock-warning-face)) | ||
| 1331 | (gdb-stopping ignored)) | 1337 | (gdb-stopping ignored)) |
| 1332 | 1338 | ||
| 1333 | (defun gdb-signalled (ignored) | 1339 | (defun gdb-signalled (ignored) |
| @@ -1375,7 +1381,8 @@ sink to `user' in `gdb-stopping', that is fine." | |||
| 1375 | 'delete))))) | 1381 | 'delete))))) |
| 1376 | (unless (member gdb-inferior-status '("exited" "signal")) | 1382 | (unless (member gdb-inferior-status '("exited" "signal")) |
| 1377 | (setq gdb-inferior-status "stopped") | 1383 | (setq gdb-inferior-status "stopped") |
| 1378 | (gdb-force-mode-line-update gdb-inferior-status)) | 1384 | (gdb-force-mode-line-update |
| 1385 | (propertize gdb-inferior-status 'face font-lock-warning-face))) | ||
| 1379 | (let ((sink gdb-output-sink)) | 1386 | (let ((sink gdb-output-sink)) |
| 1380 | (cond | 1387 | (cond |
| 1381 | ((eq sink 'inferior) | 1388 | ((eq sink 'inferior) |
| @@ -3268,7 +3275,8 @@ is set in them." | |||
| 3268 | (make-local-variable 'gdb-define-alist) | 3275 | (make-local-variable 'gdb-define-alist) |
| 3269 | (gdb-create-define-alist) | 3276 | (gdb-create-define-alist) |
| 3270 | (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))) | 3277 | (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))) |
| 3271 | (gdb-force-mode-line-update "ready")) | 3278 | (gdb-force-mode-line-update |
| 3279 | (propertize "ready" 'face font-lock-variable-name-face))) | ||
| 3272 | 3280 | ||
| 3273 | ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. | 3281 | ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. |
| 3274 | (defun gdb-var-list-children-1 (varnum) | 3282 | (defun gdb-var-list-children-1 (varnum) |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 37d4952058b..e7d85910a63 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -155,7 +155,7 @@ The following place holders should be present in the string: | |||
| 155 | :type 'alist | 155 | :type 'alist |
| 156 | :group 'grep) | 156 | :group 'grep) |
| 157 | 157 | ||
| 158 | (defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}") | 158 | (defcustom grep-find-ignored-directories '("CVS" ".svn" "{arch}" ".hg" "_darcs") |
| 159 | "*List of names of sub-directories which `rgrep' shall not recurse into." | 159 | "*List of names of sub-directories which `rgrep' shall not recurse into." |
| 160 | :type '(repeat string) | 160 | :type '(repeat string) |
| 161 | :group 'grep) | 161 | :group 'grep) |
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index bdc8161c80f..f4c117fd935 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el | |||
| @@ -4384,7 +4384,7 @@ idlwave-shell-electric-debug-mode-map) | |||
| 4384 | ["Edit Default Cmd" idlwave-shell-edit-default-command-line t]) | 4384 | ["Edit Default Cmd" idlwave-shell-edit-default-command-line t]) |
| 4385 | ("Breakpoints" | 4385 | ("Breakpoints" |
| 4386 | ["Set Breakpoint" idlwave-shell-break-here | 4386 | ["Set Breakpoint" idlwave-shell-break-here |
| 4387 | :keys "C-c C-d C-c" :active (eq major-mode 'idlwave-mode)] | 4387 | :keys "C-c C-d C-b" :active (eq major-mode 'idlwave-mode)] |
| 4388 | ("Set Special Breakpoint" | 4388 | ("Set Special Breakpoint" |
| 4389 | ["Set After Count Breakpoint" | 4389 | ["Set After Count Breakpoint" |
| 4390 | (progn | 4390 | (progn |
diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el index ec12468e5d9..4f0159c5992 100644 --- a/lisp/progmodes/ld-script.el +++ b/lisp/progmodes/ld-script.el | |||
| @@ -74,25 +74,55 @@ | |||
| 74 | "Syntax table used while in `ld-script-mode'.") | 74 | "Syntax table used while in `ld-script-mode'.") |
| 75 | 75 | ||
| 76 | ;; Font lock keywords | 76 | ;; Font lock keywords |
| 77 | ;; (The section number comes from ld's info.) | ||
| 77 | (defvar ld-script-keywords | 78 | (defvar ld-script-keywords |
| 78 | '("ENTRY" "INCLUDE" "INPUT" "GROUP" | 79 | '( |
| 79 | "OUTPUT" "SEARCH_DIR" "STARTUP" | 80 | ;; 3.4.1 Setting the Entry Point |
| 81 | "ENTRY" | ||
| 82 | ;; 3.4.2 Commands Dealing with Files | ||
| 83 | "INCLUDE" "INPUT" "GROUP" "AS_NEEDED" "OUTPUT" "SEARCH_DIR" "STARTUP" | ||
| 84 | ;; 3.4.3 Commands Dealing with Object File Formats | ||
| 80 | "OUTPUT_FORMAT" "TARGET" | 85 | "OUTPUT_FORMAT" "TARGET" |
| 81 | "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" "NOCROSSREFS" "OUTPUT_ARCH" | 86 | ;; 3.4.3 Other Linker Script Commands |
| 87 | "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" | ||
| 88 | "INHIBIT_COMMON_ALLOCATION" "NOCROSSREFS" "OUTPUT_ARCH" | ||
| 89 | ;; 3.5.2 PROVIDE | ||
| 82 | "PROVIDE" | 90 | "PROVIDE" |
| 83 | "SECTIONS" "SORT" "COMMON" "KEEP" | 91 | ;; 3.5.3 PROVIDE_HIDDEN |
| 84 | "BYTE" "SHORT" "LONG" "QUAD" "SQAD" | 92 | "PROVIDE_HIDEN" |
| 85 | "FILL" | 93 | ;; 3.6 SECTIONS Command |
| 86 | "CREATE_OBJECT_SYMBOLS" | 94 | "SECTIONS" |
| 87 | "CONSTRUCTORS" | 95 | ;; 3.6.4.2 Input Section Wildcard Patterns |
| 96 | "SORT" "SORT_BY_NAME" "SORT_BY_ALIGNMENT" | ||
| 97 | ;; 3.6.4.3 Input Section for Common Symbols | ||
| 98 | "COMMON" | ||
| 99 | ;; 3.6.4.4 Input Section and Garbage Collection | ||
| 100 | "KEEP" | ||
| 101 | ;; 3.6.5 Output Section Data | ||
| 102 | "BYTE" "SHORT" "LONG" "QUAD" "SQUAD" "FILL" | ||
| 103 | ;; 3.6.6 Output Section Keywords | ||
| 104 | "CREATE_OBJECT_SYMBOLS" "CONSTRUCTORS" | ||
| 105 | "__CTOR_LIST__" "__CTOR_END__" "__DTOR_LIST__" "__DTOR_END__" | ||
| 106 | ;; 3.6.7 Output Section Discarding | ||
| 107 | ;; See `ld-script-font-lock-keywords' | ||
| 108 | ;; 3.6.8.1 Output Section Type | ||
| 88 | "NOLOAD" "DSECT" "COPY" "INFO" "OVERLAY" | 109 | "NOLOAD" "DSECT" "COPY" "INFO" "OVERLAY" |
| 110 | ;; 3.6.8.2 Output Section LMA | ||
| 89 | "AT" | 111 | "AT" |
| 112 | ;; 3.6.8.4 Forced Input Alignment | ||
| 113 | "SUBALIGN" | ||
| 114 | ;; 3.6.8.6 Output Section Phdr | ||
| 115 | ":PHDR" | ||
| 116 | ;; 3.7 MEMORY Command | ||
| 90 | "MEMORY" | 117 | "MEMORY" |
| 118 | ;; 3.8 PHDRS Command | ||
| 91 | "PHDRS" "FILEHDR" "FLAGS" | 119 | "PHDRS" "FILEHDR" "FLAGS" |
| 92 | "PT_NULL" "PT_LOAD" "PT_DYNAMIC" "PT_INTERP" "PT_NONE" "PT_SHLIB" "PT_PHDR" | 120 | "PT_NULL" "PT_LOAD" "PT_DYNAMIC" "PT_INTERP" "PT_NONE" "PT_SHLIB" "PT_PHDR" |
| 121 | ;; 3.9 VERSION Command | ||
| 93 | "VERSION") | 122 | "VERSION") |
| 94 | "Keywords used of GNU ld script.") | 123 | "Keywords used of GNU ld script.") |
| 95 | 124 | ||
| 125 | ;; 3.10.8 Builtin Functions | ||
| 96 | (defvar ld-script-builtins | 126 | (defvar ld-script-builtins |
| 97 | '("ABSOLUTE" | 127 | '("ABSOLUTE" |
| 98 | "ADDR" | 128 | "ADDR" |
| @@ -102,12 +132,12 @@ | |||
| 102 | "DATA_SEGMENT_END" | 132 | "DATA_SEGMENT_END" |
| 103 | "DATA_SEGMENT_RELRO_END" | 133 | "DATA_SEGMENT_RELRO_END" |
| 104 | "DEFINED" | 134 | "DEFINED" |
| 105 | "LENGTH" | 135 | "LENGTH" "len" "l" |
| 106 | "LOADADDR" | 136 | "LOADADDR" |
| 107 | "MAX" | 137 | "MAX" |
| 108 | "MIN" | 138 | "MIN" |
| 109 | "NEXT" | 139 | "NEXT" |
| 110 | "ORIGIN" | 140 | "ORIGIN" "org" "o" |
| 111 | "SEGMENT_START" | 141 | "SEGMENT_START" |
| 112 | "SIZEOF" | 142 | "SIZEOF" |
| 113 | "SIZEOF_HEADERS" | 143 | "SIZEOF_HEADERS" |
| @@ -120,7 +150,10 @@ | |||
| 120 | 1 font-lock-keyword-face) | 150 | 1 font-lock-keyword-face) |
| 121 | (,(regexp-opt ld-script-builtins 'words) | 151 | (,(regexp-opt ld-script-builtins 'words) |
| 122 | 1 font-lock-builtin-face) | 152 | 1 font-lock-builtin-face) |
| 123 | ("/DISCARD/" . font-lock-warning-face) | 153 | ;; 3.6.7 Output Section Discarding |
| 154 | ;; 3.6.4.1 Input Section Basics | ||
| 155 | ;; 3.6.8.6 Output Section Phdr | ||
| 156 | ("/DISCARD/\\|EXCLUDE_FILE\\|:NONE" . font-lock-warning-face) | ||
| 124 | ("\\W\\(\\.\\)\\W" 1 ld-script-location-counter-face) | 157 | ("\\W\\(\\.\\)\\W" 1 ld-script-location-counter-face) |
| 125 | ) | 158 | ) |
| 126 | cpp-font-lock-keywords) | 159 | cpp-font-lock-keywords) |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index ef80d28c578..6098c8be067 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -980,47 +980,55 @@ Point is at the beginning of the next line." | |||
| 980 | (re-search-forward sh-here-doc-re limit t)) | 980 | (re-search-forward sh-here-doc-re limit t)) |
| 981 | 981 | ||
| 982 | (defun sh-quoted-subshell (limit) | 982 | (defun sh-quoted-subshell (limit) |
| 983 | "Search for a subshell embedded in a string. Find all the unescaped | 983 | "Search for a subshell embedded in a string. |
| 984 | \" characters within said subshell, remembering that subshells can nest." | 984 | Find all the unescaped \" characters within said subshell, remembering that |
| 985 | (if (re-search-forward "\"\\(?:.\\|\n\\)*?\\(\\$(\\|`\\)" limit t) | 985 | subshells can nest." |
| 986 | ;; bingo we have a $( or a ` inside a "" | 986 | ;; FIXME: This can (and often does) match multiple lines, yet it makes no |
| 987 | (let ((char (char-after (point))) | 987 | ;; effort to handle multiline cases correctly, so it ends up being |
| 988 | (continue t) | 988 | ;; rather flakey. |
| 989 | (pos (point)) | 989 | (when (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t) |
| 990 | (data nil) ;; value to put into match-data (and return) | 990 | ;; bingo we have a $( or a ` inside a "" |
| 991 | (last nil) ;; last char seen | 991 | (let ((char (char-after (point))) |
| 992 | (bq (equal (match-string 1) "`")) ;; ` state flip-flop | 992 | (continue t) |
| 993 | (seen nil) ;; list of important positions | 993 | (pos (point)) |
| 994 | (nest 1)) ;; subshell nesting level | 994 | (data nil) ;; value to put into match-data (and return) |
| 995 | (while (and continue char (<= pos limit)) | 995 | (last nil) ;; last char seen |
| 996 | ;; unescaped " inside a $( ... ) construct. | 996 | (bq (equal (match-string 1) "`")) ;; ` state flip-flop |
| 997 | ;; state machine time... | 997 | (seen nil) ;; list of important positions |
| 998 | ;; \ => ignore next char; | 998 | (nest 1)) ;; subshell nesting level |
| 999 | ;; ` => increase or decrease nesting level based on bq flag | 999 | (while (and continue char (<= pos limit)) |
| 1000 | ;; ) [where nesting > 0] => decrease nesting | 1000 | ;; unescaped " inside a $( ... ) construct. |
| 1001 | ;; ( [where nesting > 0] => increase nesting | 1001 | ;; state machine time... |
| 1002 | ;; ( [preceeded by $ ] => increase nesting | 1002 | ;; \ => ignore next char; |
| 1003 | ;; " [nesting <= 0 ] => terminate, we're done. | 1003 | ;; ` => increase or decrease nesting level based on bq flag |
| 1004 | ;; " [nesting > 0 ] => remember this, it's not a proper " | 1004 | ;; ) [where nesting > 0] => decrease nesting |
| 1005 | (if (eq ?\\ last) nil | 1005 | ;; ( [where nesting > 0] => increase nesting |
| 1006 | (if (eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq)) | 1006 | ;; ( [preceeded by $ ] => increase nesting |
| 1007 | (if (and (> nest 0) (eq ?\) char)) (setq nest (1- nest)) | 1007 | ;; " [nesting <= 0 ] => terminate, we're done. |
| 1008 | (if (and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest)) | 1008 | ;; " [nesting > 0 ] => remember this, it's not a proper " |
| 1009 | (if (and (> nest 0) (eq ?\( char)) (setq nest (1+ nest)) | 1009 | ;; FIXME: don't count parens that appear within quotes. |
| 1010 | (if (eq char ?\") | 1010 | (cond |
| 1011 | (if (>= 0 nest) (setq continue nil) | 1011 | ((eq ?\\ last) nil) |
| 1012 | (setq seen (cons pos seen)) ) )))))) | 1012 | ((eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq))) |
| 1013 | ;;(message "POS: %d [%d]" pos nest) | 1013 | ((and (> nest 0) (eq ?\) char)) (setq nest (1- nest))) |
| 1014 | (setq last char | 1014 | ((and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest))) |
| 1015 | pos (1+ pos) | 1015 | ((and (> nest 0) (eq ?\( char)) (setq nest (1+ nest))) |
| 1016 | char (char-after pos)) ) | 1016 | ((eq char ?\") |
| 1017 | (when seen | 1017 | (if (>= 0 nest) (setq continue nil) (push pos seen)))) |
| 1018 | ;;(message "SEEN: %S" seen) | 1018 | ;;(message "POS: %d [%d]" pos nest) |
| 1019 | (setq data (list (current-buffer))) | 1019 | (setq last char |
| 1020 | (mapc (lambda (P) | 1020 | pos (1+ pos) |
| 1021 | (setq data (cons P (cons (1+ P) data)) ) ) seen) | 1021 | char (char-after pos)) ) |
| 1022 | (store-match-data data)) | 1022 | ;; FIXME: why construct a costly match data to pass to |
| 1023 | data) )) | 1023 | ;; sh-apply-quoted-subshell rather than apply the highlight |
| 1024 | ;; directly here? -- Stef | ||
| 1025 | (when seen | ||
| 1026 | ;;(message "SEEN: %S" seen) | ||
| 1027 | (setq data (list (current-buffer))) | ||
| 1028 | (dolist(P seen) | ||
| 1029 | (setq data (cons P (cons (1+ P) data)))) | ||
| 1030 | (store-match-data data)) | ||
| 1031 | data) )) | ||
| 1024 | 1032 | ||
| 1025 | (defun sh-is-quoted-p (pos) | 1033 | (defun sh-is-quoted-p (pos) |
| 1026 | (and (eq (char-before pos) ?\\) | 1034 | (and (eq (char-before pos) ?\\) |
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 8ca7eb188ec..b622e536d26 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el | |||
| @@ -262,11 +262,11 @@ It calls them sequentially, and if any returns non-nil, | |||
| 262 | 262 | ||
| 263 | (defun which-function () | 263 | (defun which-function () |
| 264 | "Return current function name based on point. | 264 | "Return current function name based on point. |
| 265 | Uses `which-function-functions', `imenu--index-alist' | 265 | Uses `which-func-functions', `imenu--index-alist' |
| 266 | or `add-log-current-defun-function'. | 266 | or `add-log-current-defun-function'. |
| 267 | If no function name is found, return nil." | 267 | If no function name is found, return nil." |
| 268 | (let ((name | 268 | (let ((name |
| 269 | ;; Try the `which-function-functions' functions first. | 269 | ;; Try the `which-func-functions' functions first. |
| 270 | (run-hook-with-args-until-success 'which-func-functions))) | 270 | (run-hook-with-args-until-success 'which-func-functions))) |
| 271 | 271 | ||
| 272 | ;; If Imenu is loaded, try to make an index alist with it. | 272 | ;; If Imenu is loaded, try to make an index alist with it. |