emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] xwidget 5e22550: merge master


From: Joakim Verona
Subject: [Emacs-diffs] xwidget 5e22550: merge master
Date: Fri, 16 Jan 2015 21:31:36 +0000

branch: xwidget
commit 5e2255017323c54feeaaee220175d7761a3b6ed1
Merge: b646755 78e6ccc
Author: Joakim Verona <address@hidden>
Commit: Joakim Verona <address@hidden>

    merge master
---
 ChangeLog                      |    8 +++
 admin/ChangeLog                |    5 ++
 admin/unidata/uvs.el           |    1 +
 configure.ac                   |    5 ++-
 doc/lispref/ChangeLog          |    6 ++
 doc/lispref/streams.texi       |   24 ++++++++
 doc/lispref/text.texi          |    3 +
 etc/ChangeLog                  |    4 ++
 etc/NEWS                       |    4 ++
 lib-src/ChangeLog              |   12 ++++
 lib-src/Makefile.in            |    7 ++-
 lib-src/make-docfile.c         |   12 ----
 lisp/ChangeLog                 |   47 ++++++++++++++---
 lisp/calc/calc-units.el        |   16 ++++--
 lisp/cus-start.el              |    6 ++
 lisp/dom.el                    |    8 +++
 lisp/emacs-lisp/package.el     |   96 ++++++++++++++++++++++++---------
 lisp/files.el                  |   11 ++--
 lisp/gnus/ChangeLog            |    4 ++
 lisp/gnus/nntp.el              |   19 ++++---
 lisp/pcomplete.el              |    3 +-
 lisp/vc/vc-svn.el              |    3 +-
 nt/ChangeLog                   |    9 +++
 nt/Makefile.in                 |   28 ++++++++--
 src/ChangeLog                  |   56 +++++++++++++++++++
 src/alloc.c                    |   64 ++--------------------
 src/decompress.c               |    3 +-
 src/fileio.c                   |   50 +++++++++++++++++
 src/fns.c                      |    9 +++
 src/font.c                     |   20 +++----
 src/font.h                     |  115 ++++++++++++++++++++++++++++------------
 src/frame.c                    |    7 +++
 src/ftfont.c                   |    9 +--
 src/gnutls.c                   |   20 ++++++-
 src/gtkutil.h                  |    2 +-
 src/lisp.h                     |   37 +++++++------
 src/macfont.m                  |   10 +---
 src/process.c                  |   15 +++++-
 src/terminal.c                 |    9 +++
 src/w32uniscribe.c             |    8 +--
 src/window.c                   |   11 ++++-
 src/xdisp.c                    |    3 +-
 src/xftfont.c                  |    6 +--
 src/xmenu.c                    |    2 +-
 test/ChangeLog                 |   16 ++++++
 test/automated/Makefile.in     |    2 +-
 test/automated/calc-tests.el   |   52 ++++++++++++++++++
 test/automated/package-test.el |   17 ++++++
 48 files changed, 656 insertions(+), 228 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cca9100..309b04f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-16  Paul Eggert  <address@hidden>
+
+       Give up on -Wsuggest-attribute=const
+       The attribute doesn't help performance significantly, and the
+       warning seems to be more trouble than it's worth.  See the thread at:
+       http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00361.html
+       * configure.ac (WERROR_CFLAGS): Don't use -Wsuggest-attribute=const.
+
 2015-01-11  Paul Eggert  <address@hidden>
 
        Default to 'configure --enable-silent-rules'
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 2b04281..70d1714 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-15  Eli Zaretskii  <address@hidden>
+
+       * unidata/uvs.el (uvs-print-table-ivd): Call set-binary-mode on
+       stdout.
+
 2015-01-12  Paul Eggert  <address@hidden>
 
        Say "ELC foo.elc" instead of "GEN foo.elc"
diff --git a/admin/unidata/uvs.el b/admin/unidata/uvs.el
index 8bad523..a6beac9 100644
--- a/admin/unidata/uvs.el
+++ b/admin/unidata/uvs.el
@@ -200,6 +200,7 @@ corresponding number."
           (insert-file-contents filename)
           (uvs-alist-from-ivd collection-id
                               sequence-id-to-glyph-func))))
