summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/ada-mode.el6
-rw-r--r--lisp/progmodes/ada-stmt.el2
-rw-r--r--lisp/progmodes/ada-xref.el2
-rw-r--r--lisp/progmodes/cc-awk.el8
-rw-r--r--lisp/progmodes/cc-cmds.el6
-rw-r--r--lisp/progmodes/cc-defs.el2
-rw-r--r--lisp/progmodes/cc-engine.el234
-rw-r--r--lisp/progmodes/cc-fonts.el32
-rw-r--r--lisp/progmodes/cc-langs.el72
-rw-r--r--lisp/progmodes/cc-mode.el196
-rw-r--r--lisp/progmodes/cc-vars.el2
-rw-r--r--lisp/progmodes/cfengine.el142
-rw-r--r--lisp/progmodes/cperl-mode.el14
-rw-r--r--lisp/progmodes/dcl-mode.el4
-rw-r--r--lisp/progmodes/ebnf2ps.el8
-rw-r--r--lisp/progmodes/gdb-mi.el223
-rw-r--r--lisp/progmodes/grep.el7
-rw-r--r--lisp/progmodes/gud.el108
-rw-r--r--lisp/progmodes/hideif.el2
-rw-r--r--lisp/progmodes/idlwave.el4
-rw-r--r--lisp/progmodes/inf-lisp.el2
-rw-r--r--lisp/progmodes/js.el2
-rw-r--r--lisp/progmodes/make-mode.el58
-rw-r--r--lisp/progmodes/pascal.el1
-rw-r--r--lisp/progmodes/prolog.el6
-rw-r--r--lisp/progmodes/python.el2
-rw-r--r--lisp/progmodes/sql.el2
-rw-r--r--lisp/progmodes/vera-mode.el4
-rw-r--r--lisp/progmodes/verilog-mode.el20
-rw-r--r--lisp/progmodes/vhdl-mode.el26
30 files changed, 670 insertions, 527 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index 64734420a8c..17ff4bd32a6 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -499,7 +499,7 @@ Used to define `ada-*-keywords.'"))
(defvar ada-case-exception-substring '()
"Alist of substrings (entities) that have special casing.
-The substrings are detected for word constituant when the word
+The substrings are detected for word constituent when the word
is not itself in `ada-case-exception', and only for substrings that
either are at the beginning or end of the word, or start after '_'.")
@@ -1773,7 +1773,7 @@ ATTENTION: This function might take very long for big buffers!"
;; `ada-insert-paramlist'.
;; Both steps are called from `ada-format-paramlist'.
;; Note: Comments inside the parameter list are lost.
-;; The syntax has to be correct, or the reformating will fail.
+;; The syntax has to be correct, or the reformatting will fail.
;;--------------------------------------------------------------
(defun ada-format-paramlist ()
@@ -2139,7 +2139,7 @@ command like:
(while command-line-args-left
(let ((source (car command-line-args-left)))
- (message "Formating %s" source)
+ (message "Formatting %s" source)
(find-file source)
(ada-indent-region (point-min) (point-max))
(ada-adjust-case-buffer)
diff --git a/lisp/progmodes/ada-stmt.el b/lisp/progmodes/ada-stmt.el
index e48055c9f50..b33da441eeb 100644
--- a/lisp/progmodes/ada-stmt.el
+++ b/lisp/progmodes/ada-stmt.el
@@ -56,7 +56,7 @@
;; BUGS:
;;;> I have the following suggestions for the function template: 1) I
;;;> don't want it automatically assigning it a name for the return variable. I
-;;;> never want it to be called "Result" because that is nondescriptive. If you
+;;;> never want it to be called "Result" because that is nondescript. If you
;;;> must define a variable, give me the ability to specify its name.
;;;>
;;;> 2) You do not provide a type for variable 'Result'. Its type is the same
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index 2f6a7be393a..f30457992a3 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -30,7 +30,7 @@
;;; for lookup and completion in Ada mode.
;;;
;;; If a file *.`adp' exists in the ada-file directory, then it is
-;;; read for configuration informations. It is read only the first
+;;; read for configuration information. It is read only the first
;;; time a cross-reference is asked for, and is not read later.
;;; You need Emacs >= 20.2 to run this package
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 8213a83461b..ef67a18d807 100644
--- a/lisp/progmodes/cc-awk.el
+++ b/lisp/progmodes/cc-awk.el
@@ -545,7 +545,7 @@
(defun c-awk-vsemi-status-unknown-p ()
;; Are we unsure whether there is a virtual semicolon on the current line?
;; DO NOT under any circumstances attempt to calculate this; that would
- ;; defeat the (admittedly kludgey) purpose of this function, which is to
+ ;; defeat the (admittedly kludgy) purpose of this function, which is to
;; prevent an infinite recursion in c-beginning-of-statement-1 when point
;; starts at a `while' token.
(not (c-get-char-property (c-point 'eol) 'c-awk-NL-prop)))
@@ -894,9 +894,9 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
;; Keywords.
(concat "\\<"
(regexp-opt
- '("BEGIN" "END" "break" "continue" "delete" "do" "else"
- "exit" "for" "getline" "if" "in" "next" "nextfile"
- "return" "while")
+ '("BEGIN" "END" "break" "case" "continue" "default" "delete"
+ "do" "else" "exit" "for" "getline" "if" "in" "next"
+ "nextfile" "return" "switch" "while")
t) "\\>")
;; Builtins.
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 8e4ac92d96f..686695bc838 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1360,7 +1360,7 @@ No indentation or other \"electric\" behavior is performed."
;; Determine where we are with respect to functions (or other brace
;; constructs, included in the term "function" in the rest of this comment).
;; Point is assumed to be outside any macro or literal.
- ;; This is used by c-\(begining\|end\)-of-defun.
+ ;; This is used by c-\(beginning\|end\)-of-defun.
;;
;; Return one of these symbols:
;; at-header : we're at the start of a function's header.
@@ -2051,7 +2051,7 @@ function does not require the declaration to contain a brace block."
(c-narrow-to-comment-innards range) ; This may move point back.
(let* ((here (point))
last
- (here-filler ; matches WS and comment-prefices at point.
+ (here-filler ; matches WS and comment-prefixes at point.
(concat "\\=\\(^[ \t]*\\(" c-current-comment-prefix "\\)"
"\\|[ \t\n\r\f]\\)*"))
(prefix-at-bol-here ; matches WS and prefix at BOL, just before point
@@ -2071,7 +2071,7 @@ function does not require the declaration to contain a brace block."
;; Now seek successively earlier sentence ends between PAR-BEG and
;; HERE, until the "start of sentence" following it is earlier than
- ;; HERE, or we hit PAR-BEG. Beware of comment prefices!
+ ;; HERE, or we hit PAR-BEG. Beware of comment prefixes!
(while (and (re-search-backward (c-sentence-end) par-beg 'limit)
(setq last (point))
(goto-char (match-end 0)) ; tentative beginning of sentence
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index c91fe13543a..2991b511830 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -473,7 +473,7 @@ various buffer change hooks."
(let ((saved-undo-list (elt saved-state 0)))
(if (eq buffer-undo-list saved-undo-list)
- ;; No change was done afterall.
+ ;; No change was done after all.
(setq buffer-undo-list (cdr saved-undo-list))
(if keep
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 9544c4f8728..0865ddfed69 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -195,9 +195,6 @@
(not prevstate)
(> arg 0)))
-;; Dynamically bound cache for `c-in-literal'.
-(defvar c-in-literal-cache t)
-
;; Basic handling of preprocessor directives.
@@ -2093,28 +2090,35 @@ comment at the start of cc-engine.el for more info."
;; `c-state-literal-at'.
(defsubst c-state-pp-to-literal (from to)
- ;; Do a parse-partial-sexp from FROM to TO, returning the bounds of any
- ;; literal at TO as a cons, otherwise NIL.
- ;; FROM must not be in a literal, and the buffer should already be wide
- ;; enough.
+ ;; Do a parse-partial-sexp from FROM to TO, returning either
+ ;; (STATE TYPE (BEG . END)) if TO is in a literal; or
+ ;; (STATE) otherwise,
+ ;; where STATE is the parsing state at TO, TYPE is the type of the literal
+ ;; (one of 'c, 'c++, 'string) and (BEG . END) is the boundaries of the literal.
+ ;;
+ ;; Only elements 3 (in a string), 4 (in a comment), 5 (following a quote),
+ ;; 7 (comment type) and 8 (start of comment/string) (and possibly 9) of
+ ;; STATE are valid.
(save-excursion
- (let ((s (parse-partial-sexp from to)))
+ (let ((s (parse-partial-sexp from to))
+ ty)
(when (or (nth 3 s) (nth 4 s)) ; in a string or comment
+ (setq ty (cond
+ ((nth 3 s) 'string)
+ ((eq (nth 7 s) t) 'c++)
+ (t 'c)))
(parse-partial-sexp (point) (point-max)
nil ; TARGETDEPTH
nil ; STOPBEFORE
s ; OLDSTATE
- 'syntax-table) ; stop at end of literal
- (cons (nth 8 s) (point))))))
+ 'syntax-table)) ; stop at end of literal
+ (if ty
+ `(,s ,ty (,(nth 8 s) . ,(point)))
+ `(,s)))))
-(defun c-state-literal-at (here)
- ;; If position HERE is inside a literal, return (START . END), the
- ;; boundaries of the literal (which may be outside the accessible bit of the
- ;; buffer). Otherwise, return nil.
- ;;
- ;; This function is almost the same as `c-literal-limits'. It differs in
- ;; that it is a lower level function, and that it rigourously follows the
- ;; syntax from BOB, whereas `c-literal-limits' uses a "local" safe position.
+(defun c-state-safe-place (here)
+ ;; Return a buffer position before HERE which is "safe", i.e. outside any
+ ;; string, comment, or macro.
;;
;; NOTE: This function manipulates `c-state-nonlit-pos-cache'. This cache
;; MAY NOT contain any positions within macros, since macros are frequently
@@ -2137,7 +2141,7 @@ comment at the start of cc-engine.el for more info."
(while (<= (setq npos (+ pos c-state-nonlit-pos-interval))
here)
- (setq lit (c-state-pp-to-literal pos npos))
+ (setq lit (car (cddr (c-state-pp-to-literal pos npos))))
(setq pos (or (cdr lit) npos)) ; end of literal containing npos.
(goto-char pos)
(when (and (c-beginning-of-macro) (/= (point) pos))
@@ -2148,9 +2152,22 @@ comment at the start of cc-engine.el for more info."
(if (> pos c-state-nonlit-pos-cache-limit)
(setq c-state-nonlit-pos-cache-limit pos))
- (if (< pos here)
- (setq lit (c-state-pp-to-literal pos here)))
- lit))))
+ pos))))
+
+(defun c-state-literal-at (here)
+ ;; If position HERE is inside a literal, return (START . END), the
+ ;; boundaries of the literal (which may be outside the accessible bit of the
+ ;; buffer). Otherwise, return nil.
+ ;;
+ ;; This function is almost the same as `c-literal-limits'. Previously, it
+ ;; differed in that it was a lower level function, and that it rigourously
+ ;; followed the syntax from BOB. `c-literal-limits' is now (2011-12)
+ ;; virtually identical to this function.
+ (save-restriction
+ (widen)
+ (save-excursion
+ (let ((pos (c-state-safe-place here)))
+ (car (cddr (c-state-pp-to-literal pos here)))))))
(defsubst c-state-lit-beg (pos)
;; Return the start of the literal containing POS, or POS itself.
@@ -4181,7 +4198,7 @@ comment at the start of cc-engine.el for more info."
;; Tools for handling comments and string literals.
-(defun c-slow-in-literal (&optional lim detect-cpp)
+(defun c-in-literal (&optional lim detect-cpp)
"Return the type of literal point is in, if any.
The return value is `c' if in a C-style comment, `c++' if in a C++
style comment, `string' if in a string literal, `pound' if DETECT-CPP
@@ -4194,67 +4211,12 @@ The last point calculated is cached if the cache is enabled, i.e. if
Note that this function might do hidden buffer changes. See the
comment at the start of cc-engine.el for more info."
-
- (if (and (vectorp c-in-literal-cache)
- (= (point) (aref c-in-literal-cache 0)))
- (aref c-in-literal-cache 1)
- (let ((rtn (save-excursion
- (let* ((pos (point))
- (lim (or lim (progn
- (c-beginning-of-syntax)
- (point))))
- (state (parse-partial-sexp lim pos)))
- (cond
- ((elt state 3) 'string)
- ((elt state 4) (if (elt state 7) 'c++ 'c))
- ((and detect-cpp (c-beginning-of-macro lim)) 'pound)
- (t nil))))))
- ;; cache this result if the cache is enabled
- (if (not c-in-literal-cache)
- (setq c-in-literal-cache (vector (point) rtn)))
- rtn)))
-
-;; XEmacs has a built-in function that should make this much quicker.
-;; I don't think we even need the cache, which makes our lives more
-;; complicated anyway. In this case, lim is only used to detect
-;; cpp directives.
-;;
-;; Note that there is a bug in XEmacs's buffer-syntactic-context when used in
-;; conjunction with syntax-table-properties. The bug is present in, e.g.,
-;; XEmacs 21.4.4. It manifested itself thus:
-;;
-;; Starting with an empty AWK Mode buffer, type
-;; /regexp/ {<C-j>
-;; Point gets wrongly left at column 0, rather than being indented to tab-width.
-;;
-;; AWK Mode is designed such that when the first / is typed, it gets the
-;; syntax-table property "string fence". When the second / is typed, BOTH /s
-;; are given the s-t property "string". However, buffer-syntactic-context
-;; fails to take account of the change of the s-t property on the opening / to
-;; "string", and reports that the { is within a string started by the second /.
-;;
-;; The workaround for this is for the AWK Mode initialization to switch the
-;; defalias for c-in-literal to c-slow-in-literal. This will slow down other
-;; cc-modes in XEmacs whenever an awk-buffer has been initialized.
-;;
-;; (Alan Mackenzie, 2003/4/30).
-
-(defun c-fast-in-literal (&optional lim detect-cpp)
- ;; This function might do hidden buffer changes.
- (let ((context (buffer-syntactic-context)))
- (cond
- ((eq context 'string) 'string)
- ((eq context 'comment) 'c++)
- ((eq context 'block-comment) 'c)
- ((and detect-cpp (save-excursion (c-beginning-of-macro lim))) 'pound))))
-
-(defalias 'c-in-literal
- (if (fboundp 'buffer-syntactic-context)
- 'c-fast-in-literal ; XEmacs
- 'c-slow-in-literal)) ; GNU Emacs
-
-;; The defalias above isn't enough to shut up the byte compiler.
-(cc-bytecomp-defun c-in-literal)
+ (let* ((safe-place (c-state-safe-place (point)))
+ (lit (c-state-pp-to-literal safe-place (point))))
+ (or (cadr lit)
+ (and detect-cpp
+ (save-excursion (c-beginning-of-macro))
+ 'pound))))
(defun c-literal-limits (&optional lim near not-in-delimiter)
"Return a cons of the beginning and end positions of the comment or
@@ -4273,64 +4235,56 @@ comment at the start of cc-engine.el for more info."
(save-excursion
(let* ((pos (point))
- (lim (or lim (progn
- (c-beginning-of-syntax)
- (point))))
- (state (parse-partial-sexp lim pos)))
-
- (cond ((elt state 3) ; String.
- (goto-char (elt state 8))
- (cons (point) (or (c-safe (c-forward-sexp 1) (point))
- (point-max))))
-
- ((elt state 4) ; Comment.
- (goto-char (elt state 8))
- (cons (point) (progn (c-forward-single-comment) (point))))
-
- ((and (not not-in-delimiter)
- (not (elt state 5))
- (eq (char-before) ?/)
- (looking-at "[/*]"))
- ;; We're standing in a comment starter.
- (backward-char 1)
- (cons (point) (progn (c-forward-single-comment) (point))))
-
- (near
- (goto-char pos)
-
- ;; Search forward for a literal.
- (skip-chars-forward " \t")
+ (lim (or lim (c-state-safe-place pos)))
+ (pp-to-lit (c-state-pp-to-literal lim pos))
+ (state (car pp-to-lit))
+ (lit-type (cadr pp-to-lit))
+ (lit-limits (car (cddr pp-to-lit))))
- (cond
- ((looking-at c-string-limit-regexp) ; String.
- (cons (point) (or (c-safe (c-forward-sexp 1) (point))
- (point-max))))
+ (cond
+ (lit-limits)
+ ((and (not not-in-delimiter)
+ (not (elt state 5))
+ (eq (char-before) ?/)
+ (looking-at "[/*]")) ; FIXME!!! use c-line/block-comment-starter. 2008-09-28.
+ ;; We're standing in a comment starter.
+ (backward-char 1)
+ (cons (point) (progn (c-forward-single-comment) (point))))
+
+ (near
+ (goto-char pos)
+ ;; Search forward for a literal.
+ (skip-chars-forward " \t")
+ (cond
+ ((looking-at c-string-limit-regexp) ; String.
+ (cons (point) (or (c-safe (c-forward-sexp 1) (point))
+ (point-max))))
- ((looking-at c-comment-start-regexp) ; Line or block comment.
- (cons (point) (progn (c-forward-single-comment) (point))))
+ ((looking-at c-comment-start-regexp) ; Line or block comment.
+ (cons (point) (progn (c-forward-single-comment) (point))))
- (t
- ;; Search backward.
- (skip-chars-backward " \t")
+ (t
+ ;; Search backward.
+ (skip-chars-backward " \t")
- (let ((end (point)) beg)
- (cond
- ((save-excursion
- (< (skip-syntax-backward c-string-syntax) 0)) ; String.
- (setq beg (c-safe (c-backward-sexp 1) (point))))
-
- ((and (c-safe (forward-char -2) t)
- (looking-at "*/"))
- ;; Block comment. Due to the nature of line
- ;; comments, they will always be covered by the
- ;; normal case above.
- (goto-char end)
- (c-backward-single-comment)
- ;; If LIM is bogus, beg will be bogus.
- (setq beg (point))))
-
- (if beg (cons beg end))))))
- ))))
+ (let ((end (point)) beg)
+ (cond
+ ((save-excursion
+ (< (skip-syntax-backward c-string-syntax) 0)) ; String.
+ (setq beg (c-safe (c-backward-sexp 1) (point))))
+
+ ((and (c-safe (forward-char -2) t)
+ (looking-at "*/"))
+ ;; Block comment. Due to the nature of line
+ ;; comments, they will always be covered by the
+ ;; normal case above.
+ (goto-char end)
+ (c-backward-single-comment)
+ ;; If LIM is bogus, beg will be bogus.
+ (setq beg (point))))
+
+ (if beg (cons beg end))))))
+ ))))
;; In case external callers use this; it did have a docstring.
(defalias 'c-literal-limits-fast 'c-literal-limits)
@@ -6832,7 +6786,7 @@ comment at the start of cc-engine.el for more info."
got-suffix-after-parens
(eq (char-after got-suffix-after-parens) ?\())
;; Got a type, no declarator but a paren suffix. I.e. it's a
- ;; normal function call afterall (or perhaps a C++ style object
+ ;; normal function call after all (or perhaps a C++ style object
;; instantiation expression).
(throw 'at-decl-or-cast nil))))
@@ -9151,7 +9105,7 @@ comment at the start of cc-engine.el for more info."
'label))
(if (eq step 'up)
(setq placeholder (point))
- ;; There was no containing statement afterall.
+ ;; There was no containing statement after all.
(goto-char placeholder)))))
placeholder))
(if (looking-at c-block-stmt-2-key)
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index a31de35f3ba..97cfe808322 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -194,9 +194,13 @@
(unless (face-property-instance oldface 'reverse)
(invert-face newface)))))
-(defvar c-annotation-face (make-face 'c-annotation-face)
- "Face used to highlight annotations in java-mode and other modes that may wish to use it.")
-(set-face-foreground 'c-annotation-face "blue")
+(defvar c-annotation-face 'c-annotation-face)
+
+(defface c-annotation-face
+ '((default :inherit font-lock-constant-face))
+ "Face for highlighting annotations in Java mode and similar modes."
+ :version "24.1"
+ :group 'c)
(eval-and-compile
;; We need the following definitions during compilation since they're
@@ -1207,7 +1211,7 @@ casts and declarations are fontified. Used on level 2 and higher."
;; o - '<> if the arglist is of angle bracket type;
;; o - 'arglist if it's some other arglist;
;; o - nil, if not in an arglist at all. This includes the
- ;; parenthesised condition which follows "if", "while", etc.
+ ;; parenthesized condition which follows "if", "while", etc.
context
;; The position of the next token after the closing paren of
;; the last detected cast.
@@ -1534,24 +1538,8 @@ casts and declarations are fontified. Used on level 2 and higher."
;; prevent a repeat invocation. See elisp/lispref page "Search-based
;; Fontification".
(let* ((paren-state (c-parse-state))
- (start (point))
- decl-context bo-decl in-typedef type-type ps-elt)
-
- ;; First, are we actually in a "local" declaration?
- (setq decl-context (c-beginning-of-decl-1)
- bo-decl (point)
- in-typedef (looking-at c-typedef-key))
- (if in-typedef (c-forward-token-2))
- (when (and (eq (car decl-context) 'same)
- (< bo-decl start))
- ;; Are we genuinely at a type?
- (setq type-type (c-forward-type t))
- (if (and type-type
- (or (not (eq type-type 'maybe))
- (looking-at c-symbol-key)))
- (c-font-lock-declarators limit t in-typedef)))
-
- ;; Secondly, are we in any nested struct/union/class/etc. braces?
+ decl-context in-typedef ps-elt)
+ ;; Are we in any nested struct/union/class/etc. braces?
(while paren-state
(setq ps-elt (car paren-state)
paren-state (cdr paren-state))
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 37818638d41..2aca885ca35 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -485,28 +485,56 @@ The functions are called even when font locking isn't enabled.
When the mode is initialized, the functions are called with
parameters \(point-min) and \(point-max).")
-(c-lang-defconst c-before-font-lock-function
- "If non-nil, a function called just before font locking.
-Typically it will extend the region about to be fontified \(see
+(c-lang-defconst c-before-font-lock-functions
+ ;; For documentation see the following c-lang-defvar of the same name.
+ ;; The value here may be a list of functions or a single function.
+ t 'c-change-set-fl-decl-start
+ (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP
+ c-change-set-fl-decl-start)
+ awk 'c-awk-extend-and-syntax-tablify-region)
+(c-lang-defvar c-before-font-lock-functions
+ (let ((fs (c-lang-const c-before-font-lock-functions)))
+ (if (listp fs)
+ fs
+ (list fs)))
+ "If non-nil, a list of functions called just before font locking.
+Typically they will extend the region about to be fontified \(see
below) and will set `syntax-table' text properties on the region.
-It takes 3 parameters, the BEG, END, and OLD-LEN supplied to
-every after-change function; point is undefined on both entry and
-exit; on entry, the buffer will have been widened and match-data
-will have been saved; the return value is ignored.
+These functions will be run in the order given. Each of them
+takes 3 parameters, the BEG, END, and OLD-LEN supplied to every
+after-change function; point is undefined on both entry and exit;
+on entry, the buffer will have been widened and match-data will
+have been saved; the return value is ignored.
-The function may extend the region to be fontified by setting the
+The functions may extend the region to be fontified by setting the
buffer local variables c-new-BEG and c-new-END.
-The function is called even when font locking is disabled.
+The functions are called even when font locking is disabled.
-When the mode is initialized, this function is called with
-parameters \(point-min), \(point-max) and <buffer size>."
- t nil
- (c c++ objc) 'c-neutralize-syntax-in-and-mark-CPP
- awk 'c-awk-extend-and-syntax-tablify-region)
-(c-lang-defvar c-before-font-lock-function
- (c-lang-const c-before-font-lock-function))
+When the mode is initialized, these functions are called with
+parameters \(point-min), \(point-max) and <buffer size>.")
+
+(c-lang-defconst c-before-context-fontification-functions
+ awk nil
+ t 'c-context-set-fl-decl-start)
+ ;; For documentation see the following c-lang-defvar of the same name.
+ ;; The value here may be a list of functions or a single function.
+(c-lang-defvar c-before-context-fontification-functions
+ (let ((fs (c-lang-const c-before-context-fontification-functions)))
+ (if (listp fs)
+ fs
+ (list fs)))
+ "If non-nil, a list of functions called just before context (or
+other non-change) fontification is done. Typically they will
+extend the region.
+
+These functions will be run in the order given. Each of them
+takes 2 parameters, the BEG and END of the region to be
+fontified. Point is undefined on both entry and exit. On entry,
+the buffer will have been widened and match-data will have been
+saved; the return value is a cons of the adjusted
+region, (NEW-BEG . NEW-END).")
;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK).
@@ -522,7 +550,7 @@ don't have EOL terminated statements. "
(c-lang-defconst c-vsemi-status-unknown-p-fn
"Contains a function \"are we unsure whether there is a virtual semicolon on this line?\".
-The (admittedly kludgey) purpose of such a function is to prevent an infinite
+The (admittedly kludgy) purpose of such a function is to prevent an infinite
recursion in c-beginning-of-statement-1 when point starts at a `while' token.
The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
even indirectly. This variable contains nil for languages which don't have
@@ -2242,8 +2270,7 @@ This construct is \"<keyword> <expression> :\"."
(c-lang-defconst c-label-kwds
"Keywords introducing colon terminated labels in blocks."
- t '("case" "default")
- awk nil)
+ t '("case" "default"))
(c-lang-defconst c-label-kwds-regexp
;; Adorned regexp matching any keyword that introduces a label.
@@ -2998,18 +3025,19 @@ neither in a statement nor in a declaration context. The regexp is
tested at the beginning of every sexp in a suspected label,
i.e. before \":\". Only used if `c-recognize-colon-labels' is set."
t (concat
- ;; Don't allow string literals.
- "\"\\|"
;; All keywords except `c-label-kwds' and `c-protection-kwds'.
(c-make-keywords-re t
(set-difference (c-lang-const c-keywords)
(append (c-lang-const c-label-kwds)
(c-lang-const c-protection-kwds))
:test 'string-equal)))
+ ;; Don't allow string literals, except in AWK. Character constants are OK.
+ (c objc java pike idl) (concat "\"\\|"
+ (c-lang-const c-nonlabel-token-key))
;; Also check for open parens in C++, to catch member init lists in
;; constructors. We normally allow it so that macros with arguments
;; work in labels.
- c++ (concat "\\s\(\\|" (c-lang-const c-nonlabel-token-key)))
+ c++ (concat "\\s\(\\|\"\\|" (c-lang-const c-nonlabel-token-key)))
(c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key))
(c-lang-defconst c-nonlabel-token-2-key
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index cc5a5236255..1bc0741b0aa 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -599,8 +599,8 @@ that requires a literal mode spec at compile time."
;; Buffer local variables defining the region to be fontified by a font lock
;; after-change function. They are set in c-after-change to
-;; after-change-function's BEG and END, and may be modified by a
-;; `c-before-font-lock-function'.
+;; after-change-functions' BEG and END, and may be modified by functions in
+;; `c-before-font-lock-functions'.
(defvar c-new-BEG 0)
(make-variable-buffer-local 'c-new-BEG)
(defvar c-new-END 0)
@@ -633,13 +633,13 @@ compatible with old code; callers should always specify it."
(setq c-new-BEG (point-min))
(setq c-new-END (point-max))
(save-excursion
- (if c-get-state-before-change-functions
- (mapc (lambda (fn)
- (funcall fn (point-min) (point-max)))
- c-get-state-before-change-functions))
- (if c-before-font-lock-function
- (funcall c-before-font-lock-function (point-min) (point-max)
- (- (point-max) (point-min))))))
+ (mapc (lambda (fn)
+ (funcall fn (point-min) (point-max)))
+ c-get-state-before-change-functions)
+ (mapc (lambda (fn)
+ (funcall fn (point-min) (point-max)
+ (- (point-max) (point-min))))
+ c-before-font-lock-functions)))
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
(set (make-local-variable 'outline-level) 'c-outline-level)
@@ -830,6 +830,35 @@ Note that the style variables are always made local to the buffer."
; with a c-cpp-delimiter category property
(setq c-old-EOM (point)))
+(defun c-extend-font-lock-region-for-macros (begg endd &optional old-len)
+ ;; Extend the region (BEGG ENDD) to cover all (possibly changed)
+ ;; preprocessor macros; return the cons (new-BEG . new-END). OLD-LEN should
+ ;; be either the old length parameter when called from an
+ ;; after-change-function, or nil otherwise. This defun uses the variables
+ ;; c-old-BOM, c-new-BOM.
+ ;;
+ ;; Point is undefined on both entry and exit to this function. The buffer
+ ;; will have been widened on entry.
+ (let (limits new-beg new-end)
+ (goto-char c-old-BOM) ; already set to old start of macro or begg.
+ (setq new-beg
+ (min begg
+ (if (setq limits (c-state-literal-at (point)))
+ (cdr limits) ; go forward out of any string or comment.
+ (point))))
+
+ (goto-char endd)
+ (if (setq limits (c-state-literal-at (point)))
+ (goto-char (car limits))) ; go backward out of any string or comment.
+ (if (c-beginning-of-macro)
+ (c-end-of-macro))
+ (setq new-end (max endd
+ (if old-len
+ (+ (- c-old-EOM old-len) (- endd begg))
+ c-old-EOM)
+ (point)))
+ (cons new-beg new-end)))
+
(defun c-neutralize-CPP-line (beg end)
;; BEG and END bound a region, typically a preprocessor line. Put a
;; "punctuation" syntax-table property on syntactically obtrusive
@@ -881,31 +910,19 @@ Note that the style variables are always made local to the buffer."
;; Point is undefined both before and after this function call, the buffer
;; has been widened, and match-data saved. The return value is ignored.
;;
- ;; This function is the C/C++/ObjC value of `c-before-font-lock-function'.
+ ;; This function is in the C/C++/ObjC value of `c-before-font-lock-functions'.
;;
;; Note: SPEED _MATTERS_ IN THIS FUNCTION!!!
;;
;; This function might make hidden buffer changes.
- (c-save-buffer-state (limits)
+ (c-save-buffer-state (new-bounds)
;; First determine the region, (c-new-BEG c-new-END), which will get font
;; locked. It might need "neutralizing". This region may not start
;; inside a string, comment, or macro.
- (goto-char c-old-BOM) ; already set to old start of macro or begg.
- (setq c-new-BEG
- (min c-new-BEG
- (if (setq limits (c-state-literal-at (point)))
- (cdr limits) ; go forward out of any string or comment.
- (point))))
-
- (goto-char endd)
- (if (setq limits (c-state-literal-at (point)))
- (goto-char (car limits))) ; go backward out of any string or comment.
- (if (c-beginning-of-macro)
- (c-end-of-macro))
- (setq c-new-END (max c-new-END
- (+ (- c-old-EOM old-len) (- endd begg))
- (point)))
-
+ (setq new-bounds (c-extend-font-lock-region-for-macros
+ c-new-BEG c-new-END old-len))
+ (setq c-new-BEG (car new-bounds)
+ c-new-END (cdr new-bounds))
;; Clear all old relevant properties.
(c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1))
(c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter)
@@ -943,7 +960,7 @@ Note that the style variables are always made local to the buffer."
;; Note that this function must be FAST rather than accurate. Note
;; also that it only has any effect when font locking is enabled.
;; We exploit this by checking for font-lock-*-face instead of doing
- ;; rigourous syntactic analysis.
+ ;; rigorous syntactic analysis.
;; If either change boundary is wholly inside an identifier, delete
;; it/them from the cache. Don't worry about being inside a string
@@ -1015,6 +1032,11 @@ Note that the style variables are always made local to the buffer."
c-get-state-before-change-functions))
))))
+(defvar c-in-after-change-fontification nil)
+(make-variable-buffer-local 'c-in-after-change-fontification)
+;; A flag to prevent region expanding stuff being done twice for after-change
+;; fontification.
+
(defun c-after-change (beg end old-len)
;; Function put on `after-change-functions' to adjust various caches
;; etc. Prefer speed to finesse here, since there will be an order
@@ -1026,7 +1048,7 @@ Note that the style variables are always made local to the buffer."
;; these caches from inside them, and we must thus be sure that this
;; has already been executed.
;;
- ;; This calls the language variable c-before-font-lock-function, if non nil.
+ ;; This calls the language variable c-before-font-lock-functions, if non nil.
;; This typically sets `syntax-table' properties.
(c-save-buffer-state ()
@@ -1066,19 +1088,113 @@ Note that the style variables are always made local to the buffer."
;; larger than (beg end).
(setq c-new-BEG beg
c-new-END end)
- (if c-before-font-lock-function
- (save-excursion
- (funcall c-before-font-lock-function beg end old-len)))))))
-
+ (setq c-in-after-change-fontification t)
+ (save-excursion
+ (mapc (lambda (fn)
+ (funcall fn beg end old-len))
+ c-before-font-lock-functions))))))
+
+(defun c-set-fl-decl-start (pos)
+ ;; If the beginning of the line containing POS is in the middle of a "local"
+ ;; declaration (i.e. one which does not start outside of braces enclosing
+ ;; POS, such as a struct), return the beginning of that declaration.
+ ;; Otherwise return POS. Note that declarations, in this sense, can be
+ ;; nested.
+ ;;
+ ;; This function is called indirectly from font locking stuff - either from
+ ;; c-after-change (to prepare for after-change font-lockng) or from font
+ ;; lock context (etc.) fontification.
+ (let ((lit-limits (c-literal-limits))
+ (new-pos pos)
+ bod-lim bo-decl)
+ (goto-char (c-point 'bol new-pos))
+ (when lit-limits ; Comment or string.
+ (goto-char (car lit-limits)))
+ (setq bod-lim (max (- (point) 500) (point-min)))
+
+ (while
+ ;; Go to a less nested declaration each time round this loop.
+ (and
+ (eq (car (c-beginning-of-decl-1 bod-lim)) 'same)
+ (progn (setq bo-decl (point))
+ ;; Are we looking at a keyword such as "template" or
+ ;; "typedef" which can decorate a type, or the type itself?
+ (when (or (looking-at c-prefix-spec-kwds-re)
+ (c-forward-type t))
+ ;; We've found another candidate position.
+ (setq new-pos (min new-pos bo-decl))
+ (goto-char bo-decl))
+ t)
+ ;; Try and go out a level to search again.
+ (progn
+ (c-backward-syntactic-ws bod-lim)
+ (or (memq (char-before) '(?\( ?\[))
+ (and (eq (char-before) ?\<)
+ (eq (c-get-char-property
+ (1- (point)) 'syntax-table)
+ c-<-as-paren-syntax))))
+ (not (bobp)))
+ (backward-char))
+ new-pos)) ; back over (, [, <.
+
+(defun c-change-set-fl-decl-start (beg end old-len)
+ ;; Set c-new-BEG to the beginning of a "local" declaration if it('s BOL) is
+ ;; inside one. This is called from an after-change-function, but the
+ ;; parameters BEG END and OLD-LEN are ignored. See `c-set-fl-decl-start'
+ ;; for the detailed functionality.
+ (if font-lock-mode
+ (setq c-new-BEG (c-set-fl-decl-start c-new-BEG))))
+
+(defun c-context-set-fl-decl-start (beg end)
+ ;; Return a cons (NEW-BEG . END), where NEW-BEG is the beginning of a
+ ;; "local" declaration (BOL at) NEW is inside or BEG. See
+ ;; `c-set-fl-decl-start' for the detailed functionality.
+ (cons (c-set-fl-decl-start beg) end))
+
+(defvar c-standard-font-lock-fontify-region-function nil
+ "Standard value of `font-lock-fontify-region-function'")
+
+(defun c-font-lock-fontify-region (beg end &optional verbose)
+ ;; Effectively advice around `font-lock-fontify-region' which extends the
+ ;; region (BEG END), for example, to avoid context fontification chopping
+ ;; off the start of the context. Do not do anything if it's already been
+ ;; done (i.e. from and after-change fontification. An example (C++) where
+ ;; this used to happen is this:
+ ;;
+ ;; template <typename T>
+ ;;
+ ;;
+ ;; void myfunc(T* p) {}
+ ;;
+ ;; Type a space in the first blank line, and the fontification of the next
+ ;; line was fouled up by context fontification.
+ (let ((new-beg beg) (new-end end) new-region)
+ (if c-in-after-change-fontification
+ (setq c-in-after-change-fontification nil)
+ (save-restriction
+ (widen)
+ (save-excursion
+ (mapc (lambda (fn)
+ (setq new-region (funcall fn new-beg new-end))
+ (setq new-beg (car new-region) new-end (cdr new-region)))
+ c-before-context-fontification-functions))))
+ (funcall c-standard-font-lock-fontify-region-function
+ new-beg new-end verbose)))
+
(defun c-after-font-lock-init ()
- ;; Put on `font-lock-mode-hook'.
+ ;; Put on `font-lock-mode-hook'. This function ensures our after-change
+ ;; function will get excuted before the font-lock one. Amongst other
+ ;; things.
(remove-hook 'after-change-functions 'c-after-change t)
- (add-hook 'after-change-functions 'c-after-change nil t))
+ (add-hook 'after-change-functions 'c-after-change nil t)
+ (setq c-standard-font-lock-fontify-region-function
+ (default-value 'font-lock-fontify-region-function)))
(defun c-font-lock-init ()
"Set up the font-lock variables for using the font-lock support in CC Mode.
This does not load the font-lock package. Use after
-`c-basic-common-init' and after cc-fonts has been loaded."
+`c-basic-common-init' and after cc-fonts has been loaded.
+This function is called from `c-common-init', once per mode initialization."
(set (make-local-variable 'font-lock-defaults)
`(,(if (c-major-mode-is 'awk-mode)
@@ -1092,6 +1208,10 @@ This does not load the font-lock package. Use after
c-beginning-of-syntax
(font-lock-mark-block-function
. c-mark-function)))
+
+ (make-local-variable 'font-lock-fontify-region-function)
+ (setq font-lock-fontify-region-function 'c-font-lock-fontify-region)
+
(if (featurep 'xemacs)
(make-local-hook 'font-lock-mode-hook))
(add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t))
@@ -1562,10 +1682,6 @@ Key bindings:
(c-common-init 'awk-mode)
(c-awk-unstick-NL-prop)
- ;; Prevent XEmacs's buffer-syntactic-context being used. See the comment
- ;; in cc-engine.el, just before (defun c-fast-in-literal ...
- (defalias 'c-in-literal 'c-slow-in-literal)
-
(c-run-mode-hooks 'c-mode-common-hook 'awk-mode-hook)
(c-update-modeline))
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 549f94387d2..a4338a3193b 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -586,7 +586,7 @@ in a mode hook, you have to call `c-setup-doc-comment-style'
afterwards to redo that work."
;; Symbols other than those documented above may be used on this
;; variable. If a variable exists that has that name with
- ;; "-font-lock-keywords" appended, it's value is prepended to the
+ ;; "-font-lock-keywords" appended, its value is prepended to the
;; font lock keywords list. If it's a function then it's called and
;; the result is prepended.
:type '(radio
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 823304bd250..ffe8edfaeb6 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -5,6 +5,7 @@
;; Author: Dave Love <fx@gnu.org>
;; Maintainer: Ted Zlatanov <tzz@lifelogs.com>
;; Keywords: languages
+;; Version: 1.1
;; This file is part of GNU Emacs.
@@ -29,18 +30,18 @@
;; The CFEngine 3.x support doesn't have Imenu support but patches are
;; welcome.
-;; You can set it up so either cfengine-mode (2.x and earlier) or
-;; cfengine3-mode (3.x) will be picked, depending on the buffer
+;; You can set it up so either `cfengine2-mode' (2.x and earlier) or
+;; `cfengine3-mode' (3.x) will be picked, depending on the buffer
;; contents:
-;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-auto-mode))
+;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-mode))
;; OR you can choose to always use a specific version, if you prefer
-;; it
+;; it:
;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine3-mode))
-;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine-mode))
-;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine-mode))
+;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine2-mode))
+;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine2-mode))
;; This is not the same as the mode written by Rolf Ebert
;; <ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does
@@ -49,31 +50,36 @@
;;; Code:
(defgroup cfengine ()
- "Editing Cfengine files."
+ "Editing CFEngine files."
:group 'languages)
(defcustom cfengine-indent 2
- "*Size of a Cfengine indentation step in columns."
+ "*Size of a CFEngine indentation step in columns."
:group 'cfengine
:type 'integer)
+(defvar cfengine-mode-debug nil
+ "Whether `cfengine-mode' should print debugging info.")
+
(defcustom cfengine-mode-abbrevs nil
- "Abbrevs for Cfengine mode."
+ "Abbrevs for CFEngine2 mode."
:group 'cfengine
:type '(repeat (list (string :tag "Name")
(string :tag "Expansion")
(choice :tag "Hook" (const nil) function))))
+(make-obsolete-variable 'cfengine-mode-abbrevs 'edit-abbrevs "24.1")
+
;; Taken from the doc for pre-release 2.1.
(eval-and-compile
- (defconst cfengine-actions
+ (defconst cfengine2-actions
'("acl" "alerts" "binservers" "broadcast" "control" "classes" "copy"
"defaultroute" "disks" "directories" "disable" "editfiles" "files"
"filters" "groups" "homeservers" "ignore" "import" "interfaces"
"links" "mailserver" "methods" "miscmounts" "mountables"
"processes" "packages" "rename" "required" "resolve"
"shellcommands" "tidy" "unmount"
- ;; cfservd
+ ;; Keywords for cfservd.
"admit" "grant" "deny")
"List of the action keywords supported by Cfengine.
This includes those for cfservd as well as cfagent.")
@@ -98,11 +104,11 @@ This includes those for cfservd as well as cfagent.")
'(string int real slist ilist rlist irange rrange counter))
"List of the CFEngine 3.x variable types."))
-(defvar cfengine-font-lock-keywords
+(defvar cfengine2-font-lock-keywords
`(;; Actions.
;; List the allowed actions explicitly, so that errors are more obvious.
(,(concat "^[ \t]*" (eval-when-compile
- (regexp-opt cfengine-actions t))
+ (regexp-opt cfengine2-actions t))
":")
1 font-lock-keyword-face)
;; Classes.
@@ -117,46 +123,54 @@ This includes those for cfservd as well as cfagent.")
(defvar cfengine3-font-lock-keywords
`(
+ ;; Defuns. This happens early so they don't get caught by looser
+ ;; patterns.
+ (,(concat "\\<" cfengine3-defuns-regex "\\>"
+ "[ \t]+\\<\\([[:alnum:]_]+\\)\\>"
+ "[ \t]+\\<\\([[:alnum:]_]+\\)"
+ ;; Optional parentheses with variable names inside.
+ "\\(?:(\\([^)]*\\))\\)?")
+ (1 font-lock-builtin-face)
+ (2 font-lock-constant-face)
+ (3 font-lock-function-name-face)
+ (4 font-lock-variable-name-face nil t))
+
+ ;; Class selectors.
(,(concat "^[ \t]*" cfengine3-class-selector-regex)
1 font-lock-keyword-face)
+
+ ;; Categories.
(,(concat "^[ \t]*" cfengine3-category-regex)
1 font-lock-builtin-face)
+
;; Variables, including scope, e.g. module.var
("[@$](\\([[:alnum:]_.]+\\))" 1 font-lock-variable-name-face)
("[@$]{\\([[:alnum:]_.]+\\)}" 1 font-lock-variable-name-face)
+
;; Variable definitions.
("\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face)
- ;; CFEngine 3.x faces
- ;; defuns
- (,(concat "\\<" cfengine3-defuns-regex "\\>"
- "[ \t]+\\<\\([[:alnum:]_]+\\)\\>"
- "[ \t]+\\<\\([[:alnum:]_]+\\)\\((\\([^)]*\\))\\)?")
- (1 font-lock-builtin-face)
- (2 font-lock-constant-name-face)
- (3 font-lock-function-name-face)
- (5 font-lock-variable-name-face))
- ;; variable types
+ ;; Variable types.
(,(concat "\\<" (eval-when-compile (regexp-opt cfengine3-vartypes t)) "\\>")
1 font-lock-type-face)))
-(defvar cfengine-imenu-expression
+(defvar cfengine2-imenu-expression
`((nil ,(concat "^[ \t]*" (eval-when-compile
- (regexp-opt cfengine-actions t))
+ (regexp-opt cfengine2-actions t))
":[^:]")
1)
("Variables/classes" "\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1)
("Variables/classes" "\\<define=\\([[:alnum:]_]+\\)" 1)
("Variables/classes" "\\<DefineClass\\>[ \t]+\\([[:alnum:]_]+\\)" 1))
- "`imenu-generic-expression' for Cfengine mode.")
+ "`imenu-generic-expression' for CFEngine mode.")
-(defun cfengine-outline-level ()
- "`outline-level' function for Cfengine mode."
+(defun cfengine2-outline-level ()
+ "`outline-level' function for CFEngine mode."
(if (looking-at "[^:]+\\(?:[:]+\\)$")
(length (match-string 1))))
-(defun cfengine-beginning-of-defun ()
- "`beginning-of-defun' function for Cfengine mode.
+(defun cfengine2-beginning-of-defun ()
+ "`beginning-of-defun' function for CFEngine mode.
Treats actions as defuns."
(unless (<= (current-column) (current-indentation))
(end-of-line))
@@ -165,8 +179,8 @@ Treats actions as defuns."
(goto-char (point-min)))
t)
-(defun cfengine-end-of-defun ()
- "`end-of-defun' function for Cfengine mode.
+(defun cfengine2-end-of-defun ()
+ "`end-of-defun' function for CFEngine mode.
Treats actions as defuns."
(end-of-line)
(if (re-search-forward "^[[:alpha:]]+: *$" nil t)
@@ -176,7 +190,7 @@ Treats actions as defuns."
;; Fixme: Should get an extra indent step in editfiles BeginGroup...s.
-(defun cfengine-indent-line ()
+(defun cfengine2-indent-line ()
"Indent a line in Cfengine mode.
Intended as the value of `indent-line-function'."
(let ((pos (- (point-max) (point))))
@@ -283,15 +297,17 @@ Intended as the value of `indent-line-function'."
(narrow-to-defun)
(back-to-indentation)
(setq parse (parse-partial-sexp (point-min) (point)))
- (message "%S" parse)
+ (when cfengine-mode-debug
+ (message "%S" parse))
+
(cond
- ;; body/bundle blocks start at 0
+ ;; Body/bundle blocks start at 0.
((looking-at (concat cfengine3-defuns-regex "\\>"))
(indent-line-to 0))
- ;; categories are indented one step
+ ;; Categories are indented one step.
((looking-at (concat cfengine3-category-regex "[ \t]*$"))
(indent-line-to cfengine-indent))
- ;; class selectors are indented two steps
+ ;; Class selectors are indented two steps.
((looking-at (concat cfengine3-class-selector-regex "[ \t]*$"))
(indent-line-to (* 2 cfengine-indent)))
;; Outdent leading close brackets one step.
@@ -303,11 +319,17 @@ Intended as the value of `indent-line-function'."
(backward-sexp)
(current-column)))
(error nil)))
- ;; inside a string and it starts before this line
+ ;; Inside a string and it starts before this line.
((and (nth 3 parse)
(< (nth 8 parse) (save-excursion (beginning-of-line) (point))))
(indent-line-to 0))
- ;; inside a defun, but not a nested list (depth is 1)
+
+ ;; Inside a defun, but not a nested list (depth is 1). This is
+ ;; a promise, usually.
+
+ ;; Indent to cfengine-indent times the nested depth
+ ;; plus 2. That way, promises indent deeper than class
+ ;; selectors, which in turn are one deeper than categories.
((= 1 (nth 0 parse))
(indent-line-to (* (+ 2 (nth 0 parse)) cfengine-indent)))
;; Inside brackets/parens: indent to start column of non-comment
@@ -411,18 +433,18 @@ Intended as the value of `indent-line-function'."
(set (make-local-variable 'parse-sexp-ignore-comments) t))
(defun cfengine-common-syntax (table)
- ;; the syntax defaults seem OK to give reasonable word movement
+ ;; The syntax defaults seem OK to give reasonable word movement.
(modify-syntax-entry ?# "<" table)
(modify-syntax-entry ?\n ">#" table)
(modify-syntax-entry ?\" "\"" table)
- ;; variable substitution:
+ ;; Variable substitution.
(modify-syntax-entry ?$ "." table)
- ;; Doze path separators:
+ ;; Doze path separators.
(modify-syntax-entry ?\\ "." table))
;;;###autoload
-(define-derived-mode cfengine3-mode prog-mode "CFEngine3"
- "Major mode for editing cfengine input.
+(define-derived-mode cfengine3-mode prog-mode "CFE3"
+ "Major mode for editing CFEngine3 input.
There are no special keybindings by default.
Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves
@@ -434,46 +456,46 @@ to the action header."
(setq font-lock-defaults
'(cfengine3-font-lock-keywords nil nil nil beginning-of-defun))
- ;; use defuns as the essential syntax block
+ ;; Use defuns as the essential syntax block.
(set (make-local-variable 'beginning-of-defun-function)
#'cfengine3-beginning-of-defun)
(set (make-local-variable 'end-of-defun-function)
#'cfengine3-end-of-defun))
;;;###autoload
-(define-derived-mode cfengine-mode prog-mode "Cfengine"
- "Major mode for editing cfengine input.
+(define-derived-mode cfengine2-mode prog-mode "CFE2"
+ "Major mode for editing CFEngine2 input.
There are no special keybindings by default.
Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves
to the action header."
(cfengine-common-settings)
- (cfengine-common-syntax cfengine-mode-syntax-table)
+ (cfengine-common-syntax cfengine2-mode-syntax-table)
;; Shell commands can be quoted by single, double or back quotes.
;; It's debatable whether we should define string syntax, but it
;; should avoid potential confusion in some cases.
- (modify-syntax-entry ?\' "\"" cfengine-mode-syntax-table)
- (modify-syntax-entry ?\` "\"" cfengine-mode-syntax-table)
+ (modify-syntax-entry ?\' "\"" cfengine2-mode-syntax-table)
+ (modify-syntax-entry ?\` "\"" cfengine2-mode-syntax-table)
- (set (make-local-variable 'indent-line-function) #'cfengine-indent-line)
+ (set (make-local-variable 'indent-line-function) #'cfengine2-indent-line)
(set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+")
- (set (make-local-variable 'outline-level) #'cfengine-outline-level)
+ (set (make-local-variable 'outline-level) #'cfengine2-outline-level)
(set (make-local-variable 'fill-paragraph-function)
#'cfengine-fill-paragraph)
- (define-abbrev-table 'cfengine-mode-abbrev-table cfengine-mode-abbrevs)
+ (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs)
(setq font-lock-defaults
- '(cfengine-font-lock-keywords nil nil nil beginning-of-line))
+ '(cfengine2-font-lock-keywords nil nil nil beginning-of-line))
;; Fixme: set the args of functions in evaluated classes to string
;; syntax, and then obey syntax properties.
- (setq imenu-generic-expression cfengine-imenu-expression)
+ (setq imenu-generic-expression cfengine2-imenu-expression)
(set (make-local-variable 'beginning-of-defun-function)
- #'cfengine-beginning-of-defun)
- (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun))
+ #'cfengine2-beginning-of-defun)
+ (set (make-local-variable 'end-of-defun-function) #'cfengine2-end-of-defun))
;;;###autoload
(defun cfengine-auto-mode ()
- "Choose between `cfengine-mode' and `cfengine3-mode' depending
+ "Choose between `cfengine2-mode' and `cfengine3-mode' depending
on the buffer contents"
(let ((v3 nil))
(save-restriction
@@ -481,7 +503,9 @@ on the buffer contents"
(while (not (or (eobp) v3))
(setq v3 (looking-at (concat cfengine3-defuns-regex "\\>")))
(forward-line)))
- (if v3 (cfengine3-mode) (cfengine-mode))))
+ (if v3 (cfengine3-mode) (cfengine2-mode))))
+
+(defalias 'cfengine-mode 'cfengine-auto-mode)
(provide 'cfengine3)
(provide 'cfengine)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 13fa310106c..86284eaa30a 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -958,7 +958,7 @@ B) Speed of editing operations.
`cperl-array-face' Array names
`cperl-hash-face' Hash names
`font-lock-comment-face' Comments, PODs and whatever is considered
- syntaxically to be not code
+ syntactically to be not code
`font-lock-constant-face' HERE-doc delimiters, labels, delimiters of
2-arg operators s/y/tr/ or of RExen,
`font-lock-warning-face' Special-cased m// and s//foo/,
@@ -970,7 +970,7 @@ B) Speed of editing operations.
`cperl-nonoverridable-face' Non-overridable keywords, modifiers of RExen
`font-lock-string-face' Strings, qw() constructs, RExen, POD sections,
literal parts and the terminator of formats
- and whatever is syntaxically considered
+ and whatever is syntactically considered
as string literals
`font-lock-type-face' Overridable keywords
`font-lock-variable-name-face' Variable declarations, indirect array and
@@ -1537,8 +1537,8 @@ default.) You can always quote (with \\[quoted-insert]) the left
since most the time you mean \"less\". CPerl mode tries to guess
whether you want to type pair <>, and inserts is if it
appropriate. You can set `cperl-electric-parens-string' to the string that
-contains the parenths from the above list you want to be electrical.
-Electricity of parenths is controlled by `cperl-electric-parens'.
+contains the parens from the above list you want to be electrical.
+Electricity of parens is controlled by `cperl-electric-parens'.
You may also set `cperl-electric-parens-mark' to have electric parens
look for active mark and \"embrace\" a region if possible.'
@@ -3517,7 +3517,7 @@ Works before syntax recognition is done."
(defvar font-lock-warning-face)
(defun cperl-find-sub-attrs (&optional st-l b-fname e-fname pos)
- "Syntaxically mark (and fontify) attributes of a subroutine.
+ "Syntactically mark (and fontify) attributes of a subroutine.
Should be called with the point before leading colon of an attribute."
;; Works *before* syntax recognition is done
(or st-l (setq st-l (list nil))) ; Avoid overwriting '()
@@ -4994,7 +4994,7 @@ conditional/loop constructs."
(setq top (point))
;; Plan A: if line has an unfinished paren-group, go to end-of-group
(while (= -1 (nth 0 (parse-partial-sexp (point) tmp-end -1)))
- (setq top (point))) ; Get the outermost parenths in line
+ (setq top (point))) ; Get the outermost parens in line
(goto-char top)
(while (< (point) tmp-end)
(parse-partial-sexp (point) tmp-end nil t) ; To start-sexp or eol
@@ -5906,7 +5906,7 @@ indentation and initial hashes. Behaves usually outside of comment."
3 font-lock-variable-name-face)))
'("\\<for\\(each\\)?\\([ \t]+\\(my\\|local\\|our\\)\\)?[ \t]*\\(\\$[a-zA-Z_][a-zA-Z_0-9]*\\)[ \t]*("
4 font-lock-variable-name-face)
- ;; Avoid $!, and s!!, qq!! etc. when not fontifying syntaxically
+ ;; Avoid $!, and s!!, qq!! etc. when not fontifying syntactically
'("\\(?:^\\|[^smywqrx$]\\)\\(!\\)" 1 font-lock-negation-char-face)
'("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend)))
(setq
diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el
index d855861d552..eeb145e2b1a 100644
--- a/lisp/progmodes/dcl-mode.el
+++ b/lisp/progmodes/dcl-mode.el
@@ -708,7 +708,7 @@ Returns point of the found command line or nil if not able to move."
(setq done t) ; not a label-only line, exit the loop
(setq retval (point))))
;; We couldn't go further back, and we haven't found a command yet.
- ;; Return to the start positionn
+ ;; Return to the start position.
(goto-char start)
(setq done t)
(setq retval nil)))
@@ -756,7 +756,7 @@ Returns point of the found command line or nil if not able to move."
(setq done t) ; not a label-only line, exit the loop
(setq retval (point)))))
;; We couldn't go further back, and we haven't found a command yet.
- ;; Return to the start positionn
+ ;; Return to the start position.
(goto-char start)
(setq done t)
(setq retval nil)))
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index d9adff6c8b8..240deb39ce3 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -3260,7 +3260,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
% --- Corners
-%>corner Right Descendent: height arrow corner_RD
+%>corner Right Descendant: height arrow corner_RD
% _ | arrow
% / height > 0 | 0 - none
% | | 1 - right
@@ -3299,7 +3299,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
Gstroke
}def
-%>corner Right Ascendent: height arrow corner_RA
+%>corner Right Ascendant: height arrow corner_RA
% | arrow
% | height > 0 | 0 - none
% / | 1 - right
@@ -3338,7 +3338,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
Gstroke
}def
-%>corner Left Descendent: height arrow corner_LD
+%>corner Left Descendant: height arrow corner_LD
% _ | arrow
% \\ height > 0 | 0 - none
% | | 1 - right
@@ -3377,7 +3377,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
Gstroke
}def
-%>corner Left Ascendent: height arrow corner_LA
+%>corner Left Ascendant: height arrow corner_LA
% | arrow
% | height > 0 | 0 - none
% \\ | 1 - right
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index ab40dff24f1..1c38c59bba6 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -811,6 +811,9 @@ detailed description of this mode.
(define-key gud-minor-mode-map [left-margin C-mouse-3]
'gdb-mouse-jump)
+ (set (make-local-variable 'gud-gdb-completion-function)
+ 'gud-gdbmi-completions)
+
(add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
nil 'local)
(local-set-key "\C-i" 'completion-at-point)
@@ -859,31 +862,28 @@ detailed description of this mode.
(set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter)
(gdb-input
;; Needs GDB 6.4 onwards
- (list (concat "-inferior-tty-set "
- (or
- ;; The process can run on a remote host.
- (process-get (get-process "gdb-inferior") 'remote-tty)
- (process-tty-name (get-process "gdb-inferior"))))
- 'ignore))
+ (concat "-inferior-tty-set "
+ (or
+ ;; The process can run on a remote host.
+ (process-get (get-process "gdb-inferior") 'remote-tty)
+ (process-tty-name (get-process "gdb-inferior"))))
+ 'ignore)
(if (eq window-system 'w32)
- (gdb-input (list "-gdb-set new-console off" 'ignore)))
- (gdb-input (list "-gdb-set height 0" 'ignore))
+ (gdb-input "-gdb-set new-console off" 'ignore))
+ (gdb-input "-gdb-set height 0" 'ignore)
(when gdb-non-stop
- (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler)))
+ (gdb-input "-gdb-set non-stop 1" 'gdb-non-stop-handler))
- (gdb-input (list "-enable-pretty-printing" 'ignore))
+ (gdb-input "-enable-pretty-printing" 'ignore)
;; find source file and compilation directory here
(if gdb-create-source-file-list
- (gdb-input
- ; Needs GDB 6.2 onwards.
- (list "-file-list-exec-source-files" 'gdb-get-source-file-list)))
- (gdb-input
- ; Needs GDB 6.0 onwards.
- (list "-file-list-exec-source-file" 'gdb-get-source-file))
- (gdb-input
- (list "-gdb-show prompt" 'gdb-get-prompt)))
+ ;; Needs GDB 6.2 onwards.
+ (gdb-input "-file-list-exec-source-files" 'gdb-get-source-file-list))
+ ;; Needs GDB 6.0 onwards.
+ (gdb-input "-file-list-exec-source-file" 'gdb-get-source-file)
+ (gdb-input "-gdb-show prompt" 'gdb-get-prompt))
(defun gdb-non-stop-handler ()
(goto-char (point-min))
@@ -894,8 +894,8 @@ detailed description of this mode.
(setq gdb-non-stop nil)
(setq gdb-supports-non-stop nil))
(setq gdb-supports-non-stop t)
- (gdb-input (list "-gdb-set target-async 1" 'ignore))
- (gdb-input (list "-list-target-features" 'gdb-check-target-async))))
+ (gdb-input "-gdb-set target-async 1" 'ignore)
+ (gdb-input "-list-target-features" 'gdb-check-target-async)))
(defun gdb-check-target-async ()
(goto-char (point-min))
@@ -903,7 +903,7 @@ detailed description of this mode.
(message
"Target doesn't support non-stop mode. Turning it off.")
(setq gdb-non-stop nil)
- (gdb-input (list "-gdb-set non-stop 0" 'ignore))))
+ (gdb-input "-gdb-set non-stop 0" 'ignore)))
(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
@@ -948,9 +948,8 @@ detailed description of this mode.
(goto-char (point-min))
(if (search-forward "expands to: " nil t)
(unless (looking-at "\\S-+.*(.*).*")
- (gdb-input
- (list (concat "-data-evaluate-expression " expr)
- `(lambda () (gdb-tooltip-print ,expr))))))))
+ (gdb-input (concat "-data-evaluate-expression " expr)
+ `(lambda () (gdb-tooltip-print ,expr)))))))
(defun gdb-init-buffer ()
(set (make-local-variable 'gud-minor-mode) 'gdbmi)
@@ -1080,9 +1079,8 @@ With arg, enter name of variable to be watched in the minibuffer."
(concat (if (derived-mode-p 'gdb-registers-mode) "$")
(tooltip-identifier-from-point (point)))))))
(set-text-properties 0 (length expr) nil expr)
- (gdb-input
- (list (concat "-var-create - * " expr "")
- `(lambda () (gdb-var-create-handler ,expr)))))))
+ (gdb-input (concat "-var-create - * " expr "")
+ `(lambda () (gdb-var-create-handler ,expr))))))
(message "gud-watch is a no-op in this mode."))))
(defun gdb-var-create-handler (expr)
@@ -1111,7 +1109,7 @@ With arg, enter name of variable to be watched in the minibuffer."
(when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)
(not (gdb-pending-p 'gdb-speedbar-timer)))
;; Dummy command to update speedbar even when idle.
- (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn))
+ (gdb-input "-environment-pwd" 'gdb-speedbar-timer-fn)
;; Keep gdb-pending-triggers non-nil till end.
(gdb-add-pending 'gdb-speedbar-timer)))
@@ -1132,12 +1130,9 @@ With arg, enter name of variable to be watched in the minibuffer."
; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards.
(defun gdb-var-list-children (varnum)
- (gdb-input
- (list (concat "-var-update " varnum) 'ignore))
- (gdb-input
- (list (concat "-var-list-children --all-values "
- varnum)
- `(lambda () (gdb-var-list-children-handler ,varnum)))))
+ (gdb-input (concat "-var-update " varnum) 'ignore)
+ (gdb-input (concat "-var-list-children --all-values " varnum)
+ `(lambda () (gdb-var-list-children-handler ,varnum))))
(defun gdb-var-list-children-handler (varnum)
(let* ((var-list nil)
@@ -1169,13 +1164,11 @@ With arg, enter name of variable to be watched in the minibuffer."
"Set the output format for a variable displayed in the speedbar."
(let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
(varnum (car var)))
- (gdb-input
- (list (concat "-var-set-format " varnum " " format) 'ignore))
+ (gdb-input (concat "-var-set-format " varnum " " format) 'ignore)
(gdb-var-update)))
(defun gdb-var-delete-1 (var varnum)
- (gdb-input
- (list (concat "-var-delete " varnum) 'ignore))
+ (gdb-input (concat "-var-delete " varnum) 'ignore)
(setq gdb-var-list (delq var gdb-var-list))
(dolist (varchild gdb-var-list)
(if (string-match (concat (car var) "\\.") (car varchild))
@@ -1194,17 +1187,15 @@ With arg, enter name of variable to be watched in the minibuffer."
(defun gdb-var-delete-children (varnum)
"Delete children of variable object at point from the speedbar."
- (gdb-input
- (list (concat "-var-delete -c " varnum) 'ignore)))
+ (gdb-input (concat "-var-delete -c " varnum) 'ignore))
(defun gdb-edit-value (_text _token _indent)
"Assign a value to a variable displayed in the speedbar."
(let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
(varnum (car var)) (value))
(setq value (read-string "New value: "))
- (gdb-input
- (list (concat "-var-assign " varnum " " value)
- `(lambda () (gdb-edit-value-handler ,value))))))
+ (gdb-input (concat "-var-assign " varnum " " value)
+ `(lambda () (gdb-edit-value-handler ,value)))))
(defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)")
@@ -1216,8 +1207,7 @@ With arg, enter name of variable to be watched in the minibuffer."
; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
(defun gdb-var-update ()
(if (not (gdb-pending-p 'gdb-var-update))
- (gdb-input
- (list "-var-update --all-values *" 'gdb-var-update-handler)))
+ (gdb-input "-var-update --all-values *" 'gdb-var-update-handler))
(gdb-add-pending 'gdb-var-update))
(defun gdb-var-update-handler ()
@@ -1697,13 +1687,17 @@ static char *magick[] = {
gdb-continuation string "\"\n"))
(setq gdb-continuation nil))))
-(defun gdb-input (item)
- (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log))
+(defun gdb-input (command handler-function)
+ "Send COMMAND to GDB via the MI interface.
+Run the function HANDLER-FUNCTION, with no arguments, once the command is
+complete."
+ (if gdb-enable-debug (push (list 'send-item command handler-function)
+ gdb-debug-log))
(setq gdb-token-number (1+ gdb-token-number))
- (setcar item (concat (number-to-string gdb-token-number) (car item)))
- (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist)
+ (setq command (concat (number-to-string gdb-token-number) command))
+ (push (cons gdb-token-number handler-function) gdb-handler-alist)
(process-send-string (get-buffer-process gud-comint-buffer)
- (concat (car item) "\n")))
+ (concat command "\n")))
;; NOFRAME is used for gud execution control commands
(defun gdb-current-context-command (command)
@@ -1890,15 +1884,16 @@ is running."
(let ((record-type (cadr output-record))
(arg1 (nth 2 output-record))
(arg2 (nth 3 output-record)))
- (if (eq record-type 'gdb-error)
- (gdb-done-or-error arg2 arg1 'error)
- (if (eq record-type 'gdb-done)
- (gdb-done-or-error arg2 arg1 'done)
- ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI
- ;; error message on internal stream. Don't print to GUD buffer.
- (unless (and (eq record-type 'gdb-internals)
- (string-equal (read arg1) "No registers.\n"))
- (funcall record-type arg1))))))
+ (cond ((eq record-type 'gdb-error)
+ (gdb-done-or-error arg2 arg1 'error))
+ ((eq record-type 'gdb-done)
+ (gdb-done-or-error arg2 arg1 'done))
+ ;; Suppress "No registers." GDB 6.8 and earlier
+ ;; duplicates MI error message on internal stream.
+ ;; Don't print to GUD buffer.
+ ((not (and (eq record-type 'gdb-internals)
+ (string-equal (read arg1) "No registers.\n")))
+ (funcall record-type arg1)))))
(setq gdb-output-sink 'user)
;; Remove padding.
@@ -1991,11 +1986,10 @@ current thread and update GDB buffers."
;; -data-list-register-names needs to be issued for any stopped
;; thread
(when (not gdb-register-names)
- (gdb-input
- (list (concat "-data-list-register-names"
- (if gdb-supports-non-stop
- (concat " --thread " thread-id)))
- 'gdb-register-names-handler)))
+ (gdb-input (concat "-data-list-register-names"
+ (if gdb-supports-non-stop
+ (concat " --thread " thread-id)))
+ 'gdb-register-names-handler))
;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler
;;; because synchronous GDB doesn't give these fields with CLI.
@@ -2062,9 +2056,7 @@ current thread and update GDB buffers."
;; (frontend MI commands should not print to this stream)
(defun gdb-console (output-field)
(setq gdb-filter-output
- (gdb-concat-output
- gdb-filter-output
- (read output-field))))
+ (gdb-concat-output gdb-filter-output (read output-field))))
(defun gdb-done-or-error (output-field token-number type)
(if (string-equal token-number "")
@@ -2102,12 +2094,11 @@ current thread and update GDB buffers."
(assq-delete-all token-number gdb-handler-alist)))))
(defun gdb-concat-output (so-far new)
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'user) (concat so-far new))
- ((eq sink 'emacs)
- (gdb-append-to-partial-output new)
- so-far))))
+ (cond
+ ((eq gdb-output-sink 'user) (concat so-far new))
+ ((eq gdb-output-sink 'emacs)
+ (gdb-append-to-partial-output new)
+ so-far)))
(defun gdb-append-to-partial-output (string)
(with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
@@ -2317,9 +2308,8 @@ trigger argument when describing buffer types with
(memq signal ,signal-list))
(when (not (gdb-pending-p
(cons (current-buffer) ',trigger-name)))
- (gdb-input
- (list ,gdb-command
- (gdb-bind-function-to-buffer ',handler-name (current-buffer))))
+ (gdb-input ,gdb-command
+ (gdb-bind-function-to-buffer ',handler-name (current-buffer)))
(gdb-add-pending (cons (current-buffer) ',trigger-name))))))
;; Used by disassembly buffer only, the rest use
@@ -2446,13 +2436,10 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
;; Only want one breakpoint icon at each location.
(gdb-put-breakpoint-icon (string-equal flag "y") bptno
(string-to-number line)))
- (gdb-input
- (list (concat "list " file ":1")
- 'ignore))
- (gdb-input
- (list "-file-list-exec-source-file"
- `(lambda () (gdb-get-location
- ,bptno ,line ,flag))))))))))
+ (gdb-input (concat "list " file ":1") 'ignore)
+ (gdb-input "-file-list-exec-source-file"
+ `(lambda () (gdb-get-location
+ ,bptno ,line ,flag)))))))))
(defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"")
@@ -2782,7 +2769,7 @@ on the current line."
(def-gdb-thread-buffer-command gdb-select-thread
(let ((new-id (bindat-get-field thread 'id)))
(gdb-setq-thread-number new-id)
- (gdb-input (list (concat "-thread-select " new-id) 'ignore))
+ (gdb-input (concat "-thread-select " new-id) 'ignore)
(gdb-update))
"Select the thread at current line of threads buffer.")
@@ -3538,8 +3525,8 @@ member."
(if (gdb-buffer-shows-main-thread-p)
(let ((new-level (bindat-get-field frame 'level)))
(setq gdb-frame-number new-level)
- (gdb-input (list (concat "-stack-select-frame " new-level)
- 'ignore))
+ (gdb-input (concat "-stack-select-frame " new-level)
+ 'ignore)
(gdb-update))
(error "Could not select frame for non-current thread"))
(error "Not recognized as frame line"))))
@@ -3767,14 +3754,11 @@ member."
;; Needs GDB 6.4 onwards (used to fail with no stack).
(defun gdb-get-changed-registers ()
- (if (and (gdb-get-buffer 'gdb-registers-buffer)
- (not (gdb-pending-p 'gdb-get-changed-registers)))
- (progn
- (gdb-input
- (list
- "-data-list-changed-registers"
- 'gdb-changed-registers-handler))
- (gdb-add-pending 'gdb-get-changed-registers))))
+ (when (and (gdb-get-buffer 'gdb-registers-buffer)
+ (not (gdb-pending-p 'gdb-get-changed-registers)))
+ (gdb-input "-data-list-changed-registers"
+ 'gdb-changed-registers-handler)
+ (gdb-add-pending 'gdb-get-changed-registers)))
(defun gdb-changed-registers-handler ()
(gdb-delete-pending 'gdb-get-changed-registers)
@@ -3803,18 +3787,15 @@ is set in them."
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (member buffer-file-name gdb-source-file-list)
- (gdb-init-buffer))))
- (gdb-force-mode-line-update
- (propertize "ready" 'face font-lock-variable-name-face)))
+ (gdb-init-buffer)))))
(defun gdb-get-main-selected-frame ()
"Trigger for `gdb-frame-handler' which uses main current
thread. Called from `gdb-update'."
(if (not (gdb-pending-p 'gdb-get-main-selected-frame))
(progn
- (gdb-input
- (list (gdb-current-context-command "-stack-info-frame")
- 'gdb-frame-handler))
+ (gdb-input (gdb-current-context-command "-stack-info-frame")
+ 'gdb-frame-handler)
(gdb-add-pending 'gdb-get-main-selected-frame))))
(defun gdb-frame-handler ()
@@ -3862,7 +3843,7 @@ overlay arrow in source buffer."
If BUF is already displayed in some window, show it, deiconifying
the frame if necessary. Otherwise, find least recently used
window and show BUF there, if the window is not used for GDB
-already, in which case that window is splitted first."
+already, in which case that window is split first."
(let ((answer (get-buffer-window buf (or frame 0))))
(if answer
(display-buffer buf nil (or frame 0)) ;Deiconify frame if necessary.
@@ -4145,7 +4126,9 @@ buffers, if required."
(gdb-get-buffer-create 'gdb-breakpoints-buffer)
(if (and gdb-show-main gdb-main-file)
(let ((pop-up-windows t))
- (display-buffer (gud-find-file gdb-main-file))))))
+ (display-buffer (gud-find-file gdb-main-file)))))
+ (gdb-force-mode-line-update
+ (propertize "ready" 'face font-lock-variable-name-face)))
;;from put-image
(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
@@ -4256,6 +4239,42 @@ BUFFER nil or omitted means use the current buffer."
(set-window-margins
window left-margin-width right-margin-width)))))
+
+;;; Functions for inline completion.
+
+(defvar gud-gdb-fetch-lines-in-progress)
+(defvar gud-gdb-fetch-lines-string)
+(defvar gud-gdb-fetch-lines-break)
+(defvar gud-gdb-fetched-lines)
+
+(defun gud-gdbmi-completions (context command)
+ "Completion table for GDB/MI commands.
+COMMAND is the prefix for which we seek completion.
+CONTEXT is the text before COMMAND on the line."
+ (let ((gud-gdb-fetch-lines-in-progress t)
+ (gud-gdb-fetch-lines-string nil)
+ (gud-gdb-fetch-lines-break (length context))
+ (gud-gdb-fetched-lines nil)
+ ;; This filter dumps output lines to `gud-gdb-fetched-lines'.
+ (gud-marker-filter #'gud-gdbmi-fetch-lines-filter)
+ complete-list)
+ (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
+ (gdb-input (concat "complete " context command)
+ (lambda () (setq gud-gdb-fetch-lines-in-progress nil)))
+ (while gud-gdb-fetch-lines-in-progress
+ (accept-process-output (get-buffer-process gud-comint-buffer))))
+ (gud-gdb-completions-1 gud-gdb-fetched-lines)))
+
+(defun gud-gdbmi-fetch-lines-filter (string)
+ "Custom filter function for `gud-gdbmi-completions'."
+ (setq string (concat gud-gdb-fetch-lines-string
+ (gud-gdbmi-marker-filter string)))
+ (while (string-match "\n" string)
+ (push (substring string gud-gdb-fetch-lines-break (match-beginning 0))
+ gud-gdb-fetched-lines)
+ (setq string (substring string (match-end 0))))
+ "")
+
(provide 'gdb-mi)
;;; gdb-mi.el ends here
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 75d71d2d8a9..38b17a9b1ee 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -108,7 +108,7 @@ To change the default value, use Customize or call the function
Setting it causes the grep commands to put point at the end of their
output window so that the end of the output is always visible rather
-than the begining."
+than the beginning."
:type 'boolean
:version "22.1"
:group 'grep)
@@ -959,7 +959,10 @@ can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-err
in the grep output buffer,
to go to the lines where grep found matches.
-This command shares argument histories with \\[lgrep] and \\[grep-find]."
+This command shares argument histories with \\[lgrep] and \\[grep-find].
+
+When called programmatically and FILES is nil, REGEXP is expected
+to specify a command to run."
(interactive
(progn
(grep-compute-defaults)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 406db76487d..7215ac4ea73 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -756,6 +756,8 @@ directory and source-file directory for your debugger."
(add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
nil 'local)
+ (set (make-local-variable 'gud-gdb-completion-function) 'gud-gdb-completions)
+
(local-set-key "\C-i" 'completion-at-point)
(setq comint-prompt-regexp "^(.*gdb[+]?) *")
(setq paragraph-start comint-prompt-regexp)
@@ -768,6 +770,12 @@ directory and source-file directory for your debugger."
;; context-sensitive command completion. We preserve that feature
;; in the GUD buffer by using a GDB command designed just for Emacs.
+(defvar gud-gdb-completion-function nil
+ "Completion function for GDB commands.
+It receives two arguments: COMMAND, the prefix for which we seek
+completion; and CONTEXT, the text before COMMAND on the line.
+It should return a list of completion strings.")
+
;; The completion process filter indicates when it is finished.
(defvar gud-gdb-fetch-lines-in-progress)
@@ -806,28 +814,32 @@ CONTEXT is the text before COMMAND on the line."
(and complete-list
(string-match "^Undefined command: \"complete\"" (car complete-list))
(error "This version of GDB doesn't support the `complete' command"))
- ;; Sort the list like readline.
- (setq complete-list (sort complete-list (function string-lessp)))
- ;; Remove duplicates.
- (let ((first complete-list)
- (second (cdr complete-list)))
- (while second
- (if (string-equal (car first) (car second))
- (setcdr first (setq second (cdr second)))
- (setq first second
- second (cdr second)))))
- ;; Add a trailing single quote if there is a unique completion
- ;; and it contains an odd number of unquoted single quotes.
- (and (= (length complete-list) 1)
- (let ((str (car complete-list))
- (pos 0)
- (count 0))
- (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos)
- (setq count (1+ count)
- pos (match-end 0)))
- (and (= (mod count 2) 1)
- (setq complete-list (list (concat str "'"))))))
- complete-list))
+ (gud-gdb-completions-1 complete-list)))
+
+;; This function is also used by `gud-gdbmi-completions'.
+(defun gud-gdb-completions-1 (complete-list)
+ ;; Sort the list like readline.
+ (setq complete-list (sort complete-list (function string-lessp)))
+ ;; Remove duplicates.
+ (let ((first complete-list)
+ (second (cdr complete-list)))
+ (while second
+ (if (string-equal (car first) (car second))
+ (setcdr first (setq second (cdr second)))
+ (setq first second
+ second (cdr second)))))
+ ;; Add a trailing single quote if there is a unique completion
+ ;; and it contains an odd number of unquoted single quotes.
+ (and (= (length complete-list) 1)
+ (let ((str (car complete-list))
+ (pos 0)
+ (count 0))
+ (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos)
+ (setq count (1+ count)
+ pos (match-end 0)))
+ (and (= (mod count 2) 1)
+ (setq complete-list (list (concat str "'"))))))
+ complete-list)
(defun gud-gdb-completion-at-point ()
"Return the data to complete the GDB command before point."
@@ -838,7 +850,7 @@ CONTEXT is the text before COMMAND on the line."
(point))))
(list start end
(completion-table-dynamic
- (apply-partially #'gud-gdb-completions
+ (apply-partially gud-gdb-completion-function
(buffer-substring (comint-line-beginning-position)
start))))))
@@ -851,11 +863,11 @@ CONTEXT is the text before COMMAND on the line."
;; The completion process filter is installed temporarily to slurp the
;; output of GDB up to the next prompt and build the completion list.
-(defun gud-gdb-fetch-lines-filter (string filter)
+(defun gud-gdb-fetch-lines-filter (string)
"Filter used to read the list of lines output by a command.
STRING is the output to filter.
-It is passed through FILTER before we look at it."
- (setq string (funcall filter string))
+It is passed through `gud-gdb-marker-filter' before we look at it."
+ (setq string (gud-gdb-marker-filter string))
(setq string (concat gud-gdb-fetch-lines-string string))
(while (string-match "\n" string)
(push (substring string gud-gdb-fetch-lines-break (match-beginning 0))
@@ -880,17 +892,6 @@ It is passed through FILTER before we look at it."
(defvar gud-gdb-fetched-stack-frame nil
"Stack frames we are fetching from GDB.")
-;(defun gud-gdb-get-scope-data (text token indent)
-; ;; checkdoc-params: (indent)
-; "Fetch data associated with a stack frame, and expand/contract it.
-;Data to do this is retrieved from TEXT and TOKEN."
-; (let ((args nil) (scope nil))
-; (gud-gdb-run-command-fetch-lines "info args")
-;
-; (gud-gdb-run-command-fetch-lines "info local")
-;
-; ))
-
(defun gud-gdb-get-stackframe (buffer)
"Extract the current stack frame out of the GUD GDB BUFFER."
(let ((newlst nil)
@@ -934,21 +935,16 @@ It is passed through FILTER before we look at it."
BUFFER is the current buffer which may be the GUD buffer in which to run.
SKIP is the number of chars to skip on each line, it defaults to 0."
(with-current-buffer gud-comint-buffer
- (if (and (eq gud-comint-buffer buffer)
- (save-excursion
- (goto-char (point-max))
- (forward-line 0)
- (not (looking-at comint-prompt-regexp))))
- nil
- ;; Much of this copied from GDB complete, but I'm grabbing the stack
- ;; frame instead.
+ (unless (and (eq gud-comint-buffer buffer)
+ (save-excursion
+ (goto-char (point-max))
+ (forward-line 0)
+ (not (looking-at comint-prompt-regexp))))
(let ((gud-gdb-fetch-lines-in-progress t)
(gud-gdb-fetched-lines nil)
(gud-gdb-fetch-lines-string nil)
(gud-gdb-fetch-lines-break (or skip 0))
- (gud-marker-filter
- `(lambda (string)
- (gud-gdb-fetch-lines-filter string ',gud-marker-filter))))
+ (gud-marker-filter #'gud-gdb-fetch-lines-filter))
;; Issue the command to GDB.
(gud-basic-call command)
;; Slurp the output.
@@ -1919,7 +1915,7 @@ extension EXTN. Normally EXTN is given as the regular expression
;; in petticoat junction.
(defun gud-jdb-skip-block ()
- ;; Find the begining of the block.
+ ;; Find the beginning of the block.
(while
(not (eq (following-char) ?{))
@@ -1936,7 +1932,7 @@ extension EXTN. Normally EXTN is given as the regular expression
(gud-jdb-skip-character-literal))
(t (forward-char))))
- ;; Now at the begining of the block.
+ ;; Now at the beginning of the block.
(forward-char)
;; Skip over the body of the block as well as the final brace.
@@ -3422,7 +3418,7 @@ With arg, dereference expr if ARG is positive, otherwise do not dereference."
((xdb pdb) (concat "p " expr))
(sdb (concat expr "/"))))
-(declare-function gdb-input "gdb-mi" (item))
+(declare-function gdb-input "gdb-mi" (command handler))
(declare-function tooltip-expr-to-print "tooltip" (event))
(declare-function tooltip-event-buffer "tooltip" (event))
@@ -3468,12 +3464,12 @@ so they have been disabled."))
(if (eq gud-minor-mode 'gdbmi)
(if gdb-macro-info
(gdb-input
- (list (concat
- "server macro expand " expr "\n")
- `(lambda () (gdb-tooltip-print-1 ,expr))))
+ (concat
+ "server macro expand " expr "\n")
+ `(lambda () (gdb-tooltip-print-1 ,expr)))
(gdb-input
- (list (concat cmd "\n")
- `(lambda () (gdb-tooltip-print ,expr)))))
+ (concat cmd "\n")
+ `(lambda () (gdb-tooltip-print ,expr))))
(setq gud-tooltip-original-filter (process-filter process))
(set-process-filter process 'gud-tooltip-process-output)
(gud-basic-call cmd))
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 374a45acec6..82961376669 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -822,7 +822,7 @@ Point is left unchanged."
(defun hif-possibly-hide ()
"Called at #ifX expression, this hides those parts that should be hidden.
-It uses the judgement of `hide-ifdef-evaluator'."
+It uses the judgment of `hide-ifdef-evaluator'."
;; (message "hif-possibly-hide") (sit-for 1)
(let ((test (hif-canonicalize))
(range (hif-find-range)))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index d8715599d74..6ce415b563d 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -2464,7 +2464,7 @@ If prefix ARG < 0 then move forward to enclosing block end."
(defun idlwave-down-block (&optional arg)
"Go down a block.
With ARG: ARG >= 0 go forwards, ARG < 0 go backwards.
-Returns non-nil if successfull."
+Returns non-nil if successful."
(interactive "p")
(let (status)
(if (< arg 0)
@@ -7866,7 +7866,7 @@ itself."
"Display online help about the completion at point."
(interactive "eP")
;; Restore last-command for next command, to make
- ;; scrolling/cancelling of completions work.
+ ;; scrolling/canceling of completions work.
(setq this-command last-command)
(idlwave-do-mouse-completion-help ev))
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 1328e303d45..dd24aeea9a3 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -36,7 +36,7 @@
;; This makes these modes easier to use.
;; For documentation on the functionality provided by comint mode, and
-;; the hooks available for customising it, see the file comint.el.
+;; the hooks available for customizing it, see the file comint.el.
;; For further information on inferior-lisp mode, see the comments below.
;; Needs fixin:
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 94a9c250fee..f0c86265232 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3000,7 +3000,7 @@ browser, respectively."
'(js> ((fifth hitab) "selectedTab") (fourth hitab))
cmds)))
- ;; Hilighting whole window
+ ;; Highlighting whole window
((third hitab)
(push '(js! ((third hitab) "document"
"documentElement" "setAttribute")
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index c1a87a9d033..024744957c6 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -315,25 +315,32 @@ not be enclosed in { } or ( )."
"List of keywords understood by automake.")
(defconst makefile-gmake-statements
- `("-sinclude" "sinclude" "vpath" ; makefile-makepp-statements takes rest
+ `("-sinclude" "sinclude" ; makefile-makepp-statements takes rest
"ifdef" "ifndef" "ifeq" "ifneq" "-include" "define" "endef" "export"
- "override define" "override" "unexport"
+ "override define" "override" "unexport" "vpath"
,@(cdr makefile-automake-statements))
"List of keywords understood by gmake.")
-;; These are even more silly, because you can have more spaces in between.
(defconst makefile-makepp-statements
- `("and ifdef" "and ifndef" "and ifeq" "and ifneq" "and ifperl"
- "and ifmakeperl" "and ifsys" "and ifnsys" "build_cache" "build_check"
+ `(t ; - alternately means _
+ ;; todo: take if* out of these lists, and let the negation regexp do it all
+ "ifperl" "ifmakeperl" "ifsys" "ifnsys" "iftrue" "ifntrue"
+ "and ifdef" "and ifndef" "and ifeq" "and ifneq" "and ifperl"
+ "and ifmakeperl" "and ifsys" "and ifnsys" "and iftrue" "and ifntrue"
"else ifdef" "else ifndef" "else ifeq" "else ifneq" "else ifperl"
- "else ifmakeperl" "else ifsys" "else ifnsys" "enddef" "global"
- "load_makefile" "ifperl" "ifmakeperl" "ifsys" "ifnsys" "_include"
- "makeperl" "makesub" "no_implicit_load" "perl" "perl-begin" "perl_begin"
- "perl-end" "perl_end" "prebuild" "or ifdef" "or ifndef" "or ifeq"
- "or ifneq" "or ifperl" "or ifmakeperl" "or ifsys" "or ifnsys"
- "override export" "override global" "register_command_parser"
- "register_scanner" "repository" "runtime" "signature" "sub"
- ,@(nthcdr 3 makefile-gmake-statements))
+ "else ifmakeperl" "else ifsys" "else ifnsys" "else iftrue" "else ifntrue"
+ "or ifdef" "or ifndef" "or ifeq" "or ifneq" "or ifperl"
+ "or ifmakeperl" "or ifsys" "or ifnsys" "or iftrue" "or ifntrue"
+
+ "autoload" "build-cache" "build-check" "enddef" "export define"
+ "global" "global build-cache" "global build-check" "global define"
+ "global signature" "global override signature" "load-makefile"
+ "make" "makeperl" "makesub" "no-implicit-load" "perl" "perl-begin"
+ "perl-end" "prebuild" "override export" "override global" "register-parser"
+ "register-command-parser" "register-input-suffix"
+ "register-scanner" "repository" "runtime" "signature" "sub"
+
+ ,@(nthcdr 2 makefile-gmake-statements))
"List of keywords understood by gmake.")
(defconst makefile-bsdmake-statements
@@ -372,7 +379,12 @@ not be enclosed in { } or ( )."
;; Fontify conditionals and includes.
(,(concat "^\\(?: [ \t]*\\)?"
- (regexp-opt keywords t)
+ (replace-regexp-in-string
+ " " "[ \t]+"
+ (if (eq (car keywords) t)
+ (replace-regexp-in-string "-" "[_-]"
+ (regexp-opt (cdr keywords) t))
+ (regexp-opt keywords t)))
"\\>[ \t]*\\([^: \t\n#]*\\)")
(1 font-lock-keyword-face) (2 font-lock-variable-name-face))
@@ -436,7 +448,7 @@ not be enclosed in { } or ( )."
makefile-var-use-regex
makefile-makepp-statements
nil
- "^\\(?: [ \t]*\\)?\\(?:and[ \t]+\\|else[ \t]+\\|or[ \t]+\\)?if\\(n\\)\\(?:def\\|eq\\|sys\\)\\>"
+ "^\\(?: [ \t]*\\)?\\(?:and[ \t]+\\|else[ \t]+\\|or[ \t]+\\)?if\\(n\\)\\(?:def\\|eq\\|sys\\|true\\)\\>"
'("[^$]\\(\\$[({]\\(?:output\\|stem\\|target\\)s?\\_>.*?[})]\\)"
1 'makefile-targets append)
@@ -447,17 +459,17 @@ not be enclosed in { } or ( )."
(2 font-lock-keyword-face t)
(3 font-lock-variable-name-face t))
- ;; $(function ...) $((function ...)) ${function ...} ${{function ...}}
- '("[^$]\\$\\(?:((?\\|{{?\\)\\([-a-zA-Z0-9_.]+\\s \\)"
+ ;; $(function ...) $((function ...)) ${...} ${{...}} $[...] $[[...]]
+ '("[^$]\\$\\(?:((?\\|{{?\\|\\[\\[?\\)\\([-a-zA-Z0-9_.]+\\s \\)"
1 font-lock-function-name-face prepend)
- ;; $(shell ...) $((shell ...)) ${shell ...} ${{shell ...}}
- '("[^$]\\$\\(((?\\|{{?\\)shell\\(?:[-_]\\(?:global[-_]\\)?once\\)?[ \t]+"
+ ;; $(shell ...) $((shell ...)) ${...} ${{...}} $[...] $[[...]]
+ '("[^$]\\$\\(((?\\|{{?\\|\\[\\[?\\)shell\\(?:[-_]\\(?:global[-_]\\)?once\\)?[ \t]+"
makefile-match-function-end nil nil
(1 'makefile-shell prepend t))
- ;; $(perl ...) $((perl ...)) ${perl ...} ${{perl ...}}
- '("[^$]\\$\\(((?\\|{{?\\)makeperl[ \t]+"
+ ;; $(perl ...) $((perl ...)) ${...} ${{...}} $[...] $[[...]]
+ '("[^$]\\$\\(((?\\|{{?\\|\\[\\[?\\)makeperl[ \t]+"
makefile-match-function-end nil nil
(1 'makefile-makepp-perl prepend t))
'("[^$]\\$\\(((?\\|{{?\\)perl[ \t]+"
@@ -1688,8 +1700,10 @@ The anchor must have matched the opening parens in the first group."
;; FIXME forward-sexp or somesuch would be better?
(if (setq s (cond ((string= s "(") ")")
((string= s "{") "}")
+ ((string= s "[") "]")
((string= s "((") "))")
- ((string= s "{{") "}}")))
+ ((string= s "{{") "}}")
+ ((string= s "[[") "]]")))
(re-search-forward (concat "\\(.*\\)[ \t]*" s) (line-end-position) t))))
(defun makefile-match-dependency (bound)
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index b1502adbeb1..2db4309d9e0 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -786,6 +786,7 @@ on the line which ends a function or procedure named NAME."
(if (looking-at "[ \t]+$")
(skip-chars-forward " \t"))))
+(defvar ind) ;Used via `eval' in pascal-indent-alist.
(defun pascal-indent-line ()
"Indent current line as a Pascal statement."
(let* ((indent-str (pascal-calculate-indent))
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 5b229cc0c24..0efc2ca231b 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -147,9 +147,9 @@
;; o Introduced three new customizable variables: electric colon
;; (`prolog-electric-colon-flag', default nil), electric dash
;; (`prolog-electric-dash-flag', default nil), and a possibility
-;; to prevent the predicate template insertion from adding commata
+;; to prevent the predicate template insertion from adding commas
;; (`prolog-electric-dot-full-predicate-template', defaults to t
-;; since it seems quicker to me to just type those commata). A
+;; since it seems quicker to me to just type those commas). A
;; trivial adaptation of a patch by Markus Triska.
;; o Improved the behavior of electric if-then-else to only skip
;; forward if the parenthesis/semicolon is preceded by
@@ -512,7 +512,7 @@ It does not apply in strings and comments."
(defcustom prolog-electric-dot-full-predicate-template nil
"*If nil, electric dot inserts only the current predicate's name and `('
for recursive calls or new clause heads. Non-nil means to also
-insert enough commata to cover the predicate's arity and `)',
+insert enough commas to cover the predicate's arity and `)',
and dot and newline for recursive calls."
:group 'prolog-keyboard
:type 'boolean)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index fbf7c3c42f7..6081d8e838b 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2343,7 +2343,7 @@ Interactively, prompt for the name with completion."
;;;; Bicycle Repair Man support
(autoload 'pymacs-load "pymacs" nil t)
-(autoload 'brm-init "bikemacs")
+(autoload 'brm-init "bikeemacs")
(defvar brm-menu)
;; I'm not sure how useful BRM really is, and it's certainly dangerous
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 03e095b6bfc..60ba768a80e 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4224,7 +4224,7 @@ The default comes from `process-coding-system-alist' and
"^\\(.+\\) (hex ..)$"
"SET \\1")
- ;; FEDDBACK ON for 99 or more rows
+ ;; FEEDBACK ON for 99 or more rows
;; feedback OFF
(sql-redirect-value
sqlbuf
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index b02324871ff..434984c8bf1 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -427,7 +427,7 @@ Key bindings:
"icompare" "insert" "inst_get_at_least" "inst_get_auto_bin_max"
"inst_get_collect" "inst_get_cov_weight" "inst_get_coverage_goal"
"inst_getcross_bin_max" "inst_query" "inst_set_at_least"
- "inst_set_auto_bin_max" "inst_set_bin_activiation" "inst_set_collect"
+ "inst_set_auto_bin_max" "inst_set_bin_activation" "inst_set_collect"
"inst_set_cov_weight" "inst_set_coverage_goal" "inst_set_cross_bin_max"
"itoa"
"last" "last_index" "len" "load"
@@ -438,7 +438,7 @@ Key bindings:
"push_front" "putc"
"query" "query_str"
"rand_mode" "randomize" "reserve" "reverse" "rsort"
- "search" "set_at_least" "set_auto_bin_max" "set_bin_activiation"
+ "search" "set_at_least" "set_auto_bin_max" "set_bin_activation"
"set_cov_weight" "set_coverage_goal" "set_cross_bin_max" "set_name" "size"
"sort" "substr" "sum"
"thismatch" "tolower" "toupper"
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 3ae66a477e8..52e7b6e2429 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -981,7 +981,7 @@ of each Verilog file that requires it, rather than being set globally."
"*If true, AUTORESET will reset those signals which were
assigned with blocking assignments (=) even in a block with
non-blocking assignments (<=).
-
+
If nil, all blocking assigned signals are ignored when any
non-blocking assignment is in the AUTORESET block. This allows
blocking assignments to be used for temporary values and not have
@@ -2011,7 +2011,7 @@ find the errors."
"`uvm_component_utils"
"`uvm_create"
"`uvm_create_on"
- "`uvm_create_seq" ;; Undocumented in 1.1
+ "`uvm_create_seq" ;; Undocumented in 1.1
"`uvm_declare_p_sequencer"
"`uvm_declare_sequence_lib" ;; Deprecated in 1.1
"`uvm_do"
@@ -7505,7 +7505,7 @@ Signals must be in standard (base vector) form."
(nreverse out-list)))
(defun verilog-signals-combine-bus (in-list)
- "Return a list of signals in IN-LIST, with busses combined.
+ "Return a list of signals in IN-LIST, with buses combined.
Duplicate signals are also removed. For example A[2] and A[1] become A[2:1]."
(let (combo buswarn
out-list
@@ -9907,7 +9907,7 @@ If optional WHITESPACE true, ignore whitespace."
(p2 (with-current-buffer b2 (goto-char (point-min))))
(maxp1 (with-current-buffer b1 (point-max)))
(maxp2 (with-current-buffer b2 (point-max)))
- (op1 -1) (op2 -1)
+ (op1 -1) (op2 -1)
progress size)
(while (not (and (eq p1 op1) (eq p2 op2)))
;; If both windows have whitespace optionally skip over it.
@@ -10100,7 +10100,7 @@ instantiating the resulting module. Long lines are split based
on the `fill-column', see \\[set-fill-column].
Limitations:
- Concatenation and outputting partial busses is not supported.
+ Concatenation and outputting partial buses is not supported.
Typedefs must match `verilog-typedef-regexp', which is disabled by default.
@@ -10932,7 +10932,7 @@ Typing \\[verilog-auto] will make this into:
(defun verilog-auto-logic ()
"Expand AUTOLOGIC statements, as part of \\[verilog-auto].
Make wire statements using the SystemVerilog logic keyword.
-This is currently equivelent to:
+This is currently equivalent to:
/*AUTOWIRE*/
@@ -10958,7 +10958,7 @@ the datatype of the declarations.
Limitations:
This ONLY detects outputs of AUTOINSTants (see `verilog-read-sub-decls'),
- and all busses must have widths, such as those from AUTOINST, or using []
+ and all buses must have widths, such as those from AUTOINST, or using []
in AUTO_TEMPLATEs.
This does NOT work on memories or SystemVerilog .name connections,
@@ -11315,7 +11315,7 @@ Limitations:
If placed inside the parenthesis of a module declaration, it creates
Verilog 2001 style, else uses Verilog 1995 style.
- Concatenation and outputting partial busses is not supported.
+ Concatenation and outputting partial buses is not supported.
Module names must be resolvable to filenames. See `verilog-auto-inst'.
@@ -11439,7 +11439,7 @@ Limitations:
If placed inside the parenthesis of a module declaration, it creates
Verilog 2001 style, else uses Verilog 1995 style.
- Concatenation and outputting partial busses is not supported.
+ Concatenation and outputting partial buses is not supported.
Module names must be resolvable to filenames. See `verilog-auto-inst'.
@@ -11490,7 +11490,7 @@ Limitations:
If placed inside the parenthesis of a module declaration, it creates
Verilog 2001 style, else uses Verilog 1995 style.
- Concatenation and outputting partial busses is not supported.
+ Concatenation and outputting partial buses is not supported.
Module names must be resolvable to filenames. See `verilog-auto-inst'.
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 3a94601768d..deac85581d2 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1714,7 +1714,7 @@ an absolute path (i.e. all caches can be stored in one global directory)."
(defgroup vhdl-menu nil
- "Customizations for menues."
+ "Customizations for menus."
:group 'vhdl)
(defcustom vhdl-index-menu nil
@@ -1844,7 +1844,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
;; Internal variables
(defvar vhdl-menu-max-size 20
- "*Specifies the maximum size of a menu before splitting it into submenues.")
+ "*Specifies the maximum size of a menu before splitting it into submenus.")
(defvar vhdl-progress-interval 1
"*Interval used to update progress status during long operations.
@@ -2468,7 +2468,7 @@ conversion."
(goto-char marker))
(defun vhdl-menu-split (list title)
- "Split menu LIST into several submenues, if number of
+ "Split menu LIST into several submenus, if number of
elements > `vhdl-menu-max-size'."
(if (> (length list) vhdl-menu-max-size)
(let ((remain list)
@@ -4266,7 +4266,7 @@ Usage:
CODE BEAUTIFICATION:
`C-c M-b' and `C-c C-b' beautify the code of a region or of the entire
- buffer respectively. This inludes indentation, alignment, and case
+ buffer respectively. This includes indentation, alignment, and case
fixing. Code beautification can also be run non-interactively using the
command:
@@ -10812,7 +10812,7 @@ but not if inside a comment or quote."
(defvar vhdl-port-list nil
"Variable to hold last port map parsed.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (ent-name
;; ((generic-names) generic-type generic-init generic-comment group-comment)
;; ((port-names) port-object port-direct port-type port-comment group-comment)
@@ -11660,7 +11660,7 @@ reflected in a subsequent paste operation."
(defvar vhdl-subprog-list nil
"Variable to hold last subprogram interface parsed.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (subprog-name kind
;; ((names) object direct type init comment group-comment)
;; return-type return-comment group-comment)
@@ -12971,7 +12971,7 @@ This does background highlighting of translate-off regions.")
(defvar vhdl-entity-alist nil
"Cache with entities and corresponding architectures for each
project/directory.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (cache-key
;; (ent-key ent-name ent-file ent-line
;; (arch-key arch-name arch-file arch-line
@@ -12982,7 +12982,7 @@ project/directory.")
(defvar vhdl-config-alist nil
"Cache with configurations for each project/directory.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (cache-key
;; (conf-key conf-name conf-file conf-line ent-key arch-key
;; (inst-key inst-comp-name inst-ent-key inst-arch-key
@@ -12991,7 +12991,7 @@ project/directory.")
(defvar vhdl-package-alist nil
"Cache with packages for each project/directory.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (cache-key
;; (pack-key pack-name pack-file pack-line
;; (comp-key comp-name comp-file comp-line)
@@ -13003,19 +13003,19 @@ project/directory.")
(defvar vhdl-ent-inst-alist nil
"Cache with instantiated entities for each project/directory.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (cache-key (inst-ent-key))
(defvar vhdl-file-alist nil
"Cache with design units in each file for each project/directory.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (cache-key
;; (file-name (ent-list) (arch-list) (arch-ent-list) (conf-list)
;; (pack-list) (pack-body-list) (inst-list) (inst-ent-list))
(defvar vhdl-directory-alist nil
"Cache with source directories for each project.")
-;; structure: (parenthesised expression means list of such entries)
+;; structure: (parenthesized expression means list of such entries)
;; (cache-key (directory))
(defvar vhdl-speedbar-shown-unit-alist nil
@@ -13655,7 +13655,7 @@ of PROJECT."
(vhdl-speedbar-update-current-unit)
(when updated (message "Updating hierarchy...done")))))
-;; structure (parenthesised expression means list of such entries)
+;; structure (parenthesized expression means list of such entries)
;; (inst-key inst-file-marker comp-ent-key comp-ent-file-marker
;; comp-arch-key comp-arch-file-marker comp-conf-key comp-conf-file-marker
;; comp-lib-name level)