]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs-24; up to 2014-05-04T21:18:30Z!eggert@cs.ucla.edu
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 May 2014 19:37:56 +0000 (12:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 May 2014 19:37:56 +0000 (12:37 -0700)
46 files changed:
ChangeLog
admin/make-tarball.txt
configure.ac
doc/emacs/ChangeLog
doc/emacs/trouble.texi
doc/misc/ChangeLog
doc/misc/autotype.texi
doc/misc/message.texi
doc/misc/semantic.texi
doc/misc/todo-mode.texi
lib-src/ChangeLog
lib-src/emacsclient.c
lisp/ChangeLog
lisp/allout-widgets.el
lisp/calendar/todo-mode.el
lisp/cedet/ChangeLog
lisp/cedet/ede.el
lisp/cedet/semantic/bovine/c.el
lisp/cedet/semantic/ia-sb.el
lisp/cedet/semantic/tag.el
lisp/emacs-lisp/cl-macs.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-registry.el
lisp/mail/rmailsum.el
lisp/menu-bar.el
lisp/minibuffer.el
lisp/mpc.el
lisp/progmodes/gdb-mi.el
lisp/progmodes/js.el
lisp/progmodes/prolog.el
lisp/progmodes/sh-script.el
lisp/progmodes/verilog-mode.el
lisp/textmodes/reftex-parse.el
lisp/url/ChangeLog
lisp/url/url-parse.el
lisp/vc/ediff-diff.el
lisp/vc/ediff-init.el
lisp/vc/ediff-util.el
src/ChangeLog
src/buffer.c
src/floatfns.c
src/intervals.c
src/process.c
src/profiler.c
src/syswait.h
src/term.c

index 35b690d75e406f55bbf59a72aa1face096ee9349..bcc44003df9e56013d24d0f1fc0ef43f7127cd46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Require ImageMagick >= 6.3.5, due to PixelSetMagickColor (Bug#17339).
+       * configure.ac (IMAGEMAGICK_MODULE): Bump prereq from 6.2.8 to 6.3.5.
+       A more-complicated fix would be to remove uses of PixelSetMagickColor,
+       introduced in ImageMagick 6.3.5 (Sept. 2007).
+
+2014-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac (LIBPNG): Consult libpng-config for the precise
+       form of "-lpng" to use.  (Bug#17339)
+
 2014-05-03  Glenn Morris  <rgm@gnu.org>
 
        * autogen.sh: If all else fails, try using pkg-config to find pkg.m4.
index 50183f75561094c78f302d618420b5cf25f234dc..a2e8a9e7da3f8ec1c1c324d2384593022a50bb14 100644 (file)
@@ -5,6 +5,11 @@ Instructions to create pretest or release tarballs. -*- coding: utf-8 -*-
 
 Steps to take before starting on the first pretest in any release sequence:
 
+0.  The release branch (e.g. emacs-24) should already have been made
+    and you should use it for all that follows.  Diffs from this
+    branch should be going to the emacs-diffs mailing list (see
+    admin/notes/bzr section on bzr-email plugin).
+
 1.  Decide on versions of automake and autoconf, and ensure you will
     have them available for the duration of the release process.
 
@@ -14,17 +19,15 @@ Steps to take before starting on the first pretest in any release sequence:
     when preparing the first pretest for a major Emacs release.)
     Commit cus-edit.el if changed.
 
+3.  Remove any old pretests from ftp://alpha.gnu.org/gnu/emacs/pretest.
+    You can use `gnupload --delete' (see below for more gnupload details).
 
 General steps (for each step, check for possible errors):
 
 1.  `bzr update' (for a bound branch), or `bzr pull'.
      bzr status   # check for locally modified files
 
-2.  Bootstrap to make 100% sure all elc files are up-to-date, and to
-    make sure that the later tagged version will bootstrap, should it be
-    necessary to check it out.
-
-3.  Regenerate the etc/AUTHORS file:
+2.  Regenerate the etc/AUTHORS file:
       M-: (require 'authors) RET
       M-x authors RET
 
@@ -39,7 +42,7 @@ General steps (for each step, check for possible errors):
     authors-ambiguous-files or authors-aliases, and repeat.
     Commit any fixes to ChangeLogs or authors.el.
 
-4.  Set the version number (M-x load-file RET admin/admin.el RET, then
+3.  Set the version number (M-x load-file RET admin/admin.el RET, then
     M-x set-version RET).  For a release, add released ChangeLog
     entries (M-x add-release-logs RET).
 
@@ -54,31 +57,37 @@ General steps (for each step, check for possible errors):
     emacs-XX.Y-rc1.tar.  If all goes well in the following week, you
     can simply rename the file and use it for the actual release.
 
-5.   autoreconf -i -I m4 --force
+4.   autoreconf -i -I m4 --force
      make bootstrap
 
      make -C etc/refcards
      make -C etc/refcards clean
 
-6.  Copy lisp/loaddefs.el to lisp/ldefs-boot.el.
+5.  Copy lisp/loaddefs.el to lisp/ldefs-boot.el.
 
     Commit etc/AUTHORS, lisp/ldefs-boot.el, and the files changed
-    by M-x set-version.
+    by M-x set-version.  Use a commit log message that bzrmerge.el
+    will ignore (eg "Bump version...").
     For a release, also commit the ChangeLog files in all directories.
 
-7.  ./make-dist --snapshot --no-compress
+    If someone else made a commit between step 1 and now,
+    you need to repeat from step 4 onwards.  (You can commit the files
+    from step 2 and 3 earlier to reduce the chance of this.)
+
+6.  ./make-dist --snapshot --no-compress
 
-    Check the contents of the new tar with
-    admin/diff-tar-files against an older tar file.  Some old pretest
-    tarballs may be found at <ftp://alpha.gnu.org/gnu/emacs/pretest>;
-    old release tarballs are at <ftp://ftp.gnu.org/pub/gnu/emacs/>.
+    Check the contents of the new tar with admin/diff-tar-files
+    against the previous release (if this is the first pretest) or the
+    previous pretest.  If you did not make the previous pretest
+    yourself, find it at <ftp://alpha.gnu.org/gnu/emacs/pretest>.
+    Releases are of course at <ftp://ftp.gnu.org/pub/gnu/emacs/>.
 
     If this is the first pretest of a major release, just comparing
     with the previous release may overlook many new files.  You can try
     something like `find . | sort' in a clean bzr tree, and compare the
     results against the new tar contents.
 
-8.   tar -xf emacs-NEW.tar; cd emacs-NEW
+7.   tar -xf emacs-NEW.tar; cd emacs-NEW
      ./configure --prefix=/tmp/emacs && make && make install
     Use `script' or M-x compile to save the compilation log in
     compile-NEW.log and compare it against an old one.  The easiest way
@@ -87,25 +96,21 @@ General steps (for each step, check for possible errors):
     M-x ediff.  Especially check that Info files aren't built, and that
     no autotools (autoconf etc) run.
 
-9.  cd EMACS_ROOT_DIR && bzr tag TAG
+8.  cd EMACS_ROOT_DIR && bzr tag TAG
     TAG is emacs-XX.Y.ZZ for a pretest, emacs-XX.Y for a release.
 
-    Shortly before the release, cut the version branch also, and open
-    a Savannah support request asking for commits to the new branch to
-    be sent to the emacs-diffs mailing list (by default, the list
-    normally only gets commits to the trunk).
-
-10. Decide what compression schemes to offer.
+9. Decide what compression schemes to offer.
     For a release, at least gz and xz:
       gzip --best -c emacs-NEW.tar > emacs-NEW.tar.gz
       xz -c emacs-NEW.tar > emacs-NEW.tar.xz
+    For pretests, just xz is probably fine (saves bandwidth).
 
     Now you should upload the files to the GNU ftp server.  In order to
     do that, you must be registered as an Emacs maintainer and have your
     GPG key acknowledged by the ftp people.  For instructions, see
     http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html
-    The simplest method is to use the gnulib <http://www.gnu.org/s/gnulib/>
-    script "build-aux/gnupload" to upload each FILE, like this:
+    The simplest method to upload is to use the gnulib
+    <http://www.gnu.org/s/gnulib/> script "build-aux/gnupload":
 
     For a pretest:
      gnupload [--user your@gpg.key.email] --to alpha.gnu.org:emacs/pretest \
@@ -136,19 +141,21 @@ General steps (for each step, check for possible errors):
     For a pretest, place the files in /incoming/alpha instead, so that
     they appear on ftp://alpha.gnu.org/.
 
-11. After five minutes, verify that the files are visible at
+10. After five minutes, verify that the files are visible at
     ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, or
     ftp://ftp.gnu.org/gnu/emacs/ for a release.
 
     Download them and check the signatures.  Check they build.
 
-12. For a pretest, announce it on emacs-devel and info-gnu-emacs@gnu.org.
-    Probably should also include the platform-testers list:
-    https://lists.gnu.org/mailman/listinfo/platform-testers
-    For a release, also announce it on info-gnu@gnu.org.  (Probably
-    bcc the info- addresses to make it less likely that people will
-    followup on those lists.)
-
-13. For a release, update the Emacs homepage in the web repository.
-    Also add the new NEWS file as NEWS.xx.y.
-    Maybe regenerate the html manuals, update the FAQ, etc, etc.
+11. Send an announcement to: emacs-devel, and bcc: info-gnu-emacs@gnu.org.
+    For a pretest, also bcc: platform-testers@gnu.org.
+    (The reason for using bcc: is to make it less likely that people
+    will followup on the wrong list.)
+    See the info-gnu-emacs mailing list archives for the form
+    of past announcements.  The first pretest announcement, and the
+    release announcement, should have more detail.
+
+12. For a release, update the Emacs homepage in the web repository.
+    Also update history.html, and add the new NEWS file as NEWS.xx.y.
+    Regenerate the html manuals (use make-manuals from admin.el).
+    If there are new manuals, add appropriate index pages.
index 7545e14e15df29a01b1b391e0af44c33f9b38eb1..47bb458a7675f97ae2882e0b50600a055db1b9b1 100644 (file)
@@ -2175,11 +2175,9 @@ fi
 HAVE_IMAGEMAGICK=no
 if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" = "yes"; then
   if test "${with_imagemagick}" != "no"; then
-    ## 6.2.8 is the earliest version known to work, but earlier versions
-    ## might work - let us know if you find one.
-    ## 6.0.7 does not work.  See bug#7955.
+    ## 6.3.5 is the earliest version known to work; see Bug#17339.
     ## 6.8.2 makes Emacs crash; see Bug#13867.
-    IMAGEMAGICK_MODULE="Wand >= 6.2.8 Wand != 6.8.2"
+    IMAGEMAGICK_MODULE="Wand >= 6.3.5 Wand != 6.8.2"
     EMACS_CHECK_MODULES([IMAGEMAGICK], [$IMAGEMAGICK_MODULE])
     AC_SUBST(IMAGEMAGICK_CFLAGS)
     AC_SUBST(IMAGEMAGICK_LIBS)
@@ -3051,8 +3049,15 @@ elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
   fi
 
   if test "${HAVE_PNG}" = "yes"; then
-    AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
-    LIBPNG="-lpng -lz -lm"
+    AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library.])
+
+    dnl Some systems, eg NetBSD 6, only provide eg "libpng16", not "libpng".
+    lpng=`libpng-config --libs 2> /dev/null`
+    case $lpng in
+      -l*) : ;;
+      *) lpng="-lpng" ;;
+    esac
+    LIBPNG="$lpng -lz -lm"
 
     AC_CHECK_DECL(png_longjmp,
       [],
@@ -4908,7 +4913,7 @@ echo "  Does Emacs use -lXpm?                                   ${HAVE_XPM}"
 echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
 echo "  Does Emacs use -ltiff?                                  ${HAVE_TIFF}"
 echo "  Does Emacs use a gif library?                           ${HAVE_GIF} $LIBGIF"
-echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
+echo "  Does Emacs use a png library?                           ${HAVE_PNG} $LIBPNG"
 echo "  Does Emacs use -lrsvg-2?                                ${HAVE_RSVG}"
 echo "  Does Emacs use imagemagick?                             ${HAVE_IMAGEMAGICK}"
 
index 46eee3c31a95af15d2cafed18452d681ca163fc0..7bcd720203fc097637e6a587690f604d8f2aeacc 100644 (file)
@@ -1,3 +1,10 @@
+2014-05-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * trouble.texi (Lossage, DEL Does Not Delete, Stuck Recursive)
+       (Screen Garbled, Text Garbled, After a Crash, Emergency Escape)
+       (Bug Criteria, Understanding Bug Reporting, Checklist, Service):
+       Improve indexing.
+
 2014-05-04  Leo Liu  <sdl.web@gmail.com>
 
        * cal-xtra.texi (Non-Gregorian Diary): Document new features for
index bf7c6175dcb89cb3467cef334f1714beaf01c6f1..f0cbbcc57217adf655696636098e6eca951b4fca 100644 (file)
@@ -135,6 +135,7 @@ facility.
 
 @node Lossage
 @section Dealing with Emacs Trouble
+@cindex troubleshooting Emacs
 
   This section describes how to recognize and deal with situations in
 which Emacs does not work as you expect, such as keyboard code mixups,
@@ -158,6 +159,7 @@ Emacs.
 @subsection If @key{DEL} Fails to Delete
 @cindex @key{DEL} vs @key{BACKSPACE}
 @cindex @key{BACKSPACE} vs @key{DEL}
+@cindex @key{DEL} does not delete
 
   Every keyboard has a large key, usually labeled @key{BACKSPACE},
 which is ordinarily used to erase the last character that you typed.
@@ -212,6 +214,8 @@ Customization}.
 
 @node Stuck Recursive
 @subsection Recursive Editing Levels
+@cindex stuck in recursive editing
+@cindex recursive editing, cannot exit
 
   Recursive editing levels are important and useful features of Emacs, but
 they can seem like malfunctions if you do not understand them.
@@ -225,6 +229,9 @@ top-level}.  @xref{Recursive Edit}.
 
 @node Screen Garbled
 @subsection Garbage on the Screen
+@cindex garbled display
+@cindex display, incorrect
+@cindex screen display, wrong
 
   If the text on a text terminal looks wrong, the first thing to do is
 see whether it is wrong in the buffer.  Type @kbd{C-l} to redisplay
@@ -242,6 +249,8 @@ bug in Emacs that appears for certain terminal types.
 
 @node Text Garbled
 @subsection Garbage in the Text
+@cindex garbled text
+@cindex buffer text garbled
 
   If @kbd{C-l} shows that the text is wrong, first type @kbd{C-h l} to
 see what commands you typed to produce the observed results.  Then try
@@ -348,6 +357,7 @@ enable them by running the shell command @samp{ulimit -c unlimited}
 
 @node After a Crash
 @subsection Recovery After a Crash
+@cindex recovering crashed session
 
   If Emacs or the computer crashes, you can recover the files you were
 editing at the time of the crash from their auto-save files.  To do
@@ -394,6 +404,7 @@ not make a backup of its old contents.
 
 @node Emergency Escape
 @subsection Emergency Escape
+@cindex emergency escape
 
   On text terminals, the @dfn{emergency escape} feature suspends Emacs
 immediately if you type @kbd{C-g} a second time before Emacs can
@@ -528,6 +539,8 @@ not feel obliged to read this list before reporting a bug.
 
 @node Bug Criteria
 @subsection When Is There a Bug
+@cindex bug criteria
+@cindex what constitutes an Emacs bug
 
   If Emacs accesses an invalid memory location (``segmentation
 fault''), or exits with an operating system error message that
@@ -580,6 +593,8 @@ with the manual, one of them must be wrong; that is a bug.
 
 @node Understanding Bug Reporting
 @subsection Understanding Bug Reporting
+@cindex bug reporting
+@cindex report an Emacs bug, how to
 
 @findex emacs-version
   When you decide that there is a bug, it is important to report it
@@ -636,8 +651,8 @@ separate bug report for each.
 
 @node Checklist
 @subsection Checklist for Bug Reports
-
-@cindex reporting bugs
+@cindex checklist before reporting a bug
+@cindex bug reporting, checklist
 
   Before reporting a bug, first try to see if the problem has already
 been reported (@pxref{Known Problems}).
@@ -1192,6 +1207,9 @@ file in the Emacs distribution.
 
 @node Service
 @section How To Get Help with GNU Emacs
+@cindex help in using Emacs
+@cindex help-gnu-emacs mailing list
+@cindex gnu.emacs.help newsgroup
 
 If you need help installing, using or changing GNU Emacs, there are two
 ways to find it:
