commit bf3f6a961f378f35a292c41c0bfbdae88ee1b1b9 (HEAD, refs/remotes/origin/master) Author: Artur Malabarba Date: Wed Aug 12 08:52:42 2015 +0100 * emacs-lisp/lisp-mnt.el (lm-header): save-excursion diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 104c23c..01ba656 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -265,16 +265,17 @@ a section." (defun lm-header (header) "Return the contents of the header named HEADER." - (goto-char (point-min)) - (let ((case-fold-search t)) - (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t) - ;; RCS ident likes format "$identifier: data$" - (looking-at - (if (save-excursion - (skip-chars-backward "^$" (match-beginning 0)) - (= (point) (match-beginning 0))) - "[^\n]+" "[^$\n]+"))) - (match-string-no-properties 0)))) + (save-excursion + (goto-char (point-min)) + (let ((case-fold-search t)) + (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t) + ;; RCS ident likes format "$identifier: data$" + (looking-at + (if (save-excursion + (skip-chars-backward "^$" (match-beginning 0)) + (= (point) (match-beginning 0))) + "[^\n]+" "[^$\n]+"))) + (match-string-no-properties 0))))) (defun lm-header-multiline (header) "Return the contents of the header named HEADER, with continuation lines. commit 197f280042a4d901ea94acdf10f1dc544fae4750 Author: Fabián Ezequiel Gallina Date: Tue Aug 11 23:56:25 2015 -0300 ; python.el: Emacs 24.x compatibility fixes * lisp/progmodes/python.el: Provide compatibility alternatives for prog-widen and prog-first-column. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 95814fa..0b7b9b7 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -282,6 +282,18 @@ :version "24.3" :link '(emacs-commentary-link "python")) + +;;; 24.x Compat + + +(unless (fboundp 'prog-widen) + (defun prog-widen () + (widen))) + +(unless (fboundp 'prog-first-column) + (defun prog-first-column () + 0)) + ;;; Bindings commit bf0ed7340098dcb6228566450a99d3cbc0460094 Author: Fabián Ezequiel Gallina Date: Tue Aug 11 23:04:11 2015 -0300 Respect python.el imenu when semantic-mode is off Fixes debbugs:21220 * lisp/cedet/semantic/wisent/python.el: Do not force wisent-python-default-setup on python-mode-hook. diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el index a8348d2..6abeb4a 100644 --- a/lisp/cedet/semantic/wisent/python.el +++ b/lisp/cedet/semantic/wisent/python.el @@ -534,9 +534,6 @@ Shortens 'code' tags, but passes through for others." (code . "Code"))) ) -;;;###autoload -(add-hook 'python-mode-hook 'wisent-python-default-setup) - ;; Make sure the newer python modes pull in the same python ;; mode overrides. (define-child-mode python-2-mode python-mode "Python 2 mode") commit d6640d6e4c4f1a85edf924bca0f8a90d1aa6341a Author: Paul Eggert Date: Tue Aug 11 15:53:18 2015 -0700 Give names to Unicode code points in C code * src/character.h (NO_BREAK_SPACE, SOFT_HYPHEN) (ZERO_WIDTH_NON_JOINER, ZERO_WIDTH_JOINER, HYPHEN) (NON_BREAKING_HYPHEN, LEFT_SINGLE_QUOTATION_MARK) (RIGHT_SINGLE_QUOTATION_MARK, PARAGRAPH_SEPARATOR) (LEFT_POINTING_ANGLE_BRACKET, RIGHT_POINTING_ANGLE_BRACKET) (LEFT_ANGLE_BRACKET, RIGHT_ANGLE_BRACKET) (OBJECT_REPLACEMENT_CHARACTER): New named constants for Unicode code points. * src/bidi.c (bidi_fetch_char, CANONICAL_EQU): * src/composite.c (char_composable_p): * src/lread.c (readevalloop, read1): * src/xdisp.c (get_next_display_element): Use them. * src/doc.c (LEFT_SINGLE_QUOTATION_POINT): Remove; now in character.h. diff --git a/src/bidi.c b/src/bidi.c index e06430c..bcc15b8 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1313,13 +1313,13 @@ bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos, /* `(space ...)' display specs are handled as paragraph separators for the purposes of the reordering; see UAX#9 section 3 and clause HL1 in section 4.3 there. */ - ch = 0x2029; + ch = PARAGRAPH_SEPARATOR; } else { /* All other display specs are handled as the Unicode Object Replacement Character. */ - ch = 0xFFFC; + ch = OBJECT_REPLACEMENT_CHARACTER; } disp_end_pos = compute_display_string_end (*disp_pos, string); if (disp_end_pos < 0) @@ -2482,8 +2482,8 @@ typedef struct bpa_stack_entry { #define CANONICAL_EQU(c) \ ( ASCII_CHAR_P (c) ? c \ - : (c) == 0x2329 ? 0x3008 \ - : (c) == 0x232a ? 0x3009 \ + : (c) == LEFT_POINTING_ANGLE_BRACKET ? LEFT_ANGLE_BRACKET \ + : (c) == RIGHT_POINTING_ANGLE_BRACKET ? RIGHT_ANGLE_BRACKET \ : c ) #ifdef ENABLE_CHECKING diff --git a/src/character.h b/src/character.h index 859d717..0b2c419 100644 --- a/src/character.h +++ b/src/character.h @@ -59,6 +59,25 @@ INLINE_HEADER_BEGIN /* Maximum leading code of multibyte characters. */ #define MAX_MULTIBYTE_LEADING_CODE 0xF8 +/* Unicode character values. */ +enum +{ + NO_BREAK_SPACE = 0x00A0, + SOFT_HYPHEN = 0x00AD, + ZERO_WIDTH_NON_JOINER = 0x200C, + ZERO_WIDTH_JOINER = 0x200D, + HYPHEN = 0x2010, + NON_BREAKING_HYPHEN = 0x2011, + LEFT_SINGLE_QUOTATION_MARK = 0x2018, + RIGHT_SINGLE_QUOTATION_MARK = 0x2019, + PARAGRAPH_SEPARATOR = 0x2029, + LEFT_POINTING_ANGLE_BRACKET = 0x2329, + RIGHT_POINTING_ANGLE_BRACKET = 0x232A, + LEFT_ANGLE_BRACKET = 0x3008, + RIGHT_ANGLE_BRACKET = 0x3009, + OBJECT_REPLACEMENT_CHARACTER = 0xFFFC, +}; + /* Nonzero iff C is a character that corresponds to a raw 8-bit byte. */ #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) diff --git a/src/composite.c b/src/composite.c index 1c18165..88cef22 100644 --- a/src/composite.c +++ b/src/composite.c @@ -927,7 +927,7 @@ char_composable_p (int c) { Lisp_Object val; return (c > ' ' - && (c == 0x200C || c == 0x200D + && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER || (val = CHAR_TABLE_REF (Vunicode_category_table, c), (INTEGERP (val) && (XINT (val) <= UNICODE_CATEGORY_So))))); } diff --git a/src/doc.c b/src/doc.c index a079cd2..cb52266 100644 --- a/src/doc.c +++ b/src/doc.c @@ -689,7 +689,6 @@ the same file name is found in the `doc-directory'. */) "\xE2\x80\x98" and "\xE2\x80\x99", respectively. */ enum { - LEFT_SINGLE_QUOTATION_MARK = 0x2018, uLSQM0 = 0xE2, uLSQM1 = 0x80, uLSQM2 = 0x98, uRSQM0 = 0xE2, uRSQM1 = 0x80, uRSQM2 = 0x99, }; diff --git a/src/lread.c b/src/lread.c index 11c8d00..fe4d367 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1885,7 +1885,7 @@ readevalloop (Lisp_Object readcharfun, /* Ignore whitespace here, so we can detect eof. */ if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r' - || c == 0xa0) /* NBSP */ + || c == NO_BREAK_SPACE) goto read_next; if (!NILP (Vpurify_flag) && c == '(') @@ -2793,7 +2793,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) uninterned_symbol = 1; c = READCHAR; if (!(c > 040 - && c != 0xa0 /* NBSP */ + && c != NO_BREAK_SPACE && (c >= 0200 || strchr ("\"';()[]#`,", c) == NULL))) { @@ -3127,7 +3127,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) default: default_label: if (c <= 040) goto retry; - if (c == 0xa0) /* NBSP */ + if (c == NO_BREAK_SPACE) goto retry; read_symbol: @@ -3167,7 +3167,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) c = READCHAR; } while (c > 040 - && c != 0xa0 /* NBSP */ + && c != NO_BREAK_SPACE && (c >= 0200 || strchr ("\"';()[]#`,", c) == NULL)); diff --git a/src/xdisp.c b/src/xdisp.c index 711fe08..7371216 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6890,9 +6890,10 @@ get_next_display_element (struct it *it) non-ASCII spaces and hyphens specially. */ if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display)) { - if (c == 0xA0) + if (c == NO_BREAK_SPACE) nonascii_space_p = true; - else if (c == 0xAD || c == 0x2010 || c == 0x2011) + else if (c == SOFT_HYPHEN || c == HYPHEN + || c == NON_BREAKING_HYPHEN) nonascii_hyphen_p = true; } commit 85f7e5115f9f409126d355997e8103ea5126ada2 Author: Stephen Leake Date: Tue Aug 11 14:28:17 2015 -0500 elisp--xref-find-definitions handle cl-defstuct default constructor * lisp/progmodes/elisp-mode.el (elisp-xref-find): Add FIXME. (elisp--xref-format-extra): Rename from elisp--xref-format-cl-defmethod. (elisp--xref-find-definitions): Handle cl-defstuct default constructor. * test/automated/elisp-mode-tests.el (xref-elisp-test-run): Split out from xref-elisp-test for ease of debugging. (xref-elisp-deftest): Rename from xref-elisp-test. (find-defs-constructor): New test. (find-defs-defgeneric-el): Match batch test config. (compile): Required for find-defs compilation-minor-mode test. (find-defs-defvar-el): Match code change. (find-defs-face-el): Match code change. * lisp/progmodes/xref.el (xref-find-function, xref-find-definitions): Improve doc string. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 41ca57f..7ac5a5c 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -590,6 +590,10 @@ It can be quoted, or be inside a quoted form." (defun elisp-xref-find (action id) (require 'find-func) + ;; FIXME: use information in source near point to filter results: + ;; (dvc-log-edit ...) - exclude 'feature + ;; (require 'dvc-log-edit) - only 'feature + ;; Semantic may provide additional information (pcase action (`definitions (let ((sym (intern-soft id))) @@ -606,7 +610,7 @@ It can be quoted, or be inside a quoted form." (put-text-property 4 6 'face 'font-lock-function-name-face str) str)) -(defconst elisp--xref-format-cl-defmethod +(defconst elisp--xref-format-extra (let ((str "(%s %s %s)")) (put-text-property 1 3 'face 'font-lock-keyword-face str) (put-text-property 4 6 'face 'font-lock-function-name-face str) @@ -675,7 +679,7 @@ otherwise build the summary from TYPE and SYMBOL." (when (fboundp symbol) (let ((file (find-lisp-object-file-name symbol (symbol-function symbol))) - generic) + generic doc) (when file (cond ((eq file 'C-source) @@ -684,11 +688,26 @@ otherwise build the summary from TYPE and SYMBOL." ;; Second call will return "src/*.c" in file; handled by 't' case below. (push (elisp--xref-make-xref nil symbol (help-C-file-name (symbol-function symbol) 'subr)) xrefs)) + ((and (setq doc (documentation symbol t)) + ;; This doc string is defined in cl-macs.el cl-defstruct + (string-match "Constructor for objects of type `\\(.*\\)'" doc)) + ;; `symbol' is a name for the default constructor created by + ;; cl-defstruct, so return the location of the cl-defstruct. + (let* ((type-name (match-string 1 doc)) + (type-symbol (intern type-name)) + (file (find-lisp-object-file-name type-symbol 'define-type)) + (summary (format elisp--xref-format-extra + 'cl-defstruct + (concat "(" type-name) + (concat "(:constructor " (symbol-name symbol) "))")))) + (push (elisp--xref-make-xref 'define-type type-symbol file summary) xrefs) + )) + ((setq generic (cl--generic symbol)) (dolist (method (cl--generic-method-table generic)) (let* ((info (cl--generic-method-info method)) (met-name (cons symbol (cl--generic-method-specializers method))) - (descr (format elisp--xref-format-cl-defmethod 'cl-defmethod symbol (nth 1 info))) + (descr (format elisp--xref-format-extra 'cl-defmethod symbol (nth 1 info))) (file (find-lisp-object-file-name met-name 'cl-defmethod))) (when file (push (elisp--xref-make-xref 'cl-defmethod met-name file descr) xrefs)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 68f6cff..b0a8eb7 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -202,8 +202,10 @@ LOCATION is an `xref-location'." It can be called in several ways: (definitions IDENTIFIER): Find definitions of IDENTIFIER. The -result must be a list of xref objects. If no definitions can be -found, return nil. +result must be a list of xref objects. If IDENTIFIER contains +sufficient information to determine a unique definition, returns +only that definition. If there are multiple possible definitions, +return all of them. If no definitions can be found, return nil. (references IDENTIFIER): Find references of IDENTIFIER. The result must be a list of xref objects. If no references can be @@ -751,7 +753,14 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (defun xref-find-definitions (identifier) "Find the definition of the identifier at point. With prefix argument or when there's no identifier at point, -prompt for it." +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." (interactive (list (xref--read-identifier "Find definitions of: "))) (xref--find-definitions identifier nil)) diff --git a/test/automated/elisp-mode-tests.el b/test/automated/elisp-mode-tests.el index 114b71c..9b4014a 100644 --- a/test/automated/elisp-mode-tests.el +++ b/test/automated/elisp-mode-tests.el @@ -176,28 +176,30 @@ ))) -(defmacro xref-elisp-test (name computed-xrefs expected-xrefs) +(defun xref-elisp-test-run (xrefs expecteds) + (while xrefs + (should (= (length xrefs) (length expecteds))) + (let ((xref (pop xrefs)) + (expected (pop expecteds))) + + (should (equal xref + (or (when (consp expected) (car expected)) expected))) + + (xref--goto-location (xref-item-location xref)) + (should (looking-at (or (when (consp expected) (cdr expected)) + (xref-elisp-test-descr-to-target expected))))) + )) + +(defmacro xref-elisp-deftest (name computed-xrefs expected-xrefs) "Define an ert test for an xref-elisp feature. COMPUTED-XREFS and EXPECTED-XREFS are lists of xrefs, except if an element of EXPECTED-XREFS is a cons (XREF . TARGET), TARGET is matched to the found location; otherwise, match to (xref-elisp-test-descr-to-target xref)." - (declare (indent defun)) - (declare (debug (symbolp "name"))) + (declare (indent defun) + (debug (symbolp "name"))) `(ert-deftest ,(intern (concat "xref-elisp-test-" (symbol-name name))) () - (let ((xrefs ,computed-xrefs) - (expecteds ,expected-xrefs)) - (while xrefs - (let ((xref (pop xrefs)) - (expected (pop expecteds))) - - (should (equal xref - (or (when (consp expected) (car expected)) expected))) - - (xref--goto-location (xref-item-location xref)) - (should (looking-at (or (when (consp expected) (cdr expected)) - (xref-elisp-test-descr-to-target expected))))) - )) + (xref-elisp-test-run ,computed-xrefs ,expected-xrefs) )) ;; When tests are run from the Makefile, 'default-directory' is $HOME, @@ -212,7 +214,22 @@ to (xref-elisp-test-descr-to-target xref)." ;; FIXME: defalias-defun-c cmpl-prefix-entry-head ;; FIXME: defalias-defvar-el allout-mode-map -(xref-elisp-test find-defs-defalias-defun-el +(xref-elisp-deftest find-defs-constructor + (elisp--xref-find-definitions 'xref-make-elisp-location) + ;; 'xref-make-elisp-location' is just a name for the default + ;; constructor created by the cl-defstruct, so the location is the + ;; cl-defstruct location. + (list + (cons + (xref-make "(cl-defstruct (xref-elisp-location (:constructor xref-make-elisp-location)))" + (xref-make-elisp-location + 'xref-elisp-location 'define-type + (expand-file-name "../../lisp/progmodes/elisp-mode.el" emacs-test-dir))) + ;; It's not worth adding another special case to `xref-elisp-test-descr-to-target' for this + "(cl-defstruct (xref-elisp-location") + )) + +(xref-elisp-deftest find-defs-defalias-defun-el (elisp--xref-find-definitions 'Buffer-menu-sort) (list (xref-make "(defalias Buffer-menu-sort)" @@ -227,7 +244,7 @@ to (xref-elisp-test-descr-to-target xref)." ;; FIXME: defconst -(xref-elisp-test find-defs-defgeneric-el +(xref-elisp-deftest find-defs-defgeneric-el (elisp--xref-find-definitions 'xref-location-marker) (list (xref-make "(cl-defgeneric xref-location-marker)" @@ -250,20 +267,14 @@ to (xref-elisp-test-descr-to-target xref)." (xref-make-elisp-location '(xref-location-marker xref-bogus-location) 'cl-defmethod (expand-file-name "../../lisp/progmodes/xref.el" emacs-test-dir))) - (xref-make "(cl-defmethod xref-location-marker ((l xref-etags-location)))" - (xref-make-elisp-location - '(xref-location-marker xref-etags-location) 'cl-defmethod - (expand-file-name "../../lisp/progmodes/etags.el" emacs-test-dir))) + ;; etags is not loaded at test time )) -;; FIXME: constructor xref-make-elisp-location; location is -;; cl-defstruct location. use :constructor in description. - -(xref-elisp-test find-defs-defgeneric-eval +(xref-elisp-deftest find-defs-defgeneric-eval (elisp--xref-find-definitions (eval '(cl-defgeneric stephe-leake-cl-defgeneric ()))) nil) -(xref-elisp-test find-defs-defun-el +(xref-elisp-deftest find-defs-defun-el (elisp--xref-find-definitions 'xref-find-definitions) (list (xref-make "(defun xref-find-definitions)" @@ -271,11 +282,11 @@ to (xref-elisp-test-descr-to-target xref)." 'xref-find-definitions nil (expand-file-name "../../lisp/progmodes/xref.el" emacs-test-dir))))) -(xref-elisp-test find-defs-defun-eval +(xref-elisp-deftest find-defs-defun-eval (elisp--xref-find-definitions (eval '(defun stephe-leake-defun ()))) nil) -(xref-elisp-test find-defs-defun-c +(xref-elisp-deftest find-defs-defun-c (elisp--xref-find-definitions 'buffer-live-p) (list (xref-make "(defun buffer-live-p)" @@ -283,7 +294,7 @@ to (xref-elisp-test-descr-to-target xref)." ;; FIXME: deftype -(xref-elisp-test find-defs-defun-c-defvar-c +(xref-elisp-deftest find-defs-defun-c-defvar-c (elisp-xref-find 'definitions "system-name") (list (xref-make "(defvar system-name)" @@ -292,7 +303,7 @@ to (xref-elisp-test-descr-to-target xref)." (xref-make-elisp-location 'system-name nil "src/editfns.c"))) ) -(xref-elisp-test find-defs-defun-el-defvar-c +(xref-elisp-deftest find-defs-defun-el-defvar-c (elisp-xref-find 'definitions "abbrev-mode") ;; It's a minor mode, but the variable is defined in buffer.c (list @@ -310,42 +321,34 @@ to (xref-elisp-test-descr-to-target xref)." ;; compilation-minor-mode". There is no way to tell that from the ;; symbol. find-function-regexp-alist uses find-function-regexp for ;; this, but that matches too many things for use in this test. -(xref-elisp-test find-defs-defun-defvar-el +(require 'compile) ;; not loaded by default at test time +(xref-elisp-deftest find-defs-defun-defvar-el (elisp--xref-find-definitions 'compilation-minor-mode) (list (cons - (xref-make "(defun compilation-minor-mode)" - (xref-make-elisp-location - 'compilation-minor-mode nil - (expand-file-name "../../lisp/progmodes/compile.el" emacs-test-dir))) - "(define-minor-mode compilation-minor-mode") - (cons (xref-make "(defvar compilation-minor-mode)" (xref-make-elisp-location 'compilation-minor-mode 'defvar (expand-file-name "../../lisp/progmodes/compile.el" emacs-test-dir))) "(define-minor-mode compilation-minor-mode") - ) - ) + (cons + (xref-make "(defun compilation-minor-mode)" + (xref-make-elisp-location + 'compilation-minor-mode nil + (expand-file-name "../../lisp/progmodes/compile.el" emacs-test-dir))) + "(define-minor-mode compilation-minor-mode") + )) -(xref-elisp-test find-defs-defvar-el +(xref-elisp-deftest find-defs-defvar-el (elisp--xref-find-definitions 'xref--marker-ring) - ;; This is a defconst, which creates an alias and a variable. - ;; FIXME: try not to show the alias in this case (list (xref-make "(defvar xref--marker-ring)" (xref-make-elisp-location 'xref--marker-ring 'defvar (expand-file-name "../../lisp/progmodes/xref.el" emacs-test-dir))) - (cons - (xref-make "(defalias xref--marker-ring)" - (xref-make-elisp-location - 'xref--marker-ring 'defalias - (expand-file-name "../../lisp/progmodes/xref.elc" emacs-test-dir))) - "(defvar xref--marker-ring") )) -(xref-elisp-test find-defs-defvar-c +(xref-elisp-deftest find-defs-defvar-c (elisp--xref-find-definitions 'default-directory) (list (cons @@ -354,15 +357,13 @@ to (xref-elisp-test-descr-to-target xref)." ;; IMPROVEME: we might be able to compute this target "DEFVAR_PER_BUFFER (\"default-directory\""))) -(xref-elisp-test find-defs-defvar-eval +(xref-elisp-deftest find-defs-defvar-eval (elisp--xref-find-definitions (eval '(defvar stephe-leake-defvar nil))) nil) -(xref-elisp-test find-defs-face-el +(xref-elisp-deftest find-defs-face-el (elisp--xref-find-definitions 'font-lock-keyword-face) ;; 'font-lock-keyword-face is both a face and a var - ;; defface creates both a face and an alias - ;; FIXME: try to not show the alias in this case (list (xref-make "(defvar font-lock-keyword-face)" (xref-make-elisp-location @@ -372,19 +373,13 @@ to (xref-elisp-test-descr-to-target xref)." (xref-make-elisp-location 'font-lock-keyword-face 'defface (expand-file-name "../../lisp/font-lock.el" emacs-test-dir))) - (cons - (xref-make "(defalias font-lock-keyword-face)" - (xref-make-elisp-location - 'font-lock-keyword-face 'defalias - (expand-file-name "../../lisp/font-lock.elc" emacs-test-dir))) - "(defface font-lock-keyword-face") )) -(xref-elisp-test find-defs-face-eval +(xref-elisp-deftest find-defs-face-eval (elisp--xref-find-definitions (eval '(defface stephe-leake-defface nil ""))) nil) -(xref-elisp-test find-defs-feature-el +(xref-elisp-deftest find-defs-feature-el (elisp--xref-find-definitions 'xref) (list (xref-make "(feature xref)" @@ -392,7 +387,7 @@ to (xref-elisp-test-descr-to-target xref)." 'xref 'feature (expand-file-name "../../lisp/progmodes/xref.el" emacs-test-dir))))) -(xref-elisp-test find-defs-feature-eval +(xref-elisp-deftest find-defs-feature-eval (elisp--xref-find-definitions (eval '(provide 'stephe-leake-feature))) nil) commit 6171d5b1f9edb09ca43c219f08e7a372de8740b2 Author: Stefan Monnier Date: Tue Aug 11 11:43:10 2015 -0400 * lisp/replace.el (perform-replace): Document `replacements'. (perform-replace): Move the description of the format of `replacements' from the body's comment to the docstring. diff --git a/lisp/replace.el b/lisp/replace.el index a541c55..aa1da08 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2080,7 +2080,13 @@ see the documentation of `replace-match' to find out how to simulate `case-replace'. This function returns nil if and only if there were no matches to -make, or the user didn't cancel the call." +make, or the user didn't cancel the call. + +REPLACEMENTS is either a string, a list of strings, or a cons cell +containing a function and its first argument. The function is +called to generate each replacement like this: + (funcall (car replacements) (cdr replacements) replace-count) +It must return a string." (or map (setq map query-replace-map)) (and query-flag minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) @@ -2136,11 +2142,6 @@ make, or the user didn't cancel the call." (when (eq (lookup-key map (vector last-input-event)) 'automatic-all) (setq query-flag nil multi-buffer t)) - ;; REPLACEMENTS is either a string, a list of strings, or a cons cell - ;; containing a function and its first argument. The function is - ;; called to generate each replacement like this: - ;; (funcall (car replacements) (cdr replacements) replace-count) - ;; It must return a string. (cond ((stringp replacements) (setq next-replacement replacements