summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-05-25 19:28:09 -0700
committerGlenn Morris <rgm@gnu.org>2014-05-25 19:28:09 -0700
commit015936fba1bcaa51b7886a73144d4c088200c0aa (patch)
treec9628339352c1a97e574df28966e977143c43e41
parent5e26d9849a79bf78fda821979fc937f7e5e6df52 (diff)
parente8f2cc26e712f42f6391fa52cd67c3e791096f1e (diff)
downloademacs-015936fba1bcaa51b7886a73144d4c088200c0aa.tar.gz
Merge from emacs-24; up to 2014-05-26T10:21:18Z!rgm@gnu.org
-rw-r--r--ChangeLog6
-rw-r--r--admin/ChangeLog5
-rw-r--r--configure.ac11
-rw-r--r--doc/emacs/ChangeLog6
-rw-r--r--doc/emacs/frames.texi11
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/display.texi18
-rw-r--r--doc/misc/ChangeLog13
-rw-r--r--doc/misc/htmlfontify.texi4
-rw-r--r--doc/misc/org.texi1
-rw-r--r--doc/misc/todo-mode.texi89
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/ETAGS.EBNF2
-rw-r--r--etc/NEWS2
-rw-r--r--etc/ORG-NEWS2
-rw-r--r--lib-src/ChangeLog10
-rwxr-xr-xlib-src/rcs2log59
-rw-r--r--lisp/ChangeLog142
-rw-r--r--lisp/avoid.el25
-rw-r--r--lisp/calendar/todo-mode.el494
-rw-r--r--lisp/cus-face.el4
-rw-r--r--lisp/emacs-lisp/eieio-opt.el2
-rw-r--r--lisp/emacs-lisp/lisp.el36
-rw-r--r--lisp/emacs-lisp/nadvice.el16
-rw-r--r--lisp/emacs-lisp/package.el17
-rw-r--r--lisp/emacs-lisp/timer.el80
-rw-r--r--lisp/frame.el12
-rw-r--r--lisp/hippie-exp.el2
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/mouse.el2
-rw-r--r--lisp/net/dbus.el12
-rw-r--r--lisp/net/tramp-sh.el2
-rw-r--r--lisp/nxml/nxml-mode.el5
-rw-r--r--lisp/progmodes/scheme.el58
-rw-r--r--lisp/simple.el10
-rw-r--r--lisp/vc/vc-rcs.el7
-rw-r--r--lisp/window.el5
-rw-r--r--src/ChangeLog49
-rw-r--r--src/lisp.h4
-rw-r--r--src/minibuf.c3
-rw-r--r--src/unexaix.c4
-rw-r--r--src/w32fns.c14
-rw-r--r--src/w32term.c4
-rw-r--r--src/xdisp.c62
-rw-r--r--test/automated/advice-tests.el1
46 files changed, 889 insertions, 436 deletions
diff --git a/ChangeLog b/ChangeLog
index 91b1b3ebc6c..8dfffbd9ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix port to 32-bit AIX (Bug#17540).
+ * configure.ac (opsys): On Power Architecture, treat release 7 of
+ AIX like releases 5 and 6.
+
2014-05-19 Paul Eggert <eggert@cs.ucla.edu>
Remove dependencies on getdelim and getline.
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 35ad1744410..79adb4f543d 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,7 +1,6 @@
-2014-05-25 Jan Djärv <jan.h.d@swipnet.se>
+2014-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
- * mac/uvs.el: New file from Mac port. src/macuvs.h is generated
- by it.
+ * mac/uvs.el: New file from Mac port. Generates src/macuvs.h.
2014-05-17 Paul Eggert <eggert@cs.ucla.edu>
diff --git a/configure.ac b/configure.ac
index 2cfc1ad1031..d727c0253f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,7 +547,7 @@ case "${canonical}" in
rs6000-ibm-aix[56]* )
opsys=aix4-2
;;
- powerpc-ibm-aix[56]* )
+ powerpc-ibm-aix[5-9]* | powerpc-ibm-aix[1-9][0-9]* )
opsys=aix4-2
;;
@@ -999,6 +999,15 @@ if test "$opsys" = "mingw32"; then
LN_S="/bin/ln"
fi
+dnl On some Debian versions, "install-info" prints irritating messages
+dnl "This is not dpkg install-info anymore, but GNU install-info"
+dnl if called via an absolute file name.
+dnl Use the entirely-identical-but-quieter ginstall-info instead if present.
+dnl Sadly some people may have an old ginstall-info installed on
+dnl non-Debian systems, so we can't use this.
+dnl AC_PATH_PROGS(INSTALL_INFO, [ginstall-info install-info], :,
+dnl $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
+
AC_PATH_PROG(INSTALL_INFO, install-info, :,
$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
dnl Don't use GZIP, which is used by gzip for additional parameters.
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index afb8782ac75..db310ea37bd 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * frames.texi (Fonts): Clarify which frames are affected by
+ setting font from the menu and in default-frame-alist.
+ (Bug#17532)
+
2014-05-14 Eli Zaretskii <eliz@gnu.org>
* mule.texi (Language Environments): Remove unused @anchor. (Bug#17479)
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 8dd387b5fa0..cd8347369d3 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -494,13 +494,14 @@ the mouse cursor to the chosen frame.
@cindex fonts
By default, Emacs displays text on graphical displays using a
-12-point monospace font. There are several different ways to specify
+10-point monospace font. There are several different ways to specify
a different font:
@itemize
@item
-Click on @samp{Set Default Font} in the @samp{Options} menu. To save
-this for future sessions, click on @samp{Save Options} in the
+Click on @samp{Set Default Font} in the @samp{Options} menu. This
+makes the selected font the default on all existing graphical frames.
+To save this for future sessions, click on @samp{Save Options} in the
@samp{Options} menu.
@item
@@ -513,6 +514,10 @@ Add a line to your init file, modifying the variable
'(font . "DejaVu Sans Mono-10"))
@end example
+@noindent
+This makes the font the default on all graphical frames created after
+restarting Emacs with that init file.
+
@cindex X defaults file
@cindex X resources file
@item
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 334b5d8d91c..e810e75a80f 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * display.texi (Invisible Text): Clarify the description of
+ line-move-ignore-invisible. (Bug#17511)
+
2014-05-22 Leo Liu <sdl.web@gmail.com>
* sequences.texi (Sequence Functions): Don't mention when and how
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index acbef6b9495..e93f9ab5a4d 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -930,12 +930,14 @@ current value of @code{buffer-invisibility-spec}.
@vindex line-move-ignore-invisible
Ordinarily, functions that operate on text or move point do not care
-whether the text is invisible. The user-level line motion commands
-ignore invisible newlines if @code{line-move-ignore-invisible} is
-non-@code{nil} (the default), but only because they are explicitly
-programmed to do so.
-
- However, if a command ends with point inside or at the boundary of
+whether the text is invisible, they process invisible characters and
+visible characters alike. The user-level line motion commands,
+such as @code{next-line}, @code{previous-line}, ignore invisible
+newlines if @code{line-move-ignore-invisible} is non-@code{nil} (the
+default), i.e., behave like these invisible newlines didn't exist in
+the buffer, but only because they are explicitly programmed to do so.
+
+ If a command ends with point inside or at the boundary of
invisible text, the main editing loop relocates point to one of the
two ends of the invisible text. Emacs chooses the direction of
relocation so that it is the same as the overall movement direction of
@@ -952,6 +954,10 @@ command moved point forward into an invisible range, Emacs moves point forward
to the first visible character that follows the invisible text and then forward
one more character.
+ These @dfn{adjustments} of point that ended up in the middle of
+invisible text can be disabled by setting @code{disable-point-adjustment}
+to a non-@code{nil} value. @xref{Adjusting Point}.
+
Incremental search can make invisible overlays visible temporarily
and/or permanently when a match includes invisible text. To enable
this, the overlay should have a non-@code{nil}
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 79474a52f40..ec790f1f7b0 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,16 @@
+2014-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Specify coding if Latin-1 Emacs would misinterpret (Bug#17575).
+ * htmlfontify.texi, org.texi: Add "coding: utf-8".
+
+2014-05-26 Stephen Berman <stephen.berman@gmx.net>
+
+ * todo-mode.texi: Update in light of changes due to bug#17482.
+ Replace numerous mistaken uses of literal quotes with proper
+ Texinfo markup.
+ (Todo Mode Entry Points): Comment out reference to using find-file
+ or Dired to visit Todo files, since this has been disabled (bug#17482).
+
2014-05-20 Leo Liu <sdl.web@gmail.com>
* cl.texi (List Functions, Efficiency Concerns): Update cl-endp.
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
index 48b40eb84a4..1d8794d772d 100644
--- a/doc/misc/htmlfontify.texi
+++ b/doc/misc/htmlfontify.texi
@@ -1589,3 +1589,7 @@ A copy of the @code{file} command.
@setchapternewpage odd
@bye
+
+@c Local Variables:
+@c coding: utf-8
+@c End:
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 418eb1d6944..3800a41d239 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -18208,6 +18208,7 @@ org-customize @key{RET}} and then click yourself through the tree.
@bye
@c Local variables:
+@c coding: utf-8
@c fill-column: 77
@c indent-tabs-mode: nil
@c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$"
diff --git a/doc/misc/todo-mode.texi b/doc/misc/todo-mode.texi
index ad97e608156..44ea7fbf06e 100644
--- a/doc/misc/todo-mode.texi
+++ b/doc/misc/todo-mode.texi
@@ -258,15 +258,15 @@ are @kbd{C-c t} for @code{todo-show}, @kbd{C-c j} 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
-be in the appropriate Todo mode. Moreover, as long as the command you
-use to visit the file is listed in the option
-@code{todo-visit-files-commands} (which by default contains
-@code{find-file} and @code{dired-find-file}), it will also correctly
-display the file's first category on first visiting the file (otherwise
-you have to use one of the commands for navigating between categories in
-order to get a proper display).
+@c You can also visit a Todo file via @code{find-file} or Dired, like any
+@c other file, and since Emacs recognizes it, the buffer will automatically
+@c be in the appropriate Todo mode. Moreover, as long as the command you
+@c use to visit the file is listed in the option
+@c @code{todo-visit-files-commands} (which by default contains
+@c @code{find-file} and @code{dired-find-file}), it will also correctly
+@c display the file's first category on first visiting the file (otherwise
+@c you have to use one of the commands for navigating between categories in
+@c order to get a proper display).
You can leave Todo mode by typing @kbd{q} (@code{todo-quit}), which
buries the current todo file buffer. Doing this also saves any changes
@@ -295,7 +295,7 @@ 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} (capital `C', not the
+rule, key sequences beginning with @kbd{C} (capital @samp{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
@@ -669,9 +669,9 @@ 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.
+@code{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
Note that the parameters are divided into five numbered groups; within
@@ -715,9 +715,9 @@ Press a key (so far `i y'): y=>diary:GO! @{ c=>calendar d=>date n=>dayname @} t
@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.
+continuation key, it is still available, but now the string
+@samp{:GO!} is appended to the pair to remind you that pressing this
+key again will complete the sequence.
@@ -821,10 +821,10 @@ otherwise it enters the empty string (i.e., no time string).
@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.
+inconvenient; therefore, if you type @kbd{e e} or @kbd{e h} on an item
+whose text contains more than one logical line, the effect is the same
+as if you had typed @kbd{e m}, that is, you switch a special buffer in
+Todo Edit mode.
When you pass any of the parameters of the preceding group, except for
the @samp{date} parameter, this completes the item editing invocation
@@ -916,10 +916,10 @@ invocation:
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:
+In addition to the item-level invocations @kbd{e y}, to change the
+current item's diary inclusion status, and @kbd{e k}, to change the
+current item's calendar marking status, Todo mode also has two related
+category-level commands:
@table @kbd
@@ -932,7 +932,7 @@ category.
@end table
@noindent
-Like `e k', `C e k' automatically removes @code{todo-nondiary-marker}
+Like @kbd{e k}, @kbd{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}.
@@ -944,7 +944,7 @@ 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}).
+and then invoking @kbd{e y} or @kbd{e k}, @pxref{Marked Items}).
@node Relocating and Removing Items, , Editing Item Headers and Text, Item Editing
@subsection Relocating and Removing Items
@@ -1050,14 +1050,15 @@ Archive Mode}).
@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
-@code{todo-done-string} (by default ``DONE '') and the current date, and
-if @code{todo-always-add-time-string} is enabled, also the current time,
-and adds the resulting done item to the top of the done items section of
-the category. Invoked with a prefix argument, it also prompts you to
-enter a comment, which is appended to the end of the done item, prefixed
-with @code{todo-comment-string} (by default ``COMMENT: '').
+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 @code{todo-done-string} (by default @samp{DONE }) and the current
+date, and if @code{todo-always-add-time-string} is enabled, also the
+current time, and adds the resulting done item to the top of the done
+items section of the category. Invoked with a prefix argument, it
+also prompts you to enter a comment, which is appended to the end of
+the done item, prefixed with @code{todo-comment-string} (by default
+@samp{COMMENT: }).
@end table
A category's done items section is located below the last todo (i.e.,
@@ -1255,7 +1256,7 @@ category in the archive, the archive file is also automatically deleted.
Since it is natural to visit an archive from the corresponding todo
file, it would be convenient to easily return to the todo file when you
-have finished browsing the archive. If you type `q' to quit Todo
+have finished browsing the archive. If you type @kbd{q} to quit Todo
Archive mode, this switches to the corresponding todo file and shows the
todo category corresponding to the archive category you were just
visiting.
@@ -1396,13 +1397,13 @@ to sort by archived item counts.
Each row of the table is also buttonized; pressing one of these exits
the buffer (killing it), returns to the buffer of the file from which
-you had invoked `F c', and displays the category that was named in the
-row button you pressed (i.e., pressing this button jumps to that
-category). However, if the category named in the row is in a todo file
-and all of its items have been archived, and you have enabled the option
-@code{todo-skip-archived-categories}, then pressing the button jumps to
-the archive category instead of the empty todo category. You can
-recognize such categories by their items counts in the table---all
+you had invoked @kbd{F c}, and displays the category that was named in
+the row button you pressed (i.e., pressing this button jumps to that
+category). However, if the category named in the row is in a todo
+file and all of its items have been archived, and you have enabled the
+option @code{todo-skip-archived-categories}, then pressing the button
+jumps to 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 (@pxref{Faces}).
@@ -1586,7 +1587,7 @@ todo file, and the latter sets the number of top priorities for the
current category. To exclude a category or file from filtering by @kbd{F t t}
and @kbd{F t m}, set the number to @samp{0}.
@item
-You can invoke `F t t' and `F t m' with a numeric prefix argument,
+You can invoke @kbd{F t t} and @kbd{F t m} with a numeric prefix argument,
which specifies the number of top priorities in each category just for
this invocation, overriding both @code{todo-top-priorities-overrides} and
@code{todo-top-priorities}.
@@ -1681,7 +1682,7 @@ 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. You
-can invoke a command similar to `find-file':
+can invoke a command similar to @code{find-file}:
@table @kbd
@item F f
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 5a359e02863..49be20a5f79 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Specify coding if Latin-1 Emacs would misinterpret (Bug#17575).
+ * ETAGS.EBNF, NEWS, ORG-NEWS: Add "coding: utf-8".
+
2014-05-17 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Assume C99 or later (Bug#17487).
diff --git a/etc/ETAGS.EBNF b/etc/ETAGS.EBNF
index 66a974b948c..0d872383a16 100644
--- a/etc/ETAGS.EBNF
+++ b/etc/ETAGS.EBNF
@@ -1,4 +1,4 @@
--*- indented-text -*-
+-*- mode: indented-text; coding: utf-8 -*-
See the end of this file for copyright information.
diff --git a/etc/NEWS b/etc/NEWS
index 7c686a6502a..3d76642fe52 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1476,7 +1476,6 @@ This is like the old `eval-after-load', but better behaved.
*** `generic-make-keywords-list'
*** `get-upcase-table' (use `case-table-get-table' instead).
-+++
** `with-wrapper-hook' is obsoleted by `add-function'.
The few hooks that used with-wrapper-hook are replaced as follows:
*** `abbrev-expand-function' obsoletes `abbrev-expand-functions'.
@@ -4187,6 +4186,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
Local variables:
+coding: utf-8
mode: outline
paragraph-separate: "[ ]*$"
end:
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index c74506ce3ac..46b4c954ecd 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1,4 +1,4 @@
-ORG NEWS -- history of user-visible changes. -*- org -*-
+ORG NEWS -- history of user-visible changes. -*- mode: org; coding: utf-8 -*-
#+LINK: doc http://orgmode.org/worg/doc.html#%s
#+LINK: git http://orgmode.org/w/?p=org-mode.git;a=commit;h=%s
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 3ac401b16a3..cedd9ab8965 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,13 @@
+2014-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix rcs2log problems with CVS.
+ Problem reported by Glenn Morris in
+ <http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00277.html>.
+ Plus, fix some security and filename quoting problems.
+ * rcs2log (logdir): Prefer mktemp if available.
+ (logdir, llogdir): Work even if TMPDIR begins with '-' or has spaces.
+ (output_authors, main awk script): Parse more-recent CVS output format.
+
2014-05-19 Paul Eggert <eggert@cs.ucla.edu>
Remove dependencies on getline and getdelim.
diff --git a/lib-src/rcs2log b/lib-src/rcs2log
index a0a75e390fb..8dd9cdcf2bb 100755
--- a/lib-src/rcs2log
+++ b/lib-src/rcs2log
@@ -205,11 +205,19 @@ month_data='
m[9]="Oct"; m[10]="Nov"; m[11]="Dec"
'
-logdir=$TMPDIR/rcs2log$$
-llogout=$logdir/l
+if type mktemp >/dev/null 2>&1; then
+ logdir=`mktemp -d`
+else
+ logdir=$TMPDIR/rcs2log$$
+ (umask 077 && mkdir "$logdir")
+fi || exit
+case $logdir in
+-*) logdir=./$logdir;;
+esac
trap exit 1 2 13 15
-trap "rm -fr $logdir 2>/dev/null" 0
-(umask 077 && exec mkdir $logdir) || exit
+trap "rm -fr \"$logdir\" 2>/dev/null" 0
+
+llogout=$logdir/l
# If no rlog-format log file is given, generate one into $rlogfile.
case $rlogfile in
@@ -417,10 +425,10 @@ case $loginFullnameMailaddrs in
?*)
case $loginFullnameMailaddrs in
*\"* | *\\*)
- sed 's/["\\]/\\&/g' >$llogout <<EOF || exit
+ sed 's/["\\]/\\&/g' >"$llogout" <<EOF || exit
$loginFullnameMailaddrs
EOF
- loginFullnameMailaddrs=`cat $llogout`;;
+ loginFullnameMailaddrs=`cat "$llogout"`;;
esac
oldIFS=$IFS
@@ -442,29 +450,33 @@ esac
case $logins in
?*)
- sort -u -o $llogout <<EOF
+ sort -u -o "$llogout" <<EOF
$logins
EOF
;;
'')
: ;;
-esac >$llogout || exit
+esac >"$llogout" || exit
output_authors='/^date: / {
- if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/ && $4 == "author:" && $5 ~ /^[^;]*;$/) {
- print substr($5, 1, length($5)-1)
+ cvsformat = $5 == "author:"
+ if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && (cvsformat ? $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ && $4 ~ /^[-+][0-9:]*;$/ : $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/)) {
+ author = $(5 + cvsformat)
+ if ($(4 + cvsformat) == "author:" && author ~ /^[^;]*;$/) {
+ print substr(author, 1, length(author)-1)
+ }
}
}'
authors=`
- $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - $llogout
+ $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - "$llogout"
`
case $authors in
?*)
- cat >$llogout <<EOF || exit
+ cat >"$llogout" <<EOF || exit
$authors
EOF
initialize_author_script='s/["\\]/\\&/g; s/.*/author[\"&\"] = 1/'
- initialize_author=`sed -e "$initialize_author_script" <$llogout`
+ initialize_author=`sed -e "$initialize_author_script" <"$llogout"`
awkscript='
BEGIN {
alphabet = "abcdefghijklmnopqrstuvwxyz"
@@ -644,8 +656,23 @@ $AWK '
}
date = newdate date
}
- time = substr($3, 1, length($3) - 1)
- author = substr($5, 1, length($5)-1)
+ time = ""
+ for (i = 3; i <= NF; i++) {
+ time = time $i
+ if (time ~ /;$/) {
+ time = substr(time, 1, length(time) - 1)
+ break
+ }
+ }
+ i++
+ if ($i == "author:") {
+ author = $(i + 1)
+ if (author ~ /;$/) {
+ author = substr(author, 1, length(author) - 1)
+ }
+ } else {
+ author = ""
+ }
printf "%s%s%s%s%s%s%s%s%s%s", filename, SOH, rev, SOH, date, SOH, time, SOH, author, SOH
rev = "?"
next
@@ -769,7 +796,7 @@ $AWK -F"$SOH" '
# Exit successfully.
-exec rm -fr $logdir
+exec rm -fr "$logdir"
# Local Variables:
# tab-width:4
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 78dcac1399e..594feb08980 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,145 @@
+2014-05-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * cus-face.el (custom-face-attributes): Add :distant-foreground.
+
+2014-05-26 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (window--dump-frame): Remove interactive specification.
+
+2014-05-26 Glenn Morris <rgm@gnu.org>
+
+ * hippie-exp.el (he-line-search-regexp):
+ Handle comint-prompt-regexp containing subgroups. (Bug#17529)
+
+2014-05-26 Stephen Berman <stephen.berman@gmx.net>
+
+ * calendar/todo-mode.el: Remove dependence on auto-mode-alist,
+ to avoid errors when trying to create or visit a file foo.todo
+ located outside to todo-directory, and to allow having such files
+ without them being tied to Todo mode (bug#17482).
+ (todo-show, todo-move-category, todo-merge-category, todo-find-archive)
+ (todo-archive-done-item, todo-find-filtered-items-file)
+ (todo-filter-items, todo-find-item, todo-diary-goto-entry)
+ (todo-category-completions, todo-read-category): When visiting a
+ Todo file, make sure we're in the right mode and the buffer local
+ variables are set.
+ (todo-make-categories-list, todo-reset-nondiary-marker)
+ (todo-reset-done-string, todo-reset-comment-string): After
+ processing all Todo files, kill the buffers of those files that
+ weren't being visited before the processing.
+ (todo-display-as-todo-file, todo-add-to-buffer-list)
+ (todo-visit-files-commands): Comment out.
+ (todo-modes-set-3, todo-mode): Comment out additions to find-file-hook.
+ (auto-mode-alist): Remove add-to-list calls making Todo file
+ extensions unrestrictedly tied to Todo modes.
+
+2014-05-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/nadvice.el (advice--member-p): Change second arg.
+ (advice-function-member-p): Tell it to check both names and functions
+ (bug#17531).
+ (advice--add-function): Adjust call accordingly.
+
+2014-05-26 Stephen Berman <stephen.berman@gmx.net>
+
+ * calendar/todo-mode.el: Miscellaneous bug fixes.
+ (todo-delete-file): When deleting an archive but not its todo
+ file, make sure to update the todo file's category sexp.
+ (todo-move-category): Keep the moved category's name unless the
+ file moved to already has a category with that name. If the
+ numerically last category of the source file was moved, make the
+ first category current to avoid selecting a nonexisting category.
+ (todo-merge-category): Fix implementation to make merging to a
+ category in another file work as documented. Eliminate now
+ insufficient and unnecessary renaming of archive category, correct
+ document string accordingly, and clarify it. If the numerically
+ last category of the source file was merged, make the first
+ category current to avoid selecting a nonexisting category.
+ (todo-archive-done-item): When there are marked items and point
+ happens to be on an unmarked item, ignore the latter. Don't leave
+ point below last item after archiving marked items.
+ (todo-unarchive-items): Fix logic to ensure unarchiving an item
+ from an archive with only one category deletes the archive only
+ when the category is empty after unarchiving. Make sure the todo
+ file's category sexp is updated.
+ (todo-read-file-name): Allow an existing file name even when it is
+ not required (todo-move-category needs this to work as documented).
+ (todo-add-file): Call todo-validate-name to reject the name of an
+ existing todo file (needed due to fix in todo-read-file-name).
+ (todo-reset-nondiary-marker): Also reset in filtered items files.
+ (todo-reset-done-string, todo-reset-comment-string): Also reset in
+ regexp filtered items files.
+ (todo-reset-highlight-item): Also reset in filtered items files.
+ Fix incorrect variable reference in document string.
+
+2014-05-26 Glenn Morris <rgm@gnu.org>
+
+ * window.el (window--dump-frame): Avoid error in --without-x builds.
+
+2014-05-26 Glenn Morris <rgm@gnu.org>
+
+ * nxml/nxml-mode.el (xml-mode): Only define this alias once.
+
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * frame.el (set-frame-font): Doc fix.
+
+ * menu-bar.el (menu-set-font): Doc fix. (Bug#17532)
+
+2014-05-26 Dmitry Gutov <dgutov@yandex.ru>
+
+ * emacs-lisp/package.el (package--download-one-archive): Use
+ `write-region' instead of `save-buffer' to avoid running various
+ hooks. (Bug#17155)
+ (describe-package-1): Same. Insert newline at the end of the
+ buffer if appropriate.
+
+2014-05-26 Juri Linkov <juri@jurta.org>
+
+ * avoid.el (mouse-avoidance-set-mouse-position): Don't raise frame.
+ (mouse-avoidance-ignore-p): Remove `switch-frame', add `focus-out'.
+ Add more modifiers: meta, control, shift, hyper, super, alt.
+ (Bug#17439)
+
+ * avoid.el (mouse-avoidance-banish-position): Fix defcustom :options
+ to allow changing its value with `set-variable'.
+
+2014-05-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/scheme.el (scheme-mode-syntax-table): Remove hack for
+ #; comments.
+ (scheme-syntax-propertize, scheme-syntax-propertize-sexp-comment):
+ New functions.
+ (scheme-mode-variables): Set syntax-propertize-function instead of
+ font-lock-syntactic-face-function.
+ (scheme-font-lock-syntactic-face-function): Delete.
+
+ * emacs-lisp/lisp.el (end-of-defun): Ensure we move (bug#17274).
+
+ * emacs-lisp/timer.el (timer-event-handler): Don't run if canceled
+ (bug#17392).
+
+2014-05-26 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-find-inline-encoding): Do not match "%%t"
+ for a temporary file name.
+
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * simple.el (line-move-ignore-invisible): Doc fix. (Bug#17511)
+
+2014-05-26 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/dbus.el (dbus-init-bus, dbus-call-method)
+ (dbus-call-method-asynchronously, dbus-send-signal)
+ (dbus-method-return-internal, dbus-method-error-internal):
+ Check, whether Emacs has been compiled with D-Bus support. (Bug#17508)
+
+2014-05-26 Nicolas Richard <theonewiththeevillook@yahoo.fr>
+
+ * emacs-lisp/eieio-opt.el (eieio-help-class): Correctly deal with
+ methods which do not have a doc string. (Bug#17490)
+
2014-05-25 Tassilo Horn <tsdh@gnu.org>
* textmodes/reftex-ref.el (reftex-format-special): Make it work
diff --git a/lisp/avoid.el b/lisp/avoid.el
index f3013728931..680e509ceba 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -52,9 +52,6 @@
;;
;; - Using this code does slow Emacs down. "banish" mode shouldn't
;; be too bad, and on my workstation even "animate" is reasonable.
-;;
-;; - It ought to find out where any overlapping frames are and avoid them,
-;; rather than always raising the frame.
;; Credits:
;; This code was helped by all those who contributed suggestions,
@@ -129,9 +126,9 @@ TOP-OR-BOTTOM: banish the mouse to top or bottom of frame or window.
TOP-OR-BOTTOM-POS: Distance from top or bottom edge of frame or window."
:group 'avoid
:version "24.3"
- :type '(alist :key-type symbol :value-type symbol)
- :options '(frame-or-window side (side-pos integer)
- top-or-bottom (top-or-bottom-pos integer)))
+ :type '(alist :key-type symbol :value-type (choice symbol integer))
+ :options '((frame-or-window symbol) (side symbol) (side-pos integer)
+ (top-or-bottom symbol) (top-or-bottom-pos integer)))
;; Internal variables
(defvar mouse-avoidance-state nil)
@@ -172,12 +169,8 @@ Analogous to `mouse-position'."
(defun mouse-avoidance-set-mouse-position (pos)
;; Carefully set mouse position to given position (X . Y)
- ;; Ideally, should check if X,Y is in the current frame, and if not,
- ;; leave the mouse where it was. However, this is currently
- ;; difficult to do, so we just raise the frame to avoid frame switches.
;; Returns t if it moved the mouse.
(let ((f (selected-frame)))
- (raise-frame f)
(set-mouse-position f (car pos) (cdr pos))
t))
@@ -342,12 +335,18 @@ redefine this function to suit your own tastes."
(let ((modifiers (event-modifiers (car last-input-event))))
(or (memq (car last-input-event)
'(mouse-movement scroll-bar-movement
- select-window switch-frame))
+ select-window focus-out))
(memq 'click modifiers)
(memq 'double modifiers)
(memq 'triple modifiers)
(memq 'drag modifiers)
- (memq 'down modifiers)))))))
+ (memq 'down modifiers)
+ (memq 'meta modifiers)
+ (memq 'control modifiers)
+ (memq 'shift modifiers)
+ (memq 'hyper modifiers)
+ (memq 'super modifiers)
+ (memq 'alt modifiers)))))))
(defun mouse-avoidance-banish ()
(if (not (mouse-avoidance-ignore-p))
@@ -403,8 +402,6 @@ Effects of the different modes:
* cat-and-mouse: Same as `animate'.
* proteus: As `animate', but changes the shape of the mouse pointer too.
-Whenever the mouse is moved, the frame is also raised.
-
\(See `mouse-avoidance-threshold' for definition of \"too close\",
and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
definition of \"random distance\".)"
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index f7f2b1d1539..ab2ab3e4cb8 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -566,13 +566,13 @@ less than or equal the category's top priority setting."
;;; Entering and exiting
;; -----------------------------------------------------------------------------
-(defcustom todo-visit-files-commands (list 'find-file 'dired-find-file)
- "List of file finding commands for `todo-display-as-todo-file'.
-Invoking these commands to visit a todo file or todo archive file
-calls `todo-show' or `todo-find-archive', so that the file is
-displayed correctly."
- :type '(repeat function)
- :group 'todo)
+;; (defcustom todo-visit-files-commands (list 'find-file 'dired-find-file)
+;; "List of file finding commands for `todo-display-as-todo-file'.
+;; Invoking these commands to visit a todo file or todo archive file
+;; calls `todo-show' or `todo-find-archive', so that the file is
+;; displayed correctly."
+;; :type '(repeat function)
+;; :group 'todo)
(defun todo-short-file-name (file)
"Return the short form of todo file FILE's name.
@@ -740,9 +740,12 @@ corresponding todo file, displaying the corresponding category."
"Choose a regexp items file: "
rxf) 'regexp))))))
(if (file-exists-p fi-file)
- (set-window-buffer
- (selected-window)
- (set-buffer (find-file-noselect fi-file 'nowarn)))
+ (progn
+ (set-window-buffer
+ (selected-window)
+ (set-buffer (find-file-noselect fi-file 'nowarn)))
+ (unless (derived-mode-p 'todo-filtered-items-mode)
+ (todo-filtered-items-mode)))
(message "There is no %s file for %s"
(cond ((eq todo-show-first 'top)
"top priorities")
@@ -757,6 +760,9 @@ corresponding todo file, displaying the corresponding category."
(unless (todo-check-file file) (throw 'end nil))
(set-window-buffer (selected-window)
(set-buffer (find-file-noselect file 'nowarn)))
+ (if (equal (file-name-extension (buffer-file-name)) "toda")
+ (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
+ (unless (derived-mode-p 'todo-mode) (todo-mode)))
;; When quitting an archive file, show the corresponding
;; category in the corresponding todo file, if it exists.
(when (assoc cat todo-categories)
@@ -1090,6 +1096,9 @@ Noninteractively, return the name of the new file."
(let* ((prompt (concat "Enter name of new todo file "
"(TAB or SPC to see current names): "))
(file (todo-read-file-name prompt)))
+ ;; Don't accept the name of an existing todo file.
+ (setq file (todo-absolute-file-name
+ (todo-validate-name (todo-short-file-name file) 'file)))
(with-current-buffer (get-buffer-create file)
(erase-buffer)
(write-region (point-min) (point-max) file nil 'nomessage nil t)
@@ -1179,10 +1188,28 @@ visiting the deleted files."
(when (file-exists-p file1) (delete-file file1))
(setq todo-visited (delete file1 todo-visited))
(kill-buffer buf1)
- (when delete2
- (when (file-exists-p file2) (delete-file file2))
- (setq todo-visited (delete file2 todo-visited))
- (and buf2 (kill-buffer buf2)))
+ (if delete2
+ (progn
+ (when (file-exists-p file2) (delete-file file2))
+ (setq todo-visited (delete file2 todo-visited))
+ (and buf2 (kill-buffer buf2)))
+ ;; If we deleted an archive but not its todo file, update the
+ ;; latter's category sexp.
+ (when (equal (file-name-extension file2) "todo")
+ (with-current-buffer (or buf2 (find-file-noselect file2))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (let ((sexp (read (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position))))
+ (buffer-read-only nil))
+ (mapc (lambda (x) (aset (cdr x) 3 0)) sexp)
+ (delete-region (line-beginning-position) (line-end-position))
+ (prin1 sexp (current-buffer)))))
+ (todo-set-categories)
+ (unless buf2 (kill-buffer)))))
(setq todo-files (funcall todo-files-function)
todo-archives (funcall todo-files-function t))
(when (or (string= file1-sn todo-default-todo-file)
@@ -1197,7 +1224,8 @@ visiting the deleted files."
(concat "and its "
(cond (todo "archive") (archive "todo"))
" file "))
- "deleted") file1-sn))))
+ "deleted")
+ file1-sn))))
(defvar todo-edit-buffer "*Todo Edit*"
"Name of current buffer in Todo Edit mode.")
@@ -1385,8 +1413,7 @@ the archive of the file moved to, creating it if it does not exist."
"Do you want to proceed? ")))
(let* ((ofile todo-current-todo-file)
(cat (todo-current-category))
- (nfile (todo-read-file-name
- "Todo file to move this category to: " nil))
+ (nfile (todo-read-file-name "Todo file to move this category to: "))
(archive (concat (file-name-sans-extension ofile) ".toda"))
(buffers (append (list ofile)
(unless (zerop (todo-get-count 'archived cat))
@@ -1394,7 +1421,7 @@ the archive of the file moved to, creating it if it does not exist."
new)
(while (equal nfile (file-truename ofile))
(setq nfile (todo-read-file-name
- "Choose a file distinct from this file: " nil)))
+ "Choose a file distinct from this file: ")))
(unless (member nfile todo-files)
(with-current-buffer (get-buffer-create nfile)
(erase-buffer)
@@ -1428,6 +1455,10 @@ the archive of the file moved to, creating it if it does not exist."
(if (member buf (funcall todo-files-function t))
(concat (file-name-sans-extension nfile) ".toda")
nfile))
+ (if (equal (file-name-extension (buffer-file-name)) "toda")
+ (unless (derived-mode-p 'todo-archive-mode)
+ (todo-archive-mode))
+ (unless (derived-mode-p 'todo-mode) (todo-mode)))
(let* ((nfile-short (todo-short-file-name nfile))
(prompt (concat
(format "Todo file \"%s\" already has "
@@ -1453,7 +1484,7 @@ the archive of the file moved to, creating it if it does not exist."
"\\(" (regexp-quote cat) "\\)$") nil t)
(replace-match new nil nil nil 1)))
(setq todo-categories
- (append todo-categories (list (cons new counts))))
+ (append todo-categories (list (cons (or new cat) counts))))
(todo-update-categories-sexp)
;; If archive was just created, save it to avoid "File
;; <xyz> no longer exists!" message on invoking
@@ -1481,6 +1512,8 @@ the archive of the file moved to, creating it if it does not exist."
(setq todo-categories (delete (assoc cat todo-categories)
todo-categories))
(todo-update-categories-sexp)
+ (when (> todo-category-number (length todo-categories))
+ (setq todo-category-number 1))
(todo-category-select)))))
(set-window-buffer (selected-window)
(set-buffer (find-file-noselect nfile)))
@@ -1495,25 +1528,25 @@ choose (with TAB completion) a category in it to merge into;
otherwise, choose and merge into a category in either the
current todo file or a file in `todo-category-completions-files'.
-After merging, the current category's todo and done items are
+After merging, the source category's todo and done items are
appended to the chosen goal category's todo and done items,
respectively. The goal category becomes the current category,
-and the previous current category is deleted.
+and the source category is deleted.
-If both the first and goal categories also have archived items,
-the former are merged to the latter. If only the first category
-has archived items, the archived category is renamed to the goal
-category."
+If both the source and goal categories also have archived items,
+they are also merged. If only the source category has archived
+items, the goal category is added as a new category to the
+archive file and the source category is deleted."
(interactive "P")
(let* ((tfile todo-current-todo-file)
(cat (todo-current-category))
(cat+file (todo-read-category "Merge into category: " 'todo file))
(goal (car cat+file))
(gfile (cdr cat+file))
- (archive (concat (file-name-sans-extension (if file gfile tfile))
- ".toda"))
- archived-count here)
- ;; Merge in todo file.
+ (tarchive (concat (file-name-sans-extension tfile) ".toda"))
+ (garchive (concat (file-name-sans-extension gfile) ".toda"))
+ (archived-count (todo-get-count 'archived))
+ here)
(with-current-buffer (get-buffer (find-file-noselect tfile))
(widen)
(let* ((buffer-read-only nil)
@@ -1536,94 +1569,102 @@ category."
(point-marker))
(point-max-marker))))
(todo (buffer-substring-no-properties tbeg tend))
- (done (buffer-substring-no-properties dbeg cend)))
- (goto-char (point-min))
- ;; Merge any todo items.
- (unless (zerop (length todo))
- (re-search-forward
- (concat "^" (regexp-quote (concat todo-category-beg goal)) "$")
- nil t)
- (re-search-forward
- (concat "^" (regexp-quote todo-category-done)) nil t)
- (forward-line -1)
- (setq here (point-marker))
- (insert todo)
- (todo-update-count 'todo (todo-get-count 'todo cat) goal))
- ;; Merge any done items.
- (unless (zerop (length done))
- (goto-char (if (re-search-forward
- (concat "^" (regexp-quote todo-category-beg)) nil t)
- (match-beginning 0)
- (point-max)))
- (when (zerop (length todo)) (setq here (point-marker)))
- (insert done)
- (todo-update-count 'done (todo-get-count 'done cat) goal))
+ (done (buffer-substring-no-properties dbeg cend))
+ (todo-count (todo-get-count 'todo cat))
+ (done-count (todo-get-count 'done cat)))
+ ;; Merge into goal todo category.
+ (with-current-buffer (get-buffer (find-file-noselect gfile))
+ (unless (derived-mode-p 'todo-mode) (todo-mode))
+ (widen)
+ (goto-char (point-min))
+ (let ((buffer-read-only nil))
+ ;; Merge any todo items.
+ (unless (zerop (length todo))
+ (re-search-forward
+ (concat "^" (regexp-quote (concat todo-category-beg goal)) "$")
+ nil t)
+ (re-search-forward
+ (concat "^" (regexp-quote todo-category-done)) nil t)
+ (forward-line -1)
+ (setq here (point-marker))
+ (insert todo)
+ (todo-update-count 'todo todo-count goal))
+ ;; Merge any done items.
+ (unless (zerop (length done))
+ (goto-char (if (re-search-forward
+ (concat "^" (regexp-quote todo-category-beg))
+ nil t)
+ (match-beginning 0)
+ (point-max)))
+ (when (zerop (length todo)) (setq here (point-marker)))
+ (insert done)
+ (todo-update-count 'done done-count goal)))
+ (todo-update-categories-sexp))
+ ;; Update and clean up source todo file.
(remove-overlays cbeg cend)
(delete-region cbeg cend)
(setq todo-categories (delete (assoc cat todo-categories)
- todo-categories))
+ todo-categories))
(todo-update-categories-sexp)
- (mapc (lambda (m) (set-marker m nil)) (list cbeg tbeg dbeg tend cend))))
- (when (file-exists-p archive)
- ;; Merge in archive file.
- (with-current-buffer (get-buffer (find-file-noselect archive))
+ (when (> todo-category-number (length todo-categories))
+ (setq todo-category-number 1))
+ (todo-category-select)
+ (mapc (lambda (m) (set-marker m nil))
+ (list cbeg tbeg dbeg tend cend))))
+ (when (> archived-count 0)
+ (with-current-buffer (get-buffer (find-file-noselect tarchive))
(widen)
(goto-char (point-min))
- (let ((buffer-read-only nil)
- (cbeg (save-excursion
- (when (re-search-forward
- (concat "^" (regexp-quote
- (concat todo-category-beg cat)) "$")
- nil t)
- (goto-char (match-beginning 0))
- (point-marker))))
- (gbeg (save-excursion
- (when (re-search-forward
- (concat "^" (regexp-quote
- (concat todo-category-beg goal)) "$")
- nil t)
- (goto-char (match-beginning 0))
- (point-marker))))
- cend carch)
- (when cbeg
- (setq archived-count (todo-get-count 'done cat))
- (setq cend (save-excursion
- (if (re-search-forward
- (concat "^" (regexp-quote todo-category-beg))
+ (let* ((buffer-read-only nil)
+ (cbeg (progn
+ (when (re-search-forward
+ (concat "^" (regexp-quote
+ (concat todo-category-beg cat)) "$")
nil t)
+ (goto-char (match-beginning 0))
+ (point-marker))))
+ (cend (if (re-search-forward
+ (concat "^" (regexp-quote todo-category-beg)) nil t)
+ (match-beginning 0)
+ (point-max)))
+ (carch (progn
+ (goto-char cbeg)
+ (forward-line)
+ (buffer-substring-no-properties (point) cend))))
+ ;; Merge into goal archive category, if it exists, else create it.
+ (with-current-buffer (get-buffer (find-file-noselect garchive))
+ (let ((gbeg (when (re-search-forward
+ (concat "^" (regexp-quote
+ (concat todo-category-beg goal))
+ "$")
+ nil t)
+ (goto-char (match-beginning 0))
+ (point-marker))))
+ (goto-char (if (and gbeg
+ (re-search-forward
+ (concat "^" (regexp-quote todo-category-beg))
+ nil t))
(match-beginning 0)
- (point-max))))
- (setq carch (save-excursion (goto-char cbeg) (forward-line)
- (buffer-substring-no-properties (point) cend)))
- ;; If both categories of the merge have archived items, merge the
- ;; source items to the goal items, else "merge" by renaming the
- ;; source category to goal.
- (if gbeg
- (progn
- (goto-char (if (re-search-forward
- (concat "^" (regexp-quote todo-category-beg))
- nil t)
- (match-beginning 0)
- (point-max)))
- (insert carch)
- (remove-overlays cbeg cend)
- (delete-region cbeg cend))
- (goto-char cbeg)
- (search-forward cat)
- (replace-match goal))
- (setq todo-categories (todo-make-categories-list t))
- (todo-update-categories-sexp)))))
- (with-current-buffer (get-file-buffer tfile)
- (when archived-count
- (unless (zerop archived-count)
- (todo-update-count 'archived archived-count goal)
- (todo-update-categories-sexp)))
- (todo-category-number goal)
- ;; If there are only merged done items, show them.
- (let ((todo-show-with-done (zerop (todo-get-count 'todo goal))))
- (todo-category-select)
- ;; Put point on the first merged item.
- (goto-char here)))
+ (point-max)))
+ (unless gbeg (todo-add-category nil goal))
+ (insert carch)
+ (todo-update-categories-sexp)))
+ ;; Update and clean up source archive file.
+ (remove-overlays cbeg cend)
+ (delete-region cbeg cend)
+ (setq todo-categories (todo-make-categories-list t))
+ (todo-update-categories-sexp))))
+ ;; Update goal todo file for merged archived items and display it.
+ (set-window-buffer (selected-window) (set-buffer (get-file-buffer gfile)))
+ (unless (zerop archived-count)
+ (todo-update-count 'archived archived-count goal)
+ (todo-update-categories-sexp))
+ (todo-category-number goal)
+ ;; If there are only merged done items, show them.
+ (let ((todo-show-with-done (zerop (todo-get-count 'todo goal))))
+ (todo-category-select)
+ ;; Put point on the first merged item.
+ (goto-char here))
(set-marker here nil)))
;; -----------------------------------------------------------------------------
@@ -2965,6 +3006,7 @@ displayed."
(when place
(set-window-buffer (selected-window)
(set-buffer (find-file-noselect archive)))
+ (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
(if (member place '(other-archive other-cat))
(setq todo-category-number 1)
(todo-category-number cat))
@@ -2997,7 +3039,7 @@ this category does not exist in the archive, it is created."
(afile (concat (file-name-sans-extension
todo-current-todo-file) ".toda"))
(archive (find-file-noselect afile t))
- (item (and (todo-done-item-p)
+ (item (and (not marked) (todo-done-item-p)
(concat (todo-item-string) "\n")))
(count 0)
(opoint (unless (todo-done-item-p) (point)))
@@ -3040,6 +3082,7 @@ this category does not exist in the archive, it is created."
(if (not (or marked all item))
(throw 'end (message "Only done items can be archived"))
(with-current-buffer archive
+ (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
(let (buffer-read-only)
(widen)
(goto-char (point-min))
@@ -3061,12 +3104,12 @@ this category does not exist in the archive, it is created."
(todo-update-categories-sexp)
;; If archive is new, save to file now (with
;; write-region to avoid prompt for file to save to)
- ;; to update todo-archives, and to let auto-mode-alist
- ;; take effect below on visiting the archive.
+ ;; to update todo-archives, and set the mode for
+ ;; visiting the archive below.
(unless (nth 7 (file-attributes afile))
(write-region nil nil afile t t)
(setq todo-archives (funcall todo-files-function t))
- (kill-buffer))))
+ (todo-archive-mode))))
(with-current-buffer tbuf
(cond
(all
@@ -3092,7 +3135,8 @@ this category does not exist in the archive, it is created."
(todo-update-count 'done -1)
(todo-update-count 'archived 1)
;; Don't leave point below last item.
- (and item (bolp) (eolp) (< (point-min) (point-max))
+ (and (or marked item) (bolp) (eolp)
+ (< (point-min) (point-max))
(todo-backward-item))
(when item
(throw 'done (setq item nil))))
@@ -3182,15 +3226,16 @@ the only category in the archive, the archive file is deleted."
(throw 'done (setq item nil))))
(todo-forward-item))))
(todo-update-count 'done (if marked (- marked-count) -1) cat)
- ;; If that was the last category in the archive, delete the whole file.
- (if (= (length todo-categories) 1)
- (progn
- (delete-file todo-current-todo-file)
- ;; Kill the archive buffer silently.
- (set-buffer-modified-p nil)
- (kill-buffer))
- ;; Otherwise, if the archive category is now empty, delete it.
- (when (eq (point-min) (point-max))
+ ;; If we unarchived the last item in category, then if that was
+ ;; the only category, delete the whole file, otherwise, just
+ ;; delete the category.
+ (when (= 0 (todo-get-count 'done))
+ (if (= 1 (length todo-categories))
+ (progn
+ (delete-file todo-current-todo-file)
+ ;; Kill the archive buffer silently.
+ (set-buffer-modified-p nil)
+ (kill-buffer))
(widen)
(let ((beg (re-search-backward
(concat "^" (regexp-quote todo-category-beg) cat "$")
@@ -3203,8 +3248,8 @@ the only category in the archive, the archive file is deleted."
(remove-overlays beg end)
(delete-region beg end)
(setq todo-categories (delete (assoc cat todo-categories)
- todo-categories))
- (todo-update-categories-sexp))))
+ todo-categories)))))
+ (todo-update-categories-sexp)
;; Visit category in todo file and show restored done items.
(let ((tfile (buffer-file-name tbuf))
(todo-show-with-done t))
@@ -3925,7 +3970,9 @@ regexp items."
(setq file (completing-read "Choose a filtered items file: "
falist nil t nil nil (car falist)))
(setq file (cdr (assoc-string file falist)))
- (find-file file)))
+ (find-file file)
+ (unless (derived-mode-p 'todo-filtered-items-mode)
+ (todo-filtered-items-mode))))
(defun todo-go-to-source-item ()
"Display the file and category of the filtered item at point."
@@ -4056,6 +4103,8 @@ multifile commands for further details."
(completing-read "Choose a regexp items file: "
rxf) 'regexp))))
(find-file fname)
+ (unless (derived-mode-p 'todo-filtered-items-mode)
+ (todo-filtered-items-mode))
(todo-prefix-overlays)
(todo-check-filtered-items-file))
(t
@@ -4309,6 +4358,9 @@ its priority has changed, and `same' otherwise."
todo-global-current-todo-file)))
(find-file-noselect file)
(with-current-buffer (find-buffer-visiting file)
+ (if archive
+ (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
+ (unless (derived-mode-p 'todo-mode) (todo-mode)))
(save-restriction
(widen)
(goto-char (point-min))
@@ -4885,23 +4937,28 @@ the file."
;; Make sure to include newly created archives, e.g. due to
;; todo-move-category.
(when (member archive (funcall todo-files-function t))
- (let ((archive-count 0))
- (with-current-buffer (find-file-noselect archive)
- (widen)
- (goto-char (point-min))
- (when (re-search-forward
- (concat "^" (regexp-quote todo-category-beg)
- cat "$")
- (point-max) t)
- (forward-line)
- (while (not (or (looking-at
- (concat
- (regexp-quote todo-category-beg)
- "\\(.*\\)\n"))
- (eobp)))
- (when (looking-at todo-done-string-start)
- (setq archive-count (1+ archive-count)))
- (forward-line))))
+ (let ((archive-count 0)
+ (visiting (find-buffer-visiting archive)))
+ (with-current-buffer (or visiting
+ (find-file-noselect archive))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (when (re-search-forward
+ (concat "^" (regexp-quote todo-category-beg)
+ cat "$")
+ (point-max) t)
+ (forward-line)
+ (while (not (or (looking-at
+ (concat
+ (regexp-quote todo-category-beg)
+ "\\(.*\\)\n"))
+ (eobp)))
+ (when (looking-at todo-done-string-start)
+ (setq archive-count (1+ archive-count)))
+ (forward-line)))))
+ (unless visiting (kill-buffer)))
(todo-update-count 'archived archive-count cat))))
((looking-at todo-done-string-start)
(todo-update-count 'done 1 cat))
@@ -5125,6 +5182,11 @@ Overrides `diary-goto-entry'."
(if (not (and (file-exists-p file)
(find-file-other-window file)))
(message "Unable to locate this diary entry")
+ ;; If it's a Todo file, make sure it's in Todo mode.
+ (when (and (equal (file-name-directory (file-truename file))
+ (file-truename todo-directory))
+ (not (derived-mode-p 'todo-mode)))
+ (todo-mode))
(when (eq major-mode 'todo-mode) (widen))
(goto-char (point-min))
(when (re-search-forward (format "%s.*\\(%s\\)" date content) nil t)
@@ -5564,6 +5626,9 @@ have been removed."
(add-to-list 'files curfile))
(dolist (f files listall)
(with-current-buffer (find-file-noselect f 'nowarn)
+ (if archive
+ (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
+ (unless (derived-mode-p 'todo-mode) (todo-mode)))
;; Ensure category is properly displayed in case user
;; switches to file via a non-Todo mode command. And if
;; done items in category are visible, keep them visible.
@@ -5616,7 +5681,7 @@ otherwise, a new file name is allowed."
""))))
(unless (file-exists-p todo-directory)
(make-directory todo-directory))
- (unless mustmatch
+ (unless (or mustmatch (member file files))
(setq file (todo-validate-name file 'file)))
(setq file (file-truename (concat todo-directory file
(if archive ".toda" ".todo"))))))
@@ -5649,6 +5714,7 @@ categories from `todo-category-completions-files'."
(categories (cond (file0
(with-current-buffer
(find-file-noselect file0 'nowarn)
+ (unless (derived-mode-p 'todo-mode) (todo-mode))
(let ((todo-current-todo-file file0))
todo-categories)))
((and add (not file))
@@ -5915,8 +5981,9 @@ the empty string (i.e., no time string)."
(defun todo-reset-nondiary-marker (symbol value)
"The :set function for user option `todo-nondiary-marker'."
- (let ((oldvalue (symbol-value symbol))
- (files (append todo-files todo-archives)))
+ (let* ((oldvalue (symbol-value symbol))
+ (files (append todo-files todo-archives
+ (directory-files todo-directory t "\.tod[rty]$" t))))
(custom-set-default symbol value)
;; Need to reset these to get font-locking right.
(setq todo-nondiary-start (nth 0 todo-nondiary-marker)
@@ -5927,23 +5994,28 @@ the empty string (i.e., no time string)."
(regexp-quote diary-nonmarking-symbol) "\\)?"))
(when (not (equal value oldvalue))
(dolist (f files)
- (with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
- (widen)
- (goto-char (point-min))
- (while (not (eobp))
- (if (re-search-forward
- (concat "^\\(" todo-done-string-start "[^][]+] \\)?"
- "\\(?1:" (regexp-quote (car oldvalue))
- "\\)" todo-date-pattern "\\( "
- diary-time-regexp "\\)?\\(?2:"
- (regexp-quote (cadr oldvalue)) "\\)")
- nil t)
- (progn
- (replace-match (nth 0 value) t t nil 1)
- (replace-match (nth 1 value) t t nil 2))
- (forward-line)))
- (todo-category-select)))))))
+ (let ((buf (find-buffer-visiting f)))
+ (with-current-buffer (find-file-noselect f)
+ (let (buffer-read-only)
+ (widen)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (if (re-search-forward
+ (concat "^\\(" todo-done-string-start "[^][]+] \\)?"
+ "\\(?1:" (regexp-quote (car oldvalue))
+ "\\)" todo-date-pattern "\\( "
+ diary-time-regexp "\\)?\\(?2:"
+ (regexp-quote (cadr oldvalue)) "\\)")
+ nil t)
+ (progn
+ (replace-match (nth 0 value) t t nil 1)
+ (replace-match (nth 1 value) t t nil 2))
+ (forward-line)))
+ (if buf
+ (when (derived-mode-p 'todo-mode 'todo-archive-mode)
+ (todo-category-select))
+ (save-buffer)
+ (kill-buffer)))))))))
(defun todo-reset-done-separator-string (symbol value)
"The :set function for `todo-done-separator-string'."
@@ -5963,51 +6035,63 @@ the empty string (i.e., no time string)."
(defun todo-reset-done-string (symbol value)
"The :set function for user option `todo-done-string'."
(let ((oldvalue (symbol-value symbol))
- (files (append todo-files todo-archives)))
+ (files (append todo-files todo-archives
+ (directory-files todo-directory t "\.todr$" t))))
(custom-set-default symbol value)
;; Need to reset this to get font-locking right.
(setq todo-done-string-start
(concat "^\\[" (regexp-quote todo-done-string)))
(when (not (equal value oldvalue))
(dolist (f files)
- (with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
- (widen)
- (goto-char (point-min))
- (while (not (eobp))
- (if (re-search-forward
- (concat "^" (regexp-quote todo-nondiary-start)
- "\\(" (regexp-quote oldvalue) "\\)")
- nil t)
- (replace-match value t t nil 1)
- (forward-line)))
- (todo-category-select)))))))
+ (let ((buf (find-buffer-visiting f)))
+ (with-current-buffer (find-file-noselect f)
+ (let (buffer-read-only)
+ (widen)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (if (re-search-forward
+ (concat "^" (regexp-quote todo-nondiary-start)
+ "\\(" (regexp-quote oldvalue) "\\)")
+ nil t)
+ (replace-match value t t nil 1)
+ (forward-line)))
+ (if buf
+ (when (derived-mode-p 'todo-mode 'todo-archive-mode)
+ (todo-category-select))
+ (save-buffer)
+ (kill-buffer)))))))))
(defun todo-reset-comment-string (symbol value)
"The :set function for user option `todo-comment-string'."
(let ((oldvalue (symbol-value symbol))
- (files (append todo-files todo-archives)))
+ (files (append todo-files todo-archives
+ (directory-files todo-directory t "\.todr$" t))))
(custom-set-default symbol value)
(when (not (equal value oldvalue))
(dolist (f files)
- (with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
- (save-excursion
+ (let ((buf (find-buffer-visiting f)))
+ (with-current-buffer (find-file-noselect f)
+ (let (buffer-read-only)
(widen)
(goto-char (point-min))
(while (not (eobp))
(if (re-search-forward
- (concat
- "\\[\\(" (regexp-quote oldvalue) "\\): [^]]*\\]")
+ (concat "\\[\\(" (regexp-quote oldvalue)
+ "\\): [^]]*\\]")
nil t)
(replace-match value t t nil 1)
(forward-line)))
- (todo-category-select))))))))
+ (if buf
+ (when (derived-mode-p 'todo-mode 'todo-archive-mode)
+ (todo-category-select))
+ (save-buffer)
+ (kill-buffer)))))))))
(defun todo-reset-highlight-item (symbol value)
- "The :set function for `todo-toggle-item-highlighting'."
+ "The :set function for user option `todo-highlight-item'."
(let ((oldvalue (symbol-value symbol))
- (files (append todo-files todo-archives)))
+ (files (append todo-files todo-archives
+ (directory-files todo-directory t "\.tod[rty]$" t))))
(custom-set-default symbol value)
(when (not (equal value oldvalue))
(dolist (f files)
@@ -6399,20 +6483,20 @@ Added to `pre-command-hook' in Todo mode when user option
`todo-show-current-file' is set to non-nil."
(setq todo-global-current-todo-file todo-current-todo-file))
-(defun todo-display-as-todo-file ()
- "Show todo files correctly when visited from outside of Todo mode.
-Added to `find-file-hook' in Todo mode and Todo Archive mode."
- (and (member this-command todo-visit-files-commands)
- (= (- (point-max) (point-min)) (buffer-size))
- (member major-mode '(todo-mode todo-archive-mode))
- (todo-category-select)))
-
-(defun todo-add-to-buffer-list ()
- "Add name of just visited todo file to `todo-file-buffers'.
-This function is added to `find-file-hook' in Todo mode."
- (let ((filename (file-truename (buffer-file-name))))
- (when (member filename todo-files)
- (add-to-list 'todo-file-buffers filename))))
+;; (defun todo-display-as-todo-file ()
+;; "Show todo files correctly when visited from outside of Todo mode.
+;; Added to `find-file-hook' in Todo mode and Todo Archive mode."
+;; (and (member this-command todo-visit-files-commands)
+;; (= (- (point-max) (point-min)) (buffer-size))
+;; (member major-mode '(todo-mode todo-archive-mode))
+;; (todo-category-select)))
+
+;; (defun todo-add-to-buffer-list ()
+;; "Add name of just visited todo file to `todo-file-buffers'.
+;; This function is added to `find-file-hook' in Todo mode."
+;; (let ((filename (file-truename (buffer-file-name))))
+;; (when (member filename todo-files)
+;; (add-to-list 'todo-file-buffers filename))))
(defun todo-update-buffer-list ()
"Make current Todo mode buffer file car of `todo-file-buffers'.
@@ -6467,7 +6551,8 @@ Added to `window-configuration-change-hook' in Todo mode."
"Make some settings that apply to multiple Todo modes."
(setq-local todo-categories (todo-set-categories))
(setq-local todo-category-number 1)
- (add-hook 'find-file-hook 'todo-display-as-todo-file nil t))
+ ;; (add-hook 'find-file-hook 'todo-display-as-todo-file nil t)
+ )
(put 'todo-mode 'mode-class 'special)
@@ -6486,7 +6571,7 @@ Added to `window-configuration-change-hook' in Todo mode."
(setq-local todo-current-todo-file (file-truename (buffer-file-name))))
(setq-local todo-show-done-only nil)
(setq-local todo-categories-with-marks nil)
- (add-hook 'find-file-hook 'todo-add-to-buffer-list nil t)
+ ;; (add-hook 'find-file-hook 'todo-add-to-buffer-list nil t)
(add-hook 'post-command-hook 'todo-update-buffer-list nil t)
(when todo-show-current-file
(add-hook 'pre-command-hook 'todo-show-current-file nil t))
@@ -6555,13 +6640,6 @@ Added to `window-configuration-change-hook' in Todo mode."
(todo-modes-set-1)
(todo-modes-set-2))
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-mode))
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.toda\\'" . todo-archive-mode))
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.tod[tyr]\\'" . todo-filtered-items-mode))
-
;; -----------------------------------------------------------------------------
(provide 'todo-mode)
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 913ef4cb8bf..a9e6f3f5b56 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -218,6 +218,10 @@
(color :tag "Foreground"
:help-echo "Set foreground color (name or #RRGGBB hex spec)."))
+ (:distant-foreground
+ (color :tag "Distant Foreground"
+ :help-echo "Set distant foreground color (name or #RRGGBB hex spec)."))
+
(:background
(color :tag "Background"
:help-echo "Set background color (name or #RRGGBB hex spec)."))
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index a502901a469..ca9b91bed58 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -141,7 +141,7 @@ If CLASS is actually an object, then also display current values of that object.
(insert " " (aref type counter) " "
(prin1-to-string (car cur) (current-buffer))
"\n"
- (cdr cur)))
+ (or (cdr cur) "")))
(setq counter (1+ counter))))
(insert "\n\n")
(setq methods (cdr methods))))))
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 3ff65ff11cd..23b021df177 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -431,16 +431,18 @@ is called as a function to find the defun's end."
(push-mark))
(if (or (null arg) (= arg 0)) (setq arg 1))
(let ((pos (point))
- (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point))))
+ (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point)))
+ (skip (lambda ()
+ ;; When comparing point against pos, we want to consider that if
+ ;; point was right after the end of the function, it's still
+ ;; considered as "in that function".
+ ;; E.g. `eval-defun' from right after the last close-paren.
+ (unless (bolp)
+ (skip-chars-forward " \t")
+ (if (looking-at "\\s<\\|\n")
+ (forward-line 1))))))
(funcall end-of-defun-function)
- ;; When comparing point against pos, we want to consider that if
- ;; point was right after the end of the function, it's still
- ;; considered as "in that function".
- ;; E.g. `eval-defun' from right after the last close-paren.
- (unless (bolp)
- (skip-chars-forward " \t")
- (if (looking-at "\\s<\\|\n")
- (forward-line 1)))
+ (funcall skip)
(cond
((> arg 0)
;; Moving forward.
@@ -463,11 +465,19 @@ is called as a function to find the defun's end."
(goto-char beg))
(unless (zerop arg)
(beginning-of-defun-raw (- arg))
+ (setq beg (point))
(funcall end-of-defun-function))))
- (unless (bolp)
- (skip-chars-forward " \t")
- (if (looking-at "\\s<\\|\n")
- (forward-line 1)))))
+ (funcall skip)
+ (while (and (< arg 0) (>= (point) pos))
+ ;; We intended to move backward, but this ended up not doing so:
+ ;; Try harder!
+ (goto-char beg)
+ (beginning-of-defun-raw (- arg))
+ (if (>= (point) beg)
+ (setq arg 0)
+ (setq beg (point))
+ (funcall end-of-defun-function)
+ (funcall skip)))))
(defun mark-defun (&optional allow-extend)
"Put mark at end of this defun, point at beginning.
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index 66a4f8fdea7..bfd939d69e2 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -180,12 +180,16 @@ WHERE is a symbol to select an entry in `advice--where-alist'."
(advice--make-1 (nth 1 desc) (nth 2 desc)
function main props)))))
-(defun advice--member-p (function name definition)
+(defun advice--member-p (function use-name definition)
(let ((found nil))
(while (and (not found) (advice--p definition))
- (if (if name
- (equal name (cdr (assq 'name (advice--props definition))))
- (equal function (advice--car definition)))
+ (if (if (eq use-name :use-both)
+ (or (equal function
+ (cdr (assq 'name (advice--props definition))))
+ (equal function (advice--car definition)))
+ (equal function (if use-name
+ (cdr (assq 'name (advice--props definition)))
+ (advice--car definition))))
(setq found definition)
(setq definition (advice--cdr definition))))
found))
@@ -292,7 +296,7 @@ is also interactive. There are 3 cases:
;;;###autoload
(defun advice--add-function (where ref function props)
(let* ((name (cdr (assq 'name props)))
- (a (advice--member-p function name (gv-deref ref))))
+ (a (advice--member-p (or name function) (if name t) (gv-deref ref))))
(when a
;; The advice is already present. Remove the old one, first.
(setf (gv-deref ref)
@@ -324,7 +328,7 @@ properties alist that was specified when it was added."
"Return non-nil if ADVICE is already in FUNCTION-DEF.
Instead of ADVICE being the actual function, it can also be the `name'
of the piece of advice."
- (advice--member-p advice advice function-def))
+ (advice--member-p advice :use-both function-def))
;;;; Specific application of add-function to `symbol-function' for advice.
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 5843724a596..e6bc8f9b485 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1266,10 +1266,7 @@ similar to an entry in `package-alist'. Save the cached copy to
;; may fetch a URL redirect page).
(when (listp (read (current-buffer)))
(make-directory dir t)
- (setq buffer-file-name (expand-file-name file dir))
- (let ((version-control 'never)
- (require-final-newline nil))
- (save-buffer))))
+ (write-region nil nil (expand-file-name file dir) nil 'silent)))
(when good-signatures
;; Write out good signatures into archive-contents.signed file.
(write-region (mapconcat #'epg-signature-to-string good-signatures "\n")
@@ -1515,11 +1512,13 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(package--with-work-buffer
(package-archive-base desc)
(format "%s-readme.txt" name)
- (setq buffer-file-name
- (expand-file-name readme package-user-dir))
- (let ((version-control 'never)
- (require-final-newline t))
- (save-buffer))
+ (save-excursion
+ (goto-char (point-max))
+ (unless (bolp)
+ (insert ?\n)))
+ (write-region nil nil
+ (expand-file-name readme package-user-dir)
+ nil 'silent)
(setq readme-string (buffer-string))
t))
(error nil))
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 515bbc36a06..7fc6bf7b920 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -290,42 +290,50 @@ This function is called, by name, directly by the C code."
(cell
;; Delete from queue. Record the cons cell that was used.
(cancel-timer-internal timer)))
- ;; Re-schedule if requested.
- (if (timer--repeat-delay timer)
- (if (timer--idle-delay timer)
- (timer-activate-when-idle timer nil cell)
- (timer-inc-time timer (timer--repeat-delay timer) 0)
- ;; If real time has jumped forward,
- ;; perhaps because Emacs was suspended for a long time,
- ;; limit how many times things get repeated.
- (if (and (numberp timer-max-repeats)
- (< 0 (timer-until timer (current-time))))
- (let ((repeats (/ (timer-until timer (current-time))
- (timer--repeat-delay timer))))
- (if (> repeats timer-max-repeats)
- (timer-inc-time timer (* (timer--repeat-delay timer)
- repeats)))))
- ;; Place it back on the timer-list before running
- ;; timer--function, so it can cancel-timer itself.
- (timer-activate timer t cell)
- (setq retrigger t)))
- ;; Run handler.
- (condition-case-unless-debug err
- ;; Timer functions should not change the current buffer.
- ;; If they do, all kinds of nasty surprises can happen,
- ;; and it can be hellish to track down their source.
- (save-current-buffer
- (apply (timer--function timer) (timer--args timer)))
- (error (message "Error running timer%s: %S"
- (if (symbolp (timer--function timer))
- (format " `%s'" (timer--function timer)) "")
- err)))
- (when (and retrigger
- ;; If the timer's been canceled, don't "retrigger" it
- ;; since it might still be in the copy of timer-list kept
- ;; by keyboard.c:timer_check (bug#14156).
- (memq timer timer-list))
- (setf (timer--triggered timer) nil)))))
+ ;; If `cell' is nil, it means the timer was already canceled, so we
+ ;; shouldn't be running it at all. This can happen for example with the
+ ;; following scenario (bug#17392):
+ ;; - we run timers, starting with A (and remembering the rest as (B C)).
+ ;; - A runs and a does a sit-for.
+ ;; - during sit-for we run timer D which cancels timer B.
+ ;; - timer A finally finishes, so we move on to timers B and C.
+ (when cell
+ ;; Re-schedule if requested.
+ (if (timer--repeat-delay timer)
+ (if (timer--idle-delay timer)
+ (timer-activate-when-idle timer nil cell)
+ (timer-inc-time timer (timer--repeat-delay timer) 0)
+ ;; If real time has jumped forward,
+ ;; perhaps because Emacs was suspended for a long time,
+ ;; limit how many times things get repeated.
+ (if (and (numberp timer-max-repeats)
+ (< 0 (timer-until timer (current-time))))
+ (let ((repeats (/ (timer-until timer (current-time))
+ (timer--repeat-delay timer))))
+ (if (> repeats timer-max-repeats)
+ (timer-inc-time timer (* (timer--repeat-delay timer)
+ repeats)))))
+ ;; Place it back on the timer-list before running
+ ;; timer--function, so it can cancel-timer itself.
+ (timer-activate timer t cell)
+ (setq retrigger t)))
+ ;; Run handler.
+ (condition-case-unless-debug err
+ ;; Timer functions should not change the current buffer.
+ ;; If they do, all kinds of nasty surprises can happen,
+ ;; and it can be hellish to track down their source.
+ (save-current-buffer
+ (apply (timer--function timer) (timer--args timer)))
+ (error (message "Error running timer%s: %S"
+ (if (symbolp (timer--function timer))
+ (format " `%s'" (timer--function timer)) "")
+ err)))
+ (when (and retrigger
+ ;; If the timer's been canceled, don't "retrigger" it
+ ;; since it might still be in the copy of timer-list kept
+ ;; by keyboard.c:timer_check (bug#14156).
+ (memq timer timer-list))
+ (setf (timer--triggered timer) nil))))))
;; This function is incompatible with the one in levents.el.
(defun timeout-event-p (event)
diff --git a/lisp/frame.el b/lisp/frame.el
index f081df788ec..5e9b5351005 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1107,10 +1107,10 @@ number of lines and columns.
If FRAMES is nil, apply the font to the selected frame only.
If FRAMES is non-nil, it should be a list of frames to act upon,
-or t meaning all graphical frames. Also, if FRAME is non-nil,
-alter the user's Customization settings as though the
-font-related attributes of the `default' face had been \"set in
-this session\", so that the font is applied to future frames."
+or t meaning all existing graphical frames.
+Also, if FRAMES is non-nil, alter the user's Customization settings
+as though the font-related attributes of the `default' face had been
+\"set in this session\", so that the font is applied to future frames."
(interactive
(let* ((completion-ignore-case t)
(font (completing-read "Font name: "
@@ -1822,9 +1822,7 @@ terminals, cursor blinking is controlled by the terminal."
:initialize 'custom-initialize-delay
:group 'cursor
:global t
- (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
- (setq blink-cursor-idle-timer nil)
- (blink-cursor-end)
+ (blink-cursor-suspend)
(remove-hook 'focus-in-hook #'blink-cursor-check)
(remove-hook 'focus-out-hook #'blink-cursor-suspend)
(when blink-cursor-mode
diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el
index 51c8c3c3d7e..d3b8a2cf6c5 100644
--- a/lisp/hippie-exp.el
+++ b/lisp/hippie-exp.el
@@ -715,7 +715,7 @@ string). It returns t if a new completion is found, nil otherwise."
(defun he-line-search-regexp (pat strip-prompt)
(if strip-prompt
- (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\("
+ (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(?2:"
(regexp-quote pat)
"[^\n]*[^ \t\n]\\)")
(concat "^\\(\\s-*\\)\\("
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 436d8f611a8..f9cbc62b464 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -662,7 +662,7 @@ by \"Save Options\" in Custom buffers.")
;; Function for setting/saving default font.
(defun menu-set-font ()
- "Interactively select a font and make it the default."
+ "Interactively select a font and make it the default on all existing frames."
(interactive)
(set-frame-font (if (fboundp 'x-select-font)
(x-select-font)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 2f898fa1ba5..cfff1533e48 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -529,7 +529,7 @@ for use at QPOS."
(let* ((qpos pred)
(ustring (funcall unquote string))
(uprefix (funcall unquote (substring string 0 qpos)))
- ;; FIXME: we really should pass `qpos' to `unuote' and have that
+ ;; FIXME: we really should pass `qpos' to `unquote' and have that
;; function give us the corresponding `uqpos'. But for now we
;; presume (more or less) that `concat' and `unquote' commute.
(uqpos (if (string-prefix-p uprefix ustring)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index ca94a343c1a..15f89291af9 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -26,8 +26,6 @@
;; This package provides various useful commands (including help
;; system access) through the mouse. All this code assumes that mouse
;; interpretation has been abstracted into Emacs input events.
-;;
-;; The code is rather X-dependent.
;;; Code:
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 4d146a33248..7f230a9d2ab 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -277,6 +277,8 @@ object is returned instead of a list containing this single Lisp object.
=> \"i686\""
+ (or (featurep 'dbusbind)
+ (signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service)
@@ -380,6 +382,8 @@ Example:
-| i686"
+ (or (featurep 'dbusbind)
+ (signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service)
@@ -428,6 +432,8 @@ Example:
:session nil \"/org/gnu/Emacs\" \"org.gnu.Emacs.FileManager\"
\"FileModified\" \"/home/albinus/.emacs\")"
+ (or (featurep 'dbusbind)
+ (signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus)))
(or (null service) (stringp service)
@@ -446,6 +452,8 @@ Example:
"Return for message SERIAL on the D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el."
+ (or (featurep 'dbusbind)
+ (signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service)
@@ -460,6 +468,8 @@ This is an internal function, it shall not be used outside dbus.el."
"Return error message for message SERIAL on the D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el."
+ (or (featurep 'dbusbind)
+ (signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service)
@@ -1763,6 +1773,8 @@ connection used in the same Emacs process, like the one established by
GTK+. It should be used with care for at least the `:system' and
`:session' buses, because other Emacs Lisp packages might already use
this connection to those buses."
+ (or (featurep 'dbusbind)
+ (signal 'dbus-error (list "Emacs not compiled with dbus support")))
(dbus--init-bus bus private)
(dbus-register-signal
bus nil dbus-path-local dbus-interface-local
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 900e1c812ae..15aa1329817 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4137,7 +4137,7 @@ Goes through the list `tramp-local-coding-commands' and
tmpfile)
(while (string-match (regexp-quote "-") name)
(setq name (replace-match "_" nil t name)))
- (when (string-match "%t" value)
+ (when (string-match "\\(^\\|[^%]\\)%t" value)
(setq tmpfile
(make-temp-name
(expand-file-name
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index cd50bce2152..b3ce7aaac25 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -2630,8 +2630,9 @@ With a prefix argument, inserts the character directly."
(put 'entity-ref 'nxml-friendly-name "entity reference")
(put 'char-ref 'nxml-friendly-name "character reference")
-;;;###autoload
-(defalias 'xml-mode 'nxml-mode)
+;; Only do this in loaddefs, so that if someone defines a different
+;; alias in .emacs, loading this file afterwards does not clobber it.
+;;;###autoload(defalias 'xml-mode 'nxml-mode)
(provide 'nxml-mode)
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index 14f8dd65083..c47a3bd6fbe 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -99,7 +99,7 @@
(modify-syntax-entry ?\( "() " st)
(modify-syntax-entry ?\) ")( " st)
;; It's used for single-line comments as well as for #;(...) sexp-comments.
- (modify-syntax-entry ?\; "< 2 " st)
+ (modify-syntax-entry ?\; "<" st)
(modify-syntax-entry ?\" "\" " st)
(modify-syntax-entry ?' "' " st)
(modify-syntax-entry ?` "' " st)
@@ -147,19 +147,15 @@
(setq-local lisp-indent-function 'scheme-indent-function)
(setq mode-line-process '("" scheme-mode-line-process))
(setq-local imenu-case-fold-search t)
- (setq imenu-generic-expression scheme-imenu-generic-expression)
- (setq-local imenu-syntax-alist
- '(("+-*/.<>=?!$%_&~^:" . "w")))
+ (setq-local imenu-generic-expression scheme-imenu-generic-expression)
+ (setq-local imenu-syntax-alist '(("+-*/.<>=?!$%_&~^:" . "w")))
+ (setq-local syntax-propertize-function #'scheme-syntax-propertize)
(setq font-lock-defaults
'((scheme-font-lock-keywords
scheme-font-lock-keywords-1 scheme-font-lock-keywords-2)
nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14"))
beginning-of-defun
- (font-lock-mark-block-function . mark-defun)
- (font-lock-syntactic-face-function
- . scheme-font-lock-syntactic-face-function)
- (parse-sexp-lookup-properties . t)
- (font-lock-extra-managed-props syntax-table)))
+ (font-lock-mark-block-function . mark-defun)))
(setq-local lisp-doc-string-elt-property 'scheme-doc-string-elt))
(defvar scheme-mode-line-process "")
@@ -354,28 +350,28 @@ See `run-hooks'."
(forward-comment (point-max))
(if (eq (char-after) ?\() 2 0)))
-(defun scheme-font-lock-syntactic-face-function (state)
- (when (and (null (nth 3 state))
- (eq (char-after (nth 8 state)) ?#)
- (eq (char-after (1+ (nth 8 state))) ?\;))
- ;; It's a sexp-comment. Tell parse-partial-sexp where it ends.
- (save-excursion
- (let ((pos (point))
- (end
- (condition-case err
- (let ((parse-sexp-lookup-properties nil))
- (goto-char (+ 2 (nth 8 state)))
- ;; FIXME: this doesn't handle the case where the sexp
- ;; itself contains a #; comment.
- (forward-sexp 1)
- (point))
- (scan-error (nth 2 err)))))
- (when (< pos (- end 2))
- (put-text-property pos (- end 2)
- 'syntax-table scheme-sexp-comment-syntax-table))
- (put-text-property (- end 1) end 'syntax-table '(12)))))
- ;; Choose the face to use.
- (lisp-font-lock-syntactic-face-function state))
+(defun scheme-syntax-propertize (beg end)
+ (goto-char beg)
+ (scheme-syntax-propertize-sexp-comment (point) end)
+ (funcall
+ (syntax-propertize-rules
+ ("\\(#\\);" (1 (prog1 "< cn"
+ (scheme-syntax-propertize-sexp-comment (point) end)))))
+ (point) end))
+
+(defun scheme-syntax-propertize-sexp-comment (_ end)
+ (let ((state (syntax-ppss)))
+ (when (eq 2 (nth 7 state))
+ ;; It's a sexp-comment. Tell parse-partial-sexp where it ends.
+ (condition-case nil
+ (progn
+ (goto-char (+ 2 (nth 8 state)))
+ ;; FIXME: this doesn't handle the case where the sexp
+ ;; itself contains a #; comment.
+ (forward-sexp 1)
+ (put-text-property (1- (point)) (point)
+ 'syntax-table (string-to-syntax "> cn")))
+ (scan-error (goto-char end))))))
;;;###autoload
(define-derived-mode dsssl-mode scheme-mode "DSSSL"
diff --git a/lisp/simple.el b/lisp/simple.el
index af8e47c2383..e5b0203866c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5069,7 +5069,15 @@ When the `track-eol' feature is doing its job, the value is
`most-positive-fixnum'.")
(defcustom line-move-ignore-invisible t
- "Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines.
+ "Non-nil means commands that move by lines ignore invisible newlines.
+When this option is non-nil, \\[next-line], \\[previous-line], \\[move-end-of-line], and \\[move-beginning-of-line] behave
+as if newlines that are invisible didn't exist, and count
+only visible newlines. Thus, moving across across 2 newlines
+one of which is invisible will be counted as a one-line move.
+Also, a non-nil value causes invisible text to be ignored when
+counting columns for the purposes of keeping point in the same
+column by \\[next-line] and \\[previous-line].
+
Outline mode sets this."
:type 'boolean
:group 'editing-basics)
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 703b46eb113..6b064260f95 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -886,10 +886,9 @@ and CVS."
(minor-num (string-to-number (vc-rcs-minor-part rev))))
(concat branch "." (number-to-string (1+ minor-num))))))
-;; Note that most GNU/Linux distributions seem to supply rcs2log in a
-;; standard bin directory. Eg both Red Hat and Debian include it in
-;; their cvs packages. It's not obvious why Emacs still needs to
-;; provide it as well...
+;; You might think that this should be distributed with RCS, but
+;; apparently not. CVS sometimes provides a version of it.
+;; http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00288.html
(defvar vc-rcs-rcs2log-program
(let (exe)
(cond ((file-executable-p
diff --git a/lisp/window.el b/lisp/window.el
index 60f13e65c4e..c5093ca51a5 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1079,7 +1079,6 @@ WINDOW-OR-FRAME can be a frame or a window and defaults to the
selected frame. When WINDOW-OR-FRAME is a window, dump that
window's frame. The buffer *window-frame-dump* is erased before
dumping to it."
- (interactive)
(let* ((window
(cond
((or (not window-or-frame)
@@ -1102,7 +1101,9 @@ dumping to it."
(frame-text-width frame) (frame-text-height frame)
(frame-text-cols frame) (frame-text-lines frame))
(format "tool: %s scroll: %s fringe: %s border: %s right: %s bottom: %s\n\n"
- (tool-bar-height frame t)
+ (if (fboundp 'tool-bar-height)
+ (tool-bar-height frame t)
+ "0")
(frame-scroll-bar-width frame)
(frame-fringe-width frame)
(frame-border-width frame)
diff --git a/src/ChangeLog b/src/ChangeLog
index f40931cbabc..76117451b16 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,52 @@
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (move_it_in_display_line_to): Don't record wrap position
+ if we are iterating over an object that generates glyphs for
+ marginal areas. (Bug#17585)
+
+2014-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * xdisp.c (safe__call1, safe__eval): Now static.
+
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (safe__call): Accept va_list argument instead of '...'.
+ (safe_call, safe__call1): Construct a va_list argument for safe_call.
+ (safe_call1): Call safe_call instead of safe__call directly.
+
+2014-05-26 Ken Brown <kbrown@cornell.edu>
+
+ * w32term.c (x_delete_display) [CYGWIN]: Don't free
+ dpyinfo->w32_id_name, to make sure it doesn't get freed more than
+ once. (Bug#17510)
+
+2014-05-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c: Bind inhibit-quit during pre-redisplay-function.
+ (safe__call, safe__call1, safe__eval): New functions.
+ (safe_call): Use it.
+ (prepare_menu_bars): Use it for pre-redisplay-function (bug#17577).
+ (display_mode_element): Same for `:eval'.
+
+2014-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix port to 32-bit AIX (Bug#17540).
+ * unexaix.c (copy_text_and_data): Don't add text_scnptr to ptr
+ twice. _text already includes this offset.
+ (unrelocate_symbols): Don't cast 64-bit integer to pointer.
+
+2014-05-26 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (move_it_in_display_line_to): Avoid infinite recursion:
+ when closest_pos is identical to to_charpos, don't recurse, since
+ we already tried that, and failed. (Bug#17539)
+
+ * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: If we are
+ unwinding when frame's faces were not initialized yet, increment
+ the frame's image-cache reference count before calling
+ x_free_frame_resources. Don't dereference
+ dpyinfo->terminal->image_cache if it is NULL. (Bug#17524)
+
2014-05-25 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (nsfont_draw): Simplify as arguments are adjusted in
diff --git a/src/lisp.h b/src/lisp.h
index 40dd03c4fc4..2fd28359868 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1718,8 +1718,8 @@ struct Lisp_Hash_Table
ratio, a float. */
Lisp_Object rehash_threshold;
- /* Vector of hash codes.. If hash[I] is nil, this means that that
- entry I is unused. */
+ /* Vector of hash codes. If hash[I] is nil, this means that the
+ I-th entry is unused. */
Lisp_Object hash;
/* Vector used to chain entries. If entry I is free, next[I] is the
diff --git a/src/minibuf.c b/src/minibuf.c
index 06fe0c07df6..3042b13b7d6 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -396,7 +396,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
in previous recursive minibuffer, but was not set explicitly
to t for this invocation, so set it to nil in this minibuffer.
Save the old value now, before we change it. */
- specbind (intern ("minibuffer-completing-file-name"), Vminibuffer_completing_file_name);
+ specbind (intern ("minibuffer-completing-file-name"),
+ Vminibuffer_completing_file_name);
if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil;
diff --git a/src/unexaix.c b/src/unexaix.c
index c08d192b32c..c97d5cae2a8 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -379,7 +379,7 @@ copy_text_and_data (int new)
char *ptr;
lseek (new, text_scnptr, SEEK_SET);
- ptr = _text + text_scnptr;
+ ptr = _text;
end = ptr + f_ohdr.tsize;
write_segment (new, ptr, end);
@@ -606,7 +606,7 @@ unrelocate_symbols (int new, int a_out,
PERROR (a_name);
}
- p = (int *) (ldrel.l_vaddr + d_reloc);
+ p = (int *) (intptr_t) (ldrel.l_vaddr + d_reloc);
switch (ldrel.l_symndx) {
case SYMNDX_TEXT:
diff --git a/src/w32fns.c b/src/w32fns.c
index fa988583f33..c9a83c98234 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4244,6 +4244,17 @@ unwind_create_frame (Lisp_Object frame)
{
#ifdef GLYPH_DEBUG
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
+
+ /* If the frame's image cache refcount is still the same as our
+ private shadow variable, it means we are unwinding a frame
+ for which we didn't yet call init_frame_faces, where the
+ refcount is incremented. Therefore, we increment it here, so
+ that free_frame_faces, called in x_free_frame_resources
+ below, will not mistakenly decrement the counter that was not
+ incremented yet to account for this new frame. */
+ if (FRAME_IMAGE_CACHE (f) != NULL
+ && FRAME_IMAGE_CACHE (f)->refcount == image_cache_refcount)
+ FRAME_IMAGE_CACHE (f)->refcount++;
#endif
x_free_frame_resources (f);
@@ -4254,7 +4265,8 @@ unwind_create_frame (Lisp_Object frame)
eassert (dpyinfo->reference_count == dpyinfo_refcount);
eassert ((dpyinfo->terminal->image_cache == NULL
&& image_cache_refcount == 0)
- || dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
+ || (dpyinfo->terminal->image_cache != NULL
+ && dpyinfo->terminal->image_cache->refcount == image_cache_refcount));
#endif
return Qt;
}
diff --git a/src/w32term.c b/src/w32term.c
index aa65af4afd3..8ca023a86cb 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6419,7 +6419,11 @@ x_delete_display (struct w32_display_info *dpyinfo)
if (dpyinfo->palette)
DeleteObject (dpyinfo->palette);
}
+ /* Avoid freeing dpyinfo->w32_id_name more than once if emacs is
+ running as a daemon; see bug#17510. */
+#ifndef CYGWIN
xfree (dpyinfo->w32_id_name);
+#endif
w32_reset_fringes ();
}
diff --git a/src/xdisp.c b/src/xdisp.c
index ab492d098d0..1585164f439 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2591,8 +2591,8 @@ safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args)
following. Return the result, or nil if something went
wrong. Prevent redisplay during the evaluation. */
-Lisp_Object
-safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
+static Lisp_Object
+safe__call (bool inhibit_quit, ptrdiff_t nargs, Lisp_Object func, va_list ap)
{
Lisp_Object val;
@@ -2600,21 +2600,20 @@ safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
val = Qnil;
else
{
- va_list ap;
ptrdiff_t i;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1;
Lisp_Object *args = alloca (nargs * word_size);
args[0] = func;
- va_start (ap, func);
for (i = 1; i < nargs; i++)
args[i] = va_arg (ap, Lisp_Object);
- va_end (ap);
GCPRO1 (args[0]);
gcpro1.nvars = nargs;
specbind (Qinhibit_redisplay, Qt);
+ if (inhibit_quit)
+ specbind (Qinhibit_quit, Qt);
/* Use Qt to ensure debugger does not run,
so there is no possibility of wanting to redisplay. */
val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
@@ -2626,6 +2625,17 @@ safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
return val;
}
+Lisp_Object
+safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
+{
+ Lisp_Object retval;
+ va_list ap;
+
+ va_start (ap, func);
+ retval = safe__call (false, nargs, func, ap);
+ va_end (ap);
+ return retval;
+}
/* Call function FN with one argument ARG.
Return the result, or nil if something went wrong. */
@@ -2636,12 +2646,30 @@ safe_call1 (Lisp_Object fn, Lisp_Object arg)
return safe_call (2, fn, arg);
}
+static Lisp_Object
+safe__call1 (bool inhibit_quit, Lisp_Object fn, ...)
+{
+ Lisp_Object retval;
+ va_list ap;
+
+ va_start (ap, fn);
+ retval = safe__call (inhibit_quit, 2, fn, ap);
+ va_end (ap);
+ return retval;
+}
+
static Lisp_Object Qeval;
Lisp_Object
safe_eval (Lisp_Object sexpr)
{
- return safe_call1 (Qeval, sexpr);
+ return safe__call1 (false, Qeval, sexpr);
+}
+
+static Lisp_Object
+safe__eval (bool inhibit_quit, Lisp_Object sexpr)
+{
+ return safe__call1 (inhibit_quit, Qeval, sexpr);
}
/* Call function FN with two arguments ARG1 and ARG2.
@@ -8528,7 +8556,7 @@ move_it_in_display_line_to (struct it *it,
}
else
{
- if (it->line_wrap == WORD_WRAP)
+ if (it->line_wrap == WORD_WRAP && it->area == TEXT_AREA)
{
if (IT_DISPLAYING_WHITESPACE (it))
may_wrap = 1;
@@ -8812,8 +8840,11 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
- move_it_in_display_line_to (it, closest_pos, -1,
- MOVE_TO_POS);
+ /* Don't recurse if closest_pos is equal to
+ to_charpos, since we have just tried that. */
+ if (closest_pos != to_charpos)
+ move_it_in_display_line_to (it, closest_pos, -1,
+ MOVE_TO_POS);
result = MOVE_POS_MATCH_OR_ZV;
}
else
@@ -8874,8 +8905,9 @@ move_it_in_display_line_to (struct it *it,
&& !at_eob_p && closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
- move_it_in_display_line_to (it, closest_pos, -1,
- MOVE_TO_POS);
+ if (closest_pos != to_charpos)
+ move_it_in_display_line_to (it, closest_pos, -1,
+ MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;
@@ -8893,7 +8925,9 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
- move_it_in_display_line_to (it, closest_pos, -1, MOVE_TO_POS);
+ if (closest_pos != to_charpos)
+ move_it_in_display_line_to (it, closest_pos, -1,
+ MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;
@@ -11543,7 +11577,7 @@ prepare_menu_bars (void)
}
}
}
- safe_call1 (Vpre_redisplay_function, windows);
+ safe__call1 (true, Vpre_redisplay_function, windows);
}
/* Update all frame titles based on their buffer names, etc. We do
@@ -21857,7 +21891,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
if (CONSP (XCDR (elt)))
{
Lisp_Object spec;
- spec = safe_eval (XCAR (XCDR (elt)));
+ spec = safe__eval (true, XCAR (XCDR (elt)));
n += display_mode_element (it, depth, field_width - n,
precision - n, spec, props,
risky);
diff --git a/test/automated/advice-tests.el b/test/automated/advice-tests.el
index e0c3b40487e..a87d979f919 100644
--- a/test/automated/advice-tests.el
+++ b/test/automated/advice-tests.el
@@ -184,6 +184,7 @@ function being an around advice."
(sm-advice (lambda (x) (if (consp x) (list (* 5 (car x))) (* 4 x)))))
(should (equal (funcall sm-test10 5) 15))
(add-function :filter-args (var sm-test10) sm-advice)
+ (should (advice-function-member-p sm-advice sm-test10))
(should (equal (funcall sm-test10 5) 35))
(add-function :filter-return (var sm-test10) sm-advice)
(should (equal (funcall sm-test10 5) 60))