Merge from trunk.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 26 Aug 2011 16:13:07 +0000 (09:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 26 Aug 2011 16:13:07 +0000 (09:13 -0700)
21 files changed:
ChangeLog
autogen/configure
configure.in
doc/emacs/ChangeLog
doc/emacs/Makefile.in
doc/emacs/custom.texi
doc/emacs/emacs.texi
doc/emacs/help.texi
doc/emacs/makefile.w32-in
doc/emacs/misc.texi
doc/emacs/package.texi [new file with mode: 0644]
doc/emacs/trouble.texi
etc/NEWS
lisp/ChangeLog
lisp/emacs-lisp/cl-loaddefs.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/package.el
lisp/gnus/ChangeLog
lisp/gnus/mailcap.el
src/ChangeLog
src/xdisp.c

index 55deca0..dd80379 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-08-26  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * configure.in: Add -MP to DEPFLAGS (Bug#9372).
+
 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
 
        * configure.in: Add header check: sys/socket.h (Bug#8477),
index 02fa5ab..5996e24 100755 (executable)
@@ -9112,7 +9112,7 @@ $as_echo "$HAVE_GNU_MAKE" >&6; }
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands -MMD -MF" >&5
 $as_echo_n "checking whether gcc understands -MMD -MF... " >&6; }
       SAVE_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -MMD -MF deps.d"
+      CFLAGS="$CFLAGS -MMD -MF deps.d -MP"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -9137,7 +9137,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 $as_echo "$ac_enable_autodepend" >&6; }
    fi
    if test $ac_enable_autodepend = yes; then
-      DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d'
+      DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d -MP'
       ## In parallel builds, another make might create depdir between
       ## the first test and mkdir, so stick another test on the end.
       ## Or use install-sh -d?  mkdir -p is not portable.
index cfb9dc8..f62f364 100644 (file)
@@ -1390,7 +1390,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
    if test $HAVE_GNU_MAKE = yes; then
       AC_MSG_CHECKING([whether gcc understands -MMD -MF])
       SAVE_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -MMD -MF deps.d"
+      CFLAGS="$CFLAGS -MMD -MF deps.d -MP"
       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no)
       CFLAGS="$SAVE_CFLAGS"
       test -f deps.d || ac_enable_autodepend=no
@@ -1398,7 +1398,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
       AC_MSG_RESULT([$ac_enable_autodepend])
    fi
    if test $ac_enable_autodepend = yes; then
-      DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d'
+      DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d -MP'
       ## In parallel builds, another make might create depdir between
       ## the first test and mkdir, so stick another test on the end.
       ## Or use install-sh -d?  mkdir -p is not portable.
index 9050efa..f74f06e 100644 (file)
@@ -1,3 +1,11 @@
+2011-08-26  Chong Yidong  <cyd@stupidchicken.com>
+
+       * package.texi: New file, documenting the package manager.
+
+       * emacs.texi: Include it.
+
+       * help.texi (Help Summary): Add describe-package.
+
 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
 
        * misc.texi (Printing): Convert subnodes into subsections.
index 9465c72..66cd7f1 100644 (file)
@@ -96,6 +96,7 @@ EMACSSOURCES= \
        ${srcdir}/dired.texi \
        ${srcdir}/calendar.texi \
        ${srcdir}/misc.texi \
+       ${srcdir}/package.texi \
        ${srcdir}/custom.texi \
        ${srcdir}/trouble.texi \
        ${srcdir}/cmdargs.texi \
index 6a6d465..a22d6c1 100644 (file)
@@ -2,7 +2,7 @@
 @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
 @c   Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Customization, Quitting, Amusements, Top
+@node Customization
 @chapter Customization
 @cindex customization
 
index 24a7e6d..060f939 100644 (file)
@@ -212,6 +212,7 @@ Advanced Features
 * Emulation::           Emulating some other editors with Emacs.
 * Hyperlinking::        Following links in buffers.
 * Amusements::          Various games and hacks.
+* Packages::            Installing additional features.
 * Customization::       Modifying the behavior of Emacs.
 
 Recovery from Problems
@@ -1497,6 +1498,7 @@ Lisp programming.
 @include rmail.texi
 @c Includes picture-xtra.texi
 @include misc.texi
+@include package.texi
 @include custom.texi
 @include trouble.texi
 
