commit 2f7008715326a49770fcb82003ed78eab28c0626 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sun Feb 8 23:12:04 2015 -0800 Use C99's INFINITY and NAN macros * lread.c: Include . (string_to_number): Use INFINITY and NAN rather than rolling our own. This avoids some runtime diagnostics when building with gcc -fsanitize=undefined. diff --git a/src/ChangeLog b/src/ChangeLog index 3b2c9a6..381ae6b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2015-02-09 Paul Eggert + Use C99's INFINITY and NAN macros + * lread.c: Include . + (string_to_number): Use INFINITY and NAN rather than rolling our own. + This avoids some runtime diagnostics when building with + gcc -fsanitize=undefined. + Fix bidi_explicit_dir_char undefined behavior * bidi.c (bidi_explicit_dir_char): Avoid subscript error when argument is BIDI_EOB. This can happen in bidi_level_of_next_char. diff --git a/src/lread.c b/src/lread.c index 69ec059..b42849f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -28,6 +28,7 @@ along with GNU Emacs. If not, see . */ #include #include #include /* For CHAR_BIT. */ +#include #include #include "lisp.h" #include "intervals.h" @@ -3369,10 +3370,6 @@ string_to_number (char const *string, int base, bool ignore_trailing) bool float_syntax = 0; double value = 0; - /* Compute NaN and infinities using a variable, to cope with compilers that - think they are smarter than we are. */ - double zero = 0; - /* Negate the value ourselves. This treats 0, NaNs, and infinity properly on IEEE floating point hosts, and works around a formerly-common bug where atof ("-0.0") drops the sign. */ @@ -3424,30 +3421,15 @@ string_to_number (char const *string, int base, bool ignore_trailing) { state |= E_EXP; cp += 3; - value = 1.0 / zero; + value = INFINITY; } else if (cp[-1] == '+' && cp[0] == 'N' && cp[1] == 'a' && cp[2] == 'N') { state |= E_EXP; cp += 3; - value = zero / zero; - - /* If that made a "negative" NaN, negate it. */ - { - int i; - union { double d; char c[sizeof (double)]; } - u_data, u_minus_zero; - u_data.d = value; - u_minus_zero.d = -0.0; - for (i = 0; i < sizeof (double); i++) - if (u_data.c[i] & u_minus_zero.c[i]) - { - value = -value; - break; - } - } - /* Now VALUE is a positive NaN. */ + /* NAN is a "positive" NaN on all known Emacs hosts. */ + value = NAN; } else cp = ecp; commit 237171731157095f5cc46b0f6f6205e3b4ba9f00 Author: Paul Eggert Date: Sun Feb 8 18:14:14 2015 -0800 Fix bidi_explicit_dir_char undefined behavior * bidi.c (bidi_explicit_dir_char): Avoid subscript error when argument is BIDI_EOB. This can happen in bidi_level_of_next_char. diff --git a/src/ChangeLog b/src/ChangeLog index 017b8f1..3b2c9a6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2015-02-09 Paul Eggert + Fix bidi_explicit_dir_char undefined behavior + * bidi.c (bidi_explicit_dir_char): Avoid subscript error when + argument is BIDI_EOB. This can happen in bidi_level_of_next_char. + Better distinguish infinite from invalid times * editfns.c (check_time_validity): New function. (decode_time_components): Return int, not bool. diff --git a/src/bidi.c b/src/bidi.c index cbc1820..e5e08c6 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1799,6 +1799,11 @@ bidi_explicit_dir_char (int ch) if (!bidi_initialized) emacs_abort (); + if (ch < 0) + { + eassert (ch == BIDI_EOB); + return false; + } ch_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); return (ch_type == LRE || ch_type == LRO || ch_type == RLE || ch_type == RLO commit 751adc4b9631cedcf9bec475afe40da4db7d74a1 Author: Leo Liu Date: Mon Feb 9 10:05:44 2015 +0800 Add macro pcase-lambda Fixes: debbugs:19814 * emacs-lisp/lisp-mode.el (el-kws-re): Include `pcase-lambda'. * emacs-lisp/macroexp.el (macroexp-parse-body): New function. * emacs-lisp/pcase.el (pcase-lambda): New Macro. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce38131..cd40ac7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2015-02-09 Leo Liu + + * emacs-lisp/pcase.el (pcase-lambda): New Macro. (Bug#19814) + + * emacs-lisp/lisp-mode.el (el-kws-re): Include `pcase-lambda'. + + * emacs-lisp/macroexp.el (macroexp-parse-body): New function. + 2015-02-08 Paul Eggert Port to platforms lacking test -a and -o diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 868a957..5d91209 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -204,7 +204,7 @@ "defface")) (el-tdefs '("defgroup" "deftheme")) (el-kw '("while-no-input" "letrec" "pcase" "pcase-exhaustive" - "pcase-let" "pcase-let*" "save-restriction" + "pcase-lambda" "pcase-let" "pcase-let*" "save-restriction" "save-excursion" "save-selected-window" ;; "eval-after-load" "eval-next-after-load" "save-window-excursion" "save-current-buffer" diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 797de9a..b75c8cc 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -297,6 +297,16 @@ definitions to shadow the loaded ones for use in file byte-compilation." ;;; Handy functions to use in macros. +(defun macroexp-parse-body (exps) + "Parse EXPS into ((DOC DECLARE-FORM INTERACTIVE-FORM) . BODY)." + `((,(and (stringp (car exps)) + (pop exps)) + ,(and (eq (car-safe (car exps)) 'declare) + (pop exps)) + ,(and (eq (car-safe (car exps)) 'interactive) + (pop exps))) + ,@exps)) + (defun macroexp-progn (exps) "Return an expression equivalent to `(progn ,@EXPS)." (if (cdr exps) `(progn ,@exps) (car exps))) diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index b495793..057b128 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -164,6 +164,26 @@ like `(,a . ,(pred (< a))) or, with more checks: ;; FIXME: Could we add the FILE:LINE data in the error message? exp (append cases `((,x (error "No clause matching `%S'" ,x))))))) +;;;###autoload +(defmacro pcase-lambda (lambda-list &rest body) + "Like `lambda' but allow each argument to be a pattern. +`&rest' argument is supported." + (declare (doc-string 2) (indent defun) + (debug ((&rest pcase-UPAT &optional ["&rest" pcase-UPAT]) body))) + (let ((args (make-symbol "args")) + (pats (mapcar (lambda (u) + (unless (eq u '&rest) + (if (eq (car-safe u) '\`) (cadr u) (list '\, u)))) + lambda-list)) + (body (macroexp-parse-body body))) + ;; Handle &rest + (when (eq nil (car (last pats 2))) + (setq pats (append (butlast pats 2) (car (last pats))))) + `(lambda (&rest ,args) + ,@(remq nil (car body)) + (pcase ,args + (,(list '\` pats) . ,(cdr body)))))) + (defun pcase--let* (bindings body) (cond ((null bindings) (macroexp-progn body)) commit fd6f7d1449c8496ab5c019d2aad7ca5e2980713a Author: Paul Eggert Date: Sun Feb 8 16:21:11 2015 -0800 Better distinguish infinite from invalid times * editfns.c (check_time_validity): New function. (decode_time_components): Return int, not bool. Return -1 (not 0) if the time is out of range. All callers changed. (lisp_time_struct, lisp_seconds_argument): Distinguish better between time overflow and invalid time values. diff --git a/src/ChangeLog b/src/ChangeLog index 56f88f5..017b8f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2015-02-09 Paul Eggert + + Better distinguish infinite from invalid times + * editfns.c (check_time_validity): New function. + (decode_time_components): Return int, not bool. + Return -1 (not 0) if the time is out of range. + All callers changed. + (lisp_time_struct, lisp_seconds_argument): Distinguish better + between time overflow and invalid time values. + 2015-02-08 Paul Eggert Minor tweaks to frame_size_history_add diff --git a/src/editfns.c b/src/editfns.c index 7026ccc..c205ca3 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1395,6 +1395,19 @@ invalid_time (void) error ("Invalid time specification"); } +/* Check a return value compatible with that of decode_time_components. */ +static void +check_time_validity (int validity) +{ + if (validity <= 0) + { + if (validity < 0) + time_overflow (); + else + invalid_time (); + } +} + /* A substitute for mktime_z on platforms that lack it. It's not thread-safe, but should be good enough for Emacs in typical use. */ #ifndef HAVE_TZALLOC @@ -1698,9 +1711,9 @@ decode_float_time (double t, struct lisp_time *result) If *DRESULT is not null, store into *DRESULT the number of seconds since the start of the POSIX Epoch. - Return true if successful, false if the components are of the - wrong type or represent a time out of range. */ -bool + Return 1 if successful, 0 if the components are of the + wrong type, and -1 if the time is out of range. */ +int decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, Lisp_Object psec, struct lisp_time *result, double *dresult) @@ -1708,17 +1721,17 @@ decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, EMACS_INT hi, lo, us, ps; if (! (INTEGERP (high) && INTEGERP (usec) && INTEGERP (psec))) - return false; + return 0; if (! INTEGERP (low)) { if (FLOATP (low)) { double t = XFLOAT_DATA (low); if (result && ! decode_float_time (t, result)) - return false; + return -1; if (dresult) *dresult = t; - return true; + return 1; } else if (NILP (low)) { @@ -1732,10 +1745,10 @@ decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, } if (dresult) *dresult = now.tv_sec + now.tv_nsec / 1e9; - return true; + return 1; } else - return false; + return 0; } hi = XINT (high); @@ -1755,7 +1768,7 @@ decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, if (result) { if (! (MOST_NEGATIVE_FIXNUM <= hi && hi <= MOST_POSITIVE_FIXNUM)) - return false; + return -1; result->hi = hi; result->lo = lo; result->us = us; @@ -1768,7 +1781,7 @@ decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, *dresult = (us * 1e6 + ps) / 1e12 + lo + dhi * (1 << LO_TIME_BITS); } - return true; + return 1; } struct timespec @@ -1792,8 +1805,8 @@ lisp_time_struct (Lisp_Object specified_time, int *plen) Lisp_Object high, low, usec, psec; struct lisp_time t; int len = disassemble_lisp_time (specified_time, &high, &low, &usec, &psec); - if (! (len && decode_time_components (high, low, usec, psec, &t, 0))) - invalid_time (); + int val = len ? decode_time_components (high, low, usec, psec, &t, 0) : 0; + check_time_validity (val); *plen = len; return t; } @@ -1818,13 +1831,20 @@ lisp_seconds_argument (Lisp_Object specified_time) { Lisp_Object high, low, usec, psec; struct lisp_time t; - if (! (disassemble_lisp_time (specified_time, &high, &low, &usec, &psec) - && decode_time_components (high, low, make_number (0), - make_number (0), &t, 0))) - invalid_time (); - if (! ((TYPE_SIGNED (time_t) ? TIME_T_MIN >> LO_TIME_BITS <= t.hi : 0 <= t.hi) - && t.hi <= TIME_T_MAX >> LO_TIME_BITS)) - time_overflow (); + + int val = disassemble_lisp_time (specified_time, &high, &low, &usec, &psec); + if (val != 0) + { + val = decode_time_components (high, low, make_number (0), + make_number (0), &t, 0); + if (0 < val + && ! ((TYPE_SIGNED (time_t) + ? TIME_T_MIN >> LO_TIME_BITS <= t.hi + : 0 <= t.hi) + && t.hi <= TIME_T_MAX >> LO_TIME_BITS)) + val = -1; + } + check_time_validity (val); return (t.hi << LO_TIME_BITS) + t.lo; } diff --git a/src/keyboard.c b/src/keyboard.c index 1176d70..ee62192 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4369,19 +4369,18 @@ Lisp_Object pending_funcalls; static bool decode_timer (Lisp_Object timer, struct timespec *result) { - Lisp_Object *vector; + Lisp_Object *vec; if (! (VECTORP (timer) && ASIZE (timer) == 9)) return 0; - vector = XVECTOR (timer)->contents; - if (! NILP (vector[0])) + vec = XVECTOR (timer)->contents; + if (! NILP (vec[0])) return 0; - if (! INTEGERP (vector[2])) + if (! INTEGERP (vec[2])) return false; struct lisp_time t; - if (! decode_time_components (vector[1], vector[2], vector[3], vector[8], - &t, 0)) + if (decode_time_components (vec[1], vec[2], vec[3], vec[8], &t, 0) <= 0) return false; *result = lisp_to_timespec (t); return timespec_valid_p (*result); diff --git a/src/systime.h b/src/systime.h index 1d3a4ba..4787c51 100644 --- a/src/systime.h +++ b/src/systime.h @@ -100,8 +100,8 @@ struct lisp_time /* defined in editfns.c */ extern Lisp_Object make_lisp_time (struct timespec); -extern bool decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, struct lisp_time *, double *); +extern int decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, struct lisp_time *, double *); extern struct timespec lisp_to_timespec (struct lisp_time); extern struct timespec lisp_time_argument (Lisp_Object); #endif commit db3fc07caf71b6d7a34f80333ba54ed6d67ee144 Author: Paul Eggert Date: Sun Feb 8 16:02:36 2015 -0800 * configure.ac (HAVE_LIBXML2): Add missing comma. diff --git a/ChangeLog b/ChangeLog index ab551e1..a574ac8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-02-09 Paul Eggert + + * configure.ac (HAVE_LIBXML2): Add missing comma. + 2015-02-08 Paul Eggert Port to platforms lacking test -a and -o diff --git a/configure.ac b/configure.ac index 6a5c73e..68291b8 100644 --- a/configure.ac +++ b/configure.ac @@ -3505,7 +3505,7 @@ if test "${with_xml2}" != "no"; then fi if test "${HAVE_LIBXML2}" = "yes"; then if test "${opsys}" != "mingw32"; then - AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no + AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no, [$LIBXML2_LIBS]) else LIBXML2_LIBS="" commit 5c20aa7486f9cb8871f40bca9ac5fee09caefca3 Author: Paul Eggert Date: Sun Feb 8 16:00:17 2015 -0800 Port to platforms lacking test -a and -o * configure.ac (HAVE_LIBXML2): * lisp/Makefile.in (compile-clean): * lisp/net/tramp-sh.el (tramp-find-executable): Prefer '&&' and '||' to 'test -a' and 'test -o'. diff --git a/ChangeLog b/ChangeLog index 908ffe6..ab551e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-02-08 Paul Eggert + + Port to platforms lacking test -a and -o + * configure.ac (HAVE_LIBXML2): + Prefer '&&' and '||' to 'test -a' and 'test -o'. + 2015-02-08 Ulrich Müller * configure.ac (--with-gameuser): Default to 'games' group instead diff --git a/configure.ac b/configure.ac index 192634b..6a5c73e 100644 --- a/configure.ac +++ b/configure.ac @@ -3491,7 +3491,7 @@ if test "${with_xml2}" != "no"; then ### I'm not sure what the version number should be, so I just guessed. EMACS_CHECK_MODULES([LIBXML2], [libxml-2.0 > 2.6.17]) # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc. - if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then + if test "${HAVE_LIBXML2}" != "yes" && test "$opsys" = "darwin"; then SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2" AC_CHECK_HEADER(libxml/HTMLparser.h, @@ -4508,10 +4508,10 @@ if test $emacs_cv_func_sigsetjmp = yes; then fi # We need all of these features to handle C stack overflows. -if test "$ac_cv_header_sys_resource_h" = "yes" -a \ - "$ac_cv_func_getrlimit" = "yes" -a \ - "$emacs_cv_func_sigsetjmp" = "yes" -a \ - "$emacs_cv_alternate_stack" = yes; then +if test "$ac_cv_header_sys_resource_h" = "yes" && + test "$ac_cv_func_getrlimit" = "yes" && + test "$emacs_cv_func_sigsetjmp" = "yes" && + test "$emacs_cv_alternate_stack" = yes; then AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1, [Define to 1 if C stack overflow can be handled in some cases.]) fi diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad4f3b9..ce38131 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-02-08 Paul Eggert + + Port to platforms lacking test -a and -o + * Makefile.in (compile-clean): + * net/tramp-sh.el (tramp-find-executable): + Prefer '&&' and '||' to 'test -a' and 'test -o'. + 2015-02-08 Artur Malabarba * newcomment.el (comment-line): Fix missing paren. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 7bf5386..e5cfc63 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -324,7 +324,7 @@ compile-clean: @cd $(lisp) && $(setwins); \ elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \ for el in `echo $$elcs | sed -e 's/\.elc/\.el/g'`; do \ - if test -f "$$el" -o \! -f "$${el}c"; then :; else \ + if test -f "$$el" || test ! -f "$${el}c"; then :; else \ echo rm "$${el}c"; \ rm "$${el}c"; \ fi \ diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9c8a222..45050cd 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3796,7 +3796,7 @@ This function expects to be in the right *tramp* buffer." (tramp-send-command vec (format (concat "while read d; " - "do if test -x $d/%s -a -f $d/%s; " + "do if test -x $d/%s && test -f $d/%s; " "then echo tramp_executable $d/%s; " "break; fi; done <<'%s'\n" "%s\n%s") commit 7d631aa0ffab875e4979727f632703ad5b4100a2 Author: Artur Malabarba Date: Sun Feb 8 20:24:36 2015 -0200 newcomment.el (comment-line): Fix missing paren. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8848fe6..ad4f3b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-02-08 Artur Malabarba + + * newcomment.el (comment-line): Fix missing paren. + 2015-02-08 Ulrich Müller * play/gamegrid.el: Update comment to reflect that the diff --git a/lisp/newcomment.el b/lisp/newcomment.el index aabafc7..172a563 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1481,7 +1481,7 @@ Unlike `comment-dwim', this always comments whole lines." (apply #'max range))) (forward-line 1) (back-to-indentation) - (unless (natnump n) (setq this-command 'comment-line-backward))) + (unless (natnump n) (setq this-command 'comment-line-backward)))) (provide 'newcomment) commit dbde138155118344b33dfd2db95f688a24a42fec Author: Ulrich Müller Date: Sun Feb 8 21:00:49 2015 +0100 configure --with-gameuser now defaults to games group. * configure.ac (--with-gameuser): Default to 'games' group instead of 'games' user. * lisp/play/gamegrid.el: Update comment to reflect that the 'update-game-score' helper program is now setgid by default. diff --git a/ChangeLog b/ChangeLog index ca9f44a..908ffe6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-02-08 Ulrich Müller + + * configure.ac (--with-gameuser): Default to 'games' group instead + of 'games' user. + 2015-02-04 Paul Eggert * .gitattributes: Ignore blanks at EOL in texinfo.tex. diff --git a/configure.ac b/configure.ac index 5776e4e..192634b 100644 --- a/configure.ac +++ b/configure.ac @@ -397,17 +397,12 @@ AC_ARG_WITH(gameuser,dnl An argument prefixed by ':' specifies a group instead.])]) gameuser= gamegroup= +# We don't test if we can actually chown/chgrp here, because configure +# may run without root privileges. lib-src/Makefile.in will handle +# any errors due to missing user/group gracefully. case ${with_gameuser} in no) ;; - "" | yes) - AC_MSG_CHECKING([whether a 'games' user exists]) - if id -u games >/dev/null 2>&1; then - AC_MSG_RESULT([yes]) - gameuser=games - else - AC_MSG_RESULT([no]) - fi - ;; + "" | yes) gamegroup=games ;; :*) gamegroup=`echo "${with_gameuser}" | sed -e "s/://"` ;; *) gameuser=${with_gameuser} ;; esac diff --git a/etc/NEWS b/etc/NEWS index c72a409..4c7160e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -53,7 +53,7 @@ build with 'make V=1'. group instead of a user if its argument is prefixed by ':' (a colon). This will cause the game score files in ${localstatedir}/games/emacs to be owned by that group, and the helper program for updating them to -be installed setgid. +be installed setgid. The option now defaults to the 'games' group. --- ** The `grep-changelog' script (and its manual page) are no longer included. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d95c0e6..8848fe6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-02-08 Ulrich Müller + + * play/gamegrid.el: Update comment to reflect that the + 'update-game-score' helper program is now setgid by default. + 2015-02-08 David Kastrup * subr.el (apply-partially): Use lexical binding here. diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index b4c3c59..df06d5a 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -462,22 +462,22 @@ FILE is created there." ;; `gamegrid-add-score' was supposed to be used in the past and ;; is covered here for backward-compatibility. ;; -;; 2. The helper program "update-game-score" is setuid and the -;; file FILE does already exist in a system wide shared game -;; directory. This should be the normal case on POSIX systems, -;; if the game was installed system wide. Use +;; 2. The helper program "update-game-score" is setgid or setuid +;; and the file FILE does already exist in a system wide shared +;; game directory. This should be the normal case on POSIX +;; systems, if the game was installed system wide. Use ;; "update-game-score" to add the score to the file in the ;; shared game directory. ;; -;; 3. "update-game-score" is setuid, but the file FILE does *not* -;; exist in the system wide shared game directory. Use +;; 3. "update-game-score" is setgid/setuid, but the file FILE does +;; *not* exist in the system wide shared game directory. Use ;; `gamegrid-add-score-insecure' to create--if necessary--and ;; update FILE. This is for the case that a user has installed ;; a game on her own. ;; -;; 4. "update-game-score" is not setuid. Use it to create/update -;; FILE in the user's home directory. There is presumably no -;; shared game directory. +;; 4. "update-game-score" is not setgid/setuid. Use it to +;; create/update FILE in the user's home directory. There is +;; presumably no shared game directory. (defvar gamegrid-shared-game-dir) @@ -491,7 +491,7 @@ FILE is created there." (gamegrid-add-score-insecure file score)) ((and gamegrid-shared-game-dir (file-exists-p (expand-file-name file shared-game-score-directory))) - ;; Use the setuid (or setgid) "update-game-score" program + ;; Use the setgid (or setuid) "update-game-score" program ;; to update a system-wide score file. (gamegrid-add-score-with-update-game-score-1 file (expand-file-name file shared-game-score-directory) score)) commit 19ee7875db8b154a3ba49a98da2d3c24b03fff1e Author: David Kastrup Date: Sun Jan 25 20:42:46 2015 +0100 subr.el (apply-partially): Use lexical binding. Fixes: debbugs:19785 See for discussion. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 64424b7..d95c0e6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-02-08 David Kastrup + + * subr.el (apply-partially): Use lexical binding here. + 2015-02-08 Artur Malabarba * newcomment.el (comment-line): New command. diff --git a/lisp/subr.el b/lisp/subr.el index 0dfb8ed..deadca6 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -136,8 +136,8 @@ ARGS is a list of the first N arguments to pass to FUN. The result is a new function which does the same as FUN, except that the first N arguments are fixed at the values with which this function was called." - `(closure (t) (&rest args) - (apply ',fun ,@(mapcar (lambda (arg) `',arg) args) args))) + (lambda (&rest args2) + (apply fun (append args args2)))) (defmacro push (newelt place) "Add NEWELT to the list stored in the generalized variable PLACE. commit 64bdc0efbe27bea66cd4be4de8205198c7a9aee8 Author: Artur Malabarba Date: Sun Feb 8 19:05:24 2015 -0200 NEWS: Document `comment-line'. diff --git a/etc/ChangeLog b/etc/ChangeLog index 3703189..1fcea54 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2015-02-08 Artur Malabarba + + * NEWS: Document `comment-line'. + 2015-02-03 Artur Malabarba * NEWS: Document package.el's improved dependency-handling. diff --git a/etc/NEWS b/etc/NEWS index d72d01f..c72a409 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -66,6 +66,8 @@ so if you want to use it, you can always take a copy from an older Emacs. * Changes in Emacs 25.1 +** New command `comment-line' bound to `C-x C-;'. + ** New function `custom-prompt-customize-unsaved-options' checks for unsaved customizations and prompts user to customize (if found). commit 97cb255360172980e7b79ed6a8cb35abbc58f897 Author: Artur Malabarba Date: Sun Feb 8 19:03:17 2015 -0200 newcomment.el (comment-line): New command on C-x C-;. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b862d42..64424b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-08 Artur Malabarba + + * newcomment.el (comment-line): New command. + + * bindings.el (ctl-x-map): Bind to `C-x C-;'. + 2015-02-08 Oleh Krehel * outline.el (outline-show-entry): Fix one invisible char for the diff --git a/lisp/bindings.el b/lisp/bindings.el index 883914e..4cc9f6a 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1130,6 +1130,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key esc-map "j" 'indent-new-comment-line) (define-key esc-map "\C-j" 'indent-new-comment-line) (define-key ctl-x-map ";" 'comment-set-column) +(define-key ctl-x-map "C-;" 'comment-line) (define-key ctl-x-map "f" 'set-fill-column) (define-key ctl-x-map "$" 'set-selective-display) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index e307eac..aabafc7 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1451,6 +1451,38 @@ unless optional argument SOFT is non-nil." (end-of-line 0) (insert comend)))))))))))) +;;;###autoload +(defun comment-line (n) + "Comment or uncomment current line and leave point after it. +With positive prefix, apply to N lines including current one. +With negative prefix, apply to -N lines above. Also, further +consecutive invocations of this command will inherit the negative +argument. + +If region is active, comment lines in active region instead. +Unlike `comment-dwim', this always comments whole lines." + (interactive "p") + (if (use-region-p) + (comment-or-uncomment-region + (save-excursion + (goto-char (region-beginning)) + (line-beginning-position)) + (save-excursion + (goto-char (region-end)) + (line-end-position))) + (when (and (eq last-command 'comment-line-backward) + (natnump n)) + (setq n (- n))) + (let ((range + (list (line-beginning-position) + (goto-char (line-end-position n))))) + (comment-or-uncomment-region + (apply #'min range) + (apply #'max range))) + (forward-line 1) + (back-to-indentation) + (unless (natnump n) (setq this-command 'comment-line-backward))) + (provide 'newcomment) ;;; newcomment.el ends here commit 61320cc95ca14ec282bb73307e9006fb1d6e7e80 Author: Paul Eggert Date: Sun Feb 8 10:52:05 2015 -0800 Minor tweaks to frame_size_history_add * frame.c (frame_size_history_add): Don't assume length fits in 'int'. Prefer XCAR and XCDR to Fcar and Fcdr when the arg is a cons. (Fframe_after_make_frame): Simplify. * gtkutil.c: Remove commented-out code. * xfns.c (Fx_create_frame): Fix indenting. diff --git a/src/ChangeLog b/src/ChangeLog index 66e7bfb..56f88f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2015-02-08 Paul Eggert + + Minor tweaks to frame_size_history_add + * frame.c (frame_size_history_add): Don't assume length fits in 'int'. + Prefer XCAR and XCDR to Fcar and Fcdr when the arg is a cons. + (Fframe_after_make_frame): Simplify. + * gtkutil.c: Remove commented-out code. + * xfns.c (Fx_create_frame): Fix indenting. + 2015-02-08 Eli Zaretskii * frame.c (Fframe_parameter): Don't replace a non-nil value of diff --git a/src/frame.c b/src/frame.c index 9060f56..92b6b7c 100644 --- a/src/frame.c +++ b/src/frame.c @@ -155,14 +155,13 @@ frame_size_history_add (struct frame *f, Lisp_Object fun_symbol, int width, int height, Lisp_Object rest) { Lisp_Object frame; - int number; XSETFRAME (frame, f); if (CONSP (frame_size_history) - && NUMBERP (Fcar (frame_size_history)) - && ((number = XINT (Fcar (frame_size_history))) > 0)) + && INTEGERP (XCAR (frame_size_history)) + && 0 < XINT (XCAR (frame_size_history))) frame_size_history = - Fcons (make_number (number - 1), + Fcons (make_number (XINT (XCAR (frame_size_history)) - 1), Fcons (list4 (frame, fun_symbol, ((width > 0) @@ -172,7 +171,7 @@ frame_size_history_add (struct frame *f, Lisp_Object fun_symbol, make_number (height)) : Qnil), rest), - Fcdr (frame_size_history))); + XCDR (frame_size_history))); } @@ -2298,9 +2297,7 @@ otherwise used with utter care to avoid that running functions on (Lisp_Object frame, Lisp_Object made) { struct frame *f = decode_live_frame (frame); - - f->after_make_frame = NILP (made) ? false : true; - + f->after_make_frame = !NILP (made); return made; } diff --git a/src/gtkutil.c b/src/gtkutil.c index 063e882..6f17078 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -50,12 +50,6 @@ along with GNU Emacs. If not, see . */ #include "emacsgtkfixed.h" #endif -/** #define FRAME_TOTAL_PIXEL_HEIGHT(f) \ **/ -/** (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) **/ - -/** #define FRAME_TOTAL_PIXEL_WIDTH(f) \ **/ -/** (FRAME_PIXEL_WIDTH (f) + FRAME_TOOLBAR_WIDTH (f)) **/ - #ifndef HAVE_GTK_WIDGET_SET_HAS_WINDOW #define gtk_widget_set_has_window(w, b) \ (gtk_fixed_set_has_window (GTK_FIXED (w), b)) @@ -903,9 +897,6 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight) || pixelwidth != FRAME_PIXEL_WIDTH (f) || pixelheight != FRAME_PIXEL_HEIGHT (f)) { -/** FRAME_PIXEL_WIDTH (f) = pixelwidth; **/ -/** FRAME_PIXEL_HEIGHT (f) = pixelheight; **/ - xg_clear_under_internal_border (f); change_frame_size (f, width, height, 0, 1, 0, 1); SET_FRAME_GARBAGED (f); diff --git a/src/xfns.c b/src/xfns.c index e667e71..629ac4b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3184,7 +3184,7 @@ This function is an internal primitive--use `make-frame' instead. */) "title", "Title", RES_TYPE_STRING); x_default_parameter (f, parms, Qwait_for_wm, Qt, "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qtool_bar_position, + x_default_parameter (f, parms, Qtool_bar_position, FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL); /* Compute the size of the X window. */ commit dd2aa937d68390755d0b042a81560211aa138406 Author: Eli Zaretskii Date: Sun Feb 8 19:54:59 2015 +0200 Fix a thinko in frame-parameter (Bug#19802) src/frame.c (Fframe_parameter): Don't replace a non-nil value of foreground-color or background-color parameters with a nil value. diff --git a/src/ChangeLog b/src/ChangeLog index f544f19..66e7bfb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2015-02-08 Eli Zaretskii + + * frame.c (Fframe_parameter): Don't replace a non-nil value of + foreground-color or background-color parameters with a nil value. + (Bug#19802) + 2015-02-08 Stefan Monnier * data.c (Findirect_function): Like `symbol-function', don't signal an diff --git a/src/frame.c b/src/frame.c index 96fe377..9060f56 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2615,7 +2615,12 @@ If FRAME is nil, describe the currently selected frame. */) important when param_alist's notion of colors is "unspecified". We need to do the same here. */ if (STRINGP (value) && !FRAME_WINDOW_P (f)) - value = frame_unspecified_color (f, value); + { + Lisp_Object tem = frame_unspecified_color (f, value); + + if (!NILP (tem)) + value = tem; + } } else value = Fcdr (Fassq (parameter, Fframe_parameters (frame))); commit 1a489c1a421a56bfc0ebaa07a87db2394887405a Author: Oleh Krehel Date: Sat Feb 7 18:54:07 2015 +0100 lisp/outline.el (outline-show-entry): Fix one invisible char * lisp/outline.el (outline-show-entry): Previously, when called for the last outline in a file, a single invisible char was left. Add a check for this condition. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf5ccd2..b862d42 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-02-08 Oleh Krehel + + * outline.el (outline-show-entry): Fix one invisible char for the + file's last outline. Fixes Bug#19493. + 2015-02-08 Stefan Monnier * subr.el (indirect-function): Change advertised calling convention. diff --git a/lisp/outline.el b/lisp/outline.el index ae31b80..059ca62 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -777,7 +777,12 @@ Show the heading too, if it is currently invisible." (save-excursion (outline-back-to-heading t) (outline-flag-region (1- (point)) - (progn (outline-next-preface) (point)) nil))) + (progn + (outline-next-preface) + (if (= 1 (- (point-max) (point))) + (point-max) + (point))) + nil))) (define-obsolete-function-alias 'show-entry 'outline-show-entry "25.1") commit 60f8214e97042bb1c4e7beb9da8df76cd4c124f7 Author: Stefan Monnier Date: Sun Feb 8 08:51:10 2015 -0500 * src/data.c (Findirect_function): Don't signal an error * src/data.c (Findirect_function): Like `symbol-function', don't signal an error for void functions any more. * lisp/subr.el (indirect-function): Change advertised calling convention. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5911f13..cf5ccd2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,13 @@ +2015-02-08 Stefan Monnier + + * subr.el (indirect-function): Change advertised calling convention. + 2015-02-08 Fabián Ezequiel Gallina python.el: Fix completion-at-point. (Bug#19667) * progmodes/python.el - (python-shell-completion-native-get-completions): Force process - buffer. + (python-shell-completion-native-get-completions): Force process buffer. (python-shell-completion-at-point): Handle case where call is not in a shell buffer. @@ -13,17 +16,16 @@ python.el: Fix shell font-lock multiline input. (Bug#19744) * progmodes/python.el - (python-shell-font-lock-post-command-hook): Handle multiline - input. + (python-shell-font-lock-post-command-hook): Handle multiline input. 2015-02-08 Fabián Ezequiel Gallina python.el: Make shell font-lock respect markers. (Bug#19650) - * progmodes/python.el (python-shell-font-lock-cleanup-buffer): Use - `erase-buffer`. - (python-shell-font-lock-comint-output-filter-function): Handle - newlines. + * progmodes/python.el (python-shell-font-lock-cleanup-buffer): + Use `erase-buffer`. + (python-shell-font-lock-comint-output-filter-function): + Handle newlines. (python-shell-font-lock-post-command-hook): Respect markers on text fontification. @@ -31,8 +33,8 @@ python.el: Keep eldoc visible while typing args. (Bug#19637) - * progmodes/python.el (python-eldoc--get-symbol-at-point): New - function based on Carlos Pita patch. + * progmodes/python.el (python-eldoc--get-symbol-at-point): + New function based on Carlos Pita patch. (python-eldoc--get-doc-at-point, python-eldoc-at-point): Use it. 2015-02-07 Fabián Ezequiel Gallina @@ -52,10 +54,10 @@ 2015-02-07 Martin Rudalics - * frame.el (frame-notice-user-settings): Update - `frame-size-history'. - (make-frame): Update `frame-size-history'. Call - `frame-after-make-frame'. + * frame.el (frame-notice-user-settings): + Update `frame-size-history'. + (make-frame): Update `frame-size-history'. + Call `frame-after-make-frame'. * faces.el (face-set-after-frame-default): Remove call to frame-can-run-window-configuration-change-hook. @@ -91,8 +93,8 @@ 2015-02-05 Artur Malabarba - * emacs-lisp/package.el (package--sort-by-dependence): New - function. Return PACKAGE-LIST sorted by dependencies. + * emacs-lisp/package.el (package--sort-by-dependence): + New function. Return PACKAGE-LIST sorted by dependencies. (package-menu-execute): Use it to delete packages in order. (package--sort-deps-in-alist): New function. (package-menu-mark-install): Can mark dependencies. diff --git a/lisp/subr.el b/lisp/subr.el index 3b27b33..0dfb8ed 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1274,6 +1274,7 @@ is converted into a string by expressing it in decimal." (set-advertised-calling-convention 'all-completions '(string collection &optional predicate) "23.1") (set-advertised-calling-convention 'unintern '(name obarray) "23.3") +(set-advertised-calling-convention 'indirect-function '(object) "25.1") (set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3") (set-advertised-calling-convention 'decode-char '(ch charset) "21.4") (set-advertised-calling-convention 'encode-char '(ch charset) "21.4") diff --git a/src/ChangeLog b/src/ChangeLog index ec70cdb..f544f19 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,19 +1,24 @@ +2015-02-08 Stefan Monnier + + * data.c (Findirect_function): Like `symbol-function', don't signal an + error for void functions any more. + 2015-02-07 Martin Rudalics * frame.c (frame_size_history_add): New function. (frame_inhibit_resize): Consider frame_inhibit_implied_resize - only after frame's after_make_frame slot is true. Inhibit - resizing fullwidth-/height frames in one direction only. Update - frame_size_history. + only after frame's after_make_frame slot is true. + Inhibit resizing fullwidth-/height frames in one direction only. + Update frame_size_history. (adjust_frame_size): Call frame_size_history_add. (make_frame): Initalize after_make_frame slot. (Fmake_terminal_frame): Adjust adjust_frame_size call. (Fcan_run_window_configuration_change_hook): Rename to - Fframe_after_make_frame. Set after_make_frame slot. Return - second argument. + Fframe_after_make_frame. Set after_make_frame slot. + Return second argument. (x_set_frame_parameters): Postpone handling fullscreen parameter - until after width and height parameters have been set. Apply - width and height changes only if can_x_set_window_size is true. + until after width and height parameters have been set. + Apply width and height changes only if can_x_set_window_size is true. Update frame_size_history. (Qadjust_frame_size_1, Qadjust_frame_size_2) (Qadjust_frame_size_3, QEmacsFrameResize, Qframe_inhibit_resize) @@ -22,12 +27,11 @@ (Qxg_frame_set_char_size_2, Qxg_frame_set_char_size_3) (Qxg_change_toolbar_position, Qx_net_wm_state) (Qx_handle_net_wm_state, Qtb_size_cb, Qupdate_frame_tool_bar) - (Qfree_frame_tool_bar): New symbol for updating - frame_size_history. + (Qfree_frame_tool_bar): New symbol for updating frame_size_history. (Qtip_frame, Qterminal_frame): New symbols. (Vframe_adjust_size_history): Rename to frame_size_history. - * frame.h (struct frame): Rename - can_run_window_configuration_change_hook slot to + * frame.h (struct frame): + Rename can_run_window_configuration_change_hook slot to after_make_frame. (frame_size_history_add): Extern. * gtkutil.c (xg_frame_resized): Call frame_size_history_add. @@ -52,21 +56,21 @@ (x_set_window_size): Try to handle fullwidth and fullheight more accurately. Don't rely on w32_enable_frame_resize_hack. (w32_enable_frame_resize_hack): Remove variable. - * widget.c (EmacsFrameResize): Remove dead code. Call - frame_size_history_add - * window.c (run_window_configuration_change_hook): Check - f->after_make_frame instead of + * widget.c (EmacsFrameResize): Remove dead code. + Call frame_size_history_add + * window.c (run_window_configuration_change_hook): + Check f->after_make_frame instead of f->can_run_window_configuration_change_hook. * xfns.c (x_change_tool_bar_height): Handle frame's fullscreen status. (Fx_create_frame): Process fullscreen parameter after frame has been resized. (Fx_frame_geometry): Don't pollute pure storage. - * xterm.c (x_net_wm_state, x_handle_net_wm_state): Call - frame_size_history_add. + * xterm.c (x_net_wm_state, x_handle_net_wm_state): + Call frame_size_history_add. (do_ewmh_fullscreen): Handle x_frame_normalize_before_maximize. (x_check_fullscreen): Count in menubar when calling - XResizeWindow. Wait for ConfigureNotify event. Call - frame_size_history_add. + XResizeWindow. Wait for ConfigureNotify event. + Call frame_size_history_add. (x_set_window_size_1): Remove PIXELWISE argument. Try to handle changing a fullheight frame's width or a fullwidth frame's height. Call frame_size_history_add. @@ -319,8 +323,8 @@ (x_horizontal_scroll_bar_report_motion, w32_read_socket) (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar) (w32_draw_window_cursor, x_new_font, x_set_offset) - (x_set_window_size, x_make_frame_invisible, x_iconify_frame): Use - bool where appropriate. + (x_set_window_size, x_make_frame_invisible, x_iconify_frame): + Use bool where appropriate. Use bool for boolean in w32fns.c * w32fns.c (w32_defined_color, x_decode_color) @@ -789,8 +793,8 @@ Qx_create_frame_2 to adjust_frame_size. * w32menu.c (set_frame_menubar): Simplify adjust_frame_size call. - * window.c (Fset_window_configuration): Pass - Qset_window_configuration to adjust_frame_size. + * window.c (Fset_window_configuration): + Pass Qset_window_configuration to adjust_frame_size. * xdisp.c (redisplay_tool_bar): Assign new height to frame_default_tool_bar_height. (redisplay_internal): If we haven't redisplayed this frame's @@ -858,8 +862,8 @@ * w32fns.c (Fw32_register_hot_key): Use XINT instead of XLI. - * w32notify.c (Fw32notify_add_watch, w32_get_watch_object): Use - make_pointer_integer instead of XIL. + * w32notify.c (Fw32notify_add_watch, w32_get_watch_object): + Use make_pointer_integer instead of XIL. (Fw32notify_rm_watch): Use XINTPTR instead of XLI. * w32inevt.c (handle_file_notifications): Use make_pointer_integer diff --git a/src/data.c b/src/data.c index d06b991..4770658 100644 --- a/src/data.c +++ b/src/data.c @@ -2125,8 +2125,6 @@ DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0, doc: /* Return the function at the end of OBJECT's function chain. If OBJECT is not a symbol, just return it. Otherwise, follow all function indirections to find the final function binding and return it. -If the final symbol in the chain is unbound, signal a void-function error. -Optional arg NOERROR non-nil means to return nil instead of signaling. Signal a cyclic-function-indirection error if there is a loop in the function chain of symbols. */) (register Lisp_Object object, Lisp_Object noerror) @@ -2141,9 +2139,6 @@ function chain of symbols. */) if (!NILP (result)) return result; - if (NILP (noerror)) - xsignal1 (Qvoid_function, object); - return Qnil; }