commit 435da5d2955ce35be4785b7d46566ed9b42ea9fb (HEAD, refs/remotes/origin/master) Merge: 7c9e625 b134c20 Author: Paul Eggert Date: Mon Apr 11 09:07:16 2016 -0700 Merge from origin/emacs-25 b134c20 Sync with gnulib bb30fa9 Fix last change on 2016-01-02 488a72f ; Spelling fixes 9b1aab9 Port run-prolog EMACS to SWI-Prolog 7.2.3 0e7bcec Avoid crashes due to unreasonably large or small text scaling 85f257c Improve documentation of 'with-eval-after-load' 668c7bc Improve handling of non-ASCII characters in Git log messages b570769 Remove undefined behavior in OS X dumper. 97211f3 Fix clipping of xwidgets e87fbc0 Improve Lisp-level documentation of tooltips 9f1786e Faces names should not end in "-face". 3283271 * src/xsmfns.c (syms_of_xsmfns): Remove stray "s in doc strings. a1f221b Comint and compile no longer set EMACS 5c28890 * lisp/subr.el (read-key): Don't let the prompt linger (bug#2... a75b9a6 Merge branch 'emacs-25' of git.savannah.gnu.org:/srv/git/emac... c93ae7a Allow to customize names of executables used by grep.el f6497c6 Set locale encoding to UTF-8 when run from OS X GUI. 7ad1d07 Avoid signaling errors in 'M-n' at the 'C-x C-f' prompt a3f1ac2 Avoid infinite loop in 'studlify-word' f36df4b Don’t recommend obsolete EMACS env var fb0b531 * lisp/emacs-lisp/package.el: Change from a few days ago need... commit 7c9e6254bbac949aa5493ab1741d2523a7d595b7 Merge: d1e2b10 b7d8abd Author: Paul Eggert Date: Mon Apr 11 09:07:16 2016 -0700 ; Merge from origin/emacs-25 The following commit was skipped: b7d8abd * lisp/emacs-lisp/seq.el: Load cl-lib, not cl-extra. commit d1e2b10afa2df313e029b3faeeb0d694fd6e0fbc Merge: 7b45cc5 96d9e78 Author: Paul Eggert Date: Mon Apr 11 09:07:16 2016 -0700 Merge from origin/emacs-25 96d9e78 Fix "Beginning of buffer" error in forward-page 20686f7 Add a `transient' project type commit 7b45cc583c4f16cc070a9925431ca944f510a685 Merge: ff2c764 0d7aad1 Author: Paul Eggert Date: Mon Apr 11 09:07:16 2016 -0700 ; Merge from origin/emacs-25 The following commits were skipped: 0d7aad1 Revert "Backport HTTPS proxy fix" 2d1a605 Backport HTTPS proxy fix commit ff2c76476479c43607825df01c78d8f239caefb5 Merge: d6ea645 80128a7 Author: Paul Eggert Date: Mon Apr 11 09:07:15 2016 -0700 Merge from origin/emacs-25 80128a7 Fix stability confusion in sort-tests 1e4aa42 Avoid describe-key error with lambdas a05fb21 * lisp/emacs-lisp/package.el (package-install-selected-packag... f501116 Sync with gnulib c4963f9 Fix doc for Universal Time commit b134c206bc07dbbb9e74b3be2db269c4f1196e40 Author: Paul Eggert Date: Mon Apr 11 09:02:00 2016 -0700 Sync with gnulib This is for picky compilers whose stdint.h fails our C11 tests. Problem reported for clang by Philipp Stephani (Bug#23261). This incorporates: 2016-04-11 stdint: port to strict C11 left shift * doc/misc/texinfo.tex, lib/stdint.in.h: Copy from gnulib. diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 75017af..d164d45 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2016-03-25.17} +\def\texinfoversion{2016-03-29.15} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -1550,8 +1550,7 @@ \fi \turnoffactive \makevalueexpandable - % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. - % Therefore \txiescapepdf is not necessary. + \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % @@ -1566,9 +1565,12 @@ \fi { \turnoffactive - % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. - % Therefore \txiescapepdf is not necessary. - \special{pdf:out [-] #2 << /Title (#1) /A << /S /GoTo /D (name\pdfoutlinedest) >> >> }% + \txiescapepdf\pdfoutlinedest + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A + << /S /GoTo /D (name\pdfoutlinedest) >> >> }% } } % @@ -1624,6 +1626,20 @@ % ``\special{pdf:dest ...}'' can not handle non-ASCII strings. % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } % make a live url in pdf output. \def\pdfurl#1{% \begingroup @@ -8760,6 +8776,7 @@ % % Make link in pdf output. \ifpdf + % For pdfTeX and LuaTeX {\indexnofonts \turnoffactive \makevalueexpandable @@ -8786,6 +8803,47 @@ \fi }% \setcolor{\linkcolor}% + \else + \ifx\XeTeXrevision\thisisundefined + \else + % For XeTeX + {\indexnofonts + \turnoffactive + \makevalueexpandable + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \iftxiuseunicodedestname + \def\pdfxrefdest{#1}% Pass through Unicode characters. + \else + \edef\pdfxrefdest{#1}% Replace Unicode characters to ASCII. + \fi + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi + % + \leavevmode + \ifnum\filenamelength>0 + % By the default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDF cannot be known. In order to avoid replacement, + % you can use commandline option `-C 0x0010' for xdvipdfmx. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (name\pdfxrefdest) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (name\pdfxrefdest) >> >>}% + \fi + }% + \setcolor{\linkcolor}% + \fi \fi {% % Have to otherify everything special to allow the \csname to diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 0bb9ad4..cf65ec6 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -118,15 +118,10 @@ picky compilers. */ #define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) + ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) #define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : /* The expression for the unsigned case. The subtraction of (signed) \ - is a nop in the unsigned case and avoids "signed integer overflow" \ - warnings in the signed case. */ \ - ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) + (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) #if !GNULIB_defined_stdint_types commit bb30fa951c23911f5c3a14d9d46d1a3260a50fe0 Author: Leo Liu Date: Mon Apr 11 20:19:38 2016 +0800 Fix last change on 2016-01-02 * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Move `cl-errs-re' before `lisp--el-match-keyword'; don't use `prepend' which highlights `cl-errs-re' even in comments or strings. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 3f34555..315b3d5 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -396,6 +396,9 @@ This will generate compile-time constants from BINDINGS." lisp-el-font-lock-keywords-1 `( ;; Regexp negated char group. ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) + ;; Erroneous structures. + (,(concat "(" el-errs-re "\\_>") + (1 font-lock-warning-face)) ;; Control structures. Common Lisp forms. (lisp--el-match-keyword . 1) ;; Exit/Feature symbols as constants. @@ -403,9 +406,6 @@ This will generate compile-time constants from BINDINGS." "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?") (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) - ;; Erroneous structures. - (,(concat "(" el-errs-re "\\_>") - (1 font-lock-warning-face prepend)) ;; Words inside \\[] tend to be for `substitute-command-keys'. (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]") (1 font-lock-constant-face prepend)) commit 488a72f8e390d5da37da3bb7792e1d6ca5079b07 Author: Paul Eggert Date: Sun Apr 10 23:54:33 2016 -0700 ; Spelling fixes diff --git a/ChangeLog.2 b/ChangeLog.2 index b2dc6c5..2197c41 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -16990,7 +16990,7 @@ 2015-09-01 Paul Eggert - terminal-init-w32console mimicks command-line + terminal-init-w32console mimics command-line Problem reported by Eli Zaretskii. * lisp/startup.el (startup--setup-quote-display): New function, refactored from a part of ‘command-line’. diff --git a/etc/NEWS b/etc/NEWS index f5e5548..fe7df96 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1785,7 +1785,7 @@ function 'encode-time', which already accepted a simple time zone rule argument, has been extended to accept all the new forms. *** Incompatible change in the third argument of 'format-time-string'. -Previously, any non-nil argument was interpeted as specifying Universal Time. +Previously, any non-nil argument was interpreted as specifying Universal Time. This is no longer true; packages that want Universal Time should pass t as the third argument. diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15 index 88f5487..46fa01a 100644 --- a/lisp/ChangeLog.15 +++ b/lisp/ChangeLog.15 @@ -5820,7 +5820,7 @@ * epa.el (epa-passphrase-callback-function): Say what we're querying the password for. - * ibuffer.el (ibuffer-visit-buffer): To mimick list-buffers + * ibuffer.el (ibuffer-visit-buffer): To mimic list-buffers behavior, don't bury the ibuffer buffer when visiting other buffers. 2010-10-08 Chong Yidong diff --git a/lisp/subr.el b/lisp/subr.el index 4202cc7..0fb4a2e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2088,7 +2088,7 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'." (cancel-timer timer) ;; For some reason, `read-key(-sequence)' leaves the prompt in the echo ;; area, whereas `read-event' seems to empty it just before returning - ;; (bug#22714). So, let's mimick the behavior of `read-event'. + ;; (bug#22714). So, let's mimic the behavior of `read-event'. (message nil) (use-global-map old-global-map)))) diff --git a/src/ChangeLog.12 b/src/ChangeLog.12 index 3045ecd..b2df482 100644 --- a/src/ChangeLog.12 +++ b/src/ChangeLog.12 @@ -2895,7 +2895,7 @@ (wait_reading_process_output, init_process_emacs): Assume O_NONBLOCK. (wait_reading_process_output): Put in a special case for WINDOWSNT - to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. + to mimic the older behavior where it had O_NDELAY but not O_NONBLOCK. It's not clear this is needed, but it's a more-conservative change. (create_process): Assume FD_CLOEXEC. (create_process, create_pty): Assume O_NOCTTY. commit 9b1aab91fc479be9a923af1874801eadc1c19b20 Author: Paul Eggert Date: Sun Apr 10 22:47:03 2016 -0700 Port run-prolog EMACS to SWI-Prolog 7.2.3 * lisp/progmodes/prolog.el (prolog-ensure-process): Work around incompatibility of SWI-Prolog 7.2.3 and earlier with the new way of dealing with the EMACS and INSIDE_EMACS environment variables. diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 9ee405b..212a5fa 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -1374,8 +1374,20 @@ the variable `prolog-prompt-regexp'." () (with-current-buffer (get-buffer-create "*prolog*") (prolog-inferior-mode) - (apply 'make-comint-in-buffer "prolog" (current-buffer) - (prolog-program-name) nil (prolog-program-switches)) + + ;; The "INFERIOR=yes" hack is for SWI-Prolog 7.2.3 and earlier, + ;; which assumes it is running under Emacs if either INFERIOR=yes or + ;; if EMACS is set to a nonempty value. The EMACS setting is + ;; obsolescent, so set INFERIOR. Newer versions of SWI-Prolog should + ;; know about INSIDE_EMACS (which replaced EMACS) and should not need + ;; this hack. + (let ((process-environment + (if (getenv "INFERIOR") + process-environment + (cons "INFERIOR=yes" process-environment)))) + (apply 'make-comint-in-buffer "prolog" (current-buffer) + (prolog-program-name) nil (prolog-program-switches))) + (unless prolog-system ;; Setup auto-detection. (setq-local commit 0e7bcec103073eceecc2621c19e4d290b2d97e8d Author: Eli Zaretskii Date: Sun Apr 10 19:50:39 2016 +0300 Avoid crashes due to unreasonably large or small text scaling * lisp/face-remap.el (text-scale-min-amount) (text-scale-max-amount): New functions. (text-scale-set, text-scale-increase): Use them to limit the text scaling to a reasonable range of values. (Bug#23259) diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 0da6be7..9c2cae1 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -256,6 +256,23 @@ disable `text-scale-mode' as necessary)." text-scale-mode-amount)))) (force-window-update (current-buffer))) +(defun text-scale-min-amount () + "Return the minimum amount of text-scaling we allow." + ;; When the resulting pixel-height of characters will become smaller + ;; than 1 pixel, we can expect trouble from the display engine. + ;; E.g., it requires that the character glyph's ascent is + ;; non-negative. + (log (/ 1.0 (frame-char-height)) text-scale-mode-step)) + +(defun text-scale-max-amount () + "Return the maximum amount of text-scaling we allow." + ;; The display engine uses a 16-bit short for pixel-width of + ;; characters, thus the 0xffff limitation. It also makes no sense + ;; to have characters wider than the display. + (log (/ (min (display-pixel-width) #xffff) + (frame-char-width)) + text-scale-mode-step)) + ;;;###autoload (defun text-scale-set (level) "Set the scale factor of the default face in the current buffer to LEVEL. @@ -266,7 +283,8 @@ Each step scales the height of the default face by the variable `text-scale-mode-step' (a negative number decreases the height by the same amount)." (interactive "p") - (setq text-scale-mode-amount level) + (setq text-scale-mode-amount + (max (min level (text-scale-max-amount)) (text-scale-min-amount))) (text-scale-mode (if (zerop text-scale-mode-amount) -1 1))) ;;;###autoload @@ -279,8 +297,13 @@ Each step scales the height of the default face by the variable height by the same amount). As a special case, an argument of 0 will remove any scaling currently active." (interactive "p") - (setq text-scale-mode-amount - (if (= inc 0) 0 (+ (if text-scale-mode text-scale-mode-amount 0) inc))) + (let* ((current-value (if text-scale-mode text-scale-mode-amount 0)) + (new-value (if (= inc 0) 0 (+ current-value inc)))) + (if (or (> new-value (text-scale-max-amount)) + (< new-value (text-scale-min-amount))) + (user-error "Cannot %s the default face height more than it already is" + (if (> inc 0) "increase" "decrease"))) + (setq text-scale-mode-amount new-value)) (text-scale-mode (if (zerop text-scale-mode-amount) -1 1))) ;;;###autoload commit 85f257c9bc5b89043b2d7019e6763e552f4c89e7 Author: Eli Zaretskii Date: Sun Apr 10 19:15:13 2016 +0300 Improve documentation of 'with-eval-after-load' * lisp/subr.el (with-eval-after-load): Doc fix. (Bug#23258) diff --git a/lisp/subr.el b/lisp/subr.el index cbcc27b..4202cc7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3945,7 +3945,8 @@ This function makes or adds to an entry on `after-load-alist'." (defmacro with-eval-after-load (file &rest body) "Execute BODY after FILE is loaded. FILE is normally a feature name, but it can also be a file name, -in case that file does not provide any feature." +in case that file does not provide any feature. See `eval-after-load' +for more details about the different forms of FILE and their semantics." (declare (indent 1) (debug t)) `(eval-after-load ,file (lambda () ,@body))) commit 668c7bc5ba761551ef0d08dc96080eb5aa169da1 Author: Eli Zaretskii Date: Sun Apr 10 19:04:33 2016 +0300 Improve handling of non-ASCII characters in Git log messages * lisp/vc/vc-git.el (vc-git-commits-coding-system): Now a defcustom. (vc-git-log-output-coding-system): New defcustom. (vc-git-print-log, vc-git-command, vc-git--call): Use 'vc-git-log-output-coding-system' for reading stuff from Git. Don't override values of 'coding-system-for-read/write' if they are bound by caller -- this allows the user to force an encoding via "C-x RET c". (vc-git-checkin): On MS-Windows, pass the log message via a temporary file, to work around the limitations on passing non-ASCII characters via command-line arguments. Force using the 'locale-coding-system' for Git command-line arguments. This fixes problems with non-ASCII commit log messages on MS-Windows. (Bug#23076) * etc/NEWS: Mention the new vc-git related defcustoms. diff --git a/etc/NEWS b/etc/NEWS index 78d725b..f5e5548 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -987,6 +987,17 @@ back-end for the buffer's file, or remove it from version control. the color range from 'vc-annotate-color-map' is applied to the background or to the foreground. +--- +*** New options for customizing encoding of Git commit log messages. +The new options `vc-git-commits-coding-system' and +`vc-git-log-output-coding-system' allow to customize the encoding of +the log messages sent to Git when committing, and the decoding of the +log messages read from Git history commands. Both default to UTF-8; +if you customize them, make sure they are consistent with the Git +config variables i18n.commitEncoding and i18n.logOutputEncoding. +(`vc-git-commits-coding-system' existed previously, but was a +variable, not a user option.) + +++ *** 'compare-windows' now compares text with the most recently selected window instead of the next window. If you want the previous behavior of diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2921b64..f8b0b6f 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -165,8 +165,20 @@ matching the resulting Git log output, and KEYWORDS is a list of :type '(list string string (repeat sexp)) :version "24.1") -(defvar vc-git-commits-coding-system 'utf-8 - "Default coding system for git commits.") +(defcustom vc-git-commits-coding-system 'utf-8 + "Default coding system for sending commit log messages to Git. + +Should be consistent with the Git config value i18n.commitEncoding, +and should also be consistent with `locale-coding-system'." + :type '(coding-system :tag "Coding system to encode Git commit logs") + :version "25.1") + +(defcustom vc-git-log-output-coding-system 'utf-8 + "Default coding system for receiving log output from Git. + +Should be consistent with the Git config value i18n.logOutputEncoding." + :type '(coding-system :tag "Coding system to decode Git log output") + :version "25.1") ;; History of Git commands. (defvar vc-git-history nil) @@ -680,21 +692,43 @@ It is based on `log-edit-mode', and has Git-specific extensions.") (default-directory (expand-file-name root)) (only (or (cdr files) (not (equal root (abbreviate-file-name file1))))) - (coding-system-for-write vc-git-commits-coding-system)) + (pcsw coding-system-for-write) + (coding-system-for-write + ;; On MS-Windows, we must encode command-line arguments in + ;; the system codepage. + (if (eq system-type 'windows-nt) + locale-coding-system + (or coding-system-for-write vc-git-commits-coding-system))) + (msg-file + ;; On MS-Windows, pass the commit log message through a + ;; file, to work around the limitation that command-line + ;; arguments must be in the system codepage, and therefore + ;; might not support the non-ASCII characters in the log + ;; message. + (if (eq system-type 'windows-nt) (make-temp-file "git-msg")))) (cl-flet ((boolean-arg-fn (argument) (lambda (value) (when (equal value "yes") (list argument))))) ;; When operating on the whole tree, better pass "-a" than ".", since "." ;; fails when we're committing a merge. (apply 'vc-git-command nil 0 (if only files) - (nconc (list "commit" "-m") - (log-edit-extract-headers - `(("Author" . "--author") - ("Date" . "--date") - ("Amend" . ,(boolean-arg-fn "--amend")) - ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) - comment) - (if only (list "--only" "--") '("-a"))))))) + (nconc (if msg-file (list "commit" "-F" msg-file) + (list "commit" "-m")) + (let ((args + (log-edit-extract-headers + `(("Author" . "--author") + ("Date" . "--date") + ("Amend" . ,(boolean-arg-fn "--amend")) + ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) + comment))) + (when msg-file + (let ((coding-system-for-write + (or pcsw vc-git-commits-coding-system))) + (write-region (car args) nil msg-file)) + (setq args (cdr args))) + args) + (if only (list "--only" "--") '("-a"))))) + (if (and msg-file (file-exists-p msg-file)) (delete-file msg-file)))) (defun vc-git-find-revision (file rev buffer) (let* (process-file-side-effects @@ -854,7 +888,7 @@ If SHORTLOG is non-nil, use a short format based on `vc-git-root-log-format'. If START-REVISION is non-nil, it is the newest revision to show. If LIMIT is non-nil, show no more than this many entries." (let ((coding-system-for-read - (or coding-system-for-read vc-git-commits-coding-system))) + (or coding-system-for-read vc-git-log-output-coding-system))) ;; `vc-do-command' creates the buffer, but we need it before running ;; the command. (vc-setup-buffer buffer) @@ -1387,7 +1421,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]." The difference to vc-do-command is that this function always invokes `vc-git-program'." (let ((coding-system-for-read - (or coding-system-for-read vc-git-commits-coding-system)) + (or coding-system-for-read vc-git-log-output-coding-system)) (coding-system-for-write (or coding-system-for-write vc-git-commits-coding-system))) (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program @@ -1412,8 +1446,10 @@ The difference to vc-do-command is that this function always invokes ;; directories. We enable `inhibit-null-byte-detection', otherwise ;; Tramp's eol conversion might be confused. (let ((inhibit-null-byte-detection t) - (coding-system-for-read vc-git-commits-coding-system) - (coding-system-for-write vc-git-commits-coding-system) + (coding-system-for-read + (or coding-system-for-read vc-git-log-output-coding-system)) + (coding-system-for-write + (or coding-system-for-write vc-git-commits-coding-system)) (process-environment (cons "PAGER=" process-environment))) (apply 'process-file vc-git-program nil buffer nil command args))) commit b57076929f0e904864e1457d5789f2fe6652fc84 Author: Philipp Stephani Date: Thu Mar 31 23:10:40 2016 +0200 Remove undefined behavior in OS X dumper. Found by Address Sanitizer. * src/unexmacosx.c (unexec_write): Use Mach virtual memory API to avoid undefined behavior when reading arbitrary memory. diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 827eda5..bdacc8b 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -103,9 +103,11 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include #include #include +#include #include #include #ifdef HAVE_MALLOC_MALLOC_H @@ -217,10 +219,27 @@ unexec_read (void *dest, size_t n) static int unexec_write (off_t dest, const void *src, size_t count) { + task_t task = mach_task_self(); + if (task == MACH_PORT_NULL || task == MACH_PORT_DEAD) + return false; + if (lseek (outfd, dest, SEEK_SET) != dest) return 0; - return write (outfd, src, count) == count; + /* We use the Mach virtual memory API to read our process memory + because using src directly would be undefined behavior and fails + under Address Sanitizer. */ + bool success = false; + vm_offset_t data; + mach_msg_type_number_t data_count; + if (vm_read (task, (uintptr_t) src, count, &data, &data_count) + == KERN_SUCCESS) + { + success = + write (outfd, (const void *) (uintptr_t) data, data_count) == count; + vm_deallocate (task, data, data_count); + } + return success; } /* Write COUNT bytes of zeros to outfd starting at offset DEST. commit 97211f3630d0f5b76a5416075f7c7182e1ee3abd Author: Joakim Verona Date: Sat Apr 9 15:04:54 2016 +0300 Fix clipping of xwidgets * src/xwidget.c (x_draw_xwidget_glyph_string): Use window_box instead of calculating the clipping borders manually. Suggested by YAMAMOTO Mitsuharu . diff --git a/src/xwidget.c b/src/xwidget.c index 8ff4c23..7e96307 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -578,24 +578,22 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) other time to know things like window placement etc. */ xv = xwidget_init_view (xww, s, x, y); - /* Calculate clipping, which is used for all manner of onscreen - xwidget views. Each widget border can get clipped by other emacs - objects so there are four clipping variables. */ - clip_right = - min (xww->width, - WINDOW_RIGHT_EDGE_X (s->w) - x - - WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w) - - WINDOW_RIGHT_FRINGE_WIDTH (s->w)); - clip_left = - max (0, - WINDOW_LEFT_EDGE_X (s->w) - x + - WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w) + - WINDOW_LEFT_FRINGE_WIDTH (s->w)); - - clip_bottom = - min (xww->height, - WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y); - clip_top = max (0, WINDOW_TOP_EDGE_Y (s->w) - y); + int text_area_x, text_area_y, text_area_width, text_area_height; + + window_box (s->w, + ANY_AREA, + &text_area_x, + &text_area_y, + &text_area_width, + &text_area_height); + clip_right = min (xww->width, + text_area_width); + clip_left = max (0, + text_area_x); + + clip_bottom = min (xww->height, + text_area_height); + clip_top = max (0, text_area_y); /* We are concerned with movement of the onscreen area. The area might sit still when the widget actually moves. This happens commit e87fbc07801a4ac291d335f0af957ca32cd26381 Author: Eli Zaretskii Date: Sat Apr 9 12:30:59 2016 +0300 Improve Lisp-level documentation of tooltips * doc/lispref/display.texi (Tooltips): New section. (Bug#23246) (Display): Update the chapter menu. * doc/lispref/text.texi (Special Properties): Make the "tooltip" index entry more concrete. Change the cross-reference to point to "Tooltips" in the ELisp manual. * doc/lispref/elisp.texi (Top): Update the master menu. * doc/emacs/frames.texi (Tooltips): Include more customization variables. Add a cross-reference to the ELisp manual. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 35b3f83..383ae7f 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1152,11 +1152,11 @@ change the variable @code{x-gtk-file-dialog-help-text} to @code{nil}. @section Tooltips @cindex tooltips - @dfn{Tooltips} are small windows that display text information at -the current mouse position. They activate when there is a pause in -mouse movement over some significant piece of text in a window, or the -mode line, or some other part of the Emacs frame such as a tool bar -button or menu item. + @dfn{Tooltips} are small special frames that display text +information at the current mouse position. They activate when there +is a pause in mouse movement over some significant piece of text in a +window, or the mode line, or some other part of the Emacs frame such +as a tool bar button or menu item. @findex tooltip-mode You can toggle the use of tooltips with the command @kbd{M-x @@ -1164,11 +1164,41 @@ tooltip-mode}. When Tooltip mode is disabled, the help text is displayed in the echo area instead. To control the use of tooltips at startup, customize the variable @code{tooltip-mode}. -@vindex tooltip-delay - The variables @code{tooltip-delay} specifies how long Emacs should -wait before displaying a tooltip. For additional customization -options for displaying tooltips, use @kbd{M-x customize-group -@key{RET} tooltip @key{RET}}. +The following variables provide customization options for tooltip +display: + +@vtable @code +@item tooltip-delay +This variable specifies how long Emacs should wait before displaying +the first tooltip. The value is in seconds. + +@item tooltip-short-delay +This variable specifies how long Emacs should wait before displaying +subsequent tooltips on different items, having already displayed the +first tooltip. The value is in seconds. + +@item tooltip-hide-delay +The number of seconds since displaying a tooltip to hide it, if the +mouse doesn't move. + +@item tooltip-x-offset +@itemx tooltip-y-offset +The X and Y offsets, in pixels, of the left top corner of the tooltip +from the mouse pointer position. Note that these are ignored if +@code{tooltip-frame-parameters} was customized to include, +respectively, the @code{left} and @code{top} parameters. The values +of the offsets should be chosen so that the tooltip doesn't cover the +mouse pointer's hot spot, or it might interfere with clicking the +mouse. + +@item tooltip-frame-parameters +The frame parameters used for displaying tooltips. @xref{Frame +Parameters,,, elisp, The Emacs Lisp Reference Manual}, and also +@ref{Tooltips,,, elisp, The Emacs Lisp Reference Manual}. +@end vtable + +For additional customization options for displaying tooltips, use +@kbd{M-x customize-group @key{RET} tooltip @key{RET}}. @vindex x-gtk-use-system-tooltips If Emacs is built with GTK+ support, it displays tooltips via GTK+, diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9ea9548..010dcb2 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -34,6 +34,7 @@ that Emacs presents to the user. * Character Display:: How Emacs displays individual characters. * Beeping:: Audible signal to the user. * Window Systems:: Which window system is being used. +* Tooltips:: Tooltip display in Emacs. * Bidirectional Display:: Display of bidirectional scripts, such as Arabic and Farsi. @end menu @@ -6968,6 +6969,81 @@ indicator of Emacs capabilities on a given display type. Instead, use @code{display-graphic-p} or any of the other @code{display-*-p} predicates described in @ref{Display Feature Testing}. +@node Tooltips +@section Tooltips +@cindex tooltips +@dfn{Tooltips} are special frames (@pxref{Frames}) that are used to +display helpful hints (a.k.a.@: ``tips'') related to the current +position of the mouse pointer. Emacs uses tooltips to display help +strings about active portions of text (@pxref{Special Properties}) and +about various UI elements, such as menu items (@pxref{Extended Menu +Items}) and tool-bar buttons (@pxref{Tool Bar}). + +@defun tooltip-mode +Tooltip Mode is a minor mode that enables display of tooltips. +Turning off this mode causes the tooltips be displayed in the echo +area. On text-mode (a.k.a.@: ``TTY'') frames, tooltips are always +displayed in the echo area. +@end defun + +@vindex x-gtk-use-system-tooltips +When Emacs is built with GTK+ support, it by default displays tooltips +using GTK+ functions, and the appearance of the tooltips is then +controlled by GTK+ settings. GTK+ tooltips can be disabled by +changing the value of the variable @code{x-gtk-use-system-tooltips} to +@code{nil}. The rest of this subsection describes how to control +non-GTK+ tooltips, which are presented by Emacs itself. + +Since tooltips are special frames, they have their frame parameters +(@pxref{Frame Parameters}). Unlike other frames, the frame parameters +for tooltips are stored in a special variable. + +@defvar tooltip-frame-parameters +This customizable option holds the frame parameters used for +displaying tooltips. Any font and color parameters are ignored, and +the corresponding attributes of the @code{tooltip} face are used +instead. If @code{left} or @code{top} parameters are included, they +are used as absolute frame-relative coordinates where the tooltip +should be shown. (Mouse-relative position of the tooltip can be +customized using the variables described in @ref{Tooltips,,, emacs, +The GNU Emacs Manual}.) Note that the @code{left} and @code{top} +parameters, if present, override the values of mouse-relative offsets. +@end defvar + +@vindex tooltip@r{ face} +The @code{tooltip} face determines the appearance of text shown in +tooltips. It should generally use a variable-pitch font of size that +is preferably smaller than the default frame font. + +@findex tooltip-help-tips +@defvar tooltip-functions +This abnormal hook is a list of functions to call when Emacs needs to +display a tooltip. Each function is called with a single argument +@var{event} which is a copy of the last mouse movement event. If a +function on this list actually displays the tooltip, it should return +non-@code{nil}, and then the rest of the functions will not be +called. The default value of this variable is a single function +@code{tooltip-help-tips}. +@end defvar + +If you write your own function to be put on the +@code{tooltip-functions} list, you may need to know the buffer of the +mouse event that triggered the tooltip display. The following +function provides that information. + +@defun tooltip-event-buffer event +This function returns the buffer over which @var{event} occurred. +Call it with the argument of the function from +@code{tooltip-functions} to obtain the buffer whose text triggered the +tooltip. Note that the event might occur not over a buffer (e.g., +over the tool bar), in which case this function will return +@code{nil}. +@end defun + +Other aspects of tooltip display are controlled by several +customizable settings; see @ref{Tooltips,,, emacs, The GNU Emacs +Manual}. + @node Bidirectional Display @section Bidirectional Display @cindex bidirectional display diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 4c1541e..a3bff0b 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -1380,6 +1380,7 @@ Emacs Display * Character Display:: How Emacs displays individual characters. * Beeping:: Audible signal to the user. * Window Systems:: Which window system is being used. +* Tooltips:: Tooltip display in Emacs. * Bidirectional Display:: Display of bidirectional scripts, such as Arabic and Farsi. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 3749292..1ad665f 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3202,12 +3202,11 @@ or shorter, higher or lower, wider or narrow, or replaced with an image. @item help-echo @kindex help-echo @r{(text property)} -@cindex tooltip +@cindex tooltip for help strings @anchor{Text help-echo} If text has a string as its @code{help-echo} property, then when you move the mouse onto that text, Emacs displays that string in the echo -area, or in the tooltip window (@pxref{Tooltips,,, emacs, The GNU Emacs -Manual}). +area, or in the tooltip window (@pxref{Tooltips}). If the value of the @code{help-echo} property is a function, that function is called with three arguments, @var{window}, @var{object} and commit 9f1786e4165aba30ddb16116c5557a0531233008 Author: Glenn Morris Date: Fri Apr 8 20:59:21 2016 -0400 Faces names should not end in "-face". * lisp/rect.el (rectangle-preview): Rename from rectangle-preview-face. * lisp/vc/vc-hooks.el (vc-state-base): Rename from vc-state-base-face. diff --git a/lisp/rect.el b/lisp/rect.el index 73790f2..685213a 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -398,8 +398,9 @@ With a prefix (or a FILL) argument, also fill too short lines." (defun rectangle--space-to (col) (propertize " " 'display `(space :align-to ,col))) -(defface rectangle-preview-face '((t :inherit region)) - "The face to use for the `string-rectangle' preview.") +(defface rectangle-preview '((t :inherit region)) + "The face to use for the `string-rectangle' preview." + :version "25.1") (defcustom rectangle-preview t "If non-nil, `string-rectangle' will show an-the-fly preview." diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 22c4d17..0826744 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -40,7 +40,7 @@ :group 'mode-line :version "25.1") -(defface vc-state-base-face +(defface vc-state-base '((default)) "Base face for VC state indicator." :group 'vc-faces @@ -48,49 +48,49 @@ :version "25.1") (defface vc-up-to-date-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file is up to date." :version "25.1" :group 'vc-faces) (defface vc-needs-update-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file needs update." :version "25.1" :group 'vc-faces) (defface vc-locked-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file locked." :version "25.1" :group 'vc-faces) (defface vc-locally-added-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file is locally added." :version "25.1" :group 'vc-faces) (defface vc-conflict-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file contains merge conflicts." :version "25.1" :group 'vc-faces) (defface vc-removed-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file was removed from the VC system." :version "25.1" :group 'vc-faces) (defface vc-missing-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file is missing from the file system." :version "25.1" :group 'vc-faces) (defface vc-edited-state - '((default :inherit vc-state-base-face)) + '((default :inherit vc-state-base)) "Face for VC modeline state when the file is edited." :version "25.1" :group 'vc-faces) commit 32832712532449ec32dfcbc5c21c2f5e52faa435 Author: Paul Eggert Date: Fri Apr 8 16:29:59 2016 -0700 * src/xsmfns.c (syms_of_xsmfns): Remove stray "s in doc strings. diff --git a/src/xsmfns.c b/src/xsmfns.c index 0819e87..42e2340 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -545,7 +545,7 @@ syms_of_xsmfns (void) Changing the value does not change the session id used by Emacs. The value is nil if no session manager is running. See also `x-session-previous-id', `emacs-save-session-functions', -`emacs-session-save' and `emacs-session-restore'." */); +`emacs-session-save' and `emacs-session-restore'. */); Vx_session_id = Qnil; DEFVAR_LISP ("x-session-previous-id", Vx_session_previous_id, @@ -568,7 +568,7 @@ The session id Emacs has while it is running is in the variable same, depending on how the session manager works. See also `emacs-save-session-functions', `emacs-session-save' and -`emacs-session-restore'." */); +`emacs-session-restore'. */); Vx_session_previous_id = Qnil; defsubr (&Shandle_save_session); commit a1f221bd82eb4393ccba83a361b435a4992b532a Author: Paul Eggert Date: Fri Apr 8 13:39:17 2016 -0700 Comint and compile no longer set EMACS This mostly restores the change that I reverted on March 23, fixing most of Bug#20202. The only part of the change that is still reverted is the change to M-x term, where compatibility with current Bash constrains us from moving too quickly (Bug#20484). Problem reported by Phillip Lord in: http://bugs.gnu.org/20484#108 * etc/NEWS: Document this. * lisp/comint.el (comint-exec-1): * lisp/net/tramp-sh.el (tramp-remote-process-environment): * lisp/progmodes/compile.el (compilation-start): Don’t set EMACS=t in the subsidiary process. diff --git a/etc/NEWS b/etc/NEWS index 9526588..78d725b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1398,8 +1398,10 @@ symbol-function was changed not to signal 'void-function' any more. *** As a consequence, the second arg of 'indirect-function' is now obsolete. +++ -** Although comint, term, and compile still set the EMACS variable, -this is now considered deprecated and will be removed in a future release. +** M-x shell and M-x compile no longer set the EMACS environment variable. +This avoids clashing when other programs use the variable for other purposes. +Although M-x term still sets EMACS for compatibility with Bash 4.3 and earlier, +this is deprecated and will be phased out when Bash 4.4 or later takes over. Use the INSIDE_EMACS environment variable instead. +++ diff --git a/lisp/comint.el b/lisp/comint.el index cb79c17..dcd4a5a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -816,13 +816,6 @@ series of processes in the same Comint buffer. The hook (format "COLUMNS=%d" (window-width))) (list "TERM=emacs" (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width)))) - - ;; This hack is for backward compatibility with Bash 4.3 and - ;; earlier. It can break common uses of 'configure', so - ;; remove it once Bash 4.4 or later is common. - (unless (getenv "EMACS") - (list "EMACS=t")) - (list (format "INSIDE_EMACS=%s,comint" emacs-version)) process-environment)) (default-directory diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 79ff1be..4d529f7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -520,7 +520,6 @@ as given in your `~/.profile'." (defcustom tramp-remote-process-environment `("TMOUT=0" "LC_CTYPE=''" ,(format "TERM=%s" tramp-terminal-type) - "EMACS=t" ;; Deprecated; remove this line once Bash 4.4-or-later is common. ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" "autocorrect=" "correct=") diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0b15a28..b7ab408 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1702,14 +1702,6 @@ Returns the compilation buffer created." (list "TERM=emacs" (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width)))) - - ;; Set the EMACS variable, but - ;; don't override users' setting of $EMACS. - ;; Remove this hack once Bash 4.4-or-later is common, - ;; since it can break 'configure'. - (unless (getenv "EMACS") - (list "EMACS=t")) - (list (format "INSIDE_EMACS=%s,compile" emacs-version)) (copy-sequence process-environment)))) (set (make-local-variable 'compilation-arguments) commit 5c288909b96452ed5d01befc8b624e94511620ed Author: Stefan Monnier Date: Fri Apr 8 14:02:24 2016 -0400 * lisp/subr.el (read-key): Don't let the prompt linger (bug#22714) diff --git a/lisp/subr.el b/lisp/subr.el index dde7691..cbcc27b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2086,6 +2086,10 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'." (aref keys 1) key))) (cancel-timer timer) + ;; For some reason, `read-key(-sequence)' leaves the prompt in the echo + ;; area, whereas `read-event' seems to empty it just before returning + ;; (bug#22714). So, let's mimick the behavior of `read-event'. + (message nil) (use-global-map old-global-map)))) (defvar read-passwd-map commit a75b9a6f2276a15a155660c99f7ff654190b7e9a Merge: c93ae7a f6497c6 Author: Eli Zaretskii Date: Fri Apr 8 16:55:34 2016 +0300 Merge branch 'emacs-25' of git.savannah.gnu.org:/srv/git/emacs into emacs-25 commit c93ae7a1e5a94541189a8f36984014344d561ffc Author: Eli Zaretskii Date: Fri Apr 8 16:54:18 2016 +0300 Allow to customize names of executables used by grep.el * lisp/progmodes/grep.el (grep-find-program): Renamed from 'find-program', which was a variable. All uses changed. (grep-xargs-program): Renamed from 'xargs-program', which was a variable. All uses changed. (grep-program): Now a defcustom rather than a simple variable. (Bug#23219) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index f04a722..5d1b68a 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -411,21 +411,34 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies This gets tacked on the end of the generated expressions.") ;;;###autoload -(defvar grep-program (purecopy "grep") +(defcustom grep-program (purecopy "grep") "The default grep program for `grep-command' and `grep-find-command'. -This variable's value takes effect when `grep-compute-defaults' is called.") +This variable's value takes effect when `grep-compute-defaults' is called." + :type 'string + :version "25.1" + :group 'grep) ;;;###autoload -(defvar find-program (purecopy "find") +(defcustom grep-find-program (purecopy "find") "The default find program. This is used by commands like `grep-find-command', `find-dired' -and others.") +and others." + :type 'string + :version "25.1" + :group 'grep) + +(define-obsolete-variable-alias 'find-program 'grep-find-program "25.1") ;;;###autoload -(defvar xargs-program (purecopy "xargs") +(defcustom grep-xargs-program (purecopy "xargs") "The default xargs program for `grep-find-command'. See `grep-find-use-xargs'. -This variable's value takes effect when `grep-compute-defaults' is called.") +This variable's value takes effect when `grep-compute-defaults' is called." + :type 'string + :version "25.1" + :group 'grep) + +(define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1") ;;;###autoload (defvar grep-find-use-xargs nil @@ -595,13 +608,14 @@ This function is called from `compilation-filter-hook'." (unless grep-find-use-xargs (setq grep-find-use-xargs (cond - ((grep-probe find-program + ((grep-probe grep-find-program `(nil nil nil ,null-device "-exec" "echo" "{}" "+")) 'exec-plus) ((and - (grep-probe find-program `(nil nil nil ,null-device "-print0")) - (grep-probe xargs-program `(nil nil nil "-0" "echo"))) + (grep-probe grep-find-program + `(nil nil nil ,null-device "-print0")) + (grep-probe grep-xargs-program `(nil nil nil "-0" "echo"))) 'gnu) (t 'exec)))) @@ -612,10 +626,11 @@ This function is called from `compilation-filter-hook'." ;; after the pipe symbol be quoted if they use ;; forward slashes as directory separators. (format "%s . -type f -print0 | \"%s\" -0 %s" - find-program xargs-program grep-command)) + grep-find-program grep-xargs-program + grep-command)) ((memq grep-find-use-xargs '(exec exec-plus)) (let ((cmd0 (format "%s . -type f -exec %s" - find-program grep-command)) + grep-find-program grep-command)) (null (if grep-use-null-device (format "%s " null-device) ""))) @@ -627,7 +642,8 @@ This function is called from `compilation-filter-hook'." (1+ (length cmd0))))) (t (format "%s . -type f -print | \"%s\" %s" - find-program xargs-program grep-command))))) + grep-find-program grep-xargs-program + grep-command))))) (unless grep-find-template (setq grep-find-template (let ((gcmd (format "%s %s " @@ -637,17 +653,17 @@ This function is called from `compilation-filter-hook'." ""))) (cond ((eq grep-find-use-xargs 'gnu) (format "%s -type f -print0 | \"%s\" -0 %s" - find-program xargs-program gcmd)) + grep-find-program grep-xargs-program gcmd)) ((eq grep-find-use-xargs 'exec) (format "%s -type f -exec %s {} %s%s" - find-program gcmd null + grep-find-program gcmd null (shell-quote-argument ";"))) ((eq grep-find-use-xargs 'exec-plus) (format "%s -type f -exec %s %s{} +" - find-program gcmd null)) + grep-find-program gcmd null)) (t (format "%s -type f -print | \"%s\" %s" - find-program xargs-program gcmd)))))))) + grep-find-program grep-xargs-program gcmd)))))))) ;; Save defaults for this host. (setq grep-host-defaults-alist commit f6497c6e760b3b50015f35d7ce5a36df628ee498 Author: Alan Third Date: Fri Apr 8 15:52:55 2016 +0200 Set locale encoding to UTF-8 when run from OS X GUI. * src/nsterm.m (ns_init_locale): Append .UTF-8 when setting LANG. diff --git a/src/nsterm.m b/src/nsterm.m index 4048ac4..34c5395 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -596,8 +596,15 @@ - (NSColor *)colorUsingDefaultColorSpace @try { + /* It seems OS X should probably use UTF-8 everywhere. + 'localeIdentifier' does not specify the encoding, and I can't + find any way to get the OS to tell us which encoding to use, + so hard-code '.UTF-8'. */ + NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8", + [locale localeIdentifier]]; + /* Set LANG to locale, but not if LANG is already set. */ - setenv("LANG", [[locale localeIdentifier] UTF8String], 0); + setenv("LANG", [localeID UTF8String], 0); } @catch (NSException *e) { commit 7ad1d075b940f276adaf3b6bb0c024079c403f80 Author: Eli Zaretskii Date: Fri Apr 8 11:05:20 2016 +0300 Avoid signaling errors in 'M-n' at the 'C-x C-f' prompt * lisp/ffap.el (ffap-guess-file-name-at-point): Ignore errors while 'ffap-guesser' runs. (Bug#23218) diff --git a/lisp/ffap.el b/lisp/ffap.el index 36727b3..8343b47 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1966,7 +1966,9 @@ Only intended for interactive use." (defun ffap-guess-file-name-at-point () "Try to get a file name at point. This hook is intended to be put in `file-name-at-point-functions'." - (let ((guess (ffap-guesser))) + ;; ffap-guesser can signal an error, and we don't want that when, + ;; e.g., the user types M-n at the "C-x C-f" prompt. + (let ((guess (ignore-errors (ffap-guesser)))) (when (stringp guess) (let ((url (ffap-url-p guess))) (or url commit a3f1ac2e3b546951f3182a7b42cad7f64a94e0b8 Author: Marcin Borkowski Date: Fri Apr 8 10:57:21 2016 +0300 Avoid infinite loop in 'studlify-word' * lisp/play/studly.el (studlify-region): Call 'forward-word-strictly' and 'backward-word-strictly' instead of 'forward-word' and 'backward-word'. (Bug#19940) diff --git a/lisp/play/studly.el b/lisp/play/studly.el index f6aae45..ff1bf03 100644 --- a/lisp/play/studly.el +++ b/lisp/play/studly.el @@ -25,10 +25,10 @@ (setq begin (point)) (while (and (<= (point) end) (not (looking-at "\\W*\\'"))) - (forward-word 1) - (backward-word 1) + (forward-word-strictly 1) + (backward-word-strictly 1) (setq begin (max (point) begin)) - (forward-word 1) + (forward-word-strictly 1) (let ((offset 0) (word-end (min (point) end)) c) @@ -55,7 +55,7 @@ "Studlify-case the current word, or COUNT words if given an argument." (interactive "*p") (let ((begin (point)) end rb re) - (forward-word count) + (forward-word-strictly count) (setq end (point)) (setq rb (min begin end) re (max begin end)) (studlify-region rb re))) commit f36df4b97ba6f335c24ada099203a9244ac84ce5 Author: Paul Eggert Date: Thu Apr 7 16:52:01 2016 -0700 Don’t recommend obsolete EMACS env var * doc/misc/efaq.texi (Escape sequences in shell output): Remove long-obsolete (and now-confusing) notes about the EMACS environment variable in Emacs 21.1 and earlier. * doc/misc/efaq.texi (^M in the shell buffer): * etc/PROBLEMS: Remove obsolescent recommendation to consult the EMACS environment variable. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 5008db3..1fa4649 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -2664,11 +2664,6 @@ by typing @kbd{M-x ansi-color-for-comint-mode} in the Shell buffer, or by adding @code{(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)} to your init file. -In Emacs versions before 21.1, the @code{ansi-color} package is not -included. In that case, you need to unalias @code{ls} for interactive -shells running in Emacs; this can be done by checking the @code{EMACS} -variable in the environment. - @node Fullscreen mode on MS-Windows @section How can I start Emacs in fullscreen mode on MS-Windows? @cindex Maximize frame @@ -2757,11 +2752,9 @@ For @code{tcsh}, put this in your @file{.cshrc} (or @file{.tcshrc}) file: @example -if ($?EMACS) then - if ("$EMACS" =~ /*) then - if ($?tcsh) unset edit - stty nl - endif +if ($?INSIDE_EMACS && $?tcsh) + unset edit + stty -icrnl -onlcr -echo susp ^Z endif @end example @@ -2769,7 +2762,7 @@ Or put this in your @file{.emacs_tcsh} or @file{~/.emacs.d/init_tcsh.sh} file: @example unset edit -stty nl +stty -icrnl -onlcr -echo susp ^Z @end example Alternatively, use @code{csh} in your shell buffers instead of diff --git a/etc/PROBLEMS b/etc/PROBLEMS index d531367..b0c21ee 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -459,11 +459,9 @@ smart. It sees that the Shell uses terminal type 'unknown' and turns on the flag to output ^M at the end of each line. You can fix the problem by adding this to your .cshrc file: - if ($?EMACS) then - if ("$EMACS" =~ /*) then - unset edit - stty -icrnl -onlcr -echo susp ^Z - endif + if ($?INSIDE_EMACS && $?tcsh) + unset edit + stty -icrnl -onlcr -echo susp ^Z endif *** Emacs startup on GNU/Linux systems (and possibly other systems) is slow. commit fb0b531e9e5a260addf79ad1603cc8b7c2c03d1f Author: Glenn Morris Date: Thu Apr 7 16:26:55 2016 -0400 * lisp/emacs-lisp/package.el: Change from a few days ago needs seq. ; Warning 'foo' is not known to be defined is always a bug. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 29de2c9..7a5b020 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -146,6 +146,7 @@ (eval-when-compile (require 'subr-x)) (eval-when-compile (require 'cl-lib)) (eval-when-compile (require 'epg)) ;For setf accessors. +(require 'seq) (require 'tabulated-list) (require 'macroexp) commit b7d8abd7f020b210d02cd7fc5b03c41a8cf7422a Author: Glenn Morris Date: Thu Apr 7 16:24:25 2016 -0400 * lisp/emacs-lisp/seq.el: Load cl-lib, not cl-extra. ; The various components of cl-lib are an internal implementation detail. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 300fe5c..8362dda 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -57,7 +57,7 @@ ;;; Code: (eval-when-compile (require 'cl-generic)) -(require 'cl-extra) ;; for cl-subseq +(require 'cl-lib) ;; for cl-subseq (defmacro seq-doseq (spec &rest body) "Loop over a sequence. commit 96d9e78bd40edff9c901eee1c95ea56d93b55acb Author: Leo Liu Date: Thu Apr 7 21:42:40 2016 +0800 Fix "Beginning of buffer" error in forward-page * lisp/textmodes/page.el (forward-page): Check before move to prevent "Beginning of buffer" error. diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el index 17fda677..22c7359 100644 --- a/lisp/textmodes/page.el +++ b/lisp/textmodes/page.el @@ -48,12 +48,13 @@ A page boundary is any line whose beginning matches the regexp (and (save-excursion (re-search-backward page-delimiter nil t)) (= (match-end 0) (point)) (goto-char (match-beginning 0))) - (forward-char -1) - (if (re-search-backward page-delimiter nil t) - ;; We found one--move to the end of it. - (goto-char (match-end 0)) - ;; We found nothing--go to beg of buffer. - (goto-char (point-min))) + (unless (bobp) + (forward-char -1) + (if (re-search-backward page-delimiter nil t) + ;; We found one--move to the end of it. + (goto-char (match-end 0)) + ;; We found nothing--go to beg of buffer. + (goto-char (point-min)))) (setq count (1+ count)))) (defun backward-page (&optional count) commit 20686f7a6430ef37f17b3866f14e7dc3095c1524 Author: Dmitry Gutov Date: Thu Apr 7 02:02:13 2016 +0300 Add a `transient' project type * lisp/progmodes/project.el (project-roots): Implement for the `transient' project type (bug#23224). (project-current): Instead of signaling an error, return a transient project instance rooted in the chosen directory. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1251bca..9c8a88c 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -101,7 +101,9 @@ that it is not applicable, or a project instance.") (defun project-current (&optional maybe-prompt dir) "Return the project instance in DIR or `default-directory'. When no project found in DIR, and MAYBE-PROMPT is non-nil, ask -the user for a different directory to look in." +the user for a different directory to look in. If that directory +is not a part of a detectable project either, return a +`transient' project instance rooted in it." (unless dir (setq dir default-directory)) (let ((pr (project--find-in-directory dir))) (cond @@ -110,7 +112,8 @@ the user for a different directory to look in." (setq dir (read-directory-name "Choose the project directory: " dir nil t) pr (project--find-in-directory dir)) (unless pr - (user-error "No project found in `%s'" dir)))) + (message "Using '%s' as a transient project root" dir) + (setq pr (cons 'transient dir))))) pr)) (defun project--find-in-directory (dir) @@ -182,6 +185,9 @@ to find the list of ignores for each directory." (t (complete-with-action action all-files string pred)))))) +(cl-defmethod project-roots ((project (head transient))) + (list (cdr project))) + (defgroup project-vc nil "Project implementation using the VC package." :version "25.1" commit 0d7aad1b30de7e9deb8b3c7011d9b679e538371c Author: Lars Magne Ingebrigtsen Date: Wed Apr 6 18:36:18 2016 +0200 Revert "Backport HTTPS proxy fix" This reverts commit 2d1a6054b161bd1055d4feb11c8c5ac95543f5db. It's too late in the Emacs 25 release cycle to add things like this to Emacs 25.1. It's border line new feature. diff --git a/etc/NEWS b/etc/NEWS index 7ed617b..9526588 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,8 +933,6 @@ variable, meaning you can bind it around an 'url-retrieve' call. plist will contain a :peer element that has the output of 'gnutls-peer-status' (if Emacs is built with GnuTLS support). -*** The URL package now support https over proxies supporting CONNECT. - ** Tramp +++ diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 9548a1f..5832e92 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -26,7 +26,6 @@ ;;; Code: (require 'cl-lib) -(require 'nsm) (eval-when-compile (require 'subr-x)) @@ -136,8 +135,6 @@ request.") (507 insufficient-storage "Insufficient storage")) "The HTTP return codes and their text.") -(defconst url-https-default-port 443 "Default HTTPS port.") - ;(eval-when-compile ;; These are all macros so that they are hidden from external sight ;; when the file is byte-compiled. @@ -199,14 +196,7 @@ request.") ;; `url-open-stream' needs a buffer in which to do things ;; like authentication. But we use another buffer afterwards. (unwind-protect - (let ((proc (url-open-stream host buf - (if url-using-proxy - (url-host url-using-proxy) - host) - (if url-using-proxy - (url-port url-using-proxy) - port) - gateway-method))) + (let ((proc (url-open-stream host buf host port gateway-method))) ;; url-open-stream might return nil. (when (processp proc) ;; Drop the temp buffer link before killing the buffer. @@ -485,7 +475,6 @@ work correctly." ) (declare-function gnutls-peer-status "gnutls.c" (proc)) -(declare-function gnutls-negotiate "gnutls.el") (defun url-http-parse-headers () "Parse and handle HTTP specific headers. @@ -942,13 +931,7 @@ should be shown to the user." (erase-buffer) (let ((url-request-method url-http-method) (url-request-extra-headers url-http-extra-headers) - (url-request-data url-http-data) - (url-using-proxy (url-find-proxy-for-url - url-current-object - (url-host url-current-object)))) - (when url-using-proxy - (setq url-using-proxy - (url-generic-parse-url url-using-proxy))) + (url-request-data url-http-data)) (url-http url-current-object url-callback-function url-callback-arguments (current-buffer))))) ((url-http-parse-headers) @@ -1229,20 +1212,17 @@ overriding the value of `url-gateway-method'." (nsm-noninteractive (or url-request-noninteractive (and (boundp 'url-http-noninteractive) url-http-noninteractive))) - (connection (url-http-find-free-connection (url-host url) - (url-port url) - gateway-method)) + (connection (url-http-find-free-connection host port gateway-method)) (mime-accept-string url-mime-accept-string) (buffer (or retry-buffer (generate-new-buffer - (format " *http %s:%d*" (url-host url) (url-port url)))))) + (format " *http %s:%d*" host port))))) (if (not connection) ;; Failed to open the connection for some reason (progn (kill-buffer buffer) (setq buffer nil) - (error "Could not create connection to %s:%d" (url-host url) - (url-port url))) + (error "Could not create connection to %s:%d" host port)) (with-current-buffer buffer (mm-disable-multibyte) (setq url-current-object url @@ -1298,72 +1278,13 @@ overriding the value of `url-gateway-method'." (set-process-sentinel connection 'url-http-async-sentinel)) (`failed ;; Asynchronous connection failed - (error "Could not create connection to %s:%d" (url-host url) - (url-port url))) + (error "Could not create connection to %s:%d" host port)) (_ - (if (and url-http-proxy (string= "https" - (url-type url-current-object))) - (url-https-proxy-connect connection) - (set-process-sentinel connection - 'url-http-end-of-document-sentinel) - (process-send-string connection (url-http-create-request))))))) + (set-process-sentinel connection + 'url-http-end-of-document-sentinel) + (process-send-string connection (url-http-create-request)))))) buffer)) -(defun url-https-proxy-connect (connection) - (setq url-http-after-change-function 'url-https-proxy-after-change-function) - (process-send-string connection (format (concat "CONNECT %s:%d HTTP/1.1\r\n" - "Host: %s\r\n" - "\r\n") - (url-host url-current-object) - (or (url-port url-current-object) - url-https-default-port) - (url-host url-current-object)))) - -(defun url-https-proxy-after-change-function (st nd length) - (let* ((process-buffer (current-buffer)) - (proc (get-buffer-process process-buffer))) - (goto-char (point-min)) - (when (re-search-forward "^\r?\n" nil t) - (backward-char 1) - ;; Saw the end of the headers - (setq url-http-end-of-headers (set-marker (make-marker) (point))) - (url-http-parse-response) - (cond - ((null url-http-response-status) - ;; We got back a headerless malformed response from the - ;; server. - (url-http-activate-callback) - (error "Malformed response from proxy, fail!")) - ((= url-http-response-status 200) - (if (gnutls-available-p) - (condition-case e - (let ((tls-connection (gnutls-negotiate - :process proc - :hostname (url-host url-current-object) - :verify-error nil))) - ;; check certificate validity - (setq tls-connection - (nsm-verify-connection tls-connection - (url-host url-current-object) - (url-port url-current-object))) - (with-current-buffer process-buffer (erase-buffer)) - (set-process-buffer tls-connection process-buffer) - (setq url-http-after-change-function - 'url-http-wait-for-headers-change-function) - (set-process-filter tls-connection 'url-http-generic-filter) - (process-send-string tls-connection - (url-http-create-request))) - (gnutls-error - (url-http-activate-callback) - (error "gnutls-error: %s" e)) - (error - (url-http-activate-callback) - (error "error: %s" e))) - (error "error: gnutls support needed!"))) - (t - (url-http-activate-callback) - (message "error response: %d" url-http-response-status)))))) - (defun url-http-async-sentinel (proc why) ;; We are performing an asynchronous connection, and a status change ;; has occurred. @@ -1375,13 +1296,11 @@ overriding the value of `url-gateway-method'." (url-http-end-of-document-sentinel proc why)) ((string= (substring why 0 4) "open") (setq url-http-connection-opened t) - (if (and url-http-proxy (string= "https" (url-type url-current-object))) - (url-https-proxy-connect proc) - (condition-case error - (process-send-string proc (url-http-create-request)) - (file-error - (setq url-http-connection-opened nil) - (message "HTTP error: %s" error))))) + (condition-case error + (process-send-string proc (url-http-create-request)) + (file-error + (setq url-http-connection-opened nil) + (message "HTTP error: %s" error)))) (t (setf (car url-callback-arguments) (nconc (list :error (list 'error 'connection-failed why @@ -1542,6 +1461,7 @@ p3p ;; with url-http.el on systems with 8-character file names. (require 'tls) +(defconst url-https-default-port 443 "Default HTTPS port.") (defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") ;; FIXME what is the point of this alias being an autoload? commit 2d1a6054b161bd1055d4feb11c8c5ac95543f5db Author: Tao Fang Date: Mon Apr 4 22:21:21 2016 +0200 Backport HTTPS proxy fix Cherry-picked from 3c623c26ae7d695746e05d8a2e16a67a6256b024 Backport: diff --git a/etc/NEWS b/etc/NEWS index 9526588..7ed617b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,6 +933,8 @@ variable, meaning you can bind it around an 'url-retrieve' call. plist will contain a :peer element that has the output of 'gnutls-peer-status' (if Emacs is built with GnuTLS support). +*** The URL package now support https over proxies supporting CONNECT. + ** Tramp +++ diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 5832e92..9548a1f 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -26,6 +26,7 @@ ;;; Code: (require 'cl-lib) +(require 'nsm) (eval-when-compile (require 'subr-x)) @@ -135,6 +136,8 @@ request.") (507 insufficient-storage "Insufficient storage")) "The HTTP return codes and their text.") +(defconst url-https-default-port 443 "Default HTTPS port.") + ;(eval-when-compile ;; These are all macros so that they are hidden from external sight ;; when the file is byte-compiled. @@ -196,7 +199,14 @@ request.") ;; `url-open-stream' needs a buffer in which to do things ;; like authentication. But we use another buffer afterwards. (unwind-protect - (let ((proc (url-open-stream host buf host port gateway-method))) + (let ((proc (url-open-stream host buf + (if url-using-proxy + (url-host url-using-proxy) + host) + (if url-using-proxy + (url-port url-using-proxy) + port) + gateway-method))) ;; url-open-stream might return nil. (when (processp proc) ;; Drop the temp buffer link before killing the buffer. @@ -475,6 +485,7 @@ work correctly." ) (declare-function gnutls-peer-status "gnutls.c" (proc)) +(declare-function gnutls-negotiate "gnutls.el") (defun url-http-parse-headers () "Parse and handle HTTP specific headers. @@ -931,7 +942,13 @@ should be shown to the user." (erase-buffer) (let ((url-request-method url-http-method) (url-request-extra-headers url-http-extra-headers) - (url-request-data url-http-data)) + (url-request-data url-http-data) + (url-using-proxy (url-find-proxy-for-url + url-current-object + (url-host url-current-object)))) + (when url-using-proxy + (setq url-using-proxy + (url-generic-parse-url url-using-proxy))) (url-http url-current-object url-callback-function url-callback-arguments (current-buffer))))) ((url-http-parse-headers) @@ -1212,17 +1229,20 @@ overriding the value of `url-gateway-method'." (nsm-noninteractive (or url-request-noninteractive (and (boundp 'url-http-noninteractive) url-http-noninteractive))) - (connection (url-http-find-free-connection host port gateway-method)) + (connection (url-http-find-free-connection (url-host url) + (url-port url) + gateway-method)) (mime-accept-string url-mime-accept-string) (buffer (or retry-buffer (generate-new-buffer - (format " *http %s:%d*" host port))))) + (format " *http %s:%d*" (url-host url) (url-port url)))))) (if (not connection) ;; Failed to open the connection for some reason (progn (kill-buffer buffer) (setq buffer nil) - (error "Could not create connection to %s:%d" host port)) + (error "Could not create connection to %s:%d" (url-host url) + (url-port url))) (with-current-buffer buffer (mm-disable-multibyte) (setq url-current-object url @@ -1278,13 +1298,72 @@ overriding the value of `url-gateway-method'." (set-process-sentinel connection 'url-http-async-sentinel)) (`failed ;; Asynchronous connection failed - (error "Could not create connection to %s:%d" host port)) + (error "Could not create connection to %s:%d" (url-host url) + (url-port url))) (_ - (set-process-sentinel connection - 'url-http-end-of-document-sentinel) - (process-send-string connection (url-http-create-request)))))) + (if (and url-http-proxy (string= "https" + (url-type url-current-object))) + (url-https-proxy-connect connection) + (set-process-sentinel connection + 'url-http-end-of-document-sentinel) + (process-send-string connection (url-http-create-request))))))) buffer)) +(defun url-https-proxy-connect (connection) + (setq url-http-after-change-function 'url-https-proxy-after-change-function) + (process-send-string connection (format (concat "CONNECT %s:%d HTTP/1.1\r\n" + "Host: %s\r\n" + "\r\n") + (url-host url-current-object) + (or (url-port url-current-object) + url-https-default-port) + (url-host url-current-object)))) + +(defun url-https-proxy-after-change-function (st nd length) + (let* ((process-buffer (current-buffer)) + (proc (get-buffer-process process-buffer))) + (goto-char (point-min)) + (when (re-search-forward "^\r?\n" nil t) + (backward-char 1) + ;; Saw the end of the headers + (setq url-http-end-of-headers (set-marker (make-marker) (point))) + (url-http-parse-response) + (cond + ((null url-http-response-status) + ;; We got back a headerless malformed response from the + ;; server. + (url-http-activate-callback) + (error "Malformed response from proxy, fail!")) + ((= url-http-response-status 200) + (if (gnutls-available-p) + (condition-case e + (let ((tls-connection (gnutls-negotiate + :process proc + :hostname (url-host url-current-object) + :verify-error nil))) + ;; check certificate validity + (setq tls-connection + (nsm-verify-connection tls-connection + (url-host url-current-object) + (url-port url-current-object))) + (with-current-buffer process-buffer (erase-buffer)) + (set-process-buffer tls-connection process-buffer) + (setq url-http-after-change-function + 'url-http-wait-for-headers-change-function) + (set-process-filter tls-connection 'url-http-generic-filter) + (process-send-string tls-connection + (url-http-create-request))) + (gnutls-error + (url-http-activate-callback) + (error "gnutls-error: %s" e)) + (error + (url-http-activate-callback) + (error "error: %s" e))) + (error "error: gnutls support needed!"))) + (t + (url-http-activate-callback) + (message "error response: %d" url-http-response-status)))))) + (defun url-http-async-sentinel (proc why) ;; We are performing an asynchronous connection, and a status change ;; has occurred. @@ -1296,11 +1375,13 @@ overriding the value of `url-gateway-method'." (url-http-end-of-document-sentinel proc why)) ((string= (substring why 0 4) "open") (setq url-http-connection-opened t) - (condition-case error - (process-send-string proc (url-http-create-request)) - (file-error - (setq url-http-connection-opened nil) - (message "HTTP error: %s" error)))) + (if (and url-http-proxy (string= "https" (url-type url-current-object))) + (url-https-proxy-connect proc) + (condition-case error + (process-send-string proc (url-http-create-request)) + (file-error + (setq url-http-connection-opened nil) + (message "HTTP error: %s" error))))) (t (setf (car url-callback-arguments) (nconc (list :error (list 'error 'connection-failed why @@ -1461,7 +1542,6 @@ p3p ;; with url-http.el on systems with 8-character file names. (require 'tls) -(defconst url-https-default-port 443 "Default HTTPS port.") (defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") ;; FIXME what is the point of this alias being an autoload? commit 80128a784912096c6b0ee46b76b068e019cff057 Author: Paul Eggert Date: Wed Apr 6 01:22:00 2016 -0700 Fix stability confusion in sort-tests Problem reported by Philipp Stephani (Bug#23205). * test/automated/sort-tests.el: (sort-tests--insert-words-sort-and-compare): Don’t assume that reversing a sorted list is the same as sorting with the reverse predicate. This is not true for stable sorts when items compare equal. diff --git a/test/automated/sort-tests.el b/test/automated/sort-tests.el index 5297329..f3a182c 100644 --- a/test/automated/sort-tests.el +++ b/test/automated/sort-tests.el @@ -40,8 +40,10 @@ (funcall function reverse (point-min) (point-max)) (let ((sorted-words (mapconcat #'identity - (let ((x (sort (copy-sequence words) less-predicate))) - (if reverse (reverse x) x)) + (sort (copy-sequence words) + (if reverse + (lambda (a b) (funcall less-predicate b a)) + less-predicate)) separator))) (should (string= (substring (buffer-string) 0 -1) sorted-words))))) commit 1e4aa42aa50fe4429f0a8d147af5254d5ec960a5 Author: Paul Eggert Date: Tue Apr 5 13:58:57 2016 -0700 Avoid describe-key error with lambdas Problem reported by Sho Takemori (Bug#22716). * lisp/cedet/mode-local.el (describe-mode-local-overload) (xref-mode-local-overload): Use function-overload-p instead of assuming the argument is a symbol. diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el index c7e6615..4f42431 100644 --- a/lisp/cedet/mode-local.el +++ b/lisp/cedet/mode-local.el @@ -638,7 +638,7 @@ SYMBOL is a function that can be overridden." (defun describe-mode-local-overload (symbol) "For `help-fns-describe-function-functions'; add overloads for SYMBOL." - (when (get symbol 'mode-local-overload) + (when (function-overload-p symbol) (let ((default (or (intern-soft (format "%s-default" (symbol-name symbol))) symbol)) (override (with-current-buffer describe-function-orig-buffer @@ -684,7 +684,7 @@ SYMBOL is a function that can be overridden." (defun xref-mode-local-overload (symbol) "For `elisp-xref-find-def-functions'; add overloads for SYMBOL." ;; Current buffer is the buffer where xref-find-definitions was invoked. - (when (get symbol 'mode-local-overload) + (when (function-overload-p symbol) (let* ((symbol-file (find-lisp-object-file-name symbol (symbol-function symbol))) (default (intern-soft (format "%s-default" (symbol-name symbol)))) (default-file (when default (find-lisp-object-file-name default (symbol-function default)))) commit a05fb21d73d2ca84dd7e5e7ee931931048ecddba Author: Artur Malabarba Date: Mon Apr 4 11:58:49 2016 -0300 * lisp/emacs-lisp/package.el (package-install-selected-packages): Skip unavailable packages. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b65e45b..29de2c9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2023,17 +2023,21 @@ If some packages are not installed propose to install them." ;; gets installed). (if (not package-selected-packages) (message "`package-selected-packages' is empty, nothing to install") - (cl-loop for p in package-selected-packages - unless (package-installed-p p) - collect p into lst - finally - (if lst - (when (y-or-n-p - (format "%s packages will be installed:\n%s, proceed?" - (length lst) - (mapconcat #'symbol-name lst ", "))) - (mapc #'package-install lst)) - (message "All your packages are already installed"))))) + (let* ((not-installed (seq-remove #'package-installed-p package-selected-packages)) + (available (seq-filter (lambda (p) (assq p package-archive-contents)) not-installed)) + (difference (- (length not-installed) (length available)))) + (cond + (available + (when (y-or-n-p + (format "%s packages will be installed:\n%s, proceed?" + (length available) + (mapconcat #'symbol-name available ", "))) + (mapc (lambda (p) (package-install p 'dont-select)) available))) + ((> difference 0) + (message "%s packages are not available (the rest already installed), maybe you need to `M-x package-refresh-contents'" + difference)) + (t + (message "All your packages are already installed")))))) ;;; Package Deletion commit f501116ea896b20f195f5c841e8770d7fe0418b9 Author: Paul Eggert Date: Sun Apr 3 23:12:04 2016 -0700 Sync with gnulib This incorporates: 2016-04-03 stdint: detect good enough pre-C++11 stdint.h in C++ mode 2016-04-01 stddef: support configuring with g++ * doc/misc/texinfo.tex, lib/stddef.in.h, m4/stdint.m4: Copy from gnulib. diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 9437a4d..75017af 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2016-03-22.15} +\def\texinfoversion{2016-03-25.17} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -1645,6 +1645,32 @@ /Subtype /Link /A << /S /URI /URI (#1) >> >>}% \endgroup} \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \special{pdf:bann << /Border [0 0 0] + /Type /Annot /Subtype /Link /A << /S /GoTo /D (name#1) >> >>}% + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} % % % @image support @@ -2857,6 +2883,7 @@ \setbox0 = \hbox{\ignorespaces #2}% look for second arg \ifdim\wd0 > 0pt \ifpdf + % For pdfTeX and LuaTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg \unhbox0 @@ -2866,7 +2893,19 @@ \unhbox0\ (\urefcode{#1})% \fi \else - \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \ifx\XeTeXrevision\thisisundefined + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \else + % For XeTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \fi \fi \else \urefcode{#1}% only url given, so show it @@ -2967,7 +3006,18 @@ \endlink \endgroup} \else - \let\email=\uref + \ifx\XeTeXrevision\thisisundefined + \let\email=\uref + \else + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} + \fi \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), @@ -5479,7 +5529,14 @@ % preserve coloured links across page boundaries. Otherwise the marks % would get in the way of \lastbox in \insertindexentrybox. \else - \hskip\skip\thinshrinkable #1% + \ifx\XeTeXrevision\thisisundefined + \hskip\skip\thinshrinkable #1% + \else + \pdfgettoks#1.% + \bgroup\let\domark\relax + \hskip\skip\thinshrinkable\the\toksA + \egroup + \fi \fi \fi \egroup % end \boxA @@ -5614,7 +5671,11 @@ \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else - #2 + \ifx\XeTeXrevision\thisisundefined + #2 + \else + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \fi \fi \par }} @@ -11029,6 +11090,13 @@ % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in + \else + \ifx\XeTeXrevision\thisisundefined + \else + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % XeTeX does not have \pdfhorigin and \pdfvorigin. + \fi \fi % \setleading{\textleading} diff --git a/lib/stddef.in.h b/lib/stddef.in.h index c6d2317..f4c4a10 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h @@ -81,8 +81,10 @@ # define wchar_t int #endif -/* Some platforms lack max_align_t. */ -#if !@HAVE_MAX_ALIGN_T@ +/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is + a hack in case the configure-time test was done with g++ even though + we are currently compiling with gcc. */ +#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) /* On the x86, the maximum storage alignment of double, long, etc. is 4, but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, and the C11 standard allows this. Work around this problem by diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 0f40ce8..0b4b906 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 43 +# stdint.m4 serial 44 dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -70,6 +70,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -218,6 +220,8 @@ struct s { AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include ] gl_STDINT_INCLUDES @@ -279,6 +283,29 @@ static const char *macro_values[] = ]) fi if test "$gl_cv_header_working_stdint_h" = yes; then + dnl Now see whether the system works without + dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. + AC_CACHE_CHECK([whether stdint.h predates C++11], + [gl_cv_header_stdint_predates_cxx11_h], + [gl_cv_header_stdint_predates_cxx11_h=yes + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +] +gl_STDINT_INCLUDES +[ +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + ]])], + [gl_cv_header_stdint_predates_cxx11_h=no])]) + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + AC_DEFINE([__STDC_CONSTANT_MACROS], [1], + [Define to 1 if the system predates C++11.]) + AC_DEFINE([__STDC_LIMIT_MACROS], [1], + [Define to 1 if the system predates C++11.]) + fi STDINT_H= else dnl Check for , and for commit c4963f9a905bf15740aa7e3ebf85af917f17be15 Author: Paul Eggert Date: Sun Apr 3 15:27:21 2016 -0700 Fix doc for Universal Time * doc/lispref/os.texi (Time of Day, Time Conversion): Be more careful about distinguishing UTC (which is not valid for pre-1961 time stamps) and UT (which is). (Time Parsing): Remove stray obsolete paragraph about a UNIVERSAL argument for ‘format-time-string’. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index c5e3672..8839745 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1305,7 +1305,7 @@ This function returns a list describing the time zone that the user is in. The value has the form @code{(@var{offset} @var{name})}. Here -@var{offset} is an integer giving the number of seconds ahead of UTC +@var{offset} is an integer giving the number of seconds ahead of Universal Time (east of Greenwich). A negative value means west of Greenwich. The second element, @var{name}, is a string giving the name of the time zone. Both elements change when daylight saving time begins or ends; @@ -1323,7 +1323,7 @@ defaults to the current time zone rule. @vindex TZ, environment variable The default time zone is determined by the @env{TZ} environment variable. @xref{System Environment}. For example, you can tell Emacs -to default to universal time with @code{(setenv "TZ" "UTC0")}. If +to default to Universal Time with @code{(setenv "TZ" "UTC0")}. If @env{TZ} is not in the environment, Emacs uses system wall clock time, which is a platform-dependent default time zone. @@ -1347,8 +1347,8 @@ calendrical information and vice versa. Many 32-bit operating systems are limited to system times containing 32 bits of information in their seconds component; these systems -typically handle only the times from 1901-12-13 20:45:52 UTC through -2038-01-19 03:14:07 UTC@. However, 64-bit and some 32-bit operating +typically handle only the times from 1901-12-13 20:45:52 through +2038-01-19 03:14:07 Universal Time. However, 64-bit and some 32-bit operating systems have larger seconds components, and can represent times far in the past or future. @@ -1390,7 +1390,7 @@ Sunday. @item dst @code{t} if daylight saving time is effect, otherwise @code{nil}. @item utcoff -An integer indicating the UTC offset in seconds, i.e., the number of +An integer indicating the Universal Time offset in seconds, i.e., the number of seconds east of Greenwich. @end table @@ -1559,10 +1559,6 @@ based on the Japanese Emperors' reigns. @samp{E} is allowed in representation of numbers, instead of the ordinary decimal digits. This is allowed with most letters, all the ones that output numbers. -If @var{universal} is non-@code{nil}, that means to describe the time as -Universal Time; @code{nil} means describe it using what Emacs believes -is the local time zone (see @code{current-time-zone}). - This function uses the C library function @code{strftime} (@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference Manual}) to do most of the work. In order to communicate with that diff --git a/etc/NEWS b/etc/NEWS index 7de746e..9526588 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1772,8 +1772,8 @@ function 'encode-time', which already accepted a simple time zone rule argument, has been extended to accept all the new forms. *** Incompatible change in the third argument of 'format-time-string'. -Previously, any non-nil argument was interpreted as a UTC time zone. -This is no longer true; packages that want UTC time zone should pass t +Previously, any non-nil argument was interpeted as specifying Universal Time. +This is no longer true; packages that want Universal Time should pass t as the third argument. *** Time-related functions now consistently accept numbers