index 318b92fbe7e17c9c8896b499690c550d4a78428c..cdaa6b4fb34f109958e9dcb0ee58c845a48c270b 100644 (file)
@@ -1,3 +1,15 @@
+2014-05-04  Stephen Berman  <stephen.berman@gmx.net>
+
+       * todo-mode.texi: Update, improve exposition, add cross
+       references, fix typos.
+       (Inserting New Items, Editing Item Headers and Text): Rewrite to
+       document new user interface.
+
+2014-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * autotype.texi (Skeleton Language):
+       * message.texi (Header Commands): Replace `iff'.
+
 2014-05-02  Paul Eggert  <eggert@cs.ucla.edu>
 
        * vhdl-mode.texi: Add "@documentencoding UTF-8",
index ae3fa0e58703862fef3c4fa53c3c61d394343d76..e01a6c2f5c55be83b0d6b4fa6eb5ae38f3a64ce5 100644 (file)
@@ -241,10 +241,10 @@ put at these places.  Point is left at first @code{_} where nothing is wrapped.
 Indent line according to major mode.  When following element is @code{_}, and
 there is a interregion that will be wrapped here, indent that interregion.
 @item @code{&}
-Logical and.  Iff preceding element moved point, i.e., usually inserted
+Logical and.  If preceding element moved point, i.e., usually inserted
 something, do following element.
 @item @code{|}
-Logical xor.  Iff preceding element didn't move point, i.e., usually inserted
+Logical xor.  If preceding element didn't move point, i.e., usually inserted
 nothing, do following element.
 @item @code{-@var{number}}
 Delete preceding number characters.  Depends on value of
index 6d5a00ba819e70a3ea7bf7c24c4b7d341d30d78b..14ba46c70f5448b7a38e1467c65bf1e58193c73f 100644 (file)
@@ -748,9 +748,8 @@ by the @code{message-cross-post-note-function} variable.
 @item C-c C-f t
 @kindex C-c C-f t
 @findex message-reduce-to-to-cc
-Replace contents of @samp{To} header with contents of @samp{Cc} or
-@samp{Bcc} header.  (Iff @samp{Cc} header is not present, @samp{Bcc}
-header will be used instead.)
+Replace contents of @samp{To} header with contents of @samp{Cc}
+header (or the @samp{Bcc} header, if there is no @samp{Cc} header).
 
 @item C-c C-f w
 @kindex C-c C-f w
index f9ccd034fe6e9c4ac998e5f0e1ae5b7c4bb5407f..b72fb3c88cf12d03255752764fd5ed890142053f 100644 (file)
@@ -611,7 +611,7 @@ Emacs Lisp.  It is an LALR parser suitable for complex languages.
 @c LocalWords: deffn deffnx defun defvar destructor's dfn diff dir
 @c LocalWords: doc docstring EDE EIEIO elisp emacsman emph enum
 @c LocalWords: eq Exp EXPANDFULL expression fn foo func funcall
-@c LocalWords: ia ids iff ifinfo imenu imenus init int isearch itemx java kbd
+@c LocalWords: ia ids ifinfo imenu imenus init int isearch itemx java kbd
 @c LocalWords: keymap keywordtable lang languagemode lexer lexing Ludlam
 @c LocalWords: menubar metaparent metaparents min minibuffer Misc mode's
 @c LocalWords: multitable NAvigaTOR noindent nomedian nonterm noselect
index 5a903f7dee474b6efc2e651a29633a360031d9f7..3ff205865ae00973722667bc3950e313c32f628c 100644 (file)
@@ -188,13 +188,15 @@ diary, date and time stamps, whether it is done or still to do.
 @node Todo Items as Diary Entries, , Levels of Organization, Overview
 @section Todo Items as Diary Entries
 
-Each todo item is also a potential diary item: if you include a todo
-file in the Emacs diary file (@pxref{Fancy Diary Display,,, emacs}), the
-Fancy Diary display will show those todo items that are not marked with
-@code{todo-nondiary-marker}.  This effectively augments the Emacs diary
-with categorized diary entries.  For the various options available for
-making a todo item a diary entry, see @ref{Inserting New Items} and
-@ref{Editing Item Headers and Text}.
+You can have todo items show up in the Emacs Fancy Diary display by
+including the todo file in your diary file (@pxref{Fancy Diary
+Display,,, emacs}).  This effectively augments the Emacs diary with
+categorized diary entries.  All items in an included todo file will
+appear in the Fancy Diary display except for those that are marked
+with @code{todo-nondiary-marker}.  You can add or omit this marking
+upon creating a new todo item, or you can do so by editing an existing
+item, see @ref{Inserting New Items} and @ref{Editing Item Headers and
+Text} for details.
 
 To ensure the proper display of todo items in the Fancy Diary display,
 they must have the format of diary entries, i.e., they have to begin
@@ -245,20 +247,16 @@ default todo file.
 
 If you want to enter Todo mode and go directly to a specific category
 instead the first or current category in the current or default todo
-file, use the command @code{todo-jump-to-category}; @ref{Navigation}, for
-details.  You can also enter Todo mode by invoking a todo item insertion
-command; @ref{Inserting New Items}, for details.
+file, use the command @code{todo-jump-to-category}; @ref{Navigation},
+for details.  You can also enter Todo mode by invoking the command
+@code{todo-insert-item}; @ref{Inserting New Items}, for details.
 
 The most convenient way to use these commands to enter Todo mode is to
-define global key bindings for them in your init file.  Good choices are
-for @code{todo-show} and @code{todo-jump-to-category} are @kbd{C-c t}
-and @kbd{C-c j}, since these commands are bound to @kbd{t} and @kbd{j},
-respectively, in Todo mode.  For invoking item insertion from outside of
-Todo mode, it is useful to bind @code{todo-insertion-map}, which is the
-key map containing the bindings of all Todo item insertion commands, to
-@kbd{C-c i}, since it is bound to @kbd{i} in Todo mode; to complete the
-invocation, supply the rest of the key sequence (@pxref{Inserting New
-Items}).
+define global key bindings for them in your init file.  Good choices
+are @kbd{C-c t} for @code{todo-show}, @kbd{C-c j} for
+@code{todo-jump-to-category} and @kbd{C-c i} for
+@code{todo-insert-item}, since these commands are bound to @kbd{t},
+@kbd{j} and @kbd{i}, respectively, in Todo mode.
 
 You can also visit a Todo file via @code{find-file} or Dired, like any
 other file, and since Emacs recognizes it, the buffer will automatically
@@ -297,12 +295,12 @@ for the shift key for capitalization and the raw prefix argument
 number key.
 
 The predefined key bindings in Todo are more or less mnemonic.  As a
-rule, key sequences beginning with @kbd{C} are bound to commands
-applying to categories, sequences beginning with @kbd{F} apply to
-(non-archive) file-level commands, and those beginning with @kbd{A}
-apply to archives (a special type of Todo file; @ref{Todo Archive
-Mode}).  Todo commands applying to items, which constitute the majority,
-are bound to lower case key sequences.
+rule, key sequences beginning with @kbd{C} (capital `C', not the
+control key) are bound to commands applying to categories, sequences
+beginning with @kbd{F} apply to (non-archive) file-level commands, and
+those beginning with @kbd{A} apply to archives (a special type of Todo
+file; @ref{Todo Archive Mode}).  Todo commands applying to items,
+which constitute the majority, are bound to lower case key sequences.
 
 @node Navigation, Editing, Key Binding Conventions, Top
 @chapter Navigation
@@ -315,8 +313,8 @@ commands are likely to be used frequently and repetitively, it is
 convenient for their key bindings to be single lower case keys, even for
 navigation commands applying to categories and files.
 
-Two of the navigation commands were already mentioned in the section on
-Todo mode entry points:
+Two of the navigation commands were already mentioned in @ref{Todo
+Mode Entry Points}:
 
 @table @kbd
 
@@ -397,11 +395,17 @@ sections below.
 
 Editing in Todo mode means making structural or textual changes at one
 of the levels of organization (file, category, or item).  Structural
-editing includes adding, relocating and removing, textual editing includes
-renaming files or categories and changing an item's content or date, or
-adding certain kinds of marks or tags to items.  To save changes you
-make to the current todo file, type @kbd{s} (@code{todo-save}).  Changes
-are also saved on quitting Todo mode with @kbd{q}.
+editing includes adding, relocating and removing units of information
+at a level; textual editing includes renaming files or categories and
+changing an item's content or date/time stamp, or adding certain kinds
+of marks or tags to items.  Todo mode provides commands, detailed in
+the following sections, which enable you to quickly and safely make
+changes to your todo lists, without having to worry about preserving
+the file format.
+
+To save changes you make to the current todo file,
+type @kbd{s} (@code{todo-save}).  Changes are also saved on quitting
+Todo mode with @kbd{q}.
 
 @menu
 * File Editing::
@@ -417,12 +421,12 @@ There are four file-level editing commands:
 @table @kbd
 
 @item F a
-Add a new todo file (@code{todo-add-file}).  This command prompts for a
-name and creates the file in @code{todo-directory}, adding the
+Add a new todo file (@code{todo-add-file}).  This command prompts for
+name and creates the file in @code{todo-directory}, adding the
 @samp{.todo} extension (so you should not include the extension in the
-name you enter).  The command also prompts for the file's first category and, if
-option @code{todo-add-item-if-new-category} is enabled (the default),
-for that category's first item.
+name you enter).  The command also prompts for the file's first
+category and, if option @code{todo-add-item-if-new-category} is
+enabled (the default), for that category's first item.
 
 @item F r
 Rename the current todo file (@code{todo-rename-file}).  If called with
@@ -430,15 +434,15 @@ a prefix argument, prompt for a todo file and rename it.  If the todo
 file has an archive (@pxref{Todo Archive Mode}) or there are
 corresponding filtered items files (@pxref{Todo Filtered Items Mode}),
 this command renames these accordingly.  If there are live buffers
-visiting any of these files, the command also rename them accordingly.
+visiting any of these files, the command also renames them accordingly.
 
 @item F k
 Delete the current todo file (@code{todo-delete-file}).@footnote{The key
 binding of this command is mnemonic for ``kill'' to parallel the binding
 @kbd{k} for item deletion, since @kbd{d} is bound to another item
 editing command (@pxref{Done Items}).}  If the todo file has an archive
-(@pxref{Todo Archive Mode}), prompt whether to delete that as well.
-This command also kill the buffers visiting the deleted files.
+(@pxref{Todo Archive Mode}), prompt for whether to delete that as well.
+This command also kills the buffers visiting the deleted files.
 
 @item F e
 This command (@code{todo-edit-file}) changes the buffer's major mode to
@@ -458,20 +462,21 @@ text that occurs in different categories throughout the file.  The other
 use case is to recover from a mistake, such as accidentally deleting an
 item, since this cannot be undone in Todo mode.
 
-Using @kbd{C-x C-q} to quit Todo Edit mode provides a measure of safety,
-since it runs a file format check, signaling an error if the format has
-become invalid.  However, this check cannot tell if the number of items
-changed, which could result in the file containing inconsistent
-information (see the cautionary note in @ref{Reordering Categories}, for
-more details).  For this reason @kbd{F e} should be used with caution.
+Using @kbd{C-x C-q} to quit Todo Edit mode provides a measure of
+safety, since it runs a file format check, signaling an error if the
+format has become invalid.  However, this check cannot tell if the
+number of items or categories changed, which could result in the file
+containing inconsistent information (see the cautionary note in
+@ref{Reordering Categories}, for more details).  Invoking @kbd{F e}
+displays a warning to this effect.
 @end table
 
 @node Category Editing, Item Editing, File Editing, Editing
 @section Category Editing
 
-The following commands are available for editing at the category level
-(for additional category-editing commands, which are extensions of item
-commands, @pxref{Editing Item Headers and Text}):
+The following commands are available for editing specifically at the
+category level (for two other category-editing commands, which are
+extensions of item commands, @pxref{Editing Item Headers and Text}):
 
 @table @kbd
 
@@ -519,8 +524,10 @@ category in that file.
 @node Item Editing, , Category Editing, Editing
 @section Item Editing
 
-Todo mode provides a wide variety of commands for adding and textually
-changing items, as well as for deleting and relocating items.
+Todo mode provides commands for adding new items as well as textually
+changing, deleting and relocating existing items.  The commands and
+associated options for adding and editing items, in particular, offer
+you a lot of flexibility to fine-tune these operations to your needs.
 
 @menu
 * Inserting New Items::
@@ -531,282 +538,388 @@ changing items, as well as for deleting and relocating items.
 @node  Inserting New Items, Editing Item Headers and Text, , Item Editing
 @subsection Inserting New Items
 
-There are many commands for adding new todo items.  The command names
-contain the word ``insert'' instead of ``add'' and their key bindings are
-sequences beginning with @kbd{i}.  The motivation for this terminology is
-that speaking of adding an item to a category suggests appending it to
-the top or bottom, whereas you can insert an item into the category
-anywhere, giving each new item any priority in the list.
+To add a new todo item to a category, type @kbd{i}, which is bound to
+the command @code{todo-insert-item}.
 
 @table @kbd
 