+    (set-binary-mode 'stdout t)
     (princ "/* Automatically generated by uvs.el.  */\n")
     (princ
      (format "static const unsigned char mac_uvs_table_%s_bytes[] =\n  {\n"
diff --git a/configure.ac b/configure.ac
index 1b2dd3d..1d206db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -894,6 +894,10 @@ else
   # Emacs's use of alloca inhibits protecting the stack.
   nw="$nw -Wstack-protector"
 
+  # Emacs's use of partly-const functions such as Fgnutls_available_p
+  # make this option problematic.
+  nw="$nw -Wsuggest-attribute=const"
+
   # Emacs's use of partly-pure functions such as CHECK_TYPE make this
   # option problematic.
   nw="$nw -Wsuggest-attribute=pure"
@@ -1976,7 +1980,6 @@ fi
 if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
    # Too many warnings for now.
    nw=
-   nw="$nw -Wsuggest-attribute=const"
    nw="$nw -Wsuggest-attribute=noreturn"
    gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
 
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 941be3c..4c0c116 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-15  Eli Zaretskii  <address@hidden>
+
+       * streams.texi (Input Functions): Document 'set-binary-mode'.
+       (Output Functions): Cross-reference to documentation of
+       'set-binary-mode'.
+
 2015-01-04  Paul Eggert  <address@hidden>
 
        batch write-region no longer says "Wrote FOO"
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi
index 5e4df00..e52a543 100644
--- a/doc/lispref/streams.texi
+++ b/doc/lispref/streams.texi
@@ -339,6 +339,25 @@ shared structures.  @xref{Circular Objects}.  Its default 
value is
 @code{t}.
 @end defvar
 
address@hidden binary I/O in batch mode
+When reading or writing from the standard input/output streams of the
+Emacs process in batch mode, it is sometimes required to make sure any
+arbitrary binary data will be read/written verbatim, and/or that no
+translation of newlines to or from CR-LF pairs are performed.  This
+issue does not exist on Posix hosts, only on MS-Windows and MS-DOS.
+The following function allows to control the I/O mode of any standard
+stream of the Emacs process.
+
address@hidden set-binary-mode stream mode
+Switch @var{stream} into binary or text I/O mode.  If @var{mode} is
address@hidden, switch to binary mode, otherwise switch to text mode.
+The value of @var{stream} can be one of @code{stdin}, @code{stdout},
+or @code{stderr}.  This function flushes any pending output data of
address@hidden as a side effect, and returns the previous value of I/O
+mode for @var{stream}.  On Posix hosts, it always returns a
address@hidden value and does nothing except flushing pending output.
address@hidden defun
+
 @node Output Streams
 @section Output Streams
 @cindex stream (for printing)
@@ -686,6 +705,11 @@ This function outputs @var{object} to @var{stream}, just 
like
 indent and fill the object to make it more readable for humans.
 @end defun
 
+If you need to use binary I/O in batch mode, e.g., use the functions
+described in this section to write out arbitrary binary data or avoid
+conversion of newlines on non-Posix hosts, see @ref{Input Functions,
+set-binary-mode}.
+
 @node Output Variables
 @section Variables Affecting Output
 @cindex output-controlling variables
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 472aedb..1b8897f 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4507,6 +4507,9 @@ which is a regular expression.
 Return all nodes in @var{dom} that have IDs that match @var{match},
 which is a regular expression.
 
address@hidden dom-strings @var{dom}
+Return all strings in @var{DOM}.
+
 @end table
 
 Utility functions:
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 20f88bd..681858e 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-15  Eli Zaretskii  <address@hidden>
+
+       * NEWS: Mention 'set-binary-mode'.
+
 2015-01-11  Paul Eggert  <address@hidden>
 
        Default to 'configure --enable-silent-rules'
diff --git a/etc/NEWS b/etc/NEWS
index f291c0c..0bfd3fd 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -588,6 +588,10 @@ been obsoleted.
 undocumented integer-pair format.  Instead, they return a list of two
 integers.
 
++++
+** New function `set-binary-mode' allows to switch a standard stream
+of the Emacs process to binary I/O mode.
+
 
 * Changes in Frames and Windows Code in Emacs 25.1
 
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index e9205fd..37f037e 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,15 @@
+2015-01-16  Eli Zaretskii  <address@hidden>
+
+       * Makefile.in (AM_V_RC, am__v_RC_, am__v_RC_0, am__v_RC_1): New
+       macros.
+       (emacsclient.res): Use $(AM_V_RC).
+
+2015-01-16  Paul Eggert  <address@hidden>
+
+       Give up on -Wsuggest-attribute=const
+       * make-docfile.c (write_globals):
+       Remove special hack for Fnext_read_file_uses_dialog_p
+
 2015-01-13  Paul Eggert  <address@hidden>
 
        Don't say Fnext_read_file_uses_dialog_p is const
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 22a5eca..01592bd 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -58,6 +58,11 @@ am__v_CCLD_ = $(address@hidden@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 =
 
+AM_V_RC = $(address@hidden@)
+am__v_RC_ = $(address@hidden@)
+am__v_RC_0 = @echo "  RC      " $@;
+am__v_RC_1 =
+
 # ==================== Where To Install Things ====================
 
 # Location to install Emacs.app under GNUstep / Mac OS X.
@@ -381,6 +386,6 @@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c 
$(NTLIB) $(config_h)
          $< $(NTLIB) $(LOADLIBES) -o $@
 
 emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico
-       $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<
+       $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<
 
 ## Makefile ends here.
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 741fa4b..79d421a 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -729,18 +729,6 @@ write_globals (void)
 
          if (globals[i].flags & DEFUN_const)
            fputs (" ATTRIBUTE_CONST", stdout);
-         else if (strcmp (globals[i].name, "Fnext_read_file_uses_dialog_p")
-                  == 0)
-           {
-             /* It would be nice to have a cleaner way to deal with this
-                special hack.  */
-             fputs (("\n"
-                     "#if ! (defined USE_GTK || defined USE_MOTIF \\\n"
-                     "       || defined HAVE_NS || defined HAVE_NTGUI)\n"
-                     "\tATTRIBUTE_CONST\n"
-                     "#endif\n"),
-                    stdout);
-           }
 
          puts (";");
        }
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b7a38af..57aaea0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,41 @@
+2015-01-16  Jorgen Schaefer  <address@hidden>
+
+       * emacs-lisp/package.el: Provide repository priorities.
+       (package-archive-priorities): New variable.
+       (package--add-to-alist): New function.
+       (package--add-to-archive-contents): Use it.
+       (package-menu--find-upgrades): Use it as well. Small clean up to
+       make the use of the package name here explicit.
+       (package-archive-priority): New function.
+       (package-desc-priority-version): New function.
+
+2015-01-16  Daniel Colascione  <address@hidden>
+
+       * cus-start.el (all): Make `ring-bell-function' customizable.
+
+2015-01-16  Dmitry Gutov  <address@hidden>
+
+       * vc/vc-svn.el (vc-svn-dir-status-files): Pass t as
+       vc-svn-after-dir-status's second argument.  (Bug#19429)
+
+2015-01-16  Samer Masterson  <address@hidden>  (tiny change)
+
+       * pcomplete.el (pcomplete-parse-arguments): Parse arguments
+       regardless of pcomplete-cycle-completions's value.  (Bug#18950)
+
+2015-01-16  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * dom.el (dom-strings): New function.
+
+       * files.el (directory-files-recursively): Don't use the word
+       "path" for a file name.
+
+2015-01-15  Wolfgang Jenkner  <address@hidden>
+
+       * calc/calc-units.el (math-units-in-expr-p)
+       (math-single-units-in-expr-p, math-find-compatible-unit-rec)
+       (math-extract-units): Handle the `neg' operator.  (Bug#19582)
+
 2015-01-15  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/eieio-core.el: Provide support for cl-generic.
@@ -28,27 +66,22 @@
 
 2015-01-13  Alan Mackenzie  <address@hidden>
 
-       Allow compilation during loading of Modes derived from a CC Mode mode.
-       Fixes debbugs#19206.
-
+       Allow compilation during loading of CC Mode-derived modes (bug#19206).
        * progmodes/cc-bytecomp.el (cc-bytecomp-compiling-or-loading):
        New function which walks the stack to discover whether we're compiling
        or loading.
-       (cc-bytecomp-is-compiling): Reformulate, and move towards
-       beginning.
+       (cc-bytecomp-is-compiling): Reformulate, and move towards beginning.
        (cc-bytecomp-is-loading): New defsubst.
        (cc-bytecomp-setup-environment, cc-bytecomp-restore-environment):
        Use the above defsubsts.
        (cc-require-when-compile, cc-bytecomp-defvar)
        (cc-bytecomp-defun): Simplify conditionals.
-
        * progmodes/cc-defs.el (cc-bytecomp-compiling-or-loading):
        "Borrow" this function from cc-bytecomp.el.
        (c-get-current-file): Reformulate using the above.
        (c-lang-defconst): Prevent duplicate entries of file names in a
        symbol's 'source property.
        (c-lang-const): Use cc-bytecomp-is-compiling.
-
        * progmodes/cc-langs.el (c-make-init-lang-vars-fun):
        Use cc-bytecomp-is-compiling.
 
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 26a644a..0595086 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -904,10 +904,12 @@ If COMP or STD is non-nil, put that in the units table 
instead."
   (and (consp expr)
        (if (eq (car expr) 'var)
           (math-check-unit-name expr)
-        (and (or sub-exprs
-                 (memq (car expr) '(* / ^)))
-             (or (math-units-in-expr-p (nth 1 expr) sub-exprs)
-                 (math-units-in-expr-p (nth 2 expr) sub-exprs))))))
+        (if (eq (car expr) 'neg)
+            (math-units-in-expr-p (nth 1 expr) sub-exprs)
+          (and (or sub-exprs
+                   (memq (car expr) '(* / ^)))
+               (or (math-units-in-expr-p (nth 1 expr) sub-exprs)
+                   (math-units-in-expr-p (nth 2 expr) sub-exprs)))))))
 
 (defun math-only-units-in-expr-p (expr)
   (and (consp expr)
@@ -924,6 +926,8 @@ If COMP or STD is non-nil, put that in the units table 
instead."
   (cond ((math-scalarp expr) nil)
        ((eq (car expr) 'var)
         (math-check-unit-name expr))
+       ((eq (car expr) 'neg)
+        (math-single-units-in-expr-p (nth 1 expr)))
        ((eq (car expr) '*)
         (let ((u1 (math-single-units-in-expr-p (nth 1 expr)))
               (u2 (math-single-units-in-expr-p (nth 2 expr))))
@@ -1079,6 +1083,8 @@ If COMP or STD is non-nil, put that in the units table 
instead."
        ((eq (car-safe expr) '/)
         (or (math-find-compatible-unit-rec (nth 1 expr) pow)
             (math-find-compatible-unit-rec (nth 2 expr) (- pow))))
+       ((eq (car-safe expr) 'neg)
+        (math-find-compatible-unit-rec (nth 1 expr) pow))
        ((and (eq (car-safe expr) '^)
              (integerp (nth 2 expr)))
         (math-find-compatible-unit-rec (nth 1 expr) (* pow (nth 2 expr))))
@@ -1497,6 +1503,8 @@ If COMP or STD is non-nil, put that in the units table 
instead."
    ((memq (car-safe expr) '(* /))
     (cons (car expr)
           (mapcar 'math-extract-units (cdr expr))))
+   ((eq (car-safe expr) 'neg)
+    (math-extract-units (nth 1 expr)))
    ((eq (car-safe expr) '^)
     (list '^ (math-extract-units (nth 1 expr)) (nth 2 expr)))
    ((math-check-unit-name expr) expr)
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 299b18d..71506cb 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -421,6 +421,12 @@ Leaving \"Default\" unchecked is equivalent with 
specifying a default of
                                                    "21.1")
              ;; term.c
              (visible-cursor cursor boolean "22.1")
+             ;; terminal.c
+             (ring-bell-function display
+              (choice
+               (const :tag "Default" nil)
+               (const :tag "Silent" ignore)
+               function))
             ;; undo.c
             (undo-limit undo integer)
             (undo-strong-limit undo integer)
diff --git a/lisp/dom.el b/lisp/dom.el
index 527b8e6..11357e8 100644
--- a/lisp/dom.el
+++ b/lisp/dom.el
@@ -103,6 +103,14 @@ A name is a symbol like `td'."
        (cons dom matches)
       matches)))
 
