]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-25
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 13 May 2016 14:45:30 +0000 (07:45 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 13 May 2016 14:45:30 +0000 (07:45 -0700)
9c2a1a2 * doc/misc/texinfo.tex: Sync from gnulib.
66cd4d8 * lisp/emacs-lisp/find-func.el (find-feature-regexp) (find-al...
1a5a05c Do not mistake colon at the end of regexp for slash symbol
4c5a00b Make package-install-from-buffer not move point
9596ea1 ; Revert "* emacs-lisp/lisp-mnt.el (lm-header): save-excursion"
f79c352 Redo the fix for bug#21839
8d2f78c Don't treat JS spread as contination method call

1  2 
lisp/emacs-lisp/find-func.el
lisp/emacs-lisp/package.el
lisp/help.el
lisp/progmodes/js.el
test/lisp/progmodes/ruby-mode-tests.el
test/manual/indent/js.js

index c625fd345c9ef7c2b55fa812fb7499821201b856,f174a64fcbac1dcaaf00513c43162cc84d3dd7b2..7bc966366bd329b65854ca57f3caf591c31e9d83
@@@ -111,7 -111,7 +111,7 @@@ should insert the feature name.
    ;; (point-min), which is acceptable in this case.
    :type 'regexp
    :group 'xref
-   :version "25.0")
+   :version "25.1")
  
  (defcustom find-alias-regexp
    "(defalias +'%s"
@@@ -120,7 -120,7 +120,7 @@@ Note it must contain a `%s' at the plac
  should insert the feature name."
    :type 'regexp
    :group 'xref
-   :version "25.0")
+   :version "25.1")
  
  (defvar find-function-regexp-alist
    '((nil . find-function-regexp)
@@@ -182,15 -182,15 +182,15 @@@ See the functions `find-function' and `
  LIBRARY should be a string (the name of the library)."
    ;; If the library is byte-compiled, try to find a source library by
    ;; the same name.
 -  (if (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
 -      (setq library (replace-match "" t t library)))
 +  (when (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
 +    (setq library (replace-match "" t t library)))
    (or
     (locate-file library
 -              (or find-function-source-path load-path)
 -              (find-library-suffixes))
 +                (or find-function-source-path load-path)
 +                (find-library-suffixes))
     (locate-file library
 -              (or find-function-source-path load-path)
 -              load-file-rep-suffixes)
 +                (or find-function-source-path load-path)
 +                load-file-rep-suffixes)
     (when (file-name-absolute-p library)
       (let ((rel (find-library--load-name library)))
         (when rel
            (locate-file rel
                         (or find-function-source-path load-path)
                         load-file-rep-suffixes)))))
 +   (find-library--from-load-path library)
     (error "Can't find library %s" library)))
  
 +(defun find-library--from-load-path (library)
 +  ;; In `load-history', the file may be ".elc", ".el", ".el.gz", and
 +  ;; LIBRARY may be "foo.el" or "foo", so make sure that we get all
 +  ;; potential matches, and then see whether any of them lead us to an
 +  ;; ".el" or an ".el.gz" file.
 +  (let* ((elc-regexp "\\.el\\(c\\(\\..*\\)?\\)\\'")
 +         (suffix-regexp
 +          (concat "\\("
 +                  (mapconcat 'regexp-quote (find-library-suffixes) "\\'\\|")
 +                  "\\|" elc-regexp "\\)\\'"))
 +         (potentials
 +          (mapcar
 +           (lambda (entry)
 +             (if (string-match suffix-regexp (car entry))
 +                 (replace-match "" t t (car entry))
 +               (car entry)))
 +           (seq-filter
 +            (lambda (entry)
 +              (string-match
 +               (concat "\\`"
 +                       (regexp-quote
 +                        (replace-regexp-in-string suffix-regexp "" library))
 +                       suffix-regexp)
 +               (file-name-nondirectory (car entry))))
 +            load-history)))
 +         result)
 +    (dolist (file potentials)
 +      (dolist (suffix (find-library-suffixes))
 +        (when (not result)
 +          (cond ((file-exists-p file)
 +                 (setq result file))
 +                ((file-exists-p (concat file suffix))
 +                 (setq result (concat file suffix)))))))
 +    result))
 +
  (defvar find-function-C-source-directory
    (let ((dir (expand-file-name "src" source-directory)))
      (if (file-accessible-directory-p dir) dir))
@@@ -291,12 -255,9 +291,12 @@@ TYPE should be nil to find a function, 
      (cons (current-buffer) (match-beginning 0))))
  
  ;;;###autoload
 -(defun find-library (library)
 +(defun find-library (library &optional other-window)
    "Find the Emacs Lisp source of LIBRARY.
 -LIBRARY should be a string (the name of the library)."
 +LIBRARY should be a string (the name of the library).  If the
 +optional OTHER-WINDOW argument (i.e., the command argument) is
 +specified, pop to a different window before displaying the
 +buffer."
    (interactive
     (let* ((dirs (or find-function-source-path load-path))
            (suffixes (find-library-suffixes))
       (when (and def (not (test-completion def table)))
         (setq def nil))
       (list
 -      (completing-read (if def (format "Library name (default %s): " def)
 +      (completing-read (if def
 +                           (format "Library name (default %s): " def)
                         "Library name: ")
 -                     table nil nil nil nil def))))
 -  (let ((buf (find-file-noselect (find-library-name library))))
 -    (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf)))))
 +                     table nil nil nil nil def)
 +      current-prefix-arg)))
 +  (prog1
 +      (funcall (if other-window
 +                   'pop-to-buffer
 +                 'pop-to-buffer-same-window)
 +               (find-file-noselect (find-library-name library)))
 +    (run-hooks 'find-function-after-hook)))
  
  ;;;###autoload
  (defun find-function-search-for-symbol (symbol type library)
index c05bb53b0b31cf0ed0087639e3a8a264c5320b83,5371f0b9e55f0ea43021576204dd7dad66167b43..fea184d624248d562fe43a09e93261e5f6cf8329
  
  (require 'tabulated-list)
  (require 'macroexp)
 +(require 'url-handlers)
  
  (defgroup package nil
    "Manager for Emacs Lisp packages."
@@@ -906,15 -905,12 +906,15 @@@ untar into a directory named DIR; other
    file)
  
  (defvar generated-autoload-file)
 +(defvar autoload-timestamps)
  (defvar version-control)
  
  (defun package-generate-autoloads (name pkg-dir)
    (let* ((auto-name (format "%s-autoloads.el" name))
           ;;(ignore-name (concat name "-pkg.el"))
           (generated-autoload-file (expand-file-name auto-name pkg-dir))
 +         ;; We don't need 'em, and this makes the output reproducible.
 +         (autoload-timestamps nil)
           ;; Silence `autoload-generate-file-autoloads'.
           (noninteractive inhibit-message)
           (backup-inhibited t)
@@@ -1993,7 -1989,8 +1993,8 @@@ Downloads and installs required package
              ((derived-mode-p 'tar-mode)
               (package-tar-file-info))
              (t
-              (package-buffer-info))))
+              (save-excursion
+               (package-buffer-info)))))
           (name (package-desc-name pkg-desc)))
      ;; Download and install the dependencies.
      (let* ((requires (package-desc-reqs pkg-desc))
@@@ -2300,7 -2297,7 +2301,7 @@@ Otherwise no newline is inserted.
      (insert "\n")
      (unless (and pkg-dir (not archive)) ; Installed pkgs don't have archive.
        (package--print-help-section "Archive"
 -        (or archive "n/a") "\n"))
 +        (or archive "n/a")))
      (and version
           (package--print-help-section "Version"
             (package-version-join version)))
diff --combined lisp/help.el
index 897cab5e37189337b2bbd1348f10737279b683db,57f358b9a72b681dae1bc897f1bacf1f65358053..b8485667ae03ff1f6ea60b2d08f576bba4372536
@@@ -613,15 -613,7 +613,15 @@@ temporarily enables it to allow gettin
           (when (null (cdr yank-menu))
             (setq saved-yank-menu (copy-sequence yank-menu))
             (menu-bar-update-yank-menu "(any string)" nil))
 -         (setq key (read-key-sequence "Describe key (or click or menu item): "))
 +           (while
 +               (progn
 +                 (setq key (read-key-sequence "Describe the following key, mouse click, or menu item: "))
 +                 (and (vectorp key)
 +                      (consp (aref key 0))
 +                      (symbolp (car (aref key 0)))
 +                      (string-match "\\(mouse\\|down\\|click\\|drag\\)"
 +                                    (symbol-name (car (aref key 0))))
 +                      (not (sit-for (/ double-click-time 1000.0) t)))))
           ;; Clear the echo area message (Bug#7014).
           (message nil)
           ;; If KEY is a down-event, read and discard the
@@@ -758,15 -750,7 +758,15 @@@ temporarily enables it to allow gettin
           (when (null (cdr yank-menu))
             (setq saved-yank-menu (copy-sequence yank-menu))
             (menu-bar-update-yank-menu "(any string)" nil))
 -         (setq key (read-key-sequence "Describe key (or click or menu item): "))
 +           (while
 +               (progn
 +                 (setq key (read-key-sequence "Describe the following key, mouse click, or menu item: "))
 +                 (and (vectorp key)
 +                      (consp (aref key 0))
 +                      (symbolp (car (aref key 0)))
 +                      (string-match "\\(mouse\\|down\\|click\\|drag\\)"
 +                                    (symbol-name (car (aref key 0))))
 +                      (not (sit-for (/ double-click-time 1000.0) t)))))
           (list
            key
            (prefix-numeric-value current-prefix-arg)
@@@ -946,15 -930,14 +946,15 @@@ documentation for the major and minor m
              (let ((mode-function (nth 0 mode))
                    (pretty-minor-mode (nth 1 mode))
                    (indicator (nth 2 mode)))
 -              (add-text-properties 0 (length pretty-minor-mode)
 -                                   '(face bold) pretty-minor-mode)
                (save-excursion
                  (goto-char (point-max))
                  (princ "\n\f\n")
                  (push (point-marker) help-button-cache)
                  ;; Document the minor modes fully.
 -                (insert pretty-minor-mode)
 +                  (insert-text-button
 +                   pretty-minor-mode 'type 'help-function
 +                   'help-args (list mode-function)
 +                   'button '(t))
                  (princ (format " minor mode (%s):\n"
                                 (if (zerop (length indicator))
                                     "no indicator"
@@@ -1412,7 -1395,7 +1412,7 @@@ ARGLIST can also be t or a string of th
                (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "")
              "\n\n")
            (if (stringp arglist)
-                 (if (string-match "\\`[^ ]+\\(\\(?:.\\|\n\\)*\\))\\'" arglist)
+                 (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist)
                      (concat "(fn" (match-string 1 arglist) ")")
                    (error "Unrecognized usage format"))
              (help--make-usage-docstring 'fn arglist)))))
@@@ -1485,7 -1468,8 +1485,8 @@@ the same names as used in the original 
  (define-obsolete-function-alias 'help-make-usage 'help--make-usage "25.1")
  
  (defun help--make-usage-docstring (fn arglist)
-   (help--docstring-quote (format "%S" (help--make-usage fn arglist))))
+   (let ((print-escape-newlines t))
+     (help--docstring-quote (format "%S" (help--make-usage fn arglist)))))
  
  \f
  (provide 'help)
diff --combined lisp/progmodes/js.el
index 9265e38e4bc166b8b942df9180890dd4faee060a,f024d397ffb5790bfcdadd6fc13a9c3f2d513c51..508195996b642021ebb3029928d50a1ed1af9f5b
@@@ -1722,8 -1722,7 +1722,8 @@@ This performs fontification according t
                             (eval-when-compile (append "=({[,:;" '(nil))))))
             (put-text-property (match-beginning 1) (match-end 1)
                                'syntax-table (string-to-syntax "\"/"))
 -           (js-syntax-propertize-regexp end))))))
 +           (js-syntax-propertize-regexp end)))))
 +    ("\\`\\(#\\)!" (1 "< b")))
     (point) end))
  
  (defconst js--prettify-symbols-alist
    "Regular expression matching variable declaration keywords.")
  
  (defconst js--indent-operator-re
-   (concat "[-+*/%<>&^|?:.]\\([^-+*/]\\|$\\)\\|!?=\\|"
+   (concat "[-+*/%<>&^|?:.]\\([^-+*/.]\\|$\\)\\|!?=\\|"
            (js--regexp-opt-symbol '("in" "instanceof")))
    "Regexp matching operators that affect indentation of continued expressions.")
  
@@@ -2249,7 -2248,7 +2249,7 @@@ i.e., customize JSX element indentatio
    "Fill the paragraph with `c-fill-paragraph'."
    (interactive "*P")
    (let ((js--filling-paragraph t)
 -        (fill-paragraph-function 'c-fill-paragraph))
 +        (fill-paragraph-function #'c-fill-paragraph))
      (c-fill-paragraph justify)))
  
  ;;; Type database and Imenu
@@@ -3496,7 -3495,6 +3496,7 @@@ browser, respectively.
  
  
         (unwind-protect
 +           ;; FIXME: Don't impose IDO on the user.
             (setq selected-tab-cname
                   (let ((ido-minibuffer-setup-hook
                          (cons #'setup-hook ido-minibuffer-setup-hook)))
@@@ -3719,11 -3717,11 +3719,11 @@@ If one hasn't been set, or if it's stal
  (define-derived-mode js-mode prog-mode "JavaScript"
    "Major mode for editing JavaScript."
    :group 'js
 -  (setq-local indent-line-function 'js-indent-line)
 -  (setq-local beginning-of-defun-function 'js-beginning-of-defun)
 -  (setq-local end-of-defun-function 'js-end-of-defun)
 +  (setq-local indent-line-function #'js-indent-line)
 +  (setq-local beginning-of-defun-function #'js-beginning-of-defun)
 +  (setq-local end-of-defun-function #'js-end-of-defun)
    (setq-local open-paren-in-column-0-is-defun-start nil)
 -  (setq-local font-lock-defaults (list js--font-lock-keywords))
 +  (setq-local font-lock-defaults '(js--font-lock-keywords))
    (setq-local syntax-propertize-function #'js-syntax-propertize)
    (setq-local prettify-symbols-alist js--prettify-symbols-alist)
  
    ;; Comments
    (setq-local comment-start "// ")
    (setq-local comment-end "")
 -  (setq-local fill-paragraph-function 'js-c-fill-paragraph)
 +  (setq-local fill-paragraph-function #'js-c-fill-paragraph)
  
    ;; Parse cache
    (add-hook 'before-change-functions #'js--flush-caches t t)
index 7e85fb83eddf25ada143a09665753a4e8a5a38c4,52126a3bdf142365eee3f57dfc39c4535079722a..52126a3bdf142365eee3f57dfc39c4535079722a
@@@ -146,6 -146,9 +146,9 @@@ VALUES-PLIST is a list with alternatin
  (ert-deftest ruby-slash-char-literal-is-not-mistaken-for-regexp ()
    (ruby-assert-state "?/" 3 nil))
  
+ (ert-deftest ruby-regexp-is-not-mistaken-for-slash-symbol ()
+   (ruby-assert-state "x = /foo:/" 3 nil))
  (ert-deftest ruby-indent-simple ()
    (ruby-should-indent-buffer
     "if foo
diff --combined test/manual/indent/js.js
index 23fae17b3ce58a5f9363e7e8d57ac79a73cbf07e,b40d47b3e5da00254c8fe81551ee1e61daa1b81f..b40d47b3e5da00254c8fe81551ee1e61daa1b81f
@@@ -103,6 -103,12 +103,12 @@@ Fooba
      console.log(num);
    });
  
+ var z = [
+   ...iterableObj,
+   4,
+   5
+ ]
  var arr = [
    -1, 2,
    -3, 4 +