1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 19:31:02 -08:00

Merge from emacs-24; up to 2014-05-26T10:21:18Z!rgm@gnu.org

This commit is contained in:
Glenn Morris 2014-05-25 19:28:09 -07:00
commit 015936fba1
46 changed files with 898 additions and 445 deletions

View file

@ -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> 2014-05-19 Paul Eggert <eggert@cs.ucla.edu>
Remove dependencies on getdelim and getline. Remove dependencies on getdelim and getline.

View file

@ -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 * mac/uvs.el: New file from Mac port. Generates src/macuvs.h.
by it.
2014-05-17 Paul Eggert <eggert@cs.ucla.edu> 2014-05-17 Paul Eggert <eggert@cs.ucla.edu>

View file

@ -547,7 +547,7 @@ case "${canonical}" in
rs6000-ibm-aix[56]* ) rs6000-ibm-aix[56]* )
opsys=aix4-2 opsys=aix4-2
;; ;;
powerpc-ibm-aix[56]* ) powerpc-ibm-aix[5-9]* | powerpc-ibm-aix[1-9][0-9]* )
opsys=aix4-2 opsys=aix4-2
;; ;;
@ -999,6 +999,15 @@ if test "$opsys" = "mingw32"; then
LN_S="/bin/ln" LN_S="/bin/ln"
fi 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, :, AC_PATH_PROG(INSTALL_INFO, install-info, :,
$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
dnl Don't use GZIP, which is used by gzip for additional parameters. dnl Don't use GZIP, which is used by gzip for additional parameters.

View file

@ -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> 2014-05-14 Eli Zaretskii <eliz@gnu.org>
* mule.texi (Language Environments): Remove unused @anchor. (Bug#17479) * mule.texi (Language Environments): Remove unused @anchor. (Bug#17479)

View file

@ -494,13 +494,14 @@ the mouse cursor to the chosen frame.
@cindex fonts @cindex fonts
By default, Emacs displays text on graphical displays using a 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: a different font:
@itemize @itemize
@item @item
Click on @samp{Set Default Font} in the @samp{Options} menu. To save Click on @samp{Set Default Font} in the @samp{Options} menu. This
this for future sessions, click on @samp{Save Options} in the 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. @samp{Options} menu.
@item @item
@ -513,6 +514,10 @@ Add a line to your init file, modifying the variable
'(font . "DejaVu Sans Mono-10")) '(font . "DejaVu Sans Mono-10"))
@end example @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 defaults file
@cindex X resources file @cindex X resources file
@item @item

View file

@ -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> 2014-05-22 Leo Liu <sdl.web@gmail.com>
* sequences.texi (Sequence Functions): Don't mention when and how * sequences.texi (Sequence Functions): Don't mention when and how

View file

@ -930,12 +930,14 @@ current value of @code{buffer-invisibility-spec}.
@vindex line-move-ignore-invisible @vindex line-move-ignore-invisible
Ordinarily, functions that operate on text or move point do not care Ordinarily, functions that operate on text or move point do not care
whether the text is invisible. The user-level line motion commands whether the text is invisible, they process invisible characters and
ignore invisible newlines if @code{line-move-ignore-invisible} is visible characters alike. The user-level line motion commands,
non-@code{nil} (the default), but only because they are explicitly such as @code{next-line}, @code{previous-line}, ignore invisible
programmed to do so. 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.
However, if a command ends with point inside or at the boundary of If a command ends with point inside or at the boundary of
invisible text, the main editing loop relocates point to one of the invisible text, the main editing loop relocates point to one of the
two ends of the invisible text. Emacs chooses the direction of two ends of the invisible text. Emacs chooses the direction of
relocation so that it is the same as the overall movement 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 to the first visible character that follows the invisible text and then forward
one more character. 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 Incremental search can make invisible overlays visible temporarily
and/or permanently when a match includes invisible text. To enable and/or permanently when a match includes invisible text. To enable
this, the overlay should have a non-@code{nil} this, the overlay should have a non-@code{nil}

View file

@ -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> 2014-05-20 Leo Liu <sdl.web@gmail.com>
* cl.texi (List Functions, Efficiency Concerns): Update cl-endp. * cl.texi (List Functions, Efficiency Concerns): Update cl-endp.

View file

@ -1589,3 +1589,7 @@ A copy of the @code{file} command.
@setchapternewpage odd @setchapternewpage odd
@bye @bye
@c Local Variables:
@c coding: utf-8
@c End:

View file

@ -18208,6 +18208,7 @@ org-customize @key{RET}} and then click yourself through the tree.
@bye @bye
@c Local variables: @c Local variables:
@c coding: utf-8
@c fill-column: 77 @c fill-column: 77
@c indent-tabs-mode: nil @c indent-tabs-mode: nil
@c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$" @c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$"

View file

@ -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}, @code{todo-insert-item}, since these commands are bound to @kbd{t},
@kbd{j} and @kbd{i}, respectively, in Todo mode. @kbd{j} and @kbd{i}, respectively, in Todo mode.
You can also visit a Todo file via @code{find-file} or Dired, like any @c 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 @c other file, and since Emacs recognizes it, the buffer will automatically
be in the appropriate Todo mode. Moreover, as long as the command you @c be in the appropriate Todo mode. Moreover, as long as the command you
use to visit the file is listed in the option @c use to visit the file is listed in the option
@code{todo-visit-files-commands} (which by default contains @c @code{todo-visit-files-commands} (which by default contains
@code{find-file} and @code{dired-find-file}), it will also correctly @c @code{find-file} and @code{dired-find-file}), it will also correctly
display the file's first category on first visiting the file (otherwise @c 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 @c you have to use one of the commands for navigating between categories in
order to get a proper display). @c order to get a proper display).
You can leave Todo mode by typing @kbd{q} (@code{todo-quit}), which 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 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. number key.
The predefined key bindings in Todo are more or less mnemonic. As a 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 control key) are bound to commands applying to categories, sequences
beginning with @kbd{F} apply to (non-archive) file-level commands, and 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 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 @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 text of the new item, and insert this in accordance with the item
insertion options and other parameters passed. If the option insertion options and other parameters passed. If the option
`todo-use-only-highlighted-region' is non-nil, then use the region @code{todo-use-only-highlighted-region} is non-nil, then use the
only when it is highlighted; otherwise, use the region regardless of region only when it is highlighted; otherwise, use the region
highlighting. regardless of highlighting.
@end enumerate @end enumerate
Note that the parameters are divided into five numbered groups; within 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 @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 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 is no longer available for this sequence. Since @kbd{y} is a
continuation key, it is still available, but now the string ":GO!" is continuation key, it is still available, but now the string
appended to the pair to remind you that pressing this key again will @samp{:GO!} is appended to the pair to remind you that pressing this
complete the sequence. key again will complete the sequence.
@ -821,10 +821,10 @@ otherwise it enters the empty string (i.e., no time string).
@noindent @noindent
Editing the text of a lengthy item in the minibuffer can be 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 inconvenient; therefore, if you type @kbd{e e} or @kbd{e h} on an item
text contains more than one logical line, the effect is the same as if whose text contains more than one logical line, the effect is the same
you had typed `e m', that is, you switch a special buffer in Todo Edit as if you had typed @kbd{e m}, that is, you switch a special buffer in
mode. Todo Edit mode.
When you pass any of the parameters of the preceding group, except for When you pass any of the parameters of the preceding group, except for
the @samp{date} parameter, this completes the item editing invocation 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 Press a key (so far `e d'): f=>full c=>calendar a=>today n=>dayname y=>year m=>month d=>daynum
@end example @end example
In addition to the item-level invocations `e y', to change the current In addition to the item-level invocations @kbd{e y}, to change the
item's diary inclusion status, and `e k', to change the current item's current item's diary inclusion status, and @kbd{e k}, to change the
calendar marking status, Todo mode also has two related category-level current item's calendar marking status, Todo mode also has two related
commands: category-level commands:
@table @kbd @table @kbd
@ -932,7 +932,7 @@ category.
@end table @end table
@noindent @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 from all items it is present on, since only diary items can bear
@code{diary-nonmarking-symbol}. @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 category, and take a prefix argument to reverse the effect. (If you
really want to toggle the diary-inclusion and calendar-marking status 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 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 @node Relocating and Removing Items, , Editing Item Headers and Text, Item Editing
@subsection Relocating and Removing Items @subsection Relocating and Removing Items
@ -1050,14 +1050,15 @@ Archive Mode}).
@anchor{todo-item-done} @anchor{todo-item-done}
@item d @item d
This command (@code{todo-item-done}) removes the todo item at point from This command (@code{todo-item-done}) removes the todo item at point
the todo list, appends to the original header a header consisting of from the todo list, appends to the original header a header consisting
@code{todo-done-string} (by default ``DONE '') and the current date, and of @code{todo-done-string} (by default @samp{DONE }) and the current
if @code{todo-always-add-time-string} is enabled, also the current time, date, and if @code{todo-always-add-time-string} is enabled, also the
and adds the resulting done item to the top of the done items section of current time, and adds the resulting done item to the top of the done
the category. Invoked with a prefix argument, it also prompts you to items section of the category. Invoked with a prefix argument, it
enter a comment, which is appended to the end of the done item, prefixed also prompts you to enter a comment, which is appended to the end of
with @code{todo-comment-string} (by default ``COMMENT: ''). the done item, prefixed with @code{todo-comment-string} (by default
@samp{COMMENT: }).
@end table @end table
A category's done items section is located below the last todo (i.e., 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 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 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 Archive mode, this switches to the corresponding todo file and shows the
todo category corresponding to the archive category you were just todo category corresponding to the archive category you were just
visiting. visiting.
@ -1396,13 +1397,13 @@ to sort by archived item counts.
Each row of the table is also buttonized; pressing one of these exits 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 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 you had invoked @kbd{F c}, and displays the category that was named in
row button you pressed (i.e., pressing this button jumps to that 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 category). However, if the category named in the row is in a todo
and all of its items have been archived, and you have enabled the option file and all of its items have been archived, and you have enabled the
@code{todo-skip-archived-categories}, then pressing the button jumps to option @code{todo-skip-archived-categories}, then pressing the button
the archive category instead of the empty todo category. You can jumps to the archive category instead of the empty todo category. You
recognize such categories by their items counts in the table---all can recognize such categories by their items counts in the table---all
columns but the archived one have counts of zero---and in addition, 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 their lines in the table are also distinguished from the others by a
different face (@pxref{Faces}). 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} 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}. and @kbd{F t m}, set the number to @samp{0}.
@item @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 which specifies the number of top priorities in each category just for
this invocation, overriding both @code{todo-top-priorities-overrides} and this invocation, overriding both @code{todo-top-priorities-overrides} and
@code{todo-top-priorities}. @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 Aside from explicitly invoking an item filtering command to display a
saved list of items filtered by a given method from given todo files, 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 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 @table @kbd
@item F f @item F f

