1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -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>
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
by it.
* mac/uvs.el: New file from Mac port. Generates src/macuvs.h.
2014-05-17 Paul Eggert <eggert@cs.ucla.edu>

View file

@ -547,7 +547,7 @@ case "${canonical}" in
rs6000-ibm-aix[56]* )
opsys=aix4-2
;;
powerpc-ibm-aix[56]* )
powerpc-ibm-aix[5-9]* | powerpc-ibm-aix[1-9][0-9]* )
opsys=aix4-2
;;
@ -999,6 +999,15 @@ if test "$opsys" = "mingw32"; then
LN_S="/bin/ln"
fi
dnl On some Debian versions, "install-info" prints irritating messages
dnl "This is not dpkg install-info anymore, but GNU install-info"
dnl if called via an absolute file name.
dnl Use the entirely-identical-but-quieter ginstall-info instead if present.
dnl Sadly some people may have an old ginstall-info installed on
dnl non-Debian systems, so we can't use this.
dnl AC_PATH_PROGS(INSTALL_INFO, [ginstall-info install-info], :,
dnl $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
AC_PATH_PROG(INSTALL_INFO, install-info, :,
$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
dnl Don't use GZIP, which is used by gzip for additional parameters.

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>
* mule.texi (Language Environments): Remove unused @anchor. (Bug#17479)

View file

@ -494,13 +494,14 @@ the mouse cursor to the chosen frame.
@cindex fonts
By default, Emacs displays text on graphical displays using a
12-point monospace font. There are several different ways to specify
10-point monospace font. There are several different ways to specify
a different font:
@itemize
@item
Click on @samp{Set Default Font} in the @samp{Options} menu. To save
this for future sessions, click on @samp{Save Options} in the
Click on @samp{Set Default Font} in the @samp{Options} menu. This
makes the selected font the default on all existing graphical frames.
To save this for future sessions, click on @samp{Save Options} in the
@samp{Options} menu.
@item
@ -513,6 +514,10 @@ Add a line to your init file, modifying the variable
'(font . "DejaVu Sans Mono-10"))
@end example
@noindent
This makes the font the default on all graphical frames created after
restarting Emacs with that init file.
@cindex X defaults file
@cindex X resources file
@item

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>
* 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
Ordinarily, functions that operate on text or move point do not care
whether the text is invisible. The user-level line motion commands
ignore invisible newlines if @code{line-move-ignore-invisible} is
non-@code{nil} (the default), but only because they are explicitly
programmed to do so.
whether the text is invisible, they process invisible characters and
visible characters alike. The user-level line motion commands,
such as @code{next-line}, @code{previous-line}, ignore invisible
newlines if @code{line-move-ignore-invisible} is non-@code{nil} (the
default), i.e., behave like these invisible newlines didn't exist in
the buffer, but only because they are explicitly programmed to do so.
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
two ends of the invisible text. Emacs chooses the direction of
relocation so that it is the same as the overall movement direction of
@ -952,6 +954,10 @@ command moved point forward into an invisible range, Emacs moves point forward
to the first visible character that follows the invisible text and then forward
one more character.
These @dfn{adjustments} of point that ended up in the middle of
invisible text can be disabled by setting @code{disable-point-adjustment}
to a non-@code{nil} value. @xref{Adjusting Point}.
Incremental search can make invisible overlays visible temporarily
and/or permanently when a match includes invisible text. To enable
this, the overlay should have a non-@code{nil}

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>
* cl.texi (List Functions, Efficiency Concerns): Update cl-endp.

View file

@ -1589,3 +1589,7 @@ A copy of the @code{file} command.
@setchapternewpage odd
@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
@c Local variables:
@c coding: utf-8
@c fill-column: 77
@c indent-tabs-mode: nil
@c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$"

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

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>
* 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.

View file

@ -1476,7 +1476,6 @@ This is like the old `eval-after-load', but better behaved.
*** `generic-make-keywords-list'
*** `get-upcase-table' (use `case-table-get-table' instead).
+++
** `with-wrapper-hook' is obsoleted by `add-function'.
The few hooks that used with-wrapper-hook are replaced as follows:
*** `abbrev-expand-function' obsoletes `abbrev-expand-functions'.
@ -4187,6 +4186,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
Local variables:
coding: utf-8
mode: outline
paragraph-separate: "[ ]*$"
end:

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: 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>
Remove dependencies on getline and getdelim.

View file

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

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>
* 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
;; be too bad, and on my workstation even "animate" is reasonable.
;;
;; - It ought to find out where any overlapping frames are and avoid them,
;; rather than always raising the frame.
;; Credits:
;; This code was helped by all those who contributed suggestions,
@ -129,9 +126,9 @@ TOP-OR-BOTTOM: banish the mouse to top or bottom of frame or window.
TOP-OR-BOTTOM-POS: Distance from top or bottom edge of frame or window."
:group 'avoid
:version "24.3"
:type '(alist :key-type symbol :value-type symbol)
:options '(frame-or-window side (side-pos integer)
top-or-bottom (top-or-bottom-pos integer)))
:type '(alist :key-type symbol :value-type (choice symbol integer))
:options '((frame-or-window symbol) (side symbol) (side-pos integer)
(top-or-bottom symbol) (top-or-bottom-pos integer)))
;; Internal variables
(defvar mouse-avoidance-state nil)
@ -172,12 +169,8 @@ Analogous to `mouse-position'."
(defun mouse-avoidance-set-mouse-position (pos)
;; Carefully set mouse position to given position (X . Y)
;; Ideally, should check if X,Y is in the current frame, and if not,
;; leave the mouse where it was. However, this is currently
;; difficult to do, so we just raise the frame to avoid frame switches.
;; Returns t if it moved the mouse.
(let ((f (selected-frame)))
(raise-frame f)
(set-mouse-position f (car pos) (cdr pos))
t))
@ -342,12 +335,18 @@ redefine this function to suit your own tastes."
(let ((modifiers (event-modifiers (car last-input-event))))
(or (memq (car last-input-event)
'(mouse-movement scroll-bar-movement
select-window switch-frame))
select-window focus-out))
(memq 'click modifiers)
(memq 'double modifiers)
(memq 'triple modifiers)
(memq 'drag modifiers)
(memq 'down modifiers)))))))
(memq 'down modifiers)
(memq 'meta modifiers)
(memq 'control modifiers)
(memq 'shift modifiers)
(memq 'hyper modifiers)
(memq 'super modifiers)
(memq 'alt modifiers)))))))
(defun mouse-avoidance-banish ()
(if (not (mouse-avoidance-ignore-p))
@ -403,8 +402,6 @@ Effects of the different modes:
* cat-and-mouse: Same as `animate'.
* proteus: As `animate', but changes the shape of the mouse pointer too.
Whenever the mouse is moved, the frame is also raised.
\(See `mouse-avoidance-threshold' for definition of \"too close\",
and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
definition of \"random distance\".)"