index 9a75bfb..bf93892 100644 (file)
@@ -126,16 +126,20 @@ The complete Emacs manual is available on-line in Info.
 Display the name and documentation of the command that @var{key} runs
 (@code{describe-key}).
 @item C-h l
-Display a description of your last 300 keystrokes 
+Display a description of your last 300 keystrokes
 (@code{view-lossage}).
 @item C-h m
 Display documentation of the current major mode (@code{describe-mode}).
 @item C-h n
 Display news of recent Emacs changes (@code{view-emacs-news}).
 @item C-h p
-Find packages by topic keyword (@code{finder-by-keyword}).  For an
-alternative interface to the same information, try the @code{info-finder}
-command.
+Find packages by topic keyword (@code{finder-by-keyword}).  This lists
+packages using a package menu buffer (@pxref{Package Menu}); for an
+alternative interface to the same information, try the
+@code{info-finder} command.
+@item C-h P @var{package} @key{RET}
+Display documentation about the package named @var{package}
+(@code{describe-package}; @pxref{Packages}).
 @item C-h r
 Display the Emacs manual in Info (@code{info-emacs-manual}).
 @item C-h s
index 4064f4e..e128a50 100644 (file)
@@ -88,6 +88,7 @@ EMACSSOURCES= \
        $(srcdir)/dired.texi \
        $(srcdir)/calendar.texi \
        $(srcdir)/misc.texi \
+       $(srcdir)/package.texi \
        $(srcdir)/custom.texi \
        $(srcdir)/trouble.texi \
        $(srcdir)/cmdargs.texi \
index e43a8ad..2dab70c 100644 (file)
@@ -2513,7 +2513,7 @@ Display a menu of files and URLs mentioned in current buffer, then
 find the one you select (@code{ffap-menu}).
 @end table
 