+(defun dom-strings (dom)
+  "Return elements in DOM that are strings."
+  (cl-loop for child in (dom-children dom)
+          if (stringp child)
+          collect child
+          else
+          append (dom-strings child)))
+
 (defun dom-by-class (dom match)
   "Return elements in DOM that have a class name that matches regexp MATCH."
   (dom-elements dom 'class match))
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 79f8b65..5336271 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -228,6 +228,22 @@ a package can run arbitrary code."
   :group 'package
   :version "24.1")
 
+(defcustom package-archive-priorities nil
+  "An alist of priorities for packages.
+
+Each element has the form (ARCHIVE-ID . PRIORITY).
+
+When installing packages, the package with the highest version
+number from the archive with the highest priority is
+selected. When higher versions are available from archives with
+lower priorities, the user has to select those manually.
+
+Archives not in this list have the priority 0."
+  :type 'integer
+  :risky t
+  :group 'package
+  :version "25.1")
+
 (defcustom package-pinned-packages nil
   "An alist of packages that are pinned to specific archives.
 This can be useful if you have multiple package archives enabled,
@@ -1114,23 +1130,32 @@ Also, add the originating archive to the `package-desc' 
structure."
                         ;; Older archive-contents files have only 4
                         ;; elements here.
                         (package--ac-desc-extras (cdr package)))))
-         (existing-packages (assq name package-archive-contents))
          (pinned-to-archive (assoc name package-pinned-packages)))
-    (cond
-     ;; Skip entirely if pinned to another archive.
-     ((and pinned-to-archive
-           (not (equal (cdr pinned-to-archive) archive)))
-      nil)
-     ((not existing-packages)
-      (push (list name pkg-desc) package-archive-contents))
-     (t
-      (while
-          (if (and (cdr existing-packages)
-                   (version-list-<
-                    version (package-desc-version (cadr existing-packages))))
-              (setq existing-packages (cdr existing-packages))
-            (push pkg-desc (cdr existing-packages))
-            nil))))))
+    ;; Skip entirely if pinned to another archive.
+    (when (not (and pinned-to-archive
+                    (not (equal (cdr pinned-to-archive) archive))))
+      (setq package-archive-contents
+            (package--add-to-alist pkg-desc package-archive-contents)))))
+
+(defun package--add-to-alist (pkg-desc alist)
+  "Add PKG-DESC to ALIST.
+
+Packages are grouped by name. The package descriptions are sorted
+by version number."
+  (let* ((name (package-desc-name pkg-desc))
+         (priority-version (package-desc-priority-version pkg-desc))
+         (existing-packages (assq name alist)))
+    (if (not existing-packages)
+        (cons (list name pkg-desc)
+              alist)
+      (while (if (and (cdr existing-packages)
+                      (version-list-< priority-version
+                                      (package-desc-priority-version
+                                       (cadr existing-packages))))
+                 (setq existing-packages (cdr existing-packages))
+               (push pkg-desc (cdr existing-packages))
+               nil))
+      alist)))
 
 (defun package-download-transaction (packages)
   "Download and install all the packages in PACKAGES.
@@ -1319,6 +1344,25 @@ The file can either be a tar file or an Emacs Lisp file."
   "Return the archive containing the package NAME."
   (cdr (assoc (package-desc-archive desc) package-archives)))
 
+(defun package-archive-priority (archive)
+  "Return the priority of ARCHIVE.
+
+The archive priorities are specified in
+`package-archive-priorities'. If not given there, the priority
+defaults to 0."
+  (or (cdr (assoc archive package-archive-priorities))
+      0))
+
+(defun package-desc-priority-version (pkg-desc)
+  "Return the version PKG-DESC with the archive priority prepended.
+
+This allows for easy comparison of package versions from
+different archives if archive priorities are meant to be taken in
+consideration."
+  (cons (package-archive-priority
+         (package-desc-archive pkg-desc))
+        (package-desc-version pkg-desc)))
+
 (defun package--download-one-archive (archive file)
   "Retrieve an archive file FILE from ARCHIVE, and cache it.
 ARCHIVE should be a cons cell of the form (NAME . LOCATION),
@@ -1991,18 +2035,18 @@ If optional arg BUTTON is non-nil, describe its 
associated package."
       ;; ENTRY is (PKG-DESC [NAME VERSION STATUS DOC])
       (let ((pkg-desc (car entry))
            (status (aref (cadr entry) 2)))
-       (cond ((member status '("installed" "unsigned"))
-              (push pkg-desc installed))
-             ((member status '("available" "new"))
-              (push (cons (package-desc-name pkg-desc) pkg-desc)
-                     available)))))
+        (cond ((member status '("installed" "unsigned"))
+               (push pkg-desc installed))
+              ((member status '("available" "new"))
+               (setq available (package--add-to-alist pkg-desc available))))))
     ;; Loop through list of installed packages, finding upgrades.
     (dolist (pkg-desc installed)
-      (let ((avail-pkg (assq (package-desc-name pkg-desc) available)))
-       (and avail-pkg
-            (version-list-< (package-desc-version pkg-desc)
-                             (package-desc-version (cdr avail-pkg)))
-            (push avail-pkg upgrades))))
+      (let* ((name (package-desc-name pkg-desc))
+             (avail-pkg (cadr (assq name available))))
+        (and avail-pkg
+             (version-list-< (package-desc-priority-version pkg-desc)
+                             (package-desc-priority-version avail-pkg))
+             (push (cons name avail-pkg) upgrades))))
     upgrades))
 
 (defun package-menu-mark-upgrades ()
diff --git a/lisp/files.el b/lisp/files.el
index 175f85b..f8318d8 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -749,14 +749,15 @@ If INCLUDE-DIRECTORIES, also include directories that 
have matching names."
       (unless (member file '("./" "../"))
        (if (directory-name-p file)
            (let* ((leaf (substring file 0 (1- (length file))))
-                  (path (expand-file-name leaf dir)))
+                  (full-file (expand-file-name leaf dir)))
              ;; Don't follow symlinks to other directories.
-             (unless (file-symlink-p path)
-               (setq result (nconc result (directory-files-recursively
-                                           path match include-directories))))
+             (unless (file-symlink-p full-file)
+               (setq result
+                     (nconc result (directory-files-recursively
+                                    full-file match include-directories))))
              (when (and include-directories
                         (string-match match leaf))
-               (setq result (nconc result (list path)))))
+               (setq result (nconc result (list full-file)))))
          (when (string-match match file)
            (push (expand-file-name file dir) files)))))
     (nconc result (nreverse files))))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 20de9ae..5a61a21 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-15  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * nntp.el (nntp-send-authinfo): Error out if the password is wrong.
