summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/ada-mode.el2
-rw-r--r--lisp/progmodes/ada-prj.el2
-rw-r--r--lisp/progmodes/ada-stmt.el2
-rw-r--r--lisp/progmodes/ada-xref.el2
-rw-r--r--lisp/progmodes/antlr-mode.el2
-rw-r--r--lisp/progmodes/asm-mode.el2
-rw-r--r--lisp/progmodes/autoconf.el2
-rw-r--r--lisp/progmodes/bat-mode.el2
-rw-r--r--lisp/progmodes/bug-reference.el2
-rw-r--r--lisp/progmodes/cc-align.el2
-rw-r--r--lisp/progmodes/cc-awk.el2
-rw-r--r--lisp/progmodes/cc-bytecomp.el2
-rw-r--r--lisp/progmodes/cc-cmds.el40
-rw-r--r--lisp/progmodes/cc-defs.el42
-rw-r--r--lisp/progmodes/cc-engine.el121
-rw-r--r--lisp/progmodes/cc-fonts.el38
-rw-r--r--lisp/progmodes/cc-guess.el2
-rw-r--r--lisp/progmodes/cc-langs.el28
-rw-r--r--lisp/progmodes/cc-menus.el2
-rw-r--r--lisp/progmodes/cc-mode.el33
-rw-r--r--lisp/progmodes/cc-styles.el2
-rw-r--r--lisp/progmodes/cc-vars.el2
-rw-r--r--lisp/progmodes/cfengine.el2
-rw-r--r--lisp/progmodes/cmacexp.el2
-rw-r--r--lisp/progmodes/compile.el24
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/progmodes/cpp.el2
-rw-r--r--lisp/progmodes/cwarn.el2
-rw-r--r--lisp/progmodes/dcl-mode.el2
-rw-r--r--lisp/progmodes/ebnf-abn.el2
-rw-r--r--lisp/progmodes/ebnf-bnf.el2
-rw-r--r--lisp/progmodes/ebnf-dtd.el2
-rw-r--r--lisp/progmodes/ebnf-ebx.el2
-rw-r--r--lisp/progmodes/ebnf-iso.el2
-rw-r--r--lisp/progmodes/ebnf-otz.el2
-rw-r--r--lisp/progmodes/ebnf-yac.el2
-rw-r--r--lisp/progmodes/ebnf2ps.el2
-rw-r--r--lisp/progmodes/ebrowse.el2
-rw-r--r--lisp/progmodes/elisp-mode.el2
-rw-r--r--lisp/progmodes/etags.el2
-rw-r--r--lisp/progmodes/executable.el2
-rw-r--r--lisp/progmodes/f90.el2
-rw-r--r--lisp/progmodes/flymake.el2
-rw-r--r--lisp/progmodes/fortran.el6
-rw-r--r--lisp/progmodes/gdb-mi.el2
-rw-r--r--lisp/progmodes/glasses.el2
-rw-r--r--lisp/progmodes/grep.el2
-rw-r--r--lisp/progmodes/gud.el2
-rw-r--r--lisp/progmodes/hideif.el2
-rw-r--r--lisp/progmodes/hideshow.el2
-rw-r--r--lisp/progmodes/icon.el2
-rw-r--r--lisp/progmodes/idlw-complete-structtag.el2
-rw-r--r--lisp/progmodes/idlw-help.el2
-rw-r--r--lisp/progmodes/idlw-shell.el2
-rw-r--r--lisp/progmodes/idlw-toolbar.el2
-rw-r--r--lisp/progmodes/idlwave.el2
-rw-r--r--lisp/progmodes/inf-lisp.el2
-rw-r--r--lisp/progmodes/js.el2
-rw-r--r--lisp/progmodes/ld-script.el2
-rw-r--r--lisp/progmodes/m4-mode.el2
-rw-r--r--lisp/progmodes/make-mode.el2
-rw-r--r--lisp/progmodes/mantemp.el2
-rw-r--r--lisp/progmodes/meta-mode.el2
-rw-r--r--lisp/progmodes/mixal-mode.el2
-rw-r--r--lisp/progmodes/octave.el2
-rw-r--r--lisp/progmodes/opascal.el3
-rw-r--r--lisp/progmodes/pascal.el2
-rw-r--r--lisp/progmodes/perl-mode.el2
-rw-r--r--lisp/progmodes/prog-mode.el2
-rw-r--r--lisp/progmodes/project.el69
-rw-r--r--lisp/progmodes/prolog.el2
-rw-r--r--lisp/progmodes/ps-mode.el2
-rw-r--r--lisp/progmodes/python.el12
-rw-r--r--lisp/progmodes/ruby-mode.el2
-rw-r--r--lisp/progmodes/scheme.el2
-rw-r--r--lisp/progmodes/sh-script.el9
-rw-r--r--lisp/progmodes/simula.el2
-rw-r--r--lisp/progmodes/sql.el2
-rw-r--r--lisp/progmodes/subword.el2
-rw-r--r--lisp/progmodes/tcl.el2
-rw-r--r--lisp/progmodes/vera-mode.el2
-rw-r--r--lisp/progmodes/verilog-mode.el2
-rw-r--r--lisp/progmodes/vhdl-mode.el2
-rw-r--r--lisp/progmodes/which-func.el2
-rw-r--r--lisp/progmodes/xref.el74
-rw-r--r--lisp/progmodes/xscheme.el7
86 files changed, 405 insertions, 245 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index 529b691ee79..12ab5b01ab3 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -1,6 +1,6 @@
;;; ada-mode.el --- major-mode for editing Ada sources
-;; Copyright (C) 1994-1995, 1997-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 1997-2016 Free Software Foundation, Inc.
;; Author: Rolf Ebert <ebert@inf.enst.fr>
;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el
index 3b71c5987ed..51a8972a1b0 100644
--- a/lisp/progmodes/ada-prj.el
+++ b/lisp/progmodes/ada-prj.el
@@ -1,6 +1,6 @@
;;; ada-prj.el --- GUI editing of project files for the ada-mode
-;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2016 Free Software Foundation, Inc.
;; Author: Emmanuel Briot <briot@gnat.com>
;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
diff --git a/lisp/progmodes/ada-stmt.el b/lisp/progmodes/ada-stmt.el
index 302bbc9a690..b3f497afb1d 100644
--- a/lisp/progmodes/ada-stmt.el
+++ b/lisp/progmodes/ada-stmt.el
@@ -1,6 +1,6 @@
;;; ada-stmt.el --- an extension to Ada mode for inserting statement templates
-;; Copyright (C) 1987, 1993-1994, 1996-2015 Free Software Foundation,
+;; Copyright (C) 1987, 1993-1994, 1996-2016 Free Software Foundation,
;; Inc.
;; Authors: Daniel Pfeiffer
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index 0ea33c16878..8518163a1b7 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -1,6 +1,6 @@
;; ada-xref.el --- for lookup and completion in Ada mode
-;; Copyright (C) 1994-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2016 Free Software Foundation, Inc.
;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
;; Rolf Ebert <ebert@inf.enst.fr>
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 9cac400c27b..20880a806fd 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -1,6 +1,6 @@
;;; antlr-mode.el --- major mode for ANTLR grammar files
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Christoph Wedler <Christoph.Wedler@sap.com>
;; Keywords: languages, ANTLR, code generator
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index 7df6a5d1de4..40c2b771a15 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -1,6 +1,6 @@
;;; asm-mode.el --- mode for editing assembler code
-;; Copyright (C) 1991, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 2001-2016 Free Software Foundation, Inc.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el
index 0bcc315446c..205e6636291 100644
--- a/lisp/progmodes/autoconf.el
+++ b/lisp/progmodes/autoconf.el
@@ -1,6 +1,6 @@
;;; autoconf.el --- mode for editing Autoconf configure.ac files
-;; Copyright (C) 2000-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2016 Free Software Foundation, Inc.
;; Author: Dave Love <fx@gnu.org>
;; Keywords: languages
diff --git a/lisp/progmodes/bat-mode.el b/lisp/progmodes/bat-mode.el
index 2c5f192bf87..78c30bfb45e 100644
--- a/lisp/progmodes/bat-mode.el
+++ b/lisp/progmodes/bat-mode.el
@@ -1,6 +1,6 @@
;;; bat-mode.el --- Major mode for editing DOS/Windows scripts
-;; Copyright (C) 2003, 2008-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
;; Author: Arni Magnusson <arnima@hafro.is>
;; Keywords: languages
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 921a904191c..50a2ff63daa 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -1,6 +1,6 @@
;; bug-reference.el --- buttonize bug references
-;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
;; Author: Tom Tromey <tromey@redhat.com>
;; Created: 21 Mar 2007
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el
index 1e3cb8e16f9..d59503be61a 100644
--- a/lisp/progmodes/cc-align.el
+++ b/lisp/progmodes/cc-align.el
@@ -1,6 +1,6 @@
;;; cc-align.el --- custom indentation functions for CC Mode
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2004- Alan Mackenzie
;; 1998- Martin Stjernholm
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 19a95aad676..525a7481965 100644
--- a/lisp/progmodes/cc-awk.el
+++ b/lisp/progmodes/cc-awk.el
@@ -1,6 +1,6 @@
;;; cc-awk.el --- AWK specific code within cc-mode.
-;; Copyright (C) 1988, 1994, 1996, 2000-2015 Free Software Foundation,
+;; Copyright (C) 1988, 1994, 1996, 2000-2016 Free Software Foundation,
;; Inc.
;; Author: Alan Mackenzie <acm@muc.de> (originally based on awk-mode.el)
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el
index d3b4db74c16..47ff8e43721 100644
--- a/lisp/progmodes/cc-bytecomp.el
+++ b/lisp/progmodes/cc-bytecomp.el
@@ -1,6 +1,6 @@
;;; cc-bytecomp.el --- compile time setup for proper compilation
-;; Copyright (C) 2000-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2016 Free Software Foundation, Inc.
;; Author: Martin Stjernholm
;; Maintainer: bug-cc-mode@gnu.org
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 32ce8c6a249..6761de11700 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1,6 +1,6 @@
;;; cc-cmds.el --- user level commands for CC Mode
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2003- Alan Mackenzie
;; 1998- Martin Stjernholm
@@ -1121,35 +1121,15 @@ numeric argument is supplied, or the point is inside a literal."
(looking-at "<<"))
(>= (match-end 0) final-pos)))
- ;; It's a >. Either a C++ >> operator. ......
- (or (and (c-major-mode-is 'c++-mode)
+ ;; It's a >. Either a template/generic terminator ...
+ (or (c-get-char-property (1- final-pos) 'syntax-table)
+ ;; or a C++ >> operator.
+ (and (c-major-mode-is 'c++-mode)
(progn
(goto-char (1- final-pos))
(c-beginning-of-current-token)
(looking-at ">>"))
- (>= (match-end 0) final-pos))
- ;; ...., or search back for a < which isn't already marked as an
- ;; opening template delimiter.
- (save-restriction
- (widen)
- ;; Narrow to avoid `c-forward-<>-arglist' below searching past
- ;; our position.
- (narrow-to-region (point-min) final-pos)
- (goto-char final-pos)
- (while
- (and
- (progn
- (c-syntactic-skip-backward "^<;}" nil t)
- (eq (char-before) ?<))
- (progn
- (backward-char)
- (looking-at "\\s("))))
- (and (eq (char-after) ?<)
- (not (looking-at "\\s("))
- (progn (c-backward-syntactic-ws)
- (c-simple-skip-symbol-backward))
- (or (looking-at c-opt-<>-sexp-key)
- (not (looking-at c-keywords-regexp)))))))))
+ (>= (match-end 0) final-pos))))))
(goto-char final-pos)
(when found-delim
@@ -1157,11 +1137,9 @@ numeric argument is supplied, or the point is inside a literal."
(when (and (eq (char-before) ?>)
(not executing-kbd-macro)
blink-paren-function)
- ;; Currently (2014-10-19), the syntax-table text properties on < and >
- ;; are only applied in code called during Emacs redisplay. We thus
- ;; explicitly cause a redisplay so that these properties have been
- ;; applied when `blink-paren-function' gets called.
- (sit-for 0)
+ ;; From now (2016-01-01), the syntax-table text properties on < and >
+ ;; are applied in an after-change function, not during redisplay. Hence
+ ;; we no longer need to call (sit-for 0) for blink paren to work.
(funcall blink-paren-function)))))
(defun c-electric-paren (arg)
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 8eed4b1b86e..2056f3907b8 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1,6 +1,6 @@
;;; cc-defs.el --- compile time definitions for CC Mode
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2003- Alan Mackenzie
;; 1998- Martin Stjernholm
@@ -656,23 +656,35 @@ right side of it."
;; Wrappers for common scan-lists cases, mainly because it's almost
;; impossible to get a feel for how that function works.
-(defmacro c-go-list-forward ()
- "Move backward across one balanced group of parentheses.
+(defmacro c-go-list-forward (&optional pos limit)
+ "Move forward across one balanced group of parentheses starting at POS or
+point. Return POINT when we succeed, NIL when we fail. In the latter case,
+leave point unmoved.
-Return POINT when we succeed, NIL when we fail. In the latter case, leave
-point unmoved."
- `(c-safe (let ((endpos (scan-lists (point) 1 0)))
- (goto-char endpos)
- endpos)))
+A LIMIT for the search may be given. The start position is assumed to be
+before it."
+ (let ((res `(c-safe (goto-char (scan-lists ,(or pos `(point)) 1 0)) (point))))
+ (if limit
+ `(save-restriction
+ (if ,limit
+ (narrow-to-region (point-min) ,limit))
+ ,res)
+ res)))
-(defmacro c-go-list-backward ()
- "Move backward across one balanced group of parentheses.
+(defmacro c-go-list-backward (&optional pos limit)
+ "Move backward across one balanced group of parentheses starting at POS or
+point. Return POINT when we succeed, NIL when we fail. In the latter case,
+leave point unmoved.
-Return POINT when we succeed, NIL when we fail. In the latter case, leave
-point unmoved."
- `(c-safe (let ((endpos (scan-lists (point) -1 0)))
- (goto-char endpos)
- endpos)))
+A LIMIT for the search may be given. The start position is assumed to be
+after it."
+ (let ((res `(c-safe (goto-char (scan-lists ,(or pos `(point)) -1 0)) (point))))
+ (if limit
+ `(save-restriction
+ (if ,limit
+ (narrow-to-region ,limit (point-max)))
+ ,res)
+ res)))
(defmacro c-up-list-forward (&optional pos limit)
"Return the first position after the list sexp containing POS,
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index dbc55f5e0ef..b08c555e34f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1,6 +1,6 @@
;;; cc-engine.el --- core syntax guessing engine for CC mode -*- coding: utf-8 -*-
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2001- Alan Mackenzie
;; 1998- Martin Stjernholm
@@ -5577,8 +5577,9 @@ comment at the start of cc-engine.el for more info."
(defun c-before-change-check-<>-operators (beg end)
;; Unmark certain pairs of "< .... >" which are currently marked as
- ;; template/generic delimiters. (This marking is via syntax-table
- ;; text properties).
+ ;; template/generic delimiters. (This marking is via syntax-table text
+ ;; properties), and expand the (c-new-BEG c-new-END) region to include all
+ ;; unmarked < and > operators within the certain bounds (see below).
;;
;; These pairs are those which are in the current "statement" (i.e.,
;; the region between the {, }, or ; before BEG and the one after
@@ -5595,40 +5596,43 @@ comment at the start of cc-engine.el for more info."
;; FIXME!!! This routine ignores the possibility of macros entirely.
;; 2010-01-29.
(save-excursion
- (let ((beg-lit-limits (progn (goto-char beg) (c-literal-limits)))
- (end-lit-limits (progn (goto-char end) (c-literal-limits)))
- new-beg new-end need-new-beg need-new-end)
- ;; Locate the barrier before the changed region
+ (c-save-buffer-state
+ ((beg-lit-limits (progn (goto-char beg) (c-literal-limits)))
+ (end-lit-limits (progn (goto-char end) (c-literal-limits)))
+ new-beg new-end beg-limit end-limit)
+ ;; Locate the earliest < after the barrier before the changed region,
+ ;; which isn't already marked as a paren.
(goto-char (if beg-lit-limits (car beg-lit-limits) beg))
- (c-syntactic-skip-backward "^;{}" (c-determine-limit 512))
- (setq new-beg (point))
+ (setq beg-limit (c-determine-limit 512))
;; Remove the syntax-table/category properties from each pertinent <...>
- ;; pair. Firsly, the ones with the < before beg and > after beg.
- (while
- (c-search-forward-char-property 'syntax-table c-<-as-paren-syntax beg)
- (if (c-clear-<-pair-props-if-match-after beg (1- (point)))
- (setq need-new-beg t)))
+ ;; pair. Firstly, the ones with the < before beg and > after beg....
+ (while (progn (c-syntactic-skip-backward "^;{}<" beg-limit)
+ (eq (char-before) ?<))
+ (c-backward-token-2)
+ (when (eq (char-after) ?<)
+ (c-clear-<-pair-props-if-match-after beg)))
+ (c-forward-syntactic-ws)
+ (setq new-beg (point))
- ;; Locate the barrier after END.
+ ;; ...Then the ones with < before end and > after end.
(goto-char (if end-lit-limits (cdr end-lit-limits) end))
- (c-syntactic-re-search-forward "[;{}]" (c-determine-+ve-limit 512) 'end)
+ (setq end-limit (c-determine-+ve-limit 512))
+ (while (and (c-syntactic-re-search-forward "[;{}>]" end-limit 'end)
+ (eq (char-before) ?>))
+ (c-end-of-current-token)
+ (when (eq (char-before) ?>)
+ (c-clear->-pair-props-if-match-before end (1- (point)))))
+ (c-backward-syntactic-ws)
(setq new-end (point))
- ;; Remove syntax-table properties from the remaining pertinent <...>
- ;; pairs, those with a > after end and < before end.
- (while (c-search-backward-char-property 'syntax-table c->-as-paren-syntax end)
- (if (c-clear->-pair-props-if-match-before end)
- (setq need-new-end t)))
-
;; Extend the fontification region, if needed.
- (when need-new-beg
- (goto-char new-beg)
- (c-forward-syntactic-ws)
- (and (< (point) c-new-BEG) (setq c-new-BEG (point))))
-
- (when need-new-end
- (and (> new-end c-new-END) (setq c-new-END new-end))))))
+ (and new-beg
+ (< new-beg c-new-BEG)
+ (setq c-new-BEG new-beg))
+ (and new-end
+ (> new-end c-new-END)
+ (setq c-new-END new-end)))))
(defun c-after-change-check-<>-operators (beg end)
;; This is called from `after-change-functions' when
@@ -5668,7 +5672,28 @@ comment at the start of cc-engine.el for more info."
(c-clear-<>-pair-props)
(forward-char)))))))
-
+(defun c-restore-<>-properties (_beg _end _old-len)
+ ;; This function is called as an after-change function. It restores the
+ ;; category/syntax-table properties on template/generic <..> pairs between
+ ;; c-new-BEG and c-new-END. It may do hidden buffer changes.
+ (c-save-buffer-state ((c-parse-and-markup-<>-arglists t)
+ c-restricted-<>-arglists lit-limits)
+ (goto-char c-new-BEG)
+ (if (setq lit-limits (c-literal-limits))
+ (goto-char (cdr lit-limits)))
+ (while (and (< (point) c-new-END)
+ (c-syntactic-re-search-forward "<" c-new-END 'bound))
+ (backward-char)
+ (save-excursion
+ (c-backward-token-2)
+ (setq c-restricted-<>-arglists
+ (and (not (looking-at c-opt-<>-sexp-key))
+ (progn (c-backward-syntactic-ws) ; to ( or ,
+ (and (memq (char-before) '(?\( ?,)) ; what about <?
+ (not (eq (c-get-char-property (point) 'c-type)
+ 'c-decl-arg-start)))))))
+ (or (c-forward-<>-arglist nil)
+ (forward-char)))))
;; Handling of small scale constructs like types and names.
@@ -6616,16 +6641,22 @@ comment at the start of cc-engine.el for more info."
res))
(defun c-forward-annotation ()
- ;; Used for Java code only at the moment. Assumes point is on the
- ;; @, moves forward an annotation. returns nil if there is no
- ;; annotation at point.
- (and (looking-at "@")
- (progn (forward-char) t)
- (c-forward-type)
- (progn (c-forward-syntactic-ws) t)
- (if (looking-at "(")
- (c-go-list-forward)
- t)))
+ ;; Used for Java code only at the moment. Assumes point is on the @, moves
+ ;; forward an annotation and returns t. Leaves point unmoved and returns
+ ;; nil if there is no annotation at point.
+ (let ((pos (point)))
+ (or
+ (and (looking-at "@")
+ (not (looking-at c-keywords-regexp))
+ (progn (forward-char) t)
+ (looking-at c-symbol-key)
+ (progn (goto-char (match-end 0))
+ (c-forward-syntactic-ws)
+ t)
+ (if (looking-at "(")
+ (c-go-list-forward)
+ t))
+ (progn (goto-char pos) nil))))
(defmacro c-pull-open-brace (ps)
;; Pull the next open brace from PS (which has the form of paren-state),
@@ -6934,9 +6965,8 @@ comment at the start of cc-engine.el for more info."
(when (or (looking-at c-prefix-spec-kwds-re) ;FIXME!!! includes auto
(and (c-major-mode-is 'java-mode)
(looking-at "@[A-Za-z0-9]+")))
- (save-match-data
- (if (looking-at c-typedef-key)
- (setq at-typedef t)))
+ (if (save-match-data (looking-at c-typedef-key))
+ (setq at-typedef t))
(setq kwd-sym (c-keyword-sym (match-string 1)))
(save-excursion
(c-forward-keyword-clause 1)
@@ -9081,6 +9111,11 @@ comment at the start of cc-engine.el for more info."
(goto-char containing-sexp)
(if (or (save-excursion
(c-backward-syntactic-ws lim)
+ (while (and (eq (char-before) ?>)
+ (c-get-char-property (1- (point))
+ 'syntax-table)
+ (c-go-list-backward nil lim))
+ (c-backward-syntactic-ws lim))
(and (> (point) (or lim (point-min)))
(c-on-identifier)))
(and c-special-brace-lists
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index ad112d720d8..03e67a99515 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1,6 +1,6 @@
;;; cc-fonts.el --- font lock support for CC Mode
-;; Copyright (C) 2002-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2016 Free Software Foundation, Inc.
;; Authors: 2003- Alan Mackenzie
;; 2002- Martin Stjernholm
@@ -1157,15 +1157,6 @@ casts and declarations are fontified. Used on level 2 and higher."
(setq pos (point)))))) ; acts to make the `while' form continue.
nil)
-(defconst c-font-lock-maybe-decl-faces
- ;; List of faces that might be put at the start of a type when
- ;; `c-font-lock-declarations' runs. This needs to be evaluated to
- ;; ensure that face name aliases in Emacs are resolved.
- (list nil
- font-lock-type-face
- c-reference-face-name
- font-lock-keyword-face))
-
(defun c-font-lock-declarations (limit)
;; Fontify all the declarations, casts and labels from the point to LIMIT.
;; Assumes that strings and comments have been fontified already.
@@ -1205,6 +1196,9 @@ casts and declarations are fontified. Used on level 2 and higher."
;; Same as `max-type-decl-*', but used when we're before
;; `token-pos'.
(max-type-decl-end-before-token 0)
+ ;; End of <..> construct which has had c-<>-arg-sep c-type
+ ;; properties set within it.
+ (max-<>-end 0)
;; Set according to the context to direct the heuristics for
;; recognizing C++ templates.
c-restricted-<>-arglists
@@ -1253,7 +1247,7 @@ casts and declarations are fontified. Used on level 2 and higher."
(c-find-decl-spots
limit
c-decl-start-re
- c-font-lock-maybe-decl-faces
+ (eval c-maybe-decl-faces)
(lambda (match-pos inside-macro)
;; Note to maintainers: don't use `limit' inside this lambda form;
@@ -1347,6 +1341,28 @@ casts and declarations are fontified. Used on level 2 and higher."
(setq decl-or-cast (c-forward-decl-or-cast-1
match-pos context last-cast-end))
+ ;; Ensure that c-<>-arg-sep c-type properties are in place on the
+ ;; commas separating the arguments inside template/generic <..>s.
+ (when (and (eq (char-before match-pos) ?<)
+ (> match-pos max-<>-end))
+ (save-excursion
+ (goto-char match-pos)
+ (c-backward-token-2)
+ (if (and
+ (eq (char-after) ?<)
+ (let ((c-restricted-<>-arglists
+ (save-excursion
+ (c-backward-token-2)
+ (and
+ (not (looking-at c-opt-<>-sexp-key))
+ (progn (c-backward-syntactic-ws)
+ (memq (char-before) '(?\( ?,)))
+ (not (eq (c-get-char-property (1- (point))
+ 'c-type)
+ 'c-decl-arg-start))))))
+ (c-forward-<>-arglist nil)))
+ (setq max-<>-end (point)))))
+
(cond
((eq decl-or-cast 'cast)
;; Save the position after the previous cast so we can feed
diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el
index 4295fc72351..d957334f926 100644
--- a/lisp/progmodes/cc-guess.el
+++ b/lisp/progmodes/cc-guess.el
@@ -1,6 +1,6 @@
;;; cc-guess.el --- guess indentation values by scanning existing code
-;; Copyright (C) 1985, 1987, 1992-2006, 2011-2015 Free Software
+;; Copyright (C) 1985, 1987, 1992-2006, 2011-2016 Free Software
;; Foundation, Inc.
;; Author: 1994-1995 Barry A. Warsaw
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 1a07c4cd699..b52da3f662d 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1,6 +1,6 @@
;;; cc-langs.el --- language specific settings for CC Mode -*- coding: utf-8 -*-
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2002- Alan Mackenzie
;; 1998- Martin Stjernholm
@@ -499,8 +499,13 @@ parameters \(point-min) and \(point-max).")
;; 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-expand-fl-region
- (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP
- c-change-expand-fl-region)
+ (c objc) '(c-neutralize-syntax-in-and-mark-CPP
+ c-change-expand-fl-region)
+ c++ '(c-neutralize-syntax-in-and-mark-CPP
+ c-restore-<>-properties
+ c-change-expand-fl-region)
+ java '(c-restore-<>-properties
+ c-change-expand-fl-region)
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)))
@@ -526,8 +531,8 @@ 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-expand-fl-region)
+ t 'c-context-expand-fl-region
+ awk nil)
;; 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
@@ -3246,6 +3251,19 @@ way."
objc t)
(c-lang-defvar c-type-decl-end-used (c-lang-const c-type-decl-end-used))
+(c-lang-defconst c-maybe-decl-faces
+ "List of faces that might be put at the start of a type when
+`c-font-lock-declarations' runs. This must be evaluated (with `eval') at
+runtime to get the actual list of faces. This ensures that face name
+aliases in Emacs are resolved."
+ t '(list nil
+ font-lock-type-face
+ c-reference-face-name
+ font-lock-keyword-face)
+ java (append (c-lang-const c-maybe-decl-faces)
+ '(font-lock-preprocessor-face)))
+(c-lang-defvar c-maybe-decl-faces (c-lang-const c-maybe-decl-faces))
+
;;; Wrap up the `c-lang-defvar' system.
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el
index 51cb9203e72..92e56431b7e 100644
--- a/lisp/progmodes/cc-menus.el
+++ b/lisp/progmodes/cc-menus.el
@@ -1,6 +1,6 @@
;;; cc-menus.el --- imenu support for CC Mode
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 1998- Martin Stjernholm
;; 1992-1999 Barry A. Warsaw
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 5d8af239972..738870b727a 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1,6 +1,6 @@
;;; cc-mode.el --- major mode for editing C and similar languages
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2003- Alan Mackenzie
;; 1998- Martin Stjernholm
@@ -631,8 +631,11 @@ that requires a literal mode spec at compile time."
(font-lock-mode 1)))
;; 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-functions' BEG and END, and may be modified by functions in
+;; after-change function. They are initialized in c-before-change to
+;; before-change-functions' BEG and END. `c-new-END' is amended in
+;; c-after-change with after-change-functions' BEG, END, and OLD-LEN. These
+;; variables may be modified by any before/after-change function, in
+;; particular by functions in `c-get-state-before-change-functions' and
;; `c-before-font-lock-functions'.
(defvar c-new-BEG 0)
(make-variable-buffer-local 'c-new-BEG)
@@ -671,8 +674,9 @@ compatible with old code; callers should always specify it."
(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))))
+ (if (not (eq fn 'c-restore-<>-properties))
+ (funcall fn (point-min) (point-max)
+ (- (point-max) (point-min)))))
c-before-font-lock-functions))))
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
@@ -1032,6 +1036,8 @@ Note that the style variables are always made local to the buffer."
c-just-done-before-change) ; guard against a spurious second
; invocation of before-change-functions.
(setq c-just-done-before-change t)
+ ;; (c-new-BEG c-new-END) will be the region to fontify.
+ (setq c-new-BEG beg c-new-END end)
(setq c-maybe-stale-found-type nil)
(save-restriction
(save-match-data
@@ -1126,7 +1132,8 @@ Note that the style variables are always made local to the buffer."
;; (c-new-BEG c-new-END) will be the region to fontify. It may become
;; larger than (beg end).
- (setq c-new-BEG beg c-new-END end)
+ ;; (setq c-new-BEG beg c-new-END end)
+ (setq c-new-END (- (+ c-new-END (- end beg)) old-len))
(unless (c-called-from-text-property-change-p)
(setq c-just-done-before-change nil)
@@ -1245,7 +1252,8 @@ Note that the style variables are always made local to the buffer."
(save-restriction
(widen)
(save-excursion
- (let ((new-beg beg) (new-end end) new-region)
+ (let ((new-beg beg) (new-end end)
+ (new-region (cons beg end)))
(mapc (lambda (fn)
(setq new-region (funcall fn new-beg new-end))
(setq new-beg (car new-region) new-end (cdr new-region)))
@@ -1328,12 +1336,13 @@ This function is called from `c-common-init', once per mode initialization."
. c-mark-function)))
;; Prevent `font-lock-default-fontify-region' extending the region it will
- ;; fontify to whole lines by removing `font-lock-extend-region-whole-lines'
- ;; (and, coincidentally, `font-lock-extend-region-multiline' (which we do
- ;; not need)) from `font-lock-extend-region-functions'. (Emacs only). This
- ;; fixes Emacs bug #19669.
+ ;; fontify to whole lines by removing `font-lock-extend-region-wholelines'
+ ;; from `font-lock-extend-region-functions'. (Emacs only). This fixes
+ ;; Emacs bug #19669.
(when (boundp 'font-lock-extend-region-functions)
- (setq font-lock-extend-region-functions nil))
+ (setq font-lock-extend-region-functions
+ (delq 'font-lock-extend-region-wholelines
+ font-lock-extend-region-functions)))
(make-local-variable 'font-lock-fontify-region-function)
(setq font-lock-fontify-region-function 'c-font-lock-fontify-region)
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index 527d4c4bd72..7859218f169 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -1,6 +1,6 @@
;;; cc-styles.el --- support for styles in CC Mode
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2004- Alan Mackenzie
;; 1998- Martin Stjernholm
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 9afece9e30b..8cee733ec8e 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1,6 +1,6 @@
;;; cc-vars.el --- user customization variables for CC Mode
-;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc.
;; Authors: 2002- Alan Mackenzie
;; 1998- Martin Stjernholm
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 78c8d94576b..08302147204 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1,6 +1,6 @@
;;; cfengine.el --- mode for editing Cfengine files
-;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Author: Dave Love <fx@gnu.org>
;; Maintainer: Ted Zlatanov <tzz@lifelogs.com>
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 9953cae2bef..007619d31f6 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -1,6 +1,6 @@
;;; cmacexp.el --- expand C macros in a region
-;; Copyright (C) 1992, 1994, 1996, 2000-2015 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1996, 2000-2016 Free Software Foundation,
;; Inc.
;; Author: Francesco Potortì <pot@gnu.org>
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f13906680cf..b7ab408f744 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1,6 +1,6 @@
;;; compile.el --- run compiler as inferior of Emacs, parse error messages -*- lexical-binding:t -*-
-;; Copyright (C) 1985-1987, 1993-1999, 2001-2015 Free Software
+;; Copyright (C) 1985-1987, 1993-1999, 2001-2016 Free Software
;; Foundation, Inc.
;; Authors: Roland McGrath <roland@gnu.org>,
@@ -1125,6 +1125,16 @@ POS and RES.")
(compilation-internal-error-properties
file line end-line col end-col type fmt)))
+(defun compilation-beginning-of-line (&optional n)
+ "Like `beginning-of-line', but accounts for lines hidden by `selective-display'."
+ (if (or (not (eq selective-display t))
+ (null n)
+ (= n 1))
+ (beginning-of-line n)
+ (re-search-forward "[\n\r]" nil 'end (1- n))
+ (if (< n 0)
+ (beginning-of-line))))
+
(defun compilation-move-to-column (col screen)
"Go to column COL on the current line.
If SCREEN is non-nil, columns are screen columns, otherwise, they are
@@ -1183,13 +1193,15 @@ FMTS is a list of format specs for transforming the file name.
(goto-char (marker-position marker))
;; Set end-marker if appropriate and go to line.
(if (not (or end-col end-line))
- (beginning-of-line (- line marker-line -1))
- (beginning-of-line (- (or end-line line) marker-line -1))
+ (compilation-beginning-of-line (- line marker-line -1))
+ (compilation-beginning-of-line (- (or end-line line)
+ marker-line -1))
(if (or (null end-col) (< end-col 0))
(end-of-line)
(compilation-move-to-column end-col screen-columns))
(setq end-marker (point-marker))
- (when end-line (beginning-of-line (- line end-line -1))))
+ (when end-line
+ (compilation-beginning-of-line (- line end-line -1))))
(if col
(compilation-move-to-column col screen-columns)
(forward-to-indentation 0))
@@ -2469,7 +2481,7 @@ This is the value of `next-error-function' in Compilation buffers."
;; Treat file's found lines in forward order, 1 by 1.
(dolist (line (reverse (cddr (compilation--loc->file-struct loc))))
(when (car line) ; else this is a filename w/o a line#
- (beginning-of-line (- (car line) last -1))
+ (compilation-beginning-of-line (- (car line) last -1))
(setq last (car line)))
;; Treat line's found columns and store/update a marker for each.
(dolist (col (cdr line))
@@ -2541,7 +2553,7 @@ displays at the top of the window; there is no arrow."
(if (integerp compilation-context-lines)
(set-window-start w (save-excursion
(goto-char mk)
- (beginning-of-line
+ (compilation-beginning-of-line
(- 1 compilation-context-lines))
(point)))
;; If there is no left fringe.
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index ab3aa7f993a..de546f7c1d4 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1,6 +1,6 @@
;;; cperl-mode.el --- Perl code editing commands for Emacs
-;; Copyright (C) 1985-1987, 1991-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1991-2016 Free Software Foundation, Inc.
;; Author: Ilya Zakharevich
;; Bob Olson
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index faa917a87a7..7d641ab47f0 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -1,6 +1,6 @@
;;; cpp.el --- highlight or hide text according to cpp conditionals
-;; Copyright (C) 1994-1995, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2016 Free Software Foundation, Inc.
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Keywords: c, faces, tools
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el
index eae96f01c3c..6c800ab2512 100644
--- a/lisp/progmodes/cwarn.el
+++ b/lisp/progmodes/cwarn.el
@@ -1,6 +1,6 @@
;;; cwarn.el --- highlight suspicious C and C++ constructions
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Anders Lindgren
;; Keywords: c, languages, faces
diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el
index 8c8bef06ecc..ef4ac912d0c 100644
--- a/lisp/progmodes/dcl-mode.el
+++ b/lisp/progmodes/dcl-mode.el
@@ -1,6 +1,6 @@
;;; dcl-mode.el --- major mode for editing DCL command files
-;; Copyright (C) 1997, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Odd Gripenstam <gripenstamol@decus.se>
;; Maintainer: Odd Gripenstam <gripenstamol@decus.se>
diff --git a/lisp/progmodes/ebnf-abn.el b/lisp/progmodes/ebnf-abn.el
index d409139d27f..553beae4db5 100644
--- a/lisp/progmodes/ebnf-abn.el
+++ b/lisp/progmodes/ebnf-abn.el
@@ -1,6 +1,6 @@
;;; ebnf-abn.el --- parser for ABNF (Augmented BNF)
-;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf-bnf.el b/lisp/progmodes/ebnf-bnf.el
index e339818cf30..a2d51c940a7 100644
--- a/lisp/progmodes/ebnf-bnf.el
+++ b/lisp/progmodes/ebnf-bnf.el
@@ -1,6 +1,6 @@
;;; ebnf-bnf.el --- parser for EBNF
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf-dtd.el b/lisp/progmodes/ebnf-dtd.el
index 35bd8df9c99..0963d27784e 100644
--- a/lisp/progmodes/ebnf-dtd.el
+++ b/lisp/progmodes/ebnf-dtd.el
@@ -1,6 +1,6 @@
;;; ebnf-dtd.el --- parser for DTD (Data Type Description for XML)
-;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf-ebx.el b/lisp/progmodes/ebnf-ebx.el
index 28058e360bd..eb0fd621368 100644
--- a/lisp/progmodes/ebnf-ebx.el
+++ b/lisp/progmodes/ebnf-ebx.el
@@ -1,6 +1,6 @@
;;; ebnf-ebx.el --- parser for EBNF used to specify XML (EBNFX)
-;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf-iso.el b/lisp/progmodes/ebnf-iso.el
index 2cbe9010821..3b092cd24b3 100644
--- a/lisp/progmodes/ebnf-iso.el
+++ b/lisp/progmodes/ebnf-iso.el
@@ -1,6 +1,6 @@
;;; ebnf-iso.el --- parser for ISO EBNF
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf-otz.el b/lisp/progmodes/ebnf-otz.el
index 3e5cf38665c..b78a748667d 100644
--- a/lisp/progmodes/ebnf-otz.el
+++ b/lisp/progmodes/ebnf-otz.el
@@ -1,6 +1,6 @@
;;; ebnf-otz.el --- syntactic chart OpTimiZer
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el
index d9e8a15fef4..aaffce999ad 100644
--- a/lisp/progmodes/ebnf-yac.el
+++ b/lisp/progmodes/ebnf-yac.el
@@ -1,6 +1,6 @@
;;; ebnf-yac.el --- parser for Yacc/Bison
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 6d8e90c2d6a..ffb93de8062 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -1,6 +1,6 @@
;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 80f9e2a7719..5a9870b9001 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -1,6 +1,6 @@
;;; ebrowse.el --- Emacs C++ class browser & tags facility
-;; Copyright (C) 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2016 Free Software Foundation, Inc.
;; Author: Gerd Moellmann <gerd@gnu.org>
;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 4cc2aee9346..9e175a20e22 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1,6 +1,6 @@
;;; elisp-mode.el --- Emacs Lisp mode -*- lexical-binding:t -*-
-;; Copyright (C) 1985-1986, 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1999-2016 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: lisp, languages
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index dbb46a38381..2db7220de5c 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1,6 +1,6 @@
;;; etags.el --- etags facility for Emacs -*- lexical-binding: t -*-
-;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2015 Free
+;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2016 Free
;; Software Foundation, Inc.
;; Author: Roland McGrath <roland@gnu.org>
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index b057fa68471..173bf85bb52 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -1,6 +1,6 @@
;;; executable.el --- base functionality for executable interpreter scripts -*- byte-compile-dynamic: t -*-
-;; Copyright (C) 1994-1996, 2000-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2000-2016 Free Software Foundation, Inc.
;; Author: Daniel Pfeiffer <occitan@esperanto.org>
;; Keywords: languages, unix
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 324efb0e1bb..588f4d99d78 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1,6 +1,6 @@
;;; f90.el --- Fortran-90 mode (free format) -*- lexical-binding: t -*-
-;; Copyright (C) 1995-1997, 2000-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1997, 2000-2016 Free Software Foundation, Inc.
;; Author: Torbjörn Einarsson <Torbjorn.Einarsson@era.ericsson.se>
;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 882ac064b82..30c9fed45ca 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1,6 +1,6 @@
;;; flymake.el --- a universal on-the-fly syntax checker -*- lexical-binding: t; -*-
-;; Copyright (C) 2003-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2016 Free Software Foundation, Inc.
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
;; Maintainer: Leo Liu <sdl.web@gmail.com>
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 33fe4b37cf8..bd08d3fd16d 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1,6 +1,6 @@
;;; fortran.el --- Fortran mode for GNU Emacs
-;; Copyright (C) 1986, 1993-1995, 1997-2015 Free Software Foundation,
+;; Copyright (C) 1986, 1993-1995, 1997-2016 Free Software Foundation,
;; Inc.
;; Author: Michael D. Prange <prange@erl.mit.edu>
@@ -496,12 +496,12 @@ This is used to fontify fixed-format Fortran comments."
;; worth the trouble (about 0.5% of slow down).
(eval ;I hate `eval', but it's hard to avoid it here.
`(syntax-propertize-rules
- ("^[cd\\*]" (0 "<"))
+ ("^[CcDd\\*]" (0 "<"))
;; We mark all chars after line-length as "comment-start", rather than
;; just the first one. This is so that a closing ' that's past the
;; line-length will indeed be ignored (and will result in a string that
;; leaks into subsequent lines).
- ((format "^[^cd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length))
+ ((format "^[^CcDd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length))
(1 "<")))))
(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index bde030e3f26..5ad101df7bf 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1,6 +1,6 @@
;;; gdb-mi.el --- User Interface for running GDB -*- lexical-binding: t -*-
-;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
;; Author: Nick Roberts <nickrob@gnu.org>
;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index 6ee32b0b3ee..17f5ffd5118 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -1,6 +1,6 @@
;;; glasses.el --- make cantReadThis readable
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Milan Zamazal <pdm@zamazal.org>
;; Maintainer: Milan Zamazal <pdm@zamazal.org>
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index efecd21a92a..7e6f157f5fe 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1,6 +1,6 @@
;;; grep.el --- run `grep' and display the results -*- lexical-binding:t -*-
-;; Copyright (C) 1985-1987, 1993-1999, 2001-2015 Free Software
+;; Copyright (C) 1985-1987, 1993-1999, 2001-2016 Free Software
;; Foundation, Inc.
;; Author: Roland McGrath <roland@gnu.org>
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 024547cc487..c22de2f77ac 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1,6 +1,6 @@
;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers -*- lexical-binding:t -*-
-;; Copyright (C) 1992-1996, 1998, 2000-2015 Free Software Foundation,
+;; Copyright (C) 1992-1996, 1998, 2000-2016 Free Software Foundation,
;; Inc.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 71646d312c4..43cf42c048b 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -1,6 +1,6 @@
;;; hideif.el --- hides selected code within ifdef -*- lexical-binding:t -*-
-;; Copyright (C) 1988, 1994, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1994, 2001-2016 Free Software Foundation, Inc.
;; Author: Brian Marick
;; Daniel LaLiberte <liberte@holonexus.org>
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 7dfef5fae4c..e5460009a56 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -1,6 +1,6 @@
;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks
-;; Copyright (C) 1994-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2016 Free Software Foundation, Inc.
;; Author: Thien-Thi Nguyen <ttn@gnu.org>
;; Dan Nicolaescu <dann@ics.uci.edu>
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index b716e7da594..7fde29dcf7a 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -1,6 +1,6 @@
;;; icon.el --- mode for editing Icon code
-;; Copyright (C) 1989, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2016 Free Software Foundation, Inc.
;; Author: Chris Smith <csmith@convex.com>
;; Created: 15 Feb 89
diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el
index a9ddeba9433..26cd46b88e9 100644
--- a/lisp/progmodes/idlw-complete-structtag.el
+++ b/lisp/progmodes/idlw-complete-structtag.el
@@ -1,6 +1,6 @@
;;; idlw-complete-structtag.el --- Completion of structure tags.
-;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@astro.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index 4473409e344..9a3199fedaa 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -1,6 +1,6 @@
;;; idlw-help.el --- HTML Help code for IDLWAVE
-;; Copyright (C) 2000-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2016 Free Software Foundation, Inc.
;;
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@science.uva.nl>
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 5aeb4ea1a07..af2e48d03a6 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1,6 +1,6 @@
;; idlw-shell.el --- run IDL as an inferior process of Emacs.
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@astro.uva.nl>
diff --git a/lisp/progmodes/idlw-toolbar.el b/lisp/progmodes/idlw-toolbar.el
index 89284cae3eb..0e0714e27ed 100644
--- a/lisp/progmodes/idlw-toolbar.el
+++ b/lisp/progmodes/idlw-toolbar.el
@@ -1,6 +1,6 @@
;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@astro.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 1546e9ad6e6..ab87a584bfd 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1,6 +1,6 @@
;; idlwave.el --- IDL editing mode for GNU Emacs
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@science.uva.nl>
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 290ebeea290..843c79e8b38 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -1,6 +1,6 @@
;;; inf-lisp.el --- an inferior-lisp mode
-;; Copyright (C) 1988, 1993-1994, 2001-2015 Free Software Foundation,
+;; Copyright (C) 1988, 1993-1994, 2001-2016 Free Software Foundation,
;; Inc.
;; Author: Olin Shivers <shivers@cs.cmu.edu>
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 310b7ba371f..07849484b78 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1,6 +1,6 @@
;;; js.el --- Major mode for editing JavaScript -*- lexical-binding: t -*-
-;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
;; Author: Karl Landstrom <karl.landstrom@brgeight.se>
;; Daniel Colascione <dan.colascione@gmail.com>
diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el
index 0c180dfc147..c82775ed5d3 100644
--- a/lisp/progmodes/ld-script.el
+++ b/lisp/progmodes/ld-script.el
@@ -1,6 +1,6 @@
;;; ld-script.el --- GNU linker script editing mode for Emacs
-;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Author: Masatake YAMATO<jet@gyve.org>
;; Keywords: languages, faces
diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el
index 80a93a477b4..f2e4d68436b 100644
--- a/lisp/progmodes/m4-mode.el
+++ b/lisp/progmodes/m4-mode.el
@@ -1,6 +1,6 @@
;;; m4-mode.el --- m4 code editing commands for Emacs
-;; Copyright (C) 1996-1997, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Andrew Csillag <drew@thecsillags.com>
;; Keywords: languages, faces
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 9736f0f207c..5cc6321e1ba 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1,6 +1,6 @@
;;; make-mode.el --- makefile editing commands for Emacs -*- lexical-binding:t -*-
-;; Copyright (C) 1992, 1994, 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994, 1999-2016 Free Software Foundation, Inc.
;; Author: Thomas Neumann <tom@smart.bo.open.de>
;; Eric S. Raymond <esr@snark.thyrsus.com>
diff --git a/lisp/progmodes/mantemp.el b/lisp/progmodes/mantemp.el
index 79a60400eed..913849df324 100644
--- a/lisp/progmodes/mantemp.el
+++ b/lisp/progmodes/mantemp.el
@@ -1,6 +1,6 @@
;;; mantemp.el --- create manual template instantiations from g++ 2.7.2 output
-;; Copyright (C) 1996, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2016 Free Software Foundation, Inc.
;; Author: Tom Houlder <thoulder@icor.fr>
;; Created: 10 Dec 1996
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 62ff2fac2ac..503cfcf802b 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -1,6 +1,6 @@
;;; meta-mode.el --- major mode for editing Metafont or MetaPost sources -*- lexical-binding:t -*-
-;; Copyright (C) 1997, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Ulrik Vieth <vieth@thphy.uni-duesseldorf.de>
;; Version: 1.0
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index c95315700b3..cfae5695c8d 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -1,6 +1,6 @@
;;; mixal-mode.el --- Major mode for the mix asm language.
-;; Copyright (C) 2003-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2016 Free Software Foundation, Inc.
;; Author: Pieter E.J. Pareit <pieter.pareit@gmail.com>
;; Maintainer: Pieter E.J. Pareit <pieter.pareit@gmail.com>
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index b54b88dccb5..28619a55853 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -1,6 +1,6 @@
;;; octave.el --- editing octave source files under emacs -*- lexical-binding: t; -*-
-;; Copyright (C) 1997, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>
;; John Eaton <jwe@octave.org>
diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el
index ef3433f003b..6a02280c1e8 100644
--- a/lisp/progmodes/opascal.el
+++ b/lisp/progmodes/opascal.el
@@ -1,6 +1,6 @@
;;; opascal.el --- major mode for editing Object Pascal source in Emacs -*- lexical-binding: t -*-
-;; Copyright (C) 1998-1999, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2001-2016 Free Software Foundation, Inc.
;; Authors: Ray Blaak <blaak@infomatch.com>,
;; Simon South <ssouth@member.fsf.org>
@@ -257,6 +257,7 @@ routine.")
(defvar opascal-mode-syntax-table
(let ((st (make-syntax-table)))
+ (modify-syntax-entry ?\\ "." st) ; bug#22224
;; Strings.
(modify-syntax-entry ?\" "\"" st)
(modify-syntax-entry ?\' "\"" st)
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 904001d3383..b0929ebd040 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -1,6 +1,6 @@
;;; pascal.el --- major mode for editing pascal source in Emacs -*- lexical-binding: t -*-
-;; Copyright (C) 1993-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1993-2016 Free Software Foundation, Inc.
;; Author: Espen Skoglund <esk@gnu.org>
;; Keywords: languages
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 55d69bfddff..241521bef4d 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -1,6 +1,6 @@
;;; perl-mode.el --- Perl code editing commands for GNU Emacs -*- lexical-binding:t -*-
-;; Copyright (C) 1990, 1994, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1994, 2001-2016 Free Software Foundation, Inc.
;; Author: William F. Mann
;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 9702880771c..2f12df47723 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -1,6 +1,6 @@
;;; prog-mode.el --- Generic major mode for programming -*- lexical-binding: t -*-
-;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: internal
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index c8e48e2275a..fe28ed776b2 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,6 +1,6 @@
;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
@@ -27,6 +27,11 @@
;; current project, without having to know which package handles
;; detection of that project type, parsing its config files, etc.
;;
+;; NOTE: The project API is still experimental and can change in major,
+;; backward-incompatible ways. Everyone is encouraged to try it, and
+;; report to us any problems or use cases we hadn't anticipated, by
+;; sending an email to emacs-devel, or `M-x report-emacs-bug'.
+;;
;; Infrastructure:
;;
;; Function `project-current', to determine the current project
@@ -45,10 +50,12 @@
;;; TODO:
-;; * Commands `project-find-file' and `project-or-external-find-file'.
-;; Currently blocked on adding a new completion style that would let
-;; the user enter just the base file name (or a part of it), and get
-;; it expanded to the absolute file name.
+;; * Reliably cache the list of files in the project, probably using
+;; filenotify.el (if supported) to invalidate. And avoiding caching
+;; if it's not available (manual cache invalidation is not nice).
+;;
+;; * Allow the backend to override the file-listing logic? Maybe also
+;; to delegate file name completion to an external tool.
;;
;; * Build tool related functionality. Start with a `project-build'
;; command, which should provide completions on tasks to run, and
@@ -251,13 +258,15 @@ DIRS must contain directory names."
(defun project--value-in-dir (var dir)
(with-temp-buffer
(setq default-directory dir)
- (hack-dir-local-variables-non-file-buffer)
+ (let ((enable-local-variables :all))
+ (hack-dir-local-variables-non-file-buffer))
(symbol-value var)))
(declare-function grep-read-files "grep")
(declare-function xref-collect-matches "xref")
(declare-function xref--show-xrefs "xref")
(declare-function xref-backend-identifier-at-point "xref")
+(declare-function xref--find-ignores-arguments "xref")
;;;###autoload
(defun project-find-regexp (regexp)
@@ -302,5 +311,53 @@ pattern to search for."
(user-error "No matches for: %s" regexp))
(xref--show-xrefs xrefs nil)))
+;;;###autoload
+(defun project-find-file ()
+ "Visit a file in the current project's roots.
+
+This is like `find-file', but it limits the file-name completion
+candidates to the files within the current project roots."
+ (interactive)
+ (let* ((pr (project-current t))
+ (dirs (project-roots pr)))
+ (project--find-file-in dirs pr)))
+
+;;;###autoload
+(defun project-or-external-find-file ()
+ "Visit a file in the current project's roots or external roots.
+
+This is like `find-file', but it limits the file-name completion
+candidates to the files within the current project roots and external roots."
+ (interactive)
+ (let* ((pr (project-current t))
+ (dirs (append
+ (project-roots pr)
+ (project-external-roots pr))))
+ (project--find-file-in dirs pr)))
+
+;; FIXME: Uniquely abbreviate the roots?
+(defun project--find-file-in (dirs project)
+ (require 'xref)
+ (let* ((all-files
+ (cl-mapcan
+ (lambda (dir)
+ (let ((command
+ (format "%s %s %s -type f -print0"
+ find-program
+ dir
+ (xref--find-ignores-arguments
+ (project-ignores project dir)
+ (expand-file-name dir)))))
+ (split-string (shell-command-to-string command) "\0" t)))
+ dirs))
+ (table (lambda (string pred action)
+ (cond
+ ((eq action 'metadata)
+ '(metadata . ((category . project-file))))
+ (t
+ (complete-with-action action all-files string pred))))))
+ (find-file
+ (completing-read "Find file: " table nil t))))
+
(provide 'project)
;;; project.el ends here
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 61d3a3c638b..c62146769ec 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1,6 +1,6 @@
;;; prolog.el --- major mode for Prolog (and Mercury) -*- lexical-binding:t -*-
-;; Copyright (C) 1986-1987, 1997-1999, 2002-2003, 2011-2015 Free
+;; Copyright (C) 1986-1987, 1997-1999, 2002-2003, 2011-2016 Free
;; Software Foundation, Inc.
;; Authors: Emil Åström <emil_astrom(at)hotmail(dot)com>
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el
index 077be53e2fb..79c32c62a5c 100644
--- a/lisp/progmodes/ps-mode.el
+++ b/lisp/progmodes/ps-mode.el
@@ -1,6 +1,6 @@
;;; ps-mode.el --- PostScript mode for GNU Emacs
-;; Copyright (C) 1999, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2016 Free Software Foundation, Inc.
;; Author: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
;; Maintainer: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 04542cdff3d..3bcbf07cbbd 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1,6 +1,6 @@
;;; python.el --- Python's flying circus support for Emacs -*- lexical-binding: t -*-
-;; Copyright (C) 2003-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2016 Free Software Foundation, Inc.
;; Author: Fabián E. Gallina <fgallina@gnu.org>
;; URL: https://github.com/fgallina/python.el
@@ -2042,8 +2042,8 @@ virtualenv."
(defun python-shell-calculate-pythonpath ()
"Calculate the PYTHONPATH using `python-shell-extra-pythonpaths'."
(let ((pythonpath
- (tramp-compat-split-string
- (or (getenv "PYTHONPATH") "") path-separator)))
+ (split-string
+ (or (getenv "PYTHONPATH") "") path-separator 'omit)))
(python-shell--add-to-path-with-priority
pythonpath python-shell-extra-pythonpaths)
(mapconcat 'identity pythonpath path-separator)))
@@ -2114,7 +2114,7 @@ appends `python-shell-remote-exec-path' instead of `exec-path'."
(md5 tramp-end-of-output)))
unset vars item)
(while env
- (setq item (tramp-compat-split-string (car env) "="))
+ (setq item (split-string (car env) "=" 'omit))
(setcdr item (mapconcat 'identity (cdr item) "="))
(if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
(push (format "%s %s" (car item) (cdr item)) vars)
@@ -3569,7 +3569,9 @@ using that one instead of current buffer's process."
(forward-char (length (match-string-no-properties 0)))
(point))))
(end (point))
- (prompt-boundaries (python-util-comint-last-prompt))
+ (prompt-boundaries
+ (with-current-buffer (process-buffer process)
+ (python-util-comint-last-prompt)))
(prompt
(with-current-buffer (process-buffer process)
(when prompt-boundaries
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index df07083eaef..8f08b7c9e60 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1,6 +1,6 @@
;;; ruby-mode.el --- Major mode for editing Ruby files
-;; Copyright (C) 1994-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2016 Free Software Foundation, Inc.
;; Authors: Yukihiro Matsumoto
;; Nobuyoshi Nakada
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index e921e84a33e..27ce60bde44 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -1,6 +1,6 @@
;;; scheme.el --- Scheme (and DSSSL) editing mode -*- lexical-binding: t; -*-
-;; Copyright (C) 1986-1988, 1997-1998, 2001-2015 Free Software
+;; Copyright (C) 1986-1988, 1997-1998, 2001-2016 Free Software
;; Foundation, Inc.
;; Author: Bill Rozas <jinx@martigny.ai.mit.edu>
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 394e9ca48c6..7f89ab2762c 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1,6 +1,7 @@
;;; sh-script.el --- shell-script editing commands for Emacs -*- lexical-binding:t -*-
-;; Copyright (C) 1993-1997, 1999, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1997, 1999, 2001-2016 Free Software Foundation,
+;; Inc.
;; Author: Daniel Pfeiffer <occitan@esperanto.org>
;; Version: 2.0f
@@ -2114,7 +2115,11 @@ May return nil if the line should not be treated as continued."
;; sh-indent-after-done: aligned completely differently.
(`(:after . "in") (sh-var-value 'sh-indent-for-case-label))
;; sh-indent-for-continuation: Line continuations are handled differently.
- (`(:after . ,(or `"(" `"{" `"[")) (sh-var-value 'sh-indent-after-open))
+ (`(:after . ,(or `"(" `"{" `"["))
+ (if (not (looking-at ".[ \t]*[^\n \t#]"))
+ (sh-var-value 'sh-indent-after-open)
+ (goto-char (1- (match-end 0)))
+ `(column . ,(current-column))))
;; sh-indent-after-function: we don't handle it differently.
))
diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el
index d3ee9b5b4b2..0c420dfbec6 100644
--- a/lisp/progmodes/simula.el
+++ b/lisp/progmodes/simula.el
@@ -1,6 +1,6 @@
;;; simula.el --- SIMULA 87 code editing commands for Emacs
-;; Copyright (C) 1992, 1994, 1996, 2001-2015 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1996, 2001-2016 Free Software Foundation,
;; Inc.
;; Author: Hans Henrik Eriksen <hhe@ifi.uio.no>
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 40596749de7..65e94bac5d3 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -1,6 +1,6 @@
;;; sql.el --- specialized comint.el for SQL interpreters -*- lexical-binding: t -*-
-;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2016 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
;; Maintainer: Michael Mauger <michael@mauger.com>
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index a279e294fec..102e0da2fef 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -1,6 +1,6 @@
;;; subword.el --- Handling capitalized subwords in a nomenclature -*- lexical-binding: t -*-
-;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2016 Free Software Foundation, Inc.
;; Author: Masatake YAMATO
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index e4e96554c95..93f329165a4 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -1,6 +1,6 @@
;;; tcl.el --- Tcl code editing commands for Emacs
-;; Copyright (C) 1994, 1998-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1998-2016 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Author: Tom Tromey <tromey@redhat.com>
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index 354002dd3b3..987022e8cb3 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -1,6 +1,6 @@
;;; vera-mode.el --- major mode for editing Vera files
-;; Copyright (C) 1997-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2016 Free Software Foundation, Inc.
;; Author: Reto Zimmermann <reto@gnu.org>
;; Maintainer: Reto Zimmermann <reto@gnu.org>
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 90145ddff8b..6b6cc643ffc 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -1,6 +1,6 @@
;;; verilog-mode.el --- major mode for editing verilog source in Emacs
-;; Copyright (C) 1996-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2016 Free Software Foundation, Inc.
;; Author: Michael McNamara <mac@verilog.com>
;; Wilson Snyder <wsnyder@wsnyder.org>
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 09330d76dcd..d20a6b2f682 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1,6 +1,6 @@
;;; vhdl-mode.el --- major mode for editing VHDL code
-;; Copyright (C) 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2016 Free Software Foundation, Inc.
;; Authors: Reto Zimmermann <reto@gnu.org>
;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 7e289b3ff5b..2fc24a8cb3d 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -1,6 +1,6 @@
;;; which-func.el --- print current function in mode line -*- lexical-binding:t -*-
-;; Copyright (C) 1994, 1997-1998, 2001-2015 Free Software Foundation,
+;; Copyright (C) 1994, 1997-1998, 2001-2016 Free Software Foundation,
;; Inc.
;; Author: Alex Rezinsky <alexr@msil.sps.mot.com>
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index abb9cc6361d..fe39122d24f 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,6 +1,6 @@
;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
-;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
@@ -19,6 +19,11 @@
;;; Commentary:
+;; NOTE: The xref API is still experimental and can change in major,
+;; backward-incompatible ways. Everyone is encouraged to try it, and
+;; report to us any problems or use cases we hadn't anticipated, by
+;; sending an email to emacs-devel, or `M-x report-emacs-bug'.
+;;
;; This file provides a somewhat generic infrastructure for cross
;; referencing commands, in particular "find-definition".
;;
@@ -203,7 +208,7 @@ LENGTH is the match length, in characters."
(defvar xref-backend-functions nil
"Special hook to find the xref backend for the current context.
-Each functions on this hook is called in turn with no arguments
+Each function on this hook is called in turn with no arguments,
and should return either nil to mean that it is not applicable,
or an xref backend, which is a value to be used to dispatch the
generic functions.")
@@ -497,10 +502,14 @@ WINDOW controls how the buffer is displayed:
(xref--pop-to-location xref window)))
(defun xref-query-replace (from to)
- "Perform interactive replacement in all current matches."
+ "Perform interactive replacement of FROM with TO in all displayed xrefs.
+
+This command interactively replaces FROM with TO in the names of the
+references displayed in the current *xref* buffer."
(interactive
- (list (read-regexp "Query replace regexp in matches" ".*")
- (read-regexp "Replace with: ")))
+ (let ((fr (read-regexp "Xref query-replace (regexp)" ".*")))
+ (list fr
+ (read-regexp (format "Xref query-replace (regexp) %s with: " fr)))))
(let (pairs item)
(unwind-protect
(progn
@@ -757,12 +766,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
With prefix argument or when there's no identifier at point,
prompt for it.
-If the backend has sufficient information to determine a unique
-definition for IDENTIFIER, it returns only that definition. If
-there are multiple possible definitions, it returns all of them.
-
-If the backend returns one definition, jump to it; otherwise,
-display the list in a buffer."
+If sufficient information is available to determine a unique
+definition for IDENTIFIER, display it in the selected window.
+Otherwise, display the list of the possible definitions in a
+buffer where the user can select from the list."
(interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier nil))
@@ -871,7 +878,9 @@ IGNORES is a list of glob patterns."
grep-find-template t t))
(grep-highlight-matches nil)
(command (xref--rgrep-command (xref--regexp-to-extended regexp)
- files dir ignores))
+ files
+ (expand-file-name dir)
+ ignores))
(orig-buffers (buffer-list))
(buf (get-buffer-create " *xref-grep*"))
(grep-re (caar grep-regexp-alist))
@@ -886,7 +895,7 @@ IGNORES is a list of glob patterns."
hits)))
(unwind-protect
(cl-mapcan (lambda (hit) (xref--collect-matches hit regexp))
- hits)
+ (nreverse hits))
;; TODO: Same as above.
(mapc #'kill-buffer
(cl-set-difference (buffer-list) orig-buffers)))))
@@ -907,23 +916,28 @@ IGNORES is a list of glob patterns."
" "
(shell-quote-argument ")"))
dir
- (concat
- (shell-quote-argument "(")
- " -path "
- (mapconcat
- (lambda (ignore)
- (when (string-match-p "/\\'" ignore)
- (setq ignore (concat ignore "*")))
- (if (string-match "\\`\\./" ignore)
- (setq ignore (replace-match dir t t ignore))
- (unless (string-prefix-p "*" ignore)
- (setq ignore (concat "*/" ignore))))
- (shell-quote-argument ignore))
- ignores
- " -o -path ")
- " "
- (shell-quote-argument ")")
- " -prune -o ")))
+ (xref--find-ignores-arguments ignores dir)))
+
+(defun xref--find-ignores-arguments (ignores dir)
+ ;; `shell-quote-argument' quotes the tilde as well.
+ (cl-assert (not (string-match-p "\\`~" dir)))
+ (concat
+ (shell-quote-argument "(")
+ " -path "
+ (mapconcat
+ (lambda (ignore)
+ (when (string-match-p "/\\'" ignore)
+ (setq ignore (concat ignore "*")))
+ (if (string-match "\\`\\./" ignore)
+ (setq ignore (replace-match dir t t ignore))
+ (unless (string-prefix-p "*" ignore)
+ (setq ignore (concat "*/" ignore))))
+ (shell-quote-argument ignore))
+ ignores
+ " -o -path ")
+ " "
+ (shell-quote-argument ")")
+ " -prune -o "))
(defun xref--regexp-to-extended (str)
(replace-regexp-in-string
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index cf61073b442..214f381971a 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -1,6 +1,6 @@
;;; xscheme.el --- run MIT Scheme under Emacs -*- lexical-binding: t; -*-
-;; Copyright (C) 1986-1987, 1989-1990, 2001-2015 Free Software
+;; Copyright (C) 1986-1987, 1989-1990, 2001-2016 Free Software
;; Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
@@ -1174,9 +1174,10 @@ the remaining input.")
(defun xscheme-prompt-for-expression-exit ()
(interactive)
- (if (eq (xscheme-region-expression-p (point-min) (point-max)) 'one)
+ (if (eq (xscheme-region-expression-p (minibuffer-prompt-end) (point-max))
+ 'one)
(exit-minibuffer)
- (error "input must be a single, complete expression")))
+ (error "Input must be a single, complete expression")))
(defun xscheme-region-expression-p (start end)
(save-excursion