-@node Amusements, Customization, Hyperlinking, Top
+@node Amusements, Packages, Hyperlinking, Top
 @section Other Amusements
 @cindex boredom
 
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
new file mode 100644 (file)
index 0000000..739a8ce
--- /dev/null
@@ -0,0 +1,230 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
+@c   Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@node Packages
+@chapter Emacs Lisp Packages
+@cindex Package
+@cindex Emacs Lisp package archive
+@cindex Package archive
+@cindex Emacs Lisp package
+
+Emacs includes a facility that lets you easily download and install
+@dfn{packages} that implement additional features.  Each package is a
+separate Emacs Lisp program, sometimes including other components such
+as an Info manual.
+
+  @kbd{M-x list-packages} brings up a buffer named @samp{*Packages*}
+with a list of all packages.  You can install or uninstall packages
+via this buffer.  @xref{Package Menu}.
+
+@findex describe-package
+  The command @kbd{C-h P} (@code{describe-package}) prompts for the
+name of a package, and displays a help buffer describing that
+attributes of the package and the features that it implements.
+
+  By default, Emacs downloads packages from a @dfn{package archive}
+maintained by the Emacs developers and hosted by the GNU project.
+Optionally, you can also download packages from archives maintained by
+third parties.  @xref{Package Installation}.
+
+  For information about turning an Emacs Lisp program into an
+installable package, @xref{Packaging,,,elisp, The Emacs Lisp Reference
+Manual}.  For information about finding third-party packages and other
+Emacs Lisp extensions, @xref{Packages that do not come with
+Emacs,,,efaq, GNU Emacs FAQ}.
+
+@menu
+* Package Menu::         Buffer for viewing and managing packages.
+* Package Installation:: Options for package installation.
+* Package Files::        Where packages are installed.
+@end menu
+
+@node Package Menu
+@section The Package Menu Buffer
+@cindex package menu
+@cindex built-in package
+@findex list-packages
+
+The command @kbd{M-x list-packages} brings up the @dfn{package menu}.
+This is a buffer listing all the packages that Emacs knows about, one
+on each line, with the following information:
+
+@itemize @bullet
+@item
+The package name (e.g. @samp{auctex}).
+
+@item
+The package's version number (e.g. @samp{11.86}).
+
+@item
+The package's status---normally one of @samp{available} (can be
+downloaded from the package archive), @samp{installed}, or
+@samp{built-in} (included in Emacs by default).
+
+In some instances, the status can be @samp{held}, @samp{disabled}, or
+@samp{obsolete}.  @xref{Package Installation}.
+
+@item
+A short description of the package.
+@end itemize
+
+@noindent
+The @code{list-packages} command accesses the network, to retrieve the
+list of available packages from the package archive server.  If the
+network is unavailable, it falls back on the most recently retrieved
+list.
+
+The following commands are available in the package menu:
+
+@table @kbd
+@item h
+Print a short message summarizing how to use the package menu
+(@code{package-menu-quick-help}).
+
+@item ?
+@itemx @key{RET}
+Display a help buffer for the package on the current line
+(@code{package-menu-describe-package}), similar to the help window
+displayed by the @kbd{C-h P} command (@pxref{Packages}).
+
+@item i
+Mark the package on the current line for installation
+(@code{package-menu-mark-install}).  If the package status is
+@samp{available}, this adds an @samp{I} character to the start of the
+line; typing @kbd{x} (see below) will download and install the
+package.
+
+@item d
+Mark the package on the current line for deletion
+(@code{package-menu-mark-delete}).  If the package status is
+@samp{installed}, this adds a @samp{D} character to the start of the
+line; typing @kbd{x} (see below) will delete the package.
+@xref{Package Files}, for information about what package deletion
+entails.
+
+@item u
+Remove any installation or deletion mark previously added to the
+current line by an @kbd{i} or @kbd{d} command.
+
+@item x
+Download and install all packages marked with @kbd{i}, and their
+dependencies; also, delete all packages marked with @kbd{d}
+(@code{package-menu-execute}).  This also removes the marks.
+
+@item r
+Refresh the package list (@code{package-menu-refresh}).  This also
+retrieves the list of available packages from the package archive
+again.
+@end table
+
+@noindent
+For example, you can install a package by typing @kbd{i} on the line
+listing that package, followed by @kbd{x}.
+
+@node Package Installation
+@section Package Installation
+
+@findex package-install
+  Packages are most conveniently installed using the package menu
+(@pxref{Package Menu}), but you can also use the command @kbd{M-x
+package-install}.  This prompts for the name of a package with the
+@samp{available} status, then downloads and installs it.
+
+@cindex package requirements
+  A package may @dfn{require} certain other packages to be installed,
+because it relies on functionality provided by them.  When Emacs
+installs such a package, it also automatically downloads and installs
+any required package that is not already installed.  (If a required
+package is somehow unavailable, Emacs signals an error and stops
+installation.)  A package's requirements list is shown in its help
+buffer.
+
+@vindex package-archives
+  By default, packages are downloaded from a single package archive
+maintained by the Emacs developers.  This is controlled by the
+variable @code{package-archives}, whose value is a list of package
+archives known to Emacs.  Each list element must have the form
+@code{(@var{id} . @var{location})}, where @var{id} is the name of a
+package archive and @var{location} is the @acronym{HTTP} address or
+directory name of the package archive.  You can alter this list if you
+wish to use third party package archives---but do so at your own risk,
+and use only third parties that you think you can trust!
+
+  Once a package is downloaded and installed, it takes effect in the
+current Emacs session.  What ``taking effect'' means depends on the
+package; most packages just make some new commands available, while
+others have more wide-ranging effects on the Emacs session.  For such
+information, consult the package's help buffer.
+
+  By default, Emacs also automatically loads all installed packages
+(causing them to ``take effect'') in subsequent Emacs sessions.  This
+happens at startup, after processing the init file (@pxref{Init
+File}).  As an exception, Emacs does not load packages at startup if
+invoked with the @samp{-q} or @samp{--no-init-file} options
+(@pxref{Initial Options}).
+
+@vindex package-enable-at-startup
+@findex package-initialize
+  To disable automatic package loading, change the variable
+@code{package-enable-at-startup} to @code{nil}.  If you do this, you
+can use the command @kbd{M-x package-initialize} to load your
+packages.
+
+@vindex package-load-list
+  For finer control over package loading, you can use the variable
+@code{package-load-list}.  Its value should be a list.  A list element
+of the form @code{(@var{name} @var{version})} tells Emacs to load
+version @var{version} of the package named @var{name}.  Here,
+@var{version} should be a version string (corresponding to a specific
+version of the package), or @code{t} (which means to load any
+installed version), or @code{nil} (which means no version; this
+``disables'' the package, preventing it from being loaded).  A list
+element can also be the symbol @code{all}, which means to load the
+latest installed version of any package not named by the other list
+elements.  The default value is just @code{'(all)}.
+
+  For example, if you set @code{package-load-list} to @code{'((muse
+"3.20") all)}, then Emacs only loads version 3.20 of the @samp{muse}
+package, plus any installed version of packages other than
+@samp{muse}.  Any other version of @samp{muse} that happens to be
+installed will be ignored.  The @samp{muse} package will be listed in
+the package menu with the @samp{held} status.
+
+@node Package Files
+@section Package Files and Directory Layout
+@cindex package directory
+
+@cindex package file
+@findex package-install-file
+  Each package is downloaded from the package archive in the form of a
+single @dfn{package file}---either an Emacs Lisp source file, or a tar
+file containing multiple Emacs Lisp source and other files.  Package
+files are automatically retrieved, processed, and disposed of by the
+Emacs commands that install packages.  Normally, you will not need to
+deal directly with them, unless you are making a package
+(@pxref{Packaging,,,elisp, The Emacs Lisp Reference Manual}).  Should
+you ever need to install a package directly from a package file, use
+the command @kbd{M-x package-install-file}.
+
+@vindex package-user-dir
+  Once installed, the contents of a package are placed in a
+subdirectory of @file{~/.emacs.d/elpa/} (you can change the name of
+that directory by changing the variable @code{package-user-dir}).  The
+package subdirectory is named @file{@var{name}-@var{version}}, where
+@var{name} is the package name and @var{version} is its version
+string.
+
+@cindex system-wide packages
+@vindex package-directory-list
+  In addition to @code{package-user-dir}, Emacs looks for installed
+packages in the directories listed in @code{package-directory-list}.
+These directories are meant for system administrators to make Emacs
+packages available system-wide; Emacs itself never installs packages
+there.  The package subdirectories for @code{package-directory-list}
+are laid out in the same way as in @code{package-user-dir}.
+
+  Deleting a package (@pxref{Package Menu}) involves deleting the
+corresponding package subdirectory.  This only works for packages
+installed in @code{package-user-dir}; if told to act on a package in a
+system-wide package directory, the deletion command signals an error.
index 4be8926..fd06dde 100644 (file)
@@ -15,7 +15,7 @@ also considered.
 @raisesections
 @end ifnottex
 