View file

@ -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> 2014-05-17 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Assume C99 or later (Bug#17487). * NEWS: Assume C99 or later (Bug#17487).

View file

@ -1,4 +1,4 @@
-*- indented-text -*- -*- mode: indented-text; coding: utf-8 -*-
See the end of this file for copyright information. See the end of this file for copyright information.

View file

@ -1476,7 +1476,6 @@ This is like the old `eval-after-load', but better behaved.
*** `generic-make-keywords-list' *** `generic-make-keywords-list'
*** `get-upcase-table' (use `case-table-get-table' instead). *** `get-upcase-table' (use `case-table-get-table' instead).
+++
** `with-wrapper-hook' is obsoleted by `add-function'. ** `with-wrapper-hook' is obsoleted by `add-function'.
The few hooks that used with-wrapper-hook are replaced as follows: The few hooks that used with-wrapper-hook are replaced as follows:
*** `abbrev-expand-function' obsoletes `abbrev-expand-functions'. *** `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: Local variables:
coding: utf-8
mode: outline mode: outline
paragraph-separate: "[ ]*$" paragraph-separate: "[ ]*$"
end: end:

View file

@ -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: doc http://orgmode.org/worg/doc.html#%s
#+LINK: git http://orgmode.org/w/?p=org-mode.git;a=commit;h=%s #+LINK: git http://orgmode.org/w/?p=org-mode.git;a=commit;h=%s

View file

@ -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> 2014-05-19 Paul Eggert <eggert@cs.ucla.edu>
Remove dependencies on getline and getdelim. Remove dependencies on getline and getdelim.

View file

@ -205,11 +205,19 @@ month_data='
m[9]="Oct"; m[10]="Nov"; m[11]="Dec" m[9]="Oct"; m[10]="Nov"; m[11]="Dec"
' '
logdir=$TMPDIR/rcs2log$$ if type mktemp >/dev/null 2>&1; then
llogout=$logdir/l 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 exit 1 2 13 15
trap "rm -fr $logdir 2>/dev/null" 0 trap "rm -fr \"$logdir\" 2>/dev/null" 0
(umask 077 && exec mkdir $logdir) || exit
llogout=$logdir/l
# If no rlog-format log file is given, generate one into $rlogfile. # If no rlog-format log file is given, generate one into $rlogfile.
case $rlogfile in case $rlogfile in
@ -417,10 +425,10 @@ case $loginFullnameMailaddrs in
?*) ?*)
case $loginFullnameMailaddrs in case $loginFullnameMailaddrs in
*\"* | *\\*) *\"* | *\\*)
sed 's/["\\]/\\&/g' >$llogout <<EOF || exit sed 's/["\\]/\\&/g' >"$llogout" <<EOF || exit
$loginFullnameMailaddrs $loginFullnameMailaddrs
EOF EOF
loginFullnameMailaddrs=`cat $llogout`;; loginFullnameMailaddrs=`cat "$llogout"`;;
esac esac
oldIFS=$IFS oldIFS=$IFS
@ -442,29 +450,33 @@ esac
case $logins in case $logins in
?*) ?*)
sort -u -o $llogout <<EOF sort -u -o "$llogout" <<EOF
$logins $logins
EOF EOF
;; ;;
'') '')
: ;; : ;;
esac >$llogout || exit esac >"$llogout" || exit
output_authors='/^date: / { 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 ~ /^[^;]*;$/) { cvsformat = $5 == "author:"
print substr($5, 1, length($5)-1) 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=` authors=`
$AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - $llogout $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - "$llogout"
` `
case $authors in case $authors in
?*) ?*)
cat >$llogout <<EOF || exit cat >"$llogout" <<EOF || exit
$authors $authors
EOF EOF
initialize_author_script='s/["\\]/\\&/g; s/.*/author[\"&\"] = 1/' 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=' awkscript='
BEGIN { BEGIN {
alphabet = "abcdefghijklmnopqrstuvwxyz" alphabet = "abcdefghijklmnopqrstuvwxyz"
@ -644,8 +656,23 @@ $AWK '
} }
date = newdate date date = newdate date
} }
time = substr($3, 1, length($3) - 1) time = ""
author = substr($5, 1, length($5)-1) 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 printf "%s%s%s%s%s%s%s%s%s%s", filename, SOH, rev, SOH, date, SOH, time, SOH, author, SOH
rev = "?" rev = "?"
next next
@ -769,7 +796,7 @@ $AWK -F"$SOH" '
# Exit successfully. # Exit successfully.
exec rm -fr $logdir exec rm -fr "$logdir"
# Local Variables: # Local Variables:
# tab-width:4 # tab-width:4

View file

@ -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> 2014-05-25 Tassilo Horn <tsdh@gnu.org>
* textmodes/reftex-ref.el (reftex-format-special): Make it work * textmodes/reftex-ref.el (reftex-format-special): Make it work

View file

@ -52,9 +52,6 @@
;; ;;
;; - Using this code does slow Emacs down. "banish" mode shouldn't ;; - Using this code does slow Emacs down. "banish" mode shouldn't
;; be too bad, and on my workstation even "animate" is reasonable. ;; 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: ;; Credits:
;; This code was helped by all those who contributed suggestions, ;; 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." TOP-OR-BOTTOM-POS: Distance from top or bottom edge of frame or window."
:group 'avoid :group 'avoid
:version "24.3" :version "24.3"
:type '(alist :key-type symbol :value-type symbol) :type '(alist :key-type symbol :value-type (choice symbol integer))
:options '(frame-or-window side (side-pos integer) :options '((frame-or-window symbol) (side symbol) (side-pos integer)
top-or-bottom (top-or-bottom-pos integer))) (top-or-bottom symbol) (top-or-bottom-pos integer)))
;; Internal variables ;; Internal variables
(defvar mouse-avoidance-state nil) (defvar mouse-avoidance-state nil)
@ -172,12 +169,8 @@ Analogous to `mouse-position'."
(defun mouse-avoidance-set-mouse-position (pos) (defun mouse-avoidance-set-mouse-position (pos)
;; Carefully set mouse position to given position (X . Y) ;; 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. ;; Returns t if it moved the mouse.
(let ((f (selected-frame))) (let ((f (selected-frame)))
(raise-frame f)
(set-mouse-position f (car pos) (cdr pos)) (set-mouse-position f (car pos) (cdr pos))
t)) t))
@ -342,12 +335,18 @@ redefine this function to suit your own tastes."
(let ((modifiers (event-modifiers (car last-input-event)))) (let ((modifiers (event-modifiers (car last-input-event))))
(or (memq (car last-input-event) (or (memq (car last-input-event)
'(mouse-movement scroll-bar-movement '(mouse-movement scroll-bar-movement
select-window switch-frame)) select-window focus-out))
(memq 'click modifiers) (memq 'click modifiers)
(memq 'double modifiers) (memq 'double modifiers)
(memq 'triple modifiers) (memq 'triple modifiers)
(memq 'drag 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 () (defun mouse-avoidance-banish ()
(if (not (mouse-avoidance-ignore-p)) (if (not (mouse-avoidance-ignore-p))
@ -403,8 +402,6 @@ Effects of the different modes:
* cat-and-mouse: Same as `animate'. * cat-and-mouse: Same as `animate'.
* proteus: As `animate', but changes the shape of the mouse pointer too. * 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\", \(See `mouse-avoidance-threshold' for definition of \"too close\",
and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
definition of \"random distance\".)" definition of \"random distance\".)"

