aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-engine.el2
-rw-r--r--lisp/progmodes/compile.el9
-rw-r--r--lisp/progmodes/cperl-mode.el3
-rw-r--r--lisp/progmodes/ebnf2ps.el4
-rw-r--r--lisp/progmodes/elisp-mode.el10
-rw-r--r--lisp/progmodes/etags.el4
-rw-r--r--lisp/progmodes/idlw-help.el3
-rw-r--r--lisp/progmodes/idlw-shell.el7
-rw-r--r--lisp/progmodes/idlwave.el193
-rw-r--r--lisp/progmodes/perl-mode.el4
-rw-r--r--lisp/progmodes/project.el22
-rw-r--r--lisp/progmodes/python.el19
-rw-r--r--lisp/progmodes/subword.el2
-rw-r--r--lisp/progmodes/xref.el43
14 files changed, 97 insertions, 228 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index c3a98d9c5cf..7b8b174c430 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -384,7 +384,7 @@ comment at the start of cc-engine.el for more info."
384 c-macro-cache-syntactic nil 384 c-macro-cache-syntactic nil
385 c-macro-cache-no-comment nil)) 385 c-macro-cache-no-comment nil))
386 (save-match-data 386 (save-match-data
387 (let ((safe-pos (point))) ; a point ouside any literal. 387 (let ((safe-pos (point))) ; a point outside any literal.
388 ;; Move over stuff followed by a multiline block comment lacking 388 ;; Move over stuff followed by a multiline block comment lacking
389 ;; escaped newlines each time around this loop. 389 ;; escaped newlines each time around this loop.
390 (while 390 (while
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b9f417845f..a043bbcfa3c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -316,8 +316,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
316 (gcc-include 316 (gcc-include
317 "^\\(?:In file included \\| \\|\t\\)from \ 317 "^\\(?:In file included \\| \\|\t\\)from \
318\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\ 318\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\
319\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\(:\\)\\|\\(,\\|$\\)\\)?" 319\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\([:,]\\|$\\)\\)?"
320 1 2 3 (4 . 5)) 320 1 2 3 (nil . 4))
321 321
322 (ruby-Test::Unit 322 (ruby-Test::Unit
323 "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2) 323 "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
@@ -2417,12 +2417,9 @@ and runs `compilation-filter-hook'."
2417 &optional object limit) 2417 &optional object limit)
2418 (let (parsed res) 2418 (let (parsed res)
2419 (while (progn 2419 (while (progn
2420 ;; We parse the buffer here "on-demand" by chunks of 500 chars.
2421 ;; But we could also just parse the whole buffer.
2422 (compilation--ensure-parse 2420 (compilation--ensure-parse
2423 (setq parsed (max compilation--parsed 2421 (setq parsed (max compilation--parsed
2424 (min (+ position 500) 2422 (or limit (point-max)))))
2425 (or limit (point-max))))))
2426 (and (or (not (setq res (next-single-property-change 2423 (and (or (not (setq res (next-single-property-change
2427 position prop object limit))) 2424 position prop object limit)))
2428 (eq res limit)) 2425 (eq res limit))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6122caf5189..2d2713a36ab 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3979,6 +3979,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3979 (and (eq (preceding-char) ?.) 3979 (and (eq (preceding-char) ?.)
3980 (eq (char-after (- (point) 2)) ?.)) 3980 (eq (char-after (- (point) 2)) ?.))
3981 (bobp)) 3981 (bobp))
3982 ;; { $a++ / $b } doesn't start a regex, nor does $a--
3983 (not (and (memq (preceding-char) '(?+ ?-))
3984 (eq (preceding-char) (char-before (1- (point))))))
3982 ;; m|blah| ? foo : bar; 3985 ;; m|blah| ? foo : bar;
3983 (not 3986 (not
3984 (and (eq c ?\?) 3987 (and (eq c ?\?)
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 08cf802bcbe..22c70bf734d 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -4527,7 +4527,7 @@ end
4527 (let* ((ebnf-tree tree) 4527 (let* ((ebnf-tree tree)
4528 (ps-color-p (and ebnf-color-p (ps-color-device))) 4528 (ps-color-p (and ebnf-color-p (ps-color-device)))
4529 (ps-print-color-scale (if ps-color-p 4529 (ps-print-color-scale (if ps-color-p
4530 (float (car (ps-color-values "white"))) 4530 (float (car (color-values "white")))
4531 1.0)) 4531 1.0))
4532 (ebnf-total (length ebnf-tree)) 4532 (ebnf-total (length ebnf-tree))
4533 (ebnf-nprod 0) 4533 (ebnf-nprod 0)
@@ -4629,7 +4629,7 @@ end
4629 (let* ((ebnf-tree tree) 4629 (let* ((ebnf-tree tree)
4630 (ps-color-p (and ebnf-color-p (ps-color-device))) 4630 (ps-color-p (and ebnf-color-p (ps-color-device)))
4631 (ps-print-color-scale (if ps-color-p 4631 (ps-print-color-scale (if ps-color-p
4632 (float (car (ps-color-values "white"))) 4632 (float (car (color-values "white")))
4633 1.0)) 4633 1.0))
4634 ps-zebra-stripes ps-line-number ps-razzle-dazzle 4634 ps-zebra-stripes ps-line-number ps-razzle-dazzle
4635 ps-print-hook 4635 ps-print-hook
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2f44118edb5..21ba42a0fe1 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1420,10 +1420,12 @@ Intended for `eldoc-documentation-functions' (which see)."
1420(defun elisp-eldoc-var-docstring (callback &rest _ignored) 1420(defun elisp-eldoc-var-docstring (callback &rest _ignored)
1421 "Document variable at point. 1421 "Document variable at point.
1422Intended for `eldoc-documentation-functions' (which see)." 1422Intended for `eldoc-documentation-functions' (which see)."
1423 (let ((sym (elisp--current-symbol))) 1423 (let* ((sym (elisp--current-symbol))
1424 (when sym (funcall callback (elisp-get-var-docstring sym) 1424 (docstring (and sym (elisp-get-var-docstring sym))))
1425 :thing sym 1425 (when docstring
1426 :face 'font-lock-variable-name-face)))) 1426 (funcall callback docstring
1427 :thing sym
1428 :face 'font-lock-variable-name-face))))
1427 1429
1428(defun elisp-get-fnsym-args-string (sym &optional index) 1430(defun elisp-get-fnsym-args-string (sym &optional index)
1429 "Return a string containing the parameter list of the function SYM. 1431 "Return a string containing the parameter list of the function SYM.
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index edadbbdafc1..2c5c36504a9 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1424,6 +1424,10 @@ hits the start of file."
1424 (goto-func goto-tag-location-function) 1424 (goto-func goto-tag-location-function)
1425 tag tag-info pt) 1425 tag tag-info pt)
1426 (forward-line 1) 1426 (forward-line 1)
1427 ;; Exuberant ctags add a line starting with the DEL character;
1428 ;; skip past it.
1429 (when (looking-at "\177")
1430 (forward-line 1))
1427 (while (not (or (eobp) (looking-at "\f"))) 1431 (while (not (or (eobp) (looking-at "\f")))
1428 ;; We used to use explicit tags when available, but the current goto-func 1432 ;; We used to use explicit tags when available, but the current goto-func
1429 ;; can only handle implicit tags. 1433 ;; can only handle implicit tags.
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index d3a2308e06b..ec4fd58886a 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -267,7 +267,6 @@ support."
267(declare-function idlwave-find-class-definition "idlwave") 267(declare-function idlwave-find-class-definition "idlwave")
268(declare-function idlwave-find-inherited-class "idlwave") 268(declare-function idlwave-find-inherited-class "idlwave")
269(declare-function idlwave-find-struct-tag "idlwave") 269(declare-function idlwave-find-struct-tag "idlwave")
270(declare-function idlwave-get-buffer-visiting "idlwave")
271(declare-function idlwave-in-quote "idlwave") 270(declare-function idlwave-in-quote "idlwave")
272(declare-function idlwave-make-full-name "idlwave") 271(declare-function idlwave-make-full-name "idlwave")
273(declare-function idlwave-members-only "idlwave") 272(declare-function idlwave-members-only "idlwave")
@@ -880,7 +879,7 @@ This function can be used as `idlwave-extra-help-function'."
880 (setq in-buf ; structure-tag completion is always in current buffer 879 (setq in-buf ; structure-tag completion is always in current buffer
881 (if struct-tag 880 (if struct-tag
882 idlwave-current-tags-buffer 881 idlwave-current-tags-buffer
883 (idlwave-get-buffer-visiting file))) 882 (find-buffer-visiting file)))
884 ;; see if file is in a visited buffer, insert those contents 883 ;; see if file is in a visited buffer, insert those contents
885 (if in-buf 884 (if in-buf
886 (progn 885 (progn
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index f875915ca8e..99ac0877c8b 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -2640,7 +2640,7 @@ Assumes that `idlwave-shell-sources-alist' contains an entry for that module."
2640 (if (or (not source-file) 2640 (if (or (not source-file)
2641 (not (file-regular-p source-file)) 2641 (not (file-regular-p source-file))
2642 (not (setq buf 2642 (not (setq buf
2643 (or (idlwave-get-buffer-visiting source-file) 2643 (or (find-buffer-visiting source-file)
2644 (find-file-noselect source-file))))) 2644 (find-file-noselect source-file)))))
2645 (progn 2645 (progn
2646 (message "The source file for module %s is probably not compiled" 2646 (message "The source file for module %s is probably not compiled"
@@ -3241,8 +3241,7 @@ Does not work for a region with multiline blocks - use
3241 "Delete the temporary files and kill associated buffers." 3241 "Delete the temporary files and kill associated buffers."
3242 (if (stringp idlwave-shell-temp-pro-file) 3242 (if (stringp idlwave-shell-temp-pro-file)
3243 (condition-case nil 3243 (condition-case nil
3244 (let ((buf (idlwave-get-buffer-visiting 3244 (let ((buf (find-buffer-visiting idlwave-shell-temp-pro-file)))
3245 idlwave-shell-temp-pro-file)))
3246 (if (buffer-live-p buf) 3245 (if (buffer-live-p buf)
3247 (kill-buffer buf)) 3246 (kill-buffer buf))
3248 (delete-file idlwave-shell-temp-pro-file)) 3247 (delete-file idlwave-shell-temp-pro-file))
@@ -3788,7 +3787,7 @@ handled by this command."
3788 (save-buffer) 3787 (save-buffer)
3789 (setq idlwave-shell-last-save-and-action-file (buffer-file-name))) 3788 (setq idlwave-shell-last-save-and-action-file (buffer-file-name)))
3790 (idlwave-shell-last-save-and-action-file 3789 (idlwave-shell-last-save-and-action-file
3791 (if (setq buf (idlwave-get-buffer-visiting 3790 (if (setq buf (find-buffer-visiting
3792 idlwave-shell-last-save-and-action-file)) 3791 idlwave-shell-last-save-and-action-file))
3793 (with-current-buffer buf 3792 (with-current-buffer buf
3794 (save-buffer)))) 3793 (save-buffer))))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index f7e53ec02d6..153f2578bf1 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -581,12 +581,7 @@ like this:
581MyMethod <Class1,Class2,Class3> 581MyMethod <Class1,Class2,Class3>
582 582
583The value of this variable may be nil to inhibit display, or an integer to 583The value of this variable may be nil to inhibit display, or an integer to
584indicate the maximum number of classes to display. 584indicate the maximum number of classes to display."
585
586On XEmacs, a full list of classes will also be placed into a `help-echo'
587property on the completion items, so that the list of classes for the current
588item is displayed in the echo area. If the value of this variable is a
589negative integer, the `help-echo' property will be suppressed."
590 :group 'idlwave-completion 585 :group 'idlwave-completion
591 :type '(choice (const :tag "Don't show" nil) 586 :type '(choice (const :tag "Don't show" nil)
592 (integer :tag "Number of classes shown" 1))) 587 (integer :tag "Number of classes shown" 1)))
@@ -1054,7 +1049,6 @@ goto Goto Statements
1054common-blocks Common Blocks 1049common-blocks Common Blocks
1055keyword-parameters Keyword Parameters in routine definitions and calls 1050keyword-parameters Keyword Parameters in routine definitions and calls
1056system-variables System Variables 1051system-variables System Variables
1057fixme FIXME: Warning in comments (on XEmacs only v. 21.0 and up)
1058class-arrows Object Arrows with class property" 1052class-arrows Object Arrows with class property"
1059 :group 'idlwave-misc 1053 :group 'idlwave-misc
1060 :type '(set 1054 :type '(set
@@ -1069,7 +1063,6 @@ class-arrows Object Arrows with class property"
1069 (const :tag "Common Blocks" common-blocks) 1063 (const :tag "Common Blocks" common-blocks)
1070 (const :tag "Keyword Parameters" keyword-parameters) 1064 (const :tag "Keyword Parameters" keyword-parameters)
1071 (const :tag "System Variables" system-variables) 1065 (const :tag "System Variables" system-variables)
1072 (const :tag "FIXME: Warning" fixme)
1073 (const :tag "Object Arrows with class property " class-arrows))) 1066 (const :tag "Object Arrows with class property " class-arrows)))
1074 1067
1075(defcustom idlwave-mode-hook nil 1068(defcustom idlwave-mode-hook nil
@@ -1138,23 +1131,16 @@ As a user, you should not set this to t.")
1138 ;; Common blocks 1131 ;; Common blocks
1139 (common-blocks 1132 (common-blocks
1140 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?" 1133 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?"
1141 (1 font-lock-keyword-face) ; "common" 1134 (1 font-lock-keyword-face) ; "common"
1142 (2 font-lock-constant-face nil t) ; block name 1135 (2 font-lock-constant-face nil t) ; block name
1143 ("[ \t]*\\(\\sw+\\)[ ,]*" 1136 ("[ \t]*\\(\\sw+\\)[ ,]*"
1144 ;; Start with point after block name and comma 1137 ;; Start with point after block name and comma
1145 (goto-char (match-end 0)) ; needed for XEmacs, could be nil 1138 nil nil (1 font-lock-variable-name-face)))) ; variable names
1146 nil
1147 (1 font-lock-variable-name-face) ; variable names
1148 )))
1149 1139
1150 ;; Batch files 1140 ;; Batch files
1151 (batch-files 1141 (batch-files
1152 '("^[ \t]*\\(@[^ \t\n]+\\)" (1 font-lock-string-face))) 1142 '("^[ \t]*\\(@[^ \t\n]+\\)" (1 font-lock-string-face)))
1153 1143
1154 ;; FIXME warning.
1155 (fixme
1156 '("\\<FIXME:" (0 font-lock-warning-face t)))
1157
1158 ;; Labels 1144 ;; Labels
1159 (label 1145 (label
1160 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face))) 1146 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face)))
@@ -1241,9 +1227,6 @@ As a user, you should not set this to t.")
1241 ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) 1227 ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
1242 beginning-of-line)) 1228 beginning-of-line))
1243 1229
1244(put 'idlwave-mode 'font-lock-defaults
1245 idlwave-font-lock-defaults) ; XEmacs
1246
1247(defconst idlwave-comment-line-start-skip "^[ \t]*;" 1230(defconst idlwave-comment-line-start-skip "^[ \t]*;"
1248 "Regexp to match the start of a full-line comment. 1231 "Regexp to match the start of a full-line comment.
1249That is the _beginning_ of a line containing a comment delimiter `;' preceded 1232That is the _beginning_ of a line containing a comment delimiter `;' preceded
@@ -1479,9 +1462,7 @@ Otherwise ARGS forms a list that is evaluated."
1479 (define-key map "\M-\C-i" 'idlwave-complete) 1462 (define-key map "\M-\C-i" 'idlwave-complete)
1480 (define-key map "\C-c\C-i" 'idlwave-update-routine-info) 1463 (define-key map "\C-c\C-i" 'idlwave-update-routine-info)
1481 (define-key map "\C-c=" 'idlwave-resolve) 1464 (define-key map "\C-c=" 'idlwave-resolve)
1482 (define-key map 1465 (define-key map [(shift mouse-3)] 'idlwave-mouse-context-help)
1483 (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
1484 'idlwave-mouse-context-help)
1485 map) 1466 map)
1486 "Keymap used in IDL mode.") 1467 "Keymap used in IDL mode.")
1487 1468
@@ -1916,8 +1897,6 @@ The main features of this mode are
1916 (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS"))) 1897 (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
1917 1898
1918 ;; Font-lock additions 1899 ;; Font-lock additions
1919 ;; Following line is for Emacs - XEmacs uses the corresponding property
1920 ;; on the `idlwave-mode' symbol.
1921 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults) 1900 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
1922 (set (make-local-variable 'font-lock-mark-block-function) 1901 (set (make-local-variable 'font-lock-mark-block-function)
1923 'idlwave-mark-subprogram) 1902 'idlwave-mark-subprogram)
@@ -3814,15 +3793,8 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
3814 (setq start (match-end 0))) 3793 (setq start (match-end 0)))
3815 (setq ret_string (concat ret_string (substring string start last))))) 3794 (setq ret_string (concat ret_string (substring string start last)))))
3816 3795
3817(defun idlwave-get-buffer-visiting (file) 3796(define-obsolete-function-alias 'idlwave-get-buffer-visiting
3818 ;; Return the buffer currently visiting FILE 3797 #'find-buffer-visiting "28.1")
3819 (cond
3820 ((boundp 'find-file-compare-truenames) ; XEmacs
3821 (let ((find-file-compare-truenames t))
3822 (get-file-buffer file)))
3823 ((fboundp 'find-buffer-visiting) ; Emacs
3824 (find-buffer-visiting file))
3825 (t (error "This should not happen (idlwave-get-buffer-visiting)"))))
3826 3798
3827(defvar idlwave-outlawed-buffers nil 3799(defvar idlwave-outlawed-buffers nil
3828 "List of buffers pulled up by IDLWAVE for special reasons. 3800 "List of buffers pulled up by IDLWAVE for special reasons.
@@ -3830,7 +3802,7 @@ Buffers in this list may be killed by `idlwave-kill-autoloaded-buffers'.")
3830 3802
3831(defun idlwave-find-file-noselect (file &optional why) 3803(defun idlwave-find-file-noselect (file &optional why)
3832 ;; Return a buffer visiting file. 3804 ;; Return a buffer visiting file.
3833 (or (idlwave-get-buffer-visiting file) 3805 (or (find-buffer-visiting file)
3834 (let ((buf (find-file-noselect file))) 3806 (let ((buf (find-file-noselect file)))
3835 (if why (add-to-list 'idlwave-outlawed-buffers (cons buf why))) 3807 (if why (add-to-list 'idlwave-outlawed-buffers (cons buf why)))
3836 buf))) 3808 buf)))
@@ -6618,7 +6590,6 @@ This function is not general, can only be used for completion stuff."
6618 "A form to evaluate after completion selection in *Completions* buffer.") 6590 "A form to evaluate after completion selection in *Completions* buffer.")
6619(defconst idlwave-completion-mark (make-marker) 6591(defconst idlwave-completion-mark (make-marker)
6620 "A mark pointing to the beginning of the completion string.") 6592 "A mark pointing to the beginning of the completion string.")
6621(defvar completion-highlight-first-word-only) ;XEmacs.
6622 6593
6623(defun idlwave-complete-in-buffer (type stype list selector prompt isa 6594(defun idlwave-complete-in-buffer (type stype list selector prompt isa
6624 &optional prepare-display-function 6595 &optional prepare-display-function
@@ -6697,12 +6668,7 @@ accumulate information on matching completions."
6697 list)) 6668 list))
6698 (let* ((list all-completions) 6669 (let* ((list all-completions)
6699 ;; "complete" means, this is already a valid completion 6670 ;; "complete" means, this is already a valid completion
6700 (complete (memq spart all-completions)) 6671 (complete (memq spart all-completions)))
6701 (completion-highlight-first-word-only t)) ; XEmacs
6702 ;; (completion-fixup-function ; Emacs
6703 ;; (lambda () (and (eq (preceding-char) ?>)
6704 ;; (re-search-backward " <" beg t)))))
6705
6706 (setq list (sort list (lambda (a b) 6672 (setq list (sort list (lambda (a b)
6707 (string< (downcase a) (downcase b))))) 6673 (string< (downcase a) (downcase b)))))
6708 (if prepare-display-function 6674 (if prepare-display-function
@@ -6764,7 +6730,6 @@ accumulate information on matching completions."
6764 (let* ((do-prop (and (>= show-classes 0) 6730 (let* ((do-prop (and (>= show-classes 0)
6765 (>= emacs-major-version 21))) 6731 (>= emacs-major-version 21)))
6766 (do-buf (not (= show-classes 0))) 6732 (do-buf (not (= show-classes 0)))
6767 ;; (do-dots (featurep 'xemacs))
6768 (do-dots t) 6733 (do-dots t)
6769 (inherit (if (and (not (eq type 'class-tag)) super-classes) 6734 (inherit (if (and (not (eq type 'class-tag)) super-classes)
6770 (cons class-selector super-classes))) 6735 (cons class-selector super-classes)))
@@ -6830,10 +6795,6 @@ accumulate information on matching completions."
6830;;---------------------------------------------------------------------- 6795;;----------------------------------------------------------------------
6831;;---------------------------------------------------------------------- 6796;;----------------------------------------------------------------------
6832;;---------------------------------------------------------------------- 6797;;----------------------------------------------------------------------
6833(when (featurep 'xemacs)
6834 (defvar rtn)
6835 (defun idlwave-pset (item)
6836 (set 'rtn item)))
6837 6798
6838(defun idlwave-popup-select (ev list title &optional sort) 6799(defun idlwave-popup-select (ev list title &optional sort)
6839 "Select an item in LIST with a popup menu. 6800 "Select an item in LIST with a popup menu.
@@ -6844,17 +6805,6 @@ sort the list before displaying."
6844 (cond ((null list)) 6805 (cond ((null list))
6845 ((= 1 (length list)) 6806 ((= 1 (length list))
6846 (setq rtn (car list))) 6807 (setq rtn (car list)))
6847 ((featurep 'xemacs)
6848 (if sort (setq list (sort list (lambda (a b)
6849 (string< (upcase a) (upcase b))))))
6850 (setq menu
6851 (append (list title)
6852 (mapcar (lambda (x) (vector x (list 'idlwave-pset
6853 x)))
6854 list)))
6855 (setq menu (idlwave-split-menu-xemacs menu maxpopup))
6856 (let ((resp (get-popup-menu-response menu)))
6857 (funcall (event-function resp) (event-object resp))))
6858 (t 6808 (t
6859 (if sort (setq list (sort list (lambda (a b) 6809 (if sort (setq list (sort list (lambda (a b)
6860 (string< (upcase a) (upcase b)))))) 6810 (string< (upcase a) (upcase b))))))
@@ -6862,36 +6812,14 @@ sort the list before displaying."
6862 (list 6812 (list
6863 (append (list "") 6813 (append (list "")
6864 (mapcar (lambda(x) (cons x x)) list))))) 6814 (mapcar (lambda(x) (cons x x)) list)))))
6865 (setq menu (idlwave-split-menu-emacs menu maxpopup)) 6815 (setq menu (idlwave-split-menu menu maxpopup))
6866 (setq rtn (x-popup-menu ev menu)))) 6816 (setq rtn (x-popup-menu ev menu))))
6867 rtn)) 6817 rtn))
6868 6818
6869(defun idlwave-split-menu-xemacs (menu N) 6819(define-obsolete-function-alias 'idlwave-split-menu-emacs
6870 "Split the MENU into submenus of maximum length N." 6820 #'idlwave-split-menu "28.1")
6871 (if (<= (length menu) (1+ N))
6872 ;; No splitting needed
6873 menu
6874 (let* ((title (car menu))
6875 (entries (cdr menu))
6876 (menu (list title))
6877 (cnt 0)
6878 (nextmenu nil))
6879 (while entries
6880 (while (and entries (< cnt N))
6881 (setq cnt (1+ cnt)
6882 nextmenu (cons (car entries) nextmenu)
6883 entries (cdr entries)))
6884 (setq nextmenu (nreverse nextmenu))
6885 (setq nextmenu (cons (format "%s...%s"
6886 (aref (car nextmenu) 0)
6887 (aref (nth (1- cnt) nextmenu) 0))
6888 nextmenu))
6889 (setq menu (cons nextmenu menu)
6890 nextmenu nil
6891 cnt 0))
6892 (nreverse menu))))
6893 6821
6894(defun idlwave-split-menu-emacs (menu N) 6822(defun idlwave-split-menu (menu N)
6895 "Split the MENU into submenus of maximum length N." 6823 "Split the MENU into submenus of maximum length N."
6896 (if (<= (length (nth 1 menu)) (1+ N)) 6824 (if (<= (length (nth 1 menu)) (1+ N))
6897 ;; No splitting needed 6825 ;; No splitting needed
@@ -6946,10 +6874,7 @@ sort the list before displaying."
6946 (move-marker idlwave-completion-mark beg) 6874 (move-marker idlwave-completion-mark beg)
6947 (setq idlwave-before-completion-wconf (current-window-configuration))) 6875 (setq idlwave-before-completion-wconf (current-window-configuration)))
6948 6876
6949 (if (featurep 'xemacs) 6877 (idlwave-display-completion-list-1 list)
6950 (idlwave-display-completion-list-xemacs
6951 list)
6952 (idlwave-display-completion-list-emacs list))
6953 6878
6954 ;; Store a special value in `this-command'. When `idlwave-complete' 6879 ;; Store a special value in `this-command'. When `idlwave-complete'
6955 ;; finds this in `last-command', it will scroll the *Completions* buffer. 6880 ;; finds this in `last-command', it will scroll the *Completions* buffer.
@@ -7007,8 +6932,7 @@ The key which is associated with each option is generated automatically.
7007First, the strings are checked for preselected keys, like in \"[P]rint\". 6932First, the strings are checked for preselected keys, like in \"[P]rint\".
7008If these don't exist, a letter in the string is automatically selected." 6933If these don't exist, a letter in the string is automatically selected."
7009 (let* ((alist (symbol-value sym)) 6934 (let* ((alist (symbol-value sym))
7010 (temp-buffer-show-hook (if (fboundp 'fit-window-to-buffer) 6935 (temp-buffer-show-hook '(fit-window-to-buffer))
7011 '(fit-window-to-buffer)))
7012 keys-alist char) 6936 keys-alist char)
7013 ;; First check the cache 6937 ;; First check the cache
7014 (if (and (eq (symbol-value sym) (get sym :one-key-alist-last))) 6938 (if (and (eq (symbol-value sym) (get sym :one-key-alist-last)))
@@ -7094,42 +7018,17 @@ If these don't exist, a letter in the string is automatically selected."
7094 (and (local-variable-p var (current-buffer)) 7018 (and (local-variable-p var (current-buffer))
7095 (symbol-value var)))) 7019 (symbol-value var))))
7096 7020
7097;; In XEmacs, we can use :activate-callback directly to advice the
7098;; choose functions. We use the private keymap only for the online
7099;; help feature.
7100
7101(defvar idlwave-completion-map nil 7021(defvar idlwave-completion-map nil
7102 "Keymap for `completion-list-mode' with `idlwave-complete'.") 7022 "Keymap for `completion-list-mode' with `idlwave-complete'.")
7103 7023
7104(defun idlwave-display-completion-list-xemacs (list &rest cl-args)
7105 (with-output-to-temp-buffer "*Completions*"
7106 (apply 'display-completion-list list
7107 ':activate-callback 'idlwave-default-choose-completion
7108 cl-args))
7109 (with-current-buffer "*Completions*"
7110 (use-local-map
7111 (or idlwave-completion-map
7112 (setq idlwave-completion-map
7113 (idlwave-make-modified-completion-map-xemacs
7114 (current-local-map)))))))
7115
7116(defun idlwave-default-choose-completion (&rest args) 7024(defun idlwave-default-choose-completion (&rest args)
7117 "Execute `default-choose-completion' and then restore the win-conf." 7025 "Execute `default-choose-completion' and then restore the win-conf."
7118 (apply 'idlwave-choose 'default-choose-completion args)) 7026 (apply 'idlwave-choose 'default-choose-completion args))
7119 7027
7120(defun idlwave-make-modified-completion-map-xemacs (old-map) 7028(define-obsolete-function-alias 'idlwave-display-completion-list-emacs
7121 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." 7029 #'idlwave-display-completion-list-1 "28.1")
7122 (let ((new-map (copy-keymap old-map)))
7123 (define-key new-map [button3up] 'idlwave-mouse-completion-help)
7124 (define-key new-map [button3] (lambda ()
7125 (interactive)
7126 (setq this-command last-command)))
7127 new-map))
7128
7129;; In Emacs we also replace keybindings in the completion
7130;; map in order to install our wrappers.
7131 7030
7132(defun idlwave-display-completion-list-emacs (list) 7031(defun idlwave-display-completion-list-1 (list)
7133 "Display completion list and install the choose wrappers." 7032 "Display completion list and install the choose wrappers."
7134 (with-output-to-temp-buffer "*Completions*" 7033 (with-output-to-temp-buffer "*Completions*"
7135 (display-completion-list list)) 7034 (display-completion-list list))
@@ -7137,10 +7036,12 @@ If these don't exist, a letter in the string is automatically selected."
7137 (use-local-map 7036 (use-local-map
7138 (or idlwave-completion-map 7037 (or idlwave-completion-map
7139 (setq idlwave-completion-map 7038 (setq idlwave-completion-map
7140 (idlwave-make-modified-completion-map-emacs 7039 (idlwave-make-modified-completion-map (current-local-map)))))))
7141 (current-local-map)))))))
7142 7040
7143(defun idlwave-make-modified-completion-map-emacs (old-map) 7041(define-obsolete-function-alias 'idlwave-make-modified-completion-map-emacs
7042 #'idlwave-make-modified-completion-map "28.1")
7043
7044(defun idlwave-make-modified-completion-map (old-map)
7144 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." 7045 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP."
7145 (let ((new-map (copy-keymap old-map))) 7046 (let ((new-map (copy-keymap old-map)))
7146 (substitute-key-definition 7047 (substitute-key-definition
@@ -7352,7 +7253,7 @@ class/struct definition."
7352 (file (idlwave-routine-source-file 7253 (file (idlwave-routine-source-file
7353 (nth 3 (idlwave-rinfo-assoc pro 'pro nil 7254 (nth 3 (idlwave-rinfo-assoc pro 'pro nil
7354 (idlwave-routines)))))) 7255 (idlwave-routines))))))
7355 (cons file (if file (idlwave-get-buffer-visiting file))))) 7256 (cons file (if file (find-buffer-visiting file)))))
7356 7257
7357 7258
7358(defun idlwave-scan-class-info (class) 7259(defun idlwave-scan-class-info (class)
@@ -8223,15 +8124,9 @@ If we do not know about MODULE, just return KEYWORD literally."
8223 8124
8224(defvar idlwave-rinfo-mouse-map 8125(defvar idlwave-rinfo-mouse-map
8225 (let ((map (make-sparse-keymap))) 8126 (let ((map (make-sparse-keymap)))
8226 (define-key map 8127 (define-key map [mouse-2] 'idlwave-mouse-active-rinfo)
8227 (if (featurep 'xemacs) [button2] [mouse-2]) 8128 (define-key map [(shift mouse-2)] 'idlwave-mouse-active-rinfo-shift)
8228 'idlwave-mouse-active-rinfo) 8129 (define-key map [mouse-3] 'idlwave-mouse-active-rinfo-right)
8229 (define-key map
8230 (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)])
8231 'idlwave-mouse-active-rinfo-shift)
8232 (define-key map
8233 (if (featurep 'xemacs) [button3] [mouse-3])
8234 'idlwave-mouse-active-rinfo-right)
8235 (define-key map " " 'idlwave-active-rinfo-space) 8130 (define-key map " " 'idlwave-active-rinfo-space)
8236 (define-key map "q" 'idlwave-quit-help) 8131 (define-key map "q" 'idlwave-quit-help)
8237 map)) 8132 map))
@@ -8283,7 +8178,6 @@ If we do not know about MODULE, just return KEYWORD literally."
8283 "Button2: Display info about same method in superclass") 8178 "Button2: Display info about same method in superclass")
8284 (col 0) 8179 (col 0)
8285 (data (list name type class (current-buffer) nil initial-class)) 8180 (data (list name type class (current-buffer) nil initial-class))
8286 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
8287 (face 'idlwave-help-link) 8181 (face 'idlwave-help-link)
8288 beg props win cnt total) 8182 beg props win cnt total)
8289 ;; Fix keywords, but don't add chained super-classes, since these 8183 ;; Fix keywords, but don't add chained super-classes, since these
@@ -8308,7 +8202,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8308 idlwave-current-obj_new-class) 8202 idlwave-current-obj_new-class)
8309 (when superclasses 8203 (when superclasses
8310 (setq props (list 'mouse-face 'highlight 8204 (setq props (list 'mouse-face 'highlight
8311 km-prop idlwave-rinfo-mouse-map 8205 'local-map idlwave-rinfo-mouse-map
8312 'help-echo help-echo-class 8206 'help-echo help-echo-class
8313 'data (cons 'class data))) 8207 'data (cons 'class data)))
8314 (let ((classes (cons initial-class superclasses)) c) 8208 (let ((classes (cons initial-class superclasses)) c)
@@ -8324,7 +8218,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8324 (add-text-properties beg (point) props)))) 8218 (add-text-properties beg (point) props))))
8325 (insert "\n"))) 8219 (insert "\n")))
8326 (setq props (list 'mouse-face 'highlight 8220 (setq props (list 'mouse-face 'highlight
8327 km-prop idlwave-rinfo-mouse-map 8221 'local-map idlwave-rinfo-mouse-map
8328 'help-echo help-echo-use 8222 'help-echo help-echo-use
8329 'data (cons 'usage data))) 8223 'data (cons 'usage data)))
8330 (if html-file (setq props (append (list 'face face 'link html-file) 8224 (if html-file (setq props (append (list 'face face 'link html-file)
@@ -8352,7 +8246,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8352 (setq beg (point) 8246 (setq beg (point)
8353 ;; Relevant keywords already have link property attached 8247 ;; Relevant keywords already have link property attached
8354 props (list 'mouse-face 'highlight 8248 props (list 'mouse-face 'highlight
8355 km-prop idlwave-rinfo-mouse-map 8249 'local-map idlwave-rinfo-mouse-map
8356 'data (cons 'keyword data) 8250 'data (cons 'keyword data)
8357 'help-echo help-echo-kwd 8251 'help-echo help-echo-kwd
8358 'keyword (car x))) 8252 'keyword (car x)))
@@ -8366,7 +8260,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8366 ;; Here entry is (key file (list of type-conses)) 8260 ;; Here entry is (key file (list of type-conses))
8367 (while (setq entry (pop all)) 8261 (while (setq entry (pop all))
8368 (setq props (list 'mouse-face 'highlight 8262 (setq props (list 'mouse-face 'highlight
8369 km-prop idlwave-rinfo-mouse-map 8263 'local-map idlwave-rinfo-mouse-map
8370 'help-echo help-echo-src 8264 'help-echo help-echo-src
8371 'source (list (car (car (nth 2 entry))) ;type 8265 'source (list (car (car (nth 2 entry))) ;type
8372 (nth 1 entry) 8266 (nth 1 entry)
@@ -8471,8 +8365,7 @@ to it."
8471 (add-text-properties beg (point) (list 'face 'bold))) 8365 (add-text-properties beg (point) (list 'face 'bold)))
8472 (when (and file (not (equal file ""))) 8366 (when (and file (not (equal file "")))
8473 (setq beg (point)) 8367 (setq beg (point))
8474 (insert (apply 'abbreviate-file-name 8368 (insert (apply 'abbreviate-file-name (list file)))
8475 (if (featurep 'xemacs) (list file t) (list file))))
8476 (if file-props 8369 (if file-props
8477 (add-text-properties beg (point) file-props))))) 8370 (add-text-properties beg (point) file-props)))))
8478 8371
@@ -8632,10 +8525,9 @@ can be used to detect possible name clashes during this process."
8632 idlwave-user-catalog-routines 8525 idlwave-user-catalog-routines
8633 idlwave-buffer-routines 8526 idlwave-buffer-routines
8634 nil)) 8527 nil))
8635 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
8636 (keymap (make-sparse-keymap)) 8528 (keymap (make-sparse-keymap))
8637 (props (list 'mouse-face 'highlight 8529 (props (list 'mouse-face 'highlight
8638 km-prop keymap 8530 'local-map keymap
8639 'help-echo "Mouse2: Find source")) 8531 'help-echo "Mouse2: Find source"))
8640 (nroutines (length (or special-routines routines))) 8532 (nroutines (length (or special-routines routines)))
8641 (step (/ nroutines 100)) 8533 (step (/ nroutines 100))
@@ -8658,7 +8550,7 @@ can be used to detect possible name clashes during this process."
8658 (nth 2 b) (car b))))))) 8550 (nth 2 b) (car b)))))))
8659 (message "Sorting routines...done") 8551 (message "Sorting routines...done")
8660 8552
8661 (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)]) 8553 (define-key keymap [(mouse-2)]
8662 (lambda (ev) 8554 (lambda (ev)
8663 (interactive "e") 8555 (interactive "e")
8664 (mouse-set-point ev) 8556 (mouse-set-point ev)
@@ -9020,23 +8912,6 @@ Assumes that point is at the beginning of the unit as found by
9020 'imenu) 8912 'imenu)
9021 (error nil))))) 8913 (error nil)))))
9022 8914
9023;; Here we hack func-menu.el in order to support this new mode.
9024;; The latest versions of func-menu.el already have this stuff in, so
9025;; we hack only if it is not already there.
9026(when (featurep 'xemacs)
9027 (eval-after-load "func-menu"
9028 '(progn
9029 (or (assq 'idlwave-mode fume-function-name-regexp-alist)
9030 (not (boundp 'fume-function-name-regexp-idl)) ; avoid problems
9031 (setq fume-function-name-regexp-alist
9032 (cons '(idlwave-mode . fume-function-name-regexp-idl)
9033 fume-function-name-regexp-alist)))
9034 (or (assq 'idlwave-mode fume-find-function-name-method-alist)
9035 (not (fboundp 'fume-find-next-idl-function-name)) ; avoid problems
9036 (setq fume-find-function-name-method-alist
9037 (cons '(idlwave-mode . fume-find-next-idl-function-name)
9038 fume-find-function-name-method-alist))))))
9039
9040(defun idlwave-edit-in-idlde () 8915(defun idlwave-edit-in-idlde ()
9041 "Edit the current file in IDL Development environment." 8916 "Edit the current file in IDL Development environment."
9042 (interactive) 8917 (interactive)
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index ff0b6a331bc..127b24cb890 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -214,7 +214,9 @@
214 (defconst perl--syntax-exp-intro-regexp 214 (defconst perl--syntax-exp-intro-regexp
215 (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" 215 (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
216 (regexp-opt perl--syntax-exp-intro-keywords) 216 (regexp-opt perl--syntax-exp-intro-keywords)
217 "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*"))) 217 "\\|[?:.,;|&*=!~({[]"
218 "\\|[^-+][-+]" ;Bug#42168: `+' is intro but `++' isn't!
219 "\\|\\(^\\)\\)[ \t\n]*")))
218 220
219(defun perl-syntax-propertize-function (start end) 221(defun perl-syntax-propertize-function (start end)
220 (let ((case-fold-search nil)) 222 (let ((case-fold-search nil))
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index b6161351f0b..8afd5ce7959 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,8 +1,8 @@
1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- 1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2015-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
4;; Version: 0.5.0 4;; Version: 0.5.1
5;; Package-Requires: ((emacs "26.3")) 5;; Package-Requires: ((emacs "26.3") (xref "1.0.2"))
6 6
7;; This is a GNU ELPA :core package. Avoid using functionality that 7;; This is a GNU ELPA :core package. Avoid using functionality that
8;; not compatible with the version of Emacs recorded above. 8;; not compatible with the version of Emacs recorded above.
@@ -731,24 +731,6 @@ pattern to search for."
731 (user-error "No matches for: %s" regexp)) 731 (user-error "No matches for: %s" regexp))
732 xrefs)) 732 xrefs))
733 733
734(defun project--process-file-region (start end program
735 &optional buffer display
736 &rest args)
737 ;; FIXME: This branching shouldn't be necessary, but
738 ;; call-process-region *is* measurably faster, even for a program
739 ;; doing some actual work (for a period of time). Even though
740 ;; call-process-region also creates a temp file internally
741 ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html).
742 (if (not (file-remote-p default-directory))
743 (apply #'call-process-region
744 start end program nil buffer display args)
745 (let ((infile (make-temp-file "ppfr")))
746 (unwind-protect
747 (progn
748 (write-region start end infile nil 'silent)
749 (apply #'process-file program infile buffer display args))
750 (delete-file infile)))))
751
752(defun project--read-regexp () 734(defun project--read-regexp ()
753 (let ((sym (thing-at-point 'symbol))) 735 (let ((sym (thing-at-point 'symbol)))
754 (read-regexp "Find regexp" (and sym (regexp-quote sym))))) 736 (read-regexp "Find regexp" (and sym (regexp-quote sym)))))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3af55be4a19..d83af83b32e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -283,24 +283,6 @@
283 :link '(emacs-commentary-link "python")) 283 :link '(emacs-commentary-link "python"))
284 284
285 285
286;;; 24.x Compat
287
288
289(eval-and-compile
290 (unless (fboundp 'prog-first-column)
291 (defun prog-first-column ()
292 0))
293 (unless (fboundp 'file-local-name)
294 (defun file-local-name (file)
295 "Return the local name component of FILE.
296It returns a file name which can be used directly as argument of
297`process-file', `start-file-process', or `shell-command'."
298 (or (file-remote-p file 'localname) file))))
299
300;; In Emacs 24.3 and earlier, `define-derived-mode' does not define
301;; the hook variable, it only puts documentation on the symbol.
302(defvar inferior-python-mode-hook)
303
304 286
305;;; Bindings 287;;; Bindings
306 288
@@ -2809,6 +2791,7 @@ variable.
2809 python-shell-comint-watch-for-first-prompt-output-filter 2791 python-shell-comint-watch-for-first-prompt-output-filter
2810 python-comint-postoutput-scroll-to-bottom 2792 python-comint-postoutput-scroll-to-bottom
2811 comint-watch-for-password-prompt)) 2793 comint-watch-for-password-prompt))
2794 (setq-local comint-highlight-input nil)
2812 (set (make-local-variable 'compilation-error-regexp-alist) 2795 (set (make-local-variable 'compilation-error-regexp-alist)
2813 python-shell-compilation-regexp-alist) 2796 python-shell-compilation-regexp-alist)
2814 (add-hook 'completion-at-point-functions 2797 (add-hook 'completion-at-point-functions
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index f9b069fd4e5..0f2c9431f6e 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -115,6 +115,8 @@ treat nomenclature boundaries as word boundaries."
115 (when subword-mode (superword-mode -1)) 115 (when subword-mode (superword-mode -1))
116 (subword-setup-buffer)) 116 (subword-setup-buffer))
117 117
118;; This is defined also in cc-cmds.el, but as obsolete since 24.3.
119;; Let's keep this until the other one can also be removed.
118(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2") 120(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2")
119 121
120;;;###autoload 122;;;###autoload
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 3e3a37f6da5..bbf899e7017 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,8 +1,8 @@
1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- 1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
2 2
3;; Copyright (C) 2014-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
4;; Version: 1.0.1 4;; Version: 1.0.2
5;; Package-Requires: ((emacs "26.3") (project "0.1.1")) 5;; Package-Requires: ((emacs "26.3"))
6 6
7;; This is a GNU ELPA :core package. Avoid functionality that is not 7;; This is a GNU ELPA :core package. Avoid functionality that is not
8;; compatible with the version of Emacs recorded above. 8;; compatible with the version of Emacs recorded above.
@@ -263,13 +263,16 @@ be found, return nil.
263 263
264The default implementation uses `semantic-symref-tool-alist' to 264The default implementation uses `semantic-symref-tool-alist' to
265find a search tool; by default, this uses \"find | grep\" in the 265find a search tool; by default, this uses \"find | grep\" in the
266`project-current' roots." 266current project's main and external roots."
267 (mapcan 267 (mapcan
268 (lambda (dir) 268 (lambda (dir)
269 (xref-references-in-directory identifier dir)) 269 (xref-references-in-directory identifier dir))
270 (let ((pr (project-current t))) 270 (let ((pr (project-current t)))
271 (cons 271 (cons
272 (project-root pr) 272 (if (fboundp 'project-root)
273 (project-root pr)
274 (with-no-warnings
275 (project-roots pr)))
273 (project-external-roots pr))))) 276 (project-external-roots pr)))))
274 277
275(cl-defgeneric xref-backend-apropos (backend pattern) 278(cl-defgeneric xref-backend-apropos (backend pattern)
@@ -1281,13 +1284,13 @@ FILES must be a list of absolute file names."
1281 (insert (mapconcat #'identity files "\0")) 1284 (insert (mapconcat #'identity files "\0"))
1282 (setq default-directory dir) 1285 (setq default-directory dir)
1283 (setq status 1286 (setq status
1284 (project--process-file-region (point-min) 1287 (xref--process-file-region (point-min)
1285 (point-max) 1288 (point-max)
1286 shell-file-name 1289 shell-file-name
1287 output 1290 output
1288 nil 1291 nil
1289 shell-command-switch 1292 shell-command-switch
1290 command))) 1293 command)))
1291 (goto-char (point-min)) 1294 (goto-char (point-min))
1292 (when (and (/= (point-min) (point-max)) 1295 (when (and (/= (point-min) (point-max))
1293 (not (looking-at grep-re)) 1296 (not (looking-at grep-re))
@@ -1302,6 +1305,24 @@ FILES must be a list of absolute file names."
1302 hits))) 1305 hits)))
1303 (xref--convert-hits (nreverse hits) regexp))) 1306 (xref--convert-hits (nreverse hits) regexp)))
1304 1307
1308(defun xref--process-file-region ( start end program
1309 &optional buffer display
1310 &rest args)
1311 ;; FIXME: This branching shouldn't be necessary, but
1312 ;; call-process-region *is* measurably faster, even for a program
1313 ;; doing some actual work (for a period of time). Even though
1314 ;; call-process-region also creates a temp file internally
1315 ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html).
1316 (if (not (file-remote-p default-directory))
1317 (apply #'call-process-region
1318 start end program nil buffer display args)
1319 (let ((infile (make-temp-file "ppfr")))
1320 (unwind-protect
1321 (progn
1322 (write-region start end infile nil 'silent)
1323 (apply #'process-file program infile buffer display args))
1324 (delete-file infile)))))
1325
1305(defun xref--rgrep-command (regexp files dir ignores) 1326(defun xref--rgrep-command (regexp files dir ignores)
1306 (require 'find-dired) ; for `find-name-arg' 1327 (require 'find-dired) ; for `find-name-arg'
1307 (defvar grep-find-template) 1328 (defvar grep-find-template)