-@node Quitting, Lossage, Customization, Top
+@node Quitting
 @section Quitting and Aborting
 @cindex quitting
 
index cec19d0..841b11b 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -319,11 +319,14 @@ for `list-colors-display'.
 This is a convenient way to download and install additional packages,
 from a package repository at elpa.gnu.org.
 
++++
 *** `M-x list-packages' shows a list of packages, which can be
 selected for installation.
 
++++
 *** New command `describe-package', bound to `C-h P'.
 
++++
 *** By default, all installed packages are loaded and activated
 automatically when Emacs starts up.  To disable this, set
 `package-enable-at-startup' to nil.  To change which packages are
index b922e21..e3fe514 100644 (file)
@@ -1,3 +1,12 @@
+2011-08-26  Chong Yidong  <cyd@stupidchicken.com>
+
+       * emacs-lisp/package.el (package-install): Call package-initialize
+       if called interactively.
+
+2011-08-26  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/cl-macs.el (defstruct): Fix format.  (Bug#9357)
+
 2011-08-25  Juri Linkov  <juri@jurta.org>
 
        * isearch.el (isearch-occur): Let-bind `search-spaces-regexp' to
index 7beb4d4..d651230 100644 (file)
@@ -282,7 +282,7 @@ Not documented
 ;;;;;;  flet progv psetq do-all-symbols do-symbols dotimes dolist
 ;;;;;;  do* do loop return-from return block etypecase typecase ecase
 ;;;;;;  case load-time-value eval-when destructuring-bind function*
-;;;;;;  defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "0907093f7720996444ededb4edfe8072")
+;;;;;;  defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "cc8cbd8c86e2facbe61986e992e6c508")
 ;;; Generated autoloads from cl-macs.el
 
 (autoload 'gensym "cl-macs" "\
index fb19115..d9531cc 100644 (file)
@@ -2416,9 +2416,8 @@ value, that slot cannot be set via `setf'.
                        (append
                         (and pred-check
                              (list (list 'or pred-check
-                                         (list 'error
-                                               (format "%s accessing a non-%s"
-                                                       accessor name)))))
+                                         `(error "%s accessing a non-%s"
+                                                 ',accessor ',name))))
                         (list (if (eq type 'vector) (list 'aref 'cl-x pos)
                                 (if (= pos 0) '(car cl-x)
                                   (list 'nth pos 'cl-x)))))) forms)