-@item i i
-This is the basic command for inserting new items into a category
-(@code{todo-insert-item}).  Called without a prefix argument, it prompts
-for the text of the item and its priority (a number between 1 and one
-more than the number of items already in the category), both of which
-you enter in the minibuffer, and inserts the item into the current
-category of the current todo file at the position in the list
-corresponding to the priority you chose.  Called with one prefix
+@item i
+This command is the entry point for inserting new items into a
+category (@code{todo-insert-item}).  It prompts for additional keys
+until reaching a complete key sequence, which specifies the insertion
+parameters you wish to apply (see below).  It then prompts for the
+text of the item, which you enter in the minibuffer.@footnote{There
+are two insertion parameters that override prompting for and manually
+entering the new item's text, see below.}  Called with one prefix
 argument, it also prompts for a category, and called with two prefix
-arguments, it prompts for both a file and a category from that file, and
-inserts the item accordingly.  Category name completion works as with
-the navigation command @kbd{j}.
+arguments, it prompts for both a file and a category from that file,
+and inserts the item accordingly; category name completion works as
+with the navigation command @kbd{j}.  Finally, it inserts the item
+into the current or selected category of the current or selected todo
+file at the position in the list corresponding to the priority you
+choose, which also depends on the insertion parameters.
 @end table
 
-Each invocation of @kbd{i i} adds a header string to the item, which
+@noindent
+The name of this command reflects the fact that you can insert a new
+item into the category at any position, giving each new item any
+priority in the list, whereas speaking of adding an item to a category
+suggests appending it to the top or bottom.
+
+In addition to its file and category, each newly inserted todo item
+has a priority in the category and begins with a header string, which
 includes at least the current date in the same format used by
 @code{diary-insert-entry} (@pxref{Date Formats,,, emacs}).  You can
-control what other information is included in the header by customizing
-the following options:
+specify the priority and the content of the header string in two ways.
+First, you can set the following item insertion options, which apply
+on every invocation of @code{todo-insert-item}.
 
 @itemize @bullet
 
+@item
+@code{todo-default-priority} is for automatically assigning a new item
+the highest or lowest priority in the category, if you do not
+explicitly assign it a priority on invoking @code{todo-insert-item}.
+By default, such new items are given highest priority, i.e., inserted
+at the top of the list.
+
 @item
 @code{todo-always-add-time-string} is for including or omitting the
-current time.  The time string is omitted by default.
+current time in the new item's header.  By default, this time string
+is omitted.
 
 @item
-@code{todo-include-in-diary} is for specifying whether the item appears
-in the Fancy Diary display by adding or omitting
-@code{todo-nondiary-marker}.  By default, new todo items are marked for
-exclusion from the diary.
+@code{todo-include-in-diary} is for specifying whether the item
+appears in the Fancy Diary display (when the todo file is included in
+the Emacs diary file) by adding or omitting
+@code{todo-nondiary-marker}.  By default, new todo items are so
+marked, thus excluded from the diary.
 
 @item
 @code{todo-diary-nonmarking} is for adding or omitting
 @code{diary-nonmarking-symbol} to items displayed in the diary, to
-control whether they are marked in the calendar (@pxref{Format of Diary
-File,,, emacs}).  By default, todo items that are diary entries are
-marked in the calendar.
+control whether they are marked in the calendar (@pxref{Format of
+Diary File,,, emacs}).  By default, todo items that are diary entries
+lack this symbol, thus are marked in the calendar.
 @end itemize
 
-Instead of always adding the same header information to a new item, you
-can use more specific insertion commands that let you decide what to
-include in the item header each time you insert a new item.  And instead
-of always being prompted to choose the new item's priority, you can
-invoke a command to insert it at the position (hence with the priority)
-of the item at point.  Finally, instead of always typing the text of the
-new item in the minibuffer, you can invoke a command that makes the
-selected region in an Emacs buffer automatically become the new item's
-text.  The following paragraphs discuss how to invoke these commands by
-typing certain key sequences.
-
-There are eight parameters of item insertion in Todo mode, six
-concerning the item header, and one each concerning its priority and its
-text.  Each unique combination of these parameters produces a different
-insertion command.  The command @kbd{i i} realizes one of these
-combinations.  For the commands that realize the remaining combinations
-it is convenient to associate each parameter with a mnemonically chosen
-key.  Then by typing certain sequences of these keys, you complete the
-insertion command invocation that realizes the specified combination.
-As with @kbd{i i}, the effect of many of these commands also depends on
-the values of the item insertion options mentioned above (see the
-examples below).
-
-Here is a list of the parameters and their associated keys, in the order
-in which you must type them when building a key sequence (this order
-roughly reflects the order in which the corresponding parts of the item
-occur in a category listing):
+Beside setting these options, for more flexibility you can also pass
+certain parameters on each invocation of @code{todo-insert-item}.
+These parameters concern not only the new item's priority and header,
+but also its textual content.  You pass these parameters by typing a
+sequence of one or more keys after the initial @kbd{i}.
+
+Here is a list of the item insertion parameters together with their
+mnemonically associated keys@footnote{The non-mnemonic choice of
+@kbd{i} for the parameter @samp{default} is motivated by the
+convenience of repeating the @kbd{i} used to invoke
+@code{todo-insert-item}.} and descriptions of their effect in
+@code{todo-insert-item}:
 
 @enumerate
 
 @item
-@kbd{y} for diary (non)inclusion;
+@samp{default} (@kbd{i}): Prompt for the new item's priority
+(a number between 1 and one more than the number of items already in
+the category) and add a header string conforming to the values of the
+above options.
+
+@samp{copy} (@kbd{p}): Make an exact copy of the item at point,
+including its header string, and prompt for its priority.  (This is
+useful for quickly making a new todo item whose text or header you
+want to differ only partly from that of an existing item: after
+inserting the copy, you can quickly edit it as needed by using
+operations described in the next section.)
+
 @item
-@kbd{k} for adding or omitting `diary-nonmarking-symbol';
+@samp{diary} (@kbd{y}): Override the option
+@code{todo-include-in-diary}; that is, add @code{todo-nondiary-marker}
+if the option is non-nil, omit this marker if the option is nil.
+
+@samp{nonmarking} (@kbd{k}): Override the option
+@code{todo-diary-nonmarking}; that is, add
+@code{diary-nonmarking-symbol} if the option is non-nil, omit this
+symbol if the option is nil.  Since this symbol only applies to diary
+items, the new item is automatically marked as such, i.e., lacks
+@code{todo-nondiary-marker}.
+
 @item
-@kbd{c} for adding the date header by clicking a date in the Emacs
-calendar, or@*
-@kbd{d} for interactively entering the date header as a string of year,
-month and day number components in the minibuffer, or@*
-@kbd{n} for interactively entering the date header as a weekday name in
-the minibuffer;
+@samp{calendar} (@kbd{c}): Pop up the Emacs calendar and click a date
+in it to use that date in the new todo item's header.
+
+@samp{date} (@kbd{d}): Prompt for entering in the minibuffer
+the year, month (with completion) and day number components of the
+header.
+
+@samp{dayname} (@kbd{n}): Prompt for entering in the minibuffer
+a weekday name as the date header instead of a year-month-day string.
+
 @item
-@kbd{t} for adding a time string to the header in the minibuffer
-(including the empty string, which amounts to omitting the time);
+@samp{time} (@kbd{t}): Prompt for entering a time string in
+the minibuffer instead of automatically inserting the current time;
+however, typing @key{RET} at the prompt enters the current time if
+@code{todo-always-add-time-string} is non-nil, otherwise it enters the
+empty string (i.e., no time string).
+
 @item
-@kbd{h} for inserting the new item in the position of the item at point
-(``here''), or@*
-@kbd{r} to use the text of the selected region as the item's text.
+@samp{here} (@kbd{h}): Insert the new item in the position of
+the item at point, pushing that and all lower items in the category
+down, i.e., lowering their priority, by one.
+
+@samp{region} (@kbd{r}): Use the text of the selected region as the
+text of the new item, and insert this in accordance with the item
+insertion options and other parameters passed.  If the option
+`todo-use-only-highlighted-region' is non-nil, then use the region
+only when it is highlighted; otherwise, use the region regardless of
+highlighting.
 @end enumerate
 
-Each insertion command key sequence begins (disregarding prefix
-arguments) with @kbd{i}, followed by one or more of these eight keys, in
-the order listed.  But as you can see in the above table, since some of
-the insertion parameters are mutually exclusive, they occupy only five
-positions, so the complete (unprefixed) sequences are maximally six keys
-long.  Shorter sequences are also possible, since a parameter may be
-omitted.  But since the order in any key sequence is fixed, if the last
-key in the sequence could be followed by another insertion key, i.e., if
-the last key is not @kbd{h} or @kbd{r}, it has to be doubled to complete
-the sequence, otherwise it would be interpreted as a prefix sequence
-(this is why the binding for the basic item insertion command is @kbd{i
-i} and not @kbd{i}).
-
-Here are some examples of item insertion command key sequences:
+Note that the parameters are divided into five numbered groups; within
+a group, the parameters are mutually exclusive.  Hence, to build a
+complete insertion operation, you select at most one parameter from at
+least one of these groups, by typing the corresponding key.  If you
+want to apply more than one parameter, you must type the corresponding
+keys in the order of the numbered groups, subject to the following
+constraints.
+
+The keys of groups 2-4 are continuation keys, that is, each can be
+followed by a key from a following group.  If you want to finish the
+sequence with a continuation key, you must double the final key.  For
+example, @kbd{i y} is not a complete key sequence; rather, you must
+type @kbd{i y y}.
+
+By contrast, the keys of groups 1 and 5 are final keys; for example,
+@kbd{i i} and @kbd{i h} are complete sequences.  The reason for making
+two separate groups of the final keys is that the parameters
+@samp{default} and @samp{copy} cannot be combined with any other
+parameters, while @samp{here} and @samp{region} can be combined with
+any of the parameters from groups 2-4.
+
+To aid you in building item insertion key sequences, when you type an
+insertion key, this displays a prompt in the echo area showing pairs
+of the remaining possible keys and their associated parameters,
+grouped and ordered in accordance with the above list.  The initial
+prompt, after typing @kbd{i} to invoke @code{todo-insert-item}, looks
+like this:
+
+@example
+Press a key (so far `i'):  @{ i=>default p=>copy @} @{ y=>diary k=>nonmarking @} @{ c=>calendar d=>date n=>dayname @} t=>time @{ h=>here r=>region @}
+@end example
+
+@noindent If you now type @kbd{y}, the prompt changes to this:
+
+@example
+Press a key (so far `i y'):  y=>diary:GO! @{ c=>calendar d=>date n=>dayname @} t=>time @{ h=>here r=>region @}
+@end example
+
+@noindent Notice that the pair @samp{k=>nonmarking} is now absent, since it
+belongs to the same group as the selected pair @samp{y=>diary}, hence
+is no longer available for this sequence.  Since @kbd{y} is a
+continuation key, it is still available, but now the string ":GO!" is
+appended to the pair to remind you that pressing this key again will
+complete the sequence.
+
+
+
+@c Here are some examples of item insertion command key sequences:
+
+@c @itemize @bullet
+
+@c @item
+@c @kbd{i h} inserts a new item at the position of the item at point (pushing
+@c the latter down) with a header containing the current date and,
+@c depending on the values of the mentioned options, possibly the current
+@c time and diary-related markings.
+@c @item
+@c @kbd{i y h} does the same as the preceding command, except that
+@c @code{todo-nondiary-marker} is added if @code{todo-include-in-diary} is
+@c non-nil and omitted if that option is nil; that is, the diary key @kbd{y}
+@c overrides the setting of this option.
+@c @item
+@c @kbd{i y t h} does the same as the preceding command, except that it
+@c prompts for a time string instead of automatically inserting the
+@c current time; however, typing @key{RET} at the prompt returns the
+@c current time if @code{todo-always-add-time-string} is non-nil, otherwise
+@c the empty string (i.e., no time string).
+@c @item
+@c @kbd{i y t t} does the same as the preceding command, except that it
+@c prompts for the item's priority and inserts it accordingly.
+@c @end itemize
+
+
+An alternative to the key sequence @kbd{i c c} for choosing the item's
+date from the calendar is also available: when point is already on a
+date in the calendar, typing @kbd{i t}
+(@code{todo-insert-item-from-calendar}) prompts for a new item and its
+priority and inserts it in the current category.  This command, like
+@code{todo-insert-item}, also accepts one or two prefix arguments for
+choosing the category via minibuffer completion.  Note, however, that
+the key sequence @kbd{i t} is not defined in Todo mode but in the
+Calendar mode keymap.  It is a convenient shortcut if you happen to be
+using the calendar when you decide to make a new todo item.  (Contrast
+this with passing the @samp{calendar} parameter, which pops open the
+calendar after you have entered the item's text, and then you can
+choose a date from the calendar.)
 
-@itemize @bullet
 
-@item
-@kbd{i h} inserts a new item at the position of the item at point (pushing
-the latter down) with a header containing the current date and,
-depending on the values of the mentioned options, possibly the current
-time and diary-related markings.
-@item
-@kbd{i y h} does the same as the preceding command, except that
-@code{todo-nondiary-marker} is added if @code{todo-include-in-diary} is
-non-nil and omitted if that option is nil; that is, the diary key @kbd{y}
-overrides the setting of this option.
-@item
-@kbd{i y t h} does the same as the preceding command, except that it
-prompts for a time string instead of automatically inserting the
-current time; however, typing @key{RET} at the prompt returns the
-current time if @code{todo-always-add-time-string} is non-nil, otherwise
-the empty string (i.e., no time string).
-@item
-@kbd{i y t t} does the same as the preceding command, except that it
-prompts for the item's priority and inserts it accordingly.
-@end itemize
+@node  Editing Item Headers and Text, Relocating and Removing Items, Inserting New Items, Item Editing
+@subsection Editing Item Headers and Text
 
-Note that the commands whose key sequences include @kbd{y}, @kbd{k} or @kbd{t}
-reverse the effect of the options @code{todo-include-in-diary},
-@code{todo-diary-nonmarking} and @code{todo-always-add-time-string},
-respectively, thus temporarily overriding their values.
-
-The names of the item insertion commands correspond to their key
-bindings, e.g., @kbd{i h} is bound to @code{todo-insert-item-here}, @kbd{i y h} to
-@code{todo-insert-item-diary-here}, etc.  But since there are so many
-combinations, instead of trying to memorize either the names or the key
-sequences, you can, as usual, just type an initial part of a key
-sequence (minimally @kbd{i}), followed by @kbd{C-h} to see the valid
-completions.
-
-An alternative to using the key @kbd{c} for choosing the item's date
-from the calendar is also available: if point is on a date in the
-calendar, typing @kbd{i t} (@code{todo-insert-item-from-calendar}) will
-prompt for a new item and its priority and insert it in the current
-category.  Like @kbd{i i} and the other item insertion commands, this
-also accepts one or two prefix arguments for choosing the category via
-minibuffer completion.  Note, however, that the key sequence @kbd{i t}
-is not defined in Todo mode but in the Calendar mode keymap.  It is a
-convenient shortcut if you happen to be using the calendar when you
-decide to make a new todo item.  (Contrast this with a command like
-@kbd{i c c}, which pops open the calendar after you have entered the
-item's text, and then you can choose a date from the calendar.)
-
-There is one more item insertion command, which does not derive from the
-item insertion parameters:
+To make changes to an existing item's content or header, type @kbd{e},
+which is bound to the command @code{todo-edit-item}.
 
 @table @kbd
 
-@item i p
-This command (@code{todo-copy-item}) makes a complete copy of the item
-at point, including its header, prompts for its priority in the current
-category and inserts it accordingly.
+@item e
+This command is the entry point for textually editing existing items
+in a category (@code{todo-edit-item}).  It prompts for additional keys
+until reaching a complete key sequence, which specifies the editing
+parameters you wish to apply (see below), and then executes the
+editing operation accordingly.
 @end table
 
-@noindent
-This command is useful for quickly adding a todo item whose text or
-header you want to differ only partly from that of an existing item:
-after inserting the copy, you can quickly edit it as needed by using
-commands described in the next section.
+Here is a list of the item editing parameters together with their
+mnemonically associated keys and descriptions of their effect in
+@code{todo-edit-item}.  The list is divided into three groups, for
+reasons explained below.
 
-@node  Editing Item Headers and Text, Relocating and Removing Items, Inserting New Items, Item Editing
-@subsection Editing Item Headers and Text
-
-There are a number of commands for editing an existing item's text or
-header; these commands are bound to key sequences with @kbd{e}.
+@enumerate 1
 
-There are two commands for editing an item's text (and manually editing
-its header), one appropriate for short items and simple edits and one
-better suited for more complex changes or for editing lengthy items:
+@item
+@samp{edit} (@kbd{e}): Edit the text of the current item in the
+minibuffer; the item's header is omitted.
 
-@table @kbd
+@samp{header} (@kbd{h}): Edit the text and header of the current item
+in the minibuffer.
 
-@item e e
-Edit the text of the current item in the minibuffer
-(@code{todo-edit-item}).  If called with a prefix argument (@kbd{C-u e
-e}), the item's header is also included in the minibuffer and so can be
-edited manually.
-
-@item e m
-Edit the text of the current item in a special buffer in Todo Edit mode
-(@code{todo-edit-multiline-item}).  When you have finished editing, type
-@kbd{C-x C-q} to return to Todo mode; this runs a format check to ensure
-the item is well-formed.@footnote{Unlike the command @kbd{F e}
+@samp{multiline} (@kbd{m}): Edit the text of the current item in a
+special buffer in Todo Edit mode.  After editing, type @kbd{C-x C-q}
+to return to Todo mode.@footnote{This runs a format check to ensure
+the item is well-formed.  However, unlike the command @kbd{F e}
 (@pxref{File Editing}), @kbd{e m} does not expose you to the risk of
 putting the file in an inconsistent state, since it puts only the
 current item in Todo Edit mode.}
-@end table
 
-A number of commands are available for interactively editing all or part
-of the item header, permitting quick edits and helping avoid formatting
-errors.
+@samp{diary} (@kbd{y}): Change the current item's diary inclusion
+status by adding @code{todo-nondiary-marker} if the item lacks this,
+or by removing it if present.
 
-The following three commands are for editing any or all of the year,
-month and day components of a date header:
+@samp{nonmarking} (@kbd{k}): Change the current item's calendar
+marking status by adding @code{diary-nonmarking-symbol} if the item
+lacks this, or by removing it if present. Since this symbol only
+applies to diary items, the item is automatically marked as such,
+i.e., if @code{todo-nondiary-marker} is present, it is removed.
 
-@table @kbd
+@samp{date} (@kbd{d}): Prompt for a final key from the second group
+of item editing parameters to edit the current item's date string.
+
+@samp{time} (@kbd{t}): Edit the current item's time string, if
+present; otherwise, add one.  Typing @key{RET} at the prompt enters
+the current time if @code{todo-always-add-time-string} is non-nil,
+otherwise it enters the empty string (i.e., no time string).
+@end enumerate
 
-@item e d t
-Successively prompt for changes to the date's year, month and
-day number, and if the option @code{todo-always-add-time-string} is
-non-nil, also for editing the time string (see also @kbd{e t} below).
+@noindent
+Editing the text of a lengthy item in the minibuffer can be
+inconvenient; therefore, if you type `e e' or `e h' on an item whose
+text contains more than one logical line, the effect is the same as if
+you had typed `e m', that is, you switch a special buffer in Todo Edit
+mode.
 
-@item e d a
-Change the date to today's date.
+When you pass any of the parameters of the preceding group, except for
+the @samp{date} parameter, this completes the item editing invocation
+begun by typing @kbd{e}.  Pressing @kbd{d} to pass the @samp{date}
+parameter, however, prompts you with the following parameters and
+their associated keys, and pressing any of these completes the
+invocation.
 
-@item e d c
-This command pops up the Emacs calendar, and after you type @key{RET} on
-a date in the calendar makes that date the item's date.
-@end table
+@enumerate 2
+
+@item
+@samp{full} (@kbd{f}): Successively prompt for editing the year, month
+(with completion) and day number parts of the current item's date
+string, and, if the option @code{todo-always-add-time-string} is
+non-nil, also for editing its time string.
+
+@samp{calendar} (@kbd{c}): This pops up the Emacs calendar, and after
+you type @key{RET} on a date in the calendar makes that date the
+item's date.
+
+@samp{today} (@kbd{a}): Make the item's date today's date.
+
+@samp{dayname} (@kbd{n}): Prompt for a weekday name (with completion)
+and make it the item's date header.  Note that this replaces an
+existing date string, it does not add the day name to the date string.
+
+@samp{year} (@kbd{y}): Edit just the year component of the current
+item's date string.
+
+@samp{month} (@kbd{m}): Edit just the month component of the current
+item's date string (with completion).
+
+@samp{daynum} (@kbd{d}): Edit just the day number component of the
+current item's date string.
+@end enumerate
 
 @noindent
-You can also use these commands on items whose date header consists of a
-weekday name, which then changes to a header with year, month and day
-components.
+With the latter three parameters you can add a positive or negative
+numeric prefix argument to the invocation: this increments or
+decrements the selected date component by the given number and
+automatically adjusts the other date components if necessary.  For
+example, if the item's date string is ``January 1, 2013'', then typing
+@kbd{- 3 e d d} results in ``December 29, 2012''.
+
+The first two groups of parameters apply only to todo items that are
+not marked as done (@pxref{Done Items}); the two parameters of the
+third group, in contrast, apply only to done todo items.  You cannot
+edit the text of such items, but you can edit or delete the comment
+you may have added on marking the item as done (@pxref{Done Items,
+@code{todo-item-done}},), or retroactively add a comment, by passing
+either of these parameters.
+
+@enumerate 3
 
-Each of the following three commands, in contrast to the preceding
-three, changes only a single date component and has no effect on a date
-header consisting of a weekday name:
+@item
+@samp{add/edit comment} (@kbd{c}): Edit the current done item's
+comment, if it has one; otherwise, prompt for and add a comment.
 
-@table @kbd
-@item e d y
-@itemx e d m
-@itemx e d d
-Prompt for changing just the year, month or day number, respectively; if
-invoked with a positive or negative numeric prefix argument, directly
-increment or decrement the date component accordingly and automatically
-adjust the other date component if necessary.  For example, if the date
-string is ``January 1, 2013'', typing @kbd{- 3 e d d} results in
-``December 29, 2012''.
-@end table
+@samp{delete comment} (@kbd{d}): Delete the current done item's
+comment, if it has one.
+@end enumerate
 
-@table @kbd
-@item e d n
-Prompt for a weekday name and make it the item's date header.  Note that
-this replaces an existing date string, it does not add the day name to
-the date string.
-
-@item e t
-Edit just the item's time string.  A time string can be added both to a
-date string and to a weekday name.  If you type @key{RET} at the
-prompt, this omits a time string from the header, or deletes an existing
-time string.
-
-@item e y y
-Change the item's diary inclusion status by adding or removing
-@code{todo-nondiary-marker}.
+The command @code{todo-edit-item} is sensitive to the distinction
+between not done and done todo items.  If you type @kbd{e} when point
+is on a done item, this displays the following prompt in the echo
+area:
 
-@item e y k
-Change the item's diary marking status by adding or removing
-@code{diary-nonmarking-symbol} (this command has an effect only if the
-item is not marked for exclusion from the diary).
-@end table
+@example
+Press a key (so far `e'): c=>add/edit comment d=>delete comment
+@end example
 
 @noindent
-Parallel to the latter two item-level commands are the
-following category-level commands:
+Only by typing @kbd{c} or @kbd{d} in response to this prompt can you
+complete the invocation.  In contrast, if you type @kbd{e} when point
+is on a non-done todo item, this displays the following prompt in the
+echo area, and you can continue or complete the invocation only by
+typing one of the listed keys:
+
+@example
+Press a key (so far `e'): e=>edit h=>header m=>multiline y=>diary k=>nonmarking d=>date t=>time
+@end example
+
+As noted above, passing the @samp{date} parameter does not complete
+the invocation of @code{todo-edit-item}; rather, it displays the
+following prompt, and typing any of these keys does complete the
+invocation:
+
+@example
+Press a key (so far `e d'): f=>full c=>calendar a=>today n=>dayname y=>year m=>month d=>daynum
+@end example
+
+In addition to the item-level invocations `e y', to change the current
+item's diary inclusion status, and `e k', to change the current item's
+calendar marking status, Todo mode also has two related category-level
+commands:
 
 @table @kbd
 
@@ -818,6 +931,21 @@ a prefix argument, these markings are removed from all items in the
 category.
 @end table
 
+@noindent
+Like `e k', `C e k' automatically removes @code{todo-nondiary-marker}
+from all items it is present on, since only diary items can bear
+@code{diary-nonmarking-symbol}.
+
+Since categories often contain a mix of items marked for diary
+inclusion and exclusion, and of the former, a mix of those to be
+marked and those not to be marked in the calendar, it is more useful
+for these category-level commands, unlike the item-level commands, not
+to be toggles, but to have the same effect on all items in the
+category, and take a prefix argument to reverse the effect.  (If you
+really want to toggle the diary-inclusion and calendar-marking status
+of all items in the category, you can do this by marking all the items
+and then invoking `e y' or `e k', @pxref{Marked Items}).
+
 @node  Relocating and Removing Items,  , Editing Item Headers and Text, Item Editing
 @subsection Relocating and Removing Items
 
@@ -849,10 +977,11 @@ Lower the current item's priority by one, exchanging its position in the list
 with that of the item directly below it (@code{todo-lower-item-priority}).
 
 @item #
-Prompt for a number and relocate the item to the corresponding position
-in the list (@code{todo-set-item-priority}).  For example, entering
-@kbd{3} at the prompt makes the item the third in the category, i.e.,
-gives it third highest priority.  You can also pass the desired priority
+Prompt for a number and relocate the item to the corresponding
+position in the list (@code{todo-set-item-priority}).  For example,
+entering @kbd{3} at the prompt makes the item the third in the
+category, i.e., gives it third highest priority; all lower priority
+items are pushed down by one.  You can also pass the desired priority
 as a numeric prefix argument, e.g., @kbd{3 #} gives the item third
 highest priority without prompting.  (Prefix arguments have no effect
 with @kbd{r} or @kbd{l}.)
@@ -877,7 +1006,8 @@ enter is new, then you are asked whether to add the category to the
 file, and if you affirm, the item is moved to the new category.
 @end table
 
-You delete an item, thereby permanently removing it:
+You can delete an item, thereby permanently (and, as far as Todo mode
+is concerned, irrevocably) removing it from the todo file:
 
 @table @kbd
 
@@ -918,6 +1048,7 @@ Archive Mode}).
 
 @table @kbd
 
+@anchor{todo-item-done}
 @item d
 This command (@code{todo-item-done}) removes the todo item at point from
 the todo list, appends to the original header a header consisting of
@@ -954,23 +1085,30 @@ this is visible, hide it again and display only the todo items section
 (@code{todo-toggle-view-done-only}).
 @end table
 
-Three editing commands for done items are available:
+Since done items are meant to be a record of your finished todo items,
+you cannot apply to them the same kinds of editing operations
+available to unfinished todo items.  However, as explained in
+@ref{Editing Item Headers and Text} and repeated below for
+convenience, you can edit or delete a done item's comment, or
+retroactively add a comment.  You can also relocate a done item, and
+you can revert its done status, making it an unfinished item again.
 
 @table @kbd
 
 @item e c
-If you type this command (@code{todo-edit-done-item-comment}) when point is
-on a done item that has a comment, you can edit the text of the
-comment.  If you invoke it with a prefix argument (@kbd{C-u e c}), the
-comment is deleted on confirmation.  If the done item does not have a
-comment, this command allows you to add one.
+Edit the current done item's comment, if it has one; otherwise, prompt
+for and add a comment.
+
+@item e d
+Delete the current done item's comment, if it has one.
 
 @item m
 Move the done item at point to the top of the done items section of
-another category (@code{todo-move-item}).  This is useful in case, after
-having relocated an item to its category's done items section, you
-create a category that is better suited to the content of the done item
-than its current category, so you can recategorize the done item.
+another category (@code{todo-move-item}).  This is useful in case,
+after having finished a todo item and relocated it to its category's
+done items section, you create a category that is better suited to the
+content of the done item than its current category; in other words,
+you can retroactively recategorize the done item.
 
 @item u
 If you decide the done item at point is not done after all, this command
@@ -1156,18 +1294,34 @@ You can also use the last two commands to mark or unmark all done items in
 the category, but only when only the done items section is being
 displayed, i.e., after invoking @kbd{C V} or @kbd{V}.
 
-The following commands operate on marked items: @kbd{k} (deleting), @kbd{m}
-(moving to another category), @kbd{d} (moving to the done items section;
-note that @kbd{C-u d} adds the same comment to all marked items), @kbd{A d}
-(archiving), @kbd{u} (both in Todo mode for undoing a done item and in
-Todo Archive mode for unarchiving an item), as well as the commands for
-editing the item header (those beginning with the prefix @kbd{e d} as well
-as @kbd{e t}, @kbd{e y y} and @kbd{e y k}).  The item insertion, textual editing and
-priority changing commands do not operate on marked items.
+The following commands operate on marked items:
 
-If you use @kbd{m}, @kbd{d}, @kbd{A d} or @kbd{u} on multiple noncontiguous marked
-items, the relocated items retain their relative order but are now
-listed consecutively en bloc.
+@itemize @bullet
+
+@item
+@kbd{k} (deleting)
+@item
+@kbd{m} (moving to another category)
+@item
+@kbd{d} (moving to the done items section; note that @kbd{C-u d} adds
+the same comment to all marked items)
+@item
+@kbd{A d} (archiving)
+@item
+@kbd{u} (both in Todo mode for undoing a done item and in Todo Archive
+mode for unarchiving an item)
+@item
+the commands for editing the item header (those beginning with the
+prefix @kbd{e d} as well as @kbd{e t}, @kbd{e y} and @kbd{e k})
+@end itemize
+
+@noindent
+The item insertion, textual editing and priority changing commands do
+not operate on marked items.
+
+If you use @kbd{m}, @kbd{d}, @kbd{A d} or @kbd{u} on multiple
+noncontiguous marked items, the relocated items retain their relative
+order but are now listed consecutively en bloc.
 
 You can mark both todo and done items, but note that only @kbd{m} can apply
 to both; other commands only affect either marked todo or marked done
@@ -1177,9 +1331,9 @@ has no effect and informs you of your erroneous attempt.
 @node Todo Categories Mode, Searching for Items, Marked Items, Top
 @chapter Todo Categories Mode
 
-It can be helpful to have a compact overview of the categories in a todo
-file and the types of items it contains; Todo provides a tabular view
-of this information.
+It can be helpful to have a compact overview of the categories in a
+todo file and the types of items it contains; the Todo package
+provides a tabular view of this information.
 
 @table @kbd
 
@@ -1251,7 +1405,7 @@ the archive category instead of the empty todo category.  You can
 recognize such categories by their items counts in the table---all
 columns but the archived one have counts of zero---and in addition,
 their lines in the table are also distinguished from the others by a
-different face.
+different face (@pxref{Faces}).
 
 You can navigate around the table:
 
@@ -1313,14 +1467,15 @@ or archive file after reordering, in subsequent sessions as well.
 It is important to be aware that renumbering the categories does not
 change the textual order of the categories in the file.  This is
 significant if you should invoke @kbd{F e} to edit the entire file
-manually and in so doing alter the number of items in a category: this
-will make the item count shown in the table of categories of this file
-inconsistent with the actual number.  You can repair this inconsistency
-by invoking the command @code{todo-repair-categories-sexp} (which lacks
-a key binding, since it is meant to be a rarely needed rescue
-operation).  But this will revert any renumbering of the categories you
-have made, so you will have to renumber them again.  This is the reason
-why you should exercise caution when using @kbd{F e}.
+manually and in so doing alter the number of categories or the number
+of items in a category: this will make the information shown in the
+table of categories of this file inconsistent with its actual state.
+You can repair this inconsistency by invoking the command
+@code{todo-repair-categories-sexp} (which lacks a key binding, since
+it is meant to be a rarely needed rescue operation).  But this will
+revert any renumbering of the categories you have made, so you will
+have to renumber them again.  This is one reason why you should
+exercise caution when using @kbd{F e}.
 @end quotation
 
 @node Searching for Items, Todo Filtered Items Mode, Todo Categories Mode, Top
@@ -1525,7 +1680,8 @@ use the values of @code{todo-top-priorities-overrides} or
 
 Aside from explicitly invoking an item filtering command to display a
 saved list of items filtered by a given method from given todo files,
-there are two other ways to visit a saved file of filtered items:
+there are two other ways to visit a saved file of filtered items.  You
+can invoke a command similar to `find-file':
 
 @table @kbd
 @item F f
@@ -1533,15 +1689,13 @@ Visit a saved file of filtered items, which you choose via minibuffer
 completion (@code{todo-find-filtered-items-file}).
 @end table
 
-@itemize @bullet
-@item
-As with tables of categories, by customizing @code{todo-show-first} you
-can have the first invocation of @code{todo-show} for a given todo file
-display the corresponding saved file of filtered items.  If there is
-no saved filtered items list for the file, @code{todo-show} simply
-defaults to visiting the file and displaying its first category, as
-usual.
-@end itemize
+@noindent
+Alternatively, as with tables of categories, by customizing
+@code{todo-show-first} you can have the first invocation of
+@code{todo-show} for a given todo file display the corresponding saved
+file of filtered items.  If there is no saved filtered items list for
+the file, @code{todo-show} simply defaults to visiting the file and
+displaying its first category, as usual.
 
 The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
 Filtered Items mode.  It deletes the current filtered items file.
@@ -1560,20 +1714,23 @@ You can change the appearance of Todo mode buffers in a variety of ways.
 @node Faces, Item Prefix, , Todo Display Features
 @section Faces
 
-Each of the Todo modes uses faces to distinguish various aspects of the
-display, both structural and informational.  For example, the faces for
-the date and time strings of todo item headers by default inherit the
-attributes of the corresponding faces used by the Emacs diary; but when
-the date and time of a Todo diary item (i.e., an item lacking
-@code{todo-nondiary-marker}) is earlier than the current date and time,
-they are displayed in a different face.  In this way, you can readily
-recognize diary items that have ``expired'' and act accordingly (e.g.,
-by tagging them as done or by updating the deadlines).
-
-Another example of an informational face is the face used to distinguish
-top priority items.  A third case is the face used in Todo Categories
-mode to mark rows of the table containing categories with only archived
-items.
+Each of the Todo modes uses faces to distinguish various aspects of
+the display, both structural and informational.  For example, the
+faces for the date and time strings of todo item headers
+(@code{todo-date} and @code{todo-time}, respectively) by default
+inherit the attributes of the corresponding faces used by the Emacs
+diary; but when the date and time of a Todo diary item (i.e., an item
+lacking @code{todo-nondiary-marker}) is earlier than the current date
+and time, they are displayed in a different face
+(@code{todo-diary-expired}).  In this way, you can readily recognize
+diary items that have ``expired'' and act accordingly (e.g., by
+tagging them as done or by updating the deadlines).
+
+Another example of an informational face is the face used to
+distinguish top priority items (@code{todo-top-priority}).  A third
+case is the face used in Todo Categories mode to mark rows of the
+table containing categories with only archived items
+(@code{todo-archived-only}).
 
 The @code{todo-faces} customization group contains a complete list of
 Todo mode faces and brief descriptions of their use.
@@ -1607,15 +1764,16 @@ temporarily hide the item numbering:
 @itemx N
 Toggle between displaying item numbering and displaying the
 @code{todo-prefix} string in the current Todo file (todo, archive, or
-saved virtual category of filtered items.  This command also works in
+saved virtual category of filtered items).  (This command also works in
 buffers of filtered items that have not yet been written to a file.)
 @end table
 
 In the todo items section of each Todo mode category, the item prefix
-(whether a priority number or a fixed string) of the top priority items
-(determined as specified in @pxref{Filtering Items}) is displayed in a
-different face from the prefix of the other items, so you see at a
-glance how many items in the category are top priorities.
+(whether a priority number or a fixed string) of the top priority
+items (determined as specified in @pxref{Filtering Items}) is
+displayed in a face (@code{todo-top-priority}) different from the face
+of the prefix of non-top-priority items, so you see at a glance how
+many items in the category are top priorities.
 
 @node Other Display Commands and Options, , Item Prefix, Todo Display Features
 @section Other Display Commands and Options
@@ -1635,11 +1793,12 @@ category-file) tag is not hidden.
 
 @item F H
 @itemx H
-Highlight the current item if unhighlighted, or remove its highlighting.
-When item highlighting is enabled, it follows navigation by @kbd{n} or
-@kbd{p}.  If you want to have current item highlighting by default,
-enable the option @code{todo-highlight-item}.  @kbd{F H} or @kbd{H} will
-still toggle it.
+Highlight the current item (with the face @code{hl-line}) if
+unhighlighted, or remove its highlighting.  When item highlighting is
+enabled, it follows navigation by @kbd{n} or @kbd{p}.  If you want to
+have current item highlighting by default, enable the option
+@code{todo-highlight-item}.  @kbd{F H} or @kbd{H} will still toggle
+it.
 @end table
 
 There are two options which affect the display of items whose content is
@@ -1675,7 +1834,7 @@ By default, the todo and done items sections of a todo category are
 visually separated by a line as wide as the window the buffer is
 displayed in.  You can change the appearance and width of the separator
 by customizing @code{todo-done-separator-string}; you can also change the
-face of the separator string.
+face of the separator string (@code{todo-done-sep}).
 
 There are also several options for changing the appearance in Todo
 Categories mode and Todo Filtered Items mode, beyond those mentioned
@@ -1750,7 +1909,7 @@ do so later by invoking the command @code{todo-convert-legacy-files}
 (there is no key binding for it, since it shouldn't be necessary to use
 it often).  (A delicate part of the conversion concerns the customizable
 format of item date/time headers in the old-style; see the documentation
-string of @code{todo-todo-mode-date-time-regexp} for details.)
+string of @code{todo-legacy-date-time-regexp} for details.)
 
 @node GNU Free Documentation License, , Legacy Todo Mode Files, Top
 @appendix GNU Free Documentation License
index 94ba8f4a9c21815c316d5c4e03c257ffa322a2de..b16f881c4deb28e3ef3ada41f16087065895c115 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Handle systems without WCONTINUED consistently.  (Bug#15110, 17339)
+       * emacsclient.c (WCONTINUED): Move to ../src/syswait.h.
+
 2014-04-30  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in ($(DESTDIR)${archlibdir}):
index bd0aa121836902cf44bbf0b02c6fe8157cb2fb71..a1177f54576df8086f5143a25c5a718b099c1ab3 100644 (file)
@@ -65,10 +65,6 @@ char *w32_getenv (char *);
 # define CLOSE_SOCKET close
 # define INITIALIZE()
 
-# ifndef WCONTINUED
-#  define WCONTINUED 8
-# endif
-
 #define egetenv(VAR) getenv(VAR)
 
 #endif /* !WINDOWSNT */
index 051d0e669b4211c696586588bfe34863bc0e1071..c0032864b66535ddd192e6c840cb2c98a8f08fce 100644 (file)
@@ -1,3 +1,97 @@
+2014-05-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * mail/rmailsum.el (rmail-new-summary-1): Fix a typo in a comment.
+
+2014-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc/ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer):
+       Use nil rather than `default' for the "default" appearance (bug#17388).
+       * vc/ediff-util.el (ediff-inferior-compare-regions)
+       (ediff-toggle-autorefine, ediff-unselect-difference): Don't use
+       a misleading `default' value when it's really a boolean.
+       * vc/ediff-init.el (ediff-set-overlay-face): Don't set help-echo if the
+       overlay is not visible.
+
+2014-05-04  Stephen Berman  <stephen.berman@gmx.net>
+
+       * calendar/todo-mode.el (todo-edit-file): Use display-warning.
+       (todo-menu): Uncomment and update.
+
+2014-05-04  Stephen Berman  <stephen.berman@gmx.net>
+
+       * calendar/todo-mode.el: Reimplement item editing to have the same
+       basic user interface as item insertion, and make small UI and
+       larger internal improvements to the latter.
+       (todo-insert-item): Add reference to the Todo mode user manual to
+       the documentation string.
+       (todo-insert-item--basic): Rename from todo-basic-insert-item and
+       adjust all callers.  Change signature to combine diary and
+       nonmarking arguments.  Incorporate functionality of deleted item
+       copying command and add error checking.  Remove detailed
+       descriptions of the arguments from the documentation string, since
+       this is treated in the Todo mode user manual.
+       (todo-copy-item, todo-edit-multiline-item)
+       (todo-edit-done-item-comment, todo-edit-item-header)
+       (todo-edit-item-time, todo-edit-item-date-from-calendar)
+       (todo-edit-item-date-to-today, todo-edit-item-date-day-name)
+       (todo-edit-item-date-year, todo-edit-item-date-month)
+       (todo-edit-item-date-day, todo-edit-item-diary-nonmarking):
+       Remove.
+       (todo-edit-item): Reimplement as wrapper command for
+       todo-edit-item--next-key and make it distinguish done and not done
+       todo items.
+       (todo-edit-item--text): New function, replacing old command
+       todo-edit-item and incorporating deleted commands
+       todo-edit-multiline-item and todo-edit-done-item-comment.
+       (todo-edit-item--header): Rename from todo-basic-edit-item-header.
+       Use only numeric value of prefix argument.  Remove detailed
+       descriptions of the arguments from the documentation string, since
+       this is treated in the Todo mode user manual.
+       (todo-edit-item--diary-inclusion): New function, replacing old
+       command todo-edit-item-diary-inclusion and incorporating and fixing
+       functionality of deleted command todo-edit-item-diary-nonmarking,
+       making sure to remove todo-nondiary-marker when adding
+       diary-nonmarking-symbol.
+       (todo-edit-category-diary-inclusion): Make sure to delete
+       diary-nonmarking-symbol when adding todo-nondiary-marker.
+       (todo-edit-category-diary-nonmarking): Fix indentation.
+       (todo-insert-item--parameters): Group diary and nonmarking
+       parameters together.
+       (todo-insert-item--apply-args): Adjust to signature of
+       todo-insert-item--basic and incorporate copy parameter.
+       Make small code improvements.
+       (todo-insert-item--next-param): Improve prompt and adjust it to
+       new parameter grouping.  Remove obsolete code.
+       (todo-edit-item--param-key-alist)
+       (todo-edit-item--date-param-key-alist)
+       (todo-edit-done-item--param-key-alist): New defconsts.
+       (todo-edit-item--prompt): New variable.
+       (todo-edit-item--next-key): New function.
+       (todo-key-bindings-t): Bind "e" to todo-edit-item.  Remove
+       bindings of deleted commands.
+
+2014-05-04  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/cl-macs.el (cl-deftype): Fix indentation.
+
+2014-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * allout-widgets.el (allout-widgets-tally)
+       (allout-decorate-item-guides):
+       * menu-bar.el (menu-bar-positive-p):
+       * minibuffer.el (completion-pcm-complete-word-inserts-delimiters):
+       * progmodes/gdb-mi.el (gdbmi-same-start, gdbmi-is-number):
+       * progmodes/js.el (js--inside-param-list-p)
+       (js--inside-dojo-class-list-p, js--forward-destructuring-spec):
+       * progmodes/prolog.el (region-exists-p):
+       * progmodes/verilog-mode.el (verilog-scan-cache-ok-p):
+       * textmodes/reftex-parse.el (reftex-using-biblatex-p):
+       Doc fixes (replace `iff').
+
+2014-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries.
+
 2014-05-04  Leo Liu  <sdl.web@gmail.com>
 
        Support Chinese diary entries in calendar and diary.  (Bug#17393)
index 655176079806c3c21d5829cde7b03efee2966c18..66ec0c333a7fdf0d90e927ace44fc10527662268 100644 (file)
@@ -266,7 +266,7 @@ decreases as obsolete widgets are garbage collected."
 (defvar allout-widgets-tally nil
   "Hash-table of existing allout widgets, for debugging.
 
-Table is maintained iff `allout-widgets-maintain-tally' is non-nil.
+Table is maintained only if `allout-widgets-maintain-tally' is non-nil.
 
 The table contents will be out of sync if any widgets are created
 or deleted while this variable is nil.")
@@ -1852,7 +1852,7 @@ In their absence, the current guide column flags are used.
 
 Optional PARENT-WIDGET is the widget for the item's parent item.
 
-Optional HAS-SUCCESSOR is true iff the item is followed by a sibling.
+Optional HAS-SUCCESSOR is true if the item is followed by a sibling.
 
 We also hide the header-prefix string.
 
index 09cca201c3c68a7750bc58fa503185e4c889abc8..ddc3a4843c912eb4d073b323af3b68e4269017b4 100644 (file)
@@ -787,7 +787,7 @@ corresponding todo file, displaying the corresponding category."
                  (kill-buffer)
                  (keyboard-quit)))))
          (save-excursion (todo-category-select))
-         (when add-item (todo-basic-insert-item)))
+         (when add-item (todo-insert-item--basic)))
        (setq todo-show-first show-first)
        (add-to-list 'todo-visited file)))))
 
@@ -947,7 +947,7 @@ Categories mode."
        (todo-category-number category)
        (todo-category-select)
        (goto-char (point-min))
-       (when add-item (todo-basic-insert-item))))))
+       (when add-item (todo-insert-item--basic))))))
 
 (defun todo-next-item (&optional count)
   "Move point down to the beginning of the next item.
@@ -1216,9 +1216,19 @@ this command should be used with caution."
   (widen)
   (todo-edit-mode)
   (remove-overlays)
-  (message "%s" (substitute-command-keys
-                (concat "Type \\[todo-edit-quit] to check file format "
-                        "validity and return to Todo mode.\n"))))
+  (display-warning 'todo (format "\
+
+Type %s to return to Todo mode.
+
+This also runs a file format check and signals an error if
+the format has become invalid.  However, this check cannot
+tell if the number of items or categories changed, which
+could result in the file containing inconsistent information.
+You can repair this inconsistency by invoking the command
+`todo-repair-categories-sexp', but this will revert any
+renumbering of the categories you have made, so you will
+have to renumber them again (see `(todo-mode) Reordering
+Categories')." (substitute-command-keys "\\[todo-edit-quit]"))))
 
 (defun todo-add-category (&optional file cat)
   "Add a new category to a todo file.
@@ -1267,7 +1277,7 @@ return the new category number."
            (setq todo-category-number num)
            (todo-category-select)
            (when todo-add-item-if-new-category
-             (todo-basic-insert-item)))
+             (todo-insert-item--basic)))
        num))))
 
 (defun todo-rename-category ()
@@ -1752,7 +1762,8 @@ marking of the next N items."
 (defvar todo-insert-item--parameters)
 
 (defun todo-insert-item (&optional arg)
-  "Insert a new todo item into a category.
+  "Choose an item insertion operation and carry it out.
+This inserts a new todo item into a category.
 
 With no prefix argument ARG, add the item to the current
 category; with one prefix argument (`C-u'), prompt for a category
@@ -1766,117 +1777,31 @@ There are a number of item insertion parameters which can be
 combined by entering specific keys to produce different insertion
 commands.  After entering each key, a message shows which have
 already been entered and which remain available.  See
-`todo-basic-insert-item' for details of the parameters and their
-effects."
+`(todo-mode) Inserting New Items' for details of the parameters,
+their associated keys and their effects."
   (interactive "P")
   (setq todo-insert-item--keys-so-far "i")
   (todo-insert-item--next-param nil (list arg) todo-insert-item--parameters))
 
-(defun todo-basic-insert-item (&optional arg diary nonmarking date-type time
-                                   region-or-here)
-  "Insert a new todo item into a category.
-This is the function from which the generated Todo mode item
-insertion commands derive.
-
-The generated commands have mnemonic key bindings based on the
-arguments' values and their order in the command's argument list,
-as follows: (1) for DIARY `d', (2) for NONMARKING `k', (3) for
-DATE-TYPE either `c' for calendar or `d' for date or `n' for
-weekday name, (4) for TIME `t', (5) for REGION-OR-HERE either `r'
-for region or `h' for here.  Sequences of these keys are appended
-to the insertion prefix key `i'.  Keys that allow a following
-key (i.e., any but `r' or `h') must be doubled when used finally.
-For example, the command bound to the key sequence `i y h' will
-insert a new item with today's date, marked according to the
-DIARY argument described below, and with priority according to
-the HERE argument; `i y y' does the same except that the priority
-is not given by HERE but by prompting.
-
-In command invocations, ARG is passed as a prefix argument as
-follows.  With no prefix argument, add the item to the current
-category; with one prefix argument (`C-u'), prompt for a category
-from the current todo file; with two prefix arguments (`C-u C-u'),
-first prompt for a todo file, then a category in that file.  If
-a non-existing category is entered, ask whether to add it to the
-todo file; if answered affirmatively, add the category and
-insert the item there.
-
-The remaining arguments are set or left nil by the generated item
-insertion commands; their meanings are described in the follows
-paragraphs.
-
-When argument DIARY is non-nil, this overrides the intent of the
-user option `todo-include-in-diary' for this item: if
-`todo-include-in-diary' is nil, include the item in the Fancy
-Diary display, and if it is non-nil, exclude the item from the
-Fancy Diary display.  When DIARY is nil, `todo-include-in-diary'
-has its intended effect.
-
-When the item is included in the Fancy Diary display and the
-argument NONMARKING is non-nil, this overrides the intent of the
-user option `todo-diary-nonmarking' for this item: if
-`todo-diary-nonmarking' is nil, append `diary-nonmarking-symbol'
-to the item, and if it is non-nil, omit `diary-nonmarking-symbol'.
-
-The argument DATE-TYPE determines the content of the item's
-mandatory date header string and how it is added:
-- If DATE-TYPE is the symbol `calendar', the Calendar pops up and
-  when the user puts the cursor on a date and hits RET, that
-  date, in the format set by `calendar-date-display-form',
-  becomes the date in the header.
-- If DATE-TYPE is a string matching the regexp
-  `todo-date-pattern', that string becomes the date in the
-  header.  This case is for the command
-  `todo-insert-item-from-calendar' which is called from the
-  Calendar.
-- If DATE-TYPE is the symbol `date', the header contains the date
-  in the format set by `calendar-date-display-form', with year,
-  month and day individually prompted for (month with tab
-  completion).
-- If DATE-TYPE is the symbol `dayname' the header contains a
-  weekday name instead of a date, prompted for with tab
-  completion.
-- If DATE-TYPE has any other value (including nil or none) the
-  header contains the current date (in the format set by
-  `calendar-date-display-form').
-
-With non-nil argument TIME prompt for a time string, which must
-match `diary-time-regexp'.  Typing `<return>' at the prompt
-returns the current time, if the user option
-`todo-always-add-time-string' is non-nil, otherwise the empty
-string (i.e., no time string).  If TIME is absent or nil, add or
-omit the current time string according as
-`todo-always-add-time-string' is non-nil or nil, respectively.
-
-The argument REGION-OR-HERE determines the source and location of
-the new item:
-- If the REGION-OR-HERE is the symbol `here', prompt for the text of
-  the new item and, if the command was invoked with point in the todo
-  items section of the current category, give the new item the
-  priority of the item at point, lowering the latter's priority and
-  the priority of the remaining items.  If point is in the done items
-  section of the category, insert the new item as the first todo item
-  in the category.  Likewise, if the command with `here' is invoked
-  outside of the current category, jump to the chosen category and
-  insert the new item as the first item in the category.
-- If REGION-OR-HERE is the symbol `region', use the region of the
-  current buffer as the text of the new item, depending on the
-  value of user option `todo-use-only-highlighted-region': if
-  this is non-nil, then use the region only when it is
-  highlighted; otherwise, use the region regardless of
-  highlighting.  An error is signalled if there is no region in
-  the current buffer.  Prompt for the item's priority in the
-  category (an integer between 1 and one more than the number of
-  items in the category), and insert the item accordingly.
-- If REGION-OR-HERE has any other value (in particular, nil or
-  none), prompt for the text and the item's priority, and insert
-  the item accordingly."
+(defun todo-insert-item--basic (&optional arg diary-type date-type time where)
+  "Function implementing the core of `todo-insert-item'."
   ;; If invoked outside of Todo mode and there is not yet any Todo
   ;; file, initialize one.
   (if (null (funcall todo-files-function))
       (todo-show)
-    (let ((region (eq region-or-here 'region))
-         (here (eq region-or-here 'here)))
+    (let ((copy (eq where 'copy))
+         (region (eq where 'region))
+         (here (eq where 'here))
+         diary-item)
+      (when copy
+       (cond
+        ((not (eq major-mode 'todo-mode))
+         (user-error "You must be in Todo mode to copy a todo item"))
+        ((todo-done-item-p)
+         (user-error "You cannot copy a done item as a new todo item"))
+        ((looking-at "^$")
+         (user-error "Point must be on a todo item to copy it")))
+       (setq diary-item (todo-diary-item-p)))
       (when region
        (let (use-empty-active-region)
          (unless (and todo-use-only-highlighted-region (use-region-p))
@@ -1899,10 +1824,10 @@ the new item:
                                         todo-default-todo-file))))))
             (cat (car cat+file))
             (file (cdr cat+file))
-            (new-item (if region
-                          (buffer-substring-no-properties
-                           (region-beginning) (region-end))
-                        (read-from-minibuffer "Todo item: ")))
+            (new-item (cond (copy (todo-item-string))
+                            (region (buffer-substring-no-properties
+                                     (region-beginning) (region-end)))
+                            (t (read-from-minibuffer "Todo item: "))))
             (date-string (cond
                           ((eq date-type 'date)
                            (todo-read-date))
@@ -1941,22 +1866,26 @@ the new item:
        (let ((buffer-read-only nil)
              (called-from-outside (not (and todo-mm (equal cat ocat))))
              done-only item-added)
-         (setq new-item
-               ;; Add date, time and diary marking as required.
-               (concat (if (not (and diary (not todo-include-in-diary)))
-                           todo-nondiary-start
-                         (when (and nonmarking (not todo-diary-nonmarking))
-                           diary-nonmarking-symbol))
-                       date-string (when (and time-string ; Can be empty.
-                                              (not (zerop (length
-                                                           time-string))))
-                                     (concat " " time-string))
-                       (when (not (and diary (not todo-include-in-diary)))
-                         todo-nondiary-end)
-                       " " new-item))
-         ;; Indent newlines inserted by C-q C-j if nonspace char follows.
-         (setq new-item (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
-                                                  "\n\t" new-item nil nil 1))
+         (unless copy
+           (setq new-item
+                 ;; Add date, time and diary marking as required.
+                 (concat (if (not (and diary-type
+                                       (not todo-include-in-diary)))
+                             todo-nondiary-start
+                           (when (and (eq diary-type 'nonmarking)
+                                      (not todo-diary-nonmarking))
+                             diary-nonmarking-symbol))
+                         date-string (when (and time-string ; Can be empty.
+                                                (not (zerop (length
+                                                             time-string))))
+                                       (concat " " time-string))
+                         (when (not (and diary-type
+                                         (not todo-include-in-diary)))
+                           todo-nondiary-end)
+                         " " new-item))
+           ;; Indent newlines inserted by C-q C-j if nonspace char follows.
+           (setq new-item (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
+                                                    "\n\t" new-item nil nil 1)))
          (unwind-protect
              (progn
                ;; Make sure the correct category is selected.  There
@@ -2010,7 +1939,8 @@ the new item:
            ;; items are displayed in the window.
            (when item-added (recenter)))
          (todo-update-count 'todo 1)
-         (if (or diary todo-include-in-diary) (todo-update-count 'diary 1))
+         (when (or diary-item diary-type todo-include-in-diary)
+           (todo-update-count 'diary 1))
          (todo-update-categories-sexp))))))
 
 (defun todo-set-date-from-calendar ()
@@ -2054,21 +1984,10 @@ prompt for a todo file and then for a category in it."
   (setq todo-date-from-calendar
        (calendar-date-string (calendar-cursor-to-date t) t t))
   (calendar-exit)
-  (todo-basic-insert-item arg nil nil todo-date-from-calendar))
+  (todo-insert-item--basic arg nil nil todo-date-from-calendar))
 
 (define-key calendar-mode-map "it" 'todo-insert-item-from-calendar)
 
-(defun todo-copy-item ()
-  "Copy item at point and insert the copy as a new item."
-  (interactive)
-  (unless (or (todo-done-item-p) (looking-at "^$"))
-    (let ((copy (todo-item-string))
-         (diary-item (todo-diary-item-p)))
-      (todo-set-item-priority copy (todo-current-category) t)
-      (todo-update-count 'todo 1)
-      (when diary-item (todo-update-count 'diary 1))
-      (todo-update-categories-sexp))))
-
 (defun todo-delete-item ()
   "Delete at least one item in this category.
 If there are marked items, delete all of these; otherwise, delete
@@ -2115,64 +2034,91 @@ the item at point."
            (todo-prefix-overlays)))
       (if ov (delete-overlay ov)))))
 
-(defun todo-edit-item (&optional arg)
-  "Edit the todo item at point.
-With non-nil prefix argument ARG, include the item's date/time
-header, making it also editable; otherwise, include only the item
-content.
+(defvar todo-edit-item--param-key-alist)
+(defvar todo-edit-done-item--param-key-alist)
 
-If the item consists of only one logical line, edit it in the
-minibuffer; otherwise, edit it in Todo Edit mode."
+(defun todo-edit-item (&optional arg)
+  "Choose an editing operation for the current item and carry it out."
   (interactive "P")
-  (when (todo-item-string)
-    (let* ((opoint (point))
-          (start (todo-item-start))
-          (item-beg (progn
-                      (re-search-forward
-                       (concat todo-date-string-start todo-date-pattern
-                               "\\( " diary-time-regexp "\\)?"
-                               (regexp-quote todo-nondiary-end) "?")
-                       (line-end-position) t)
-                      (1+ (- (point) start))))
-          (header (substring (todo-item-string) 0 item-beg))
-          (item (if arg (todo-item-string)
-                  (substring (todo-item-string) item-beg)))
-          (multiline (> (length (split-string item "\n")) 1))
-          (buffer-read-only nil))
-      (if multiline
-         (todo-edit-multiline-item)
-       (let ((new (concat (if arg "" header)
-                          (read-string "Edit: " (if arg
-                                                    (cons item item-beg)
-                                                  (cons item 0))))))
-         (when arg
-           (while (not (string-match (concat todo-date-string-start
-                                             todo-date-pattern) new))
-             (setq new (read-from-minibuffer
-                        "Item must start with a date: " new))))
-         ;; Ensure lines following hard newlines are indented.
-         (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
-                                             "\n\t" new nil nil 1))
-         ;; If user moved point during editing, make sure it moves back.
-         (goto-char opoint)
-         (todo-remove-item)
-         (todo-insert-with-overlays new)
-         (move-to-column item-beg))))))
-
-(defun todo-edit-multiline-item ()
-  "Edit current todo item in Todo Edit mode.
-Use of newlines invokes `todo-indent' to insure compliance with
-the format of Diary entries."
-  (interactive)
-  (when (todo-item-string)
-    (let ((buf todo-edit-buffer))
-      (set-window-buffer (selected-window)
-                        (set-buffer (make-indirect-buffer (buffer-name) buf)))
-      (narrow-to-region (todo-item-start) (todo-item-end))
-      (todo-edit-mode)
-      (message "%s" (substitute-command-keys
-                    (concat "Type \\[todo-edit-quit] "
-                            "to return to Todo mode.\n"))))))
+  (cond ((todo-done-item-p)
+        (todo-edit-item--next-key todo-edit-done-item--param-key-alist))
+       ((todo-item-string)
+        (todo-edit-item--next-key todo-edit-item--param-key-alist arg))))
+
+(defun todo-edit-item--text (&optional arg)
+  "Function providing the text editing facilities of `todo-edit-item'."
+  (let* ((opoint (point))
+        (start (todo-item-start))
+        (end (save-excursion (todo-item-end)))
+        (item-beg (progn
+                    (re-search-forward
+                     (concat todo-date-string-start todo-date-pattern
+                             "\\( " diary-time-regexp "\\)?"
+                             (regexp-quote todo-nondiary-end) "?")
+                     (line-end-position) t)
+                    (1+ (- (point) start))))
+        (include-header (eq arg 'include-header))
+        (comment-edit (eq arg 'comment-edit))
+        (comment-delete (eq arg 'comment-delete))
+        (header-string (substring (todo-item-string) 0 item-beg))
+        (item (if (or include-header comment-edit comment-delete)
+                  (todo-item-string)
+                (substring (todo-item-string) item-beg)))
+        (multiline (> (length (split-string item "\n")) 1))
+        (comment (save-excursion
+                   (todo-item-start)
+                   (re-search-forward
+                    (concat " \\[" (regexp-quote todo-comment-string)
+                            ": \\([^]]+\\)\\]") end t)))
+        (prompt (if comment "Edit comment: " "Enter a comment: "))
+        (buffer-read-only nil))
+    (cond
+     ((or comment-edit comment-delete)
+      (save-excursion
+       (todo-item-start)
+       (if (re-search-forward (concat " \\[" (regexp-quote todo-comment-string)
+                                      ": \\([^]]+\\)\\]") end t)
+           (if comment-delete
+               (when (todo-y-or-n-p "Delete comment? ")
+                 (delete-region (match-beginning 0) (match-end 0)))
+             (replace-match (read-string prompt (cons (match-string 1) 1))
+                            nil nil nil 1))
+         (if comment-delete
+             (user-error "There is no comment to delete")
+           (insert " [" todo-comment-string ": "
+                   (prog1 (read-string prompt)
+                     ;; If user moved point during editing,
+                     ;; make sure it moves back.
+                     (goto-char opoint)
+                     (todo-item-end))
+                     "]")))))
+     ((or multiline (eq arg 'multiline))
+      (let ((buf todo-edit-buffer))
+       (set-window-buffer (selected-window)
+                          (set-buffer (make-indirect-buffer (buffer-name) buf)))
+       (narrow-to-region (todo-item-start) (todo-item-end))
+       (todo-edit-mode)
+       (message "%s" (substitute-command-keys
+                      (concat "Type \\[todo-edit-quit] "
+                              "to return to Todo mode.\n")))))
+     (t
+      (let ((new (concat (if include-header "" header-string)
+                         (read-string "Edit: " (if include-header
+                                                   (cons item item-beg)
+                                                 (cons item 0))))))
+        (when include-header
+          (while (not (string-match (concat todo-date-string-start
+                                            todo-date-pattern) new))
+            (setq new (read-from-minibuffer
+                       "Item must start with a date: " new))))
+        ;; Ensure lines following hard newlines are indented.
+        (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
+                                            "\n\t" new nil nil 1))
+        ;; If user moved point during editing, make sure it moves back.
+        (goto-char opoint)
+        (todo-remove-item)
+        (todo-insert-with-overlays new)
+        (move-to-column item-beg))))))
 
 (defun todo-edit-quit ()
   "Return from Todo Edit mode to Todo mode.
@@ -2225,35 +2171,15 @@ made in the number or names of categories."
        (todo-category-select)
        (goto-char (point-min))))))
 
-(defun todo-basic-edit-item-header (what &optional inc)
-  "Function underlying commands to edit item date/time header.
-
-The argument WHAT (passed by invoking commands) specifies what
-part of the header to edit; possible values are these symbols:
-`date', to edit the year, month, and day of the date string;
-`time', to edit just the time string; `calendar', to select the
-date from the Calendar; `today', to set the date to today's date;
-`dayname', to set the date string to the name of a day or to
-change the day name; and `year', `month' or `day', to edit only
-these respective parts of the date string (`day' is the number of
-the given day of the month, and `month' is either the name of the
-given month or its number, depending on the value of
-`calendar-date-display-form').
-
-The optional argument INC is a positive or negative integer
-\(passed by invoking commands as a numerical prefix argument)
-that in conjunction with the WHAT values `year', `month' or
-`day', increments or decrements the specified date string
-component by the specified number of suitable units, i.e., years,
-months, or days, with automatic adjustment of the other date
-string components as necessary.
-
-If there are marked items, apply the same edit to all of these;
-otherwise, edit just the item at point."
+(defun todo-edit-item--header (what &optional inc)
+  "Function providing header editing facilities of `todo-edit-item'."
   (let* ((cat (todo-current-category))
         (marked (assoc cat todo-categories-with-marks))
         (first t)
         (todo-date-from-calendar t)
+        ;; INC must be an integer, but users could pass it via
+        ;; `todo-edit-item' as e.g. `-' or `C-u'.
+        (inc (prefix-numeric-value inc))
         (buffer-read-only nil)
         ndate ntime year monthname month day
         dayname)       ; Needed by calendar-date-display-form.
@@ -2372,7 +2298,8 @@ otherwise, edit just the item at point."
                           ((or (string= omonth "*") (string= omonthname "*"))
                            (setq dd (+ dd inc))
                            (if (> dd 31)
-                               (user-error "A month cannot have more than 31 days")
+                               (user-error
+                                "A month cannot have more than 31 days")
                              (number-to-string dd)))
                           ;; Increment or decrement day by INC,
                           ;; adjusting month and year if necessary
@@ -2414,65 +2341,8 @@ otherwise, edit just the item at point."
              (todo-forward-item)
            (goto-char (point-max))))))))
 
-(defun todo-edit-item-header ()
-  "Interactively edit at least the date of item's date/time header.
-If user option `todo-always-add-time-string' is non-nil, also
-edit item's time string."
-  (interactive)
-  (todo-basic-edit-item-header 'date)
-  (when todo-always-add-time-string
-    (todo-edit-item-time)))
-
-(defun todo-edit-item-time ()
-  "Interactively edit the time string of item's date/time header."
-  (interactive)
-  (todo-basic-edit-item-header 'time))
-
-(defun todo-edit-item-date-from-calendar ()
-  "Interactively edit item's date using the Calendar."
-  (interactive)
-  (todo-basic-edit-item-header 'calendar))
-
-(defun todo-edit-item-date-to-today ()
-  "Set item's date to today's date."
-  (interactive)
-  (todo-basic-edit-item-header 'today))
-
-(defun todo-edit-item-date-day-name ()
-  "Replace item's date with the name of a day of the week."
-  (interactive)
-  (todo-basic-edit-item-header 'dayname))
-
-(defun todo-edit-item-date-year (&optional inc)
-  "Interactively edit the year of item's date string.
-With prefix argument INC a positive or negative integer,
-increment or decrement the year by INC."
-  (interactive "p")
-  (todo-basic-edit-item-header 'year inc))
-
-(defun todo-edit-item-date-month (&optional inc)
-  "Interactively edit the month of item's date string.
-With prefix argument INC a positive or negative integer,
-increment or decrement the month by INC."
-  (interactive "p")
-  (todo-basic-edit-item-header 'month inc))
-
-(defun todo-edit-item-date-day (&optional inc)
-  "Interactively edit the day of the month of item's date string.
-With prefix argument INC a positive or negative integer,
-increment or decrement the day by INC."
-  (interactive "p")
-  (todo-basic-edit-item-header 'day inc))
-
-(defun todo-edit-item-diary-inclusion ()
-  "Change diary status of one or more todo items in this category.
-That is, insert `todo-nondiary-marker' if the candidate items
-lack this marking; otherwise, remove it.
-
-If there are marked todo items, change the diary status of all
-and only these, otherwise change the diary status of the item at
-point."
-  (interactive)
+(defun todo-edit-item--diary-inclusion (&optional nonmarking)
+  "Function providing diary marking facilities of `todo-edit-item'."
   (let ((buffer-read-only)
        (marked (assoc (todo-current-category)
                       todo-categories-with-marks)))
@@ -2488,17 +2358,30 @@ point."
                     (end (save-excursion
                            (or (todo-time-string-matcher lim)
                                (todo-date-string-matcher lim)))))
-               (if (looking-at (regexp-quote todo-nondiary-start))
-                   (progn
-                     (replace-match "")
-                     (search-forward todo-nondiary-end (1+ end) t)
-                     (replace-match "")
-                     (todo-update-count 'diary 1))
-                 (when end
-                   (insert todo-nondiary-start)
-                   (goto-char (1+ end))
-                   (insert todo-nondiary-end)
-                   (todo-update-count 'diary -1)))))
+               (if nonmarking
+                   (if (looking-at (regexp-quote diary-nonmarking-symbol))
+                       (replace-match "")
+                     (when (looking-at (regexp-quote todo-nondiary-start))
+                       (save-excursion
+                         (replace-match "")
+                         (search-forward todo-nondiary-end (1+ end) t)
+                         (replace-match "")
+                         (todo-update-count 'diary 1)))
+                     (insert diary-nonmarking-symbol))
+                 (if (looking-at (regexp-quote todo-nondiary-start))
+                     (progn
+                       (replace-match "")
+                       (search-forward todo-nondiary-end (1+ end) t)
+                       (replace-match "")
+                       (todo-update-count 'diary 1))
+                   (when end
+                     (when (looking-at (regexp-quote diary-nonmarking-symbol))
+                       (replace-match "")
+                       (setq end (1- end))) ; Since we deleted nonmarking symbol.
+                     (insert todo-nondiary-start)
+                     (goto-char (1+ end))
+                     (insert todo-nondiary-end)
+                     (todo-update-count 'diary -1))))))
            (unless marked (throw 'stop nil))
            (todo-forward-item)))))
     (todo-update-categories-sexp)))
@@ -2524,6 +2407,9 @@ items."
                              (todo-date-string-matcher lim)))))
              (if arg
                  (unless (looking-at (regexp-quote todo-nondiary-start))
+                   (when (looking-at (regexp-quote diary-nonmarking-symbol))
+                     (replace-match "")
+                     (setq end (1- end))) ; Since we deleted nonmarking symbol.
                    (insert todo-nondiary-start)
                    (goto-char (1+ end))
                    (insert todo-nondiary-end))
@@ -2538,33 +2424,6 @@ items."
                                    (- todo-count diary-count))))
        (todo-update-categories-sexp)))))
 
-(defun todo-edit-item-diary-nonmarking ()
-  "Change non-marking of one or more diary items in this category.
-That is, insert `diary-nonmarking-symbol' if the candidate items
-lack this marking; otherwise, remove it.
-
-If there are marked todo items, change the non-marking status of
-all and only these, otherwise change the non-marking status of
-the item at point."
-  (interactive)
-  (let ((buffer-read-only)
-       (marked (assoc (todo-current-category)
-                      todo-categories-with-marks)))
-    (catch 'stop
-      (save-excursion
-       (when marked (goto-char (point-min)))
-       (while (not (eobp))
-         (if (todo-done-item-p)
-             (throw 'stop (message "Done items cannot be edited"))
-           (unless (and marked (not (todo-marked-item-p)))
-             (todo-item-start)
-             (unless (looking-at (regexp-quote todo-nondiary-start))
-               (if (looking-at (regexp-quote diary-nonmarking-symbol))
-                   (replace-match "")
-                 (insert diary-nonmarking-symbol))))
-           (unless marked (throw 'stop nil))
-           (todo-forward-item)))))))
-
 (defun todo-edit-category-diary-nonmarking (arg)
   "Add `diary-nonmarking-symbol' to all diary items in this category.
 With prefix ARG, remove `diary-nonmarking-symbol' from all diary
@@ -2574,16 +2433,16 @@ items in this category."
     (goto-char (point-min))
     (let (buffer-read-only)
       (catch 'stop
-      (while (not (eobp))
-       (if (todo-done-item-p)          ; We've gone too far.
-           (throw 'stop nil)
-         (unless (looking-at (regexp-quote todo-nondiary-start))
-           (if arg
-               (when (looking-at (regexp-quote diary-nonmarking-symbol))
-                 (replace-match ""))
-             (unless (looking-at (regexp-quote diary-nonmarking-symbol))
-               (insert diary-nonmarking-symbol))))
-       (todo-forward-item)))))))
+       (while (not (eobp))
+         (if (todo-done-item-p)                ; We've gone too far.
+             (throw 'stop nil)
+           (unless (looking-at (regexp-quote todo-nondiary-start))
+             (if arg
+                 (when (looking-at (regexp-quote diary-nonmarking-symbol))
+                   (replace-match ""))
+               (unless (looking-at (regexp-quote diary-nonmarking-symbol))
+                 (insert diary-nonmarking-symbol))))
+           (todo-forward-item)))))))
 
 (defun todo-set-item-priority (&optional item cat new arg)
   "Prompt for and set ITEM's priority in CATegory.
@@ -2970,32 +2829,6 @@ visible."
          ;; When done items are shown, put cursor on first just done item.
          (when opoint (goto-char opoint)))))))
 
-(defun todo-edit-done-item-comment (&optional arg)
-  "Add a comment to this done item or edit an existing comment.
-With prefix ARG delete an existing comment."
-  (interactive "P")
-  (when (todo-done-item-p)
-    (let ((item (todo-item-string))
-         (opoint (point))
-         (end (save-excursion (todo-item-end)))
-         comment buffer-read-only)
-      (save-excursion
-       (todo-item-start)
-       (if (re-search-forward (concat " \\["
-                                      (regexp-quote todo-comment-string)
-                                      ": \\([^]]+\\)\\]") end t)
-           (if arg
-               (when (todo-y-or-n-p "Delete comment? ")
-                 (delete-region (match-beginning 0) (match-end 0)))
-             (setq comment (read-string "Edit comment: "
-                                        (cons (match-string 1) 1)))
-             (replace-match comment nil nil nil 1))
-         (setq comment (read-string "Enter a comment: "))
-         ;; If user moved point during editing, make sure it moves back.
-         (goto-char opoint)
-         (todo-item-end)
-         (insert " [" todo-comment-string ": " comment "]"))))))
-
 (defun todo-item-undone ()
   "Restore at least one done item to this category's todo section.
 Prompt for the new priority.  If there are marked items, undo all
@@ -5451,7 +5284,7 @@ of each other."
        (forward-line)))))
 
 ;; -----------------------------------------------------------------------------
-;;; Utilities for generating item insertion commands and key bindings
+;;; Generating and applying item insertion and editing key sequences
 ;; -----------------------------------------------------------------------------
 
 ;; Thanks to Stefan Monnier for suggesting dynamically generating item
@@ -5462,7 +5295,7 @@ of each other."
 ;; uses dynamic binding.
 
 (defconst todo-insert-item--parameters
-  '((default copy) diary nonmarking (calendar date dayname) time (here region))
+  '((default copy) (diary nonmarking) (calendar date dayname) time (here region))
   "List of all item insertion parameters.
 Passed by `todo-insert-item' to `todo-insert-item--next-param' to
 dynamically create item insertion commands.")
@@ -5527,25 +5360,20 @@ occupied by `nil'."
                      (list (car (todo-insert-item--argsleft
                                  (todo-insert-item--this-key)
                                  todo-insert-item--argsleft)))))
-        (arglist (unless (= 5 (length args))
-                   (let ((v (make-vector 5 nil)) elt)
+        (arglist (unless (= 4 (length args))
+                   (let ((v (make-vector 4 nil)) elt)
                      (while args
                        (setq elt (pop args))
-                       (cond ((eq elt 'diary)
+                       (cond ((memq elt '(diary nonmarking))
                               (aset v 0 elt))
-                             ((eq elt 'nonmarking)
+                             ((memq elt '(calendar date dayname))
                               (aset v 1 elt))
-                             ((or (eq elt 'calendar)
-                                  (eq elt 'date)
-                                  (eq elt 'dayname))
-                              (aset v 2 elt))
                              ((eq elt 'time)
-                              (aset v 3 elt))
-                             ((or (eq elt 'here)
-                                  (eq elt 'region))
-                              (aset v 4 elt))))
+                              (aset v 2 elt))
+                             ((memq elt '(copy here region))
+                              (aset v 3 elt))))
                      (append v nil)))))
-    (apply #'todo-basic-insert-item (nconc arg arglist))))
+    (apply #'todo-insert-item--basic (nconc arg arglist))))
 
 (defun todo-insert-item--next-param (last args argsleft)
   "Build item insertion command from LAST, ARGS and ARGSLEFT and call it.
@@ -5554,35 +5382,31 @@ already entered and those still available."
   (cl-assert argsleft)
   (let* ((map (make-sparse-keymap))
          (prompt nil)
-         (addprompt (lambda (k name)
-                     (setq prompt (concat prompt
-                                          (format (concat
-                                                   (if (or (eq name 'default)
-                                                           (eq name 'calendar)
-                                                           (eq name 'here))
-                                                       " { " " ")
-                                                   "%s=>%s"
-                                                   (when (or (eq name 'copy)
-                                                             (eq name 'dayname)
-                                                             (eq name 'region))
-                                                     " }"))
-                                                  (propertize k 'face
-                                                              'todo-key-prompt)
-                                                  name))))))
+         (addprompt
+         (lambda (k name)
+           (setq prompt
+                 (concat prompt
+                         (format
+                          (concat
+                           (if (memq name '(default diary calendar here))
+                               " { " " ")
+                           "%s=>%s"
+                           (when (memq name '(copy nonmarking dayname region))
+                             " }"))
+                          (propertize k 'face 'todo-key-prompt)
+                          name))))))
     (setq todo-insert-item--args args)
     (setq todo-insert-item--argsleft argsleft)
     (when last
-      (cond ((eq last 'default)
-            (apply #'todo-basic-insert-item (car todo-insert-item--args))
-            (setq todo-insert-item--argsleft nil))
-           ((eq last 'copy)
-            (todo-copy-item)
-            (setq todo-insert-item--argsleft nil))
-           (t (let ((k (todo-insert-item--keyof last)))
-                (funcall addprompt k 'GO!)
-                (define-key map (todo-insert-item--keyof last)
-                  (lambda () (interactive)
-                    (todo-insert-item--apply-args)))))))
+      (if (memq last '(default copy))
+         (progn
+           (setq todo-insert-item--argsleft nil)
+           (todo-insert-item--apply-args))
+       (let ((k (todo-insert-item--keyof last)))
+         (funcall addprompt k (make-symbol (concat (symbol-name last) ":GO!")))
+         (define-key map (todo-insert-item--keyof last)
+           (lambda () (interactive)
+             (todo-insert-item--apply-args))))))
     (while todo-insert-item--argsleft
       (let ((x (car todo-insert-item--argsleft)))
        (setq todo-insert-item--newargsleft (cdr todo-insert-item--argsleft))
@@ -5594,14 +5418,6 @@ already entered and those still available."
                  (lambda () (interactive)
                    (todo-insert-item--apply-args))
                (lambda () (interactive)
-                 (when (equal "k" (todo-insert-item--this-key))
-                   (unless (string-match "y" todo-insert-item--keys-so-far)
-                     (when (y-or-n-p (concat "`k' only takes effect with `y';"
-                                             " add `y'? "))
-                       (setq todo-insert-item--keys-so-far
-                             (concat todo-insert-item--keys-so-far " y"))
-                       (setq todo-insert-item--args
-                             (nconc todo-insert-item--args (list 'diary))))))
                  (setq todo-insert-item--keys-so-far
                        (concat todo-insert-item--keys-so-far " "
                                (todo-insert-item--this-key)))
@@ -5617,11 +5433,74 @@ already entered and those still available."
                         (todo-insert-item--this-key)
                         todo-insert-item--argsleft)))))))))
       (setq todo-insert-item--argsleft todo-insert-item--newargsleft))
-    (when prompt (message "Enter a key (so far `%s'): %s"
+    (when prompt (message "Press a key (so far `%s'): %s"
                          todo-insert-item--keys-so-far prompt))
     (set-transient-map map)
     (setq todo-insert-item--argsleft argsleft)))
 
+(defconst todo-edit-item--param-key-alist
+  '((edit       . "e")
+    (header     . "h")
+    (multiline  . "m")
+    (diary      . "y")
+    (nonmarking . "k")
+    (date       . "d")
+    (time       . "t"))
+  "Alist of item editing parameters and their keys.")
+
+(defconst todo-edit-item--date-param-key-alist
+  '((full       . "f")
+    (calendar   . "c")
+    (today      . "a")
+    (dayname    . "n")
+    (year       . "y")
+    (month      . "m")
+    (daynum     . "d"))
+  "Alist of item date editing parameters and their keys.")
+
+(defconst todo-edit-done-item--param-key-alist
+  '((add/edit   . "c")
+    (delete     . "d"))
+  "Alist of done item comment editing parameters and their keys.")
+
+(defvar        todo-edit-item--prompt "Press a key (so far `e'): ")
+
+(defun todo-edit-item--next-key (params &optional arg)
+  (let* ((map (make-sparse-keymap))
+        (p->k (mapconcat (lambda (elt)
+                           (format "%s=>%s"
+                                   (propertize (cdr elt) 'face
+                                               'todo-key-prompt)
+                                   (concat (symbol-name (car elt))
+                                           (when (memq (car elt)
+                                                       '(add/edit delete))
+                                             " comment"))))
+                         params " "))
+        (this-key (char-to-string
+                   (read-key (concat todo-edit-item--prompt p->k))))
+        (this-param (car (rassoc this-key params))))
+    (pcase this-param
+      (`edit (todo-edit-item--text))
+      (`header (todo-edit-item--text 'include-header))
+      (`multiline (todo-edit-item--text 'multiline))
+      (`add/edit (todo-edit-item--text 'comment-edit))
+      (`delete (todo-edit-item--text 'comment-delete))
+      (`diary (todo-edit-item--diary-inclusion))
+      (`nonmarking (todo-edit-item--diary-inclusion 'nonmarking))
+      (`date (let ((todo-edit-item--prompt "Press a key (so far `e d'): "))
+              (todo-edit-item--next-key
+               todo-edit-item--date-param-key-alist arg)))
+      (`full (progn (todo-edit-item--header 'date)
+                   (when todo-always-add-time-string
+                     (todo-edit-item--header 'time))))
+      (`calendar (todo-edit-item--header 'calendar))
+      (`today (todo-edit-item--header 'today))
+      (`dayname (todo-edit-item--header 'dayname))
+      (`year (todo-edit-item--header 'year arg))
+      (`month (todo-edit-item--header 'month arg))
+      (`daynum (todo-edit-item--header 'day arg))
+      (`time (todo-edit-item--header 'time)))))
+
 ;; -----------------------------------------------------------------------------
 ;;; Todo minibuffer utilities
 ;; -----------------------------------------------------------------------------
@@ -6322,19 +6201,7 @@ Filtered Items mode following todo (not done) items."
     ("Fym"          todo-filter-diary-items-multifile)
     ("Fxx"          todo-filter-regexp-items)
     ("Fxm"          todo-filter-regexp-items-multifile)
-    ("ee"           todo-edit-item)
-    ("em"           todo-edit-multiline-item)
-    ("edt"          todo-edit-item-header)
-    ("edc"          todo-edit-item-date-from-calendar)
-    ("eda"          todo-edit-item-date-to-today)
-    ("edn"          todo-edit-item-date-day-name)
-    ("edy"          todo-edit-item-date-year)
-    ("edm"          todo-edit-item-date-month)
-    ("edd"          todo-edit-item-date-day)
-    ("et"           todo-edit-item-time)
-    ("eyy"          todo-edit-item-diary-inclusion)
-    ("eyk"          todo-edit-item-diary-nonmarking)
-    ("ec"           todo-edit-done-item-comment)
+    ("e"            todo-edit-item)
     ("d"            todo-item-done)
     ("i"            todo-insert-item)
     ("k"            todo-delete-item)
@@ -6452,64 +6319,74 @@ Filtered Items mode following todo (not done) items."
     map)
   "Todo Filtered Items mode keymap.")
 
-;; FIXME: Is it worth having a menu and if so, which commands?
-;; (easy-menu-define
-;;   todo-menu todo-mode-map "Todo Menu"
-;;   '("Todo"
-;;     ("Navigation"
-;;      ["Next Item"            todo-forward-item t]
-;;      ["Previous Item"        todo-backward-item t]
-;;      "---"
-;;      ["Next Category"        todo-forward-category t]
-;;      ["Previous Category"    todo-backward-category t]
-;;      ["Jump to Category"     todo-jump-to-category t]
-;;      "---"
-;;      ["Search Todo File"    todo-search t]
-;;      ["Clear Highlighting on Search Matches" todo-category-done t])
-;;     ("Display"
-;;      ["List Current Categories" todo-show-categories-table t]
-;;      ;; ["List Categories Alphabetically" todo-display-categories-alphabetically t]
-;;      ["Turn Item Highlighting on/off" todo-toggle-item-highlighting t]
-;;      ["Turn Item Numbering on/off" todo-toggle-prefix-numbers t]
-;;      ["Turn Item Time Stamp on/off" todo-toggle-item-header t]
-;;      ["View/Hide Done Items" todo-toggle-view-done-items t]
-;;      "---"
-;;      ["View Diary Items" todo-filter-diary-items t]
-;;      ["View Top Priority Items" todo-filter-top-priorities t]
-;;      ["View Multifile Top Priority Items" todo-filter-top-priorities-multifile t]
-;;      "---"
-;;      ["Print Category"     todo-print-buffer t])
-;;     ("Editing"
-;;      ["Insert New Item"      todo-insert-item t]
-;;      ["Insert Item Here"     todo-insert-item-here t]
-;;      ("More Insertion Commands")
-;;      ["Edit Item"            todo-edit-item t]
-;;      ["Edit Multiline Item"  todo-edit-multiline-item t]
-;;      ["Edit Item Header"     todo-edit-item-header t]
-;;      ["Edit Item Date"       todo-edit-item-date t]
-;;      ["Edit Item Time"       todo-edit-item-time t]
-;;      "---"
-;;      ["Lower Item Priority"  todo-lower-item-priority t]
-;;      ["Raise Item Priority"  todo-raise-item-priority t]
-;;      ["Set Item Priority" todo-set-item-priority t]
-;;      ["Move (Recategorize) Item" todo-move-item t]
-;;      ["Delete Item"          todo-delete-item t]
-;;      ["Undo Done Item" todo-item-undone t]
-;;      ["Mark/Unmark Item for Diary" todo-toggle-item-diary-inclusion t]
-;;      ["Mark/Unmark Items for Diary" todo-edit-item-diary-inclusion t]
-;;      ["Mark & Hide Done Item" todo-item-done t]
-;;      ["Archive Done Items" todo-archive-category-done-items t]
-;;      "---"
-;;      ["Add New Todo File" todo-add-file t]
-;;      ["Add New Category" todo-add-category t]
-;;      ["Delete Current Category" todo-delete-category t]
-;;      ["Rename Current Category" todo-rename-category t]
-;;      "---"
-;;      ["Save Todo File"      todo-save t]
-;;      )
-;;     "---"
-;;     ["Quit"                 todo-quit t]
-;;     ))
+(easy-menu-define
+  todo-menu todo-mode-map "Todo Menu"
+  '("Todo"
+    ("Navigation"
+     ["Next Item"            todo-next-item t]
+     ["Previous Item"        todo-previous-item t]
+     "---"
+     ["Next Category"        todo-forward-category t]
+     ["Previous Category"    todo-backward-category t]
+     ["Jump to Another Category"     todo-jump-to-category t]
+     "---"
+     ["Visit Another Todo File"     todo-show t]
+     ["Visit Archive" todo-find-archive t]
+     ["Visit Filtered Items File" todo-find-filtered-items-file t]
+     )
+    ("Editing"
+     ["Insert New Item"      todo-insert-item t]
+     ["Edit Item"            todo-edit-item t]
+     ["Lower Item Priority"  todo-lower-item-priority t]
+     ["Raise Item Priority"  todo-raise-item-priority t]
+     ["Set Item Priority" todo-set-item-priority t]
+     ["Mark/Unmark Item" todo-toggle-mark-item t]
+     ["Move (Recategorize) Item" todo-move-item t]
+     ["Delete Item"          todo-delete-item t]
+     ["Mark and Bury Done Item" todo-item-done t]
+     ["Undo Done Item" todo-item-undone t]
+     ["Archive Done Item" todo-archive-done-item t]
+     "---"
+     ["Add New Category" todo-add-category t]
+     ["Rename Current Category" todo-rename-category t]
+     ["Delete Current Category" todo-delete-category t]
+     ["Move Current Category" todo-move-category t]
+     ["Merge Current Category" todo-merge-category t]
+     "---"
+     ["Add New Todo File" todo-add-file t]
+     ["Rename Todo File" todo-rename-file t]
+     ["Delete Todo File" todo-delete-file t]
+     ["Edit Todo File" todo-edit-file t]
+     )
+    ("Searching and Item Filtering"
+     ["Search Todo File" todo-search t]
+     ["Clear Match Highlighting" todo-clear-matches t]
+     "---"
+     ["Set Top Priorities in File" todo-set-top-priorities-in-file t]
+     ["Set Top Priorities in Category" todo-set-top-priorities-in-category t]
+     ["Filter Top Priorities" todo-filter-top-priorities t]
+     ["Filter Multifile Top Priorities" todo-filter-top-priorities-multifile t]
+     ["Filter Diary Items" todo-filter-diary-items t]
+     ["Filter Multifile Diary Items" todo-filter-diary-items-multifile t]
+     ["Filter Regexp" todo-filter-regexp-items t]
+     ["Filter Multifile Regexp" todo-filter-regexp-items-multifile t]
+     )
+    ("Display and Printing"
+     ["Show/Hide Done Items" todo-toggle-view-done-items t]
+     ["Show/Hide Done Items Only" todo-toggle-view-done-only t]
+     ["Show/Hide Item Highlighting" todo-toggle-item-highlighting t]
+     ["Show/Hide Item Numbering" todo-toggle-prefix-numbers t]
+     ["Show/Hide Item Header" todo-toggle-item-header t]
+     "---"
+     ["Display Table of Categories" todo-show-categories-table t]
+     "---"
+     ["Print Category" todo-print-buffer t]
+     ["Print Category to File" todo-print-buffer-to-file t]
+     )
+    "---"
+    ["Save Todo File" todo-save t]
+    ["Quit Todo Mode" todo-quit t]
+    ))
 
 ;; -----------------------------------------------------------------------------
 ;;; Hook functions and mode definitions
index 5433485825b39c18e42394c793fe334c7b371e7e..56f186fe58893abe46b0a6e0378d59a0496fd3be 100644 (file)
@@ -1,3 +1,11 @@
+2014-05-01  Glenn Morris  <rgm@gnu.org>
+
+       * ede.el (ede-project-directories, ede-check-project-directory):
+       * semantic/ia-sb.el (semantic-ia-sb-show-doc):
+       * semantic/tag.el (semantic-tag-in-buffer-p):
+       * semantic/bovine/c.el (semantic-tag-abstract-p):
+       Doc fixes (replace `iff').
+
 2014-04-01  Glenn Morris  <rgm@gnu.org>
 
        * ede/emacs.el (ede-emacs-version): Update AC_INIT regexp.  (Bug#17160)
index 998df78735af5ac3e39a20030b861648fcf2099f..a9a53d776e2f851bcb3895aeecee029f7d5f6e87 100644 (file)
@@ -100,7 +100,7 @@ target willing to take the file.  'never means never perform the check."
 If the value is t, EDE may search in any directory.
 
 If the value is a function, EDE calls that function with one
-argument, the directory name; the function should return t iff
+argument, the directory name; the function should return t if
 EDE should look for project files in the directory.
 
 Otherwise, the value should be a list of fully-expanded directory
@@ -704,7 +704,7 @@ Otherwise, create a new project for DIR."
   "Check if DIR should be in `ede-project-directories'.
 If it is not, try asking the user if it should be added; if so,
 add it and save `ede-project-directories' via Customize.
-Return nil iff DIR should not be in `ede-project-directories'."
+Return nil if DIR should not be in `ede-project-directories'."
   (setq dir (directory-file-name (expand-file-name dir))) ; strip trailing /
   (or (eq ede-project-directories t)
       (and (functionp ede-project-directories)
index e4f239b14a91dca36492459f3bd4c0585e5f275c..e9715cc1bb0eb34e00e5254501ebfba1c10972be 100644 (file)
@@ -1594,7 +1594,7 @@ Optional PARENT and COLOR as specified with
   "Return non-nil if TAG is considered abstract.
 PARENT is tag's parent.
 In C, a method is abstract if it is `virtual', which is already
-handled.  A class is abstract iff its destructor is virtual."
+handled.  A class is abstract only if its destructor is virtual."
   (cond
    ((eq (semantic-tag-class tag) 'type)
     (require 'semantic/find)
index f77760c445211c1f4c5b3ab0aa89583f8fa7414b..006e8e8259f7dd7de6c143fe6c6d089027043a18 100644 (file)
@@ -1,7 +1,6 @@
 ;;; semantic/ia-sb.el --- Speedbar analysis display interactor
 
-;;; Copyright (C) 2002-2004, 2006, 2008-2014 Free Software Foundation,
-;;; Inc.
+;;; Copyright (C) 2002-2004, 2006, 2008-2014 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
@@ -139,7 +138,7 @@ DIRECTORY is the current directory, which is ignored, and ZERO is 0."
       )))
 
 (defmethod semantic-ia-sb-show-doc ((context semantic-analyze-context))
-  "Show documentation about CONTEXT iff CONTEXT points at a complete symbol."
+  "Show documentation about CONTEXT if CONTEXT points at a complete symbol."
   (let ((sym (car (reverse (oref context prefix))))
        (doc nil))
     (when (semantic-tag-p sym)
index 97fa607f9ae226710387b51339ff8d80673fee00..31354846ec0029e255434e1f833d6ccf2fc1b612 100644 (file)
@@ -172,7 +172,7 @@ That function is for internal use only."
       (semantic--tag-set-overlay tag (vector start end)))))
 
 (defun semantic-tag-in-buffer-p (tag)
-  "Return the buffer TAG resides in IFF tag is already in a buffer.
+  "Return the buffer TAG resides in, if tag is already in a buffer.
 If a tag is not in a buffer, return nil."
   (let ((o (semantic-tag-overlay tag)))
      ;; TAG is currently linked to a buffer, return it.
index 58c3638b58bd1f1f87b3058942fcfa8cbbe25d78..14e4d2da0c81f30a3e118cc2ba332423421d6194 100644 (file)
@@ -2928,7 +2928,7 @@ The function's arguments should be treated as immutable.
 (defmacro cl-deftype (name arglist &rest body)
   "Define NAME as a new data type.
 The type name can then be used in `cl-typecase', `cl-check-type', etc."
-  (declare (debug cl-defmacro) (doc-string 3))
+  (declare (debug cl-defmacro) (doc-string 3) (indent 2))
   `(cl-eval-when (compile load eval)
      (put ',name 'cl-deftype-handler
           (cl-function (lambda (&cl-defs '('*) ,@arglist) ,@body)))))
index 5158fa4c6e67318d73ec3a62517b89eb6c4b190f..759a49a91f733fd16a35a60bd6f908783dd1694c 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * gnus-registry.el (gnus-registry-install-p): Doc fix.
+
 2014-05-02  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-mime-inline-part): Redisplay a button so as to show
index 5989b8885bc2f855e1955b6538efc7d434e20abf..f3b81f77b5090ea4a0e102d49faf453a15e8d0a4 100644 (file)
@@ -1125,9 +1125,9 @@ only the last one's marks are returned."
 (add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook)
 
 (defun gnus-registry-install-p ()
-  "If the registry is not already enabled, and `gnus-registry-install' is t,
-the registry is enabled.  If `gnus-registry-install' is `ask',
-the user is asked first.  Returns non-nil iff the registry is enabled."
+  "Return non-nil if the registry is enabled (and maybe enable it first).
+If the registry is not already enabled, then if `gnus-registry-install'
+is `ask', ask the user; or if `gnus-registry-install' is non-nil, enable it."
   (interactive)
   (unless gnus-registry-enabled
     (when (if (eq gnus-registry-install 'ask)
index 2243cf29a876f97ec86ccf7440ba40aca4b4659f..af08d0f3d3a66e935255f9f8e6e4d351bb5cef55 100644 (file)
@@ -473,8 +473,8 @@ message."
                (widen)
                (goto-char (point-min))
                (while (>= total msgnum)
-                 ;; Go back to the Rmail buffer so
-                 ;; so FUNCTION and rmail-get-summary can see its local vars.
+                 ;; Go back to the Rmail buffer so FUNCTION and
+                 ;; rmail-get-summary can see its local vars.
                  (with-current-buffer main-buffer
                    ;; First test whether to include this message.
                    (if (or (null function)
index 84df6922749a555840d112c96503cc75e17a4342..436d8f611a83603cbcbc55e64e0897483dad360d 100644 (file)
@@ -922,7 +922,7 @@ by \"Save Options\" in Custom buffers.")
       (selected-frame)))
 
 (defun menu-bar-positive-p (val)
-  "Return non-nil iff VAL is a positive number."
+  "Return non-nil if VAL is a positive number."
   (and (numberp val)
        (> val 0)))
 
index 8e84a2fd307ee0379762d6df0184b2030f2970a0..cec0eb21b3801c4f3a057281ce31c8c8994352b7 100644 (file)
@@ -2773,7 +2773,7 @@ expression (not containing character ranges like `a-z')."
 
 (defcustom completion-pcm-complete-word-inserts-delimiters nil
   "Treat the SPC or - inserted by `minibuffer-complete-word' as delimiters.
-Those chars are treated as delimiters iff this variable is non-nil.
+Those chars are treated as delimiters if this variable is non-nil.
 I.e. if non-nil, M-x SPC will just insert a \"-\" in the minibuffer, whereas
 if nil, it will list all possible commands in *Completions* because none of
 the commands start with a \"-\" or a SPC."
index d89231e81b91df7a1e9428daf8598ba362e1627c..d569610a6152c0f868f6821b0d51233645faba7b 100644 (file)
@@ -1811,9 +1811,14 @@ A value of t means the main playlist.")
                         (char-after (posn-point posn))))
                     '(?◁ ?<))
               (- mpc-volume-step) mpc-volume-step))
-         (newvol (+ (string-to-number (cdr (assq 'volume mpc-status))) diff)))
-    (mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh)
-    (message "Set MPD volume to %s%%" newvol)))
+         (curvol (string-to-number (cdr (assq 'volume mpc-status))))
+         (newvol (max 0 (min 100 (+ curvol diff)))))
+    (if (= newvol curvol)
+        (progn
+          (message "MPD volume already at %s%%" newvol)
+          (ding))
+      (mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh)
+      (message "Set MPD volume to %s%%" newvol))))
 
 (defun mpc-volume-widget (vol &optional size)
   (unless size (setq size 12.5))
index 7f8c483ee5c61689d84d62ca605fd169e2e74301..0c81a8506c0484ad893ee104844ad308e1c1e424 100644 (file)
@@ -1979,7 +1979,7 @@ OFFSET is the position in STR at which the comparison takes place."
       (string-equal match (substring str offset (+ offset match-length))))))
 
 (defun gdbmi-same-start (str offset match)
-  "Return non-nil iff STR and MATCH are equal up to the end of either strings.
+  "Return non-nil if STR and MATCH are equal up to the end of either strings.
 OFFSET is the position in STR at which the comparison takes place."
   (let* ((str-length (- (length str) offset))
         (match-length (length match))
@@ -1989,7 +1989,7 @@ OFFSET is the position in STR at which the comparison takes place."
                    (substring match 0 compare-length)))))
 
 (defun gdbmi-is-number (character)
-  "Return non-nil iff CHARACTER is a numerical character between 0 and 9."
+  "Return non-nil if CHARACTER is a numerical character between 0 and 9."
   (and (>= character ?0)
        (<= character ?9)))
 
index cc9ee8fe67be647ce9cb758650d306d5afd90e63..5be1373213e04895dd9348437d4dbb2e0c7d9cb0 100644 (file)
@@ -1302,7 +1302,7 @@ LIMIT defaults to point."
     (up-list -1)))
 
 (defun js--inside-param-list-p ()
-  "Return non-nil iff point is in a function parameter list."
+  "Return non-nil if point is in a function parameter list."
   (ignore-errors
     (save-excursion
       (js--up-nearby-list)
@@ -1313,7 +1313,7 @@ LIMIT defaults to point."
                              (looking-at "function"))))))))
 
 (defun js--inside-dojo-class-list-p ()
-  "Return non-nil iff point is in a Dojo multiple-inheritance class block."
+  "Return non-nil if point is in a Dojo multiple-inheritance class block."
   (ignore-errors
     (save-excursion
       (js--up-nearby-list)
@@ -1352,7 +1352,7 @@ REGEXPS, but only if FRAMEWORK is in `js-enabled-frameworks'."
 (defun js--forward-destructuring-spec (&optional func)
   "Move forward over a JavaScript destructuring spec.
 If FUNC is supplied, call it with no arguments before every
-variable name in the spec.  Return true iff this was actually a
+variable name in the spec.  Return true if this was actually a
 spec.  FUNC must preserve the match data."
   (pcase (char-after)
     (?\[
index d82eea05e1cc0153856a0fc279d5885523784cd5..bcac59a3adedcdfc52402522132ec1e836abf544 100644 (file)
@@ -3228,7 +3228,7 @@ PREFIX is the prefix of the search regexp."
 
 (unless (fboundp 'region-exists-p)
   (defun region-exists-p ()
-    "Non-nil iff the mark is set.  Lobotomized version for Emacsen that do not provide their own."
+    "Non-nil if the mark is set.  Lobotomized version for Emacsen that do not provide their own."
     (mark)))
 
 
index e8a4d925065d4cc4e287a4f67c8c29c57bf82ee5..3ff4f57b88721a8f29ace71e83000e2f8f3eaf25 100644 (file)
@@ -2361,7 +2361,7 @@ the value thus obtained, and the result is used instead."
 
 ;; I commented this out because nobody calls it -- rms.
 ;;(defun sh-abbrevs (ancestor &rest list)
-;;  "Iff it isn't, define the current shell as abbrev table and fill that.
+;;  "If it isn't, define the current shell as abbrev table and fill that.
 ;;Abbrev table will inherit all abbrevs from ANCESTOR, which is either an abbrev
 ;;table or a list of (NAME1 EXPANSION1 ...).  In addition it will define abbrevs
 ;;according to the remaining arguments NAMEi EXPANSIONi ...
index b07e2ba5203e381ac5f07636d3d535f6ab3011e2..d0f8897ed65a114cee20c699e1877ae9a26ebe88 100644 (file)
@@ -3160,7 +3160,7 @@ and `verilog-scan'.")
   (setq verilog-scan-cache-tick nil))
 
 (defun verilog-scan-cache-ok-p ()
-  "Return t iff the scan cache is up to date."
+  "Return t if the scan cache is up to date."
   (or (and verilog-scan-cache-preserving
           (eq verilog-scan-cache-preserving (current-buffer))
           verilog-scan-cache-tick)
index 25bce076cbc87538b1e94e922c362fe552d7b30e..5b0433475b6c81664387ae17d04dfe18feef6eb7 100644 (file)
@@ -357,7 +357,7 @@ of master file."
     docstruct))
 
 (defun reftex-using-biblatex-p ()
-  "Return non-nil iff we are using biblatex rather than bibtex."
+  "Return non-nil if we are using biblatex rather than bibtex."
   (if (boundp 'TeX-active-styles)
       ;; the sophisticated AUCTeX way
       (member "biblatex" TeX-active-styles)
index 486c6649c00241309bedb874dcdbcd00d7fd19ba..f34266560388394724349a8ff02017b664c0d29d 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * url-parse.el (url-generic-parse-url): Doc fix (replace `iff').
+
 2014-04-01  Michael Albinus  <michael.albinus@gmx.de>
 
        * url-tramp.el: New file.
index 50de84f5167e9be850c8c7e74e37eb23f7ffddd0..0a811297986f9b73d34be6ee4cbe89a326c3be96 100644 (file)
@@ -125,7 +125,7 @@ TARGET   is the fragment identifier component (used to refer to a
 ATTRIBUTES is nil; this slot originally stored the attribute and
          value alists for IMAP URIs, but this feature was removed
          since it conflicts with RFC 3986.
-FULLNESS is non-nil iff the hierarchical sequence component of
+FULLNESS is non-nil if the hierarchical sequence component of
          the URL starts with two slashes, \"//\".
 
 The parser follows RFC 3986, except that it also tries to handle
index ed248fbf835ee49aaf38664b7ff5bc994b00eaa0..d21b4cc6d0b4aef96e95cd14317e0797e3cfd469 100644 (file)
@@ -818,10 +818,9 @@ one optional arguments, diff-number to refine.")
                                                     n &optional default)
   (let ((fine-diff-vector  (ediff-get-fine-diff-vector n buf-type))
        (face (if default
-                 'default
+                 nil
                (ediff-get-symbol-from-alist
-                buf-type ediff-fine-diff-face-alist)
-               )))
+                buf-type ediff-fine-diff-face-alist))))
     (mapc (lambda (overl)
            (ediff-set-overlay-face overl face))
          fine-diff-vector)))
index f3781c5388535681d8a25c18589d25d171dea0d0..dd0d76485bf75e7d97fd8a9d4e358962e2a349d9 100644 (file)
@@ -807,7 +807,7 @@ TYPE-OF-EMACS is either 'xemacs or 'emacs."
 
 (defun ediff-set-overlay-face (extent face)
   (ediff-overlay-put extent 'face face)
-  (ediff-overlay-put extent 'help-echo 'ediff-region-help-echo))
+  (ediff-overlay-put extent 'help-echo (if face 'ediff-region-help-echo)))
 
 (defun ediff-region-help-echo (extent-or-window &optional overlay _point)
   (unless overlay
index 649ef8840596467fc0fd8407dcef1c4ee7d508f9..dbf5247952727f80aa0da5adec929e32c8043882 100644 (file)
@@ -958,7 +958,7 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting."
         (message "Auto-refining is OFF")
         (setq ediff-auto-refine 'off))
        (t ;; nix 'em
-        (ediff-set-fine-diff-properties ediff-current-difference 'default)
+        (ediff-set-fine-diff-properties ediff-current-difference t)
         (message "Refinements are HIDDEN")
         (setq ediff-auto-refine 'nix))
        ))
@@ -2973,7 +2973,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
               ))
 
        ;; unhighlight fine diffs
-       (ediff-set-fine-diff-properties ediff-current-difference 'default)
+       (ediff-set-fine-diff-properties ediff-current-difference t)
        (run-hooks 'ediff-unselect-hook))))
 
 
@@ -3492,7 +3492,7 @@ Ediff Control Panel to restore highlighting."
 
     (if (ediff-valid-difference-p ediff-current-difference)
        (progn
-         (ediff-set-fine-diff-properties ediff-current-difference 'default)
+         (ediff-set-fine-diff-properties ediff-current-difference t)
          (ediff-unhighlight-diff)))
     (ediff-paint-background-regions 'unhighlight)
 
index 152bcad94702b16790d4c34fe57306f8bdee7879..e06163c32cee99a6d70ab2b645ca872dcb9782a0 100644 (file)
@@ -1,3 +1,54 @@
+2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Revert recent libpng changes (Bug#17339).
+       * Makefile.in (PNG_CFLAGS): Remove; all uses removed.
+       * image.c [HAVE_LIBPNG_PNG_H]: Include <libpng/png.h>, not <png.h>.
+
+2014-05-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Handle systems without WCONTINUED consistently.  (Bug#15110, 17339)
+       * process.c (handle_child_signal): Remove WCONTINUED ifdef,
+       because WCONTINUED is always defined now.
+       * syswait.h (WCONTINUED): Move here from ../lib-src/emacsclient.c.
+
+2014-05-03  Eli Zaretskii  <eliz@gnu.org>
+
+       * buffer.c (overlay_strings): Fix the wording of the commentary.
+
+2014-05-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Consult libpng-config more consistently (Bug#17339).
+       * Makefile.in (PNG_CFLAGS): New var.
+       (ALL_CFLAGS): Use it.
+       * image.c [HAVE_PNG]: Don't worry about <libpng/png.h>, as
+       CFLAGS now handles this.
+
+2014-05-01  Glenn Morris  <rgm@gnu.org>
+
+       * floatfns.c (Fisnan):
+       * profiler.c (Fprofiler_cpu_running_p): Doc fix (replace `iff').
+
+2014-05-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * term.c (tty_menu_activate): A better initialization for cursor
+       coordinates.
+
+2014-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * intervals.c: Tighten assertions.
+       (create_root_interval): Make sure the interval is not empty.
+       (intervals_equal): Use booleans.
+       (rotate_right, rotate_left): Check LENGTHs rather than TOTAL_LENGTH.
+       (balance_an_interval): Sanity check LENGTHs and TOTAL_LENGTHs.
+       (balance_possible_root_interval): Simplify and use booleans.
+       (split_interval_right, split_interval_left): Check LENGTH, and remove
+       now redundant assertion.
+       (adjust_intervals_for_insertion): Remove now redundant assertions.
+       (delete_node, interval_deletion_adjustment)
+       (adjust_intervals_for_deletion, merge_interval_right)
+       (merge_interval_left): Check LENGTH rather than TOTAL_LENGTH.
+       (reproduce_interval): Make sure the interval is not empty.
+
 2014-04-30  Paul Eggert  <eggert@cs.ucla.edu>
 
        * term.c (tty_menu_activate): Don't assume row and col are initialized.
index e6968e88d017a1c25f31344be2c9df9959d15563..a1142479d046737f77ee89ab457e396a3415a56d 100644 (file)
@@ -3328,17 +3328,18 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str,
     }
 }
 
-/* Return the concatenation of the strings associated with overlays that
-   begin or end at POS, ignoring overlays that are specific to a window
-   other than W.  The strings are concatenated in the appropriate order:
-   shorter overlays nest inside longer ones, and higher priority inside
-   lower.  Normally all of the after-strings come first, but zero-sized
-   overlays have their after-strings ride along with the before-strings
-   because it would look strange to print them inside-out.
-
-   Returns the string length, and stores the contents indirectly through
-   PSTR, if that variable is non-null.  The string may be overwritten by
-   subsequent calls.  */
+/* Concatenate the strings associated with overlays that begin or end
+   at POS, ignoring overlays that are specific to windows other than W.
+   The strings are concatenated in the appropriate order: shorter
+   overlays nest inside longer ones, and higher priority inside lower.
+   Normally all of the after-strings come first, but zero-sized
+   overlays have their after-strings ride along with the
+   before-strings because it would look strange to print them
+   inside-out.
+
+   Returns the concatenated string's length, and return the pointer to
+   that string via PSTR, if that variable is non-NULL.  The storage of
+   the concatenated strings may be overwritten by subsequent calls.  */
 
 ptrdiff_t
 overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr)
index ac0447ce6d69211f26a8e38af6b87e624429c862..75106a661b73e3592ebd93369de1711e90c7dd45 100644 (file)
@@ -1,7 +1,6 @@
 /* Primitive operations on floating point for GNU Emacs Lisp interpreter.
 
-Copyright (C) 1988, 1993-1994, 1999, 2001-2014 Free Software Foundation,
-Inc.
+Copyright (C) 1988, 1993-1994, 1999, 2001-2014 Free Software Foundation, Inc.
 
 Author: Wolfgang Rupprecht
 (according to ack.texi)
@@ -142,7 +141,7 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0,
 }
 
 DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
-       doc: /* Return non nil iff argument X is a NaN.  */)
+       doc: /* Return non nil if argument X is a NaN.  */)
   (Lisp_Object x)
 {
   CHECK_FLOAT (x);
index 8544ed94b796cf4e426a8e8ae2dfb62621382f86..842e0c20c42a13c76c14a9d380d8ad1fc39bb8f3 100644 (file)
@@ -110,13 +110,14 @@ create_root_interval (Lisp_Object parent)
       set_string_intervals (parent, new);
       new->position = 0;
     }
-
+  eassert (LENGTH (new) > 0);
+  
   set_interval_object (new, parent);
 
   return new;
 }
 
-/* Make the interval TARGET have exactly the properties of SOURCE */
+/* Make the interval TARGET have exactly the properties of SOURCE */
 
 void
 copy_properties (register INTERVAL source, register INTERVAL target)
@@ -176,10 +177,10 @@ intervals_equal (INTERVAL i0, INTERVAL i1)
   Lisp_Object i1_cdr, i1_val;
 
   if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1))
-    return 1;
+    return true;
 
   if (DEFAULT_INTERVAL_P (i0) || DEFAULT_INTERVAL_P (i1))
-    return 0;
+    return false;
 
   i0_cdr = i0->plist;
   i1_cdr = i1->plist;
@@ -188,31 +189,31 @@ intervals_equal (INTERVAL i0, INTERVAL i1)
       i0_sym = XCAR (i0_cdr);
       i0_cdr = XCDR (i0_cdr);
       if (!CONSP (i0_cdr))
-       return 0;
+       return false;
       i1_val = i1->plist;
       while (CONSP (i1_val) && !EQ (XCAR (i1_val), i0_sym))
        {
          i1_val = XCDR (i1_val);
          if (!CONSP (i1_val))
-           return 0;
+           return false;
          i1_val = XCDR (i1_val);
        }
 
       /* i0 has something i1 doesn't.  */
       if (EQ (i1_val, Qnil))
-       return 0;
+       return false;
 
       /* i0 and i1 both have sym, but it has different values in each.  */
       if (!CONSP (i1_val)
          || (i1_val = XCDR (i1_val), !CONSP (i1_val))
          || !EQ (XCAR (i1_val), XCAR (i0_cdr)))
-       return 0;
+       return false;
 
       i0_cdr = XCDR (i0_cdr);
 
       i1_cdr = XCDR (i1_cdr);
       if (!CONSP (i1_cdr))
-       return 0;
+       return false;
       i1_cdr = XCDR (i1_cdr);
     }
 
@@ -339,10 +340,8 @@ rotate_right (INTERVAL A)
   ptrdiff_t old_total = A->total_length;
 
   eassert (old_total > 0);
-  eassert (old_total
-          > TOTAL_LENGTH (B) + TOTAL_LENGTH (A->right));
-  eassert (TOTAL_LENGTH (B)
-          > TOTAL_LENGTH (B->left) + TOTAL_LENGTH (c));
+  eassert (LENGTH (A) > 0);
+  eassert (LENGTH (B) > 0);
 
   /* Deal with any Parent of A;  make it point to B.  */
   if (! ROOT_INTERVAL_P (A))
@@ -366,9 +365,11 @@ rotate_right (INTERVAL A)
   /* A's total length is decreased by the length of B and its left child.  */
   A->total_length -= B->total_length - TOTAL_LENGTH (c);
   eassert (TOTAL_LENGTH (A) > 0);
+  eassert (LENGTH (A) > 0);
 
   /* B must have the same total length of A.  */
   B->total_length = old_total;
+  eassert (LENGTH (B) > 0);
 
   return B;
 }
@@ -390,10 +391,8 @@ rotate_left (INTERVAL A)
   ptrdiff_t old_total = A->total_length;
 
   eassert (old_total > 0);
-  eassert (old_total
-          > TOTAL_LENGTH (B) + TOTAL_LENGTH (A->left));
-  eassert (TOTAL_LENGTH (B)
-          > TOTAL_LENGTH (B->right) + TOTAL_LENGTH (c));
+  eassert (LENGTH (A) > 0);
+  eassert (LENGTH (B) > 0);
 
   /* Deal with any parent of A;  make it point to B.  */
   if (! ROOT_INTERVAL_P (A))
@@ -417,9 +416,11 @@ rotate_left (INTERVAL A)
   /* A's total length is decreased by the length of B and its right child.  */
   A->total_length -= B->total_length - TOTAL_LENGTH (c);
   eassert (TOTAL_LENGTH (A) > 0);
+  eassert (LENGTH (A) > 0);
 
   /* B must have the same total length of A.  */
   B->total_length = old_total;
+  eassert (LENGTH (B) > 0);
 
   return B;
 }
@@ -432,6 +433,9 @@ balance_an_interval (INTERVAL i)
 {
   register ptrdiff_t old_diff, new_diff;
 
+  eassert (LENGTH (i) > 0);
+  eassert (TOTAL_LENGTH (i) >= LENGTH (i));
+
   while (1)
     {
       old_diff = LEFT_TOTAL_LENGTH (i) - RIGHT_TOTAL_LENGTH (i);
@@ -468,16 +472,16 @@ static INTERVAL
 balance_possible_root_interval (INTERVAL interval)
 {
   Lisp_Object parent;
-  bool have_parent = 0;
-
-  if (!INTERVAL_HAS_OBJECT (interval) && !INTERVAL_HAS_PARENT (interval))
-    return interval;
+  bool have_parent = false;
 
   if (INTERVAL_HAS_OBJECT (interval))
     {
-      have_parent = 1;
+      have_parent = true;
       GET_INTERVAL_OBJECT (parent, interval);
     }
+  else if (!INTERVAL_HAS_PARENT (interval))
+    return interval;
+
   interval = balance_an_interval (interval);
 
   if (have_parent)
@@ -553,7 +557,7 @@ split_interval_right (INTERVAL interval, ptrdiff_t offset)
     {
       set_interval_right (interval, new);
       new->total_length = new_length;
-      eassert (TOTAL_LENGTH (new) >= 0);
+      eassert (LENGTH (new) > 0);
     }
   else
     {
@@ -562,7 +566,6 @@ split_interval_right (INTERVAL interval, ptrdiff_t offset)
       set_interval_parent (interval->right, new);
       set_interval_right (interval, new);
       new->total_length = new_length + new->right->total_length;
-      eassert (TOTAL_LENGTH (new) >= 0);
       balance_an_interval (new);
     }
 
@@ -598,7 +601,7 @@ split_interval_left (INTERVAL interval, ptrdiff_t offset)
     {
       set_interval_left (interval, new);
       new->total_length = new_length;
-      eassert (TOTAL_LENGTH (new) >= 0);
+      eassert (LENGTH (new) > 0);
     }
   else
     {
@@ -607,7 +610,6 @@ split_interval_left (INTERVAL interval, ptrdiff_t offset)
       set_interval_parent (new->left, new);
       set_interval_left (interval, new);
       new->total_length = new_length + new->left->total_length;
-      eassert (TOTAL_LENGTH (new) >= 0);
       balance_an_interval (new);
     }
 
@@ -791,12 +793,12 @@ update_interval (register INTERVAL i, ptrdiff_t pos)
     {
       if (pos < i->position)
        {
-         /* Move left. */
+         /* Move left.  */
          if (pos >= i->position - TOTAL_LENGTH (i->left))
            {
              i->left->position = i->position - TOTAL_LENGTH (i->left)
                + LEFT_TOTAL_LENGTH (i->left);
-             i = i->left;              /* Move to the left child */
+             i = i->left;              /* Move to the left child */
            }
          else if (NULL_PARENT (i))
            error ("Point before start of properties");
@@ -806,12 +808,12 @@ update_interval (register INTERVAL i, ptrdiff_t pos)
        }
       else if (pos >= INTERVAL_LAST_POS (i))
        {
-         /* Move right. */
+         /* Move right.  */
          if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right))
            {
              i->right->position = INTERVAL_LAST_POS (i)
                + LEFT_TOTAL_LENGTH (i->right);
-             i = i->right;             /* Move to the right child */
+             i = i->right;             /* Move to the right child */
            }
          else if (NULL_PARENT (i))
            error ("Point %"pD"d after end of properties", pos);
@@ -958,7 +960,6 @@ adjust_intervals_for_insertion (INTERVAL tree,
       for (temp = prev ? prev : i; temp; temp = INTERVAL_PARENT_OR_NULL (temp))
        {
          temp->total_length += length;
-         eassert (TOTAL_LENGTH (temp) >= 0);
          temp = balance_possible_root_interval (temp);
        }
 
@@ -1014,7 +1015,6 @@ adjust_intervals_for_insertion (INTERVAL tree,
       for (temp = i; temp; temp = INTERVAL_PARENT_OR_NULL (temp))
        {
          temp->total_length += length;
-         eassert (TOTAL_LENGTH (temp) >= 0);
          temp = balance_possible_root_interval (temp);
        }
     }
@@ -1216,9 +1216,10 @@ delete_node (register INTERVAL i)
       this = this->left;
       this->total_length += migrate_amt;
     }
-  eassert (TOTAL_LENGTH (this) >= 0);
   set_interval_left (this, migrate);
   set_interval_parent (migrate, this);
+  eassert (LENGTH (this) > 0);
+  eassert (LENGTH (i->right) > 0);
 
   return i->right;
 }
@@ -1298,7 +1299,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
                                                         relative_position,
                                                         amount);
       tree->total_length -= subtract;
-      eassert (TOTAL_LENGTH (tree) >= 0);
+      eassert (LENGTH (tree) > 0);
       return subtract;
     }
   /* Right branch.  */
@@ -1313,7 +1314,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
                                               relative_position,
                                               amount);
       tree->total_length -= subtract;
-      eassert (TOTAL_LENGTH (tree) >= 0);
+      eassert (LENGTH (tree) > 0);
       return subtract;
     }
   /* Here -- this node.  */
@@ -1328,7 +1329,7 @@ interval_deletion_adjustment (register INTERVAL tree, register ptrdiff_t from,
        amount = my_amount;
 
       tree->total_length -= amount;
-      eassert (TOTAL_LENGTH (tree) >= 0);
+      eassert (LENGTH (tree) >= 0);
       if (LENGTH (tree) == 0)
        delete_interval (tree);
 
@@ -1370,7 +1371,7 @@ adjust_intervals_for_deletion (struct buffer *buffer,
   if (ONLY_INTERVAL_P (tree))
     {
       tree->total_length -= length;
-      eassert (TOTAL_LENGTH (tree) >= 0);
+      eassert (LENGTH (tree) > 0);
       return;
     }
 
@@ -1430,12 +1431,12 @@ merge_interval_right (register INTERVAL i)
       while (! NULL_LEFT_CHILD (successor))
        {
          successor->total_length += absorb;
-         eassert (TOTAL_LENGTH (successor) >= 0);
+         eassert (LENGTH (successor) > 0);
          successor = successor->left;
        }
 
       successor->total_length += absorb;
-      eassert (TOTAL_LENGTH (successor) >= 0);
+      eassert (LENGTH (successor) > 0);
       delete_interval (i);
       return successor;
     }
@@ -1457,7 +1458,7 @@ merge_interval_right (register INTERVAL i)
 
       successor = INTERVAL_PARENT (successor);
       successor->total_length -= absorb;
-      eassert (TOTAL_LENGTH (successor) >= 0);
+      eassert (LENGTH (successor) > 0);
     }
 
   /* This must be the rightmost or last interval and cannot
@@ -1486,12 +1487,12 @@ merge_interval_left (register INTERVAL i)
       while (! NULL_RIGHT_CHILD (predecessor))
        {
          predecessor->total_length += absorb;
-         eassert (TOTAL_LENGTH (predecessor) >= 0);
+         eassert (LENGTH (predecessor) > 0);
          predecessor = predecessor->right;
        }
 
       predecessor->total_length += absorb;
-      eassert (TOTAL_LENGTH (predecessor) >= 0);
+      eassert (LENGTH (predecessor) > 0);
       delete_interval (i);
       return predecessor;
     }
@@ -1513,7 +1514,7 @@ merge_interval_left (register INTERVAL i)
 
       predecessor = INTERVAL_PARENT (predecessor);
       predecessor->total_length -= absorb;
-      eassert (TOTAL_LENGTH (predecessor) >= 0);
+      eassert (LENGTH (predecessor) > 0);
     }
 
   /* This must be the leftmost or first interval and cannot
@@ -1528,6 +1529,8 @@ reproduce_interval (INTERVAL source)
 {
   register INTERVAL target = make_interval ();
 
+  eassert (LENGTH (source) > 0);
+
   target->total_length = source->total_length;
   target->position = source->position;
 
@@ -1538,6 +1541,7 @@ reproduce_interval (INTERVAL source)
   if (! NULL_RIGHT_CHILD (source))
     set_interval_right (target, reproduce_tree (source->right, target));
 
+  eassert (LENGTH (target) > 0);
   return target;
 }
 
@@ -1766,7 +1770,7 @@ lookup_char_property (Lisp_Object plist, Lisp_Object prop, bool textprop)
 
   if (! NILP (fallback))
     return fallback;
-  /* Check for alternative properties */
+  /* Check for alternative properties */
   tail = Fassq (prop, Vchar_property_alias_alist);
   if (! NILP (tail))
     {
@@ -2434,7 +2438,7 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag,
                                 end, end_byte);
     }
 
-  /* Rounding to char boundaries can theoretically ake this interval
+  /* Rounding to char boundaries can theoretically make this interval
      spurious.  If so, delete one child, and copy its property list
      to this interval.  */
   if (LEFT_TOTAL_LENGTH (i) + RIGHT_TOTAL_LENGTH (i) >= TOTAL_LENGTH (i))
index 655f083fc33c5e9951cd4812fdbb6552fbe4e00d..fdb0501f9ecdd897a98ef9645f25b18efad72177 100644 (file)
@@ -6226,11 +6226,7 @@ handle_child_signal (int sig)
       int status;
 
       if (p->alive
-#ifndef WCONTINUED
-          && child_status_changed (p->pid, &status, WUNTRACED))
-#else
-          && child_status_changed (p->pid, &status, WUNTRACED | WCONTINUED))
-#endif
+         && child_status_changed (p->pid, &status, WUNTRACED | WCONTINUED))
        {
          /* Change the status of the process that was found.  */
          p->tick = ++process_tick;
index ff97fe88b7b37cef677fa97e9d799d2565f26dfb..919aabc92af16d710b2ab853975a99d3ec45737a 100644 (file)
@@ -384,7 +384,7 @@ Return non-nil if the profiler was running.  */)
 DEFUN ("profiler-cpu-running-p",
        Fprofiler_cpu_running_p, Sprofiler_cpu_running_p,
        0, 0, 0,
-       doc: /* Return non-nil iff cpu profiler is running.  */)
+       doc: /* Return non-nil if cpu profiler is running.  */)
   (void)
 {
   return profiler_cpu_running ? Qt : Qnil;
index db197b82fb77a35bea4d6fb55c98b4c7b4ee5ca8..9c8cbd51f0043f794ea625fdfd2c92f9aa7f82c3 100644 (file)
@@ -29,6 +29,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <sys/wait.h>
 #endif  /* !HAVE_SYS_WAIT_H */
 
+#ifndef WCONTINUED
+#define WCONTINUED 8
+#endif
+
 #ifndef WCOREDUMP              /* not POSIX */
 #define WCOREDUMP(status) ((status) & 0x80)
 #endif
index c636b8cac8ba5c22085416918eecdb9fc9afffb5..8ea3e42dae6b841980e51e847884592ba57ecc15 100644 (file)
@@ -3267,7 +3267,10 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
 
   /* Turn off the cursor.  Otherwise it shows through the menu
      panes, which is ugly.  */
+  col = cursorX (tty);
+  row = cursorY (tty);
   tty_hide_cursor (tty);
+
   if (buffers_num_deleted)
     menu->text[0][7] = ' ';
   onepane = menu->count == 1 && menu->submenu[0];
@@ -3405,8 +3408,6 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
          col = cursorX (tty);
          row = cursorY (tty);
        }
-      else
-       row = -1;
 
       /* Display the help-echo message for the currently-selected menu
         item.  */
@@ -3418,8 +3419,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
          /* Move the cursor to the beginning of the current menu
             item, so that screen readers and other accessibility aids
             know where the active region is.  */
-         if (0 <= row)
-           cursor_to (sf, row, col);
+         cursor_to (sf, row, col);
          tty_hide_cursor (tty);
          fflush (tty->output);
          prev_menu_help_message = menu_help_message;