+
 2015-01-08  Stefan Monnier  <address@hidden>
 
        * registry.el: Don't use <class> as a variable.
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index e071368..0891dba 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1219,14 +1219,17 @@ If SEND-IF-FORCE, only send authinfo to the server if 
the
              nntp-authinfo-user user))
       (unless (member user '(nil ""))
        (nntp-send-command "^3.*\r?\n" "AUTHINFO USER" user)
-       (when t                         ;???Should check if AUTHINFO succeeded
-         (nntp-send-command
-          "^2.*\r?\n" "AUTHINFO PASS"
-          (or passwd
-              nntp-authinfo-password
-              (setq nntp-authinfo-password
-                    (read-passwd (format "NNTP (address@hidden) password: "
-                                         user nntp-address))))))))))
+       (let ((result
+              (nntp-send-command
+               "^2.*\r?\n" "AUTHINFO PASS"
+               (or passwd
+                   nntp-authinfo-password
+                   (setq nntp-authinfo-password
+                         (read-passwd (format "NNTP (address@hidden) password: 
"
+                                              user nntp-address)))))))
+         (if (not result)
+             (signal 'nntp-authinfo-rejected "Password rejected")
+           result))))))
 
 ;;; Internal functions.
 
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 17327ea..7bcf2c1 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -755,8 +755,7 @@ this is `comint-dynamic-complete-functions'."
            pcomplete-index 0
            pcomplete-stub (pcomplete-arg 'last))
       (let ((begin (pcomplete-begin 'last)))
-       (if (and pcomplete-cycle-completions
-                (listp pcomplete-stub) ;??
+       (if (and (listp pcomplete-stub) ;??
                 (not pcomplete-expand-only-p))
            (let* ((completions pcomplete-stub) ;??
                   (common-stub (car completions))
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index bae178d..d74daf9 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -164,6 +164,7 @@ If you want to force an empty list of arguments, use t."
 
 ;; FIXME it would be better not to have the "remote" argument,
 ;; but to distinguish the two output formats based on content.
+;; FIXME: the local format isn't used by the (sole) caller anymore.
 (defun vc-svn-after-dir-status (callback &optional remote)
   (let ((state-map '((?A . added)
                      (?C . conflict)
@@ -208,7 +209,7 @@ CALLBACK is called as (CALLBACK RESULT BUFFER), where
 RESULT is a list of conses (FILE . STATE) for directory DIR."
   ;; FIXME shouldn't this rather default to all the files in dir?
   (apply #'vc-svn-command (current-buffer) 'async nil "status" "-u" files)
-  (vc-run-delayed (vc-svn-after-dir-status callback)))
+  (vc-run-delayed (vc-svn-after-dir-status callback t)))
 
 (defun vc-svn-dir-extra-headers (_dir)
   "Generate extra status headers for a Subversion working copy."
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 5f61042..b9966fb 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,12 @@
+2015-01-16  Eli Zaretskii  <address@hidden>
+
+       * Makefile.in (AM_V_CC, am__v_CC_, am__v_CC_0, am__v_CC_1)
+       (AM_V_CCLD, am__v_CCLD_, am__v_CCLD_0, am__v_CCLD_1, AM_V_RC)
+       (am__v_RC_, am__v_RC_0, am__v_RC_1): New macros.
+       (addpm${EXEEXT}, ddeclient${EXEEXT}, cmdproxy${EXEEXT})
+       (runemacs${EXEEXT}): Use $(AM_V_CCLD).
+       (emacs.res, ../src/emacs.res): Use $(AM_V_RC).
+
 2014-12-26  Eli Zaretskii  <address@hidden>
 
        * gnulib.mk (stpcpy, string): Sync with the latest change in
diff --git a/nt/Makefile.in b/nt/Makefile.in
index 01631d8..fc6887f 100644
--- a/nt/Makefile.in
+++ b/nt/Makefile.in
@@ -41,6 +41,24 @@ WERROR_CFLAGS = @WERROR_CFLAGS@
 # Program name transformation.
 TRANSFORM = @program_transform_name@
 
+# 'make' verbosity.
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+
+AM_V_CC = $(address@hidden@)
+am__v_CC_ = $(address@hidden@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 =
+
+AM_V_CCLD = $(address@hidden@)
+am__v_CCLD_ = $(address@hidden@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 =
+
+AM_V_RC = $(address@hidden@)
+am__v_RC_ = $(address@hidden@)
+am__v_RC_0 = @echo "  RC      " $@;
+am__v_RC_1 =
+
 # ==================== Where To Install Things ====================
 
 # The default location for installation.  Everything is placed in
@@ -213,18 +231,18 @@ TAGS: ${EXE_FILES:${EXEEXT}=.c}
 
 ## Build the programs
 addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
-       $(CC) ${ALL_CFLAGS} $< $(LIBS_ADDPM) -o $@
+       $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LIBS_ADDPM) -o $@
 
 ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
-       $(CC) ${ALL_CFLAGS} $< -o $@
+       $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< -o $@
 
 cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
-       $(CC) ${ALL_CFLAGS} $< -o $@
+       $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< -o $@
 
 runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
-       $(CC) ${ALL_CFLAGS} $^ -mwindows -o $@
+       $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $^ -mwindows -o $@
 
 ## Also used in ../src/Makefile.
 emacs.res ../src/emacs.res: emacs.rc ${srcdir}/icons/emacs.ico \
   ${srcdir}/icons/hand.cur ${srcdir}/$(EMACS_MANIFEST)
-       ${WINDRES} -I ${srcdir} -O coff -o $@ $<
+       $(AM_V_RC)${WINDRES} -I ${srcdir} -O coff -o $@ $<
diff --git a/src/ChangeLog b/src/ChangeLog
index b2588f1..16e2fa1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,59 @@
+2015-01-16  Dmitry Antipov  <address@hidden>
+
+       Tune pseudovector allocation assuming Qnil == 0.
+       * alloc.c (allocate_pseudovector): Use memset for both
+       Lisp_Objects and regular slots.  Add zerolen arg.
+       * lisp.h (allocate_pseudovector): Adjust prototype.
+       (ALLOCATE_PSEUDOVECTOR): Adjust user.
+       (ALLOCATE_ZEROED_PSEUDOVECTOR): New macro.
+       (allocate_hash_table, allocate_window, allocate_frame)
+       (allocate_process, allocate_terminal): Remove prototypes.
+       * fns.c (allocate_hash_table): Now static here.
+       * frame.c (allocate_frame):
+       * process.c (allocate_process):
+       * terminal.c (allocate_terminal):
+       * window.c (allocate_window): Now static here.
+       Use ALLOCATE_ZEROED_PSEUDOVECTOR.  Add comment.
+
+       * lisp.h (XTERMINAL): Add eassert.
+       * process.c (make_lisp_proc): Now static here.
+
+       Prefer INLINE functions in font.h to match style used in lisp.h.
+       * font.h (FONTP, FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P)
+       (CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY, CHECK_FONT_OBJECT)
+       (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, CHECK_FONT_GET_OBJECT):
+       Now functions.
+       * font.c (Ffont_otf_alternates, Fquery_font, Ffont_get_glyphs):
+       * ftfont.c (ftfont_shape):
+       * macfont.m (macfont_shape):
+       * w32uniscribe.c (uniscribe_shape):
+       * xftfont.c (xftfont_shape): Adjust CHECK_FONT_GET_OBJECT users.
+
+2015-01-16  Paul Eggert  <address@hidden>
+
+       Give up on -Wsuggest-attribute=const
+       * decompress.c (Fzlib_available_p):
+       * gnutls.c (Fgnutls_available_p):
+       * gtkutil.h (xg_uses_old_file_dialog):
+       * xdisp.c (Ftool_bar_height):
+       * xmenu.c (popup_activated):
+       No longer const, since it's not const on at lest some
+       configurations, and we shouldn't lie to the compiler.
+
+2015-01-15  Eli Zaretskii  <address@hidden>
+
+       * fileio.c: Include binary-io.h.
+       (Fset_binary_mode): New function.
+       (syms_of_fileio): Defsubr it.
+       (syms_of_fileio) <Qstdin, Qstdout, Qstderr>: DEFSYM them.
+
+2015-01-15  Teodor Zlatanov  <address@hidden>
+
+       * gnutls.c (init_gnutls_functions): Import gnutls_x509_crt_check_issuer.
+       (Fgnutls_peer_status): Use it to set the :self-signed flag.
+       Rename the previous :self-signed to :unknown-ca. (Bug#19404)
+       (Fgnutls_peer_status_warning_describe): Explain :unknown-ca flag.
+
 2015-01-14  Eli Zaretskii  <address@hidden>
 
        * w32fns.c (w32_wnd_proc): Ignore MENUITEMINFO's dwItemData data
diff --git a/src/alloc.c b/src/alloc.c
index 7c93733..22a15b4 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3163,19 +3163,19 @@ allocate_vector (EMACS_INT len)
 /* Allocate other vector-like structures.  */
 
 struct Lisp_Vector *
-allocate_pseudovector (int memlen, int lisplen, enum pvec_type tag)
+allocate_pseudovector (int memlen, int lisplen,
+                      int zerolen, enum pvec_type tag)
 {
   struct Lisp_Vector *v = allocate_vectorlike (memlen);
-  int i;
 
   /* Catch bogus values.  */
   eassert (tag <= PVEC_FONT);
   eassert (memlen - lisplen <= (1 << PSEUDOVECTOR_REST_BITS) - 1);
   eassert (lisplen <= (1 << PSEUDOVECTOR_SIZE_BITS) - 1);
 
-  /* Only the first lisplen slots will be traced normally by the GC.  */
-  for (i = 0; i < lisplen; ++i)
-    v->contents[i] = Qnil;
+  /* Only the first lisplen slots will be traced normally by the GC.
+     But since Qnil == 0, we can memset Lisp_Object slots as well.  */
+  memset (v->contents, 0, zerolen * word_size);
 
   XSETPVECTYPESIZE (v, tag, lisplen, memlen - lisplen);
   return v;
@@ -3194,60 +3194,6 @@ allocate_buffer (void)
   return b;
 }
 
-struct Lisp_Hash_Table *
-allocate_hash_table (void)
-{
-  return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table, count, 
PVEC_HASH_TABLE);
-}
-
-struct window *
-allocate_window (void)
-{
-  struct window *w;
-
-  w = ALLOCATE_PSEUDOVECTOR (struct window, current_matrix, PVEC_WINDOW);
-  /* Users assumes that non-Lisp data is zeroed.  */
-  memset (&w->current_matrix, 0,
-         sizeof (*w) - offsetof (struct window, current_matrix));
-  return w;
-}
-
-struct terminal *
-allocate_terminal (void)
-{
-  struct terminal *t;
-
-  t = ALLOCATE_PSEUDOVECTOR (struct terminal, next_terminal, PVEC_TERMINAL);
-  /* Users assumes that non-Lisp data is zeroed.  */
-  memset (&t->next_terminal, 0,
-         sizeof (*t) - offsetof (struct terminal, next_terminal));
-  return t;
-}
-
-struct frame *
-allocate_frame (void)
-{
-  struct frame *f;
-
-  f = ALLOCATE_PSEUDOVECTOR (struct frame, face_cache, PVEC_FRAME);
-  /* Users assumes that non-Lisp data is zeroed.  */
-  memset (&f->face_cache, 0,
-         sizeof (*f) - offsetof (struct frame, face_cache));
-  return f;
-}
-
-struct Lisp_Process *
-allocate_process (void)
-{
-  struct Lisp_Process *p;
-
-  p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS);
-  /* Users assumes that non-Lisp data is zeroed.  */
-  memset (&p->pid, 0,
-         sizeof (*p) - offsetof (struct Lisp_Process, pid));
-  return p;
-}
-
 DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0,
        doc: /* Return a newly created vector of length LENGTH, with each 
element being INIT.
 See also the function `vector'.  */)