@@ -2426,9 +2425,8 @@ value, that slot cannot be set via `setf'.
              (push (list 'define-setf-method accessor '(cl-x)
                             (if (cadr (memq :read-only (cddr desc)))
                                  (list 'progn '(ignore cl-x)
-                                       (list 'error
-                                             (format "%s is a read-only slot"
-                                                     'accessor)))
+                                       `(error "%s is a read-only slot"
+                                              ',accessor))
                               ;; If cl is loaded only for compilation,
                               ;; the call to cl-struct-setf-expander would
                               ;; cause a warning because it may not be
index 19e8375..8828260 100644 (file)
@@ -852,18 +852,26 @@ using `package-compute-transaction'."
        (t
        (error "Unknown package kind: %s" (symbol-name kind)))))))
 
+(defvar package--initialized nil)
+
 ;;;###autoload
 (defun package-install (name)
   "Install the package named NAME.
-Interactively, prompt for the package name.
-The package is found on one of the archives in `package-archives'."
+NAME should be the name of one of the available packages in an
+archive in `package-archives'.  Interactively, prompt for NAME."
   (interactive
-   (list (intern (completing-read "Install package: "
-                                 (mapcar (lambda (elt)
-                                           (cons (symbol-name (car elt))
-                                                 nil))
-                                         package-archive-contents)
-                                 nil t))))
+   (progn
+     ;; Initialize the package system to get the list of package
+     ;; symbols for completion.
+     (unless package--initialized
+       (package-initialize t))
+     (list (intern (completing-read
+                   "Install package: "
+                   (mapcar (lambda (elt)
+                             (cons (symbol-name (car elt))
+                                   nil))
+                           package-archive-contents)
+                   nil t)))))
   (let ((pkg-desc (assq name package-archive-contents)))
     (unless pkg-desc
       (error "Package `%s' is not available for installation"
@@ -1076,8 +1084,6 @@ makes them available for download."
                      (car archive)))))
   (package-read-all-archive-contents))
 
-(defvar package--initialized nil)
-
 ;;;###autoload
 (defun package-initialize (&optional no-activate)
   "Load Emacs Lisp packages, and activate them.
index 076afdd..5c8b433 100644 (file)
@@ -1,5 +1,7 @@
 2011-08-26  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * mailcap.el (mailcap-mime-data): Regexp-quote MIME subtype.
+
        * gnus-msg.el (gnus-setup-message): Remove extra apostrophe.
 
 2011-08-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
index dffb279..7959104 100644 (file)
@@ -90,7 +90,7 @@ This is a compatibility function for different Emacsen."
 ;; files for the rest?  -- fx
 (defvar mailcap-mime-data
   `(("application"
-     ("vnd.ms-excel"
+     ("vnd\\.ms-excel"
       (viewer . "gnumeric %s")
       (test   . (getenv "DISPLAY"))
       (type . "application/vnd.ms-excel"))
index b5ba1d7..bb2a0d2 100644 (file)
@@ -1,4 +1,4 @@
-2011-08-25  Paul Eggert  <eggert@cs.ucla.edu>
+2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Integer and memory overflow issues (Bug#9196).
 
        (gs_load): Use printmax_t to print the widest integers possible.
        Check for integer overflow when computing image height and width.
 
+2011-08-26  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (redisplay_window): Don't force window start if point
+       will be invisible in the resulting window.  (Bug#9324)
+
 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
index 5f7020b..b60e3b4 100644 (file)
@@ -15097,6 +15097,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
               || (XFASTINT (w->last_modified) >= MODIFF
                   && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF)))
     {
+      int d1, d2, d3, d4, d5, d6;
 
       /* If first window line is a continuation line, and window start
         is inside the modified region, but the first change is before
@@ -15118,7 +15119,14 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
             compute_window_start_on_continuation_line.  (See also
             bug#197).  */
          && XMARKER (w->start)->buffer == current_buffer
-         && compute_window_start_on_continuation_line (w))
+         && compute_window_start_on_continuation_line (w)
+         /* It doesn't make sense to force the window start like we
+            do at label force_start if it is already known that point
+            will not be visible in the resulting window, because
+            doing so will move point from its correct position
+            instead of scrolling the window to bring point into view.
+            See bug#9324.  */
+         && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6))
        {
          w->force_start = Qt;
          SET_TEXT_POS_FROM_MARKER (startp, w->start);