commit 8db75f0ef9ad821bab0a2613bb8e549edbf14eb6 (HEAD, refs/remotes/origin/master) Author: Tom Tromey Date: Sat Feb 25 10:27:48 2017 -0700 Use font-lock-doc-face in js-mode Bug#25858: * lisp/progmodes/js.el (js-font-lock-syntactic-face-function): New defun. (js-mode): Use it. * test/lisp/progmodes/js-tests.el (js-mode-doc-comment-face): New test. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 65325a8ffa..aed42a8507 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1687,6 +1687,16 @@ This performs fontification according to `js--class-styles'." js--font-lock-keywords-3) "Font lock keywords for `js-mode'. See `font-lock-keywords'.") +(defun js-font-lock-syntactic-face-function (state) + "Return syntactic face given STATE." + (if (nth 3 state) + font-lock-string-face + (if (save-excursion + (goto-char (nth 8 state)) + (looking-at "/\\*\\*")) + font-lock-doc-face + font-lock-comment-face))) + (defconst js--syntax-propertize-regexp-regexp (rx ;; Start of regexp. @@ -3828,7 +3838,10 @@ If one hasn't been set, or if it's stale, prompt for a new one." (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 + (list js--font-lock-keywords nil nil nil nil + '(font-lock-syntactic-face-function + . js-font-lock-syntactic-face-function))) (setq-local syntax-propertize-function #'js-syntax-propertize) (setq-local prettify-symbols-alist js--prettify-symbols-alist) diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 07e659af60..e030675e07 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -128,6 +128,18 @@ if (!/[ (:,='\"]/.test(value)) { ;; Any success is ok here. (should t))) +(ert-deftest js-mode-doc-comment-face () + (dolist (test '(("/*" "*/" font-lock-comment-face) + ("//" "\n" font-lock-comment-face) + ("/**" "*/" font-lock-doc-face) + ("\"" "\"" font-lock-string-face))) + (with-temp-buffer + (js-mode) + (insert (car test) " he") + (save-excursion (insert "llo " (cadr test))) + (font-lock-ensure) + (should (eq (get-text-property (point) 'face) (caddr test)))))) + (provide 'js-tests) ;;; js-tests.el ends here commit 546d30ed1400d5a434886790a102bd37ec852919 Author: Noam Postavsky Date: Wed Feb 22 16:56:14 2017 -0500 Don't use IP 0.0.0.0 for package test server (Bug#22582) * test/lisp/emacs-lisp/package-resources/package-test-server.py: Set 'server_address' when port number is given on the command line. Print IP and port number as a URL, and flush it after printing. * test/lisp/emacs-lisp/package-tests.el: (package-test-update-archives-async): Grab the whole URL from server output. diff --git a/test/lisp/emacs-lisp/package-resources/package-test-server.py b/test/lisp/emacs-lisp/package-resources/package-test-server.py index 1acd9f744b..128b4249ec 100644 --- a/test/lisp/emacs-lisp/package-resources/package-test-server.py +++ b/test/lisp/emacs-lisp/package-resources/package-test-server.py @@ -11,11 +11,15 @@ port = int(sys.argv[1]) else: port = 0 - server_address = ('127.0.0.1', port) +server_address = ('127.0.0.1', port) HandlerClass.protocol_version = Protocol httpd = ServerClass(server_address, HandlerClass) -sa = httpd.socket.getsockname() -print "Serving HTTP on", sa[0], "port", sa[1], "..." +ip, port = httpd.socket.getsockname()[0:2] +print ("Server started, http://%s:%s/" % (ip, port)) +# Flush in case we're in full buffering mode (instead of line +# buffering), this might happen if python is a cygwin program and we +# run it from a native w32 program. +sys.stdout.flush() httpd.serve_forever() diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 2e4666e7fe..5172b482cb 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -376,22 +376,19 @@ Must called from within a `tar-mode' buffer." "package-server" "package-server-buffer" (executable-find "python2") "package-test-server.py")) - port) + (addr nil)) (unwind-protect (progn (with-current-buffer "package-server-buffer" (should (with-timeout (10 nil) - (while (not port) + (while (not addr) (accept-process-output nil 1) (goto-char (point-min)) - (if (re-search-forward "Serving HTTP on .* port \\([0-9]+\\) " - nil t) - (setq port (match-string 1)))) - port))) - (with-package-test (:basedir - package-test-data-dir - :location (format "http://0.0.0.0:%s/" port)) + (when (re-search-forward "Server started, \\(.*\\)\n" nil t) + (setq addr (match-string 1)))) + addr))) + (with-package-test (:basedir package-test-data-dir :location addr) (list-packages) (should package--downloads-in-progress) (should mode-line-process) commit 9e9d381ff0c83283278f43a65d3ecefd0cde8041 Author: Tom Tromey Date: Wed Feb 15 05:19:50 2017 -0700 Add more branch support to vc-dir Bug#25859: * lisp/vc/vc-dir.el (vc-dir-mode-map) Add "B" bindings. * lisp/vc/vc.el (vc-revision-history): New defvar. (vc-read-revision): Use vc-revision-history. (vc-print-branch-log): New function. * doc/emacs/maintaining.texi (VC Directory Commands): Document new bindings. * etc/NEWS: Mention new vc-dir bindings. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index faaa96072c..80a4467f63 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1301,7 +1301,7 @@ up a multi-file VC fileset to be acted on by VC commands like The VC Directory buffer also defines some single-key shortcuts for VC commands with the @kbd{C-x v} prefix: @kbd{=}, @kbd{+}, @kbd{l}, -@kbd{i}, @kbd{D}, @kbd{L}, @kbd{G}, @kbd{I} and @kbd{v}. +@kbd{i}, @kbd{D}, @kbd{L}, @kbd{G}, @kbd{I}, @kbd{O}, and @kbd{v}. For example, you can commit a set of edited files by opening a VC Directory buffer, where the files are listed with the @samp{edited} @@ -1332,6 +1332,21 @@ Do an incremental regular expression search on the fileset Apart from acting on multiple files, these commands behave much like their single-buffer counterparts (@pxref{Search}). + The VC Directory buffer additionally defines some branch-related +commands starting with the prefix @kbd{B}: + +@table @kbd +@item B c +Create a new branch (@code{vc-create-tag}). + +@item B l +Prompt for the name of a branch and display the change history of that +branch (@code{vc-print-branch-log}). + +@item B s +Switch to a branch (@code{vc-retrieve-tag}). @xref{Switching Branches}. +@end table + @cindex stashes in version control @cindex shelves in version control The above commands are also available via the menu bar, and via a diff --git a/etc/NEWS b/etc/NEWS index 5d14e122a2..05f380fe19 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -708,6 +708,10 @@ string is computed dynamically based on 'url-privacy-level'. colorful faces to make it more obvious to the user what the state is. See the 'vc-faces' customization group. ++++ +*** 'vc-dir-mode' now binds 'vc-log-outgoing' to 'O'; and has various +branch-related commands on a keymap bound to 'B'. + ** CC mode *** Opening a .h file will turn C or C++ mode depending on language used. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 21bd21e15d..0363aab840 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -297,6 +297,12 @@ See `run-hooks'." (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) (define-key map "G" 'vc-dir-ignore) + (let ((branch-map (make-sparse-keymap))) + (define-key map "B" branch-map) + (define-key branch-map "c" 'vc-create-tag) + (define-key branch-map "l" 'vc-print-branch-log) + (define-key branch-map "s" 'vc-retrieve-tag)) + ;; Hook up the menu. (define-key map [menu-bar vc-dir-mode] `(menu-item diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0c8492d021..c5fe8aa6b1 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1757,6 +1757,9 @@ Return t if the buffer had changes, nil otherwise." ;; because we don't know that yet. t))) +(defvar vc-revision-history nil + "History for `vc-read-revision'.") + (defun vc-read-revision (prompt &optional files backend default initial-input) (cond ((null files) @@ -1768,7 +1771,7 @@ Return t if the buffer had changes, nil otherwise." (vc-call-backend backend 'revision-completion-table files))) (if completion-table (completing-read prompt completion-table - nil nil initial-input nil default) + nil nil initial-input 'vc-revision-history default) (read-string prompt initial-input nil default)))) (defun vc-diff-build-argument-list-internal () @@ -2373,6 +2376,17 @@ When called interactively with a prefix argument, prompt for LIMIT." (vc-print-log-internal backend (list rootdir) nil nil limit))) ;;;###autoload +(defun vc-print-branch-log (branch) + (interactive + (list + (vc-read-revision "Branch to log: "))) + (when (equal branch "") + (error "No branch specified")) + (vc-print-log-internal (vc-responsible-backend default-directory) + (list default-directory) branch t + (when (> vc-log-show-limit 0) vc-log-show-limit))) + +;;;###autoload (defun vc-log-incoming (&optional remote-location) "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION. When called interactively with a prefix argument, prompt for REMOTE-LOCATION." commit 54319e7a2418690508f29cd6833c9fd9ecbc2fa3 Author: Alan Mackenzie Date: Sat Feb 25 14:53:59 2017 +0000 Allow for the :: operator in C++ "enum class" declarations. * lisp/progmodes/cc-engine.el (c-backward-typed-enum-colon): Check for "::". diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index dfd7aebd56..a5ade09791 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -10130,6 +10130,8 @@ comment at the start of cc-engine.el for more info." (or (not (looking-at "\\s)")) (c-go-up-list-backward)) (cond + ((looking-at "::") + t) ((and (eql (char-after) ?:) (save-excursion (c-backward-syntactic-ws) commit d79fd6c95ed0affa693d07fb664a97db2848a0f0 Author: Michael Albinus Date: Sat Feb 25 15:02:10 2017 +0100 Fix bug#25854 * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls): Simplify error handling for huge inodes. (tramp-convert-file-attributes): Handle very huge inodes. (Bug#25854) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1489405b84..071ef7982a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1307,18 +1307,10 @@ target of the symlink differ." (setq res-inode (condition-case err (read (current-buffer)) - (invalid-read-syntax - (when (and (equal (cadr err) - "Integer constant overflow in reader") - (string-match - "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'" - (car (cddr err)))) - (let* ((big (read (substring (car (cddr err)) 0 - (match-beginning 1)))) - (small (read (match-string 1 (car (cddr err))))) - (twiddle (/ small 65536))) - (cons (+ big twiddle) - (- small (* twiddle 65536)))))))) + ;; This error happens in Emacs 23. Starting with + ;; Emacs 24, a large integer will be converted into + ;; a float automatically during `read'. + (overflow-error (string-to-number (cadr err))))) ;; ... file mode flags (setq res-filemodes (symbol-name (read (current-buffer)))) ;; ... number links @@ -5065,8 +5057,19 @@ Return ATTR." (unless (listp (nth 10 attr)) (setcar (nthcdr 10 attr) (condition-case nil - (cons (floor (nth 10 attr) 65536) - (floor (mod (nth 10 attr) 65536))) + (let ((high (nth 10 attr)) + middle low) + (if (<= high most-positive-fixnum) + (floor high) + ;; The low 16 bits. + (setq low (mod high #x10000) + high (/ high #x10000)) + (if (<= high most-positive-fixnum) + (cons (floor high) (floor low)) + ;; The middle 24 bits. + (setq middle (mod high #x1000000) + high (/ high #x1000000)) + (cons (floor high) (cons (floor middle) (floor low)))))) ;; Inodes can be incredible huge. We must hide this. (error (tramp-get-inode vec))))) ;; Set virtual device number. commit a3c9a554f1f3be560003fa7d0c661506d5209b4e Author: Eli Zaretskii Date: Sat Feb 25 13:40:23 2017 +0200 Avoid leaving garbage on screen when using 'raise' display property * src/xdisp.c (display_line): Reset voffset value of the iterator when it hits ZV, to avoid "inheriting" it to glyph rows past ZV, which then leaves stuff on screen that needs to be cleared by redisplay. (Bug#25855) diff --git a/src/xdisp.c b/src/xdisp.c index b0644882bd..91eef0ec47 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20733,6 +20733,12 @@ display_line (struct it *it) } it->continuation_lines_width = 0; + /* Reset those iterator values set from display property + values. This is for the case when the display property + ends at ZV, and is not a replacing property, so pop_it is + not called. */ + it->font_height = Qnil; + it->voffset = 0; row->ends_at_zv_p = true; /* A row that displays right-to-left text must always have its last face extended all the way to the end of line, @@ -20919,6 +20925,8 @@ display_line (struct it *it) { row->exact_window_width_line_p = true; it->continuation_lines_width = 0; + it->font_height = Qnil; + it->voffset = 0; row->continued_p = false; row->ends_at_zv_p = true; } @@ -21236,6 +21244,8 @@ display_line (struct it *it) if (!get_next_display_element (it)) { it->continuation_lines_width = 0; + it->font_height = Qnil; + it->voffset = 0; row->ends_at_zv_p = true; row->exact_window_width_line_p = true; break;