------------------------------------------------------------ revno: 115032 committer: Michael Albinus branch nick: trunk timestamp: Fri 2013-11-08 10:31:50 +0100 message: * net/tramp-sh.el (tramp-set-remote-path, tramp-get-ls-command): Remove instrumentation code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-08 08:22:50 +0000 +++ lisp/ChangeLog 2013-11-08 09:31:50 +0000 @@ -1,3 +1,8 @@ +2013-11-08 Michael Albinus + + * net/tramp-sh.el (tramp-set-remote-path, tramp-get-ls-command): + Remove instrumentation code. + 2013-11-08 Glenn Morris * progmodes/autoconf.el (autoconf-mode): === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-11-07 11:13:41 +0000 +++ lisp/net/tramp-sh.el 2013-11-08 09:31:50 +0000 @@ -3576,12 +3576,6 @@ I.e., for each directory in `tramp-remote-path', it is tested whether it exists and if so, it is added to the environment variable PATH." - (when (featurep 'ert) - (ignore-errors - (with-demoted-errors - (message - "tramp-set-remote-path:\n%s\n" - (tramp-send-command-and-read vec "echo PATH=$PATH"))))) (tramp-message vec 5 "Setting $PATH environment variable") (tramp-send-command vec (format "PATH=%s; export PATH" @@ -4837,23 +4831,7 @@ remote-path))))) (defun tramp-get-ls-command (vec) -; (with-tramp-connection-property vec "ls" - (when (featurep 'ert) - (ignore-errors - (with-demoted-errors - (message - "tramp-get-ls-command printenv:\n%s\n" - (tramp-send-command-and-read - vec "echo \"\\\"`(printenv | sort) || exit`\\\"\""))) - (with-demoted-errors - (message - "tramp-get-ls-command getconf PATH:\n%s\n" - (tramp-send-command-and-read - vec "echo \\\"`getconf PATH 2>/dev/null || exit`\\\""))) - (with-demoted-errors - (message - "tramp-get-ls-command whereis ls:\n%s\n" - (tramp-send-command-and-read vec "echo \"\\\"`whereis ls || exit`\\\"\""))))) + (with-tramp-connection-property vec "ls" (tramp-message vec 5 "Finding a suitable `ls' command") (or (catch 'ls-found @@ -4875,7 +4853,7 @@ (setq result (concat result " --color=never"))) (throw 'ls-found result)) (setq dl (cdr dl)))))) - (tramp-error vec 'file-error "Couldn't find a proper `ls' command")));) + (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))) (defun tramp-get-ls-command-with-dired (vec) (save-match-data ------------------------------------------------------------ revno: 115031 committer: Michael Albinus branch nick: trunk timestamp: Fri 2013-11-08 10:31:15 +0100 message: * automated/file-notify-tests.el: * automated/tramp-tests.el: Add `tramp-own-remote-path' to `tramp-remote-path' when running on hydra. (tramp-test07-file-exists-p): Remove instrumentation code. (tramp-test26-process-file): Don't use "/bin/true" and "/bin/false", these paths do not exist on hydra. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-08 07:52:28 +0000 +++ test/ChangeLog 2013-11-08 09:31:15 +0000 @@ -1,7 +1,11 @@ 2013-11-08 Michael Albinus + * automated/file-notify-tests.el: * automated/tramp-tests.el: Add `tramp-own-remote-path' to - `tramp-remote-path'. + `tramp-remote-path' when running on hydra. + (tramp-test07-file-exists-p): Remove instrumentation code. + (tramp-test26-process-file): Don't use "/bin/true" and + "/bin/false", these paths do not exist on hydra. 2013-11-08 Helmut Eller === modified file 'test/automated/file-notify-tests.el' --- test/automated/file-notify-tests.el 2013-10-24 07:38:45 +0000 +++ test/automated/file-notify-tests.el 2013-11-08 09:31:15 +0000 @@ -46,6 +46,9 @@ (setq tramp-verbose 0 tramp-message-show-message nil) (when noninteractive (defalias 'tramp-read-passwd 'ignore)) +;; This shall happen on hydra only. +(when (getenv "NIX_STORE") + (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) ;; We do not want to try and fail `file-notify-add-watch'. (defun file-notify--test-local-enabled () === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2013-11-08 07:52:28 +0000 +++ test/automated/tramp-tests.el 2013-11-08 09:31:15 +0000 @@ -19,13 +19,17 @@ ;;; Commentary: -;; Some of the tests are intended to run over remote files. Set +;; The tests require a recent ert.el from Emacs 24.4. + +;; Some of the tests require access to a remote host files. Set ;; `tramp-test-temporary-file-directory' to a suitable value. It must ;; NOT require an interactive password prompt, when running the tests ;; in batch mode. -;; If you want to skip tests for remote files, set this variable to -;; `null-device'. +;; If you want to skip tests accessing a remote host, set this +;; variable to `null-device'. + +;; A whole test run can be performed calling the command `tramp-test-all'. ;;; Code: @@ -40,10 +44,9 @@ (setq tramp-verbose 0 tramp-message-show-message nil) (when noninteractive (defalias 'tramp-read-passwd 'ignore)) -;; This shall happen on hydra only; we need a proper test. Check -;; `process-environment' for a hint. -(add-to-list 'tramp-remote-path 'tramp-own-remote-path) -(message "%s" process-environment) +;; This shall happen on hydra only. +(when (getenv "NIX_STORE") + (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) (defvar tramp--test-enabled-checked nil "Cached result of `tramp--test-enabled'. @@ -506,25 +509,13 @@ (ert-deftest tramp-test07-file-exists-p () "Check `file-exist-p', `write-region' and `delete-file'." - (condition-case err - (with-timeout (20 (should-not 'timeout)) - (message "tramp--test-enabled") - (message "%S" (tramp--test-enabled)) - (skip-unless (tramp--test-enabled)) - (let ((tmp-name (tramp--test-make-temp-name))) - (message "file-exists-p") - (should-not (file-exists-p tmp-name)) - (message "write-region") - (write-region "foo" nil tmp-name) - (message "file-exists-p") - (should (file-exists-p tmp-name)) - (message "delete-file") - (delete-file tmp-name) - (message "file-exists-p") - (should-not (file-exists-p tmp-name)))) - ((error quit) - (message "%S" err) - (signal (car err) (cdr err))))) + (skip-unless (tramp--test-enabled)) + (let ((tmp-name (tramp--test-make-temp-name))) + (should-not (file-exists-p tmp-name)) + (write-region "foo" nil tmp-name) + (should (file-exists-p tmp-name)) + (delete-file tmp-name) + (should-not (file-exists-p tmp-name)))) (ert-deftest tramp-test08-file-local-copy () "Check `file-local-copy'." @@ -930,8 +921,8 @@ "Check `process-file'." (skip-unless (tramp--test-enabled)) (let ((default-directory tramp-test-temporary-file-directory)) - (should (zerop (process-file "/bin/true"))) - (should-not (zerop (process-file "/bin/false"))) + (should (zerop (process-file "true"))) + (should-not (zerop (process-file "false"))) (with-temp-buffer (should (zerop (process-file "ls" nil t))) (should (> (point-max) (point-min)))))) ------------------------------------------------------------ revno: 115030 committer: Alex Schroeder branch nick: trunk timestamp: Fri 2013-11-08 09:49:40 +0100 message: Fix a typo in (epa) Encrypting/decrypting *.gpg files diff: === modified file 'doc/misc/epa.texi' --- doc/misc/epa.texi 2013-08-13 07:02:00 +0000 +++ doc/misc/epa.texi 2013-11-08 08:49:40 +0000 @@ -396,7 +396,7 @@ variable for this. @vindex epa-file-encrypt-to -For example, if you want an Elisp file should be encrypted with a +For example, if you want an Elisp file to be encrypted with a public key associated with an email address @samp{ueno@@unixuser.org}, add the following line to the beginning of the file. ------------------------------------------------------------ revno: 115029 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-11-08 00:22:50 -0800 message: Add missing ChangeLog entry from r112851 http://lists.gnu.org/archive/html/emacs-diffs/2013-06/msg00043.html diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-08 07:36:54 +0000 +++ lisp/ChangeLog 2013-11-08 08:22:50 +0000 @@ -6635,6 +6635,13 @@ * emacs-lisp/macroexp.el (macroexp--compiling-p): New function. (macroexp--warn-and-return): Use it. +2013-06-05 Stefan Monnier + + * lisp/subr.el: Convert to lexical binding. + (overriding-local-map): Make obsolete. + (add-to-list): Doc fix. Add compiler macro. + (read-key): Swap values of local maps. + 2013-06-05 Leo Liu * eshell/esh-mode.el (eshell-mode): Fix key bindings. ------------------------------------------------------------ revno: 115028 committer: Michael Albinus branch nick: trunk timestamp: Fri 2013-11-08 08:52:28 +0100 message: * automated/tramp-tests.el: Add `tramp-own-remote-path' to `tramp-remote-path'. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-08 04:40:51 +0000 +++ test/ChangeLog 2013-11-08 07:52:28 +0000 @@ -1,3 +1,8 @@ +2013-11-08 Michael Albinus + + * automated/tramp-tests.el: Add `tramp-own-remote-path' to + `tramp-remote-path'. + 2013-11-08 Helmut Eller * automated/process-tests.el: New file. === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2013-11-06 08:33:02 +0000 +++ test/automated/tramp-tests.el 2013-11-08 07:52:28 +0000 @@ -40,6 +40,10 @@ (setq tramp-verbose 0 tramp-message-show-message nil) (when noninteractive (defalias 'tramp-read-passwd 'ignore)) +;; This shall happen on hydra only; we need a proper test. Check +;; `process-environment' for a hint. +(add-to-list 'tramp-remote-path 'tramp-own-remote-path) +(message "%s" process-environment) (defvar tramp--test-enabled-checked nil "Cached result of `tramp--test-enabled'. ------------------------------------------------------------ revno: 115027 fixes bug: http://debbugs.gnu.org/15822 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-11-07 23:36:54 -0800 message: * lisp/progmodes/autoconf.el (autoconf-mode): Tweak comment-start-skip. See also http://debbugs.gnu.org/10033 diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-08 04:33:32 +0000 +++ lisp/ChangeLog 2013-11-08 07:36:54 +0000 @@ -1,3 +1,8 @@ +2013-11-08 Glenn Morris + + * progmodes/autoconf.el (autoconf-mode): + Tweak comment-start-skip. (Bug#15822) + 2013-11-08 Stefan Monnier * progmodes/sh-script.el (sh-smie--sh-keyword-in-p): Don't inf-loop === modified file 'lisp/progmodes/autoconf.el' --- lisp/progmodes/autoconf.el 2013-05-08 16:27:53 +0000 +++ lisp/progmodes/autoconf.el 2013-11-08 07:36:54 +0000 @@ -79,7 +79,8 @@ (setq-local parens-require-spaces nil) ; for M4 arg lists (setq-local defun-prompt-regexp "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+") (setq-local comment-start "dnl ") - (setq-local comment-start-skip "\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +") + ;; We want to avoid matching "dnl" in other text. + (setq-local comment-start-skip "\\(?:\\(\\W\\|^\\)dnl\\|#\\) +") (setq-local syntax-propertize-function (syntax-propertize-rules ("\\" (0 "<")))) (setq-local font-lock-defaults ------------------------------------------------------------ revno: 115026 fixes bug: http://debbugs.gnu.org/15825 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-11-07 23:28:21 -0800 message: * chartab.c (make_sub_char_table): Fix size typo. This bug was introduced in my 2013-06-21 change, and caused struct Lisp_Sub_Char_Table objects to be given too many slots, which broke 'make -C admin/unidata'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-07 22:21:08 +0000 +++ src/ChangeLog 2013-11-08 07:28:21 +0000 @@ -1,3 +1,10 @@ +2013-11-08 Paul Eggert + + * chartab.c (make_sub_char_table): Fix size typo (Bug#15825). + This bug was introduced in my 2013-06-21 change, and caused + struct Lisp_Sub_Char_Table objects to be given too many slots, + which broke 'make -C admin/unidata'. + 2013-11-07 Jan Djärv Import changes from mac-port 4.5. === modified file 'src/chartab.c' --- src/chartab.c 2013-11-04 06:09:03 +0000 +++ src/chartab.c 2013-11-08 07:28:21 +0000 @@ -141,7 +141,8 @@ make_sub_char_table (int depth, int min_char, Lisp_Object defalt) { Lisp_Object table; - int size = CHAR_TABLE_STANDARD_SLOTS + chartab_size[depth]; + int size = (PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) + + chartab_size[depth]); table = Fmake_vector (make_number (size), defalt); XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE); ------------------------------------------------------------ revno: 115025 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-07 23:40:51 -0500 message: Rename test/automated/sentinel-tests.el to process-tests.el diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-08 03:28:19 +0000 +++ test/ChangeLog 2013-11-08 04:40:51 +0000 @@ -1,6 +1,6 @@ 2013-11-08 Helmut Eller - * automated/sentinel-tests.el: New file. + * automated/process-tests.el: New file. 2013-11-08 Dmitry Gutov === renamed file 'test/automated/sentinel-tests.el' => 'test/automated/process-tests.el' ------------------------------------------------------------ revno: 115024 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15826 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-07 23:33:32 -0500 message: * lisp/progmodes/sh-script.el (sh-smie--sh-keyword-in-p): Don't inf-loop at bobp. (sh-smie--sh-keyword-in-p): Recognize keywords at bobp. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-08 04:09:56 +0000 +++ lisp/ChangeLog 2013-11-08 04:33:32 +0000 @@ -1,3 +1,9 @@ +2013-11-08 Stefan Monnier + + * progmodes/sh-script.el (sh-smie--sh-keyword-in-p): Don't inf-loop + at bobp (bug#15826). + (sh-smie--sh-keyword-in-p): Recognize keywords at bobp. + 2013-11-08 Darren Hoo * man.el (Man-start-calling): New macro, extracted from === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2013-10-24 21:16:20 +0000 +++ lisp/progmodes/sh-script.el 2013-11-08 04:33:32 +0000 @@ -1730,7 +1730,7 @@ like a keyword, then it is a keyword." (let ((prev (funcall smie-backward-token-function))) (if (zerop (length prev)) - (looking-back "\\s(" (1- (point))) + (looking-back "\\`\\|\\s(" (1- (point))) (assoc prev smie-grammar)))) (defun sh-smie--newline-semi-p (&optional tok) @@ -1804,12 +1804,14 @@ (setq prev (funcall smie-backward-token-function)) (cond ((zerop (length prev)) - (if newline - (progn (cl-assert words) (setq res 'word)) + (cond + (newline (cl-assert words) (setq res 'word)) + ((bobp) (setq res 'word)) + (t (setq words t) (condition-case nil (forward-sexp -1) - (scan-error (setq res 'unknown))))) + (scan-error (setq res 'unknown)))))) ((equal prev ";") (if words (setq newline t) (setq res 'keyword))) ------------------------------------------------------------ revno: 115023 author: Darren Hoo committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-07 23:09:56 -0500 message: * lisp/man.el (Man-start-calling): New macro, extracted from Man-getpage-in-background. (Man-getpage-in-background): Use it. (Man-update-manpage): New command. (Man-mode-map): Bind it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-08 02:31:51 +0000 +++ lisp/ChangeLog 2013-11-08 04:09:56 +0000 @@ -1,3 +1,11 @@ +2013-11-08 Darren Hoo + + * man.el (Man-start-calling): New macro, extracted from + Man-getpage-in-background. + (Man-getpage-in-background): Use it. + (Man-update-manpage): New command. + (Man-mode-map): Bind it. + 2013-11-08 Dmitry Gutov * progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences @@ -5,8 +13,8 @@ (ruby-smie--args-separator-p): Prohibit keyword "do" as the first argument. Prohibit opening curly brace because it could only be a block opener in that position. - (ruby-smie--forward-token, ruby-smie--backward-token): Separate - "|" from "&" or "*" going after it. That can happen in block + (ruby-smie--forward-token, ruby-smie--backward-token): + Separate "|" from "&" or "*" going after it. That can happen in block arguments. (ruby-smie--indent-to-stmt): New function, seeks the end of previous statement or beginning of buffer. === modified file 'lisp/man.el' --- lisp/man.el 2013-10-27 02:02:02 +0000 +++ lisp/man.el 2013-11-08 04:09:56 +0000 @@ -448,6 +448,7 @@ (define-key map "s" 'Man-goto-see-also-section) (define-key map "k" 'Man-kill) (define-key map "q" 'Man-quit) + (define-key map "u" 'Man-update-manpage) (define-key map "m" 'man) ;; Not all the man references get buttons currently. The text in the ;; manual page can contain references to other man pages @@ -1000,6 +1001,52 @@ (error "No item under point") (man man-args))) +(defmacro Man-start-calling (&rest body) + "Start the man command in `body' after setting up the environment" + `(let ((process-environment (copy-sequence process-environment)) + ;; The following is so Awk script gets \n intact + ;; But don't prevent decoding of the outside. + (coding-system-for-write 'raw-text-unix) + ;; We must decode the output by a coding system that the + ;; system's locale suggests in multibyte mode. + (coding-system-for-read locale-coding-system) + ;; Avoid possible error by using a directory that always exists. + (default-directory + (if (and (file-directory-p default-directory) + (not (find-file-name-handler default-directory + 'file-directory-p))) + default-directory + "/"))) + ;; Prevent any attempt to use display terminal fanciness. + (setenv "TERM" "dumb") + ;; In Debian Woody, at least, we get overlong lines under X + ;; unless COLUMNS or MANWIDTH is set. This isn't a problem on + ;; a tty. man(1) says: + ;; MANWIDTH + ;; If $MANWIDTH is set, its value is used as the line + ;; length for which manual pages should be formatted. + ;; If it is not set, manual pages will be formatted + ;; with a line length appropriate to the current ter- + ;; minal (using an ioctl(2) if available, the value of + ;; $COLUMNS, or falling back to 80 characters if nei- + ;; ther is available). + (when (or window-system + (not (or (getenv "MANWIDTH") (getenv "COLUMNS")))) + ;; This isn't strictly correct, since we don't know how + ;; the page will actually be displayed, but it seems + ;; reasonable. + (setenv "COLUMNS" (number-to-string + (cond + ((and (integerp Man-width) (> Man-width 0)) + Man-width) + (Man-width (frame-width)) + ((window-width)))))) + ;; Since man-db 2.4.3-1, man writes plain text with no escape + ;; sequences when stdout is not a tty. In 2.5.0, the following + ;; env-var was added to allow control of this (see Debian Bug#340673). + (setenv "MAN_KEEP_FORMATTING" "1") + ,@body)) + (defun Man-getpage-in-background (topic) "Use TOPIC to build and fire off the manpage and cleaning command. Return the buffer in which the manpage will appear." @@ -1015,51 +1062,8 @@ (setq buffer-undo-list t) (setq Man-original-frame (selected-frame)) (setq Man-arguments man-args)) - (let ((process-environment (copy-sequence process-environment)) - ;; The following is so Awk script gets \n intact - ;; But don't prevent decoding of the outside. - (coding-system-for-write 'raw-text-unix) - ;; We must decode the output by a coding system that the - ;; system's locale suggests in multibyte mode. - (coding-system-for-read - (if (default-value 'enable-multibyte-characters) - locale-coding-system 'raw-text-unix)) - ;; Avoid possible error by using a directory that always exists. - (default-directory - (if (and (file-directory-p default-directory) - (not (find-file-name-handler default-directory - 'file-directory-p))) - default-directory - "/"))) - ;; Prevent any attempt to use display terminal fanciness. - (setenv "TERM" "dumb") - ;; In Debian Woody, at least, we get overlong lines under X - ;; unless COLUMNS or MANWIDTH is set. This isn't a problem on - ;; a tty. man(1) says: - ;; MANWIDTH - ;; If $MANWIDTH is set, its value is used as the line - ;; length for which manual pages should be formatted. - ;; If it is not set, manual pages will be formatted - ;; with a line length appropriate to the current ter- - ;; minal (using an ioctl(2) if available, the value of - ;; $COLUMNS, or falling back to 80 characters if nei- - ;; ther is available). - (when (or window-system - (not (or (getenv "MANWIDTH") (getenv "COLUMNS")))) - ;; This isn't strictly correct, since we don't know how - ;; the page will actually be displayed, but it seems - ;; reasonable. - (setenv "COLUMNS" (number-to-string - (cond - ((and (integerp Man-width) (> Man-width 0)) - Man-width) - (Man-width (frame-width)) - ((window-width)))))) - ;; Since man-db 2.4.3-1, man writes plain text with no escape - ;; sequences when stdout is not a tty. In 2.5.0, the following - ;; env-var was added to allow control of this (see Debian Bug#340673). - (setenv "MAN_KEEP_FORMATTING" "1") - (if (fboundp 'start-process) + (Man-start-calling + (if (fboundp 'start-process) (set-process-sentinel (start-process manual-program buffer (if (memq system-type '(cygwin windows-nt)) @@ -1081,7 +1085,34 @@ exit-status))) (setq msg exit-status)) (Man-bgproc-sentinel bufname msg))))) - buffer)) + buffer)) + +(defun Man-update-manpage () + "Reformat current manpage by calling the man command again synchronously." + (interactive) + (when (eq Man-arguments nil) + ;;this shouldn't happen unless it is not in a Man buffer." + (error "Man-arguments not initialized")) + (let ((old-pos (point)) + (text (current-word)) + (old-size (buffer-size)) + (inhibit-read-only t) + (buffer-read-only nil)) + (erase-buffer) + (Man-start-calling + (call-process shell-file-name nil (list (current-buffer) nil) nil + shell-command-switch + (format (Man-build-man-command) Man-arguments))) + (if Man-fontify-manpage-flag + (Man-fontify-manpage) + (Man-cleanup-manpage)) + (goto-char old-pos) + ;;restore the point, not strictly right. + (unless (or (eq text nil) (= old-size (buffer-size))) + (let ((case-fold-search nil)) + (if (> old-size (buffer-size)) + (search-backward text nil t)) + (search-forward text nil t))))) (defun Man-notify-when-ready (man-buffer) "Notify the user when MAN-BUFFER is ready. ------------------------------------------------------------ revno: 115022 committer: Dmitry Gutov branch nick: trunk timestamp: Fri 2013-11-08 05:30:24 +0200 message: * indent/ruby.rb: New example diff: === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-11-08 02:31:51 +0000 +++ test/indent/ruby.rb 2013-11-08 03:30:24 +0000 @@ -284,3 +284,10 @@ tee end end + +# Failing with SMIE: + +foo || + begin + bar + end ------------------------------------------------------------ revno: 115021 author: Helmut Eller committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-07 22:28:19 -0500 message: * test/automated/sentinel-tests.el: New file. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-08 02:31:51 +0000 +++ test/ChangeLog 2013-11-08 03:28:19 +0000 @@ -1,3 +1,7 @@ +2013-11-08 Helmut Eller + + * automated/sentinel-tests.el: New file. + 2013-11-08 Dmitry Gutov * indent/ruby.rb: New examples. === added file 'test/automated/sentinel-tests.el' --- test/automated/sentinel-tests.el 1970-01-01 00:00:00 +0000 +++ test/automated/sentinel-tests.el 2013-11-08 03:28:19 +0000 @@ -0,0 +1,53 @@ +;;; process-tests.el --- Testing the process facilities + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) + +;; Timeout in seconds; the test fails if the timeout is reached. +(defvar process-test-sentinel-wait-timeout 2.0) + +;; Start a process that exits immediately. Call WAIT-FUNCTION, +;; possibly multiple times, to wait for the process to complete. +(defun process-test-sentinel-wait-function-working-p (wait-function) + (let ((proc (start-process "test" nil "bash" "-c" "exit 20")) + (sentinel-called nil) + (start-time (float-time))) + (set-process-sentinel proc (lambda (proc msg) + (setq sentinel-called t))) + (while (not (or sentinel-called + (> (- (float-time) start-time) + process-test-sentinel-wait-timeout))) + (funcall wait-function)) + (cl-assert (eq (process-status proc) 'exit)) + (cl-assert (= (process-exit-status proc) 20)) + sentinel-called)) + +(ert-deftest process-test-sentinel-accept-process-output () + (should (process-test-sentinel-wait-function-working-p + #'accept-process-output))) + +(ert-deftest process-test-sentinel-sit-for () + (should + (process-test-sentinel-wait-function-working-p (lambda () (sit-for 0.01 t))))) + +(provide 'process-tests) ------------------------------------------------------------ revno: 115020 committer: Dmitry Gutov branch nick: trunk timestamp: Fri 2013-11-08 04:31:51 +0200 message: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences of "and", "or", "&&" and "||". (ruby-smie--args-separator-p): Prohibit keyword "do" as the first argument. Prohibit opening curly brace because it could only be a block opener in that position. (ruby-smie--forward-token, ruby-smie--backward-token): Separate "|" from "&" or "*" going after it. That can happen in block arguments. (ruby-smie--indent-to-stmt): New function, seeks the end of previous statement or beginning of buffer. (ruby-smie-rules): Use it. (ruby-smie-rules): Check if there's a ":" before a curly block opener candidate; if there is, it's a hash. * test/indent/ruby.rb: New examples. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-07 19:30:43 +0000 +++ lisp/ChangeLog 2013-11-08 02:31:51 +0000 @@ -1,3 +1,19 @@ +2013-11-08 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences + of "and", "or", "&&" and "||". + (ruby-smie--args-separator-p): Prohibit keyword "do" as the first + argument. Prohibit opening curly brace because it could only be a + block opener in that position. + (ruby-smie--forward-token, ruby-smie--backward-token): Separate + "|" from "&" or "*" going after it. That can happen in block + arguments. + (ruby-smie--indent-to-stmt): New function, seeks the end of + previous statement or beginning of buffer. + (ruby-smie-rules): Use it. + (ruby-smie-rules): Check if there's a ":" before a curly block + opener candidate; if there is, it's a hash. + 2013-11-07 Stefan Monnier * emacs-lisp/cl-macs.el (cl-symbol-macrolet): Use macroexp-progn. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-11-07 03:02:01 +0000 +++ lisp/progmodes/ruby-mode.el 2013-11-08 02:31:51 +0000 @@ -277,7 +277,10 @@ (smie-bnf->prec2 '((id) (insts (inst) (insts ";" insts)) - (inst (exp) (inst "iuwu-mod" exp)) + (inst (exp) (inst "iuwu-mod" exp) + ;; Somewhat incorrect (both can be used multiple times), + ;; but avoids lots of conflicts: + (exp "and" exp) (exp "or" exp)) (exp (exp1) (exp "," exp) (exp "=" exp) (id " @ " exp) (exp "." id)) @@ -323,14 +326,13 @@ (left "+" "-") (left "*" "/" "%" "**") ;; (left "|") ; FIXME: Conflicts with | after block parameters. + (left "&&" "||") (left "^" "&") (nonassoc "<=>") (nonassoc ">" ">=" "<" "<=") (nonassoc "==" "===" "!=") (nonassoc "=~" "!~") - (left "<<" ">>") - (left "&&" "||") - (left "and" "or")))))) + (left "<<" ">>")))))) (defun ruby-smie--bosp () (save-excursion (skip-chars-backward " \t") @@ -379,13 +381,11 @@ (save-excursion (goto-char pos) (or (and (eq (char-syntax (char-after)) ?w) - ;; FIXME: Also "do". But alas, that breaks some - ;; indentation cases. (not (looking-at (regexp-opt '("unless" "if" "while" "until" - "else" "elsif" "end" "and" "or") + "else" "elsif" "do" "end" "and" "or") 'symbols)))) (memq (syntax-after pos) '(7 15)) - (looking-at "\\s(\\|[-+!~:]\\sw"))))) + (looking-at "[([]\\|[-+!~:]\\sw"))))) (defun ruby-smie--at-dot-call () (and (eq ?w (char-syntax (following-char))) @@ -424,7 +424,9 @@ ((member tok '("unless" "if" "while" "until")) (if (save-excursion (forward-word -1) (ruby-smie--bosp)) tok "iuwu-mod")) - ((equal tok "|") + ((string-match "|[*&]?" tok) + (forward-char (- 1 (length tok))) + (setq tok "|") (if (ruby-smie--opening-pipe-p) "opening-|" tok)) ((and (equal tok "") (looking-at "\\\\\n")) (goto-char (match-end 0)) (ruby-smie--forward-token)) @@ -466,6 +468,9 @@ tok "iuwu-mod")) ((equal tok "|") (if (ruby-smie--opening-pipe-p) "opening-|" tok)) + ((string-match-p "|[*&]" tok) + (forward-char 1) + (substring tok 1)) ((and (equal tok "") (eq ?\\ (char-before)) (looking-at "\n")) (forward-char -1) (ruby-smie--backward-token)) ((equal tok "do") @@ -478,6 +483,16 @@ (t ";"))) (t tok))))))) +(defun ruby-smie--indent-to-stmt () + (save-excursion + (let (parent) + (while (not (or (eq (car parent) t) + (equal (nth 2 parent) ";"))) + (setq parent (let (smie--parent) (smie-indent--parent))) + (when (numberp (nth 1 parent)) + (goto-char (nth 1 parent)))) + (cons 'column (smie-indent-virtual))))) + (defun ruby-smie-rules (kind token) (pcase (cons kind token) (`(:elem . basic) ruby-indent-level) @@ -498,9 +513,12 @@ (`(:before . ,(or `"(" `"[" `"{")) (cond ((and (equal token "{") - (not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";"))) + (not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";")) + (save-excursion + (forward-comment -1) + (not (eq (preceding-char) ?:)))) ;; Curly block opener. - (smie-rule-parent)) + (ruby-smie--indent-to-stmt)) ((smie-rule-hanging-p) ;; Treat purely syntactic block-constructs as being part of their parent, ;; when the opening statement is hanging. @@ -508,7 +526,7 @@ (when (eq t (car state)) (goto-char (cadr state)))) (cons 'column (smie-indent-virtual))))) (`(:after . " @ ") (smie-rule-parent)) - (`(:before . "do") (smie-rule-parent)) + (`(:before . "do") (ruby-smie--indent-to-stmt)) (`(,(or :before :after) . ".") (unless (smie-rule-parent-p ".") (smie-rule-parent ruby-indent-level))) === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-06 17:56:48 +0000 +++ test/ChangeLog 2013-11-08 02:31:51 +0000 @@ -1,3 +1,7 @@ +2013-11-08 Dmitry Gutov + + * indent/ruby.rb: New examples. + 2013-11-06 Glenn Morris * automated/Makefile.in (setwins): Avoid accidental matches. === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-11-07 03:02:01 +0000 +++ test/indent/ruby.rb 2013-11-08 02:31:51 +0000 @@ -117,6 +117,9 @@ e = 8 + 9 \ + 10 # '\' needed +foo = obj.bar { |m| tee(m) } + + obj.qux { |m| hum(m) } + begin foo ensure @@ -210,6 +213,14 @@ foo and bar +foo > bar && + tee < qux + +zux do + foo == bar and + tee == qux +end + foo ^ bar @@ -244,6 +255,14 @@ qux end +foo do |*args| + tee +end + +bar do |&block| + tee +end + foo = [1, 2, 3].map do |i| i + 1 end @@ -252,8 +271,16 @@ bar end -# Examples below still fail with `ruby-use-smie' on: - -bar.foo(tee) do # "." is parent to "do"; it shouldn't be. - bar +bar.foo(tee) do + bar +end + +bar.foo(tee) { + bar +} + +bar 1 do + foo 2 do + tee + end end ------------------------------------------------------------ revno: 115019 committer: Jan D. branch nick: trunk timestamp: Thu 2013-11-07 23:21:08 +0100 message: Import macfont changes from mac-port 4.5. * macfont.h (kCTVersionNumber10_9): Define if not defined. * macfont.m (mac_font_copy_default_descriptors_for_language) (mac_font_copy_default_name_for_charset_and_languages): Declare. (cf_charset_table): big-5-0 has uniquifier 0x4EDC. (macfont_language_default_font_names): New. (macfont_list): Rearrange language/charset code. (macfont_close): Don't check for macfont_info->cache. (mac_ctfont_create_preferred_family_for_attributes): New font selection code, call mac_font_copy_default_name_for_charset_and_languages. (mac_font_copy_default_descriptors_for_language) (mac_font_copy_default_name_for_charset_and_languages): New functions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-07 05:31:04 +0000 +++ src/ChangeLog 2013-11-07 22:21:08 +0000 @@ -1,3 +1,20 @@ +2013-11-07 Jan Djärv + + Import changes from mac-port 4.5. + * macfont.m (mac_font_copy_default_descriptors_for_language) + (mac_font_copy_default_name_for_charset_and_languages): Declare. + (cf_charset_table): big-5-0 has uniquifier 0x4EDC. + (macfont_language_default_font_names): New. + (macfont_list): Rearrange language/charset code. + (macfont_close): Don't check for macfont_info->cache. + (mac_ctfont_create_preferred_family_for_attributes): New font + selection code, call + mac_font_copy_default_name_for_charset_and_languages. + (mac_font_copy_default_descriptors_for_language) + (mac_font_copy_default_name_for_charset_and_languages): New functions. + + * macfont.h (kCTVersionNumber10_9): Define if not defined. + 2013-11-07 Paul Eggert Port to C11 aligned_alloc, and fix some integer overflows. === modified file 'src/macfont.h' --- src/macfont.h 2013-09-15 19:36:20 +0000 +++ src/macfont.h 2013-11-07 22:21:08 +0000 @@ -134,6 +134,9 @@ #define mac_nsctfont_copy_font_descriptor CTFontCopyFontDescriptor +#ifndef kCTVersionNumber10_9 +#define kCTVersionNumber10_9 0x00060000 +#endif #define MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE \ (CFSTR ("MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE")) === modified file 'src/macfont.m' --- src/macfont.m 2013-11-05 07:44:14 +0000 +++ src/macfont.m 2013-11-07 22:21:08 +0000 @@ -57,6 +57,13 @@ static CFStringRef mac_ctfont_create_preferred_family_for_attributes (CFDictionaryRef); static CFIndex mac_ctfont_shape (CTFontRef, CFStringRef, struct mac_glyph_layout *, CFIndex); +static CFArrayRef +mac_font_copy_default_descriptors_for_language (CFStringRef language); + +static CFStringRef +mac_font_copy_default_name_for_charset_and_languages (CFCharacterSetRef charset, + CFArrayRef languages); + #if USE_CT_GLYPH_INFO static CGGlyph mac_ctfont_get_glyph_for_cid (CTFontRef, CTCharacterCollection, @@ -676,7 +683,7 @@ { "iso8859-15", { 0x00A0, 0x00A1, 0x00D0, 0x0152 }}, { "iso8859-16", { 0x00A0, 0x0218}}, { "gb2312.1980-0", { 0x4E13 }, CFSTR ("zh-Hans")}, - { "big5-0", { /* 0xF6B1 in ftfont.c */ 0xF7E5 }, CFSTR ("zh-Hant") }, + { "big5-0", { /* 0xF6B1 in ftfont.c */ 0x4EDC }, CFSTR ("zh-Hant") }, { "jisx0208.1983-0", { 0x4E55 }, CFSTR ("ja")}, { "ksc5601.1987-0", { 0xAC00 }, CFSTR ("ko")}, { "cns11643.1992-1", { 0xFE32 }, CFSTR ("zh-Hant")}, @@ -700,9 +707,31 @@ { NULL } }; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 +static const struct +{ + CFStringRef language; + CFStringRef font_names[3]; +} macfont_language_default_font_names[] = { + { CFSTR ("ja"), { CFSTR ("HiraKakuProN-W3"), /* 10.5 - 10.9 */ + CFSTR ("HiraKakuPro-W3"), /* 10.4 */ + NULL }}, + { CFSTR ("ko"), { CFSTR ("AppleSDGothicNeo-Regular"), /* 10.8 - 10.9 */ + CFSTR ("AppleGothic"), /* 10.4 - 10.7 */ + NULL }}, + { CFSTR ("zh-Hans"), { CFSTR ("STHeitiSC-Light"), /* 10.6 - 10.9 */ + CFSTR ("STXihei"), /* 10.4 - 10.5 */ + NULL }}, + { CFSTR ("zh-Hant"), { CFSTR ("STHeitiTC-Light"), /* 10.6 - 10.9 */ + CFSTR ("LiHeiPro"), /* 10.4 - 10.5 */ + NULL }}, + { NULL } +}; +#endif + static CGFloat macfont_antialias_threshold; -void +static void macfont_update_antialias_threshold (void) { int threshold; @@ -2052,33 +2081,7 @@ if (! attributes) goto finish; - charset = ((CFCharacterSetRef) - CFDictionaryGetValue (attributes, - MAC_FONT_CHARACTER_SET_ATTRIBUTE)); - if (charset) - { - CFRetain (charset); - CFDictionaryRemoveValue (attributes, MAC_FONT_CHARACTER_SET_ATTRIBUTE); - } - else - { - val = assq_no_quit (QCscript, AREF (spec, FONT_EXTRA_INDEX)); - if (! NILP (val)) - { - val = assq_no_quit (XCDR (val), Vscript_representative_chars); - if (CONSP (val) && VECTORP (XCDR (val))) - chars = XCDR (val); - } - val = Qnil; - } - - languages = ((CFArrayRef) - CFDictionaryGetValue (attributes, MAC_FONT_LANGUAGES_ATTRIBUTE)); - if (languages) - { - CFRetain (languages); - CFDictionaryRemoveValue (attributes, MAC_FONT_LANGUAGES_ATTRIBUTE); - } + languages = CFDictionaryGetValue (attributes, MAC_FONT_LANGUAGES_ATTRIBUTE); if (INTEGERP (AREF (spec, FONT_SPACING_INDEX))) spacing = XINT (AREF (spec, FONT_SPACING_INDEX)); @@ -2162,6 +2165,31 @@ } } + charset = CFDictionaryGetValue (attributes, + MAC_FONT_CHARACTER_SET_ATTRIBUTE); + if (charset) + { + CFRetain (charset); + CFDictionaryRemoveValue (attributes, MAC_FONT_CHARACTER_SET_ATTRIBUTE); + } + else + { + val = assq_no_quit (QCscript, AREF (spec, FONT_EXTRA_INDEX)); + if (! NILP (val)) + { + val = assq_no_quit (XCDR (val), Vscript_representative_chars); + if (CONSP (val) && VECTORP (XCDR (val))) + chars = XCDR (val); + } + val = Qnil; + } + + if (languages) + { + CFRetain (languages); + CFDictionaryRemoveValue (attributes, MAC_FONT_LANGUAGES_ATTRIBUTE); + } + val = Qnil; extra = AREF (spec, FONT_EXTRA_INDEX); families_count = CFArrayGetCount (families); @@ -2590,25 +2618,20 @@ macfont_close (struct font *font) { struct macfont_info *macfont_info = (struct macfont_info *) font; - - if (macfont_info->cache) - { - int i; - - block_input (); - CFRelease (macfont_info->macfont); - CGFontRelease (macfont_info->cgfont); - if (macfont_info->screen_font) - CFRelease (macfont_info->screen_font); - macfont_release_cache (macfont_info->cache); - macfont_info->cache = NULL; - for (i = 0; i < macfont_info->metrics_nrows; i++) - if (macfont_info->metrics[i]) - xfree (macfont_info->metrics[i]); - if (macfont_info->metrics) - xfree (macfont_info->metrics); - unblock_input (); - } + int i; + + block_input (); + CFRelease (macfont_info->macfont); + CGFontRelease (macfont_info->cgfont); + if (macfont_info->screen_font) + CFRelease (macfont_info->screen_font); + macfont_release_cache (macfont_info->cache); + for (i = 0; i < macfont_info->metrics_nrows; i++) + if (macfont_info->metrics[i]) + xfree (macfont_info->metrics[i]); + if (macfont_info->metrics) + xfree (macfont_info->metrics); + unblock_input (); } static int @@ -2798,7 +2821,7 @@ return len; } -Lisp_Object +static Lisp_Object macfont_shape (Lisp_Object lgstring) { struct font *font; @@ -3335,49 +3358,80 @@ if (charset_string && CFStringGetLength (charset_string) > 0) { - CFAttributedStringRef attr_string = NULL; - CTLineRef ctline = NULL; - CFDictionaryRef attrs = - CFDictionaryCreate (NULL, NULL, NULL, 0, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - if (attrs) - { - attr_string = CFAttributedStringCreate (NULL, charset_string, attrs); - CFRelease (attrs); - } - if (attr_string) - { - ctline = CTLineCreateWithAttributedString (attr_string); - CFRelease (attr_string); - } - if (ctline) - { - CFArrayRef runs = CTLineGetGlyphRuns (ctline); - CFIndex i, nruns = CFArrayGetCount (runs); - CTFontRef font; - - for (i = 0; i < nruns; i++) - { - CTRunRef run = CFArrayGetValueAtIndex (runs, i); - CFDictionaryRef attributes = CTRunGetAttributes (run); - CTFontRef font_in_run; - - if (attributes == NULL) - break; - font_in_run = - CFDictionaryGetValue (attributes, kCTFontAttributeName); - if (font_in_run == NULL) - break; - if (i == 0) - font = font_in_run; - else if (!mac_ctfont_equal_in_postscript_name (font, font_in_run)) - break; - } - if (nruns > 0 && i == nruns) - result = CTFontCopyAttribute (font, kCTFontFamilyNameAttribute); - CFRelease (ctline); + CFStringRef keys[] = { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 + kCTLanguageAttributeName +#else + CFSTR ("NSLanguage") +#endif + }; + CFTypeRef values[] = {NULL}; + CFIndex num_values = 0; + CFArrayRef languages + = CFDictionaryGetValue (attributes, MAC_FONT_LANGUAGES_ATTRIBUTE); + + if (languages && CFArrayGetCount (languages) > 0) + { + if (CTGetCoreTextVersion () >= kCTVersionNumber10_9) + values[num_values++] = CFArrayGetValueAtIndex (languages, 0); + else + { + CFCharacterSetRef charset = + CFDictionaryGetValue (attributes, + MAC_FONT_CHARACTER_SET_ATTRIBUTE); + + result = mac_font_copy_default_name_for_charset_and_languages (charset, languages); + } + } + if (result == NULL) + { + CFAttributedStringRef attr_string = NULL; + CTLineRef ctline = NULL; + CFDictionaryRef attrs + = CFDictionaryCreate (NULL, (const void **) keys, + (const void **) values, num_values, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + + if (attrs) + { + attr_string = CFAttributedStringCreate (NULL, charset_string, + attrs); + CFRelease (attrs); + } + if (attr_string) + { + ctline = CTLineCreateWithAttributedString (attr_string); + CFRelease (attr_string); + } + if (ctline) + { + CFArrayRef runs = CTLineGetGlyphRuns (ctline); + CFIndex i, nruns = CFArrayGetCount (runs); + CTFontRef font; + + for (i = 0; i < nruns; i++) + { + CTRunRef run = CFArrayGetValueAtIndex (runs, i); + CFDictionaryRef attributes = CTRunGetAttributes (run); + CTFontRef font_in_run; + + if (attributes == NULL) + break; + font_in_run = + CFDictionaryGetValue (attributes, kCTFontAttributeName); + if (font_in_run == NULL) + break; + if (i == 0) + font = font_in_run; + else if (!mac_ctfont_equal_in_postscript_name (font, + font_in_run)) + break; + } + if (nruns > 0 && i == nruns) + result = CTFontCopyAttribute (font, kCTFontFamilyNameAttribute); + CFRelease (ctline); + } } } @@ -3571,7 +3625,7 @@ return ctline; } -CFIndex +static CFIndex mac_ctfont_shape (CTFontRef font, CFStringRef string, struct mac_glyph_layout *glyph_layouts, CFIndex glyph_len) { @@ -3724,7 +3778,7 @@ created by CFStringCreateWithCharacters as of Mac OS X 10.5.8 and 10.6.3. For now, we use the NSGlyphInfo version instead. */ #if USE_CT_GLYPH_INFO -CGGlyph +static CGGlyph mac_ctfont_get_glyph_for_cid (CTFontRef font, CTCharacterCollection collection, CGFontIndex cid) { @@ -3817,7 +3871,7 @@ } } -CFComparisonResult +static CFComparisonResult mac_font_family_compare (const void *val1, const void *val2, void *context) { CFStringRef family1 = (CFStringRef) val1, family2 = (CFStringRef) val2; @@ -3833,6 +3887,142 @@ } #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */ +static CFArrayRef +mac_font_copy_default_descriptors_for_language (CFStringRef language) +{ + CFArrayRef result = NULL; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + if (CTFontCopyDefaultCascadeListForLanguages != NULL) +#endif + { + CTFontRef user_font = + CTFontCreateUIFontForLanguage (kCTFontUserFontType, 0, language); + + if (user_font) + { + CFArrayRef languages = + CFArrayCreate (NULL, (const void **) &language, 1, + &kCFTypeArrayCallBacks); + + if (languages) + { + result = CTFontCopyDefaultCascadeListForLanguages (user_font, + languages); + CFRelease (languages); + } + CFRelease (user_font); + } + } +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + else /* CTFontCopyDefaultCascadeListForLanguages == NULL */ +#endif +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + { + CFIndex i; + + for (i = 0; macfont_language_default_font_names[i].language; i++) + { + if (CFStringCompare (macfont_language_default_font_names[i].language, + language, 0) == kCFCompareEqualTo) + { + CFMutableArrayRef descriptors = + CFArrayCreateMutable (NULL, 0, &kCFTypeArrayCallBacks); + + if (descriptors) + { + CFIndex j; + + for (j = 0; + macfont_language_default_font_names[i].font_names[j]; + j++) + { + CFDictionaryRef attributes = + CFDictionaryCreate (NULL, + ((const void **) + &MAC_FONT_NAME_ATTRIBUTE), + ((const void **) + &macfont_language_default_font_names[i].font_names[j]), + 1, &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + + if (attributes) + { + FontDescriptorRef pat_desc = + mac_font_descriptor_create_with_attributes (attributes); + + if (pat_desc) + { + FontDescriptorRef descriptor = + mac_font_descriptor_create_matching_font_descriptor (pat_desc, NULL); + + if (descriptor) + { + CFArrayAppendValue (descriptors, descriptor); + CFRelease (descriptor); + } + CFRelease (pat_desc); + } + CFRelease (attributes); + } + } + result = descriptors; + } + break; + } + } + } +#endif + + return result; +} + +static CFStringRef +mac_font_copy_default_name_for_charset_and_languages (CFCharacterSetRef charset, + CFArrayRef languages) +{ + CFStringRef result = NULL; + CFStringRef language = CFArrayGetValueAtIndex (languages, 0); + CFArrayRef descriptors = + mac_font_copy_default_descriptors_for_language (language); + + if (descriptors) + { + CFIndex i, count = CFArrayGetCount (descriptors); + + for (i = 0; i < count; i++) + { + FontDescriptorRef descriptor = + CFArrayGetValueAtIndex (descriptors, i); + + if (macfont_supports_charset_and_languages_p (descriptor, charset, + Qnil, languages)) + { + CFStringRef family = + mac_font_descriptor_copy_attribute (descriptor, + MAC_FONT_FAMILY_NAME_ATTRIBUTE); + if (family) + { + if (!CFStringHasPrefix (family, CFSTR (".")) + && (CFStringCompare (family, CFSTR ("LastResort"), 0) + != kCFCompareEqualTo)) + { + result = family; + break; + } + else + CFRelease (family); + } + } + } + CFRelease (descriptors); + } + + return result; +} + void * macfont_get_nsctfont (struct font *font) { ------------------------------------------------------------ revno: 115018 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-07 14:30:43 -0500 message: * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): Use macroexp-progn. (cl--block-wrapper): Fix last accidental change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-07 11:13:41 +0000 +++ lisp/ChangeLog 2013-11-07 19:30:43 +0000 @@ -1,3 +1,8 @@ +2013-11-07 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl-symbol-macrolet): Use macroexp-progn. + (cl--block-wrapper): Fix last accidental change. + 2013-11-07 Michael Albinus * net/tramp-sh.el (tramp-set-remote-path, tramp-get-ls-command): === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-11-07 04:38:00 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-11-07 19:30:43 +0000 @@ -1993,9 +1993,8 @@ (progn (fset 'macroexpand #'cl--sm-macroexpand) (let ((expansion - ;; FIXME: For N bindings, this will traverse `body' - ;; N times! - (macroexpand-all (cons 'progn body) + ;; FIXME: For N bindings, this will traverse `body' N times! + (macroexpand-all (macroexp-progn body) (cons (list (symbol-name (caar bindings)) (cl-cadar bindings)) macroexpand-all-environment)))) @@ -2739,7 +2738,7 @@ ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able ;; to indicate that this return value is already fully expanded. (if (cdr cl-entry) - `(catch ,(nth 1 cl-form) ,@(cdr cl-body)) + `(catch ,(nth 1 cl-form) ,@(macroexp-unprogn cl-body)) cl-body))) (cl-define-compiler-macro cl--block-throw (cl-tag cl-value) ------------------------------------------------------------ revno: 115017 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-11-07 12:13:41 +0100 message: * net/tramp-sh.el (tramp-set-remote-path, tramp-get-ls-command): Instrument, in order to hunt failure on hydra. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-07 04:38:00 +0000 +++ lisp/ChangeLog 2013-11-07 11:13:41 +0000 @@ -1,3 +1,8 @@ +2013-11-07 Michael Albinus + + * net/tramp-sh.el (tramp-set-remote-path, tramp-get-ls-command): + Instrument, in order to hunt failure on hydra. + 2013-11-05 Nathan Trapuzzano (tiny change) * emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-11-05 14:18:41 +0000 +++ lisp/net/tramp-sh.el 2013-11-07 11:13:41 +0000 @@ -3576,6 +3576,12 @@ I.e., for each directory in `tramp-remote-path', it is tested whether it exists and if so, it is added to the environment variable PATH." + (when (featurep 'ert) + (ignore-errors + (with-demoted-errors + (message + "tramp-set-remote-path:\n%s\n" + (tramp-send-command-and-read vec "echo PATH=$PATH"))))) (tramp-message vec 5 "Setting $PATH environment variable") (tramp-send-command vec (format "PATH=%s; export PATH" @@ -4831,7 +4837,23 @@ remote-path))))) (defun tramp-get-ls-command (vec) - (with-tramp-connection-property vec "ls" +; (with-tramp-connection-property vec "ls" + (when (featurep 'ert) + (ignore-errors + (with-demoted-errors + (message + "tramp-get-ls-command printenv:\n%s\n" + (tramp-send-command-and-read + vec "echo \"\\\"`(printenv | sort) || exit`\\\"\""))) + (with-demoted-errors + (message + "tramp-get-ls-command getconf PATH:\n%s\n" + (tramp-send-command-and-read + vec "echo \\\"`getconf PATH 2>/dev/null || exit`\\\""))) + (with-demoted-errors + (message + "tramp-get-ls-command whereis ls:\n%s\n" + (tramp-send-command-and-read vec "echo \"\\\"`whereis ls || exit`\\\"\""))))) (tramp-message vec 5 "Finding a suitable `ls' command") (or (catch 'ls-found @@ -4853,7 +4875,7 @@ (setq result (concat result " --color=never"))) (throw 'ls-found result)) (setq dl (cdr dl)))))) - (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))) + (tramp-error vec 'file-error "Couldn't find a proper `ls' command")));) (defun tramp-get-ls-command-with-dired (vec) (save-match-data ------------------------------------------------------------ revno: 115016 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-11-06 23:57:35 -0800 message: * admin/unidata/unidata-gen.el (unidata-gen-files): Update Unicode copyright diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-11-07 03:21:15 +0000 +++ admin/ChangeLog 2013-11-07 07:57:35 +0000 @@ -2,6 +2,7 @@ * unidata/unidata-gen.el (unidata-gen-files): Disable version-control in generated files. + Update Unicode Inc. copyright years. 2013-11-05 Glenn Morris === modified file 'admin/unidata/unidata-gen.el' --- admin/unidata/unidata-gen.el 2013-11-07 03:21:15 +0000 +++ admin/unidata/unidata-gen.el 2013-11-07 07:57:35 +0000 @@ -1230,7 +1230,7 @@ (setq describer (symbol-function describer))) (set-char-table-extra-slot table 3 describer)) (if (bobp) - (insert ";; Copyright (C) 1991-2009 Unicode, Inc. + (insert ";; Copyright (C) 1991-2013 Unicode, Inc. ;; This file was generated from the Unicode data files at ;; http://www.unicode.org/Public/UNIDATA/. ;; See lisp/international/README for the copyright and permission notice.\n")) ------------------------------------------------------------ revno: 115015 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-11-06 23:54:47 -0800 message: Update unicode README and related info diff: === modified file 'admin/unidata/copyright.html' --- admin/unidata/copyright.html 2012-04-07 14:26:14 +0000 +++ admin/unidata/copyright.html 2013-11-07 07:54:47 +0000 @@ -10,7 +10,7 @@ - + @@ -136,7 +136,7 @@
  1. Unicode Copyright.
      -
    1. Copyright © 1991-2012 Unicode, Inc. All rights reserved.
    2. +
    3. Copyright © 1991-2013 Unicode, Inc. All rights reserved.
    4. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and @@ -268,7 +268,7 @@

      NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.

      COPYRIGHT AND PERMISSION NOTICE

      -

      Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in +

      Copyright © 1991-2013 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.

      Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and === modified file 'lisp/international/README' --- lisp/international/README 2009-06-04 01:51:47 +0000 +++ lisp/international/README 2013-11-07 07:54:47 +0000 @@ -1,22 +1,19 @@ The following files in this directory are derived from the Unicode -Data File at http://www.unicode.org/Public/UNIDATA/UnicodeData.txt, -downloaded on 2006-05-23: +Data File at http://www.unicode.org/Public/UNIDATA/UnicodeData.txt: charprop.el uni-bidi.el uni-category.el uni-combining.el uni-comment.el uni-decimal.el uni-decomposition.el uni-digit.el uni-lowercase.el uni-mirrored.el uni-name.el uni-numeric.el uni-old-name.el uni-titlecase.el uni-uppercase.el -These files were generated from UnicodeData.txt using unidata-gen.el, -which is not included in the Emacs distribution; it can be found in -the admin/unidata directory of the Emacs source repository at -https://savannah.gnu.org/projects/emacs/ +These files were generated from the version admin/unidata/UnicodeData.txt +in the Emacs sources, using the file unidata-gen.el in the same directory. The file UnicodeData.txt is used under the terms of the following Copyright and Permission Notice: -Copyright (C) 1991-2009 Unicode, Inc. All rights reserved. Distributed +Copyright (C) 1991-2013 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining ------------------------------------------------------------ revno: 115014 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-11-06 21:31:04 -0800 message: Port to C11 aligned_alloc, and fix some integer overflows. * configure.ac (GMALLOC_OBJ): Initialize to empty if !system_malloc and doug_lea_malloc. (aligned_alloc): Test for existence if !GMALLOC_OBJ and not darwin. (posix_memalign): Test for existence only if !GMALLOC_OBJ and not darwin and !aligned_alloc. * src/alloc.c (USE_ALIGNED_ALLOC): New symbol. (USE_POSIX_MEMALIGN): Remove. All uses replaced with USE_ALIGNED_ALLOC, and use of posix_memalign replaced with aligned_alloc. (aligned_alloc): New function, defined or declared as needed. * src/conf_post.h (HAVE_POSIX_MEMALIGN) [DARWIN_OS]: Don't undef; configure.ac now does this. * src/gmalloc.c (aligned_alloc) [MSDOS]: New decl. (calloc, aligned_alloc): Check for integer overflow. (aligned_alloc): Rename from memalign. All uses changed. (memalign): New function, an alias for aligned_alloc. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-05 21:51:09 +0000 +++ ChangeLog 2013-11-07 05:31:04 +0000 @@ -1,3 +1,12 @@ +2013-11-07 Paul Eggert + + Port to C11 aligned_alloc. + * configure.ac (GMALLOC_OBJ): Initialize to empty if !system_malloc + and doug_lea_malloc. + (aligned_alloc): Test for existence if !GMALLOC_OBJ and not darwin. + (posix_memalign): Test for existence only if !GMALLOC_OBJ and + not darwin and !aligned_alloc. + 2013-11-05 Glenn Morris * configure.ac (abs_srcdir) [MINGW32]: No point setting it here, === modified file 'configure.ac' --- configure.ac 2013-11-05 21:51:09 +0000 +++ configure.ac 2013-11-07 05:31:04 +0000 @@ -1895,12 +1895,14 @@ darwin|sol2-10) system_malloc=yes ;; esac +GMALLOC_OBJ= if test "${system_malloc}" = "yes"; then - AC_DEFINE(SYSTEM_MALLOC, 1, [Define to use system malloc.]) + AC_DEFINE([SYSTEM_MALLOC], 1, + [Define to 1 to use the system memory allocator, even if it is not + Doug Lea style.]) GNU_MALLOC=no GNU_MALLOC_reason=" (The GNU allocators don't work with this system configuration.)" - GMALLOC_OBJ= VMLIMIT_OBJ= else test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o @@ -1929,7 +1931,8 @@ (Using Doug Lea's new malloc from the GNU C Library.)" fi AC_DEFINE(DOUG_LEA_MALLOC, 1, - [Define to 1 if you are using the GNU C Library.]) + [Define to 1 if the system memory allocator is Doug Lea style, + with malloc hooks and malloc_set_state.]) ## Use mmap directly for allocating larger buffers. ## FIXME this comes from src/s/{gnu,gnu-linux}.h: @@ -3372,11 +3375,18 @@ strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ gai_strerror getline getdelim sync \ -difftime posix_memalign \ +difftime \ getpwent endpwent getgrent endgrent \ touchlock \ cfmakeraw cfsetspeed copysign __executable_start log2) +dnl No need to check for aligned_alloc and posix_memalign if using +dnl gmalloc.o, as it supplies them. Don't use these functions on +dnl Darwin as they are incompatible with unexmacosx.c. +if test -z "$GMALLOC_OBJ" && test "$opsys" != darwin; then + AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break]) +fi + ## Eric Backus says, HP-UX 9.x on HP 700 machines ## has a broken `rint' in some library versions including math library ## version number A.09.05. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-06 21:17:26 +0000 +++ src/ChangeLog 2013-11-07 05:31:04 +0000 @@ -1,3 +1,17 @@ +2013-11-07 Paul Eggert + + Port to C11 aligned_alloc, and fix some integer overflows. + * alloc.c (USE_ALIGNED_ALLOC): New symbol. + (USE_POSIX_MEMALIGN): Remove. All uses replaced with USE_ALIGNED_ALLOC, + and use of posix_memalign replaced with aligned_alloc. + (aligned_alloc): New function, defined or declared as needed. + * conf_post.h (HAVE_POSIX_MEMALIGN) [DARWIN_OS]: + Don't undef; configure.ac now does this. + * gmalloc.c (aligned_alloc) [MSDOS]: New decl. + (calloc, aligned_alloc): Check for integer overflow. + (aligned_alloc): Rename from memalign. All uses changed. + (memalign): New function, an alias for aligned_alloc. + 2013-11-06 Stefan Monnier * xdisp.c (redisplay_internal): Fix typo in last change. === modified file 'src/alloc.c' --- src/alloc.c 2013-11-05 07:11:24 +0000 +++ src/alloc.c 2013-11-07 05:31:04 +0000 @@ -920,8 +920,20 @@ /* The entry point is lisp_align_malloc which returns blocks of at most BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ -#if defined (HAVE_POSIX_MEMALIGN) && defined (SYSTEM_MALLOC) -#define USE_POSIX_MEMALIGN 1 +#if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC +# define USE_ALIGNED_ALLOC 1 +/* Defined in gmalloc.c. */ +void *aligned_alloc (size_t, size_t); +#elif defined HAVE_ALIGNED_ALLOC +# define USE_ALIGNED_ALLOC 1 +#elif defined HAVE_POSIX_MEMALIGN +# define USE_ALIGNED_ALLOC 1 +static void * +aligned_alloc (size_t alignment, size_t size) +{ + void *p; + return posix_memalign (&p, alignment, size) == 0 ? p : 0; +} #endif /* BLOCK_ALIGN has to be a power of 2. */ @@ -931,7 +943,7 @@ malloc a chance to minimize the amount of memory wasted to alignment. It should be tuned to the particular malloc library used. On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best. - posix_memalign on the other hand would ideally prefer a value of 4 + aligned_alloc on the other hand would ideally prefer a value of 4 because otherwise, there's 1020 bytes wasted between each ablocks. In Emacs, testing shows that those 1020 can most of the time be efficiently used by malloc to place other objects, so a value of 0 can @@ -976,7 +988,7 @@ struct ablock blocks[ABLOCKS_SIZE]; }; -/* Size of the block requested from malloc or posix_memalign. */ +/* Size of the block requested from malloc or aligned_alloc. */ #define ABLOCKS_BYTES (sizeof (struct ablocks) - BLOCK_PADDING) #define ABLOCK_ABASE(block) \ @@ -988,7 +1000,7 @@ #define ABLOCKS_BUSY(abase) ((abase)->blocks[0].abase) /* Pointer to the (not necessarily aligned) malloc block. */ -#ifdef USE_POSIX_MEMALIGN +#ifdef USE_ALIGNED_ALLOC #define ABLOCKS_BASE(abase) (abase) #else #define ABLOCKS_BASE(abase) \ @@ -1027,13 +1039,8 @@ mallopt (M_MMAP_MAX, 0); #endif -#ifdef USE_POSIX_MEMALIGN - { - int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); - if (err) - base = NULL; - abase = base; - } +#ifdef USE_ALIGNED_ALLOC + abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES); #else base = malloc (ABLOCKS_BYTES); abase = ALIGN (base, BLOCK_ALIGN); === modified file 'src/conf_post.h' --- src/conf_post.h 2013-10-03 07:06:52 +0000 +++ src/conf_post.h 2013-11-07 05:31:04 +0000 @@ -49,8 +49,6 @@ #define malloc unexec_malloc #define realloc unexec_realloc #define free unexec_free -/* Don't use posix_memalign because it is not compatible with unexmacosx.c. */ -#undef HAVE_POSIX_MEMALIGN #endif /* The following solves the problem that Emacs hangs when evaluating (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile === modified file 'src/gmalloc.c' --- src/gmalloc.c 2013-08-15 16:37:15 +0000 +++ src/gmalloc.c 2013-11-07 05:31:04 +0000 @@ -58,6 +58,7 @@ /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ #ifdef MSDOS +extern void *aligned_alloc (size_t, size_t); extern void *memalign (size_t, size_t); extern int posix_memalign (void **, size_t, size_t); #endif @@ -143,11 +144,11 @@ /* Free list headers for each fragment size. */ extern struct list _fraghead[]; -/* List of blocks allocated with `memalign' (or `valloc'). */ +/* List of blocks allocated with aligned_alloc and friends. */ struct alignlist { struct alignlist *next; - void *aligned; /* The address that memaligned returned. */ + void *aligned; /* The address that aligned_alloc returned. */ void *exact; /* The address that malloc returned. */ }; extern struct alignlist *_aligned_blocks; @@ -977,7 +978,7 @@ /* Debugging hook for free. */ void (*__free_hook) (void *__ptr); -/* List of blocks allocated by memalign. */ +/* List of blocks allocated by aligned_alloc. */ struct alignlist *_aligned_blocks = NULL; /* Return memory to the heap. @@ -1487,13 +1488,20 @@ /* Allocate an array of NMEMB elements each SIZE bytes long. The entire array is initialized to zeros. */ void * -calloc (register size_t nmemb, register size_t size) +calloc (size_t nmemb, size_t size) { - register void *result = malloc (nmemb * size); - - if (result != NULL) - (void) memset (result, 0, nmemb * size); - + void *result; + size_t bytes = nmemb * size; + + if (size != 0 && bytes / size != nmemb) + { + errno = ENOMEM; + return NULL; + } + + result = malloc (bytes); + if (result) + memset (result, 0, bytes); return result; } /* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. @@ -1559,7 +1567,7 @@ void *(*__memalign_hook) (size_t size, size_t alignment); void * -memalign (size_t alignment, size_t size) +aligned_alloc (size_t alignment, size_t size) { void *result; size_t adj, lastadj; @@ -1570,6 +1578,11 @@ /* Allocate a block with enough extra space to pad the block with up to (ALIGNMENT - 1) bytes if necessary. */ + if (- size < alignment) + { + errno = ENOMEM; + return NULL; + } result = malloc (size + alignment - 1); if (result == NULL) return NULL; @@ -1631,6 +1644,15 @@ return result; } +/* An obsolete alias for aligned_alloc, for any old libraries that use + this alias. */ + +void * +memalign (size_t alignment, size_t size) +{ + return aligned_alloc (alignment, size); +} + int posix_memalign (void **memptr, size_t alignment, size_t size) { @@ -1641,7 +1663,7 @@ || (alignment & (alignment - 1)) != 0) return EINVAL; - mem = memalign (alignment, size); + mem = aligned_alloc (alignment, size); if (mem == NULL) return ENOMEM; @@ -1686,7 +1708,7 @@ if (pagesize == 0) pagesize = getpagesize (); - return memalign (pagesize, size); + return aligned_alloc (pagesize, size); } #ifdef GC_MCHECK ------------------------------------------------------------ revno: 115013 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15814 author: Nathan Trapuzzano committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-11-06 23:38:00 -0500 message: * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for malformed bindings form. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-07 03:02:01 +0000 +++ lisp/ChangeLog 2013-11-07 04:38:00 +0000 @@ -1,10 +1,14 @@ +2013-11-05 Nathan Trapuzzano (tiny change) + + * emacs-lisp/cl-macs.el (cl-symbol-macrolet): Print warning for + malformed bindings form (bug#15814). + 2013-11-07 Dmitry Gutov * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of "." compared to " @ ". This incidentally fixes some indentation examples with "do". - (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or - "or". + (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or "or". (ruby-smie-grammar): New tokens: "and" and "or". (ruby-smie--args-separator-p): Fix the check for tokens at POS. Exclude "and" and "or". Remove "do" in order to work around token === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-09-28 01:07:18 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-11-07 04:38:00 +0000 @@ -1992,11 +1992,19 @@ (unwind-protect (progn (fset 'macroexpand #'cl--sm-macroexpand) - ;; FIXME: For N bindings, this will traverse `body' N times! - (macroexpand-all (cons 'progn body) - (cons (list (symbol-name (caar bindings)) - (cl-cadar bindings)) - macroexpand-all-environment))) + (let ((expansion + ;; FIXME: For N bindings, this will traverse `body' + ;; N times! + (macroexpand-all (cons 'progn body) + (cons (list (symbol-name (caar bindings)) + (cl-cadar bindings)) + macroexpand-all-environment)))) + (if (or (null (cdar bindings)) (cl-cddar bindings)) + (macroexp--warn-and-return + (format "Malformed `cl-symbol-macrolet' binding: %S" + (car bindings)) + expansion) + expansion))) (fset 'macroexpand previous-macroexpand)))))) ;;; Multiple values. @@ -2726,7 +2734,7 @@ (let* ((cl-entry (cons (nth 1 (nth 1 cl-form)) nil)) (cl--active-block-names (cons cl-entry cl--active-block-names)) (cl-body (macroexpand-all ;Performs compiler-macro expansions. - (cons 'progn (cddr cl-form)) + (macroexp-progn (cddr cl-form)) macroexpand-all-environment))) ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able ;; to indicate that this return value is already fully expanded. ------------------------------------------------------------ revno: 115012 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-11-06 19:21:15 -0800 message: * admin/unidata/unidata-gen.el (unidata-gen-files): Disable version-control in generated files. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-11-05 07:54:03 +0000 +++ admin/ChangeLog 2013-11-07 03:21:15 +0000 @@ -1,3 +1,8 @@ +2013-11-07 Glenn Morris + + * unidata/unidata-gen.el (unidata-gen-files): + Disable version-control in generated files. + 2013-11-05 Glenn Morris * update_autogen: Move here from ../autogen. === modified file 'admin/unidata/unidata-gen.el' --- admin/unidata/unidata-gen.el 2013-10-30 07:15:23 +0000 +++ admin/unidata/unidata-gen.el 2013-11-07 03:21:15 +0000 @@ -1239,6 +1239,7 @@ (if (eobp) (insert ";; Local Variables:\n" ";; coding: utf-8\n" + ";; version-control: never\n" ";; no-byte-compile: t\n" ";; End:\n\n" (format ";; %s ends here\n" basename))) @@ -1247,6 +1248,7 @@ (message "Writing %s..." charprop-file) (insert ";; Local Variables:\n" ";; coding: utf-8\n" + ";; version-control: never\n" ";; no-byte-compile: t\n" ";; End:\n\n" (format ";; %s ends here\n" ------------------------------------------------------------ revno: 115011 committer: Dmitry Gutov branch nick: trunk timestamp: Thu 2013-11-07 05:02:01 +0200 message: * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or "or". (ruby-smie-grammar): New tokens: "and" and "or". (ruby-smie--args-separator-p): Fix the check for tokens at POS. Exclude "and" and "or". Remove "do" in order to work around token priorities. (ruby-smie-rules): Add all infix tokens. Handle the case of beginning-of-buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-07 01:58:12 +0000 +++ lisp/ChangeLog 2013-11-07 03:02:01 +0000 @@ -1,7 +1,16 @@ 2013-11-07 Dmitry Gutov * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of - "." compared to "do". + "." compared to " @ ". This incidentally fixes some indentation + examples with "do". + (ruby-smie--implicit-semi-p): No implicit semi after "^", "and" or + "or". + (ruby-smie-grammar): New tokens: "and" and "or". + (ruby-smie--args-separator-p): Fix the check for tokens at POS. + Exclude "and" and "or". Remove "do" in order to work around token + priorities. + (ruby-smie-rules): Add all infix tokens. Handle the case of + beginning-of-buffer. 2013-11-06 Glenn Morris === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-11-07 01:58:12 +0000 +++ lisp/progmodes/ruby-mode.el 2013-11-07 03:02:01 +0000 @@ -329,7 +329,8 @@ (nonassoc "==" "===" "!=") (nonassoc "=~" "!~") (left "<<" ">>") - (left "&&" "||")))))) + (left "&&" "||") + (left "and" "or")))))) (defun ruby-smie--bosp () (save-excursion (skip-chars-backward " \t") @@ -340,7 +341,7 @@ (skip-chars-backward " \t") (not (or (bolp) (and (memq (char-before) - '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\{ ?\\ ?& ?> ?< ?% ?~)) + '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\{ ?\\ ?& ?> ?< ?% ?~ ?^)) ;; Make sure it's not the end of a regexp. (not (eq (car (syntax-after (1- (point)))) 7))) (and (eq (char-before) ?\?) @@ -349,8 +350,8 @@ (string-match "\\`\\s." (save-excursion (ruby-smie--backward-token)))) (and (eq (car (syntax-after (1- (point)))) 2) - (equal (save-excursion (ruby-smie--backward-token)) - "iuwu-mod")) + (member (save-excursion (ruby-smie--backward-token)) + '("iuwu-mod" "and" "or"))) (save-excursion (forward-comment 1) (eq (char-after) ?.)))))) @@ -375,13 +376,15 @@ ;; This isn't very important most of the time, though. (and (memq (preceding-char) '(?! ??)) (eq (char-syntax (char-before (1- (point)))) '?w))) - (or (and (eq (char-syntax (char-after pos)) ?w) - (not (looking-at (regexp-opt '("unless" "if" "while" "until" - "else" "elsif" "do" "end") - 'symbols)))) - (memq (syntax-after pos) '(7 15)) - (save-excursion - (goto-char pos) + (save-excursion + (goto-char pos) + (or (and (eq (char-syntax (char-after)) ?w) + ;; FIXME: Also "do". But alas, that breaks some + ;; indentation cases. + (not (looking-at (regexp-opt '("unless" "if" "while" "until" + "else" "elsif" "end" "and" "or") + 'symbols)))) + (memq (syntax-after pos) '(7 15)) (looking-at "\\s(\\|[-+!~:]\\sw"))))) (defun ruby-smie--at-dot-call () @@ -504,7 +507,6 @@ (let ((state (smie-backward-sexp 'halfsexp))) (when (eq t (car state)) (goto-char (cadr state)))) (cons 'column (smie-indent-virtual))))) - (`(:after . ,(or "=" "iuwu-mod")) 2) (`(:after . " @ ") (smie-rule-parent)) (`(:before . "do") (smie-rule-parent)) (`(,(or :before :after) . ".") @@ -513,8 +515,11 @@ (`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0) (`(:before . ,(or `"when")) (if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level - (`(:after . "+") ;FIXME: Probably applicable to most infix operators. - (if (smie-rule-parent-p ";") ruby-indent-level)) + (`(:after . ,(or "=" "iuwu-mod" "+" "-" "*" "/" "&&" "||" "%" "**" "^" "&" + "<=>" ">" "<" ">=" "<=" "==" "===" "!=" "<<" ">>" + "+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^=" + "<<=" ">>=" "&&=" "||=" "and" "or")) + (if (smie-rule-parent-p ";" nil) ruby-indent-level)) )) (defun ruby-imenu-create-index-in-block (prefix beg end) === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-11-07 01:58:12 +0000 +++ test/indent/ruby.rb 2013-11-07 03:02:01 +0000 @@ -207,6 +207,12 @@ foo + bar +foo and + bar + +foo ^ + bar + foo_bar_tee(1, 2, 3) .qux .bar @@ -245,3 +251,9 @@ bar.foo do bar end + +# Examples below still fail with `ruby-use-smie' on: + +bar.foo(tee) do # "." is parent to "do"; it shouldn't be. + bar +end ------------------------------------------------------------ revno: 115010 committer: Dmitry Gutov branch nick: trunk timestamp: Thu 2013-11-07 03:58:12 +0200 message: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of "." compared to "do". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-06 17:56:48 +0000 +++ lisp/ChangeLog 2013-11-07 01:58:12 +0000 @@ -1,3 +1,8 @@ +2013-11-07 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of + "." compared to "do". + 2013-11-06 Glenn Morris * Makefile.in (setwins_almost, setwins_for_subdirs): === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-11-05 16:28:40 +0000 +++ lisp/progmodes/ruby-mode.el 2013-11-07 01:58:12 +0000 @@ -280,7 +280,7 @@ (inst (exp) (inst "iuwu-mod" exp)) (exp (exp1) (exp "," exp) (exp "=" exp) (id " @ " exp) - (exp "." exp)) + (exp "." id)) (exp1 (exp2) (exp2 "?" exp1 ":" exp1)) (exp2 ("def" insts "end") ("begin" insts-rescue-insts "end") === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-11-04 11:04:50 +0000 +++ test/indent/ruby.rb 2013-11-07 01:58:12 +0000 @@ -238,12 +238,10 @@ qux end -# Examples below still fail with `ruby-use-smie' on: - foo = [1, 2, 3].map do |i| i + 1 end -bar.foo do # "." is parent to "do"; it shouldn't be. +bar.foo do bar end ------------------------------------------------------------ revno: 115009 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-11-06 16:17:26 -0500 message: * src/xdisp.c (redisplay_internal): Fix typo in last change. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-06 19:36:12 +0000 +++ src/ChangeLog 2013-11-06 21:17:26 +0000 @@ -1,3 +1,7 @@ +2013-11-06 Stefan Monnier + + * xdisp.c (redisplay_internal): Fix typo in last change. + 2013-11-06 Paul Eggert * regex.c: Fix --enable-gcc-warning glitch with GCC 4.5.2. === modified file 'src/keyboard.c' --- src/keyboard.c 2013-11-06 18:41:31 +0000 +++ src/keyboard.c 2013-11-06 21:17:26 +0000 @@ -1629,8 +1629,8 @@ && NILP (Fmemq (Vthis_command, Vselection_inhibit_update_commands))) { - ptrdiff_t beg = - XINT (Fmarker_position (BVAR (current_buffer, mark))); + ptrdiff_t beg + = XINT (Fmarker_position (BVAR (current_buffer, mark))); ptrdiff_t end = PT; if (beg < end) call2 (Qx_set_selection, QPRIMARY, === modified file 'src/xdisp.c' --- src/xdisp.c 2013-11-06 18:41:31 +0000 +++ src/xdisp.c 2013-11-06 21:17:26 +0000 @@ -13004,7 +13004,7 @@ if (NILP (Vmemory_full)) prepare_menu_bars (); - if (windows_or_buffers_changed & !update_mode_lines) + if (windows_or_buffers_changed && !update_mode_lines) update_mode_lines = 32; reconsider_clip_changes (w); ------------------------------------------------------------ revno: 115008 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-11-06 11:36:12 -0800 message: * regex.c: Fix --enable-gcc-warning glitch with GCC 4.5.2. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-06 18:41:31 +0000 +++ src/ChangeLog 2013-11-06 19:36:12 +0000 @@ -1,3 +1,7 @@ +2013-11-06 Paul Eggert + + * regex.c: Fix --enable-gcc-warning glitch with GCC 4.5.2. + 2013-11-06 Stefan Monnier * xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and === modified file 'src/regex.c' --- src/regex.c 2013-09-22 06:22:05 +0000 +++ src/regex.c 2013-11-06 19:36:12 +0000 @@ -43,7 +43,7 @@ # endif #endif -#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && ! defined __clang__ +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) && ! defined __clang__ # pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif ------------------------------------------------------------ revno: 115007 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-11-06 13:41:31 -0500 message: * src/xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and redisplay--mode-lines-cause. (redisplay_internal): Keep them uptodate. Remove redundant check of buffer_shared_and_changed. * *.[chm]: Number every assignment to update_mode_lines so we can track why it is set. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-06 10:14:50 +0000 +++ src/ChangeLog 2013-11-06 18:41:31 +0000 @@ -1,3 +1,12 @@ +2013-11-06 Stefan Monnier + + * xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and + redisplay--mode-lines-cause. + (redisplay_internal): Keep them uptodate. Remove redundant check of + buffer_shared_and_changed. + * *.[chm]: Number every assignment to update_mode_lines so we + can track why it is set. + 2013-11-06 Eli Zaretskii * editfns.c (Fformat_time_string): Doc fix. (Bug#15816) === modified file 'src/buffer.c' --- src/buffer.c 2013-11-06 04:11:04 +0000 +++ src/buffer.c 2013-11-06 18:41:31 +0000 @@ -1393,7 +1393,7 @@ smarter about updating the `*' in mode lines. --gerd */ if (buffer_window_count (current_buffer)) { - ++update_mode_lines; + update_mode_lines = 10; current_buffer->prevent_redisplay_optimizations_p = 1; } @@ -1513,7 +1513,7 @@ /* Catch redisplay's attention. Unless we do this, the mode lines for any windows displaying current_buffer will stay unchanged. */ - update_mode_lines++; + update_mode_lines = 11; XSETBUFFER (buf, current_buffer); Fsetcar (Frassq (buf, Vbuffer_alist), newname); @@ -2765,7 +2765,7 @@ /* Force mode-line redisplay. Useful here because all major mode commands call this function. */ - update_mode_lines++; + update_mode_lines = 12; return Qnil; } === modified file 'src/commands.h' --- src/commands.h 2013-01-01 09:11:05 +0000 +++ src/commands.h 2013-11-06 18:41:31 +0000 @@ -36,10 +36,10 @@ events until a non-ASCII event is acceptable as input. */ extern Lisp_Object unread_switch_frame; -/* Nonzero if input is coming from the keyboard */ +/* Nonzero if input is coming from the keyboard. */ #define INTERACTIVE (NILP (Vexecuting_kbd_macro) && !noninteractive) -/* Set this nonzero to force reconsideration of mode line. */ +/* Set this nonzero to force reconsideration of mode line. */ extern int update_mode_lines; === modified file 'src/dosfns.c' --- src/dosfns.c 2013-01-01 09:11:05 +0000 +++ src/dosfns.c 2013-11-06 18:41:31 +0000 @@ -472,7 +472,7 @@ if (EQ (name, f->title)) return; - update_mode_lines = 1; + update_mode_lines = 13; fset_title (f, name); === modified file 'src/fileio.c' --- src/fileio.c 2013-11-05 07:44:14 +0000 +++ src/fileio.c 2013-11-06 18:41:31 +0000 @@ -4997,7 +4997,7 @@ SAVE_MODIFF = MODIFF; XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG); bset_filename (current_buffer, visit_file); - update_mode_lines++; + update_mode_lines = 14; } else if (quietly) { === modified file 'src/frame.c' --- src/frame.c 2013-11-06 04:11:04 +0000 +++ src/frame.c 2013-11-06 18:41:31 +0000 @@ -1489,7 +1489,7 @@ /* Cause frame titles to update--necessary if we now have just one frame. */ if (!is_tooltip_frame) - update_mode_lines = 1; + update_mode_lines = 15; return Qnil; } @@ -2025,7 +2025,7 @@ } fset_name (f, name); - update_mode_lines = 1; + update_mode_lines = 16; } void === modified file 'src/keyboard.c' --- src/keyboard.c 2013-11-06 04:11:04 +0000 +++ src/keyboard.c 2013-11-06 18:41:31 +0000 @@ -821,7 +821,7 @@ return Qnil; command_loop_level++; - update_mode_lines = 1; + update_mode_lines = 17; if (command_loop_level && current_buffer != XBUFFER (XWINDOW (selected_window)->contents)) @@ -848,7 +848,7 @@ Fset_buffer (buffer); command_loop_level--; - update_mode_lines = 1; + update_mode_lines = 18; } === modified file 'src/macros.c' --- src/macros.c 2013-07-16 21:35:45 +0000 +++ src/macros.c 2013-11-06 18:41:31 +0000 @@ -55,7 +55,7 @@ Non-nil arg (prefix arg) means append to last macro defined; this begins by re-executing that macro as if you typed it again. If optional second arg, NO-EXEC, is non-nil, do not re-execute last -macro before appending to it. */) +macro before appending to it. */) (Lisp_Object append, Lisp_Object no_exec) { if (!NILP (KVAR (current_kboard, defining_kbd_macro))) @@ -66,7 +66,7 @@ current_kboard->kbd_macro_buffer = xmalloc (30 * word_size); current_kboard->kbd_macro_bufsize = 30; } - update_mode_lines++; + update_mode_lines = 19; if (NILP (append)) { if (current_kboard->kbd_macro_bufsize > 200) @@ -138,7 +138,7 @@ end_kbd_macro (void) { kset_defining_kbd_macro (current_kboard, Qnil); - update_mode_lines++; + update_mode_lines = 20; kset_last_kbd_macro (current_kboard, make_event_array ((current_kboard->kbd_macro_end === modified file 'src/nsfns.m' --- src/nsfns.m 2013-11-06 04:11:04 +0000 +++ src/nsfns.m 2013-11-06 18:41:31 +0000 @@ -451,8 +451,8 @@ str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)]; - if ([[view window] miniwindowTitle] && - ! [[[view window] miniwindowTitle] isEqualToString: str]) + if ([[view window] miniwindowTitle] + && ! [[[view window] miniwindowTitle] isEqualToString: str]) [[view window] setMiniwindowTitle: str]; } @@ -469,7 +469,7 @@ /* If we're switching from explicit to implicit, we had better update the mode lines and thereby update the title. */ if (f->explicit_name && NILP (name)) - update_mode_lines = 1; + update_mode_lines = 21; f->explicit_name = ! NILP (name); } @@ -477,7 +477,7 @@ return; if (NILP (name)) - name = build_string([ns_app_name UTF8String]); + name = build_string ([ns_app_name UTF8String]); else CHECK_STRING (name); @@ -487,7 +487,7 @@ fset_name (f, name); - /* title overrides explicit name */ + /* Title overrides explicit name. */ if (! NILP (f->title)) name = f->title; @@ -534,7 +534,7 @@ if (EQ (name, f->title)) return; - update_mode_lines = 1; + update_mode_lines = 22; fset_title (f, name); === modified file 'src/process.c' --- src/process.c 2013-11-05 05:32:19 +0000 +++ src/process.c 2013-11-06 18:41:31 +0000 @@ -5246,7 +5246,7 @@ else set_marker_both (p->mark, p->buffer, PT, PT_BYTE); - update_mode_lines++; + update_mode_lines = 23; /* Make sure opoint and the old restrictions float ahead of any new text just as point would. */ @@ -6390,7 +6390,7 @@ } } /* end for */ - update_mode_lines++; /* In case buffers use %s in mode-line-format. */ + update_mode_lines = 24; /* In case buffers use %s in mode-line-format. */ UNGCPRO; } === modified file 'src/w32fns.c' --- src/w32fns.c 2013-11-06 04:11:04 +0000 +++ src/w32fns.c 2013-11-06 18:41:31 +0000 @@ -1740,7 +1740,7 @@ /* If we're switching from explicit to implicit, we had better update the mode lines and thereby update the title. */ if (f->explicit_name && NILP (name)) - update_mode_lines = 1; + update_mode_lines = 25; f->explicit_name = ! NILP (name); } @@ -1808,7 +1808,7 @@ if (EQ (name, f->title)) return; - update_mode_lines = 1; + update_mode_lines = 26; fset_title (f, name); === modified file 'src/window.c' --- src/window.c 2013-11-06 04:11:04 +0000 +++ src/window.c 2013-11-06 18:41:31 +0000 @@ -2639,7 +2639,7 @@ mark_window_display_accurate (window, 0); w->update_mode_line = 1; XBUFFER (obj)->prevent_redisplay_optimizations_p = 1; - ++update_mode_lines; + update_mode_lines = 27; best_window = window; } break; @@ -3279,7 +3279,7 @@ if (NILP (object)) { windows_or_buffers_changed = 29; - update_mode_lines++; + update_mode_lines = 28; return Qt; } @@ -3290,7 +3290,7 @@ w->update_mode_line = 1; if (BUFFERP (w->contents)) XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1; - ++update_mode_lines; + update_mode_lines = 29; return Qt; } === modified file 'src/xdisp.c' --- src/xdisp.c 2013-11-06 04:11:04 +0000 +++ src/xdisp.c 2013-11-06 18:41:31 +0000 @@ -10337,7 +10337,7 @@ if (resized_p) { windows_or_buffers_changed = 42; - ++update_mode_lines; + update_mode_lines = 30; redisplay_internal (); } } @@ -12886,12 +12886,12 @@ int polling_stopped_here = 0; Lisp_Object tail, frame; - /* Non-zero means redisplay has to consider all windows on all - frames. Zero means, only selected_window is considered. */ - int consider_all_windows_p; + /* True means redisplay has to consider all windows on all + frames. False, only selected_window is considered. */ + bool consider_all_windows_p; - /* Non-zero means redisplay has to redisplay the miniwindow. */ - int update_miniwindow_p = 0; + /* True means redisplay has to redisplay the miniwindow. */ + bool update_miniwindow_p = false; TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); @@ -12984,7 +12984,7 @@ /* If cursor type has been changed on the frame other than selected, consider all frames. */ if (f != sf && f->cursor_type_changed) - update_mode_lines++; + update_mode_lines = 31; } clear_desired_matrices (f); } @@ -13004,8 +13004,8 @@ if (NILP (Vmemory_full)) prepare_menu_bars (); - if (windows_or_buffers_changed) - update_mode_lines++; + if (windows_or_buffers_changed & !update_mode_lines) + update_mode_lines = 32; reconsider_clip_changes (w); @@ -13018,7 +13018,7 @@ { w->update_mode_line = 1; if (buffer_shared_and_changed ()) - update_mode_lines++; + update_mode_lines = 33; } if (mode_line_update_needed (w)) @@ -13031,7 +13031,10 @@ /* If specs for an arrow have changed, do thorough redisplay to ensure we remove any arrow that should no longer exist. */ if (overlay_arrows_changed_p ()) - consider_all_windows_p = windows_or_buffers_changed = 49; + { + consider_all_windows_p = true; + windows_or_buffers_changed = 49; + } /* Normally the message* functions will have already displayed and updated the echo area, but the frame may have been trashed, or @@ -13049,7 +13052,7 @@ int window_height_changed_p = echo_area_display (0); if (message_cleared_p) - update_miniwindow_p = 1; + update_miniwindow_p = true; must_finish = 1; @@ -13062,8 +13065,8 @@ if (window_height_changed_p) { - consider_all_windows_p = 1; - ++update_mode_lines; + consider_all_windows_p = true; + update_mode_lines = 34; windows_or_buffers_changed = 50; /* If window configuration was changed, frames may have been @@ -13083,9 +13086,9 @@ since only the current frame needs to be considered. This function needs to be rewritten with two variables, consider_all_windows and consider_all_frames. */ - consider_all_windows_p = 1; + consider_all_windows_p = true; windows_or_buffers_changed = 51; - ++update_mode_lines; + update_mode_lines = 35; /* If window configuration was changed, frames may have been marked garbaged. Clear them or we will experience @@ -13093,6 +13096,24 @@ clear_garbaged_frames (); } + if (VECTORP (Vredisplay__all_windows_cause) + && windows_or_buffers_changed >= 0 + && windows_or_buffers_changed < ASIZE (Vredisplay__all_windows_cause) + && INTEGERP (AREF (Vredisplay__all_windows_cause, + windows_or_buffers_changed))) + ASET (Vredisplay__all_windows_cause, windows_or_buffers_changed, + make_number (1 + XINT (AREF (Vredisplay__all_windows_cause, + windows_or_buffers_changed)))); + + if (VECTORP (Vredisplay__mode_lines_cause) + && update_mode_lines >= 0 + && update_mode_lines < ASIZE (Vredisplay__mode_lines_cause) + && INTEGERP (AREF (Vredisplay__mode_lines_cause, + update_mode_lines))) + ASET (Vredisplay__mode_lines_cause, update_mode_lines, + make_number (1 + XINT (AREF (Vredisplay__mode_lines_cause, + update_mode_lines)))); + /* Optimize the case that only the line containing the cursor in the selected window has changed. Variables starting with this_ are set in display_line and record information about the line @@ -13294,7 +13315,6 @@ } CHARPOS (this_line_start_pos) = 0; - consider_all_windows_p |= buffer_shared_and_changed (); ++clear_face_cache_count; #ifdef HAVE_WINDOW_SYSTEM ++clear_image_cache_count; @@ -13473,7 +13493,7 @@ matrices of some windows are not valid. */ if (!WINDOW_FULL_WIDTH_P (w) && !FRAME_WINDOW_P (XFRAME (w->frame))) - update_mode_lines = 1; + update_mode_lines = 36; } else { @@ -15337,7 +15357,7 @@ } else if ((w != XWINDOW (minibuf_window) || minibuf_level == 0) - /* When buffer is nonempty, redisplay window normally. */ + /* When buffer is nonempty, redisplay window normally. */ && BUF_Z (XBUFFER (w->contents)) == BUF_BEG (XBUFFER (w->contents)) /* Quail displays non-mini buffers in minibuffer window. In that case, redisplay the window normally. */ @@ -29735,6 +29755,16 @@ DEFVAR_LISP ("debug-on-message", Vdebug_on_message, doc: /* If non-nil, debug if a message matching this regexp is displayed. */); Vdebug_on_message = Qnil; + + DEFVAR_LISP ("redisplay--all-windows-cause", Vredisplay__all_windows_cause, + doc: /* */); + Vredisplay__all_windows_cause + = Fmake_vector (make_number (100), make_number (0)); + + DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause, + doc: /* */); + Vredisplay__mode_lines_cause + = Fmake_vector (make_number (100), make_number (0)); } === modified file 'src/xfns.c' --- src/xfns.c 2013-11-06 04:11:04 +0000 +++ src/xfns.c 2013-11-06 18:41:31 +0000 @@ -1383,7 +1383,7 @@ /* If we're switching from explicit to implicit, we had better update the mode lines and thereby update the title. */ if (f->explicit_name && NILP (name)) - update_mode_lines = 1; + update_mode_lines = 37; f->explicit_name = ! NILP (name); } @@ -1445,7 +1445,7 @@ if (EQ (name, f->title)) return; - update_mode_lines = 1; + update_mode_lines = 38; fset_title (f, name); ------------------------------------------------------------ revno: 115006 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-11-06 12:56:48 -0500 message: Guard against possible accidental matches with parent dirs in Makefiles * lisp/Makefile.in (setwins_almost, setwins_for_subdirs): Avoid accidental matches. * test/automated/Makefile.in (setwins): Avoid accidental matches. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-06 17:18:02 +0000 +++ lisp/ChangeLog 2013-11-06 17:56:48 +0000 @@ -1,3 +1,8 @@ +2013-11-06 Glenn Morris + + * Makefile.in (setwins_almost, setwins_for_subdirs): + Avoid accidental matches. + 2013-11-06 Stefan Monnier * menu-bar.el (popup-menu): Use key-binding. === modified file 'lisp/Makefile.in' --- lisp/Makefile.in 2013-11-06 08:37:01 +0000 +++ lisp/Makefile.in 2013-11-06 17:56:48 +0000 @@ -117,14 +117,14 @@ # Find all subdirectories except `obsolete' and `term'. setwins_almost=for file in `find ${srcdir} -type d -print`; do \ - case $$file in */obsolete | */term ) ;; \ + case $$file in ${srcdir}*/obsolete | ${srcdir}*/term ) ;; \ *) wins="$$wins$${wins:+ }$$file" ;; \ esac; \ done # Find all subdirectories in which we might want to create subdirs.el. setwins_for_subdirs=for file in `find ${srcdir} -type d -print`; do \ - case $$file in */cedet* ) ;; \ + case $$file in ${srcdir}*/cedet* ) ;; \ *) wins="$$wins$${wins:+ }$$file" ;; \ esac; \ done === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-06 08:33:02 +0000 +++ test/ChangeLog 2013-11-06 17:56:48 +0000 @@ -1,3 +1,7 @@ +2013-11-06 Glenn Morris + + * automated/Makefile.in (setwins): Avoid accidental matches. + 2013-11-06 Michael Albinus * automated/tramp-tests.el (tramp-test07-file-exists-p): === modified file 'test/automated/Makefile.in' --- test/automated/Makefile.in 2013-11-05 02:58:40 +0000 +++ test/automated/Makefile.in 2013-11-06 17:56:48 +0000 @@ -39,9 +39,8 @@ LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT) # Common command to find subdirectories -setwins=subdirs=`find $(srcdir) -type d -print`; \ - for file in $$subdirs; do \ - case $$file in */data* | */flymake* ) ;; \ +setwins=for file in `find $(srcdir) -type d -print`; do \ + case $$file in $(srcdir)*/data* | $(srcdir)*/flymake* ) ;; \ *) wins="$$wins$${wins:+ }$$file" ;; \ esac; \ done ------------------------------------------------------------ revno: 115005 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-11-06 12:18:02 -0500 message: * lisp/menu-bar.el (popup-menu): Use key-binding. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-06 10:10:22 +0000 +++ lisp/ChangeLog 2013-11-06 17:18:02 +0000 @@ -1,3 +1,7 @@ +2013-11-06 Stefan Monnier + + * menu-bar.el (popup-menu): Use key-binding. + 2013-11-06 Eli Zaretskii * menu-bar.el (popup-menu, menu-bar-open): When displaying TTY === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2013-11-06 10:10:22 +0000 +++ lisp/menu-bar.el 2013-11-06 17:18:02 +0000 @@ -2189,12 +2189,7 @@ (setq position (list menu-symbol (list frame '(menu-bar) event 0))) (setq map - (or - (lookup-key global-map (vector 'menu-bar menu-symbol)) - (lookup-key (current-local-map) (vector 'menu-bar - menu-symbol)) - (cdar (minor-mode-key-binding (vector 'menu-bar - menu-symbol))))))) + (key-binding (vector 'menu-bar menu-symbol))))) ((and (not (keymapp map)) (listp map)) ;; We were given a list of keymaps. Search them all ;; in sequence until a first binding is found. ------------------------------------------------------------ revno: 115004 committer: Xue Fuqiao branch nick: trunk timestamp: Wed 2013-11-06 22:22:02 +0800 message: Revert an indexing change. See http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00193.html diff: === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-11-05 17:47:48 +0000 +++ doc/lispref/display.texi 2013-11-06 14:22:02 +0000 @@ -6441,7 +6441,6 @@ are assumed to have left-to-right direction. @cindex display properties, and bidi reordering of text -@cindex Object Replacement Character Text covered by @code{display} text properties, by overlays with @code{display} properties whose value is a string, and by any other properties that replace buffer text, is treated as a single unit when ------------------------------------------------------------ revno: 115003 fixes bug: http://debbugs.gnu.org/15816 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2013-11-06 12:14:50 +0200 message: Fix doc string of format-time-string, per bug #15816. src/editfns.c (Fformat_time_string): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-06 04:11:04 +0000 +++ src/ChangeLog 2013-11-06 10:14:50 +0000 @@ -1,3 +1,7 @@ +2013-11-06 Eli Zaretskii + + * editfns.c (Fformat_time_string): Doc fix. (Bug#15816) + 2013-11-06 Stefan Monnier * *.[chm]: Number every assignment to windows_or_buffers_changed so we === modified file 'src/editfns.c' --- src/editfns.c 2013-10-08 17:49:20 +0000 +++ src/editfns.c 2013-11-06 10:14:50 +0000 @@ -1702,6 +1702,7 @@ %G is the year corresponding to the ISO week, %g within the century. %m is the numeric month. %b and %h are the locale's abbreviated month name, %B the full name. + (%h is not supported on MS-Windows.) %d is the day of the month, zero-padded, %e is blank-padded. %u is the numeric day of week from 1 (Monday) to 7, %w from 0 (Sunday) to 6. %a is the locale's abbreviated name of the day of week, %A the full name. ------------------------------------------------------------ revno: 115002 fixes bug: http://debbugs.gnu.org/15817 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2013-11-06 12:10:22 +0200 message: Fix bug #15817 with TTY menus produced by minor modes. lisp/menu-bar.el (popup-menu, menu-bar-open): When displaying TTY menus, support also the menus produced by minor modes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-06 09:06:05 +0000 +++ lisp/ChangeLog 2013-11-06 10:10:22 +0000 @@ -1,3 +1,9 @@ +2013-11-06 Eli Zaretskii + + * menu-bar.el (popup-menu, menu-bar-open): When displaying TTY + menus, support also the menus produced by minor modes. + (Bug#15817) + 2013-11-06 Leo Liu * thingatpt.el (thing-at-point-looking-at): Add optional arg === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2013-10-20 09:26:15 +0000 +++ lisp/menu-bar.el 2013-11-06 10:10:22 +0000 @@ -2192,7 +2192,9 @@ (or (lookup-key global-map (vector 'menu-bar menu-symbol)) (lookup-key (current-local-map) (vector 'menu-bar - menu-symbol)))))) + menu-symbol)) + (cdar (minor-mode-key-binding (vector 'menu-bar + menu-symbol))))))) ((and (not (keymapp map)) (listp map)) ;; We were given a list of keymaps. Search them all ;; in sequence until a first binding is found. @@ -2278,7 +2280,8 @@ (menu (menu-bar-menu-at-x-y x 0 frame))) (popup-menu (or (lookup-key global-map (vector 'menu-bar menu)) - (lookup-key (current-local-map) (vector 'menu-bar menu))) + (lookup-key (current-local-map) (vector 'menu-bar menu)) + (cdar (minor-mode-key-binding (vector 'menu-bar menu)))) (posn-at-x-y x 0 nil t) nil t))) (t (with-selected-frame (or frame (selected-frame)) (tmm-menubar)))))) ------------------------------------------------------------ revno: 115001 fixes bug: http://debbugs.gnu.org/15808 committer: Leo Liu branch nick: trunk timestamp: Wed 2013-11-06 17:06:05 +0800 message: * thingatpt.el (thing-at-point-looking-at): Add optional arg DISTANCE to bound the search. All uses changed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-06 08:37:01 +0000 +++ lisp/ChangeLog 2013-11-06 09:06:05 +0000 @@ -1,3 +1,8 @@ +2013-11-06 Leo Liu + + * thingatpt.el (thing-at-point-looking-at): Add optional arg + DISTANCE to bound the search. All uses changed. (Bug#15808) + 2013-11-06 Glenn Morris * Makefile.in (setwins, setwins_almost, setwins_for_subdirs): Simplify. === modified file 'lisp/thingatpt.el' --- lisp/thingatpt.el 2013-08-10 15:17:29 +0000 +++ lisp/thingatpt.el 2013-11-06 09:06:05 +0000 @@ -476,19 +476,22 @@ ;; matches that straddle the start position so we search forwards once ;; and then back repeatedly and then back up a char at a time. -(defun thing-at-point-looking-at (regexp) +(defun thing-at-point-looking-at (regexp &optional distance) "Return non-nil if point is in or just after a match for REGEXP. Set the match data from the earliest such match ending at or after point." (save-excursion - (let ((old-point (point)) match) + (let ((old-point (point)) + (forward-bound (and distance (+ (point) distance))) + (backward-bound (and distance (- (point) distance))) + match) (and (looking-at regexp) (>= (match-end 0) old-point) (setq match (point))) ;; Search back repeatedly from end of next match. ;; This may fail if next match ends before this match does. - (re-search-forward regexp nil 'limit) - (while (and (re-search-backward regexp nil t) + (re-search-forward regexp forward-bound 'limit) + (while (and (re-search-backward regexp backward-bound t) (or (> (match-beginning 0) old-point) (and (looking-at regexp) ; Extend match-end past search start (>= (match-end 0) old-point) @@ -518,7 +521,8 @@ (put 'email 'bounds-of-thing-at-point (lambda () - (let ((thing (thing-at-point-looking-at thing-at-point-email-regexp))) + (let ((thing (thing-at-point-looking-at + thing-at-point-email-regexp 500))) (if thing (let ((beginning (match-beginning 0)) (end (match-end 0)))