View file

@ -566,13 +566,13 @@ less than or equal the category's top priority setting."
;;; Entering and exiting ;;; Entering and exiting
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
(defcustom todo-visit-files-commands (list 'find-file 'dired-find-file) ;; (defcustom todo-visit-files-commands (list 'find-file 'dired-find-file)
"List of file finding commands for `todo-display-as-todo-file'. ;; "List of file finding commands for `todo-display-as-todo-file'.
Invoking these commands to visit a todo file or todo archive 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 ;; calls `todo-show' or `todo-find-archive', so that the file is
displayed correctly." ;; displayed correctly."
:type '(repeat function) ;; :type '(repeat function)
:group 'todo) ;; :group 'todo)
(defun todo-short-file-name (file) (defun todo-short-file-name (file)
"Return the short form of todo file FILE's name. "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: " "Choose a regexp items file: "
rxf) 'regexp)))))) rxf) 'regexp))))))
(if (file-exists-p fi-file) (if (file-exists-p fi-file)
(set-window-buffer (progn
(selected-window) (set-window-buffer
(set-buffer (find-file-noselect fi-file 'nowarn))) (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" (message "There is no %s file for %s"
(cond ((eq todo-show-first 'top) (cond ((eq todo-show-first 'top)
"top priorities") "top priorities")
@ -757,6 +760,9 @@ corresponding todo file, displaying the corresponding category."
(unless (todo-check-file file) (throw 'end nil)) (unless (todo-check-file file) (throw 'end nil))
(set-window-buffer (selected-window) (set-window-buffer (selected-window)
(set-buffer (find-file-noselect file 'nowarn))) (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 ;; When quitting an archive file, show the corresponding
;; category in the corresponding todo file, if it exists. ;; category in the corresponding todo file, if it exists.
(when (assoc cat todo-categories) (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 " (let* ((prompt (concat "Enter name of new todo file "
"(TAB or SPC to see current names): ")) "(TAB or SPC to see current names): "))
(file (todo-read-file-name prompt))) (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) (with-current-buffer (get-buffer-create file)
(erase-buffer) (erase-buffer)
(write-region (point-min) (point-max) file nil 'nomessage nil t) (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)) (when (file-exists-p file1) (delete-file file1))
(setq todo-visited (delete file1 todo-visited)) (setq todo-visited (delete file1 todo-visited))
(kill-buffer buf1) (kill-buffer buf1)
(when delete2 (if delete2
(when (file-exists-p file2) (delete-file file2)) (progn
(setq todo-visited (delete file2 todo-visited)) (when (file-exists-p file2) (delete-file file2))
(and buf2 (kill-buffer buf2))) (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) (setq todo-files (funcall todo-files-function)
todo-archives (funcall todo-files-function t)) todo-archives (funcall todo-files-function t))
(when (or (string= file1-sn todo-default-todo-file) (when (or (string= file1-sn todo-default-todo-file)
@ -1197,7 +1224,8 @@ visiting the deleted files."
(concat "and its " (concat "and its "
(cond (todo "archive") (archive "todo")) (cond (todo "archive") (archive "todo"))
" file ")) " file "))
"deleted") file1-sn)))) "deleted")
file1-sn))))
(defvar todo-edit-buffer "*Todo Edit*" (defvar todo-edit-buffer "*Todo Edit*"
"Name of current buffer in Todo Edit mode.") "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? "))) "Do you want to proceed? ")))
(let* ((ofile todo-current-todo-file) (let* ((ofile todo-current-todo-file)
(cat (todo-current-category)) (cat (todo-current-category))
(nfile (todo-read-file-name (nfile (todo-read-file-name "Todo file to move this category to: "))
"Todo file to move this category to: " nil))
(archive (concat (file-name-sans-extension ofile) ".toda")) (archive (concat (file-name-sans-extension ofile) ".toda"))
(buffers (append (list ofile) (buffers (append (list ofile)
(unless (zerop (todo-get-count 'archived cat)) (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) new)
(while (equal nfile (file-truename ofile)) (while (equal nfile (file-truename ofile))
(setq nfile (todo-read-file-name (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) (unless (member nfile todo-files)
(with-current-buffer (get-buffer-create nfile) (with-current-buffer (get-buffer-create nfile)
(erase-buffer) (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)) (if (member buf (funcall todo-files-function t))
(concat (file-name-sans-extension nfile) ".toda") (concat (file-name-sans-extension nfile) ".toda")
nfile)) 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)) (let* ((nfile-short (todo-short-file-name nfile))
(prompt (concat (prompt (concat
(format "Todo file \"%s\" already has " (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) "\\(" (regexp-quote cat) "\\)$") nil t)
(replace-match new nil nil nil 1))) (replace-match new nil nil nil 1)))
(setq todo-categories (setq todo-categories
(append todo-categories (list (cons new counts)))) (append todo-categories (list (cons (or new cat) counts))))
(todo-update-categories-sexp) (todo-update-categories-sexp)
;; If archive was just created, save it to avoid "File ;; If archive was just created, save it to avoid "File
;; <xyz> no longer exists!" message on invoking ;; <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) (setq todo-categories (delete (assoc cat todo-categories)
todo-categories)) todo-categories))
(todo-update-categories-sexp) (todo-update-categories-sexp)
(when (> todo-category-number (length todo-categories))
(setq todo-category-number 1))
(todo-category-select))))) (todo-category-select)))))
(set-window-buffer (selected-window) (set-window-buffer (selected-window)
(set-buffer (find-file-noselect nfile))) (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 otherwise, choose and merge into a category in either the
current todo file or a file in `todo-category-completions-files'. 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, appended to the chosen goal category's todo and done items,
respectively. The goal category becomes the current category, 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, If both the source and goal categories also have archived items,
the former are merged to the latter. If only the first category they are also merged. If only the source category has archived
has archived items, the archived category is renamed to the goal items, the goal category is added as a new category to the
category." archive file and the source category is deleted."
(interactive "P") (interactive "P")
(let* ((tfile todo-current-todo-file) (let* ((tfile todo-current-todo-file)
(cat (todo-current-category)) (cat (todo-current-category))
(cat+file (todo-read-category "Merge into category: " 'todo file)) (cat+file (todo-read-category "Merge into category: " 'todo file))
(goal (car cat+file)) (goal (car cat+file))
(gfile (cdr cat+file)) (gfile (cdr cat+file))
(archive (concat (file-name-sans-extension (if file gfile tfile)) (tarchive (concat (file-name-sans-extension tfile) ".toda"))
".toda")) (garchive (concat (file-name-sans-extension gfile) ".toda"))
archived-count here) (archived-count (todo-get-count 'archived))
;; Merge in todo file. here)
(with-current-buffer (get-buffer (find-file-noselect tfile)) (with-current-buffer (get-buffer (find-file-noselect tfile))
(widen) (widen)
(let* ((buffer-read-only nil) (let* ((buffer-read-only nil)
@ -1536,94 +1569,102 @@ category."
(point-marker)) (point-marker))
(point-max-marker)))) (point-max-marker))))
(todo (buffer-substring-no-properties tbeg tend)) (todo (buffer-substring-no-properties tbeg tend))
(done (buffer-substring-no-properties dbeg cend))) (done (buffer-substring-no-properties dbeg cend))
(goto-char (point-min)) (todo-count (todo-get-count 'todo cat))
;; Merge any todo items. (done-count (todo-get-count 'done cat)))
(unless (zerop (length todo)) ;; Merge into goal todo category.
(re-search-forward (with-current-buffer (get-buffer (find-file-noselect gfile))
(concat "^" (regexp-quote (concat todo-category-beg goal)) "$") (unless (derived-mode-p 'todo-mode) (todo-mode))
nil t) (widen)
(re-search-forward (goto-char (point-min))
(concat "^" (regexp-quote todo-category-done)) nil t) (let ((buffer-read-only nil))
(forward-line -1) ;; Merge any todo items.
(setq here (point-marker)) (unless (zerop (length todo))
(insert todo) (re-search-forward
(todo-update-count 'todo (todo-get-count 'todo cat) goal)) (concat "^" (regexp-quote (concat todo-category-beg goal)) "$")
;; Merge any done items. nil t)
(unless (zerop (length done)) (re-search-forward
(goto-char (if (re-search-forward (concat "^" (regexp-quote todo-category-done)) nil t)
(concat "^" (regexp-quote todo-category-beg)) nil t) (forward-line -1)
(match-beginning 0) (setq here (point-marker))
(point-max))) (insert todo)
(when (zerop (length todo)) (setq here (point-marker))) (todo-update-count 'todo todo-count goal))
(insert done) ;; Merge any done items.
(todo-update-count 'done (todo-get-count 'done cat) goal)) (unless (zerop (length done))
(remove-overlays cbeg cend) (goto-char (if (re-search-forward
(delete-region cbeg cend)
(setq todo-categories (delete (assoc cat 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))
(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)) (concat "^" (regexp-quote todo-category-beg))
nil t) nil t)
(match-beginning 0) (match-beginning 0)
(point-max)))) (point-max)))
(setq carch (save-excursion (goto-char cbeg) (forward-line) (when (zerop (length todo)) (setq here (point-marker)))
(buffer-substring-no-properties (point) cend))) (insert done)
;; If both categories of the merge have archived items, merge the (todo-update-count 'done done-count goal)))
;; source items to the goal items, else "merge" by renaming the (todo-update-categories-sexp))
;; source category to goal. ;; Update and clean up source todo file.
(if gbeg (remove-overlays cbeg cend)
(progn (delete-region cbeg cend)
(goto-char (if (re-search-forward (setq todo-categories (delete (assoc cat todo-categories)
(concat "^" (regexp-quote todo-category-beg)) todo-categories))
nil t) (todo-update-categories-sexp)
(match-beginning 0) (when (> todo-category-number (length todo-categories))
(point-max))) (setq todo-category-number 1))
(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) (todo-category-select)
;; Put point on the first merged item. (mapc (lambda (m) (set-marker m nil))
(goto-char here))) (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 (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)))
(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))) (set-marker here nil)))
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
@ -2965,6 +3006,7 @@ displayed."
(when place (when place
(set-window-buffer (selected-window) (set-window-buffer (selected-window)
(set-buffer (find-file-noselect archive))) (set-buffer (find-file-noselect archive)))
(unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
(if (member place '(other-archive other-cat)) (if (member place '(other-archive other-cat))
(setq todo-category-number 1) (setq todo-category-number 1)
(todo-category-number cat)) (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 (afile (concat (file-name-sans-extension
todo-current-todo-file) ".toda")) todo-current-todo-file) ".toda"))
(archive (find-file-noselect afile t)) (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"))) (concat (todo-item-string) "\n")))
(count 0) (count 0)
(opoint (unless (todo-done-item-p) (point))) (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)) (if (not (or marked all item))
(throw 'end (message "Only done items can be archived")) (throw 'end (message "Only done items can be archived"))
(with-current-buffer archive (with-current-buffer archive
(unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
(let (buffer-read-only) (let (buffer-read-only)
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
@ -3061,12 +3104,12 @@ this category does not exist in the archive, it is created."
(todo-update-categories-sexp) (todo-update-categories-sexp)
;; If archive is new, save to file now (with ;; If archive is new, save to file now (with
;; write-region to avoid prompt for file to save to) ;; write-region to avoid prompt for file to save to)
;; to update todo-archives, and to let auto-mode-alist ;; to update todo-archives, and set the mode for
;; take effect below on visiting the archive. ;; visiting the archive below.
(unless (nth 7 (file-attributes afile)) (unless (nth 7 (file-attributes afile))
(write-region nil nil afile t t) (write-region nil nil afile t t)
(setq todo-archives (funcall todo-files-function t)) (setq todo-archives (funcall todo-files-function t))
(kill-buffer)))) (todo-archive-mode))))
(with-current-buffer tbuf (with-current-buffer tbuf
(cond (cond
(all (all
@ -3092,7 +3135,8 @@ this category does not exist in the archive, it is created."
(todo-update-count 'done -1) (todo-update-count 'done -1)
(todo-update-count 'archived 1) (todo-update-count 'archived 1)
;; Don't leave point below last item. ;; 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)) (todo-backward-item))
(when item (when item
(throw 'done (setq item nil)))) (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)))) (throw 'done (setq item nil))))
(todo-forward-item)))) (todo-forward-item))))
(todo-update-count 'done (if marked (- marked-count) -1) cat) (todo-update-count 'done (if marked (- marked-count) -1) cat)
;; If that was the last category in the archive, delete the whole file. ;; If we unarchived the last item in category, then if that was
(if (= (length todo-categories) 1) ;; the only category, delete the whole file, otherwise, just
(progn ;; delete the category.
(delete-file todo-current-todo-file) (when (= 0 (todo-get-count 'done))
;; Kill the archive buffer silently. (if (= 1 (length todo-categories))
(set-buffer-modified-p nil) (progn
(kill-buffer)) (delete-file todo-current-todo-file)
;; Otherwise, if the archive category is now empty, delete it. ;; Kill the archive buffer silently.
(when (eq (point-min) (point-max)) (set-buffer-modified-p nil)
(kill-buffer))
(widen) (widen)
(let ((beg (re-search-backward (let ((beg (re-search-backward
(concat "^" (regexp-quote todo-category-beg) cat "$") (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) (remove-overlays beg end)
(delete-region beg end) (delete-region beg end)
(setq todo-categories (delete (assoc cat todo-categories) (setq todo-categories (delete (assoc cat todo-categories)
todo-categories)) todo-categories)))))
(todo-update-categories-sexp)))) (todo-update-categories-sexp)
;; Visit category in todo file and show restored done items. ;; Visit category in todo file and show restored done items.
(let ((tfile (buffer-file-name tbuf)) (let ((tfile (buffer-file-name tbuf))
(todo-show-with-done t)) (todo-show-with-done t))
@ -3925,7 +3970,9 @@ regexp items."
(setq file (completing-read "Choose a filtered items file: " (setq file (completing-read "Choose a filtered items file: "
falist nil t nil nil (car falist))) falist nil t nil nil (car falist)))
(setq file (cdr (assoc-string file 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 () (defun todo-go-to-source-item ()
"Display the file and category of the filtered item at point." "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: " (completing-read "Choose a regexp items file: "
rxf) 'regexp)))) rxf) 'regexp))))
(find-file fname) (find-file fname)
(unless (derived-mode-p 'todo-filtered-items-mode)
(todo-filtered-items-mode))
(todo-prefix-overlays) (todo-prefix-overlays)
(todo-check-filtered-items-file)) (todo-check-filtered-items-file))
(t (t
@ -4309,6 +4358,9 @@ its priority has changed, and `same' otherwise."
todo-global-current-todo-file))) todo-global-current-todo-file)))
(find-file-noselect file) (find-file-noselect file)
(with-current-buffer (find-buffer-visiting 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 (save-restriction
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
@ -4885,23 +4937,28 @@ the file."
;; Make sure to include newly created archives, e.g. due to ;; Make sure to include newly created archives, e.g. due to
;; todo-move-category. ;; todo-move-category.
(when (member archive (funcall todo-files-function t)) (when (member archive (funcall todo-files-function t))
(let ((archive-count 0)) (let ((archive-count 0)
(with-current-buffer (find-file-noselect archive) (visiting (find-buffer-visiting archive)))
(widen) (with-current-buffer (or visiting
(goto-char (point-min)) (find-file-noselect archive))
(when (re-search-forward (save-excursion
(concat "^" (regexp-quote todo-category-beg) (save-restriction
cat "$") (widen)
(point-max) t) (goto-char (point-min))
(forward-line) (when (re-search-forward
(while (not (or (looking-at (concat "^" (regexp-quote todo-category-beg)
(concat cat "$")
(regexp-quote todo-category-beg) (point-max) t)
"\\(.*\\)\n")) (forward-line)
(eobp))) (while (not (or (looking-at
(when (looking-at todo-done-string-start) (concat
(setq archive-count (1+ archive-count))) (regexp-quote todo-category-beg)
(forward-line)))) "\\(.*\\)\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)))) (todo-update-count 'archived archive-count cat))))
((looking-at todo-done-string-start) ((looking-at todo-done-string-start)
(todo-update-count 'done 1 cat)) (todo-update-count 'done 1 cat))
@ -5125,6 +5182,11 @@ Overrides `diary-goto-entry'."
(if (not (and (file-exists-p file) (if (not (and (file-exists-p file)
(find-file-other-window file))) (find-file-other-window file)))
(message "Unable to locate this diary entry") (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)) (when (eq major-mode 'todo-mode) (widen))
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward (format "%s.*\\(%s\\)" date content) nil t) (when (re-search-forward (format "%s.*\\(%s\\)" date content) nil t)
@ -5564,6 +5626,9 @@ have been removed."
(add-to-list 'files curfile)) (add-to-list 'files curfile))
(dolist (f files listall) (dolist (f files listall)
(with-current-buffer (find-file-noselect f 'nowarn) (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 ;; Ensure category is properly displayed in case user
;; switches to file via a non-Todo mode command. And if ;; switches to file via a non-Todo mode command. And if
;; done items in category are visible, keep them visible. ;; 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) (unless (file-exists-p todo-directory)
(make-directory todo-directory)) (make-directory todo-directory))
(unless mustmatch (unless (or mustmatch (member file files))
(setq file (todo-validate-name file 'file))) (setq file (todo-validate-name file 'file)))
(setq file (file-truename (concat todo-directory file (setq file (file-truename (concat todo-directory file
(if archive ".toda" ".todo")))))) (if archive ".toda" ".todo"))))))
@ -5649,6 +5714,7 @@ categories from `todo-category-completions-files'."
(categories (cond (file0 (categories (cond (file0
(with-current-buffer (with-current-buffer
(find-file-noselect file0 'nowarn) (find-file-noselect file0 'nowarn)
(unless (derived-mode-p 'todo-mode) (todo-mode))
(let ((todo-current-todo-file file0)) (let ((todo-current-todo-file file0))
todo-categories))) todo-categories)))
((and add (not file)) ((and add (not file))
@ -5915,8 +5981,9 @@ the empty string (i.e., no time string)."
(defun todo-reset-nondiary-marker (symbol value) (defun todo-reset-nondiary-marker (symbol value)
"The :set function for user option `todo-nondiary-marker'." "The :set function for user option `todo-nondiary-marker'."
(let ((oldvalue (symbol-value symbol)) (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) (custom-set-default symbol value)
;; Need to reset these to get font-locking right. ;; Need to reset these to get font-locking right.
(setq todo-nondiary-start (nth 0 todo-nondiary-marker) (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) "\\)?")) (regexp-quote diary-nonmarking-symbol) "\\)?"))
(when (not (equal value oldvalue)) (when (not (equal value oldvalue))
(dolist (f files) (dolist (f files)
(with-current-buffer (find-file-noselect f) (let ((buf (find-buffer-visiting f)))
(let (buffer-read-only) (with-current-buffer (find-file-noselect f)
(widen) (let (buffer-read-only)
(goto-char (point-min)) (widen)
(while (not (eobp)) (goto-char (point-min))
(if (re-search-forward (while (not (eobp))
(concat "^\\(" todo-done-string-start "[^][]+] \\)?" (if (re-search-forward
"\\(?1:" (regexp-quote (car oldvalue)) (concat "^\\(" todo-done-string-start "[^][]+] \\)?"
"\\)" todo-date-pattern "\\( " "\\(?1:" (regexp-quote (car oldvalue))
diary-time-regexp "\\)?\\(?2:" "\\)" todo-date-pattern "\\( "
(regexp-quote (cadr oldvalue)) "\\)") diary-time-regexp "\\)?\\(?2:"
nil t) (regexp-quote (cadr oldvalue)) "\\)")
(progn nil t)
(replace-match (nth 0 value) t t nil 1) (progn
(replace-match (nth 1 value) t t nil 2)) (replace-match (nth 0 value) t t nil 1)
(forward-line))) (replace-match (nth 1 value) t t nil 2))
(todo-category-select))))))) (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) (defun todo-reset-done-separator-string (symbol value)
"The :set function for `todo-done-separator-string'." "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) (defun todo-reset-done-string (symbol value)
"The :set function for user option `todo-done-string'." "The :set function for user option `todo-done-string'."
(let ((oldvalue (symbol-value symbol)) (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) (custom-set-default symbol value)
;; Need to reset this to get font-locking right. ;; Need to reset this to get font-locking right.
(setq todo-done-string-start (setq todo-done-string-start
(concat "^\\[" (regexp-quote todo-done-string))) (concat "^\\[" (regexp-quote todo-done-string)))
(when (not (equal value oldvalue)) (when (not (equal value oldvalue))
(dolist (f files) (dolist (f files)
(with-current-buffer (find-file-noselect f) (let ((buf (find-buffer-visiting f)))
(let (buffer-read-only) (with-current-buffer (find-file-noselect f)
(widen) (let (buffer-read-only)
(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)))))))
(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)))
(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
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
(while (not (eobp)) (while (not (eobp))
(if (re-search-forward (if (re-search-forward
(concat (concat "^" (regexp-quote todo-nondiary-start)
"\\[\\(" (regexp-quote oldvalue) "\\): [^]]*\\]") "\\(" (regexp-quote oldvalue) "\\)")
nil t) nil t)
(replace-match value t t nil 1) (replace-match value t t nil 1)
(forward-line))) (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-comment-string (symbol value)
"The :set function for user option `todo-comment-string'."
(let ((oldvalue (symbol-value symbol))
(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)
(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)
"\\): [^]]*\\]")
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-highlight-item (symbol value) (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)) (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) (custom-set-default symbol value)
(when (not (equal value oldvalue)) (when (not (equal value oldvalue))
(dolist (f files) (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." `todo-show-current-file' is set to non-nil."
(setq todo-global-current-todo-file todo-current-todo-file)) (setq todo-global-current-todo-file todo-current-todo-file))
(defun todo-display-as-todo-file () ;; (defun todo-display-as-todo-file ()
"Show todo files correctly when visited from outside of Todo mode. ;; "Show todo files correctly when visited from outside of Todo mode.
Added to `find-file-hook' in Todo mode and Todo Archive mode." ;; Added to `find-file-hook' in Todo mode and Todo Archive mode."
(and (member this-command todo-visit-files-commands) ;; (and (member this-command todo-visit-files-commands)
(= (- (point-max) (point-min)) (buffer-size)) ;; (= (- (point-max) (point-min)) (buffer-size))
(member major-mode '(todo-mode todo-archive-mode)) ;; (member major-mode '(todo-mode todo-archive-mode))
(todo-category-select))) ;; (todo-category-select)))
(defun todo-add-to-buffer-list () ;; (defun todo-add-to-buffer-list ()
"Add name of just visited todo file to `todo-file-buffers'. ;; "Add name of just visited todo file to `todo-file-buffers'.
This function is added to `find-file-hook' in Todo mode." ;; This function is added to `find-file-hook' in Todo mode."
(let ((filename (file-truename (buffer-file-name)))) ;; (let ((filename (file-truename (buffer-file-name))))
(when (member filename todo-files) ;; (when (member filename todo-files)
(add-to-list 'todo-file-buffers filename)))) ;; (add-to-list 'todo-file-buffers filename))))
(defun todo-update-buffer-list () (defun todo-update-buffer-list ()
"Make current Todo mode buffer file car of `todo-file-buffers'. "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." "Make some settings that apply to multiple Todo modes."
(setq-local todo-categories (todo-set-categories)) (setq-local todo-categories (todo-set-categories))
(setq-local todo-category-number 1) (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) (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-current-todo-file (file-truename (buffer-file-name))))
(setq-local todo-show-done-only nil) (setq-local todo-show-done-only nil)
(setq-local todo-categories-with-marks 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) (add-hook 'post-command-hook 'todo-update-buffer-list nil t)
(when todo-show-current-file (when todo-show-current-file
(add-hook 'pre-command-hook 'todo-show-current-file nil t)) (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-1)
(todo-modes-set-2)) (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) (provide 'todo-mode)

View file

@ -218,6 +218,10 @@
(color :tag "Foreground" (color :tag "Foreground"
:help-echo "Set foreground color (name or #RRGGBB hex spec).")) :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 (:background
(color :tag "Background" (color :tag "Background"
:help-echo "Set background color (name or #RRGGBB hex spec).")) :help-echo "Set background color (name or #RRGGBB hex spec)."))

View file

@ -141,7 +141,7 @@ If CLASS is actually an object, then also display current values of that object.
(insert " " (aref type counter) " " (insert " " (aref type counter) " "
(prin1-to-string (car cur) (current-buffer)) (prin1-to-string (car cur) (current-buffer))
"\n" "\n"
(cdr cur))) (or (cdr cur) "")))
(setq counter (1+ counter)))) (setq counter (1+ counter))))
(insert "\n\n") (insert "\n\n")
(setq methods (cdr methods)))))) (setq methods (cdr methods))))))

View file

@ -431,16 +431,18 @@ is called as a function to find the defun's end."
(push-mark)) (push-mark))
(if (or (null arg) (= arg 0)) (setq arg 1)) (if (or (null arg) (= arg 0)) (setq arg 1))
(let ((pos (point)) (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) (funcall end-of-defun-function)
;; When comparing point against pos, we want to consider that if (funcall skip)
;; 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)))
(cond (cond
((> arg 0) ((> arg 0)
;; Moving forward. ;; Moving forward.
@ -463,11 +465,19 @@ is called as a function to find the defun's end."
(goto-char beg)) (goto-char beg))
(unless (zerop arg) (unless (zerop arg)
(beginning-of-defun-raw (- arg)) (beginning-of-defun-raw (- arg))
(setq beg (point))
(funcall end-of-defun-function)))) (funcall end-of-defun-function))))
(unless (bolp) (funcall skip)
(skip-chars-forward " \t") (while (and (< arg 0) (>= (point) pos))
(if (looking-at "\\s<\\|\n") ;; We intended to move backward, but this ended up not doing so:
(forward-line 1))))) ;; 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) (defun mark-defun (&optional allow-extend)
"Put mark at end of this defun, point at beginning. "Put mark at end of this defun, point at beginning.

View file

@ -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) (advice--make-1 (nth 1 desc) (nth 2 desc)
function main props))))) function main props)))))
(defun advice--member-p (function name definition) (defun advice--member-p (function use-name definition)
(let ((found nil)) (let ((found nil))
(while (and (not found) (advice--p definition)) (while (and (not found) (advice--p definition))
(if (if name (if (if (eq use-name :use-both)
(equal name (cdr (assq 'name (advice--props definition)))) (or (equal function
(equal function (advice--car definition))) (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 found definition)
(setq definition (advice--cdr definition)))) (setq definition (advice--cdr definition))))
found)) found))
@ -292,7 +296,7 @@ is also interactive. There are 3 cases:
;;;###autoload ;;;###autoload
(defun advice--add-function (where ref function props) (defun advice--add-function (where ref function props)
(let* ((name (cdr (assq 'name 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 (when a
;; The advice is already present. Remove the old one, first. ;; The advice is already present. Remove the old one, first.
(setf (gv-deref ref) (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. "Return non-nil if ADVICE is already in FUNCTION-DEF.
Instead of ADVICE being the actual function, it can also be the `name' Instead of ADVICE being the actual function, it can also be the `name'
of the piece of advice." 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. ;;;; Specific application of add-function to `symbol-function' for advice.

View file

@ -1266,10 +1266,7 @@ similar to an entry in `package-alist'. Save the cached copy to
;; may fetch a URL redirect page). ;; may fetch a URL redirect page).
(when (listp (read (current-buffer))) (when (listp (read (current-buffer)))
(make-directory dir t) (make-directory dir t)
(setq buffer-file-name (expand-file-name file dir)) (write-region nil nil (expand-file-name file dir) nil 'silent)))
(let ((version-control 'never)
(require-final-newline nil))
(save-buffer))))
(when good-signatures (when good-signatures
;; Write out good signatures into archive-contents.signed file. ;; Write out good signatures into archive-contents.signed file.
(write-region (mapconcat #'epg-signature-to-string good-signatures "\n") (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--with-work-buffer
(package-archive-base desc) (package-archive-base desc)
(format "%s-readme.txt" name) (format "%s-readme.txt" name)
(setq buffer-file-name (save-excursion
(expand-file-name readme package-user-dir)) (goto-char (point-max))
(let ((version-control 'never) (unless (bolp)
(require-final-newline t)) (insert ?\n)))
(save-buffer)) (write-region nil nil
(expand-file-name readme package-user-dir)
nil 'silent)
(setq readme-string (buffer-string)) (setq readme-string (buffer-string))
t)) t))
(error nil)) (error nil))

View file

@ -290,42 +290,50 @@ This function is called, by name, directly by the C code."
(cell (cell
;; Delete from queue. Record the cons cell that was used. ;; Delete from queue. Record the cons cell that was used.
(cancel-timer-internal timer))) (cancel-timer-internal timer)))
;; Re-schedule if requested. ;; If `cell' is nil, it means the timer was already canceled, so we
(if (timer--repeat-delay timer) ;; shouldn't be running it at all. This can happen for example with the
(if (timer--idle-delay timer) ;; following scenario (bug#17392):
(timer-activate-when-idle timer nil cell) ;; - we run timers, starting with A (and remembering the rest as (B C)).
(timer-inc-time timer (timer--repeat-delay timer) 0) ;; - A runs and a does a sit-for.
;; If real time has jumped forward, ;; - during sit-for we run timer D which cancels timer B.
;; perhaps because Emacs was suspended for a long time, ;; - timer A finally finishes, so we move on to timers B and C.
;; limit how many times things get repeated. (when cell
(if (and (numberp timer-max-repeats) ;; Re-schedule if requested.
(< 0 (timer-until timer (current-time)))) (if (timer--repeat-delay timer)
(let ((repeats (/ (timer-until timer (current-time)) (if (timer--idle-delay timer)
(timer--repeat-delay timer)))) (timer-activate-when-idle timer nil cell)
(if (> repeats timer-max-repeats) (timer-inc-time timer (timer--repeat-delay timer) 0)
(timer-inc-time timer (* (timer--repeat-delay timer) ;; If real time has jumped forward,
repeats))))) ;; perhaps because Emacs was suspended for a long time,
;; Place it back on the timer-list before running ;; limit how many times things get repeated.
;; timer--function, so it can cancel-timer itself. (if (and (numberp timer-max-repeats)
(timer-activate timer t cell) (< 0 (timer-until timer (current-time))))
(setq retrigger t))) (let ((repeats (/ (timer-until timer (current-time))
;; Run handler. (timer--repeat-delay timer))))
(condition-case-unless-debug err (if (> repeats timer-max-repeats)
;; Timer functions should not change the current buffer. (timer-inc-time timer (* (timer--repeat-delay timer)
;; If they do, all kinds of nasty surprises can happen, repeats)))))
;; and it can be hellish to track down their source. ;; Place it back on the timer-list before running
(save-current-buffer ;; timer--function, so it can cancel-timer itself.
(apply (timer--function timer) (timer--args timer))) (timer-activate timer t cell)
(error (message "Error running timer%s: %S" (setq retrigger t)))
(if (symbolp (timer--function timer)) ;; Run handler.
(format " `%s'" (timer--function timer)) "") (condition-case-unless-debug err
err))) ;; Timer functions should not change the current buffer.
(when (and retrigger ;; If they do, all kinds of nasty surprises can happen,
;; If the timer's been canceled, don't "retrigger" it ;; and it can be hellish to track down their source.
;; since it might still be in the copy of timer-list kept (save-current-buffer
;; by keyboard.c:timer_check (bug#14156). (apply (timer--function timer) (timer--args timer)))
(memq timer timer-list)) (error (message "Error running timer%s: %S"
(setf (timer--triggered timer) nil))))) (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. ;; This function is incompatible with the one in levents.el.
(defun timeout-event-p (event) (defun timeout-event-p (event)

View file

@ -1107,10 +1107,10 @@ number of lines and columns.
If FRAMES is nil, apply the font to the selected frame only. 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, 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, or t meaning all existing graphical frames.
alter the user's Customization settings as though the Also, if FRAMES is non-nil, alter the user's Customization settings
font-related attributes of the `default' face had been \"set in as though the font-related attributes of the `default' face had been
this session\", so that the font is applied to future frames." \"set in this session\", so that the font is applied to future frames."
(interactive (interactive
(let* ((completion-ignore-case t) (let* ((completion-ignore-case t)
(font (completing-read "Font name: " (font (completing-read "Font name: "
@ -1822,9 +1822,7 @@ terminals, cursor blinking is controlled by the terminal."
:initialize 'custom-initialize-delay :initialize 'custom-initialize-delay
:group 'cursor :group 'cursor
:global t :global t
(if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) (blink-cursor-suspend)
(setq blink-cursor-idle-timer nil)
(blink-cursor-end)
(remove-hook 'focus-in-hook #'blink-cursor-check) (remove-hook 'focus-in-hook #'blink-cursor-check)
(remove-hook 'focus-out-hook #'blink-cursor-suspend) (remove-hook 'focus-out-hook #'blink-cursor-suspend)
(when blink-cursor-mode (when blink-cursor-mode

View file

@ -715,7 +715,7 @@ string). It returns t if a new completion is found, nil otherwise."
(defun he-line-search-regexp (pat strip-prompt) (defun he-line-search-regexp (pat strip-prompt)
(if strip-prompt (if strip-prompt
(concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(" (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(?2:"
(regexp-quote pat) (regexp-quote pat)
"[^\n]*[^ \t\n]\\)") "[^\n]*[^ \t\n]\\)")
(concat "^\\(\\s-*\\)\\(" (concat "^\\(\\s-*\\)\\("

View file

@ -662,7 +662,7 @@ by \"Save Options\" in Custom buffers.")
;; Function for setting/saving default font. ;; Function for setting/saving default font.
(defun menu-set-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) (interactive)
(set-frame-font (if (fboundp 'x-select-font) (set-frame-font (if (fboundp 'x-select-font)
(x-select-font) (x-select-font)

View file

@ -529,7 +529,7 @@ for use at QPOS."
(let* ((qpos pred) (let* ((qpos pred)
(ustring (funcall unquote string)) (ustring (funcall unquote string))
(uprefix (funcall unquote (substring string 0 qpos))) (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 ;; function give us the corresponding `uqpos'. But for now we
;; presume (more or less) that `concat' and `unquote' commute. ;; presume (more or less) that `concat' and `unquote' commute.
(uqpos (if (string-prefix-p uprefix ustring) (uqpos (if (string-prefix-p uprefix ustring)

View file

@ -26,8 +26,6 @@
;; This package provides various useful commands (including help ;; This package provides various useful commands (including help
;; system access) through the mouse. All this code assumes that mouse ;; system access) through the mouse. All this code assumes that mouse
;; interpretation has been abstracted into Emacs input events. ;; interpretation has been abstracted into Emacs input events.
;;
;; The code is rather X-dependent.
;;; Code: ;;; Code:

View file

@ -277,6 +277,8 @@ object is returned instead of a list containing this single Lisp object.
=> \"i686\"" => \"i686\""
(or (featurep 'dbusbind)
(signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus) (or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus))) (signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service) (or (stringp service)
@ -380,6 +382,8 @@ Example:
-| i686" -| i686"
(or (featurep 'dbusbind)
(signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus) (or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus))) (signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service) (or (stringp service)
@ -428,6 +432,8 @@ Example:
:session nil \"/org/gnu/Emacs\" \"org.gnu.Emacs.FileManager\" :session nil \"/org/gnu/Emacs\" \"org.gnu.Emacs.FileManager\"
\"FileModified\" \"/home/albinus/.emacs\")" \"FileModified\" \"/home/albinus/.emacs\")"
(or (featurep 'dbusbind)
(signal 'dbus-error (list "Emacs not compiled with dbus support")))
(or (memq bus '(:system :session)) (stringp bus) (or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus))) (signal 'wrong-type-argument (list 'keywordp bus)))
(or (null service) (stringp service) (or (null service) (stringp service)
@ -446,6 +452,8 @@ Example:
"Return for message SERIAL on the D-Bus BUS. "Return for message SERIAL on the D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el." 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) (or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus))) (signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service) (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. "Return error message for message SERIAL on the D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el." 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) (or (memq bus '(:system :session)) (stringp bus)
(signal 'wrong-type-argument (list 'keywordp bus))) (signal 'wrong-type-argument (list 'keywordp bus)))
(or (stringp service) (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 GTK+. It should be used with care for at least the `:system' and
`:session' buses, because other Emacs Lisp packages might already use `:session' buses, because other Emacs Lisp packages might already use
this connection to those buses." this connection to those buses."
(or (featurep 'dbusbind)
(signal 'dbus-error (list "Emacs not compiled with dbus support")))
(dbus--init-bus bus private) (dbus--init-bus bus private)
(dbus-register-signal (dbus-register-signal
bus nil dbus-path-local dbus-interface-local bus nil dbus-path-local dbus-interface-local

View file

@ -4137,7 +4137,7 @@ Goes through the list `tramp-local-coding-commands' and
tmpfile) tmpfile)
(while (string-match (regexp-quote "-") name) (while (string-match (regexp-quote "-") name)
(setq name (replace-match "_" nil t name))) (setq name (replace-match "_" nil t name)))
(when (string-match "%t" value) (when (string-match "\\(^\\|[^%]\\)%t" value)
(setq tmpfile (setq tmpfile
(make-temp-name (make-temp-name
(expand-file-name (expand-file-name

View file

@ -2630,8 +2630,9 @@ With a prefix argument, inserts the character directly."
(put 'entity-ref 'nxml-friendly-name "entity reference") (put 'entity-ref 'nxml-friendly-name "entity reference")
(put 'char-ref 'nxml-friendly-name "character reference") (put 'char-ref 'nxml-friendly-name "character reference")
;;;###autoload ;; Only do this in loaddefs, so that if someone defines a different
(defalias 'xml-mode 'nxml-mode) ;; alias in .emacs, loading this file afterwards does not clobber it.
;;;###autoload(defalias 'xml-mode 'nxml-mode)
(provide 'nxml-mode) (provide 'nxml-mode)

View file

@ -99,7 +99,7 @@
(modify-syntax-entry ?\( "() " st) (modify-syntax-entry ?\( "() " st)
(modify-syntax-entry ?\) ")( " st) (modify-syntax-entry ?\) ")( " st)
;; It's used for single-line comments as well as for #;(...) sexp-comments. ;; 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) (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-local lisp-indent-function 'scheme-indent-function)
(setq mode-line-process '("" scheme-mode-line-process)) (setq mode-line-process '("" scheme-mode-line-process))
(setq-local imenu-case-fold-search t) (setq-local imenu-case-fold-search t)
(setq imenu-generic-expression scheme-imenu-generic-expression) (setq-local imenu-generic-expression scheme-imenu-generic-expression)
(setq-local imenu-syntax-alist (setq-local imenu-syntax-alist '(("+-*/.<>=?!$%_&~^:" . "w")))
'(("+-*/.<>=?!$%_&~^:" . "w"))) (setq-local syntax-propertize-function #'scheme-syntax-propertize)
(setq font-lock-defaults (setq font-lock-defaults
'((scheme-font-lock-keywords '((scheme-font-lock-keywords
scheme-font-lock-keywords-1 scheme-font-lock-keywords-2) scheme-font-lock-keywords-1 scheme-font-lock-keywords-2)
nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14")) nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14"))
beginning-of-defun beginning-of-defun
(font-lock-mark-block-function . mark-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)))
(setq-local lisp-doc-string-elt-property 'scheme-doc-string-elt)) (setq-local lisp-doc-string-elt-property 'scheme-doc-string-elt))
(defvar scheme-mode-line-process "") (defvar scheme-mode-line-process "")
@ -354,28 +350,28 @@ See `run-hooks'."
(forward-comment (point-max)) (forward-comment (point-max))
(if (eq (char-after) ?\() 2 0))) (if (eq (char-after) ?\() 2 0)))
(defun scheme-font-lock-syntactic-face-function (state) (defun scheme-syntax-propertize (beg end)
(when (and (null (nth 3 state)) (goto-char beg)
(eq (char-after (nth 8 state)) ?#) (scheme-syntax-propertize-sexp-comment (point) end)
(eq (char-after (1+ (nth 8 state))) ?\;)) (funcall
;; It's a sexp-comment. Tell parse-partial-sexp where it ends. (syntax-propertize-rules
(save-excursion ("\\(#\\);" (1 (prog1 "< cn"
(let ((pos (point)) (scheme-syntax-propertize-sexp-comment (point) end)))))
(end (point) end))
(condition-case err
(let ((parse-sexp-lookup-properties nil)) (defun scheme-syntax-propertize-sexp-comment (_ end)
(goto-char (+ 2 (nth 8 state))) (let ((state (syntax-ppss)))
;; FIXME: this doesn't handle the case where the sexp (when (eq 2 (nth 7 state))
;; itself contains a #; comment. ;; It's a sexp-comment. Tell parse-partial-sexp where it ends.
(forward-sexp 1) (condition-case nil
(point)) (progn
(scan-error (nth 2 err))))) (goto-char (+ 2 (nth 8 state)))
(when (< pos (- end 2)) ;; FIXME: this doesn't handle the case where the sexp
(put-text-property pos (- end 2) ;; itself contains a #; comment.
'syntax-table scheme-sexp-comment-syntax-table)) (forward-sexp 1)
(put-text-property (- end 1) end 'syntax-table '(12))))) (put-text-property (1- (point)) (point)
;; Choose the face to use. 'syntax-table (string-to-syntax "> cn")))
(lisp-font-lock-syntactic-face-function state)) (scan-error (goto-char end))))))
;;;###autoload ;;;###autoload
(define-derived-mode dsssl-mode scheme-mode "DSSSL" (define-derived-mode dsssl-mode scheme-mode "DSSSL"

View file

@ -5069,7 +5069,15 @@ When the `track-eol' feature is doing its job, the value is
`most-positive-fixnum'.") `most-positive-fixnum'.")
(defcustom line-move-ignore-invisible t (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." Outline mode sets this."
:type 'boolean :type 'boolean
:group 'editing-basics) :group 'editing-basics)

View file

@ -886,10 +886,9 @@ and CVS."
(minor-num (string-to-number (vc-rcs-minor-part rev)))) (minor-num (string-to-number (vc-rcs-minor-part rev))))
(concat branch "." (number-to-string (1+ minor-num)))))) (concat branch "." (number-to-string (1+ minor-num))))))
;; Note that most GNU/Linux distributions seem to supply rcs2log in a ;; You might think that this should be distributed with RCS, but
;; standard bin directory. Eg both Red Hat and Debian include it in ;; apparently not. CVS sometimes provides a version of it.
;; their cvs packages. It's not obvious why Emacs still needs to ;; http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00288.html
;; provide it as well...
(defvar vc-rcs-rcs2log-program (defvar vc-rcs-rcs2log-program
(let (exe) (let (exe)
(cond ((file-executable-p (cond ((file-executable-p

View file

@ -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 selected frame. When WINDOW-OR-FRAME is a window, dump that
window's frame. The buffer *window-frame-dump* is erased before window's frame. The buffer *window-frame-dump* is erased before
dumping to it." dumping to it."
(interactive)
(let* ((window (let* ((window
(cond (cond
((or (not window-or-frame) ((or (not window-or-frame)
@ -1102,7 +1101,9 @@ dumping to it."
(frame-text-width frame) (frame-text-height frame) (frame-text-width frame) (frame-text-height frame)
(frame-text-cols frame) (frame-text-lines frame)) (frame-text-cols frame) (frame-text-lines frame))
(format "tool: %s scroll: %s fringe: %s border: %s right: %s bottom: %s\n\n" (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-scroll-bar-width frame)
(frame-fringe-width frame) (frame-fringe-width frame)
(frame-border-width frame) (frame-border-width frame)

View file

@ -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> 2014-05-25 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (nsfont_draw): Simplify as arguments are adjusted in * nsfont.m (nsfont_draw): Simplify as arguments are adjusted in

View file

@ -1718,8 +1718,8 @@ struct Lisp_Hash_Table
ratio, a float. */ ratio, a float. */
Lisp_Object rehash_threshold; Lisp_Object rehash_threshold;
/* Vector of hash codes.. If hash[I] is nil, this means that that /* Vector of hash codes. If hash[I] is nil, this means that the
entry I is unused. */ I-th entry is unused. */
Lisp_Object hash; Lisp_Object hash;
/* Vector used to chain entries. If entry I is free, next[I] is the /* Vector used to chain entries. If entry I is free, next[I] is the

View file

@ -396,7 +396,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
in previous recursive minibuffer, but was not set explicitly in previous recursive minibuffer, but was not set explicitly
to t for this invocation, so set it to nil in this minibuffer. to t for this invocation, so set it to nil in this minibuffer.
Save the old value now, before we change it. */ 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)) if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil; Vminibuffer_completing_file_name = Qnil;

View file

@ -379,7 +379,7 @@ copy_text_and_data (int new)
char *ptr; char *ptr;
lseek (new, text_scnptr, SEEK_SET); lseek (new, text_scnptr, SEEK_SET);
ptr = _text + text_scnptr; ptr = _text;
end = ptr + f_ohdr.tsize; end = ptr + f_ohdr.tsize;
write_segment (new, ptr, end); write_segment (new, ptr, end);
@ -606,7 +606,7 @@ unrelocate_symbols (int new, int a_out,
PERROR (a_name); PERROR (a_name);
} }
p = (int *) (ldrel.l_vaddr + d_reloc); p = (int *) (intptr_t) (ldrel.l_vaddr + d_reloc);
switch (ldrel.l_symndx) { switch (ldrel.l_symndx) {
case SYMNDX_TEXT: case SYMNDX_TEXT:

View file

@ -4244,6 +4244,17 @@ unwind_create_frame (Lisp_Object frame)
{ {
#ifdef GLYPH_DEBUG #ifdef GLYPH_DEBUG
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 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 #endif
x_free_frame_resources (f); x_free_frame_resources (f);
@ -4254,7 +4265,8 @@ unwind_create_frame (Lisp_Object frame)
eassert (dpyinfo->reference_count == dpyinfo_refcount); eassert (dpyinfo->reference_count == dpyinfo_refcount);
eassert ((dpyinfo->terminal->image_cache == NULL eassert ((dpyinfo->terminal->image_cache == NULL
&& image_cache_refcount == 0) && 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 #endif
return Qt; return Qt;
} }

View file

@ -6419,7 +6419,11 @@ x_delete_display (struct w32_display_info *dpyinfo)
if (dpyinfo->palette) if (dpyinfo->palette)
DeleteObject (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); xfree (dpyinfo->w32_id_name);
#endif
w32_reset_fringes (); w32_reset_fringes ();
} }

View file

@ -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 following. Return the result, or nil if something went
wrong. Prevent redisplay during the evaluation. */ wrong. Prevent redisplay during the evaluation. */
Lisp_Object static Lisp_Object
safe_call (ptrdiff_t nargs, Lisp_Object func, ...) safe__call (bool inhibit_quit, ptrdiff_t nargs, Lisp_Object func, va_list ap)
{ {
Lisp_Object val; Lisp_Object val;
@ -2600,21 +2600,20 @@ safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
val = Qnil; val = Qnil;
else else
{ {
va_list ap;
ptrdiff_t i; ptrdiff_t i;
ptrdiff_t count = SPECPDL_INDEX (); ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1; struct gcpro gcpro1;
Lisp_Object *args = alloca (nargs * word_size); Lisp_Object *args = alloca (nargs * word_size);
args[0] = func; args[0] = func;
va_start (ap, func);
for (i = 1; i < nargs; i++) for (i = 1; i < nargs; i++)
args[i] = va_arg (ap, Lisp_Object); args[i] = va_arg (ap, Lisp_Object);
va_end (ap);
GCPRO1 (args[0]); GCPRO1 (args[0]);
gcpro1.nvars = nargs; gcpro1.nvars = nargs;
specbind (Qinhibit_redisplay, Qt); specbind (Qinhibit_redisplay, Qt);
if (inhibit_quit)
specbind (Qinhibit_quit, Qt);
/* Use Qt to ensure debugger does not run, /* Use Qt to ensure debugger does not run,
so there is no possibility of wanting to redisplay. */ so there is no possibility of wanting to redisplay. */
val = internal_condition_case_n (Ffuncall, nargs, args, Qt, val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
@ -2626,6 +2625,17 @@ safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
return val; 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. /* Call function FN with one argument ARG.
Return the result, or nil if something went wrong. */ 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); 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; static Lisp_Object Qeval;
Lisp_Object Lisp_Object
safe_eval (Lisp_Object sexpr) 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. /* Call function FN with two arguments ARG1 and ARG2.
@ -8528,7 +8556,7 @@ move_it_in_display_line_to (struct it *it,
} }
else else
{ {
if (it->line_wrap == WORD_WRAP) if (it->line_wrap == WORD_WRAP && it->area == TEXT_AREA)
{ {
if (IT_DISPLAYING_WHITESPACE (it)) if (IT_DISPLAYING_WHITESPACE (it))
may_wrap = 1; may_wrap = 1;
@ -8812,8 +8840,11 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV) if (closest_pos < ZV)
{ {
RESTORE_IT (it, &ppos_it, ppos_data); RESTORE_IT (it, &ppos_it, ppos_data);
move_it_in_display_line_to (it, closest_pos, -1, /* Don't recurse if closest_pos is equal to
MOVE_TO_POS); 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; result = MOVE_POS_MATCH_OR_ZV;
} }
else else
@ -8874,8 +8905,9 @@ move_it_in_display_line_to (struct it *it,
&& !at_eob_p && closest_pos < ZV) && !at_eob_p && closest_pos < ZV)
{ {
RESTORE_IT (it, &ppos_it, ppos_data); RESTORE_IT (it, &ppos_it, ppos_data);
move_it_in_display_line_to (it, closest_pos, -1, if (closest_pos != to_charpos)
MOVE_TO_POS); move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
} }
result = MOVE_POS_MATCH_OR_ZV; result = MOVE_POS_MATCH_OR_ZV;
break; break;
@ -8893,7 +8925,9 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV) if (closest_pos < ZV)
{ {
RESTORE_IT (it, &ppos_it, ppos_data); 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; result = MOVE_POS_MATCH_OR_ZV;
break; 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 /* 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))) if (CONSP (XCDR (elt)))
{ {
Lisp_Object spec; 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, n += display_mode_element (it, depth, field_width - n,
precision - n, spec, props, precision - n, spec, props,
risky); risky);

View file

@ -184,6 +184,7 @@ function being an around advice."
(sm-advice (lambda (x) (if (consp x) (list (* 5 (car x))) (* 4 x))))) (sm-advice (lambda (x) (if (consp x) (list (* 5 (car x))) (* 4 x)))))
(should (equal (funcall sm-test10 5) 15)) (should (equal (funcall sm-test10 5) 15))
(add-function :filter-args (var sm-test10) sm-advice) (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)) (should (equal (funcall sm-test10 5) 35))
(add-function :filter-return (var sm-test10) sm-advice) (add-function :filter-return (var sm-test10) sm-advice)
(should (equal (funcall sm-test10 5) 60)) (should (equal (funcall sm-test10 5) 60))