:group 'lisp
(defvar xref-find-function)
(defvar xref-identifier-completion-table-function)
- (defvar project-search-path-function)
+ (defvar project-library-roots-function)
(lisp-mode-variables nil nil 'elisp)
(add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers)
(setq-local electric-pair-text-pairs
(setq-local xref-find-function #'elisp-xref-find)
(setq-local xref-identifier-completion-table-function
#'elisp--xref-identifier-completion-table)
- (setq-local project-search-path-function #'elisp-search-path)
+ (setq-local project-library-roots-function #'elisp-library-roots)
(add-hook 'completion-at-point-functions
#'elisp-completion-at-point nil 'local))
xrefs))
- (declare-function project-search-path "project")
+ (declare-function project-library-roots "project")
(declare-function project-current "project")
(defun elisp--xref-find-references (symbol)
(cl-mapcan
(lambda (dir)
(xref-collect-references symbol dir))
- (project-search-path (project-current))))
+ (let ((pr (project-current t)))
+ (append
+ (project-roots pr)
+ (project-library-roots pr)))))
(defun elisp--xref-find-apropos (regexp)
(apply #'nconc
(cl-defmethod xref-location-group ((l xref-elisp-location))
(xref-elisp-location-file l))
- (defun elisp-search-path ()
+ (defun elisp-library-roots ()
(defvar package-user-dir)
(cons package-user-dir load-path))
(eval (eval-sexp-add-defvars (elisp--preceding-sexp)) lexical-binding)
eval-last-sexp-arg-internal)))
-
(defun elisp--eval-last-sexp-print-value (value &optional eval-last-sexp-arg-internal)
(let ((unabbreviated (let ((print-length nil) (print-level nil))
(prin1-to-string value)))
(lambda (str)
;; Commented or empty lines.
(string-match-p "\\`\\(?:#\\|[ \t\r\n]*\\'\\)" str))
- (vc--read-lines
- (vc-call-backend backend 'find-ignore-file file))))
+ (let ((file (vc-call-backend backend 'find-ignore-file file)))
+ (and (file-exists-p file)
+ (vc--read-lines file)))))
(defun vc--read-lines (file)
"Return a list of lines of FILE."
(smerge-mode 1)
(message "File contains conflicts.")))
+;;;###autoload
+(defun vc-message-unresolved-conflicts (filename)
+ "Display a message indicating unresolved conflicts in FILENAME."
+ ;; This enables all VC backends to give a standard, recognizeable
+ ;; conflict message that indicates which file is conflicted.
+ (message "There are unresolved conflicts in %s" filename))
+
;;;###autoload
(defalias 'vc-resolve-conflicts 'smerge-ediff)
(should (equal (cl-set-difference b b) e))
;; Note: this test (and others) is sensitive to the order of the
;; result, which is not documented.
- (should (equal (cl-set-difference a b) (list c2 "x" "" nil 'a)))
- (should (equal (cl-set-difference b a) (list 'x 'y)))
+ (should (equal (cl-set-difference a b) (list 'a nil "" "x" c2)))
+ (should (equal (cl-set-difference b a) (list 'y 'x)))
;; We aren't testing whether this is really using `eq' rather than `eql'.
(should (equal (cl-set-difference e e :test 'eq) e))
(should (equal (cl-set-difference b e :test 'eq) b))
(should (equal (cl-set-difference e b :test 'eq) e))
(should (equal (cl-set-difference b b :test 'eq) e))
- (should (equal (cl-set-difference a b :test 'eq) (list c2 "x" "" nil 'a)))
- (should (equal (cl-set-difference b a :test 'eq) (list 'x 'y)))
+ (should (equal (cl-set-difference a b :test 'eq) (list 'a nil "" "x" c2)))
+ (should (equal (cl-set-difference b a :test 'eq) (list 'y 'x)))
(should (equal (cl-union e e) e))
(should (equal (cl-union a e) a))
(cl-defstruct (mystruct
(:constructor cl-lib--con-1 (&aux (abc 1)))
- (:constructor cl-lib--con-2 (&optional def)))
+ (:constructor cl-lib--con-2 (&optional def) "Constructor docstring."))
+ "General docstring."
(abc 5 :readonly t) (def nil))
(ert-deftest cl-lib-struct-accessors ()
(let ((x (make-mystruct :abc 1 :def 2)))
(`((cl-tag-slot) (abc 5 :readonly t)
(def . ,(or `nil `(nil))))
t)))))
+(ert-deftest cl-lib-struct-constructors ()
+ (should (equal (documentation 'cl-lib--con-2 t)
+ "Constructor docstring."))
+ (should (mystruct-p (cl-lib--con-1)))
+ (should (mystruct-p (cl-lib--con-2))))
(ert-deftest cl-lib-arglist-performance ()
;; An `&aux' should not cause lambda's arglist to be turned into an &rest