View file

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

View file

@ -218,6 +218,10 @@
(color :tag "Foreground"
:help-echo "Set foreground color (name or #RRGGBB hex spec)."))
(:distant-foreground
(color :tag "Distant Foreground"
:help-echo "Set distant foreground color (name or #RRGGBB hex spec)."))
(:background
(color :tag "Background"
:help-echo "Set background color (name or #RRGGBB hex spec)."))

View file

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

View file

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

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

View file

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

View file

@ -290,6 +290,14 @@ This function is called, by name, directly by the C code."
(cell
;; Delete from queue. Record the cons cell that was used.
(cancel-timer-internal timer)))
;; If `cell' is nil, it means the timer was already canceled, so we
;; shouldn't be running it at all. This can happen for example with the
;; following scenario (bug#17392):
;; - we run timers, starting with A (and remembering the rest as (B C)).
;; - A runs and a does a sit-for.
;; - during sit-for we run timer D which cancels timer B.
;; - timer A finally finishes, so we move on to timers B and C.
(when cell
;; Re-schedule if requested.
(if (timer--repeat-delay timer)
(if (timer--idle-delay timer)
@ -325,7 +333,7 @@ This function is called, by name, directly by the C code."
;; 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)))))
(setf (timer--triggered timer) nil))))))
;; This function is incompatible with the one in levents.el.
(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 non-nil, it should be a list of frames to act upon,
or t meaning all graphical frames. Also, if FRAME is non-nil,
alter the user's Customization settings as though the
font-related attributes of the `default' face had been \"set in
this session\", so that the font is applied to future frames."
or t meaning all existing graphical frames.
Also, if FRAMES is non-nil, alter the user's Customization settings
as though the font-related attributes of the `default' face had been
\"set in this session\", so that the font is applied to future frames."
(interactive
(let* ((completion-ignore-case t)
(font (completing-read "Font name: "
@ -1822,9 +1822,7 @@ terminals, cursor blinking is controlled by the terminal."
:initialize 'custom-initialize-delay
:group 'cursor
:global t
(if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
(setq blink-cursor-idle-timer nil)
(blink-cursor-end)
(blink-cursor-suspend)
(remove-hook 'focus-in-hook #'blink-cursor-check)
(remove-hook 'focus-out-hook #'blink-cursor-suspend)
(when blink-cursor-mode

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)
(if strip-prompt
(concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\("
(concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(?2:"
(regexp-quote pat)
"[^\n]*[^ \t\n]\\)")
(concat "^\\(\\s-*\\)\\("

View file

@ -662,7 +662,7 @@ by \"Save Options\" in Custom buffers.")
;; Function for setting/saving default font.
(defun menu-set-font ()
"Interactively select a font and make it the default."
"Interactively select a font and make it the default on all existing frames."
(interactive)
(set-frame-font (if (fboundp 'x-select-font)
(x-select-font)

View file

@ -529,7 +529,7 @@ for use at QPOS."
(let* ((qpos pred)
(ustring (funcall unquote string))
(uprefix (funcall unquote (substring string 0 qpos)))
;; FIXME: we really should pass `qpos' to `unuote' and have that
;; FIXME: we really should pass `qpos' to `unquote' and have that
;; function give us the corresponding `uqpos'. But for now we
;; presume (more or less) that `concat' and `unquote' commute.
(uqpos (if (string-prefix-p uprefix ustring)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5069,7 +5069,15 @@ When the `track-eol' feature is doing its job, the value is
`most-positive-fixnum'.")
(defcustom line-move-ignore-invisible t
"Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines.
"Non-nil means commands that move by lines ignore invisible newlines.
When this option is non-nil, \\[next-line], \\[previous-line], \\[move-end-of-line], and \\[move-beginning-of-line] behave
as if newlines that are invisible didn't exist, and count
only visible newlines. Thus, moving across across 2 newlines
one of which is invisible will be counted as a one-line move.
Also, a non-nil value causes invisible text to be ignored when
counting columns for the purposes of keeping point in the same
column by \\[next-line] and \\[previous-line].
Outline mode sets this."
:type 'boolean
:group 'editing-basics)

View file

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

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
window's frame. The buffer *window-frame-dump* is erased before
dumping to it."
(interactive)
(let* ((window
(cond
((or (not window-or-frame)
@ -1102,7 +1101,9 @@ dumping to it."
(frame-text-width frame) (frame-text-height frame)
(frame-text-cols frame) (frame-text-lines frame))
(format "tool: %s scroll: %s fringe: %s border: %s right: %s bottom: %s\n\n"
(if (fboundp 'tool-bar-height)
(tool-bar-height frame t)
"0")
(frame-scroll-bar-width frame)
(frame-fringe-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>
* nsfont.m (nsfont_draw): Simplify as arguments are adjusted in

View file

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

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
to t for this invocation, so set it to nil in this minibuffer.
Save the old value now, before we change it. */
specbind (intern ("minibuffer-completing-file-name"), Vminibuffer_completing_file_name);
specbind (intern ("minibuffer-completing-file-name"),
Vminibuffer_completing_file_name);
if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil;

View file

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

View file

@ -4244,6 +4244,17 @@ unwind_create_frame (Lisp_Object frame)
{
#ifdef GLYPH_DEBUG
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
/* If the frame's image cache refcount is still the same as our
private shadow variable, it means we are unwinding a frame
for which we didn't yet call init_frame_faces, where the
refcount is incremented. Therefore, we increment it here, so
that free_frame_faces, called in x_free_frame_resources
below, will not mistakenly decrement the counter that was not
incremented yet to account for this new frame. */
if (FRAME_IMAGE_CACHE (f) != NULL
&& FRAME_IMAGE_CACHE (f)->refcount == image_cache_refcount)
FRAME_IMAGE_CACHE (f)->refcount++;
#endif
x_free_frame_resources (f);
@ -4254,7 +4265,8 @@ unwind_create_frame (Lisp_Object frame)
eassert (dpyinfo->reference_count == dpyinfo_refcount);
eassert ((dpyinfo->terminal->image_cache == NULL
&& image_cache_refcount == 0)
|| dpyinfo->terminal->image_cache->refcount == image_cache_refcount);
|| (dpyinfo->terminal->image_cache != NULL
&& dpyinfo->terminal->image_cache->refcount == image_cache_refcount));
#endif
return Qt;
}

View file

@ -6419,7 +6419,11 @@ x_delete_display (struct w32_display_info *dpyinfo)
if (dpyinfo->palette)
DeleteObject (dpyinfo->palette);
}
/* Avoid freeing dpyinfo->w32_id_name more than once if emacs is
running as a daemon; see bug#17510. */
#ifndef CYGWIN
xfree (dpyinfo->w32_id_name);
#endif
w32_reset_fringes ();
}

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
wrong. Prevent redisplay during the evaluation. */
Lisp_Object
safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
static Lisp_Object
safe__call (bool inhibit_quit, ptrdiff_t nargs, Lisp_Object func, va_list ap)
{
Lisp_Object val;
@ -2600,21 +2600,20 @@ safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
val = Qnil;
else
{
va_list ap;
ptrdiff_t i;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1;
Lisp_Object *args = alloca (nargs * word_size);
args[0] = func;
va_start (ap, func);
for (i = 1; i < nargs; i++)
args[i] = va_arg (ap, Lisp_Object);
va_end (ap);
GCPRO1 (args[0]);
gcpro1.nvars = nargs;
specbind (Qinhibit_redisplay, Qt);
if (inhibit_quit)
specbind (Qinhibit_quit, Qt);
/* Use Qt to ensure debugger does not run,
so there is no possibility of wanting to redisplay. */
val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
@ -2626,6 +2625,17 @@ safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
return val;
}
Lisp_Object
safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
{
Lisp_Object retval;
va_list ap;
va_start (ap, func);
retval = safe__call (false, nargs, func, ap);
va_end (ap);
return retval;
}
/* Call function FN with one argument ARG.
Return the result, or nil if something went wrong. */
@ -2636,12 +2646,30 @@ safe_call1 (Lisp_Object fn, Lisp_Object arg)
return safe_call (2, fn, arg);
}
static Lisp_Object
safe__call1 (bool inhibit_quit, Lisp_Object fn, ...)
{
Lisp_Object retval;
va_list ap;
va_start (ap, fn);
retval = safe__call (inhibit_quit, 2, fn, ap);
va_end (ap);
return retval;
}
static Lisp_Object Qeval;
Lisp_Object
safe_eval (Lisp_Object sexpr)
{
return safe_call1 (Qeval, sexpr);
return safe__call1 (false, Qeval, sexpr);
}
static Lisp_Object
safe__eval (bool inhibit_quit, Lisp_Object sexpr)
{
return safe__call1 (inhibit_quit, Qeval, sexpr);
}
/* Call function FN with two arguments ARG1 and ARG2.
@ -8528,7 +8556,7 @@ move_it_in_display_line_to (struct it *it,
}
else
{
if (it->line_wrap == WORD_WRAP)
if (it->line_wrap == WORD_WRAP && it->area == TEXT_AREA)
{
if (IT_DISPLAYING_WHITESPACE (it))
may_wrap = 1;
@ -8812,6 +8840,9 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
/* Don't recurse if closest_pos is equal to
to_charpos, since we have just tried that. */
if (closest_pos != to_charpos)
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
result = MOVE_POS_MATCH_OR_ZV;
@ -8874,6 +8905,7 @@ move_it_in_display_line_to (struct it *it,
&& !at_eob_p && closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
if (closest_pos != to_charpos)
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
}
@ -8893,7 +8925,9 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
move_it_in_display_line_to (it, closest_pos, -1, MOVE_TO_POS);
if (closest_pos != to_charpos)
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;
@ -11543,7 +11577,7 @@ prepare_menu_bars (void)
}
}
}
safe_call1 (Vpre_redisplay_function, windows);
safe__call1 (true, Vpre_redisplay_function, windows);
}
/* Update all frame titles based on their buffer names, etc. We do
@ -21857,7 +21891,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
if (CONSP (XCDR (elt)))
{
Lisp_Object spec;
spec = safe_eval (XCAR (XCDR (elt)));
spec = safe__eval (true, XCAR (XCDR (elt)));
n += display_mode_element (it, depth, field_width - n,
precision - n, spec, props,
risky);

View file

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