diff --git a/src/decompress.c b/src/decompress.c
index b78dace..b14f0a2 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -88,8 +88,7 @@ unwind_decompress (void *ddata)
 }
 
 DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0,
-       doc: /* Return t if zlib decompression is available in this instance of 
Emacs.  */
-       attributes: const)
+       doc: /* Return t if zlib decompression is available in this instance of 
Emacs.  */)
      (void)
 {
 #ifdef WINDOWSNT
diff --git a/src/fileio.c b/src/fileio.c
index 6c443c9..dc67a00 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -86,6 +86,8 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <careadlinkat.h>
 #include <stat-time.h>
 
+#include <binary-io.h>
+
 #ifdef HPUX
 #include <netio.h>
 #endif
@@ -5754,6 +5756,48 @@ before any other event (mouse or keypress) is handled.  
*/)
   return Qnil;
 }
 
+
+DEFUN ("set-binary-mode", Fset_binary_mode, Sset_binary_mode, 2, 2, 0,
+       doc: /* Switch STREAM to binary I/O mode or text I/O mode.
+STREAM can be one of the symbols `stdin', `stdout', or `stderr'.
+If MODE is non-nil, switch STREAM to binary mode, otherwise switch
+it to text mode.
+
+As a side effect, this function flushes any pending STREAM's data.
+
+Value is the previous value of STREAM's I/O mode, nil for text mode,
+non-nil for binary mode.
+
+On MS-Windows and MS-DOS, binary mode is needed to read or write
+arbitrary binary data, and for disabling translation between CR-LF
+pairs and a single newline character.  Examples include generation
+of text files with Unix-style end-of-line format using `princ' in
+batch mode, with standard output redirected to a file.
+
+On Posix systems, this function always returns non-nil, and has no
+effect except for flushing STREAM's data.  */)
+  (Lisp_Object stream, Lisp_Object mode)
+{
+  FILE *fp = NULL;
+  int binmode;
+
+  CHECK_SYMBOL (stream);
+  if (EQ (stream, Qstdin))
+    fp = stdin;
+  else if (EQ (stream, Qstdout))
+    fp = stdout;
+  else if (EQ (stream, Qstderr))
+    fp = stderr;
+  else
+    xsignal2 (Qerror, build_string ("unsupported stream"), stream);
+
+  binmode = NILP (mode) ? O_TEXT : O_BINARY;
+  if (fp != stdin)
+    fflush (fp);
+
+  return (set_binary_mode (fileno (fp), binmode) == O_BINARY) ? Qt : Qnil;
+}
+
 void
 init_fileio (void)
 {
@@ -6040,6 +6084,10 @@ This includes interactive calls to `delete-file' and
   DEFSYM (Qsubstitute_env_in_file_name, "substitute-env-in-file-name");
   DEFSYM (Qget_buffer_window_list, "get-buffer-window-list");
 
+  DEFSYM (Qstdin, "stdin");
+  DEFSYM (Qstdout, "stdout");
+  DEFSYM (Qstderr, "stderr");
+
   defsubr (&Sfind_file_name_handler);
   defsubr (&Sfile_name_directory);
   defsubr (&Sfile_name_nondirectory);
@@ -6089,6 +6137,8 @@ This includes interactive calls to `delete-file' and
 
   defsubr (&Snext_read_file_uses_dialog_p);
 
+  defsubr (&Sset_binary_mode);
+
 #ifdef HAVE_SYNC
   defsubr (&Sunix_sync);
 #endif
diff --git a/src/fns.c b/src/fns.c
index 91cd513..ca3d98b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3814,6 +3814,15 @@ hashfn_user_defined (struct hash_table_test *ht, 
Lisp_Object key)
   return hashfn_eq (ht, hash);
 }
 
+/* Allocate basically initialized hash table.  */
+
+static struct Lisp_Hash_Table *
+allocate_hash_table (void)
+{
+  return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table,
+                               count, PVEC_HASH_TABLE);
+}
+
 /* An upper bound on the size of a hash table index.  It must fit in
    ptrdiff_t and be a valid Emacs fixnum.  */
 #define INDEX_SIZE_BOUND \
diff --git a/src/font.c b/src/font.c
index a68c3c7..56a2782 100644
--- a/src/font.c
+++ b/src/font.c
@@ -156,7 +156,7 @@ font_make_spec (void)
   struct font_spec *spec
     = ((struct font_spec *)
        allocate_pseudovector (VECSIZE (struct font_spec),
-                             FONT_SPEC_MAX, PVEC_FONT));
+                             FONT_SPEC_MAX, FONT_SPEC_MAX, PVEC_FONT));
   XSETFONT (font_spec, spec);
   return font_spec;
 }
@@ -168,7 +168,7 @@ font_make_entity (void)
   struct font_entity *entity
     = ((struct font_entity *)
        allocate_pseudovector (VECSIZE (struct font_entity),
-                             FONT_ENTITY_MAX, PVEC_FONT));
+                             FONT_ENTITY_MAX, FONT_ENTITY_MAX, PVEC_FONT));
   XSETFONT (font_entity, entity);
   return font_entity;
 }
@@ -181,7 +181,8 @@ font_make_object (int size, Lisp_Object entity, int 
pixelsize)
 {
   Lisp_Object font_object;
   struct font *font
-    = (struct font *) allocate_pseudovector (size, FONT_OBJECT_MAX, PVEC_FONT);
+    = (struct font *) allocate_pseudovector (size, FONT_OBJECT_MAX,
+                                            FONT_OBJECT_MAX, PVEC_FONT);
   int i;
 
   /* GC can happen before the driver is set up,
@@ -4532,12 +4533,11 @@ character code corresponding to the glyph or nil if 
there's no
 corresponding character.  */)
   (Lisp_Object font_object, Lisp_Object character, Lisp_Object otf_features)
 {
-  struct font *font;
+  struct font *font = CHECK_FONT_GET_OBJECT (font_object);
   Lisp_Object gstring_in, gstring_out, g;
   Lisp_Object alternates;
   int i, num;
 
-  CHECK_FONT_GET_OBJECT (font_object, font);
   if (! font->driver->otf_drive)
     error ("Font backend %s can't drive OpenType GSUB table",
           SDATA (SYMBOL_NAME (font->driver->type)));
@@ -4647,12 +4647,9 @@ FEATURE is a symbol representing OpenType feature tag.
 If the font is not OpenType font, CAPABILITY is nil.  */)
   (Lisp_Object font_object)
 {
-  struct font *font;
-  Lisp_Object val;
+  struct font *font = CHECK_FONT_GET_OBJECT (font_object);
+  Lisp_Object val = make_uninit_vector (9);
 
-  CHECK_FONT_GET_OBJECT (font_object, font);
-
-  val = make_uninit_vector (9);
   ASET (val, 0, AREF (font_object, FONT_NAME_INDEX));
   ASET (val, 1, AREF (font_object, FONT_FILE_INDEX));
   ASET (val, 2, make_number (font->pixel_size));
@@ -4691,12 +4688,11 @@ the corresponding element is nil.  */)
   (Lisp_Object font_object, Lisp_Object from, Lisp_Object to,
    Lisp_Object object)
 {
-  struct font *font;
+  struct font *font = CHECK_FONT_GET_OBJECT (font_object);
   ptrdiff_t i, len;
   Lisp_Object *chars, vec;
   USE_SAFE_ALLOCA;
 
-  CHECK_FONT_GET_OBJECT (font_object, font);
   if (NILP (object))
     {
       ptrdiff_t charpos, bytepos;
diff --git a/src/font.h b/src/font.h
index 5a3e38a..efc184e 100644
--- a/src/font.h
+++ b/src/font.h
@@ -413,46 +413,91 @@ struct font_bitmap
 /* Predicates to check various font-related objects.  */
 
 /* True iff X is one of font-spec, font-entity, and font-object.  */
-#define FONTP(x) PSEUDOVECTORP (x, PVEC_FONT)
+INLINE bool
+FONTP (Lisp_Object x)
+{
+  return PSEUDOVECTORP (x, PVEC_FONT);
+}
+
 /* True iff X is font-spec.  */
-#define FONT_SPEC_P(x) \
-  (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_SPEC_MAX)
+INLINE bool
+FONT_SPEC_P (Lisp_Object x)
+{
+  return FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_SPEC_MAX;
+}
+
 /* True iff X is font-entity.  */
-#define FONT_ENTITY_P(x)       \
-  (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_ENTITY_MAX)
+INLINE bool
+FONT_ENTITY_P (Lisp_Object x)
+{
+  return FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_ENTITY_MAX;
+}
+
 /* True iff X is font-object.  */
-#define FONT_OBJECT_P(x)       \
-  (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)
-
-/* Check macros for various font-related objects.  */
-
-#define CHECK_FONT(x)  \
-  do { if (! FONTP (x)) wrong_type_argument (Qfont, x); } while (false)
-#define CHECK_FONT_SPEC(x)     \
-  do { if (! FONT_SPEC_P (x)) wrong_type_argument (Qfont_spec, x); } \
-  while (false)
-#define CHECK_FONT_ENTITY(x)   \
-  do { if (! FONT_ENTITY_P (x)) wrong_type_argument (Qfont_entity, x); } \
-  while (false)
-#define CHECK_FONT_OBJECT(x)   \
-  do { if (! FONT_OBJECT_P (x)) wrong_type_argument (Qfont_object, x); } \
-  while (false)
-
-#define CHECK_FONT_GET_OBJECT(x, font) \
-  do {                                 \
-    CHECK_FONT_OBJECT (x);             \
-    font = XFONT_OBJECT (x);           \
-  } while (false)
+INLINE bool
+FONT_OBJECT_P (Lisp_Object x)
+{
+  return FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX;
+}
+
+/* Type checking functions for various font-related objects.  */
+
+INLINE void
+CHECK_FONT (Lisp_Object x)
+{
+  CHECK_TYPE (FONTP (x), Qfont, x);
+}
+
+INLINE void
+CHECK_FONT_SPEC (Lisp_Object x)
+{
+  CHECK_TYPE (FONT_SPEC_P (x), Qfont_spec, x);
+}
+
+INLINE void
+CHECK_FONT_ENTITY (Lisp_Object x)
+{
+  CHECK_TYPE (FONT_ENTITY_P (x), Qfont_entity, x);
+}
+
+INLINE void
+CHECK_FONT_OBJECT (Lisp_Object x)
+{
+  CHECK_TYPE (FONT_OBJECT_P (x), Qfont_object, x);
+}
+
+/* C pointer extraction functions for various font-related objects.  */
+
+INLINE struct font_spec *
+XFONT_SPEC (Lisp_Object p)
+{
+  eassert (FONT_SPEC_P (p));
+  return XUNTAG (p, Lisp_Vectorlike);
+}
+
+INLINE struct font_entity *
+XFONT_ENTITY (Lisp_Object p)
+{
+  eassert (FONT_ENTITY_P (p));
+  return XUNTAG (p, Lisp_Vectorlike);
+}
+
+INLINE struct font *
+XFONT_OBJECT (Lisp_Object p)
+{
+  eassert (FONT_OBJECT_P (p));
+  return XUNTAG (p, Lisp_Vectorlike);
+}
 
-#define XFONT_SPEC(p)  \
-  (eassert (FONT_SPEC_P (p)), (struct font_spec *) XUNTAG (p, Lisp_Vectorlike))
-#define XFONT_ENTITY(p)        \
-  (eassert (FONT_ENTITY_P (p)), \
-   (struct font_entity *) XUNTAG (p, Lisp_Vectorlike))
-#define XFONT_OBJECT(p)        \
-  (eassert (FONT_OBJECT_P (p)), (struct font *) XUNTAG (p, Lisp_Vectorlike))
 #define XSETFONT(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FONT))
 
+INLINE struct font *
+CHECK_FONT_GET_OBJECT (Lisp_Object x)
+{
+  CHECK_FONT_OBJECT (x);
+  return XFONT_OBJECT (x);
+}
+
 /* Number of pt per inch (from the TeXbook).  */
 #define PT_PER_INCH 72.27
 
diff --git a/src/frame.c b/src/frame.c
index ec580f3..2ce5a62 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -570,6 +570,13 @@ adjust_frame_size (struct frame *f, int new_width, int 
new_height, int inhibit,
   run_window_configuration_change_hook (f);
 }
 
+/* Allocate basically initialized frame.  */
+
+static struct frame *
+allocate_frame (void)
+{
+  return ALLOCATE_ZEROED_PSEUDOVECTOR (struct frame, face_cache, PVEC_FRAME);
+}
 
 struct frame *
 make_frame (bool mini_p)
diff --git a/src/ftfont.c b/src/ftfont.c
index 9707b6c..053b95f 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -2576,13 +2576,10 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font 
*font,
 Lisp_Object
 ftfont_shape (Lisp_Object lgstring)
 {
-  struct font *font;
-  struct ftfont_info *ftfont_info;
-  OTF *otf;
+  struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
+  struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
+  OTF *otf = ftfont_get_otf (ftfont_info);
 
-  CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
-  ftfont_info = (struct ftfont_info *) font;
-  otf = ftfont_get_otf (ftfont_info);
   if (! otf)
     return make_number (0);
   return ftfont_shape_by_flt (lgstring, font, ftfont_info->ft_size->face, otf,
diff --git a/src/gnutls.c b/src/gnutls.c
index 5e6c635..35f0eb4 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -122,6 +122,8 @@ DEF_DLL_FN (void, gnutls_transport_set_push_function,
            (gnutls_session_t, gnutls_push_func));
 DEF_DLL_FN (int, gnutls_x509_crt_check_hostname,
            (gnutls_x509_crt_t, const char *));
+DEF_DLL_FN (int, gnutls_x509_crt_check_issuer,
+              (gnutls_x509_crt_t, gnutls_x509_crt_t));
 DEF_DLL_FN (void, gnutls_x509_crt_deinit, (gnutls_x509_crt_t));
 DEF_DLL_FN (int, gnutls_x509_crt_import,
            (gnutls_x509_crt_t, const gnutls_datum_t *,
@@ -236,6 +238,7 @@ init_gnutls_functions (void)
   LOAD_DLL_FN (library, gnutls_transport_set_pull_function);
   LOAD_DLL_FN (library, gnutls_transport_set_push_function);
   LOAD_DLL_FN (library, gnutls_x509_crt_check_hostname);
+  LOAD_DLL_FN (library, gnutls_x509_crt_check_issuer);
   LOAD_DLL_FN (library, gnutls_x509_crt_deinit);
   LOAD_DLL_FN (library, gnutls_x509_crt_import);
   LOAD_DLL_FN (library, gnutls_x509_crt_init);
@@ -329,6 +332,7 @@ init_gnutls_functions (void)
 # define gnutls_transport_set_pull_function 
fn_gnutls_transport_set_pull_function
 # define gnutls_transport_set_push_function 
fn_gnutls_transport_set_push_function
 # define gnutls_x509_crt_check_hostname fn_gnutls_x509_crt_check_hostname
+# define gnutls_x509_crt_check_issuer fn_gnutls_x509_crt_check_issuer
 # define gnutls_x509_crt_deinit fn_gnutls_x509_crt_deinit
 # define gnutls_x509_crt_get_activation_time 
fn_gnutls_x509_crt_get_activation_time
 # define gnutls_x509_crt_get_dn fn_gnutls_x509_crt_get_dn
@@ -982,6 +986,10 @@ DEFUN ("gnutls-peer-status-warning-describe", 
Fgnutls_peer_status_warning_descri
   if (EQ (status_symbol, intern (":self-signed")))
     return build_string ("certificate signer was not found (self-signed)");
 
+  if (EQ (status_symbol, intern (":unknown-ca")))
+    return build_string ("the certificate was signed by an unknown "
+                         "and therefore untrusted authority");
+
   if (EQ (status_symbol, intern (":not-ca")))
     return build_string ("certificate signer is not a CA");
 
@@ -1026,7 +1034,7 @@ The return value is a property list with top-level keys 
:warnings and
     warnings = Fcons (intern (":revoked"), warnings);
 
   if (verification & GNUTLS_CERT_SIGNER_NOT_FOUND)
-    warnings = Fcons (intern (":self-signed"), warnings);
+    warnings = Fcons (intern (":unknown-ca"), warnings);
 
   if (verification & GNUTLS_CERT_SIGNER_NOT_CA)
     warnings = Fcons (intern (":not-ca"), warnings);
@@ -1044,6 +1052,13 @@ The return value is a property list with top-level keys 
:warnings and
       CERTIFICATE_NOT_MATCHING)
     warnings = Fcons (intern (":no-host-match"), warnings);
 
+  /* This could get called in the INIT stage, when the certificate is
+     not yet set. */
+  if (XPROCESS (proc)->gnutls_certificate != NULL &&
+      gnutls_x509_crt_check_issuer(XPROCESS (proc)->gnutls_certificate,
+                                   XPROCESS (proc)->gnutls_certificate))
+    warnings = Fcons (intern (":self-signed"), warnings);
+
   if (!NILP (warnings))
     result = list2 (intern (":warnings"), warnings);
 
@@ -1604,8 +1619,7 @@ This function may also return `gnutls-e-again', or
 #endif /* HAVE_GNUTLS */
 
 DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
-       doc: /* Return t if GnuTLS is available in this instance of Emacs.  */
-       attributes: const)
+       doc: /* Return t if GnuTLS is available in this instance of Emacs.  */)
      (void)
 {
 #ifdef HAVE_GNUTLS
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 7d712c9..0ac49ca 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -78,7 +78,7 @@ typedef struct xg_menu_item_cb_data_
 
 } xg_menu_item_cb_data;
 
-extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST;
+extern bool xg_uses_old_file_dialog (void);
 
 extern char *xg_get_file_name (struct frame *f,
                                char *prompt,
diff --git a/src/lisp.h b/src/lisp.h
index b6608da..e94e39a 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -608,6 +608,7 @@ INLINE bool SUBRP (Lisp_Object);
 INLINE bool (SYMBOLP) (Lisp_Object);
 INLINE bool (VECTORLIKEP) (Lisp_Object);
 INLINE bool WINDOWP (Lisp_Object);
+INLINE bool TERMINALP (Lisp_Object);
 INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object);
 INLINE struct Lisp_Symbol *(XSYMBOL) (Lisp_Object);
 INLINE void *(XUNTAG) (Lisp_Object, int);
@@ -1003,6 +1004,7 @@ XWINDOW (Lisp_Object a)
 INLINE struct terminal *
 XTERMINAL (Lisp_Object a)
 {
+  eassert (TERMINALP (a));
   return XUNTAG (a, Lisp_Vectorlike);
 }
 
@@ -1065,12 +1067,6 @@ builtin_lisp_symbol (int index)
   return make_lisp_symbol (lispsym + index);
 }
 
-INLINE Lisp_Object
-make_lisp_proc (struct Lisp_Process *p)
-{
-  return make_lisp_ptr (p, Lisp_Vectorlike);
-}
-
 #define XSETINT(a, b) ((a) = make_number (b))
 #define XSETFASTINT(a, b) ((a) = make_natnum (b))
 #define XSETCONS(a, b) ((a) = make_lisp_ptr (b, Lisp_Cons))
@@ -3785,16 +3781,25 @@ make_uninit_sub_char_table (int depth, int min_char)
   return v;
 }
 
-extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
-#define ALLOCATE_PSEUDOVECTOR(typ,field,tag)                           \
-  ((typ*)                                                              \
-   allocate_pseudovector                                               \
-       (VECSIZE (typ), PSEUDOVECSIZE (typ, field), tag))
-extern struct Lisp_Hash_Table *allocate_hash_table (void);
-extern struct window *allocate_window (void);
-extern struct frame *allocate_frame (void);
-extern struct Lisp_Process *allocate_process (void);
-extern struct terminal *allocate_terminal (void);
+extern struct Lisp_Vector *allocate_pseudovector (int, int, int,
+                                                 enum pvec_type);
+
+/* Allocate partially initialized pseudovector where all Lisp_Object
+   slots are set to Qnil but the rest (if any) is left uninitialized.  */
+
+#define ALLOCATE_PSEUDOVECTOR(type, field, tag)                               \
+  ((type *) allocate_pseudovector (VECSIZE (type),                    \
+                                  PSEUDOVECSIZE (type, field),        \
+                                  PSEUDOVECSIZE (type, field), tag))
+
+/* Allocate fully initialized pseudovector where all Lisp_Object
+   slots are set to Qnil and the rest (if any) is zeroed.  */
+
+#define ALLOCATE_ZEROED_PSEUDOVECTOR(type, field, tag)                \
+  ((type *) allocate_pseudovector (VECSIZE (type),                    \
+                                  PSEUDOVECSIZE (type, field),        \
+                                  VECSIZE (type), tag))
+
 extern bool gc_in_progress;
 extern bool abort_on_gc;
 extern Lisp_Object make_float (double);
diff --git a/src/macfont.m b/src/macfont.m
index f569934..cbf1b07 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -2788,9 +2788,9 @@ macfont_draw (struct glyph_string *s, int from, int to, 
int x, int y,
 static Lisp_Object
 macfont_shape (Lisp_Object lgstring)
 {
-  struct font *font;
-  struct macfont_info *macfont_info;
-  FontRef macfont;
+  struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
+  struct macfont_info *macfont_info = (struct macfont_info *) font;
+  FontRef macfont = macfont_info->macfont;
   ptrdiff_t glyph_len, len, i, j;
   CFIndex nonbmp_len;
   UniChar *unichars;
@@ -2799,10 +2799,6 @@ macfont_shape (Lisp_Object lgstring)
   CFIndex used = 0;
   struct mac_glyph_layout *glyph_layouts;
 
-  CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
-  macfont_info = (struct macfont_info *) font;
-  macfont = macfont_info->macfont;
-
   glyph_len = LGSTRING_GLYPH_LEN (lgstring);
   nonbmp_len = 0;
   for (i = 0; i < glyph_len; i++)
diff --git a/src/process.c b/src/process.c
index 77c94f2..0789f20 100644
--- a/src/process.c
+++ b/src/process.c
@@ -422,6 +422,11 @@ pset_write_queue (struct Lisp_Process *p, Lisp_Object val)
 }
 
 
+static Lisp_Object
+make_lisp_proc (struct Lisp_Process *p)
+{
+  return make_lisp_ptr (p, Lisp_Vectorlike);
+}
 
 static struct fd_callback_data
 {
@@ -687,7 +692,15 @@ allocate_pty (char pty_name[PTY_NAME_SIZE])
 #endif /* HAVE_PTYS */
   return -1;
 }
-
+
+/* Allocate basically initialized process.  */
+
+static struct Lisp_Process *
+allocate_process (void)
+{
+  return ALLOCATE_ZEROED_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS);
+}
+
 static Lisp_Object
 make_process (Lisp_Object name)
 {
diff --git a/src/terminal.c b/src/terminal.c
index 92befd2..b48d062 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -254,6 +254,15 @@ get_named_terminal (const char *name)
   return NULL;
 }
 
+/* Allocate basically initialized terminal.  */
+
+static struct terminal *
+allocate_terminal (void)
+{
+  return ALLOCATE_ZEROED_PSEUDOVECTOR
+    (struct terminal, next_terminal, PVEC_TERMINAL);
+}
+
 /* Create a new terminal object of TYPE and add it to the terminal list.  RIF
    may be NULL if this terminal type doesn't support window-based redisplay.  
*/
 
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 2a7fe2e..9cd97e2 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -183,8 +183,9 @@ uniscribe_otf_capability (struct font *font)
 static Lisp_Object
 uniscribe_shape (Lisp_Object lgstring)
 {
-  struct font * font;
-  struct uniscribe_font_info * uniscribe_font;
+  struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
+  struct uniscribe_font_info *uniscribe_font
+    = (struct uniscribe_font_info *) font;
   EMACS_UINT nchars;
   int nitems, max_items, i, max_glyphs, done_glyphs;
   wchar_t *chars;
@@ -199,9 +200,6 @@ uniscribe_shape (Lisp_Object lgstring)
   HDC context = NULL;
   HFONT old_font = NULL;
 
-  CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
-  uniscribe_font = (struct uniscribe_font_info *) font;
-
   /* Get the chars from lgstring in a form we can use with uniscribe.  */
   max_glyphs = nchars = LGSTRING_GLYPH_LEN (lgstring);
   done_glyphs = 0;
diff --git a/src/window.c b/src/window.c
index 60ba375..d14a0f7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3645,7 +3645,16 @@ temp_output_buffer_show (register Lisp_Object buf)
       }
     }
 }
-
+
+/* Allocate basically initialized window.  */
+
+static struct window *
+allocate_window (void)
+{
+  return ALLOCATE_ZEROED_PSEUDOVECTOR
+    (struct window, current_matrix, PVEC_WINDOW);
+}
+
 /* Make new window, have it replace WINDOW in window-tree, and make
    WINDOW its only vertical child (HORFLAG 1 means make WINDOW its only
    horizontal child).   */
diff --git a/src/xdisp.c b/src/xdisp.c
index a375757..b38e8a6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12332,8 +12332,7 @@ DEFUN ("tool-bar-height", Ftool_bar_height, 
Stool_bar_height,
        0, 2, 0,
        doc: /* Return the number of lines occupied by the tool bar of FRAME.
 If FRAME is nil or omitted, use the selected frame.  Optional argument
-PIXELWISE non-nil means return the height of the tool bar in pixels.  */
-       attributes: const)
+PIXELWISE non-nil means return the height of the tool bar in pixels.  */)
   (Lisp_Object frame, Lisp_Object pixelwise)
 {
   int height = 0;
diff --git a/src/xftfont.c b/src/xftfont.c
index c587d81..054b38e 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -640,13 +640,11 @@ xftfont_draw (struct glyph_string *s, int from, int to, 
int x, int y,
 static Lisp_Object
 xftfont_shape (Lisp_Object lgstring)
 {
-  struct font *font;
-  struct xftfont_info *xftfont_info;
+  struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
+  struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
   FT_Face ft_face;
   Lisp_Object val;
 
-  CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
-  xftfont_info = (struct xftfont_info *) font;
   ft_face = XftLockFace (xftfont_info->xftfont);
   xftfont_info->ft_size = ft_face->size;
   val = ftfont_driver.shape (lgstring);
diff --git a/src/xmenu.c b/src/xmenu.c
index 9063a8a..fdf1f6f 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2288,7 +2288,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
 /* Detect if a dialog or menu has been posted.  MSDOS has its own
    implementation on msdos.c.  */
 
-int ATTRIBUTE_CONST
+int
 popup_activated (void)
 {
   return popup_activated_flag;
diff --git a/test/ChangeLog b/test/ChangeLog
index a33ec87..8ed02ee 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,19 @@
+2015-01-16  Jorgen Schaefer  <address@hidden>
+
+       * automated/package-test.el (package-test-install-prioritized):
+       New test.
+
+2015-01-15  Wolfgang Jenkner  <address@hidden>
+
+       * automated/calc-tests.el (calc-tests-equal, calc-tests-simple):
+       New functions.
+       (test-calc-remove-units, test-calc-extract-units)
+       (test-calc-convert-units): New tests.
+
+2015-01-15  Wolfgang Jenkner  <address@hidden>
+
+       * automated/Makefile.in (WRITE_LOG): Use POSIX redirection.
+
 2015-01-15  Stefan Monnier  <address@hidden>
 
        * automated/eieio-test-methodinvoke.el (eieio-test-method-store): Add
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in
index ed75781..7243e8a 100644
--- a/test/automated/Makefile.in
+++ b/test/automated/Makefile.in
@@ -64,7 +64,7 @@ all: check
 
 ## Ignore any test errors so we can continue to test other files.
 ## But compilation errors are always fatal.
-WRITE_LOG = >& $@ || { stat=ERROR; cat $@; }; echo $$stat: $@
+WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@
 
 ## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
 ## than || true, since the former makes problems more obvious.
diff --git a/test/automated/calc-tests.el b/test/automated/calc-tests.el
index 331e01e..d5252ea 100644
--- a/test/automated/calc-tests.el
+++ b/test/automated/calc-tests.el
@@ -27,6 +27,40 @@
 (require 'cl-lib)
 (require 'ert)
 (require 'calc)
+(require 'calc-ext)
+(require 'calc-units)
+
+;; XXX The order in which calc libraries (in particular calc-units)
+;; are loaded influences whether a calc integer in an expression
+;; involving units is represented as a lisp integer or a calc float,
+;; see bug#19582.  Until this will be fixed the following function can
+;; be used to compare such calc expressions.
+(defun calc-tests-equal (a b)
+  "Like `equal' but allow for different representations of numbers.
+For example: (calc-tests-equal 10 '(float 1 1)) => t.
+A and B should be calc expressions."
+  (cond ((math-numberp a)
+        (and (math-numberp b)
+             (math-equal a b)))
+       ((atom a)
+        (equal a b))
+       ((consp b)
+        ;; Can't be dotted or circular.
+        (and (= (length a) (length b))
+             (equal (car a) (car b))
+             (cl-every #'calc-tests-equal (cdr a) (cdr b))))))
+
+(defun calc-tests-simple (fun string &rest args)
+  "Push STRING on the calc stack, then call FUN and return the new top.
+The result is a calc (i.e., lisp) expression, not its string representation.
+Also pop the entire stack afterwards.
+An existing calc stack is reused, otherwise a new one is created."
+  (calc-eval string 'push)
+  (prog1
+      (ignore-errors
+       (apply fun args)
+       (calc-top-n 1))
+    (calc-pop 0)))
 
 (ert-deftest test-math-bignum ()
   ;; bug#17556
@@ -34,6 +68,24 @@
     (should (math-negp n))
     (should (cl-notany #'cl-minusp (cdr n)))))
 
+(ert-deftest test-calc-remove-units ()
+  (should (calc-tests-equal (calc-tests-simple #'calc-remove-units "-1 m") 
-1)))
+
+(ert-deftest test-calc-extract-units ()
+  (should (calc-tests-equal (calc-tests-simple #'calc-extract-units "-1 m")
+                           '(var m var-m)))
+  (should (calc-tests-equal (calc-tests-simple #'calc-extract-units "-1 m*cm")
+                           '(* (float 1 -2) (^ (var m var-m) 2)))))
+
+(ert-deftest test-calc-convert-units ()
+  ;; Used to ask for `(The expression is unitless when simplified) Old Units: 
'.
+  (should (calc-tests-equal (calc-tests-simple #'calc-convert-units "-1 m" nil 
"cm")
+                           '(* -100 (var cm var-cm))))
+  ;; Gave wrong result.
+  (should (calc-tests-equal (calc-tests-simple #'calc-convert-units "-1 m"
+                                              (math-read-expr "1m") "cm")
+                           '(* -100 (var cm var-cm)))))
+
 (provide 'calc-tests)
 ;;; calc-tests.el ends here
 
diff --git a/test/automated/package-test.el b/test/automated/package-test.el
index 27a71c5..c33a1ba 100644
--- a/test/automated/package-test.el
+++ b/test/automated/package-test.el
@@ -230,6 +230,23 @@ Must called from within a `tar-mode' buffer."
     (package-refresh-contents)
     (package-install 'simple-single)))
 
+(ert-deftest package-test-install-prioritized ()
+  "Install a lower version from a higher-prioritized archive."
+  (with-package-test ()
+    (let* ((newer-version (expand-file-name "data/package/newer-versions"
+                                            package-test-file-dir))
+           (package-archives `(("older" . ,package-test-data-dir)
+                               ("newer" . ,newer-version)))
+           (package-archive-priorities '(("newer" . 100))))
+
+      (package-initialize)
+      (package-refresh-contents)
+      (package-install 'simple-single)
+
+      (let ((installed (cadr (assq 'simple-single package-alist))))
+        (should (version-list-= '(1 3)
+                                (package-desc-version installed)))))))
+
 (ert-deftest package-test-install-multifile ()
   "Check properties of the installed multi-file package."
   (with-package-test (:basedir "data/package" :install '(multi-file))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]