+2013-08-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-08-15 warnings: minor optimization
+ 2013-08-15 warnings: check -Wfoo rather than -Wno-foo
+
+2013-08-15 Ken Brown <kbrown@cornell.edu>
+
+ * configure.ac (G_SLICE_ALWAYS_MALLOC): Update comment.
+
+2013-08-15 Glenn Morris <rgm@gnu.org>
+
+ * make-dist: Do not distribute etc/refcards TeX intermediate files.
+ * Makefile.in (install-arch-indep):
+ Do not install etc/refcards TeX intermediate files.
+
+2013-08-14 Ulrich Müller <ulm@gentoo.org>
+
+ * configure.ac (EMACS_CONFIGURATION): Escape backslashes. (Bug#15091)
+
2013-08-12 Eli Zaretskii <eliz@gnu.org>
* configure.ac (HAVE_ZLIB): Don't use -lz on MinGW.
## deleted the entire installed etc/ directory and recreated it.
## install-etcdoc installs the relevant DOC.
+## Note that we install etc/refcards/*.ps if present.
+## TODO we should compress these if GZIP_PROG is set.
+## It would be simpler to have a separate install rule for etc/refcards
+## (maybe move it to doc/refcards?).
+
## Note that the Makefiles in the etc directory are potentially useful
## in an installed Emacs, so should not be excluded.
(cd $${dir}; tar -chf - . ) \
| (cd $${dest}; umask 022; \
tar -xvf - && cat > /dev/null) || exit 1; \
- [ "$${dir}" != "${srcdir}/etc" ] || rm -f $${dest}/DOC* ; \
+ if [ "$${dir}" = "${srcdir}/etc" ]; then \
+ rm -f $${dest}/DOC* ; \
+ rm -f $${dest}/refcards/*.aux $${dest}/refcards/*.dvi; \
+ rm -f $${dest}/refcards/*.log; \
+ else true; \
+ fi; \
for subdir in `find $${dest} -type d -print` ; do \
chmod a+rx $${subdir} ; \
rm -f $${subdir}/.gitignore ; \
+2013-08-15 Glenn Morris <rgm@gnu.org>
+
+ * make-tarball.txt: Mention generating pdfs in etc/refcards.
+
+2013-08-15 Xue Fuqiao <xfq.free@gmail.com>
+
+ * notes/hydra: More information about Hydra.
+
2013-08-10 Xue Fuqiao <xfq.free@gmail.com>
* notes/hydra: New file.
* TO BE DONE SHORTLY BEFORE RELEASE
** Manuals
+Check for node names using problematic characters:
+ find doc -name '*.texi' -exec grep '^@node[^,]*[:.()]' {} +
+Sadly makeinfo does not warn about such characters.
+
Check cross-references between the manuals (eg from emacs to elisp)
are correct. You can use something like the following in the info
directory in the Emacs build tree:
;; Check the values
(mapc (lambda (value)
+ ;; TODO for booleans, check for values that can be
+ ;; evaluated and are not t or nil. Usually a bug.
(unless (widget-apply conv :match value)
(setq mismatch 'mismatch)))
values)
5. autoreconf -i -I m4 --force
make bootstrap
+ make -C etc/refcards
+ make -C etc/refcards clean
+
6. Copy lisp/loaddefs.el to lisp/ldefs-boot.el.
Commit etc/AUTHORS, lisp/ldefs-boot.el, and the files changed
x86_64-linux
* Mail notifications
-Hydra sends notifications about build breakages in Emacs trunk to
-emacs-buildstatus@gnu.org.
+In addition to the web interface, Hydra can send notifications by
+email when the build status of a project changes—e.g., from
+`SUCCEEDED' to `FAILED'. It sends notifications about build status in
+Emacs trunk to emacs-buildstatus@gnu.org.
If you want to receive these notifications, please subscribe at
http://lists.gnu.org/mailman/listinfo/emacs-buildstatus
** The `build' job
which gets the result of the tarball job as input, together with
-system identifier, this job basically does a normal make, make check,
-make install.
+system identifier, this job basically does a normal make and make install.
** The 'coverage' job
is now running `make check'.
-* Other GNU packages
+* Nix expressions
+The recipe for GNU Emacs are available via Git:
+http://git.savannah.gnu.org/cgit/hydra-recipes.git/tree/emacs
+
+To modify the build job, email the patch to hydra-users@gnu.org. The
+build recipes are written in the Nix language.
+
+* Other Information
For a list of other GNU packages that have a continuous build on
Hydra, see http://hydra.nixos.org/project/gnu
+See http://www.gnu.org/software/devel.html#Hydra for more information.
+
\f
This file is part of GNU Emacs.
#undef GNU_MALLOC
/* Define to set the G_SLICE environment variable to "always-malloc" at
- startup, if using GTK. */
+ startup. */
#undef G_SLICE_ALWAYS_MALLOC
/* Define to 1 if you have the `accept4' function. */
for w in $ws; do
as_gl_Warn=`$as_echo "gl_cv_warn_c_$w" | $as_tr_sh`
+gl_positive="$w"
+case $gl_positive in
+ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5
$as_echo_n "checking whether C compiler handles $w... " >&6; }
if { as_var=$as_gl_Warn; eval "test \"\${$as_var+set}\" = set"; }; then :
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $w"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-missing-field-initializers"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-sign-compare"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-type-limits"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtype-limits"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-switch"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wswitch"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-parameter"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-format-nonliteral"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-logical-op"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-format-extra-args"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-extra-args"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-tautological-constant-out-of-range-compare"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtautological-constant-out-of-range-compare"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-command-line-argument"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-command-line-argument"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
else
gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-value"
+ as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-value"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
HAVE_ZLIB=no
LIBZ=
if test "${with_zlib}" != "no"; then
- if test "${HAVE_PNG}" = "yes"; then
- ### PNG depends on zlib, so if we have PNG, we have zlib.
- HAVE_ZLIB=yes
- else
- ### No PNG, so check zlib ourselves.
- OLIBS=$LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflateEnd" >&5
+ OLIBS=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflateEnd" >&5
$as_echo_n "checking for library containing inflateEnd... " >&6; }
if test "${ac_cv_search_inflateEnd+set}" = set; then :
$as_echo_n "(cached) " >&6
HAVE_ZLIB=yes
fi
- LIBS=$OLIBS
- case $ac_cv_search_inflateEnd in
- -*) LIBZ=$ac_cv_search_inflateEnd ;;
- esac
- fi
+ LIBS=$OLIBS
+ case $ac_cv_search_inflateEnd in
+ -*) LIBZ=$ac_cv_search_inflateEnd ;;
+ esac
fi
if test "${HAVE_ZLIB}" = "yes"; then
$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+ ### mingw32 doesn't use -lz, since it loads the library dynamically.
+ if test "${opsys}" = "mingw32"; then
+ LIBZ=
+ fi
fi
case $opsys in
- cygwin)
+ cygwin)
$as_echo "#define G_SLICE_ALWAYS_MALLOC 1" >>confdefs.h
#define EMACS_CONFIGURATION "${canonical}"
_ACEOF
-emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g"`
+emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g" -e 's/\\\\/\\\\\\\\/g'`
cat >>confdefs.h <<_ACEOF
#define EMACS_CONFIG_OPTIONS "${emacs_config_options}"
case $opsys in
- dnl Emacs supplies its own malloc, but glib (part of Gtk+) calls
- dnl memalign and on Cygwin, that becomes the Cygwin-supplied memalign.
- dnl As malloc is not the Cygwin malloc, the Cygwin memalign always
- dnl returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */
+ dnl Emacs supplies its own malloc, but glib calls posix_memalign,
+ dnl and on Cygwin prior to version 1.7.24 that becomes the
+ dnl Cygwin-supplied posix_memalign. As malloc is not the Cygwin
+ dnl malloc, the Cygwin posix_memalign always returns ENOSYS. A
+ dnl workaround is to set G_SLICE=always-malloc. This is no longer
+ dnl needed starting with cygwin-1.7.24, and it is no longer
+ dnl effective starting with glib-2.36. */
cygwin)
AC_DEFINE(G_SLICE_ALWAYS_MALLOC, 1, [Define to set the
- G_SLICE environment variable to "always-malloc" at startup, if
- using GTK.])
+ G_SLICE environment variable to "always-malloc" at startup.])
;;
hpux11)
AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
[Define to the canonical Emacs configuration name.])
dnl Replace any embedded " characters (bug#13274).
-emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g"`
+emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g" -e 's/\\\\/\\\\\\\\/g'`
AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
[Define to the options passed to configure.])
AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
+2013-08-17 Xue Fuqiao <xfq.free@gmail.com>
+
+ * text.texi (Enriched Justification): Minor fixes.
+
+2013-08-14 Xue Fuqiao <xfq.free@gmail.com>
+
+ * files.texi (Filesets): Add an index.
+
2013-08-12 Glenn Morris <rgm@gnu.org>
* macos.texi (GNUstep Support):
@node Filesets
@section Filesets
@cindex filesets
+@cindex sets of files
@findex filesets-init
If you regularly edit a certain group of files, you can define them
which configures Emacs for editing a certain sort of text. Ideally,
each programming language has its own major mode. @xref{Major Modes}.
+@c FIXME: Mention margins for filling?
@item Margin
The space between the usable part of a window (including the
fringe) and the window edge.
delete all the text in the region if it is active (@pxref{Using
Region}).
+@c FIXME: `cycle-spacing' should be documented, too. (Maybe not in
+@c this node, tho.) --xfq
@kindex M-\
@findex delete-horizontal-space
@kindex M-SPC
@node Enriched Justification
@subsection Justification in Enriched Text
+@cindex justification style
In Enriched mode, you can use the following commands to specify
various @dfn{justification styles} for filling. These commands apply
still indent the left margin.
@end table
+@c FIXME: We should explain the effect of these symbols. --xfq
@vindex default-justification
You can also specify justification styles using the Justification
-submenu in the Text Properties menu.
- The default justification style is specified by the per-buffer
-variable @code{default-justification}. Its value should be one of the
-symbols @code{left}, @code{right}, @code{full}, @code{center}, or
-@code{none}.
+submenu in the Text Properties menu. The default justification style
+is specified by the per-buffer variable @code{default-justification}.
+Its value should be one of the symbols @code{left}, @code{right},
+@code{full}, @code{center}, or @code{none}.
@node Enriched Properties
@subsection Setting Other Text Properties
+2013-08-18 Xue Fuqiao <xfq.free@gmail.com>
+
+ * positions.texi (Positions): Improve indexing.
+
+2013-08-18 Eli Zaretskii <eliz@gnu.org>
+
+ * markers.texi (The Region): Improve indexing.
+
+2013-08-17 Xue Fuqiao <xfq.free@gmail.com>
+
+ * modes.texi (SMIE, SMIE Grammar, SMIE Indentation): Add some indexes.
+
+ * text.texi (Maintaining Undo): Mention interactive call of
+ buffer-disable-undo.
+ (Filling): Add cross-reference for hard newlines.
+ (Sorting): Fix indentation.
+ (Columns): Comment out undefined behavior.
+ (Case Changes): Fix an `args-out-of-range' error in the example.
+
+2013-08-16 Xue Fuqiao <xfq.free@gmail.com>
+
+ * text.texi (Insertion): Refine.
+ (Margins): Add an index.
+ (Undo): Doc fix for `buffer-undo-list'.
+
+ * positions.texi (Character Motion):
+ * markers.texi (Moving Markers):
+ (Creating Markers): Comment out undefined behavior.
+
+2013-08-15 Xue Fuqiao <xfq.free@gmail.com>
+
+ * markers.texi (The Region): Add/move indexes.
+
+2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * display.texi (ImageMagick Images): Mention :content-type and
+ `image-content-type-suffixes'.
+
+2013-08-13 Xue Fuqiao <xfq.free@gmail.com>
+
+ * positions.texi (Word Motion): Remove redundant sentence.
+
+2013-08-13 Glenn Morris <rgm@gnu.org>
+
+ * lists.texi (List Elements):
+ Undocument behavior of nth and nthcdr with n < 0. (Bug#15059)
+
+2013-08-13 Xue Fuqiao <xfq.free@gmail.com>
+
+ * frames.texi (Display Feature Testing): Add indexes.
+
2013-08-12 Glenn Morris <rgm@gnu.org>
* Makefile.in (prefix, datarootdir, datadir, PACKAGE_TARNAME)
wish. @code{:max-width} and @code{:max-height} will always preserve
the aspect ratio.
+@item :format
+ImageMagick tries to auto-detect the image type, but it isn't always
+able to. By using @code{:format-type}, we can give ImageMagick a hint
+to try to help it. It's used in conjunction with the
+@code{image-format-suffixes} variable, which provides a mapping from
+content types to file name suffixes. This is then given to
+ImageMagick as a file name hint.
+
@item :rotation
Specifies a rotation angle in degrees.
@node Input Focus
@section Input Focus
@cindex input focus
-@c @cindex selected frame Duplicates selected-frame
+@c @cindex selected frame Duplicates selected-frame, same for selected-window.
At any time, one frame in Emacs is the @dfn{selected frame}. The selected
window always resides on the selected frame.
@code{display-mm-width} in case the system provides incorrect values.
@end defopt
+@cindex backing store
@defun display-backing-store &optional display
This function returns the backing store capability of the display.
Backing store means recording the pixels of windows (and parts of
when the question is inapplicable to a certain kind of display.
@end defun
+@cindex SaveUnder feature
@defun display-save-under &optional display
This function returns non-@code{nil} if the display supports the
SaveUnder feature. That feature is used by pop-up windows
element number zero. If the length of @var{list} is @var{n} or less,
the value is @code{nil}.
-If @var{n} is negative, @code{nth} returns the first element of
-@var{list}.
+@c Behavior for -ve n undefined since 2013/08; see bug#15059.
+@ignore
+If @var{n} is negative, @code{nth} returns the first element of @var{list}.
+@end ignore
@example
@group
@group
(nth 10 '(1 2 3 4))
@result{} nil
-@end group
-@group
-(nth -3 '(1 2 3 4))
- @result{} 1
(nth n x) @equiv{} (car (nthcdr n x))
@end group
words, it skips past the first @var{n} links of @var{list} and returns
what follows.
-If @var{n} is zero or negative, @code{nthcdr} returns all of
+@c "or negative" removed 2013/08; see bug#15059.
+If @var{n} is zero, @code{nthcdr} returns all of
@var{list}. If the length of @var{list} is @var{n} or less,
@code{nthcdr} returns @code{nil}.
@result{} nil
@end group
@group
-(nthcdr -3 '(1 2 3 4))
+(nthcdr 0 '(1 2 3 4))
@result{} (1 2 3 4)
@end group
@end example
The new marker's insertion type is specified by the argument
@var{insertion-type}. @xref{Marker Insertion Types}.
+@c This behavior used to be documented until 2013/08.
+@ignore
If passed an integer argument less than 1, @code{copy-marker} returns a
new marker that points to the beginning of the current buffer. If
passed an integer argument greater than the length of the buffer,
@code{copy-marker} returns a new marker that points to the end of the
buffer.
+@end ignore
@example
@group
This function returns the buffer that @var{marker} points into, or
@code{nil} if it points nowhere.
+@c FIXME: The `buffer' argument of `set-marker' already defaults to
+@c the current buffer, why use `(current-buffer)' explicitly here?
@example
@group
(setq m (make-marker))
in @var{buffer}. If @var{buffer} is not provided, it defaults to
the current buffer.
+@c This behavior used to be documented until 2013/08.
+@ignore
If @var{position} is less than 1, @code{set-marker} moves @var{marker}
to the beginning of the buffer. If @var{position} is greater than the
size of the buffer (@pxref{Point}), @code{set-marker} moves marker to
-the end of the buffer. If @var{position} is @code{nil} or a marker
-that points nowhere, then @var{marker} is set to point nowhere.
+the end of the buffer.
+@end ignore
+If @var{position} is @code{nil} or a marker that points nowhere, then
+@var{marker} is set to point nowhere.
The value returned is @var{marker}.
@node The Mark
@section The Mark
@cindex mark, the
-@cindex mark ring
+@c @cindex the mark?
Each buffer has a special marker, which is designated @dfn{the
mark}. When a buffer is newly created, this marker exists but does
Mark mode. (Another is that this enables highlighting of the region
when the mark is active. @xref{Display}.)
+@cindex mark ring
In addition to the mark, each buffer has a @dfn{mark ring} which is a
list of markers containing previous values of the mark. When editing
commands change the mark, they should normally save the old value of the
@node The Region
@section The Region
-@cindex region (between point and mark)
+@c The index entry must be just ``region'' to make it the first hit
+@c when the user types ``i region RET'', because otherwise the Info
+@c reader will present substring matches in alphabetical order,
+@c putting this one near the end, with something utterly unrelated as
+@c the first hit.
+@cindex region
The text between point and the mark is known as @dfn{the region}.
Various functions operate on text delimited by point and the mark, but
larger.
@end defun
+@c FIXME: Mention it in tips.texi?
Instead of using @code{region-beginning} and @code{region-end}, a
command designed to operate on a region should normally use
@code{interactive} with the @samp{r} specification to find the
function is intended to be used by commands that operate on the
region, instead of on text near point, when the mark is active.
+@cindex empty region
+@vindex use-empty-active-region
A region is valid if it has a non-zero size, or if the user option
@code{use-empty-active-region} is non-@code{nil} (by default, it is
@code{nil}). The function @code{region-active-p} is similar to
@node SMIE
@subsection Simple Minded Indentation Engine
+@cindex SMIE
SMIE is a package that provides a generic navigation and indentation
engine. Based on a very simple parser using an ``operator precedence
@node SMIE Grammar
@subsubsection Defining the Grammar of a Language
+@cindex SMIE grammar
+@cindex grammar, SMIE
The usual way to define the SMIE grammar of a language is by
defining a new global variable that holds the precedence table by
@node SMIE Lexer
@subsubsection Defining Tokens
+@cindex SMIE lexer
+@cindex defining tokens, SMIE
SMIE comes with a predefined lexical analyzer which uses syntax tables
in the following way: any sequence of characters that have word or
@node SMIE Indentation
@subsubsection Specifying Indentation Rules
+@cindex indentation rules, SMIE
Based on the provided grammar, SMIE will be able to provide automatic
indentation without any extra effort. But in practice, this default
@node Positions
@chapter Positions
@cindex position (in buffer)
+@cindex buffer position
A @dfn{position} is the index of a character in the text of a buffer.
More precisely, a position identifies the place between two characters
@deffn Command goto-char position
This function sets point in the current buffer to the value
-@var{position}. If @var{position} is less than 1, it moves point to the
-beginning of the buffer. If @var{position} is greater than the length
-of the buffer, it moves point to the end.
+@var{position}.
+@c This behavior used to be documented until 2013/08.
+@ignore
+If @var{position} is less than 1, it moves point to the beginning of
+the buffer. If @var{position} is greater than the length of the
+buffer, it moves point to the end.
+@end ignore
If narrowing is in effect, @var{position} still counts from the
beginning of the buffer, but point cannot go outside the accessible
@deffn Command forward-word &optional count
This function moves point forward @var{count} words (or backward if
-@var{count} is negative). If @var{count} is @code{nil}, it moves
-forward one word.
+@var{count} is negative). If @var{count} is omitted or @code{nil}, it
+defaults to 1.
``Moving one word'' means moving until point crosses a
word-constituent character and then encounters a word-separator
this function ignores field boundaries.
In an interactive call, @var{count} is specified by the numeric prefix
-argument. If @var{count} is omitted or @code{nil}, it defaults to 1.
+argument.
@end deffn
@deffn Command backward-word &optional count
buffer, use @code{save-current-buffer} or @code{with-current-buffer}
instead (@pxref{Current Buffer}). If you need to save or restore
window configurations, see the forms described in @ref{Window
-Configurations} and in @ref{Frame Configurations}.
+Configurations} and in @ref{Frame Configurations}. @c frameset?
@defspec save-excursion body@dots{}
@cindex mark excursion
copied out of the buffer.
@end defun
+@c FIXME: `filter-buffer-substring-function' should be documented.
@defvar filter-buffer-substring-functions
This variable is a wrapper hook (@pxref{Running Hooks}), whose members
should be functions that accept four arguments: @var{fun},
the inserted text, regardless of the markers' insertion type.
Insertion functions signal an error if the current buffer is
-read-only or if they insert within read-only text.
+read-only (@pxref{Read Only Buffers}) or if they insert within
+read-only text (@pxref{Special Properties}).
These functions copy text characters from strings and buffers along
with their properties. The inserted characters have exactly the same
@defun insert-buffer-substring from-buffer-or-name &optional start end
This function inserts a portion of buffer @var{from-buffer-or-name}
-(which must already exist) into the current buffer before point. The
-text inserted is the region between @var{start} and @var{end}. (These
-arguments default to the beginning and end of the accessible portion of
-that buffer.) This function returns @code{nil}.
+into the current buffer before point. The text inserted is the region
+between @var{start} (inclusive) and @var{end} (exclusive). (These
+arguments default to the beginning and end of the accessible portion
+of that buffer.) This function returns @code{nil}.
In this example, the form is executed with buffer @samp{bar} as the
current buffer. We assume that buffer @samp{bar} is initially empty.
In an interactive call, @var{count} is the numeric prefix argument.
+@c FIXME: This variable is obsolete since 23.1.
Self-insertion translates the input character through
@code{translation-table-for-input}. @xref{Translation of Characters}.
blank lines immediately following it.
A blank line is defined as a line containing only tabs and spaces.
+@c and the Newline character?
@code{delete-blank-lines} returns @code{nil}.
@end deffn
text anyway.)
@end defun
+@c FIXME: Add an index for yank-handler.
If you put a @code{yank-handler} text property on all or part of a
string, that alters how @code{insert-for-yank} inserts the string. If
different parts of the string have different @code{yank-handler}
@item (apply @var{delta} @var{beg} @var{end} @var{funname} . @var{args})
This is an extensible undo item, which records a change limited to the
range @var{beg} to @var{end}, which increased the size of the buffer
-by @var{delta}. It is undone by calling @var{funname} with arguments
-@var{args}.
+by @var{delta} characters. It is undone by calling @var{funname} with
+arguments @var{args}.
This kind of element enables undo limited to a region to determine
whether the element pertains to that region.
the undo list of @var{buffer-or-name} is already disabled, this function
has no effect.
-This function returns @code{nil}.
+In an interactive call, BUFFER-OR-NAME is the current buffer. You
+cannot specify any other buffer. This function returns @code{nil}.
@end deffn
As editing continues, undo lists get longer and longer. To prevent
a regular expression; if it matches the beginning of a line, that line
is treated as a citation marker.
+@c FIXME: "That mode" is confusing. It isn't a major/minor mode.
Ordinarily, @code{fill-individual-paragraphs} regards each change in
indentation as starting a new paragraph. If
@code{fill-individual-varying-indent} is non-@code{nil}, then only
@defvar use-hard-newlines
If this variable is non-@code{nil}, the filling functions do not delete
newlines that have the @code{hard} text property. These ``hard
-newlines'' act as paragraph separators.
+newlines'' act as paragraph separators. @xref{Hard and Soft
+Newlines,, Hard and Soft Newlines, emacs, The GNU Emacs Manual}.
@end defvar
@node Margins
@section Margins for Filling
+@cindex margins, filling
@defopt fill-prefix
This buffer-local variable, if non-@code{nil}, specifies a string of
@cindex filling, automatic
@cindex Auto Fill mode
+@c FIXME: I don't think any of the variables below is a/an normal/abnormal hook.
Auto Fill mode is a minor mode that fills lines automatically as text
is inserted. This section describes the hook used by Auto Fill mode.
For a description of functions that you can call explicitly to fill and
@group
(sort-subr reverse
(function
- (lambda ()
- (while (and (not (eobp))
- (looking-at paragraph-separate))
- (forward-line 1))))
+ (lambda ()
+ (while (and (not (eobp))
+ (looking-at paragraph-separate))
+ (forward-line 1))))
'forward-paragraph)
@end group
@end example
When called interactively, @var{column} is the value of prefix numeric
argument. If @var{column} is not an integer, an error is signaled.
+@c This behavior used to be documented until 2013/08.
+@ignore
If column @var{column} is beyond the end of the line, point moves to
the end of the line. If @var{column} is negative, point moves to the
beginning of the line.
+@end ignore
If it is impossible to move to column @var{column} because that is in
the middle of a multicolumn character such as a tab, point moves to the
For example, if @var{count} is 3, this command adds 3 columns of
indentation to each of the lines beginning in the region specified.
+@c FIXME: I suggest using message-indent-citation as the example, or
+@c just remove this paragraph. --xfq
In Mail mode, @kbd{C-c C-y} (@code{mail-yank-original}) uses
@code{indent-rigidly} to indent the text copied from the message being
replied to.
@end group
@group
-(capitalize-region 1 44)
+(capitalize-region 1 37)
@result{} nil
---------- Buffer: foo ----------
@table @code
@cindex property category of text character
+@c FIXME: Isn't @kindex for keyboard commands?
@kindex category @r{(text property)}
@item category
If a character has a @code{category} property, we call it the
This represents a window configuration to restore in one frame, and a
position to jump to in the current buffer.
+@c FIXME: Mention frameset here.
@item @code{(@var{frame-configuration} @var{position})}
This represents a frame configuration to restore, and a position
to jump to in the current buffer.
+2013-08-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * emacs-mime.texi (Encoding Customization): Exclude iso-2022-jp-2 and
+ shift_jis from the default value set to mm-coding-system-priorities for
+ Japanese users.
+
+2013-08-13 Glenn Morris <rgm@gnu.org>
+
+ * reftex.texi (LaTeX xr Package, Options - Table of Contents)
+ (Options - Defining Label Environments, Options - Creating Labels)
+ (Options - Referencing Labels, Options - Creating Citations)
+ (Options - Index Support, Options - Viewing Cross-References)
+ (Options - Finding Files, Options - Optimizations)
+ (Options - Fontification, Options - Misc):
+ * cc-mode.texi (Sample Init File):
+ * edt.texi (Init file):
+ * epa.texi (Encrypting/decrypting gpg files):
+ * mairix-el.texi (About, Setting up the mairix interface, Using)
+ (Extending):
+ Rename nodes to avoid characters that can cause Texinfo problems.
+
2013-08-12 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Mail Source Specifiers): Fix description for pop3's :leave.
* Customizing Indentation::
* Custom Macros::
* Odds and Ends::
-* Sample .emacs File::
+* Sample Init File::
* Performance Issues::
* Limitations and Known Bugs::
* FAQ::
This function is not bound to a key by default, but it's intended to be
used on the @kbd{RET} key. If you like the behavior of
@code{newline-and-indent} on @kbd{RET}, you should consider switching to
-this function. @xref{Sample .emacs File}.
+this function. @xref{Sample Init File}.
@item @kbd{M-x c-context-open-line}
@findex c-context-open-line
You can toggle each of these minor modes on and off, and you can
configure @ccmode{} so that it starts up with your favorite
-combination of them (@pxref{Sample .emacs File}). By default, when
+combination of them (@pxref{Sample Init File}). By default, when
you initialize a buffer, electric mode and syntactic-indentation mode
are enabled but the other two modes are disabled.
@vindex initialization-hook (c-)
Hook run only once per Emacs session, when @ccmode{} is initialized.
This is a good place to change key bindings (or add new ones) in any
-of the @ccmode{} key maps. @xref{Sample .emacs File}.
+of the @ccmode{} key maps. @xref{Sample Init File}.
@end defvar
@defvar c-mode-common-hook
Here's a simplified example of what you can add to your @file{.emacs}
file to do things whenever any @ccmode{} language is edited. See the
Emacs manuals for more information on customizing Emacs via hooks.
-@xref{Sample .emacs File}, for a more complete sample @file{.emacs}
+@xref{Sample Init File}, for a more complete sample @file{.emacs}
file.
@example
style. To do this, put the new style's settings into a list with the
following format; the list can then be passed as an argument to the
function @code{c-add-style}. You can see an example of a style
-definition in @ref{Sample .emacs File}.
+definition in @ref{Sample Init File}.
@cindex style definition
@c @defvr {List} style definition
You should use @code{c-set-style} instead.
The sample @file{.emacs} file provides a concrete example of how a new
-style can be added and automatically set. @xref{Sample .emacs File}.
+style can be added and automatically set. @xref{Sample Init File}.
@end defun
@defvar c-style-alist
@end defun
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node Odds and Ends, Sample .emacs File, Custom Macros, Top
+@node Odds and Ends, Sample Init File, Custom Macros, Top
@comment node-name, next, previous, up
@chapter Odds and Ends
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node Sample .emacs File, Performance Issues, Odds and Ends, Top
+@node Sample Init File, Performance Issues, Odds and Ends, Top
@comment node-name, next, previous, up
-@appendix Sample .emacs File
+@appendix Sample Init File
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Here's a sample .emacs file fragment that might help you along the way.
@end verbatim
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node Performance Issues, Limitations and Known Bugs, Sample .emacs File, Top
+@node Performance Issues, Limitations and Known Bugs, Sample Init File, Top
@comment node-name, next, previous, up
@chapter Performance Issues
@cindex performance
special needs.
@menu
-* edt-user.el:: Creating your own @file{edt-user.el} file.
+* Init file:: Creating your own @file{edt-user.el} file.
* Words:: Specifying word entities.
* Control keys:: Enabling EDT control key sequence bindings.
* Scroll margins:: Setting scroll margins.
@end menu
-@node edt-user.el
+@node Init file
@section Creating your own @file{edt-user.el} File
A sample @file{edt-user.el} file is provided in the Emacs @file{etc/}
textbook or tutorial first, especially if you only know OOP from
languages like C++ or Java. If on the other hand you are already
familiar with CLOS, you should be aware that @eieio{} does not implement
-the full CLOS specificiation and also differs in some other aspects
+the full CLOS specification and also differs in some other aspects
(@xref{Introduction}, and @ref{CLOS compatibility}).
A @dfn{class} is a definition for organizing data and methods
@vindex mm-coding-system-priorities
Prioritize coding systems to use for outgoing messages. The default
is @code{nil}, which means to use the defaults in Emacs, but is
-@code{(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8)} when
-running Emacs in the Japanese language environment. It is a list of
-coding system symbols (aliases of coding systems are also allowed, use
-@kbd{M-x describe-coding-system} to make sure you are specifying correct
-coding system names). For example, if you have configured Emacs
-to prefer UTF-8, but wish that outgoing messages should be sent in
-ISO-8859-1 if possible, you can set this variable to
-@code{(iso-8859-1)}. You can override this setting on a per-message
-basis by using the @code{charset} @acronym{MML} tag (@pxref{MML Definition}).
+@code{(iso-8859-1 iso-2022-jp utf-8)} when running Emacs in the Japanese
+language environment. It is a list of coding system symbols (aliases of
+coding systems are also allowed, use @kbd{M-x describe-coding-system} to
+make sure you are specifying correct coding system names). For example,
+if you have configured Emacs to prefer UTF-8, but wish that outgoing
+messages should be sent in ISO-8859-1 if possible, you can set this
+variable to @code{(iso-8859-1)}. You can override this setting on a
+per-message basis by using the @code{charset} @acronym{MML} tag
+(@pxref{MML Definition}).
As different hierarchies prefer different charsets, you may want to set
@code{mm-coding-system-priorities} according to the hierarchy in Gnus.
(mm-coding-system-priorities '(iso-8859-15 iso-8859-1 utf-8)))
("^fj\\." ;; Japanese
(mm-coding-system-priorities
- '(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8)))
+ '(iso-8859-1 iso-2022-jp utf-8)))
("^ru\\." ;; Cyrillic
(mm-coding-system-priorities
'(koi8-r iso-8859-5 iso-8859-1 utf-8))))
* Cryptographic operations on files::
* Dired integration::
* Mail-mode integration::
-* Encrypting/decrypting *.gpg files::
+* Encrypting/decrypting gpg files::
@end menu
@node Key management
@end table
-@node Encrypting/decrypting *.gpg files
-@section Encrypting/decrypting *.gpg files
+@node Encrypting/decrypting gpg files
+@section Encrypting/decrypting gpg files
By default, every file whose name ends with @samp{.gpg} will be
treated as encrypted. That is, when you open such a file, the
decrypted text is inserted in the buffer rather than encrypted one.
To set up elisp passphrase cache, set
@code{epa-file-cache-passphrase-for-symmetric-encryption}.
-@xref{Encrypting/decrypting *.gpg files}.
+@xref{Encrypting/decrypting gpg files}.
@node Bug Reports
@chapter Bug Reports
@end ifnottex
@menu
-* About mairix and mairix.el:: About the mairix search engine and mairix.el
-* Configuring mairix:: How to configure mairix
-* Setting up mairix.el:: Set up mairix.el
-* Using mairix.el:: List of interactive functions
-* Extending mairix.el:: Support your favorite mail reader!
+* About:: About the mairix search engine and mairix.el.
+* Configuring mairix:: How to configure mairix.
+* Setting up the mairix interface:: Set up mairix.el.
+* Using:: List of interactive functions
+* Extending:: Support your favorite mail reader!
* GNU Free Documentation License:: The license for this documentation.
@end menu
-@node About mairix and mairix.el
+@node About
@chapter About mairix and mairix.el
Mairix is a tool for indexing and searching words in locally stored
with RMail, Gnus, or VM as the Emacs mail program. However, it should
also work with Maildir or MH, and it should be very easy to integrate
other Emacs mail programs into @code{mairix.el}
-(@pxref{Extending mairix.el}).
+(@pxref{Extending}).
If you use Gnus with maildir or MH, you should really use the native
Gnus back end @code{nnmairix} instead, since it is more tightly
Note that this may take a few minutes, but every following index will do
the updates incrementally and hence is very fast.
-@node Setting up mairix.el
-@chapter Setting up mairix.el
+@node Setting up the mairix interface
+@chapter Setting up the mairix interface
First, put @code{mairix.el} in your Emacs search path and put
@code{(require 'mairix)} into your @file{.emacs} file. Then, use
nnmairix instead.
If you use another Emacs mail program which is not yet supported by
-mairix.el, it is pretty easy to integrate it. @xref{Extending
-mairix.el}, on how to integrate it into mairix.el.
+mairix.el, it is pretty easy to integrate it. @xref{Extending},
+on how to integrate it into mairix.el.
-Now you should be ready to go. @xref{Using mairix.el}, for the available
-commands.
+Now you should be ready to go. @xref{Using}, for the available commands.
-@node Using mairix.el
+@node Using
@chapter Using mairix.el
There are currently no default key bindings for mairix.el, since those
@end table
-@node Extending mairix.el
+@node Extending
@chapter Extending mairix.el
Your favorite Emacs mail program is not supported? Shame on me. But
* Defining Label Environments:: ... and environments it doesn't.
* Reference Info:: View the label corresponding to a \ref.
* Reference Styles:: Macros to be used instead of \ref.
-* xr (LaTeX package):: References to external documents.
+* LaTeX xr Package:: References to external documents.
Defining Label Environments
Options, Keymaps, Hooks
-* Options (Table of Contents)::
-* Options (Defining Label Environments)::
-* Options (Creating Labels)::
-* Options (Referencing Labels)::
-* Options (Creating Citations)::
-* Options (Index Support)::
-* Options (Viewing Cross-References)::
-* Options (Finding Files)::
-* Options (Optimizations)::
-* Options (Fontification)::
-* Options (Misc)::
+* Options - Table of Contents::
+* Options - Defining Label Environments::
+* Options - Creating Labels::
+* Options - Referencing Labels::
+* Options - Creating Citations::
+* Options - Index Support::
+* Options - Viewing Cross-References::
+* Options - Finding Files::
+* Options - Optimizations::
+* Options - Fontification::
+* Options - Misc::
@end detailmenu
@end menu
@item mouse-2
@vindex reftex-highlight-selection
Clicking with mouse button 2 on a line has the same effect as @key{RET}.
-See also variable @code{reftex-highlight-selection}, @ref{Options
-(Fontification)}.
+See also variable @code{reftex-highlight-selection},
+@ref{Options - Fontification}.
@item f
@vindex reftex-toc-follow-mode
@item x
Switch to the @file{*toc*} buffer of an external document. When the
-current document is using the @code{xr} package (@pxref{xr (LaTeX
-package)}), @RefTeX{} will switch to one of the external
-documents.
+current document is using the @code{xr} package (@pxref{LaTeX xr Package}),
+@RefTeX{} will switch to one of the external documents.
@tablesubheading{Automatic recentering}
* Defining Label Environments:: ... and environments it doesn't.
* Reference Info:: View the label corresponding to a \ref.
* Reference Styles:: Macros to be used instead of \ref.
-* xr (LaTeX package):: References to external documents.
+* LaTeX xr Package:: References to external documents.
@end menu
@node Creating Labels
@vindex reftex-insert-label-flags
If you want to change the way certain labels are created, check out the
-variable @code{reftex-insert-label-flags} (@pxref{Options (Creating
-Labels)}).
+variable @code{reftex-insert-label-flags} (@pxref{Options - Creating
+Labels}).
If you are using @AUCTeX{} to write your @LaTeX{} documents, you can
set it up to delegate the creation of labels to
@vindex reftex-highlight-selection
Clicking with mouse button 2 on a label will accept it like @key{RET}
would. See also variable @code{reftex-highlight-selection},
-@ref{Options (Misc)}.
+@ref{Options - Misc}.
@vindex reftex-multiref-punctuation
@item m - + ,
@tablesubheading{Controlling what gets displayed}
@vindex reftex-label-menu-flags
The defaults for the following flags can be configured with the variable
-@code{reftex-label-menu-flags} (@pxref{Options (Referencing Labels)}).
+@code{reftex-label-menu-flags} (@pxref{Options - Referencing Labels}).
@item c
Toggle the display of the one-line label definition context in the
Reference a label from an external document. With the @LaTeX{} package
@code{xr} it is possible to reference labels defined in another
document. This key will switch to the label menu of an external
-document and let you select a label from there (@pxref{xr (LaTeX
-package),,xr}).
+document and let you select a label from there (@pxref{LaTeX xr Package,,xr}).
@end table
@vindex reftex-label-alist
@RefTeX{} can be configured to recognize additional labeled
environments and macros. This is done with the variable
-@code{reftex-label-alist} (@pxref{Options (Defining Label
-Environments)}). If you are not familiar with Lisp, you can use the
+@code{reftex-label-alist} (@pxref{Options - Defining Label
+Environments}). If you are not familiar with Lisp, you can use the
@code{custom} library to configure this rather complex variable. To do
this, use
@code{nil} means to use the text right after the label definition.
@item
For more complex ways of getting context, see the variable
-@code{reftex-label-alist} (@ref{Options (Defining Label
-Environments)}).
+@code{reftex-label-alist} (@ref{Options - Defining Label Environments}).
@end itemize
The following list of strings is used to guess the correct label type
Depending on how you would like the label insertion and selection for
the new environments to work, you might want to add the letters @samp{a}
and @samp{h} to some of the flags in the variables
-@code{reftex-insert-label-flags} (@pxref{Options (Creating Labels)})
-and @code{reftex-label-menu-flags} (@pxref{Options (Referencing
-Labels)}).
+@code{reftex-insert-label-flags} (@pxref{Options - Creating Labels})
+and @code{reftex-label-menu-flags} (@pxref{Options - Referencing Labels}).
@node Quick Equation
these variables are deprecated now. Instead of setting them, the
variable @code{reftex-ref-style-default-list} should be adapted now.
-@node xr (LaTeX package)
+@node LaTeX xr Package
@section @code{xr}: Cross-Document References
@cindex @code{xr}, LaTeX package
@cindex LaTeX packages, @code{xr}
@item mouse-2
@vindex reftex-highlight-selection
Clicking with mouse button 2 on a citation will accept it like @key{RET}
-would. See also variable @code{reftex-highlight-selection}, @ref{Options
-(Misc)}.
+would. See also variable @code{reftex-highlight-selection},
+@ref{Options - Misc}.
@item m
Mark the current entry. When one or several entries are marked,
The @samp{Find and Index in Document} menu in the phrases buffer also
lists a few options for the indexing process. The options have
-associated customization variables to set the defaults (@pxref{Options
-(Index Support)}). Here is a short explanation of what the options do:
+associated customization variables to set the defaults
+(@pxref{Options - Index Support}). Here is a short explanation of
+what the options do:
@table @i
@item Match Whole Words
@samp{ref} or @samp{refrange}} of the @code{\ref} macro are active for
cross-reference display. This works also for labels defined in an
external document when the current document refers to them through the
-@code{xr} interface (@pxref{xr (LaTeX package)}).
+@code{xr} interface (@pxref{LaTeX xr Package}).
@item @code{\label}
@cindex @code{\label}
use faces only when @code{font-lock} is loaded. This seems to be
reasonable because people who like faces will very likely have it
loaded. If you wish to turn off fontification or change the involved
-faces, see @ref{Options (Fontification)}.
+faces, see @ref{Options - Fontification}.
@node Multifile Documents
@section Multifile Documents
reftex-customize} will get you there.
@menu
-* Options (Table of Contents)::
-* Options (Defining Label Environments)::
-* Options (Creating Labels)::
-* Options (Referencing Labels)::
-* Options (Creating Citations)::
-* Options (Index Support)::
-* Options (Viewing Cross-References)::
-* Options (Finding Files)::
-* Options (Optimizations)::
-* Options (Fontification)::
-* Options (Misc)::
+* Options - Table of Contents::
+* Options - Defining Label Environments::
+* Options - Creating Labels::
+* Options - Referencing Labels::
+* Options - Creating Citations::
+* Options - Index Support::
+* Options - Viewing Cross-References::
+* Options - Finding Files::
+* Options - Optimizations::
+* Options - Fontification::
+* Options - Misc::
* Keymaps and Hooks::
@end menu
-@node Options (Table of Contents)
+@node Options - Table of Contents
@section Table of Contents
@cindex Options, table of contents
@cindex Table of contents, options
(@pxref{Table of Contents}).
@end deffn
-@node Options (Defining Label Environments)
+@node Options - Defining Label Environments
@section Defining Label Environments
@cindex Options, defining label environments
@cindex Defining label environments, options
non-footnote labels.
@end defopt
-@node Options (Creating Labels)
+@node Options - Creating Labels
@section Creating Labels
@cindex Options, creating labels
@cindex Creating labels, options
@end table
@end defopt
-@node Options (Referencing Labels)
+@node Options - Referencing Labels
@section Referencing Labels
@cindex Options, referencing labels
@cindex Referencing labels, options
(@pxref{Referencing Labels}).
@end deffn
-@node Options (Creating Citations)
+@node Options - Creating Citations
@section Creating Citations
@cindex Options, creating citations
@cindex Creating citations, options
@end defopt
-@node Options (Index Support)
+@node Options - Index Support, Options - Viewing Cross-References, Options - Creating Citations, Options
@section Index Support
@cindex Options, Index support
@cindex Index support, options
(@pxref{Index Support}).
@end deffn
-@node Options (Viewing Cross-References)
+@node Options - Viewing Cross-References
@section Viewing Cross-References
@cindex Options, viewing cross-references
@cindex Viewing cross-references, options
scans. In order to clear it, use @kbd{M-x reftex-reset-mode}.
@end defopt
-@node Options (Finding Files)
+@node Options - Finding Files
@section Finding Files
@cindex Options, Finding Files
@cindex Finding files, options
@end defopt
@page
-@node Options (Optimizations)
+@node Options - Optimizations
@section Optimizations
@cindex Options, optimizations
@cindex Optimizations, options
non-@code{nil}.
@end defopt
-@node Options (Fontification)
+@node Options - Fontification
@section Fontification
@cindex Options, fontification
@cindex Fontification, options
Face name for index entries.
@end defopt
-@node Options (Misc)
+@node Options - Misc
@section Miscellaneous
@cindex Options, misc
@item F k
Delete the current todo file (@code{todo-delete-file}).@footnote{The key
-binding of this command is mnenomic for ``kill'' to parallel the binding
+binding of this command is mnemonic for ``kill'' to parallel the binding
@kbd{k} for item deletion, since @kbd{d} is bound to another item
editing command (@pxref{Done Items}).} If the todo file has an archive
(@pxref{Todo Archive Mode}), prompt whether to delete that as well.
@item C k
Delete the current category (@code{todo-delete-category}).@footnote{This
-binding is mnenomic for ``kill'' to parallel the binding @kbd{k} for
+binding is mnemonic for ``kill'' to parallel the binding @kbd{k} for
item deletion, since @kbd{d} is bound to another item editing command
(@pxref{Done Items}).} To delete a category that contains items, you
have to confirm your intent; if the category is empty, deletion is
text. Each unique combination of these parameters produces a different
insertion command. The command @kbd{i i} realizes one of these
combinations. For the commands that realize the remaining combinations
-it is convenient to associate each parameter with a mnenomically chosen
+it is convenient to associate each parameter with a mnemonically chosen
key. Then by typing certain sequences of these keys, you complete the
insertion command invocation that realizes the specified combination.
As with @kbd{i i}, the effect of many of these commands also depends on
@enumerate
@item
-@kbd{y} for diary (non)inclusion;
+@kbd{y} for diary (non)inclusion;
@item
@kbd{k} for adding or omitting `diary-nonmarking-symbol';
@item
@item k
Delete the todo item at point (@code{todo-delete-item}; the binding is
-mnenomic for ``kill'', since @kbd{d} is used for marking items as done
+mnemonic for ``kill'', since @kbd{d} is used for marking items as done
(@pxref{Done Items}); but note that @kbd{k} does not put the item into
the kill ring). This command requires confirmation that you want to
delete the item, since you cannot undo the deletion in Todo mode. (You
You can mark both todo and done items, but note that only @kbd{m} can apply
to both; other commands only affect either marked todo or marked done
-items, so if both types of items are marked, invoking these commmands
+items, so if both types of items are marked, invoking these commands
has no effect and informs you of your erroneous attempt.
@node Todo Categories Mode, Searching for Items, Marked Items, Top
@node Table of Item Counts, Reordering Categories, , Todo Categories Mode
@section Table of Item Counts
-Above each column of the table is a labelled button you can press by
+Above each column of the table is a labeled button you can press by
clicking with the mouse or by typing @key{RET} on it. Pressing an item
count button sorts the table alternately in ascending or descending
order according to the type of count. Pressing the category button
one for filtering a user-specified list of todo files. Thus, there
are six item filtering commands:@footnote{The use of @kbd{F} in the key
sequences of these commands naturally recalls ``filter'', but is also
-consistent with the Todo mode mnenomic key binding convention, since the
+consistent with the Todo mode mnemonic key binding convention, since the
commands involve one or more whole files.}
@itemize @bullet
@end table
@itemize @bullet
-@item
+@item
As with tables of categories, by customizing @code{todo-show-first} you
can have the first invocation of @code{todo-show} for a given todo file
display the corresponding saved file of filtered items. If there is
@node Todo Display Features, Printing Todo Buffers, Todo Filtered Items Mode, Top
@chapter Todo Display Features
-You can change the appearance of Todo mode buffers in a variety of ways.
+You can change the appearance of Todo mode buffers in a variety of ways.
@menu
* Faces::
@code{todo-nondiary-marker}) is earlier than the current date and time,
they are displayed in a different face. In this way, you can readily
recognize diary items that have ``expired'' and act accordingly (e.g.,
-by tagging them as done or by updating the deadlines).
+by tagging them as done or by updating the deadlines).
Another example of an informational face is the face used to distinguish
top priority items. A third case is the face used in Todo Categories
+2013-08-15 Glenn Morris <rgm@gnu.org>
+
+ * refcards/calccard.pdf, refcards/cs-dired-ref.pdf:
+ * refcards/cs-refcard.pdf, refcards/de-refcard.pdf:
+ * refcards/dired-ref.pdf, refcards/fr-dired-ref.pdf:
+ * refcards/fr-refcard.pdf, refcards/gnus-booklet.pdf:
+ * refcards/gnus-refcard.pdf, refcards/orgcard.pdf:
+ * refcards/pl-refcard.pdf, refcards/pt-br-refcard.pdf:
+ * refcards/refcard.pdf, refcards/ru-refcard.pdf:
+ * refcards/sk-dired-ref.pdf, refcards/sk-refcard.pdf:
+ Remove generated files from repository.
+
+ * refcards/Makefile: Rewrite to use portable Makefile syntax.
+ Add language-specific targets.
+ (distclean, extraclean): New rules.
+
+2013-08-13 Glenn Morris <rgm@gnu.org>
+
+ * refcards/Makefile (all_pdf, all_ps, fr-survival.ps, dist):
+ New rules.
+ (SURVIVAL_CARDS_PDF): Add fr_survival.pdf.
+
2013-08-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
* NEWS: Mention -lz and `decompress-gzipped-region'.
`f' (`image-next-frame') and `b' (`image-previous-frame') visit the
next or previous frame. `F' (`image-goto-frame') shows a specific frame.
+*** New commands to speed up, slow down, or reverse animation.
+
---
*** The command `image-mode-fit-frame' deletes other windows.
When toggling, it restores the frame's previous window configuration.
*** New functions `image-current-frame' and `image-show-frame' for getting
and setting the current frame of a multi-frame image.
+*** You can change the speed of animated images.
+
** Changes in encoding and decoding of text
---
*** ImageMagick images now support the :max-width and :max-height
keywords.
+*** Some data types aren't auto-detected by ImageMagick. Adding
+:format to `create-image' may help if the content type is in the
+new variable `image-format-suffixes'.
+
** Minibuffer
*** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the
## You should have received a copy of the GNU General Public License
## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+### Commentary:
-## Top-level targets.
+## See README for details.
-## PDF files that are included with Emacs.
-all: refcards_pdf dired-refcards_pdf misc-refcards_pdf
+PDF_ENGLISH = \
+ calccard.pdf \
+ dired-ref.pdf \
+ gnus-booklet.pdf \
+ gnus-refcard.pdf \
+ orgcard.pdf \
+ refcard.pdf \
+ survival.pdf \
+ vipcard.pdf \
+ viperCard.pdf
-REFCARDS_PDF = refcard.pdf cs-refcard.pdf de-refcard.pdf fr-refcard.pdf \
- pl-refcard.pdf pt-br-refcard.pdf ru-refcard.pdf sk-refcard.pdf
-refcards_pdf: ${REFCARDS_PDF}
-refcards_ps: ${REFCARDS_PDF:.pdf=.ps}
+PDF_CZECH = \
+ cs-dired-ref.pdf \
+ cs-refcard.pdf \
+ cs-survival.pdf
-DIRED_REFCARDS_PDF = dired-ref.pdf cs-dired-ref.pdf fr-dired-ref.pdf \
- sk-dired-ref.pdf
-dired-refcards_pdf: ${DIRED_REFCARDS_PDF}
-dired-refcards_ps: ${DIRED_REFCARDS_PDF:.pdf=.ps}
+PDF_FRENCH = \
+ fr-dired-ref.pdf \
+ fr-refcard.pdf \
+ fr-survival.pdf \
-MISC_REFCARDS_PDF = calccard.pdf gnus-booklet.pdf gnus-refcard.pdf orgcard.pdf
-misc-refcards_pdf: ${MISC_REFCARDS_PDF}
-misc-refcards_ps: ${MISC_REFCARDS_PDF:.pdf=.ps}
+PDF_GERMAN = de-refcard.pdf
+PDF_POLISH = pl-refcard.pdf
-## The following files are not included with Emacs.
-SURVIVAL_CARDS_PDF = survival.pdf cs-survival.pdf sk-survival.pdf
-survival-cards_pdf: ${SURVIVAL_CARDS_PDF}
-survival-cards_ps: ${SURVIVAL_CARDS_PDF:.pdf=.ps}
+PDF_PORTUGUESE = pt-br-refcard.pdf
-VIPER_CARDS_PDF = vipcard.pdf viperCard.pdf
-viper-cards_pdf: ${VIPER_CARDS_PDF}
-viper-cards_ps: ${VIPER_CARDS_PDF:.pdf=.ps}
+PDF_RUSSIAN = ru-refcard.pdf
-ENVADD = TEXINPUTS=".:"
+PDF_SLOVAKIAN = \
+ sk-dired-ref.pdf \
+ sk-refcard.pdf \
+ sk-survival.pdf
-## PDF files.
+PDF_TARGETS = $(PDF_ENGLISH) $(PDF_CZECH) $(PDF_FRENCH) $(PDF_GERMAN) \
+ $(PDF_POLISH) $(PDF_PORTUGUESE) $(PDF_RUSSIAN) $(PDF_SLOVAKIAN)
-## The page layouts (a4/letter) are written directly in the .tex files.
+PS_ENGLISH = \
+ calccard.ps \
+ dired-ref.ps \
+ gnus-booklet.ps \
+ gnus-refcard.ps \
+ orgcard.ps \
+ refcard.ps \
+ survival.ps \
+ vipcard.ps \
+ viperCard.ps
-cs-refcard.pdf cs-dired-ref.pdf cs-survival.pdf sk-refcard.pdf \
-sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex emacsver.tex
- if pdfcsplain --version > /dev/null 2> /dev/null; then \
- ${ENVADD} pdfcsplain $<; \
- else \
- ${ENVADD} csplain "\pdfoutput=1\input $<"; \
- fi
+PS_CZECH = \
+ cs-dired-ref.ps \
+ cs-refcard.ps \
+ cs-survival.ps
-## Some versions of pdfmex seem to create dvi by default, hence output-format.
-pl-refcard.pdf: %.pdf: %.tex emacsver.tex
- if ! kpsewhich -format=fmt mex > /dev/null && \
- ! pdfmex --version > /dev/null 2> /dev/null; then \
- echo "No mex format found."; false; \
- fi
- ${ENVADD} pdftex -output-format=pdf $<
+PS_FRENCH = \
+ fr-dired-ref.ps \
+ fr-refcard.ps \
+ fr-survival.ps \
-ru-refcard.pdf: %.pdf: %.tex
- pdflatex $<
+PS_GERMAN = de-refcard.ps
-#gnus-logo.pdf: %.pdf: %.eps
-# ps2pdf $<
+PS_POLISH = pl-refcard.ps
-gnus-refcard.pdf: %.pdf: %.tex gnus-logo.pdf
- pdflatex $<
+PS_PORTUGUESE = pt-br-refcard.ps
-gnus-booklet.pdf: gnus-refcard.tex gnus-logo.pdf
- pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}'
+PS_RUSSIAN = ru-refcard.ps
-## Everything not explicitly listed above.
-%.pdf: %.tex emacsver.tex
- ${ENVADD} pdftex $<
+PS_SLOVAKIAN = \
+ sk-dired-ref.ps \
+ sk-refcard.ps \
+ sk-survival.ps
+PS_TARGETS = $(PS_ENGLISH) $(PS_CZECH) $(PS_FRENCH) $(PS_GERMAN) \
+ $(PS_POLISH) $(PS_PORTUGUESE) $(PS_RUSSIAN) $(PS_SLOVAKIAN)
-## dvi files.
-cs-refcard.dvi cs-dired-ref.dvi cs-survival.dvi sk-refcard.dvi \
-sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex emacsver.tex
- ${ENVADD} csplain $<
+## For emacsver.tex.
+ENVADD = TEXINPUTS=".:$(TEXINPUTS)"
-pl-refcard.dvi: %.dvi: %.tex emacsver.tex
- if ! kpsewhich -format=fmt mex > /dev/null; then \
- echo "No mex format found."; false; \
- fi
- ${ENVADD} tex $<
-ru-refcard.dvi gnus-refcard.dvi: %.dvi: %.tex
- latex $<
+.PHONY: all pdf ps
-gnus-booklet.dvi: gnus-refcard.tex
- latex '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}'
- mv gnus-refcard.dvi $@
+all: pdf
+pdf: $(PDF_TARGETS)
+ps: $(PS_TARGETS)
-## Everything not explicitly listed above.
-%.dvi: %.tex emacsver.tex
- ${ENVADD} tex $<
+.PHONY: english czech french german polish portuguese russian slovakian
+english: $(PDF_ENGLISH)
+czech: $(PDF_CZECH)
+french: $(PDF_FRENCH)
+german: $(PDF_GERMAN)
+polish: $(PDF_POLISH)
+portuguese: $(PDF_PORTUGUESE)
+russian: $(PDF_RUSSIAN)
+slovakian: $(PDF_SLOVAKIAN)
-## PostScript files.
+.PHONY: english-ps czech-ps french-ps german-ps polish-ps portuguese-ps russian-ps slovakian-ps
+english-ps: $(PS_ENGLISH)
+czech-ps: $(PS_CZECH)
+french-ps: $(PS_FRENCH)
+german-ps: $(PS_GERMAN)
+polish-ps: $(PS_POLISH)
+portuguese-ps: $(PS_PORTUGUESE)
+russian-ps: $(PS_RUSSIAN)
+slovakian-ps: $(PS_SLOVAKIAN)
-## Note that some of the tex files (refcard, de-refcard, fr-refcard,
-## pt-br-refcard) have settings for letter or a4 paper. Following are
-## the default paper sizes (letter for English, A4 for translations).
-## FIXME orgcard.ps does not fit on letter (see orgcard.tex).
-## A4, landscape.
-de-refcard.ps fr-refcard.ps pt-br-refcard.ps orgcard.ps: %.ps: %.dvi
- dvips -t a4 -t landscape $< -o $@
+## Default for file that do not use a different paper size.
+.SUFFIXES: .ps .dvi
+.dvi.ps:
+ dvips -t letter -o $@ $<
+
+
+make_cs=if pdfcsplain --version > /dev/null 2> /dev/null; then \
+ $(ENVADD) pdfcsplain $$input; \
+ else \
+ $(ENVADD) csplain "\pdfoutput=1\input $$input"; \
+ fi
+
+## For pdf output, the page layouts (a4/letter) are written directly
+## in the .tex files.
-## A4, portrait.
-cs-dired-ref.ps cs-refcard.ps cs-survival.ps fr-dired-ref.ps \
-pl-refcard.ps ru-refcard.ps \
-sk-dired-ref.ps sk-refcard.ps sk-survival.ps: %.ps: %.dvi
- dvips -t a4 $< -o $@
+## For PostScript output, note that some of the tex files (refcard,
+## de-refcard, fr-refcard, pt-br-refcard) have settings for letter or
+## a4 paper. The Following are the default paper sizes (letter for English,
+## A4 for translations).
+## FIXME orgcard.ps does not fit on letter (see orgcard.tex).
-## letter, landscape.
-calccard.ps refcard.ps: %.ps: %.dvi
- dvips -t letter -t landscape $< -o $@
+## A4, landscape: de-refcard, fr-refcard, pt-br-refcard orgcard
+## A4, portrait: cs-*, fr-dired-ref, sk-*, pl-refcard, ru-refcard
+## Letter, landscape: calccard, refcard
+## Letter, portrait (suffix rule): dired-ref, gnus-*, survival, vip*
+
+calccard_deps = calccard.tex emacsver.tex pdflayout.sty
+calccard.pdf: $(calccard_deps)
+ $(ENVADD) pdftex calccard.tex
+calccard.dvi: $(calccard_deps)
+ $(ENVADD) tex calccard.tex
+calccard.ps: calccard.dvi
+ dvips -t letter -t landscape -o $@ calccard.dvi
+
+cs_dired_ref_deps = cs-dired-ref.tex emacsver.tex pdflayout.sty
+cs-dired-ref.pdf: $(cs_dired_ref_deps)
+ input=cs-dired-ref.tex; $(make_cs)
+cs-dired-ref.dvi: $(cs_dired_ref_deps)
+ $(ENVADD) csplain cs-dired-ref.tex
+cs-dired-ref.ps: cs-dired-ref.dvi
+ dvips -t a4 -o $@ cs-dired-ref.dvi
+
+cs_refcard_deps = cs-refcard.tex emacsver.tex pdflayout.sty
+cs-refcard.pdf: $(cs_refcard_deps)
+ input=cs-refcard.tex; $(make_cs)
+cs-refcard.dvi: $(cs_refcard_deps)
+ $(ENVADD) csplain cs-refcard.tex
+cs-refcard.ps: cs-refcard.dvi
+ dvips -t a4 -o $@ cs-refcard.dvi
+
+cs_survival_deps = cs-survival.tex emacsver.tex pdflayout.sty
+cs-survival.pdf: $(cs_survival_deps)
+ input=cs-survival.tex; $(make_cs)
+cs-survival.dvi: $(cs_survival_deps)
+ $(ENVADD) csplain cs-survival.tex
+cs-survival.ps: cs-survival.dvi
+ dvips -t a4 -o $@ cs-survival.dvi
+
+de_refcard_deps = de-refcard.tex emacsver.tex pdflayout.sty
+de-refcard.pdf: $(de_refcard_deps)
+ $(ENVADD) pdftex de-refcard.tex
+de-refcard.dvi: $(de_refcard_deps)
+ $(ENVADD) tex de-refcard.tex
+de-refcard.ps: de-refcard.dvi
+ dvips -t a4 -t landscape -o $@ de-refcard.dvi
+
+dired_ref_deps = dired-ref.tex emacsver.tex pdflayout.sty
+dired-ref.pdf: $(dired_ref_deps)
+ $(ENVADD) pdftex dired-ref.tex
+dired-ref.dvi: $(dired_ref_deps)
+ $(ENVADD) tex dired-ref.tex
+
+fr_dired_ref_deps = fr-dired-ref.tex emacsver.tex pdflayout.sty
+fr-dired-ref.pdf: $(fr_dired_ref_deps)
+ $(ENVADD) pdftex fr-dired-ref.tex
+fr-dired-ref.dvi: $(fr_dired_ref_deps)
+ $(ENVADD) tex fr-dired-ref.tex
+fr-dired-ref.ps: fr-dired-ref.dvi
+ dvips -t a4 -o $@ fr-dired-ref.dvi
+
+fr_refcard_deps = fr-refcard.tex emacsver.tex pdflayout.sty
+fr-refcard.pdf: $(fr_refcard_deps)
+ $(ENVADD) pdftex fr-refcard.tex
+fr-refcard.dvi: $(fr_refcard_deps)
+ $(ENVADD) tex fr-refcard.tex
+fr-refcard.ps: fr-refcard.dvi
+ dvips -t a4 -t landscape -o $@ fr-refcard.dvi
+
+fr_survival_deps = fr-survival.tex emacsver.tex pdflayout.sty
+fr-survival.pdf: $(fr_survival_deps)
+ $(ENVADD) pdftex fr-survival.tex
+fr-survival.dvi: $(fr_survival_deps)
+ $(ENVADD) tex fr-survival.tex
+fr-survival.ps: fr-survival.dvi
+ dvips -t a4 -o $@ fr-survival.dvi
+
+## No dependency on emacsver.tex, pdflayout.sty; no need for ENVADD.
+gnus_booklet_deps = gnus-refcard.tex gnus-logo.pdf
+gnus-booklet.pdf: $(gnus_booklet_deps)
+ pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}'
+gnus-booklet.dvi: gnus-refcard.tex gnus-logo.eps
+ latex '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}'
+ mv gnus-refcard.dvi $@
-## letter, portrait.
-dired-ref.ps gnus-booklet.ps gnus-refcard.ps survival.ps vipcard.ps \
-viperCard.ps: %.ps: %.dvi
- dvips -t letter $< -o $@
+###gnus-logo.pdf: gnus-logo.eps
+### ps2pdf gnus-logo.eps
+
+## No dependency on emacsver.tex, pdflayout.sty; no need for ENVADD.
+gnus_refcard_deps = gnus-refcard.tex gnus-logo.pdf
+gnus-refcard.pdf: $(gnus_refcard_deps)
+ pdflatex gnus-refcard.tex
+gnus-refcard.dvi: $(gnus_refcard_deps)
+ latex gnus-refcard.tex
+
+orgcard_deps = orgcard.tex emacsver.tex pdflayout.sty
+orgcard.pdf: $(orgcard_deps)
+ $(ENVADD) pdftex orgcard.tex
+orgcard.dvi: $(orgcard_deps)
+ $(ENVADD) tex orgcard.tex
+orgcard.ps: orgcard.dvi
+ dvips -t a4 -t landscape -o $@ orgcard.dvi
+
+pl_refcard_deps = pl-refcard.tex emacsver.tex pdflayout.sty
+## Some versions of pdfmex seem to create dvi by default, hence output-format.
+pl-refcard.pdf: $(pl_refcard_deps)
+ if ! kpsewhich -format=fmt mex > /dev/null && \
+ ! pdfmex --version > /dev/null 2> /dev/null; then \
+ echo "No mex format found."; false; \
+ fi
+ $(ENVADD) pdftex -output-format=pdf pl-refcard.tex
+pl-refcard.dvi: $(pl_refcard_deps)
+ if ! kpsewhich -format=fmt mex > /dev/null; then \
+ echo "No mex format found."; false; \
+ fi
+ $(ENVADD) tex pl-refcard.tex
+pl-refcard.ps: pl-refcard.dvi
+ dvips -t a4 -o $@ pl-refcard.dvi
+
+pt_br_refcard_deps = pt-br-refcard.tex emacsver.tex pdflayout.sty
+pt-br-refcard.pdf: $(pt_br_refcard_deps)
+ $(ENVADD) pdftex pt-br-refcard.tex
+pt-br-refcard.dvi: $(pt_br_refcard_deps)
+ $(ENVADD) tex pt-br-refcard.tex
+pt-br-refcard.ps: pt-br-refcard.dvi
+ dvips -t a4 -t landscape -o $@ pt-br-refcard.dvi
+
+refcard_deps = refcard.tex emacsver.tex pdflayout.sty
+refcard.pdf: $(refcard_deps)
+ $(ENVADD) pdftex refcard.tex
+refcard.dvi: $(refcard_deps)
+ $(ENVADD) tex refcard.tex
+refcard.ps: refcard.dvi
+ dvips -t letter -t landscape -o $@ refcard.dvi
+
+## No dependency on emacsver.tex, pdflayout.sty; no need for ENVADD.
+ru_refcard_deps = ru-refcard.tex
+ru-refcard.pdf: $(ru_refcard_deps)
+ pdflatex ru-refcard.tex
+ru-refcard.dvi: $(ru_refcard_deps)
+ latex ru-refcard.tex
+ru-refcard.ps: ru-refcard.dvi
+ dvips -t a4 -o $@ ru-refcard.dvi
+
+sk_dired_ref_deps = sk-dired-ref.tex emacsver.tex pdflayout.sty
+sk-dired-ref.pdf: $(sk_dired_ref_deps)
+ input=sk-dired-ref.tex; $(make_cs)
+sk-dired-ref.dvi: $(sk_dired_ref_deps)
+ $(ENVADD) csplain sk-dired-ref.tex
+sk-dired-ref.ps: sk-dired-ref.dvi
+ dvips -t a4 -o $@ sk-dired-ref.dvi
+
+sk_refcard_deps = sk-refcard.tex emacsver.tex pdflayout.sty
+sk-refcard.pdf: $(sk_refcard_deps)
+ input=sk-refcard.tex; $(make_cs)
+sk-refcard.dvi: $(sk_refcard_deps)
+ $(ENVADD) csplain sk-refcard.tex
+sk-refcard.ps: sk-refcard.dvi
+ dvips -t a4 -o $@ sk-refcard.dvi
+
+sk_survival_deps = sk-survival.tex emacsver.tex pdflayout.sty
+sk-survival.pdf: $(sk_survival_deps)
+ input=sk-survival.tex; $(make_cs)
+sk-survival.dvi: $(sk_survival_deps)
+ $(ENVADD) csplain sk-survival.tex
+sk-survival.ps: sk-survival.dvi
+ dvips -t a4 -o $@ sk-survival.dvi
+
+survival_deps = survival.tex emacsver.tex pdflayout.sty
+survival.pdf: $(survival_deps)
+ $(ENVADD) pdftex survival.tex
+survival.dvi: $(survival_deps)
+ $(ENVADD) tex survival.tex
+
+vipcard_deps = vipcard.tex emacsver.tex pdflayout.sty
+vipcard.pdf: $(vipcard_deps)
+ $(ENVADD) pdftex vipcard.tex
+vipcard.dvi: $(vipcard_deps)
+ $(ENVADD) tex vipcard.tex
+
+vipercard_deps = viperCard.tex emacsver.tex pdflayout.sty
+viperCard.pdf: $(vipercard_deps)
+ $(ENVADD) pdftex viperCard.tex
+viperCard.dvi: $(vipercard_deps)
+ $(ENVADD) tex viperCard.tex
.PHONY: clean
clean:
-rm -f *.dvi *.log *.aux
+distclean: clean
+
+## This should really by maintainer-clean, but the handling of the
+## refcards is funny. So abuse extraclean for this.
+extraclean: clean
+ -rm -f $(PDF_TARGETS) $(PS_TARGETS)
+
+## For the Emacs website.
+dist:
+ rm -rf emacs-refcards
+ mkdir emacs-refcards
+ cp Makefile README *.tex gnus-logo.* pdflayout.sty emacs-refcards/
+ tar -cf emacs-refcards.tar emacs-refcards
+ rm -rf emacs-refcards
+
### Makefile ends here
+Copyright (C) 2013 Free Software Foundation, Inc.
+See the end of the file for license conditions.
+
+
+REFERENCE CARDS FOR GNU EMACS
+
To generate these refcards, you need to install the TeX document
-production system. For example, http://www.tug.org/texlive/ .
+production system. For example, <http://www.tug.org/texlive/>.
All modern GNU/Linux distributions provide TeX packages, so the
easiest way is just to install those. Your distribution may have
separate, optional packages such as: texlive-lang-cyrillic,
texlive-lang-czechslovak, texlive-lang-german, and texlive-lang-polish.
+Type `make all' (or `make pdf') to generate PDF versions of all the cards.
+For PostScript format, use `make ps'.
+To only generate the cards for a specific language, use e.g.
+`make french' or `make french-ps'. As mentioned above, you may need
+to install extra TeX packages for some languages.
+
+PDF and PS copies of these cards are also available at
+<http://www.gnu.org/software/emacs/refcards>. The FSF online
+store <http://shop.fsf.org/> sometimes has printed copies for sale.
+
+\f
COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
The file gnus-logo.eps contains copyright and license information, but
Author: Luis Fernandes <elf@ee.ryerson.ca>
Copyright (C) 2001-2013 Free Software Foundation, Inc.
License: GNU General Public License version 3 or later (see COPYING)
+
+
+\f
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+2013-08-17 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el:
+ * net/tramp-adb.el:
+ * net/tramp-cmds.el:
+ * net/tramp-ftp.el:
+ * net/tramp-gvfs.el:
+ * net/tramp-gw.el:
+ * net/tramp-sh.el: Don't wrap external variable declarations by
+ `eval-when-compile'.
+
+2013-08-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/shr.el (shr-rescale-image): Use ImageMagick even for GIFs
+ now that Emacs supports ImageMagick animations.
+
+2013-08-16 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cmds.el (top): Don't declare `buffer-name'.
+ (tramp-append-tramp-buffers): Rewrite buffer local variables part.
+
+2013-08-16 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (mouse-autoselect-window-select): Do autoselect when
+ mouse pointer is on margin.
+
+2013-08-16 William Parsons <wbparsons@alum.mit.edu> (tiny change)
+
+ * net/ange-ftp.el (ange-ftp-skip-msgs): Add 500 EPSV. (Bug#1972)
+
+2013-08-16 Glenn Morris <rgm@gnu.org>
+
+ * net/ange-ftp.el (ange-ftp-good-msgs, ange-ftp-get-pwd):
+ Handle "Remote Directory" response of some clients. (Bug#15058)
+
+ * emacs-lisp/bytecomp.el (byte-compile-make-variable-buffer-local):
+ Tweak warning. (Bug#14926)
+
+ * menu-bar.el (send-mail-item-name, read-mail-item-name): Remove.
+ (menu-bar-tools-menu): Simplify news and mail items. (Bug#15095)
+
+ * image-mode.el (image-mode-map): Add menu items to reverse,
+ increase, decrease, reset animation speed.
+ (image--set-speed, image-increase-speed, image-decrease-speed)
+ (image-reverse-speed, image-reset-speed): New functions.
+ (image-mode-map): Add bindings for speed commands.
+
+ * image.el (image-animate-get-speed, image-animate-set-speed):
+ New functions.
+ (image-animate-timeout): Respect image :speed property.
+
+2013-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/debug.el (debugger-setup-buffer): Put point on the
+ previous line (bug#15101).
+ (debugger-eval-expression, debugger-record-expression):
+ Use read--expression (bug#15102).
+
+2013-08-15 Michael Albinus <michael.albinus@gmx.de>
+
+ Remove byte compiler warnings, visible when compiling with
+ `byte-compile-force-lexical-warnings' set to t.
+
+ * net/tramp.el (tramp-debug-message, tramp-message, tramp-error)
+ (tramp-error-with-buffer): Rename ARGS to ARGUMENTS and BUFFER to BUF.
+ (tramp-handle-unhandled-file-name-directory)
+ (tramp-handle-file-notify-add-watch, tramp-action-login)
+ (tramp-action-succeed, tramp-action-permission-denied)
+ (tramp-action-terminal, tramp-action-process-alive): Prefix unused
+ arguments with "_".
+
+ * net/tramp-adb.el (tramp-adb-parse-device-names)
+ (tramp-adb-handle-insert-directory, tramp-adb-handle-delete-file)
+ (tramp-adb-handle-copy-file): Prefix unused arguments with "_".
+ (tramp-adb-handle-file-truename): Remove unused arguments.
+
+ * net/tramp-cache.el (tramp-flush-directory-property)
+ (tramp-flush-connection-property, tramp-list-connections)
+ (tramp-parse-connection-properties): Prefix unused arguments with "_".
+
+ * net/tramp-compat.el (tramp-compat-make-temp-file):
+ Rename FILENAME to F.
+
+ * net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch)
+ (tramp-gvfs-handle-write-region, tramp-bluez-parse-device-names)
+ (tramp-zeroconf-parse-workstation-device-names)
+ (tramp-zeroconf-parse-webdav-device-names)
+ (tramp-synce-parse-device-names): Prefix unused arguments with "_".
+
+ * net/tramp-gw.el (tramp-gw-gw-proc-sentinel)
+ (tramp-gw-aux-proc-sentinel): Prefix unused arguments with "_".
+
+ * net/tramp-sh.el (tramp-sh-handle-file-truename): Remove unused
+ arguments.
+ (tramp-sh-handle-copy-file, tramp-sh-handle-dired-compress-file)
+ (tramp-sh-handle-insert-file-contents-literally)
+ (tramp-sh-handle-file-notify-add-watch): Prefix unused arguments
+ with "_".
+ (tramp-do-copy-or-rename-file, tramp-barf-if-no-shell-prompt):
+ Remove unused variables.
+
+ * net/tramp-smb.el (tramp-smb-handle-copy-directory)
+ (tramp-smb-handle-copy-file, tramp-smb-handle-delete-file)
+ (tramp-smb-read-file-entry): Prefix unused arguments with "_".
+
+ * net/tramp-uu.el (tramp-uu-b64-alphabet, tramp-uu-b64-char-to-byte):
+ Make them a defconst.
+ (tramp-uuencode-region): Remove unused variable.
+
+2013-08-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * frameset.el (frameset--prop-setter): New function.
+ (frameset-prop): Add gv-setter declaration.
+ (frameset-filter-minibuffer): Deal with the case that the minibuffer
+ parameter was already set in FILTERED. Doc fix.
+ (frameset--record-minibuffer-relationships): Allow saving a
+ minibufferless frame without its corresponding minibuffer frame.
+ (frameset--reuse-frame): Accept a match from an orphaned minibufferless
+ frame, if the frame id matches.
+ (frameset--minibufferless-last-p): Sort non-orphaned minibufferless
+ frames before orphaned ones.
+ (frameset-restore): Warn about orphaned windows, instead of error out.
+
+2013-08-14 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (window-make-atom): Don't overwrite parameter
+ already present.
+ (display-buffer-in-atom-window): Handle special case where we
+ split an already atomic window.
+ (window--major-non-side-window, display-buffer-in-side-window)
+ (window--side-check): Ignore minibuffer window when walking
+ window tree.
+ (window-deletable-p): Return 'frame only if no other frame uses
+ our minibuffer window.
+ (record-window-buffer): Run buffer-list-update-hook.
+ (split-window): Make sure window--check-frame won't destroy an
+ existing atomic window in case the new window gets nested
+ inside.
+ (display-buffer-at-bottom): Ignore minibuffer window when
+ walking window tree. Don't split a side window.
+ (pop-to-buffer): Don't set-buffer here, the select-window call
+ should do that.
+ (mouse-autoselect-window-select): Autoselect only if we are in the
+ text portion of the window.
+
+2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/shr.el (shr-parse-image-data): New function to grab both the
+ data itself and the Content-Type.
+ (shr-put-image): Use it.
+
+ * net/eww.el (eww-display-image): Ditto.
+
+ * image.el (image-content-type-suffixes): New variable.
+
+2013-08-13 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * progmodes/python.el (python-imenu--build-tree)
+ (python-imenu--put-parent): Simplify and Fix (GH bug 146).
+
+2013-08-13 Xue Fuqiao <xfq.free@gmail.com>
+
+ * simple.el (backward-word): Mention the optional argument.
+
+2013-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * frameset.el (frameset--make): Rename constructor from make-frameset.
+ (frameset-p, frameset-valid-p): Don't autoload.
+ (frameset-valid-p): Use normal accessors.
+
+2013-08-13 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/compile.el (compile-command): Tweak example in doc.
+ * obsolete/scribe.el (scribe-mode):
+ * progmodes/mixal-mode.el (mixal-mode): Quote buffer name. (Bug#15053)
+
+ * mail/feedmail.el (feedmail-confirm-outgoing)
+ (feedmail-display-full-frame, feedmail-deduce-bcc-where): Fix types.
+
+ * cus-start.el (truncate-partial-width-windows): Fix type.
+
+ * emulation/viper-init.el (viper-search-scroll-threshold): Fix type.
+
+ * net/shr.el (shr-table-horizontal-line): Fix custom type.
+
+2013-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/timer.el (timer--time-setter): New function.
+ (timer--time): Use it as gv-setter.
+
+ * emacs-lisp/gv.el (gv-define-simple-setter): Output warning when
+ setter is not a symbol.
+
2013-08-12 Grégoire Jadi <daimrod@gmail.com>
* mail/sendmail.el (sendmail-send-it): Don't kill the error buffer
2013-08-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
- * net/eww.el (eww-display-html): Ignore coding system errors. One
- web site uses "utf-8lias" as the coding system.
+ * net/eww.el (eww-display-html): Ignore coding system errors.
+ One web site uses "utf-8lias" as the coding system.
2013-08-11 Juanma Barranquero <lekktu@gmail.com>
(allout-up-current-level, allout-end-of-level, allout-reindent-body)
(allout-yank-processing, allout-process-exposed)
(allout-latex-verb-quote, allout-latexify-one-item, outlineify-sticky)
- (allout-latex-verbatim-quote-curr-line): Removed unused variables.
+ (allout-latex-verbatim-quote-curr-line): Remove unused variables.
* emacs-lisp/lisp-mode.el (lisp-eval-defun, last-sexp-toggle-display)
(lisp-indent-defform): Mark ignored arguments.
(lisp-indent-line): Mark ignored arguments. Remove unused variables.
(scroll-margin windows integer)
(hscroll-margin windows integer "22.1")
(hscroll-step windows number "22.1")
- (truncate-partial-width-windows display boolean "23.1")
+ (truncate-partial-width-windows
+ display
+ (choice (integer :tag "Truncate if narrower than")
+ (const :tag "Respect `truncate-lines'" nil)
+ (other :tag "Truncate if not full-width" t))
+ "23.1")
(make-cursor-line-fully-visible windows boolean)
(mode-line-in-non-selected-windows mode-line boolean "22.1")
(line-number-display-limit display
(defcustom desktop-restore-forces-onscreen t
"If t, offscreen frames are restored onscreen instead.
-If `:all', frames that are partially offscreen are also forced onscren.
+If `:all', frames that are partially offscreen are also forced onscreen.
NOTE: Checking of frame boundaries is only approximate and can fail
to reliably detect frames whose onscreen/offscreen state depends on a
few pixels, especially near the right / bottom borders of the screen."
;; which already takes care of frame restoration and deletion.
(called-interactively-p 'any))
(let* ((this (selected-frame))
- (mini (window-frame (minibuffer-window this)))) ; in case they difer
+ (mini (window-frame (minibuffer-window this)))) ; in case they differ
(dolist (frame (sort (frame-list) #'frameset-minibufferless-first-p))
(condition-case err
(unless (or (eq frame this)
:force-onscreen desktop-restore-forces-onscreen)))
;; Just to silence the byte compiler.
-;; Dynamicaly bound in `desktop-read'.
+;; Dynamically bound in `desktop-read'.
(defvar desktop-first-buffer)
(defvar desktop-buffer-ok-count)
(defvar desktop-buffer-fail-count)
(if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote)
(byte-compile-warning-enabled-p 'make-local))
(byte-compile-warn
- "`make-variable-buffer-local' should be called at toplevel"))
+ "`make-variable-buffer-local' not called at toplevel"))
(byte-compile-normal-call form))
(put 'make-variable-buffer-local
'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local)
(declare (debug (form &optional sexp)))
(if (cl--compiling-file)
(let* ((temp (cl-gentemp "--cl-load-time--"))
- (set `(set ',temp ,form)))
+ (set `(setq ,temp ,form)))
(if (and (fboundp 'byte-compile-file-form-defmumble)
(boundp 'this-kind) (boundp 'that-one))
(fset 'byte-compile-file-form
(insert "Debugger entered")
;; lambda is for debug-on-call when a function call is next.
;; debug is for debug-on-entry function called.
- (pcase (car args)
- ((or `lambda `debug)
- (insert "--entering a function:\n"))
- ;; Exiting a function.
- (`exit
- (insert "--returning value: ")
- (setq debugger-value (nth 1 args))
- (prin1 debugger-value (current-buffer))
- (insert ?\n)
- (delete-char 1)
- (insert ? )
- (beginning-of-line))
- ;; Debugger entered for an error.
- (`error
- (insert "--Lisp error: ")
- (prin1 (nth 1 args) (current-buffer))
- (insert ?\n))
- ;; debug-on-call, when the next thing is an eval.
- (`t
- (insert "--beginning evaluation of function call form:\n"))
- ;; User calls debug directly.
- (_
- (insert ": ")
- (prin1 (if (eq (car args) 'nil)
- (cdr args) args)
- (current-buffer))
- (insert ?\n)))
+ (let ((pos (point)))
+ (pcase (car args)
+ ((or `lambda `debug)
+ (insert "--entering a function:\n")
+ (setq pos (1- (point))))
+ ;; Exiting a function.
+ (`exit
+ (insert "--returning value: ")
+ (setq pos (point))
+ (setq debugger-value (nth 1 args))
+ (prin1 debugger-value (current-buffer))
+ (insert ?\n)
+ (delete-char 1)
+ (insert ? )
+ (beginning-of-line))
+ ;; Debugger entered for an error.
+ (`error
+ (insert "--Lisp error: ")
+ (setq pos (point))
+ (prin1 (nth 1 args) (current-buffer))
+ (insert ?\n))
+ ;; debug-on-call, when the next thing is an eval.
+ (`t
+ (insert "--beginning evaluation of function call form:\n")
+ (setq pos (1- (point))))
+ ;; User calls debug directly.
+ (_
+ (insert ": ")
+ (setq pos (point))
+ (prin1 (if (eq (car args) 'nil)
+ (cdr args) args)
+ (current-buffer))
+ (insert ?\n)))
+ ;; Place point on "stack frame 0" (bug#15101).
+ (goto-char pos))
;; After any frame that uses eval-buffer,
;; insert a line that states the buffer position it's reading at.
(save-excursion
(progn ,@body)
(setq debugger-outer-match-data (match-data)))))
-(defun debugger-eval-expression (exp)
+(defun debugger-eval-expression (exp &optional nframe)
"Eval an expression, in an environment like that outside the debugger.
The environment used is the one when entering the activation frame at point."
(interactive
- (list (read-from-minibuffer "Eval: "
- nil read-expression-map t
- 'read-expression-history)))
- (let ((nframe (condition-case nil (1+ (debugger-frame-number 'skip-base))
- (error 0))) ;; If on first line.
- (base (if (eq 'debug--implement-debug-on-entry
+ (list (read--expression "Eval in stack frame: ")))
+ (let ((nframe (or nframe
+ (condition-case nil (1+ (debugger-frame-number 'skip-base))
+ (error 0)))) ;; If on first line.
+ (base (if (eq 'debug--implement-debug-on-entry
(cadr (backtrace-frame 1 'debug)))
'debug--implement-debug-on-entry 'debug)))
(debugger-env-macro
(defun debugger-record-expression (exp)
"Display a variable's value and record it in `*Backtrace-record*' buffer."
(interactive
- (list (read-from-minibuffer
- "Record Eval: "
- nil
- read-expression-map t
- 'read-expression-history)))
+ (list (read--expression "Record Eval: ")))
(let* ((buffer (get-buffer-create debugger-record-buffer))
(standard-output buffer))
(princ (format "Debugger Eval (%s): " exp))
temp)
so as to preserve the semantics of `setf'."
(declare (debug (sexp (&or symbolp lambda-expr) &optional sexp)))
+ (when (eq 'lambda (car-safe setter))
+ (message "Use `gv-define-setter' or name %s's setter function" name))
`(gv-define-setter ,name (val &rest args)
,(if fix-return
`(macroexp-let2 nil v val
`(progn
- (,',setter ,@(append args (list v)))
+ (,',setter ,@args ,v)
,v))
- `(cons ',setter (append args (list val))))))
+ ``(,',setter ,@args ,val))))
;;; Typical operations on generalized variables.
(defsubst timer--check (timer)
(or (timerp timer) (signal 'wrong-type-argument (list #'timerp timer))))
+(defun timer--time-setter (timer time)
+ (timer--check timer)
+ (setf (timer--high-seconds timer) (pop time))
+ (let ((low time) (usecs 0) (psecs 0))
+ (when (consp time)
+ (setq low (pop time))
+ (when time
+ (setq usecs (pop time))
+ (when time
+ (setq psecs (car time)))))
+ (setf (timer--low-seconds timer) low)
+ (setf (timer--usecs timer) usecs)
+ (setf (timer--psecs timer) psecs)
+ time))
+
;; Pseudo field `time'.
(defun timer--time (timer)
+ (declare (gv-setter timer--time-setter))
(list (timer--high-seconds timer)
(timer--low-seconds timer)
(timer--usecs timer)
(timer--psecs timer)))
-(gv-define-setter timer--time (time timer)
- (macroexp-let2 nil val time
- `(progn
- (timer--check ,timer)
- (setf (timer--high-seconds ,timer) (pop ,val))
- (let ((low ,val) (usecs 0) (psecs 0))
- (when (consp ,val)
- (setq low (pop ,val))
- (when ,val
- (setq usecs (pop ,val))
- (when ,val
- (setq psecs (car ,val)))))
- (setf (timer--low-seconds ,timer) low)
- (setf (timer--usecs ,timer) usecs)
- (setf (timer--psecs ,timer) psecs))
- ,val)))
-
(defun timer-set-time (timer time &optional delta)
"Set the trigger time of TIMER to TIME.
TIME must be in the internal format returned by, e.g., `current-time'.
the window will be scrolled up or down appropriately, to reveal context.
If you want Viper search to behave as usual in Vi, set this variable to a
negative number."
- :type 'boolean
+ :type 'integer
:group 'viper-search)
(defcustom viper-re-query-replace t
;; If the region is visible, make it look good when spanning
;; multiple windows.
+
+ ;; FIXME: Why not use `use-region-p' here?
(when (region-active-p)
(follow-maximize-region
(selected-window) windows win-start-end)))
(declare-function x-display-backing-store "xfns.c" (&optional terminal))
+;; In NS port, the return value may be `buffered', `retained', or
+;; `non-retained'. See src/nsfns.m.
(defun display-backing-store (&optional display)
"Return the backing store capability of DISPLAY's screen.
The value may be `always', `when-mapped', `not-useful', or nil if
\f
(cl-defstruct (frameset (:type vector) :named
+ (:constructor frameset--make)
;; Copier is defined below.
(:copier nil))
IMPORTANT: Modifying this slot may cause frameset functions to fail,
unless the type constraints defined above are respected.\n\n(fn FRAMESET)")
-;;;###autoload (autoload 'frameset-p "frameset"
-;;;###autoload "Return non-nil if OBJECT is a frameset, nil otherwise." nil)
+;; We autoloaded this for use in register.el, but now that we use registerv
+;; objects, this autoload is not useful any more.
+;; ;;;###autoload (autoload 'frameset-p "frameset"
+;; ;;;###autoload "Return non-nil if OBJECT is a frameset, nil otherwise." nil)
(defun frameset-copy (frameset)
"Return a deep copy of FRAMESET.
FRAMESET is copied with `copy-tree'."
(copy-tree frameset t))
-;;;###autoload
(defun frameset-valid-p (object)
- "Return non-nil if OBJECT is a valid frameset, nil otherwise.
-
-The return value is nil if OBJECT is not a frameset, or not
-a valid one, and the frameset version if it is valid."
- (and (vectorp object) ; a vector
- (>= (length object) 8) ; of the right length (future-proof)
- (eq (aref object 0) 'frameset) ; tagged as `frameset'
- (integerp (aref object 1)) ; VERSION is an int
- (consp (aref object 2)) ; TIMESTAMP is a non-null list
- (let ((app (aref object 3)))
+ "Return non-nil if OBJECT is a valid frameset, nil otherwise."
+ (and (frameset-p object)
+ (integerp (frameset-version object))
+ (consp (frameset-timestamp object))
+ (let ((app (frameset-app object)))
(or (null app) ; APP is nil
(symbolp app) ; or a symbol
(and (consp app) ; or a list
(symbolp (car app))))) ; starting with a symbol
- (stringp (or (aref object 4) "")) ; NAME is a string or nil
- (stringp (or (aref object 5) "")) ; DESCRIPTION is a string or nil
- (listp (aref object 6)) ; PROPERTIES is a list
- (listp (aref object 7)) ; and STATES is, too
- (cl-every #'consp (aref object 7)) ; and an alist
- (aref object 1))) ; return VERSION
+ (stringp (or (frameset-name object) ""))
+ (stringp (or (frameset-description object) ""))
+ (listp (frameset-properties object))
+ (let ((states (frameset-states object)))
+ (and (listp states)
+ (cl-every #'consp (frameset-states object))))
+ (frameset-version object))) ; And VERSION is non-nil.
+
+(defun frameset--prop-setter (frameset property value)
+ "Setter function for `frameset-prop'. Internal use only."
+ (setf (frameset-properties frameset)
+ (plist-put (frameset-properties frameset) property value))
+ value)
;; A setf'able accessor to the frameset's properties
(defun frameset-prop (frameset property)
Properties can be set with
(setf (frameset-prop FRAMESET PROPERTY) NEW-VALUE)"
+ (declare (gv-setter frameset--prop-setter))
(plist-get (frameset-properties frameset) property))
-(gv-define-setter frameset-prop (val fs prop)
- (macroexp-let2 nil v val
- `(progn
- (setf (frameset-properties ,fs)
- (plist-put (frameset-properties ,fs) ,prop ,v))
- ,v)))
-
\f
;; Filtering
;; Let's say that Emacs' frame parameters were never designed as a tool to
;; precisely record (or restore) a frame's state. They grew organically,
;; and their uses and behaviors reflect their history. In using them to
-;; implement framesets, the unwary implementor, or the prospective package
+;; implement framesets, the unwary implementer, or the prospective package
;; writer willing to use framesets in their code, might fall victim of some
;; unexpected... oddities.
;;
(not (stringp (cdr current)))
(not (string-match-p "^unspecified-[fb]g$" (cdr current)))))
-(defun frameset-filter-minibuffer (current _filtered _parameters saving)
- "When saving, convert (minibuffer . #<window>) to (minibuffer . t).
+(defun frameset-filter-minibuffer (current filtered _parameters saving)
+ "Force the minibuffer parameter to have a sensible value.
+
+When saving, convert (minibuffer . #<window>) to (minibuffer . t).
+When restoring, if there are two copies, keep the one pointing to
+a live window.
For the meaning of CURRENT, FILTERED, PARAMETERS and SAVING,
see `frameset-filter-alist'."
- (or (not saving)
- (if (windowp (cdr current))
- '(minibuffer . t)
- t)))
+ (let ((value (cdr current)) mini)
+ (cond (saving
+ (if (windowp value) '(minibuffer . t) t))
+ ((setq mini (assq 'minibuffer filtered))
+ (when (windowp value) (setcdr mini value))
+ nil)
+ (t t))))
(defun frameset-filter-shelve-param (current _filtered parameters saving
&optional prefix)
(dolist (frame frame-list)
(unless (frame-parameter frame 'frameset--mini)
(frameset--set-id frame)
- (let* ((mb-frame (window-frame (minibuffer-window frame)))
- (id (and mb-frame (frameset-frame-id mb-frame))))
- (if (null id)
- (error "Minibuffer frame %S for %S is not being saved" mb-frame frame)
- ;; For minibufferless frames, frameset--mini is a cons
- ;; (nil . FRAME-ID), where FRAME-ID is the frameset--id
- ;; of the frame containing its minibuffer window.
- (set-frame-parameter frame
- 'frameset--mini
- (cons nil id)))))))
+ (let ((mb-frame (window-frame (minibuffer-window frame))))
+ ;; For minibufferless frames, frameset--mini is a cons
+ ;; (nil . FRAME-ID), where FRAME-ID is the frameset--id of
+ ;; the frame containing its minibuffer window.
+ ;; FRAME-ID can be set to nil, if FRAME-LIST doesn't contain
+ ;; the minibuffer frame of a minibufferless frame; we allow
+ ;; it without trying to second-guess the user.
+ (set-frame-parameter frame
+ 'frameset--mini
+ (cons nil
+ (and mb-frame
+ (frameset-frame-id mb-frame))))))))
;;;###autoload
(cl-defun frameset-save (frame-list
list)))
fs)
(frameset--record-minibuffer-relationships frames)
- (setq fs (make-frameset
+ (setq fs (frameset--make
:app app
:name name
:description description
(setq frame (frameset--find-frame-if
(lambda (f id mini-id)
(and (frameset-frame-id-equal-p f id)
- (frameset-frame-id-equal-p (window-frame
- (minibuffer-window f))
- mini-id)))
- display (cdr (assq 'frameset--id parameters)) (cdr mini))))
+ (or (null mini-id) ; minibuffer frame not saved
+ (frameset-frame-id-equal-p
+ (window-frame (minibuffer-window f))
+ mini-id))))
+ display
+ (cdr (assq 'frameset--id parameters)) (cdr mini))))
(t
;; Default to just finding a frame in the same display.
(setq frame (frameset--find-frame-if nil display))))
(cond ((eq id-def1 t) t)
((eq id-def2 t) nil)
((not (eq hasmini1 hasmini2)) (eq hasmini1 t))
- ((eq hasmini1 nil) (string< id-def1 id-def2))
+ ((eq hasmini1 nil) (or id-def1 id-def2))
(t t))))
(defun frameset-keep-original-display-p (force-display)
(condition-case-unless-debug err
(let* ((d-mini (cdr (assq 'frameset--mini frame-cfg)))
(mb-id (cdr d-mini))
- (default (and (booleanp mb-id) mb-id))
+ (default (and (car d-mini) mb-id))
(force-display (if (functionp force-display)
(funcall force-display frame-cfg window-cfg)
force-display))
(setq frame-cfg (append '((tool-bar-lines . 0) (menu-bar-lines . 0))
frame-cfg))))
(t ;; Frame depends on other frame's minibuffer window.
- (let* ((mb-frame (or (frameset-frame-with-id mb-id)
- (error "Minibuffer frame %S not found" mb-id)))
- (mb-param (assq 'minibuffer frame-cfg))
- (mb-window (minibuffer-window mb-frame)))
- (unless (and (window-live-p mb-window)
- (window-minibuffer-p mb-window))
- (error "Not a minibuffer window %s" mb-window))
- (if mb-param
- (setcdr mb-param mb-window)
- (push (cons 'minibuffer mb-window) frame-cfg)))))
+ (when mb-id
+ (let ((mb-frame (frameset-frame-with-id mb-id))
+ (mb-window nil))
+ (if (not mb-frame)
+ (delay-warning 'frameset
+ (format "Minibuffer frame %S not found" mb-id)
+ :warning)
+ (setq mb-window (minibuffer-window mb-frame))
+ (unless (and (window-live-p mb-window)
+ (window-minibuffer-p mb-window))
+ (delay-warning 'frameset
+ (format "Not a minibuffer window %s" mb-window)
+ :warning)
+ (setq mb-window nil)))
+ (when mb-window
+ (push (cons 'minibuffer mb-window) frame-cfg))))))
;; OK, we're ready at last to create (or reuse) a frame and
;; restore the window config.
(setq frame (frameset--restore-frame frame-cfg window-cfg
+2013-08-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-util.el (mm-coding-system-priorities): Exclude iso-2022-jp-2 and
+ shift_jis from the default value set for Japanese users.
+
+2013-08-13 Glenn Morris <rgm@gnu.org>
+
+ * gnus-icalendar.el (gnus-icalendar-org-capture-file): Fix type.
+
+ * gnus.el (gnus-valid-select-methods): Fix type.
+
+ * nnimap.el (nnimap-request-articles-find-limit): Fix type, version.
+
2013-08-12 Katsumi Yamaoka <yamaoka@jpl.org>
* mm-decode.el (mm-display-external): Run a timer for the temp files
(defcustom gnus-icalendar-org-capture-file nil
"Target Org file for storing captured calendar events."
- :type 'file
+ :type '(choice (const nil) file)
:group 'gnus-icalendar-org)
(defcustom gnus-icalendar-org-capture-headline nil
(const post-mail))
(checklist :inline t :greedy t
(const :format "%v " address)
+ (const global)
(const :format "%v " prompt-address)
(const :format "%v " physical-address)
(const virtual)
(not lang) nil)
;; In XEmacs 21.5 it may be the one like "Japanese (UTF-8)".
((string-match "\\`Japanese" lang)
- ;; Japanese users prefer iso-2022-jp to euc-japan or
- ;; shift_jis, however iso-8859-1 should be used when
- ;; there are only ASCII text and Latin-1 characters.
- '(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8))))
+ ;; Japanese users prefer iso-2022-jp to others usually used
+ ;; for `buffer-file-coding-system', however iso-8859-1 should
+ ;; be used when there are only ASCII and Latin-1 characters.
+ '(iso-8859-1 iso-2022-jp utf-8))))
"Preferred coding systems for encoding outgoing messages.
More than one suitable coding system may be found for some text.
By default, the coding system with the highest priority is used
to encode outgoing messages (see `sort-coding-systems'). If this
variable is set, it overrides the default priority."
- :version "21.2"
+ :version "24.4"
:type '(repeat (symbol :tag "Coding system"))
:group 'mime)
(defcustom nnimap-request-articles-find-limit nil
"Limit the number of articles to look for after moving an article."
- :type 'integer
- :version "24.3"
+ :type '(choice (const nil) integer)
+ :version "24.4"
:group 'nnimap)
(defvar nnimap-process nil)
(define-key map "b" 'image-previous-frame)
(define-key map "n" 'image-next-file)
(define-key map "p" 'image-previous-file)
+ (define-key map "a+" 'image-increase-speed)
+ (define-key map "a-" 'image-decrease-speed)
+ (define-key map "a0" 'image-reset-speed)
+ (define-key map "ar" 'image-reverse-speed)
(define-key map [remap forward-char] 'image-forward-hscroll)
(define-key map [remap backward-char] 'image-backward-hscroll)
(define-key map [remap right-char] 'image-forward-hscroll)
(image-toggle-animation)))
:style toggle :selected image-animate-loop
:active image-multi-frame
- :help "Animate images once, or forever?"]
+ :help "Animate images once, or forever?"]
+ ["Reverse Animation" image-reverse-speed
+ :style toggle :selected (let ((image (image-get-display-property)))
+ (and image (<
+ (image-animate-get-speed image)
+ 0)))
+ :active image-multi-frame
+ :help "Reverse direction of this image's animation?"]
+ ["Speed Up Animation" image-increase-speed
+ :active image-multi-frame
+ :help "Speed up this image's animation"]
+ ["Slow Down Animation" image-decrease-speed
+ :active image-multi-frame
+ :help "Slow down this image's animation"]
+ ["Reset Animation Speed" image-reset-speed
+ :active image-multi-frame
+ :help "Reset the speed of this image's animation"]
["Next Frame" image-next-frame :active image-multi-frame
:help "Show the next frame of this image"]
["Previous Frame" image-previous-frame :active image-multi-frame
(defun image-mode ()
"Major mode for image files.
You can use \\<image-mode-map>\\[image-toggle-display]
-to toggle between display as an image and display as text."
+to toggle between display as an image and display as text.
+
+Key bindings:
+\\{image-mode-map}"
(interactive)
(condition-case err
(progn
(image-animate image index
(if image-animate-loop t)))))))))
+(defun image--set-speed (speed &optional multiply)
+ "Set speed of an animated image to SPEED.
+If MULTIPLY is non-nil, treat SPEED as a multiplication factor.
+If SPEED is `reset', reset the magnitude of the speed to 1."
+ (let ((image (image-get-display-property)))
+ (cond
+ ((null image)
+ (error "No image is present"))
+ ((null image-multi-frame)
+ (message "No image animation."))
+ (t
+ (if (eq speed 'reset)
+ (setq speed (if (< (image-animate-get-speed image) 0)
+ -1 1)
+ multiply nil))
+ (image-animate-set-speed image speed multiply)
+ ;; FIXME Hack to refresh an active image.
+ (when (image-animate-timer image)
+ (image-toggle-animation)
+ (image-toggle-animation))
+ (message "Image speed is now %s" (image-animate-get-speed image))))))
+
+(defun image-increase-speed ()
+ "Increase the speed of current animated image by a factor of 2."
+ (interactive)
+ (image--set-speed 2 t))
+
+(defun image-decrease-speed ()
+ "Decrease the speed of current animated image by a factor of 2."
+ (interactive)
+ (image--set-speed 0.5 t))
+
+(defun image-reverse-speed ()
+ "Reverse the animation of the current image."
+ (interactive)
+ (image--set-speed -1 t))
+
+(defun image-reset-speed ()
+ "Reset the animation speed of the current image."
+ (interactive)
+ (image--set-speed 'reset))
+
(defun image-goto-frame (n &optional relative)
"Show frame N of a multi-frame image.
Optional argument OFFSET non-nil means interpret N as relative to the
- maybe auto-detect only if the image type is available
(see `image-type-available-p').")
+(defvar image-format-suffixes
+ '((image/x-icon "ico"))
+ "Alist of MIME Content-Type headers to file name suffixes.
+This is used as a hint by the ImageMagick library when detecting
+image types. If `create-image' is called with a :format
+matching found in this alist, the ImageMagick library will be
+told that the data would have this suffix if saved to a file.")
+
(defcustom image-load-path
(list (file-name-as-directory (expand-file-name "images" data-directory))
'data-directory 'load-path)
(plist-put (cdr image) :index n)
(force-window-update))
+(defun image-animate-get-speed (image)
+ "Return the speed factor for animating IMAGE."
+ (or (plist-get (cdr image) :speed) 1))
+
+(defun image-animate-set-speed (image value &optional multiply)
+ "Set the speed factor for animating IMAGE to VALUE.
+With optional argument MULTIPLY non-nil, treat VALUE as a
+multiplication factor for the current value."
+ (plist-put (cdr image) :speed
+ (if multiply
+ (* value (image-animate-get-speed image))
+ value)))
+
;; FIXME? The delay may not be the same for different sub-images,
;; hence we need to call image-multi-frame-p to return it.
;; But it also returns count, so why do we bother passing that as an
LIMIT determines when to stop. If t, loop forever. If nil, stop
after displaying the last animation frame. Otherwise, stop
after LIMIT seconds have elapsed.
-The minimum delay between successive frames is `image-minimum-frame-delay'."
+The minimum delay between successive frames is `image-minimum-frame-delay'.
+
+If the image has a non-nil :speed property, it acts as a multiplier
+for the animation speed. A negative value means to animate in reverse."
(image-show-frame image n t)
- (setq n (1+ n))
- (let* ((time (float-time))
+ (let* ((speed (image-animate-get-speed image))
+ (time (float-time))
(animation (image-multi-frame-p image))
;; Subtract off the time we took to load the image from the
;; stated delay time.
- (delay (max (+ (or (cdr animation) image-default-frame-delay)
+ (delay (max (+ (* (or (cdr animation) image-default-frame-delay)
+ (/ 1 (abs speed)))
time (- (float-time)))
image-minimum-frame-delay))
done)
- (if (>= n count)
- (if limit
- (setq n 0)
- (setq done t)))
+ (setq n (if (< speed 0)
+ (1- n)
+ (1+ n)))
+ (if limit
+ (cond ((>= n count) (setq n 0))
+ ((< n 0) (setq n (1- count))))
+ (and (or (>= n count) (< n 0)) (setq done t)))
(setq time-elapsed (+ delay time-elapsed))
(if (numberp limit)
(setq done (>= time-elapsed limit)))
cases. You can give a timeout for the prompt; see variable
`feedmail-confirm-outgoing-timeout'."
:group 'feedmail-misc
- :type 'boolean
- )
+ :type '(choice (const nil)
+ (const queued)
+ (const immediate)
+ (other t)))
(defcustom feedmail-display-full-frame 'queued
shuttled robotically onward."
:version "24.1"
:group 'feedmail-misc
- :type 'boolean
- )
+ :type '(choice (const nil)
+ (const queued)
+ (const immediate)
+ (other t)))
(defcustom feedmail-confirm-outgoing-timeout nil
is an option for either 'first or 'last because you might have a
delivery agent that processes the addresses backwards."
:group 'feedmail-headers
- :type 'boolean
- )
+ :type '(choice (const nil)
+ (const first)
+ (const last)))
(defcustom feedmail-fill-to-cc t
\f
;; The "Tools" menu items
-(defun send-mail-item-name ()
- (let* ((known-send-mail-commands '((sendmail-user-agent . "sendmail")
- (mh-e-user-agent . "MH")
- (message-user-agent . "Gnus Message")
- (gnus-user-agent . "Gnus")))
- (name (assq mail-user-agent known-send-mail-commands)))
- (if name
- (setq name (cdr name))
- (setq name (symbol-name mail-user-agent))
- (if (string-match "\\(.+\\)-user-agent" name)
- (setq name (match-string 1 name))))
- name))
-
-(defun read-mail-item-name ()
- (let* ((known-rmail-commands '((rmail . "RMAIL")
- (mh-rmail . "MH")
- (gnus . "Gnus")))
- (known (assq read-mail-command known-rmail-commands)))
- (if known (cdr known) (symbol-name read-mail-command))))
-
(defvar menu-bar-games-menu
(let ((menu (make-sparse-keymap "Games")))
(bindings--define-key menu [directory-search]
'(menu-item "Directory Search" eudc-tools-menu))
(bindings--define-key menu [compose-mail]
- '(menu-item (format "Send Mail (with %s)" (send-mail-item-name)) compose-mail
+ '(menu-item "Compose New Mail" compose-mail
:visible (and mail-user-agent (not (eq mail-user-agent 'ignore)))
- :help "Send a mail message"))
+ :help "Start writing a new mail message"))
(bindings--define-key menu [rmail]
- '(menu-item (format "Read Mail (with %s)" (read-mail-item-name))
- menu-bar-read-mail
+ '(menu-item "Read Mail" menu-bar-read-mail
:visible (and read-mail-command
(not (eq read-mail-command 'ignore)))
- :help "Read your mail and reply to it"))
+ :help "Read your mail"))
(bindings--define-key menu [gnus]
- '(menu-item "Read Net News (Gnus)" gnus
+ '(menu-item "Read Net News" gnus
:help "Read network news groups"))
(bindings--define-key menu [separator-vc]
;;; ange-ftp.el --- transparent FTP support for GNU Emacs
-;; Copyright (C) 1989-1996, 1998, 2000-2013 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1989-1996, 1998, 2000-2013 Free Software Foundation, Inc.
;; Author: Andy Norman (ange@hplb.hpl.hp.com)
;; Maintainer: FSF
"Regular expression matching the start of a multiline FTP reply.")
(defvar ange-ftp-good-msgs
- "^220 \\|^230 \\|^226 \\|^25. \\|^221 \\|^200 \\|^[Hh]ash mark"
+ "^220 \\|^230 \\|^226 \\|^25. \\|^221 \\|^200 \\|^[Hh]ash mark\\|^Remote directory:"
"Regular expression matching FTP \"success\" messages.")
;; CMS and the odd VMS machine say 200 Port rather than 200 PORT.
"^504 Unknown security mechanism\\|"
"^530 Please login with USER and PASS\\|" ; non kerberized vsFTPd
"^534 Kerberos Authentication not enabled\\|"
- "^22[789] .*[Pp]assive\\|^200 EPRT\\|^500 .*EPRT")
+ "^22[789] .*[Pp]assive\\|^200 EPRT\\|^500 .*EPRT\\|^500 .*EPSV")
"Regular expression matching FTP messages that can be ignored."
:group 'ange-ftp
+ :version "24.4" ; add EPSV
:type 'regexp)
(defcustom ange-ftp-fatal-msgs
(if (car result)
(save-match-data
(and (or (string-match "\"\\([^\"]*\\)\"" line)
+ ;; Some clients cache the value and return it in
+ ;; this way without asking the server. (Bug#15058)
+ (string-match "^Remote directory: \\(.*\\)" line)
(string-match " \\([^ ]+\\) " line)) ; stone-age VMS servers!
(setq dir (match-string 1 line)))))
(cons dir line)))
(goto-char (point-min))))
(defun eww-display-image ()
- (let ((data (buffer-substring (point) (point-max))))
+ (let ((data (shr-parse-image-data)))
(eww-setup-buffer)
(let ((inhibit-read-only t))
(shr-put-image data nil))
"Character used to draw horizontal table lines.
If nil, don't draw horizontal table lines."
:group 'shr
- :type 'character)
+ :type '(choice (const nil) character))
(defcustom shr-table-vertical-line ?\s
"Character used to draw vertical table lines."
(url-store-in-cache image-buffer)
(when (or (search-forward "\n\n" nil t)
(search-forward "\r\n\r\n" nil t))
- (let ((data (buffer-substring (point) (point-max))))
+ (let ((data (shr-parse-image-data)))
(with-current-buffer buffer
(save-excursion
(let ((alt (buffer-substring start end))
(setq payload (base64-decode-string payload)))
payload)))
-(defun shr-put-image (data alt &optional flags)
- "Put image DATA with a string ALT. Return image."
+(defun shr-put-image (spec alt &optional flags)
+ "Insert image SPEC with a string ALT. Return image.
+SPEC is either an image data blob, or a list where the first
+element is the data blob and the second element is the content-type."
(if (display-graphic-p)
(let* ((size (cdr (assq 'size flags)))
+ (data (if (consp spec)
+ (car spec)
+ spec))
+ (content-type (and (consp spec)
+ (cadr spec)))
(start (point))
(image (cond
((eq size 'original)
- (create-image data nil t :ascent 100))
+ (create-image data nil t :ascent 100
+ :format content-type))
((eq size 'full)
(ignore-errors
- (shr-rescale-image data t)))
+ (shr-rescale-image data t content-type)))
(t
(ignore-errors
- (shr-rescale-image data))))))
+ (shr-rescale-image data nil content-type))))))
(when image
;; When inserting big-ish pictures, put them at the
;; beginning of the line.
image)
(insert alt)))
-(defun shr-rescale-image (data &optional force)
+(defun shr-rescale-image (data &optional force content-type)
"Rescale DATA, if too big, to fit the current buffer.
If FORCE, rescale the image anyway."
(if (or (not (fboundp 'imagemagick-types))
- (eq (image-type-from-data data) 'gif)
(not (get-buffer-window (current-buffer))))
(create-image data nil t :ascent 100)
(let ((edges (window-inside-pixel-edges
:max-width (truncate (* shr-max-image-proportion
(- (nth 2 edges) (nth 0 edges))))
:max-height (truncate (* shr-max-image-proportion
- (- (nth 3 edges) (nth 1 edges))))))))
+ (- (nth 3 edges) (nth 1 edges))))
+ :format content-type))))
;; url-cache-extract autoloads url-cache.
(declare-function url-cache-create-filename "url-cache" (url))
t)
(when (or (search-forward "\n\n" nil t)
(search-forward "\r\n\r\n" nil t))
- (buffer-substring (point) (point-max))))))
+ (shr-parse-image-data)))))
+
+(defun shr-parse-image-data ()
+ (list
+ (buffer-substring (point) (point-max))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (point-min) (point))
+ (let ((content-type (mail-fetch-field "content-type")))
+ (and content-type
+ (intern content-type obarray)))))))
(defun shr-image-displayer (content-function)
"Return a function to display an image.
(require 'tramp)
(require 'time-date)
+;; Pacify byte-compiler.
+(defvar directory-sep-char)
(defvar dired-move-to-filename-regexp)
(defcustom tramp-adb-program "adb"
(tramp-run-real-handler operation args))))
;;;###tramp-autoload
-(defun tramp-adb-parse-device-names (ignore)
+(defun tramp-adb-parse-device-names (_ignore)
"Return a list of (nil host) tuples allowed to access."
(with-timeout (10)
(with-temp-buffer
;; This is derived from `tramp-sh-handle-file-truename'. Maybe the
;; code could be shared?
-(defun tramp-adb-handle-file-truename (filename &optional counter prev-dirs)
+(defun tramp-adb-handle-file-truename (filename)
"Like `file-truename' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-truename"
switches))))))
(defun tramp-adb-handle-insert-directory
- (filename switches &optional wildcard full-directory-p)
+ (filename switches &optional _wildcard _full-directory-p)
"Like `insert-directory' for Tramp files."
(when (stringp switches)
(setq switches (tramp-adb--gnu-switches-to-ash (split-string switches))))
(tramp-shell-quote-argument localname))
"Couldn't delete %s" directory)))
-(defun tramp-adb-handle-delete-file (filename &optional trash)
+(defun tramp-adb-handle-delete-file (filename &optional _trash)
"Like `delete-file' for Tramp files."
(setq filename (expand-file-name filename))
(with-parsed-tramp-file-name filename nil
(defun tramp-adb-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-extended-attributes)
+ _preserve-uid-gid _preserve-extended-attributes)
"Like `copy-file' for Tramp files.
PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq filename (expand-file-name filename)
'directory-file-name (list directory))))
(tramp-message key 8 "%s" directory)
(maphash
- (lambda (key value)
+ (lambda (key _value)
(when (and (stringp (tramp-file-name-localname key))
(string-match directory (tramp-file-name-localname key)))
(remhash key tramp-cache-data)))
(let ((hash (gethash key tramp-cache-data))
properties)
(when (hash-table-p hash)
- (maphash (lambda (x y) (add-to-list 'properties x 'append)) hash))
+ (maphash (lambda (x _y) (add-to-list 'properties x 'append)) hash))
properties))
(setq tramp-cache-data-changed t)
(remhash key tramp-cache-data))
"Return a list of all known connection vectors according to `tramp-cache'."
(let (result)
(maphash
- (lambda (key value)
+ (lambda (key _value)
(when (and (vectorp key) (null (aref key 3)))
(add-to-list 'result key)))
tramp-cache-data)
for all methods. Resulting data are derived from connection history."
(let (res)
(maphash
- (lambda (key value)
+ (lambda (key _value)
(if (and (vectorp key)
(string-equal method (tramp-file-name-method key))
(not (tramp-file-name-localname key)))
(require 'tramp)
+;; Pacify byte-compiler.
+(defvar reporter-eval-buffer)
+(defvar reporter-prompt-for-summary-p)
+
(defun tramp-list-tramp-buffers ()
"Return a list of all Tramp connection buffers."
(append
(goto-char (point-max))
;; Dump buffer local variables.
+ (insert "\nlocal variables:\n================")
(dolist (buffer
(delq nil
(mapcar
(when (string-match "\\*tramp/" (buffer-name b)) b))
(buffer-list))))
(let ((reporter-eval-buffer buffer)
- (buffer-name (buffer-name buffer))
(elbuf (get-buffer-create " *tmp-reporter-buffer*")))
(with-current-buffer elbuf
(emacs-lisp-mode)
(erase-buffer)
- (insert "\n(setq\n")
+ (insert (format "\n;; %s\n(setq-local\n" (buffer-name buffer)))
(lisp-indent-line)
- (tramp-compat-funcall
- 'reporter-dump-variable 'buffer-name (current-buffer))
- (dolist (varsym-or-cons-cell (buffer-local-variables buffer))
- (let ((varsym (or (car-safe varsym-or-cons-cell)
- varsym-or-cons-cell)))
- (when (string-match "tramp" (symbol-name varsym))
- (tramp-compat-funcall
- 'reporter-dump-variable varsym (current-buffer)))))
+ (dolist
+ (varsym
+ (sort
+ (append
+ (mapcar
+ 'intern
+ (all-completions "tramp-" (buffer-local-variables buffer)))
+ ;; Non-tramp variables of interest.
+ '(default-directory))
+ 'string<))
+ (tramp-compat-funcall 'reporter-dump-variable varsym elbuf))
(lisp-indent-line)
(insert ")\n"))
(insert-buffer-substring elbuf)))
;;; Code:
+;; Pacify byte-compiler.
(eval-when-compile
-
- ;; Pacify byte-compiler.
(require 'cl))
(eval-and-compile
;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own
;; implementation with `make-temp-name', creating the temporary file
;; immediately in order to avoid a security hole.
-(defsubst tramp-compat-make-temp-file (filename &optional dir-flag)
+(defsubst tramp-compat-make-temp-file (f &optional dir-flag)
"Create a temporary file (compat function).
-Add the extension of FILENAME, if existing."
+Add the extension of F, if existing."
(let* (file-name-handler-alist
(prefix (expand-file-name
(symbol-value 'tramp-temp-name-prefix)
(tramp-compat-temporary-file-directory)))
- (extension (file-name-extension filename t))
+ (extension (file-name-extension f t))
result)
(condition-case nil
(setq result
(require 'tramp)
+;; Pacify byte-compiler.
(eval-when-compile
-
- ;; Pacify byte-compiler.
(require 'cl)
(require 'custom))
+(defvar ange-ftp-ftp-name-arg)
+(defvar ange-ftp-ftp-name-res)
+(defvar ange-ftp-name-format)
;; Disable Ange-FTP from file-name-handler-alist.
;; To handle EFS, the following functions need to be dealt with:
;; option "--without-dbus". Declare used subroutines and variables.
(declare-function dbus-get-unique-name "dbusbind.c")
-;; Pacify byte-compiler
-(eval-when-compile
- (require 'cl)
- (require 'custom))
-
(require 'tramp)
(require 'dbus)
(require 'url-util)
(require 'zeroconf)
+;; Pacify byte-compiler.
+(eval-when-compile
+ (require 'cl)
+ (require 'custom))
+(defvar ls-lisp-use-insert-directory-program)
+
;;;###tramp-autoload
(defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce")
"List of methods for remote files, accessed with GVFS."
v (concat localname filename)
"file-name-all-completions" result))))))))
-(defun tramp-gvfs-handle-file-notify-add-watch (file-name flags callback)
+(defun tramp-gvfs-handle-file-notify-add-watch (file-name _flags _callback)
"Like `file-notify-add-watch' for Tramp files."
(setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil
(tramp-flush-file-property v localname))))))
(defun tramp-gvfs-handle-write-region
- (start end filename &optional append visit lockname confirm)
+ (start end filename &optional _append visit _lockname confirm)
"Like `write-region' for Tramp files."
(with-parsed-tramp-file-name filename nil
;; XEmacs takes a coding system as the seventh argument, not `confirm'.
:system nil nil tramp-bluez-interface-adapter "DeviceFound"
'tramp-bluez-device-found)
-(defun tramp-bluez-parse-device-names (ignore)
+(defun tramp-bluez-parse-device-names (_ignore)
"Return a list of (nil host) tuples allowed to access."
(mapcar
(lambda (x) (list nil (car x)))
\f
;; D-Bus zeroconf functions.
-(defun tramp-zeroconf-parse-workstation-device-names (ignore)
+(defun tramp-zeroconf-parse-workstation-device-names (_ignore)
"Return a list of (user host) tuples allowed to access."
(mapcar
(lambda (x)
(list nil (zeroconf-service-host x)))
(zeroconf-list-services "_workstation._tcp")))
-(defun tramp-zeroconf-parse-webdav-device-names (ignore)
+(defun tramp-zeroconf-parse-webdav-device-names (_ignore)
"Return a list of (user host) tuples allowed to access."
(mapcar
(lambda (x)
(tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices)
tramp-synce-devices))
-(defun tramp-synce-parse-device-names (ignore)
+(defun tramp-synce-parse-device-names (_ignore)
"Return a list of (nil host) tuples allowed to access."
(mapcar
(lambda (x) (list nil x))
(require 'tramp)
-;; Pacify byte-compiler
+;; Pacify byte-compiler.
(eval-when-compile
(require 'cl)
(require 'custom))
-
-;; Avoid byte-compiler warnings if the byte-compiler supports this.
-;; Currently, XEmacs supports this.
-(eval-when-compile
- (when (featurep 'xemacs)
- (byte-compiler-options (warnings (- unused-vars)))))
+(defvar socks-noproxy)
;; We don't add the following methods to `tramp-methods', in order to
;; exclude them from file name completion.
(defvar tramp-gw-aux-proc nil
"Process listening on local port, as mediation between SSH and the gateway.")
-(defun tramp-gw-gw-proc-sentinel (proc event)
+(defun tramp-gw-gw-proc-sentinel (proc _event)
"Delete auxiliary process when we are deleted."
(unless (memq (process-status proc) '(run open))
(tramp-message
(p (tramp-get-connection-property proc "process" nil)))
(when (processp p) (delete-process p)))))
-(defun tramp-gw-aux-proc-sentinel (proc event)
+(defun tramp-gw-aux-proc-sentinel (proc _event)
"Activate the different filters for involved gateway and auxiliary processes."
(when (memq (process-status proc) '(run open))
;; A new process has been spawned from `tramp-gw-aux-proc'.
;;; Code:
-(eval-when-compile (require 'cl)) ; ignore-errors
(require 'tramp)
-;; Pacify byte-compiler. The function is needed on XEmacs only. I'm
-;; not sure at all that this is the right way to do it, but let's hope
-;; it works for now, and wait for a guru to point out the Right Way to
-;; achieve this.
-;;(eval-when-compile
-;; (unless (fboundp 'dired-insert-set-properties)
-;; (fset 'dired-insert-set-properties 'ignore)))
-;; Gerd suggests this:
-(eval-when-compile (require 'dired))
-;; Note that dired is required at run-time, too, when it is needed.
-;; It is only needed on XEmacs for the function
-;; `dired-insert-set-properties'.
+;; Pacify byte-compiler.
+(eval-when-compile
+ (require 'cl)
+ (require 'dired))
+(defvar directory-sep-char)
+(defvar tramp-gw-tunnel-method)
+(defvar tramp-gw-socks-method)
(defcustom tramp-inline-compress-start-size 4096
"The minimum size of compressing where inline transfer.
(tramp-shell-quote-argument l-localname))
t))))
-(defun tramp-sh-handle-file-truename (filename &optional counter prev-dirs)
+(defun tramp-sh-handle-file-truename (filename)
"Like `file-truename' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name method user host
'copy-file (list filename newname ok-if-already-exists keep-date)))))
(defun tramp-sh-handle-copy-directory
- (dirname newname &optional keep-date parents copy-contents)
+ (dirname newname &optional keep-date parents _copy-contents)
"Like `copy-directory' for Tramp files."
(let ((t1 (tramp-tramp-file-p dirname))
(t2 (tramp-tramp-file-p newname)))
(t2 (tramp-tramp-file-p newname))
(length (nth 7 (file-attributes (file-truename filename))))
(attributes (and preserve-extended-attributes
- (apply 'file-extended-attributes (list filename))))
- pr tm)
+ (apply 'file-extended-attributes (list filename)))))
(with-parsed-tramp-file-name (if t1 filename newname) nil
(when (and (not ok-if-already-exists) (file-exists-p newname))
(tramp-error
v 'file-error "Failed to recursively delete %s" filename))))
-(defun tramp-sh-handle-dired-compress-file (file &rest ok-flag)
+(defun tramp-sh-handle-dired-compress-file (file &rest _ok-flag)
"Like `dired-compress-file' for Tramp files."
;; OK-FLAG is valid for XEmacs only, but not implemented.
;; Code stolen mainly from dired-aux.el.
(inhibit-file-name-operation 'insert-file-contents))
(unwind-protect
(progn
- (fset 'find-buffer-file-type (lambda (filename) t))
+ (fset 'find-buffer-file-type (lambda (_filename) t))
(insert-file-contents filename visit beg end replace))
;; Save exit.
(if find-buffer-file-type-function
;; Default file name handlers, we don't care.
(t (tramp-run-real-handler operation args)))))))
-(defun tramp-sh-handle-file-notify-add-watch (file-name flags callback)
+(defun tramp-sh-handle-file-notify-add-watch (file-name flags _callback)
"Like `file-notify-add-watch' for Tramp files."
(setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil
Looks at process PROC to see if a shell prompt appears in TIMEOUT
seconds. If not, it produces an error message with the given ERROR-ARGS."
(let ((vec (tramp-get-connection-property proc "vector" nil)))
- (condition-case err
+ (condition-case nil
(tramp-wait-for-regexp
proc timeout
(format
(tramp-message
vec 2 "Couldn't find an inline transfer compress command")))))
-(defvar tramp-gw-tunnel-method)
-(defvar tramp-gw-socks-method)
-
(defun tramp-compute-multi-hops (vec)
"Expands VEC according to `tramp-default-proxies-alist'.
Gateway hops are already opened."
;;; Code:
-(eval-when-compile (require 'cl)) ; block, return
(require 'tramp)
+;; Pacify byte-compiler.
+(eval-when-compile
+ (require 'cl))
+
;; Define SMB method ...
;;;###tramp-autoload
(defconst tramp-smb-method "smb"
(throw 'tramp-action 'ok)))))
(defun tramp-smb-handle-copy-directory
- (dirname newname &optional keep-date parents copy-contents)
+ (dirname newname &optional keep-date parents _copy-contents)
"Like `copy-directory' for Tramp files."
(setq dirname (expand-file-name dirname)
newname (expand-file-name newname))
(defun tramp-smb-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date
- preserve-uid-gid preserve-extended-attributes)
+ _preserve-uid-gid _preserve-extended-attributes)
"Like `copy-file' for Tramp files.
KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(tramp-error
v 'file-error "%s `%s'" (match-string 0) directory))))))
-(defun tramp-smb-handle-delete-file (filename &optional trash)
+(defun tramp-smb-handle-delete-file (filename &optional _trash)
"Like `delete-file' for Tramp files."
(setq filename (expand-file-name filename))
(when (file-exists-p filename)
"%s%s"
(if (string-match "D" mode) "d" "-")
(mapconcat
- (lambda (x) "") " "
+ (lambda (_x) "") " "
(concat "r" (if (string-match "R" mode) "-" "w") "x"))))
line (substring line 0 -6))
(return))
;;; Code:
-(defvar tramp-uu-b64-alphabet
+(defconst tramp-uu-b64-alphabet
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
"Mapping from base64-encoded character to the byte it represents.")
-(defvar tramp-uu-b64-char-to-byte
+(defconst tramp-uu-b64-char-to-byte
(let ((i 0))
(mapcar (lambda (c)
(prog1
;; First we base64 encode the region, then we transmogrify that into
;; uu encoding.
(let ((len (base64-encode-region beg end t))
- (padding 0)
i c)
(save-excursion
(goto-char beg)
;;; Code:
-(eval-when-compile (require 'cl)) ; ignore-errors
(require 'tramp-compat)
+;; Pacify byte-compiler.
+(eval-when-compile
+ (require 'cl))
+(defvar bkup-backup-directory-info)
+(defvar directory-sep-char)
+(defvar eshell-path-env)
+(defvar file-notify-descriptors)
+(defvar outline-regexp)
+
;;; User Customizable Internal Variables:
(defgroup tramp nil
(set (make-local-variable 'outline-level) 'tramp-debug-outline-level))
(current-buffer)))
-(defsubst tramp-debug-message (vec fmt-string &rest args)
+(defsubst tramp-debug-message (vec fmt-string &rest arguments)
"Append message to debug buffer.
Message is formatted with FMT-STRING as control string and the remaining
-ARGS to actually emit the message (if applicable)."
+ARGUMENTS to actually emit the message (if applicable)."
(when (get-buffer (tramp-buffer-name vec))
(with-current-buffer (tramp-get-debug-buffer vec)
(goto-char (point-max))
; (1+ (count-lines (point-min) (cdr ffn)))))))
(insert (format "%s " fn)))
;; The message.
- (insert (apply 'format fmt-string args)))))
+ (insert (apply 'format fmt-string arguments)))))
(defvar tramp-message-show-message t
"Show Tramp message in the minibuffer.
This variable is used to disable messages from `tramp-error'.
The messages are visible anyway, because an error is raised.")
-(defsubst tramp-message (vec-or-proc level fmt-string &rest args)
+(defsubst tramp-message (vec-or-proc level fmt-string &rest arguments)
"Emit a message depending on verbosity level.
VEC-OR-PROC identifies the Tramp buffer to use. It can be either a
vector or a process. LEVEL says to be quiet if `tramp-verbose' is
is greater than or equal 4.
Calls functions `message' and `tramp-debug-message' with FMT-STRING as
-control string and the remaining ARGS to actually emit the message (if
+control string and the remaining ARGUMENTS to actually emit the message (if
applicable)."
(ignore-errors
(when (<= level tramp-verbose)
((= level 2) "Warning: ")
(t "Tramp: "))
fmt-string)
- args))
+ arguments))
;; Log only when there is a minimum level.
(when (>= tramp-verbose 4)
(when (and vec-or-proc
(apply 'tramp-debug-message
vec-or-proc
(concat (format "(%d) # " level) fmt-string)
- args)))))))
+ arguments)))))))
(defsubst tramp-backtrace (vec-or-proc)
"Dump a backtrace into the debug buffer.
This function is meant for debugging purposes."
(tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))))
-(defsubst tramp-error (vec-or-proc signal fmt-string &rest args)
+(defsubst tramp-error (vec-or-proc signal fmt-string &rest arguments)
"Emit an error.
VEC-OR-PROC identifies the connection to use, SIGNAL is the
-signal identifier to be raised, remaining args passed to
+signal identifier to be raised, remaining arguments passed to
`tramp-message'. Finally, signal SIGNAL is raised."
(let (tramp-message-show-message)
(tramp-backtrace vec-or-proc)
(error-message-string
(list signal
(get signal 'error-message)
- (apply 'format fmt-string args))))
- (signal signal (list (apply 'format fmt-string args)))))
+ (apply 'format fmt-string arguments))))
+ (signal signal (list (apply 'format fmt-string arguments)))))
(defsubst tramp-error-with-buffer
- (buffer vec-or-proc signal fmt-string &rest args)
- "Emit an error, and show BUFFER.
-If BUFFER is nil, show the connection buffer. Wait for 30\", or until
+ (buf vec-or-proc signal fmt-string &rest arguments)
+ "Emit an error, and show BUF.
+If BUF is nil, show the connection buf. Wait for 30\", or until
an input event arrives. The other arguments are passed to `tramp-error'."
(save-window-excursion
- (let* ((buf (or (and (bufferp buffer) buffer)
+ (let* ((buf (or (and (bufferp buf) buf)
(and (processp vec-or-proc) (process-buffer vec-or-proc))
(and (vectorp vec-or-proc)
(tramp-get-connection-buffer vec-or-proc))))
(and buf (with-current-buffer buf
(tramp-dissect-file-name default-directory))))))
(unwind-protect
- (apply 'tramp-error vec-or-proc signal fmt-string args)
+ (apply 'tramp-error vec-or-proc signal fmt-string arguments)
;; Save exit.
(when (and buf
tramp-message-show-message
(let ((enable-recursive-minibuffers t))
;; `tramp-error' does not show messages. So we must do it
;; ourselves.
- (message fmt-string args)
+ (message fmt-string arguments)
;; Show buffer.
(pop-to-buffer buf)
(discard-input)
(setq filename (concat filename "/"))))
(tramp-run-real-handler 'substitute-in-file-name (list filename)))))
-(defun tramp-handle-unhandled-file-name-directory (filename)
+(defun tramp-handle-unhandled-file-name-directory (_filename)
"Like `unhandled-file-name-directory' for Tramp files."
;; With Emacs 23, we could simply return `nil'. But we must keep it
;; for backward compatibility.
;; only if that agrees with the buffer's record.
(t (equal mt '(-1 65535))))))))))
-(defun tramp-handle-file-notify-add-watch (filename flags callback)
+(defun tramp-handle-file-notify-add-watch (filename _flags _callback)
"Like `file-notify-add-watch' for Tramp files."
;; This is the default handler. tramp-gvfs.el and tramp-sh.el have
;; its own one.
(tramp-error
v 'file-notify-error "File notification not supported for `%s'" filename)))
-(defvar file-notify-descriptors)
(defun tramp-handle-file-notify-rm-watch (proc)
"Like `file-notify-rm-watch' for Tramp files."
;; The descriptor must be a process object.
;; prompts from the remote host. See the variable
;; `tramp-actions-before-shell' for usage of these functions.
-(defun tramp-action-login (proc vec)
+(defun tramp-action-login (_proc vec)
"Send the login name."
(when (not (stringp tramp-current-user))
(setq tramp-current-user
;; Hide password prompt.
(narrow-to-region (point-max) (point-max)))))
-(defun tramp-action-succeed (proc vec)
+(defun tramp-action-succeed (_proc _vec)
"Signal success in finding shell prompt."
(throw 'tramp-action 'ok))
-(defun tramp-action-permission-denied (proc vec)
+(defun tramp-action-permission-denied (proc _vec)
"Signal permission denied."
(kill-process proc)
(throw 'tramp-action 'permission-denied))
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec (concat "y" tramp-local-end-of-line)))))
-(defun tramp-action-terminal (proc vec)
+(defun tramp-action-terminal (_proc vec)
"Tell the remote host which terminal type to use.
The terminal type can be configured with `tramp-terminal-type'."
(tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type)
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line)))
-(defun tramp-action-process-alive (proc vec)
+(defun tramp-action-process-alive (proc _vec)
"Check, whether a process has finished."
(unless (memq (process-status proc) '(run open))
(throw 'tramp-action 'process-died)))
;;; Integration of eshell.el:
-(eval-when-compile
- (defvar eshell-path-env))
-
;; eshell.el keeps the path in `eshell-path-env'. We must change it
;; when `default-directory' points to another host.
(defun tramp-eshell-directory-change ()
(set (make-local-variable 'sentence-end)
"\\([.?!]\\|@:\\)[]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*")
(set (make-local-variable 'compile-command)
- (concat "scribe " (buffer-file-name))))
+ (concat "scribe "
+ (if buffer-file-name
+ (shell-quote-argument (buffer-file-name))))))
(defun scribe-tab ()
(interactive)
(file-exists-p \"Makefile\"))
(set (make-local-variable 'compile-command)
(concat \"make -k \"
- (file-name-sans-extension buffer-file-name))))))"
+ (if buffer-file-name
+ (shell-quote-argument
+ (file-name-sans-extension buffer-file-name))))))))"
:type 'string
:group 'compilation)
;;;###autoload(put 'compile-command 'safe-local-variable (lambda (a) (and (stringp a) (or (not (boundp 'compilation-read-command)) compilation-read-command))))
mixal-syntax-propertize-function)
;; might add an indent function in the future
;; (set (make-local-variable 'indent-line-function) 'mixal-indent-line)
- (set (make-local-variable 'compile-command) (concat "mixasm "
- buffer-file-name)))
+ (set (make-local-variable 'compile-command)
+ (concat "mixasm "
+ (if buffer-file-name
+ (shell-quote-argument buffer-file-name)))))
(provide 'mixal-mode)
"*class definition*"
"*function definition*"))
-(defun python-imenu--put-parent (type name pos num-children tree &optional root)
- "Add the parent with TYPE, NAME, POS and NUM-CHILDREN to TREE.
-Optional Argument ROOT must be non-nil when the node being
-processed is the root of the TREE."
+(defun python-imenu--put-parent (type name pos tree)
+ "Add the parent with TYPE, NAME and POS to TREE."
(let ((label
(funcall python-imenu-format-item-label-function type name))
(jump-label
(funcall python-imenu-format-parent-item-jump-label-function type name)))
- (if root
- ;; This is the root, everything is a children.
- (cons label (cons (cons jump-label pos) tree))
- ;; This is node a which may contain some children.
- (cons
- (cons label (cons (cons jump-label pos)
- ;; Append all the children
- (python-util-popn tree num-children)))
- ;; All previous non-children nodes.
- (nthcdr num-children tree)))))
+ (if (not tree)
+ (cons label pos)
+ (cons label (cons (cons jump-label pos) tree)))))
-(defun python-imenu--build-tree (&optional min-indent prev-indent num-children tree)
+(defun python-imenu--build-tree (&optional min-indent prev-indent tree)
"Recursively build the tree of nested definitions of a node.
-Arguments MIN-INDENT PREV-INDENT NUM-CHILDREN and TREE are
-internal and should not be passed explicitly unless you know what
-you are doing."
- (setq num-children (or num-children 0)
- min-indent (or min-indent 0))
+Arguments MIN-INDENT PREV-INDENT and TREE are internal and should
+not be passed explicitly unless you know what you are doing."
+ (setq min-indent (or min-indent 0)
+ prev-indent (or prev-indent python-indent-offset))
(let* ((pos (python-nav-backward-defun))
(type)
(name (when (and pos (looking-at python-nav-beginning-of-defun-regexp))
(cadr split))))
(label (when name
(funcall python-imenu-format-item-label-function type name)))
- (indent (current-indentation)))
+ (indent (current-indentation))
+ (children-indent-limit (+ python-indent-offset min-indent)))
(cond ((not pos)
- ;; No defun found, nothing to add.
- tree)
- ((equal indent 0)
- (if (> num-children 0)
- ;; Append it as the parent of everything collected to
- ;; this point.
- (python-imenu--put-parent type name pos num-children tree t)
- ;; There are no children, this is a lonely defun.
- (cons label pos)))
- ((equal min-indent indent)
- ;; Stop collecting nodes after moving to a position with
- ;; indentation equaling min-indent. This is specially
- ;; useful for navigating nested definitions recursively.
- (if (> num-children 0)
- tree
- ;; When there are no children, the collected tree is a
- ;; single node intended to be added in the list of defuns
- ;; of its parent.
- (car tree)))
+ ;; Nothing found, probably near to bobp.
+ nil)
+ ((<= indent min-indent)
+ ;; The current indentation points that this is a parent
+ ;; node, add it to the tree and stop recursing.
+ (python-imenu--put-parent type name pos tree))
(t
(python-imenu--build-tree
min-indent
indent
- ;; Add another children, either when this is the
- ;; first call or when indentation is
- ;; less-or-equal than previous. And do not
- ;; discard the number of children, because the
- ;; way code is scanned, all children are
- ;; collected until a root node yet to be found
- ;; appears.
- (if (or (not prev-indent)
- (and
- (> indent min-indent)
- (<= indent prev-indent)))
- (1+ num-children)
- num-children)
- (cond ((not prev-indent)
- ;; First call to the function: append this
- ;; defun to the index.
- (list (cons label pos)))
- ((= indent prev-indent)
- ;; Add another defun with the same depth
- ;; as the previous.
- (cons (cons label pos) tree))
- ((and (< indent prev-indent)
- (< 0 num-children))
- ;; There are children to be appended and
- ;; the previous defun had more
- ;; indentation, the current one must be a
- ;; parent.
- (python-imenu--put-parent type name pos num-children tree))
- ((> indent prev-indent)
- ;; There are children defuns deeper than
- ;; current depth. Fear not, we already
- ;; know how to treat them.
- (cons
- (prog1
- (python-imenu--build-tree
- prev-indent indent 0 (list (cons label pos)))
- ;; Adjustment: after scanning backwards
- ;; for all deeper children, we need to
- ;; continue our scan for a parent from
- ;; the current defun we are looking at.
- (python-nav-forward-defun))
- tree))))))))
+ (if (<= indent children-indent-limit)
+ ;; This lies within the children indent offset range,
+ ;; so it's a normal child of its parent (i.e., not
+ ;; a child of a child).
+ (cons (cons label pos) tree)
+ ;; Oh no, a child of a child?! Fear not, we
+ ;; know how to roll. We recursively parse these by
+ ;; swapping prev-indent and min-indent plus adding this
+ ;; newly found item to a fresh subtree. This works, I
+ ;; promise.
+ (cons
+ (python-imenu--build-tree
+ prev-indent indent (list (cons label pos)))
+ tree)))))))
(defun python-imenu-create-index ()
"Return tree Imenu alist for the current python buffer.
be copied into other buffers."
(funcall filter-buffer-substring-function beg end delete))
+;; FIXME: `with-wrapper-hook' is obsolete
(defun buffer-substring--filter (beg end &optional delete)
(with-wrapper-hook filter-buffer-substring-functions (beg end delete)
(cond
\f
(defun backward-word (&optional arg)
"Move backward until encountering the beginning of a word.
-With argument ARG, do this that many times."
+With argument ARG, do this that many times.
+If ARG is omitted or nil, move point backward one word."
(interactive "^p")
(forward-word (- (or arg 1))))
+2013-08-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * url-http.el (url-http-parse-headers): Always place point at the
+ start of the buffer instead of just 80% of the time.
+
2013-08-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-http.el (url-handle-content-transfer-encoding): Renamed
(url-handle-content-transfer-encoding))
(url-http-debug "Finished parsing HTTP headers: %S" success)
(widen)
+ (goto-char (point-min))
success))
(defun url-handle-content-transfer-encoding ()
(error "Window %s is not an internal window" window)
(walk-window-subtree
(lambda (window)
- (set-window-parameter window 'window-atom t))
+ (unless (window-parameter window 'window-atom)
+ (set-window-parameter window 'window-atom t)))
window t)
window))
sibling of an atomic window's root. If an internal window is
specified here, all children of that window become part of the
atomic window too. If no window is specified, the new window
- becomes a sibling of the selected window.
+ becomes a sibling of the selected window. By default, the
+ `window-atom' parameter of the existing window is set to `main'
+ provided it is live and was not set before.
`side' denotes the side of the existing window where the new
window shall be located. Valid values are `below', `right',
- `above' and `left'. The default is `below'.
+ `above' and `left'. The default is `below'. By default, the
+ `window-atom' parameter of the new window is set to this value.
The return value is the new window, nil when creating that window
failed."
- (let ((ignore-window-parameters t)
- (window-combination-limit t)
- (window (cdr (assq 'window alist)))
- (side (cdr (assq 'side alist)))
- new)
+ (let* ((ignore-window-parameters t)
+ (window-combination-limit t)
+ (window-combination-resize 'atom)
+ (window (cdr (assq 'window alist)))
+ (side (cdr (assq 'side alist)))
+ (atom (when window (window-parameter window 'window-atom)))
+ root new)
(setq window (window-normalize-window window))
- ;; Split off new window
+ (setq root (window-atom-root window))
+ ;; Split off new window.
(when (setq new (split-window window nil side))
- ;; Make sure we have a valid atomic window.
- (window-make-atom (window-parent window))
+ (window-make-atom
+ (if (and root (not (eq root window)))
+ ;; When WINDOW was part of an atomic window and we did not
+ ;; split its root, root atomic window at old root.
+ root
+ ;; Otherwise, root atomic window at WINDOW's new parent.
+ (window-parent window)))
+ ;; Assign `window-atom' parameters, if needed.
+ (when (and (not atom) (window-live-p window))
+ (set-window-parameter window 'window-atom 'main))
+ (set-window-parameter new 'window-atom side)
;; Display BUFFER in NEW and return NEW.
(window--display-buffer
buffer new 'window alist display-buffer-mark-dedicated))))
(and (setq sibling (window-next-sibling window))
(window-parameter sibling 'window-side)))
(setq major window)))
- frame t)
+ frame t 'nomini)
(or major (frame-root-window frame))))
(defun window--major-side-window (side)
(walk-window-tree
(lambda (window)
(when (eq (window-parameter window 'window-side) side)
- (setq windows (cons window windows)))))
+ (setq windows (cons window windows))))
+ nil nil 'nomini)
(nreverse windows))))
(slots (when major (max 1 (window-child-count major))))
(max-slots
(if bottom (throw 'reset t) (setq bottom t)))
(t
(throw 'reset t))))
- frame t))
+ frame t 'nomini))
;; If there's a side window, there must be at least one
;; non-side window.
(and (or left top right bottom) (not none)))
(walk-window-tree
(lambda (window)
(set-window-parameter window 'window-side nil))
- frame t))))
+ frame t 'nomini))))
(defun window--check (&optional frame)
"Check atomic and side windows on FRAME.
(setq value (+ value
(window--min-size-1 sub horizontal ignore)))
(setq sub (window-right sub)))
- ;; The minimum size of an ortho-combination is the maximum of
- ;; the minimum sizes of its child windows.
+ ;; The minimum size of an ortho-combination is the maximum
+ ;; of the minimum sizes of its child windows.
(while sub
(setq value (max value
(window--min-size-1 sub horizontal ignore)))
(defun window-deletable-p (&optional window)
"Return t if WINDOW can be safely deleted from its frame.
WINDOW must be a valid window and defaults to the selected one.
-Return `frame' if deleting WINDOW should also delete its frame."
+Return 'frame if deleting WINDOW should also delete its frame."
(setq window (window-normalize-window window))
- (unless ignore-window-parameters
+ (unless (or ignore-window-parameters
+ (eq (window-parameter window 'delete-window) t))
;; Handle atomicity.
(when (window-parameter window 'window-atom)
(setq window (window-atom-root window))))
;; on the same terminal, and it does not contain the active
;; minibuffer.
(unless (or (eq frame (next-frame frame 0))
+ ;; We can delete our frame only if no other frame
+ ;; currently uses our minibuffer window.
+ (catch 'other
+ (dolist (other (frame-list))
+ (when (and (not (eq other frame))
+ (eq (window-frame (minibuffer-window other))
+ frame))
+ (throw 'other t))))
(let ((minibuf (active-minibuffer-window)))
(and minibuf (eq frame (window-frame minibuf)))))
'frame))
;; (Bug#12588).
point window-point-insertion-type)))))
(set-window-prev-buffers
- window (cons entry (window-prev-buffers window))))))))
+ window (cons entry (window-prev-buffers window)))))
+
+ (run-hooks 'buffer-list-update-hook))))
(defun unrecord-window-buffer (&optional window buffer)
"Unrecord BUFFER in WINDOW.
(let* ((new (split-window-internal window new-size side new-normal)))
;; Assign window-side parameters, if any.
- (when (eq window-combination-resize 'side)
+ (cond
+ ((eq window-combination-resize 'side)
(let ((window-side
(cond
(window-side window-side)
;; new parent the same window-side parameter.
(set-window-parameter
(window-parent new) 'window-side window-side))))
+ ((eq window-combination-resize 'atom)
+ ;; Make sure `window--check-frame' won't destroy an existing
+ ;; atomic window in case the new window gets nested inside.
+ (unless (window-parameter window 'window-atom)
+ (set-window-parameter window 'window-atom t))
+ (when new-parent
+ (set-window-parameter (window-parent new) 'window-atom t))
+ (set-window-parameter new 'window-atom t)))
(run-window-configuration-change-hook frame)
(window--check frame)
frame's root window, or reuses an existing window at the bottom
of the selected frame."
(let (bottom-window window)
- (walk-window-tree (lambda (window) (setq bottom-window window)))
+ (walk-window-tree
+ (lambda (window) (setq bottom-window window)) nil nil 'nomini)
(or (and (not (frame-parameter nil 'unsplittable))
(setq window (window--try-to-split-window bottom-window alist))
(window--display-buffer
(and (not (frame-parameter nil 'unsplittable))
(setq window
(condition-case nil
- (split-window (frame-root-window))
+ (split-window (window--major-non-side-window))
(error nil)))
(window--display-buffer
buffer window 'window alist display-buffer-mark-dedicated))
(interactive (list (read-buffer "Pop to buffer: " (other-buffer))
(if current-prefix-arg t)))
(setq buffer (window-normalize-buffer-to-switch-to buffer))
- (set-buffer buffer)
+ ;; This should be done by `select-window' below.
+ ;; (set-buffer buffer)
(let* ((old-frame (selected-frame))
(window (display-buffer buffer action))
(frame (window-frame window)))
(cond
((or (menu-or-popup-active-p)
(and window
- (not (coordinates-in-window-p (cdr mouse-position) window))))
- ;; A menu / popup dialog is active or the mouse is on the scroll-bar
- ;; of WINDOW, temporarily suspend delayed autoselection.
+ (let ((coords (coordinates-in-window-p
+ (cdr mouse-position) window)))
+ (and (not (consp coords))
+ (not (memq coords '(left-margin right-margin)))))))
+ ;; A menu / popup dialog is active or the mouse is not on the
+ ;; text region of WINDOW: Suspend autoselection temporarily.
(mouse-autoselect-window-start mouse-position nil t))
((eq mouse-autoselect-window-state 'suspend)
;; Delayed autoselection was temporarily suspended, reenable it.
-# warnings.m4 serial 8
+# warnings.m4 serial 10
dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_COMPILER_OPTION_IF],
[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
+AS_LITERAL_IF([$1],
+ [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
+ [gl_positive="$1"
+case $gl_positive in
+ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
+m4_pushdef([gl_Positive], [$gl_positive])])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
gl_save_compiler_FLAGS="$gl_Flags"
- gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors $1"])
+ gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
+ [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
[AS_VAR_SET(gl_Warn, [yes])],
[AS_VAR_SET(gl_Warn, [no])])
gl_Flags="$gl_save_compiler_FLAGS"
])
AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
+m4_popdef([gl_Positive])dnl
AS_VAR_POPDEF([gl_Flags])dnl
AS_VAR_POPDEF([gl_Warn])dnl
])
for f in `find etc -type f`; do
case $f in
etc/DOC*|etc/*.pyc) continue ;;
+ ## Arguably we should not exclude *.ps.
+ etc/refcards/*.aux|etc/refcards/*.dvi|etc/refcards/*.log|etc/refcards/*.ps)
+ continue ;;
esac
ln $f $tempdir/$f
done
+2013-08-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_get_animation_cache): Don't segfault on
+ each invocation.
+ (imagemagick_get_animation_cache): Revert to previous definition
+ so that it actually works. But keep the memory leak fix.
+ (imagemagick_get_animation_cache): Fix memory leak.
+
+2013-08-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * image.c: Fix animation cache signature memory leak.
+ Fix some other minor performance problems while we're at it.
+ (imagemagick_create_cache): Clear just the members that
+ need clearing. Don't set update_time, as caller does that now.
+ (imagemagick_prune_animation_cache, imagemagick_get_animation_cache):
+ Simplify by using pointer-to-pointer instead of a prev pointer.
+ (imagemagick_prune_animation_cache): Use make_emacs_time rather
+ than EMACS_TIME_FROM_DOUBLE, and DestroyString rather than free.
+ (imagemagick_get_animation_cache): Don't xstrdup the image signature;
+ it's already a copy. Free the signature probe unless it's cached.
+
+ * process.c (handle_child_signal): Fix crash; deleted pid (Bug#15106).
+ This was introduced by my 2013-08-12 fix for Bug#15035.
+
+2013-08-19 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * image.c (imagemagick_create_cache, imagemagick_get_animation_cache)
+ (imagemagick_prune_animation_cache): Now static.
+
+2013-08-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_get_animation_cache): Don't segfault when
+ pruning all entries.
+
+2013-08-18 Ken Brown <kbrown@cornell.edu>
+
+ * sheap.c (STATIC_HEAP_SIZE): Adjust to current needs; use bigger
+ static heap if ENABLE_CHECKING is defined.
+ (max_bss_sbrk_ptr): New variable.
+ (bss_sbrk): Use it.
+ (report_sheap_usage): Report maximum static heap usage instead of
+ ending static heap usage.
+
+2013-08-17 Eli Zaretskii <eliz@gnu.org>
+
+ * decompress.c (Fzlib_available_p) [WINDOWSNT]: Update the value
+ of zlib_initialized according to the results of calling
+ init_zlib_functions.
+
+2013-08-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c: Implement an ImageMagick per-image cache.
+ (imagemagick_get_animation_cache): Fix a double-free error.
+ (imagemagick_load_image): Remove the ping_wand code, which only
+ apparently saved time on invalid animated images, and slowed down
+ everything else. Optimise for the common case.
+
+2013-08-16 Xue Fuqiao <xfq.free@gmail.com>
+
+ * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+ * editfns.c (insert_before_markers): Mention overlay in the doc string.
+
+ * marker.c (set_marker): Remove documentation of undefined behavior.
+
+2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_compute_animated_image): Animate correctly
+ when sub-images are smaller than the main image.
+ (imagemagick_compute_animated_image): Setting the iterator row to
+ zero is apparently not allowed.
+ (imagemagick_compute_animated_image): Allow images that say they
+ have sub-images that are bigger than the main image, but just crop
+ them.
+
+2013-08-15 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsmenu.m (menuWillOpen:): Fix preprocessor test (Bug#15001).
+
+2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_compute_animated_image): Respect the GIF
+ disposal methods.
+
+2013-08-15 Ken Brown <kbrown@cornell.edu>
+
+ * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC.
+ * gmalloc.c (memalign) [CYGWIN]: Revert last change; it's not
+ needed.
+
+2013-08-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix minor problems found by static checking.
+ * frame.c (delete_frame):
+ * xdisp.c (next_element_from_display_vector):
+ Avoid uninitialized local.
+ * image.c (imagemagick_compute_animated_image): Port to C89.
+ Prefer usual GNU indentation style for loops.
+ Be more careful about bizarrely large sizes, by using ptrdiff_t
+ instead of int.
+
+2013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Fix infinite frame selection loop (Bug#15025).
+ * frame.c (delete_frame): Prefer fast ad-hoc loop to next_frame.
+
+2013-08-15 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (compute_window_start_on_continuation_line): When
+ WORD_WRAP is in effect, use move_it_to instead of move_it_by_lines
+ to make sure we end up setting the window start at the leftmost
+ visible character of the display line. This avoids funky
+ horizontal shifting because the window start is not kept on the
+ same position. (Bug#15090)
+ (next_element_from_display_vector): Support 'box' face attribute
+ in the face definitions of a display vector. (Bug#15099)
+
+2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_compute_animated_image): Implement animated
+ images (bug#14700).
+ (imagemagick_compute_animated_image): Fix some compilation
+ warnings. Implement a very simple cache to make the animation
+ usable at all, but it should be replaced with a per-image cache.
+
+2013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * lisp.h (FOR_EACH_ALIST_VALUE): New macro
+ to do `for' loops over alist values.
+ * buffer.h (FOR_EACH_BUFFER):
+ * process.c (FOR_EACH_PROCESS): Use it.
+ (handle_child_signal, status_notify, Fget_buffer_process)
+ (kill_buffer_processes): Use FOR_EACH_PROCESS.
+
+2013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * term.c (get_named_tty, create_tty_output, tty_free_frame_resources)
+ (tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort.
+ * image.c (make_image_cache): For struct image_cache, prefer xmalloc
+ to xzalloc and so avoid redundant call to memset.
+ * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo
+ members because it is allocated with xzalloc and so already zeroed.
+
+2013-08-14 Ken Brown <kbrown@cornell.edu>
+
+ * gmalloc.c (memalign) [CYGWIN]: Rename to emacs_memalign
+ (Bug#15094).
+
+2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Utility function and macro to copy Lisp string to C string.
+ * lisp.h (xlispstrdupa): New macro.
+ (xlispstrdup): New prototype.
+ * alloc.c (xlispstrdup): New function.
+ * callint.c (Fcall_interactively):
+ * fileio.c (Ffile_name_directory, Fexpand_file_name)
+ (Fsubstitute_in_file_name):
+ * frame.c (Fmake_terminal_frame): Use xlispstrdupa.
+ * image.c (x_create_bitmap_from_file):
+ * w32term.c (w32_term_init):
+ * xterm.c (x_term_init): Use xlispstrdup.
+
+2013-08-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_load_image): Make animated pictures work.
+ There's still some problems with background color settings, though
+ (bug#14700).
+
+ * decompress.c (unwind_decompress): Always restore point.
+
+2013-08-14 Xue Fuqiao <xfq.free@gmail.com>
+
+ * marker.c (set_marker): Reformat documentation.
+
+2013-08-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ * xdisp.c (cursor_type_changed): Now static.
+
+ * image.c (imagemagick_filename_hint): New arg HINT_BUFFER.
+ Use changed. This avoids the need to call xmalloc and for the
+ caller to call xfree, and avoids memory leaks in some situations.
+
+2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xdisp.c (adjust_window_ends): Move duplicated code to new function.
+ (try_window, try_window_reusing_current_matrix, try_window_id): Use it.
+ (redisplay_window): If window_end_valid is cleared due to non-zero
+ windows_or_buffers_changed, clear current_matrix_up_to_date_p and
+ so do not call to try_cursor_movement for that window.
+
+2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (struct window): Convert window_end_pos and
+ window_end_vpos from Lisp_Object to ptrdiff_t and int, respectively.
+ (wset_window_end_pos, wset_window_end_vpos): Remove.
+ * dispnew.c (adjust_glyph_matrix):
+ * window.c (Fwindow_end, replace_window, set_window_buffer)
+ (make_window):
+ * xdisp.c (check_window_end, move_it_to, redisplay_internal)
+ (set_vertical_scroll_bar, redisplay_window, try_window)
+ (try_window_reusing_current_matrix, find_first_unchanged_at_end_row)
+ (try_window_id, decode_mode_spec, mouse_face_from_buffer_pos)
+ (note_mouse_highlight): Adjust users.
+ (try_cursor_movement): Likewise. Convert old precondition to eassert.
+ Add comment.
+
+2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Fix --enable-gcc-warnings errors introduced in 2013-08-13 commit.
+ * image.c (imagemagick_filename_hint): Use `const char *' and
+ prefer SSDATA to SDATA to avoid warnings.
+
+2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Cleanup window fringes, margins and scroll bars adjustments.
+ * window.c (set_window_fringes, set_window_margins)
+ (set_window_scroll_bars, apply_window_adjustment): New functions.
+ (set_window_buffer, Fset_window_margins, Fset_window_fringes)
+ (Fset_window_scroll_bars): Use them.
+
+2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (struct window): Convert scroll_bar_width
+ from Lisp_Object to integer. Adjust comment.
+ (WINDOW_CONFIG_SCROLL_BAR_WIDTH, WINDOW_CONFIG_SCROLL_BAR_COLS):
+ Adjust users.
+ * window.c (wset_scroll_bar_width): Remove.
+ (make_window): Initialize scroll_bar_width.
+ (Fsplit_window_internal): Use direct assignment.
+ (Fset_window_configuration, save_window_save):
+ Convert Lisp_Object to integer and back where appropriate.
+ (Fset_window_scroll_bars): Adjust user. Return t if any scroll
+ bar was actually changed, and mention this in docstring.
+
+2013-08-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * decompress.c: Minor simplifications.
+ (Fzlib_decompress_region): Don't bother verifying
+ that avail_out <= UINT_MAX, as that was confusing.
+ Mention the restriction in a comment instead.
+ Prefer 'int' to 'ptrdiff_t' when 'int' is wide enough.
+
+2013-08-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsmenu.m (x_activate_menubar): Check for OSX >= 10.5
+ (trackingNotification:): Call ns_check_menu_open only for OSX >= 10.5.
+
+2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_filename_hint): Check for errors in the
+ alist structure.
+
+2013-08-13 Eli Zaretskii <eliz@gnu.org>
+
+ * window.c (Fwindow_margins): Return nil when there's no marginal
+ area, as per the documented API.
+
+ * w32term.c (x_scroll_bar_create): Use ALLOCATE_PSEUDOVECTOR, not
+ Fmake_vector, as scroll bar's struct members are not all Lisp
+ objects now. This avoids crashes in GC.
+
+ * w32term.h (struct scroll_bar): Convert fringe_extended_p to a
+ bool, so its address could be taken.
+
+2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * image.c (imagemagick_filename_hint): New function to possibly
+ apply `image-content-type-suffixes'.
+ (imagemagick_load_image): Use it.
+
+2013-08-13 Eli Zaretskii <eliz@gnu.org>
+
+ * decompress.c (Fzlib_decompress_region) [WINDOWSNT]: Return Qnil
+ if loading zlib failed.
+
+2013-08-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (ns_set_vertical_scroll_bar): Fix breakage intruduced by
+ 2013-08-13 checkin below. Change bool to BOOL, rule is:
+ All Obj-C code uses BOOL, except for interfaces callable from C.
+
+ * nsterm.h: Fix CGFloat for OSX 10.4 (Bug#15086).
+
+2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
+ * nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient
+ bool instead of BOOL.
+ * w32term.h (struct scroll_bar): Convert fringe_extended_p
+ from Lisp_Object to bitfield. Adjust comment.
+ * w32term.c (x_scroll_bar_create): Adjust user.
+ Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
+ * xterm.c (XTset_vertical_scroll_bar): Likewise.
+ Use bool for boolean.
+ * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
+ to `unsigned int' when defining a bitfield.
+
+2013-08-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
+
+2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (struct window): Convert left_margin_cols and
+ right_margin_cols from Lisp_Objects to integers. Adjust comment.
+ (WINDOW_LEFT_MARGIN_COLS, WINDOW_RIGHT_MARGIN_COLS)
+ (WINDOW_LEFT_MARGIN_WIDTH, WINDOW_RIGHT_MARGIN_WIDTH):
+ Adjust users.
+ * dispnew.c (margin_glyphs_to_reserve): Convert 3rd arg to int.
+ Adjust comment.
+ (showing_window_margins_p, update_window_line, update_frame_1):
+ * fringe.c (draw_fringe_bitmap_1):
+ * xdisp.c (window_box_width): Adjust users.
+ * window.c (wset_left_margin_cols, wset_right_margin_cols): Remove.
+ (adjust_window_margins, set_window_buffer, Fsplit_window_internal):
+ Use direct assignment.
+ (Fset_window_configuration, save_window_save, Fwindow_margins):
+ Convert Lisp_Object to integer and back where appropriate.
+ (Fset_window_margins): Adjust user. Return t if any margin
+ was actually changed, and mention this in docstring.
+
+2013-08-13 Xue Fuqiao <xfq.free@gmail.com>
+
+ * syntax.c (forward_word):
+ * cmds.c (forward_char, backward_char): Mention the optional argument.
+
+2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.h (struct window): Convert left_fringe_width
+ and right_fringe_width from Lisp_Objects to integers.
+ Adjust comment.
+ (WINDOW_FRINGE_COLS, WINDOW_LEFT_FRINGE_WIDTH)
+ (WINDOW_RIGHT_FRINGE_WIDTH): Adjust users.
+ * window.c (wset_left_fringe_width, wset_right_fringe_width):
+ Remove.
+ (make_window): Initialize new integer fields to -1.
+ (Fsplit_window_internal): Use direct assignment.
+ (Fset_window_configuration, save_window_save): Convert
+ Lisp_Object to integer and back where appropriate.
+ (Fset_window_fringes): Adjust user. Return t if any fringe
+ was actually changed, and mention this in docstring.
+
+2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keyboard.c (Fdiscard_input): Do not increment update_mode_lines.
+ * nsfns.m (x_set_cursor_type):
+ * w32fns.c (x_set_cursor_type):
+ * xfns.m (x_set_cursor_type): Do not set cursor_type_changed here...
+ * xdisp.c (set_frame_cursor_types): ...but in common code.
+
+2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * font.c (clear_font_cache): New function, stripped from...
+ (Fclear_font_cache): ...here, which now uses the function
+ above. Adjust comment.
+ * font.h (clear_font_cache): Add prototype.
+ * xfaces.c (clear_face_cache): Use clear_font_cache.
+
+2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * window.c (Fset_window_start): Compare `w', not `window' because
+ `w' might not be equal to `window' after call to decode_live_window.
+
+2013-08-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * process.c (deactivate_process): Reset fds to -1 (Bug#15035).
+ This fixes a problem introduced by the Bug#15035 patch
+ when using GPG. Reported by Herbert J. Skuhra.
+
2013-08-12 Eli Zaretskii <eliz@gnu.org>
* decompress.c <zlib_initialized> [WINDOWSNT]: New static variable.
return memcpy (xmalloc (size), s, size);
}
+/* Like above, but duplicates Lisp string to C string. */
+
+char *
+xlispstrdup (Lisp_Object string)
+{
+ ptrdiff_t size = SBYTES (string) + 1;
+ return memcpy (xmalloc (size), SSDATA (string), size);
+}
+
/* Like putenv, but (1) use the equivalent of xmalloc and (2) the
argument is a const pointer. */
An entry (apply DELTA BEG END FUN-NAME . ARGS) supports selective undo
in the active region. BEG and END is the range affected by this entry
-and DELTA is the number of bytes added or deleted in that range by
+and DELTA is the number of characters added or deleted in that range by
this change.
An entry (MARKER . DISTANCE) indicates that the marker MARKER
/* FOR_EACH_LIVE_BUFFER (LIST_VAR, BUF_VAR) followed by a statement is
a `for' loop which iterates over the buffers from Vbuffer_alist. */
-#define FOR_EACH_LIVE_BUFFER(list_var, buf_var) \
- for (list_var = Vbuffer_alist; \
- (CONSP (list_var) && (buf_var = XCDR (XCAR (list_var)), 1)); \
- list_var = XCDR (list_var))
+#define FOR_EACH_LIVE_BUFFER(list_var, buf_var) \
+ FOR_EACH_ALIST_VALUE (Vbuffer_alist, list_var, buf_var)
/* Get text properties of B. */
/* If SPECS is set to a string, use it as an interactive prompt. */
if (STRINGP (specs))
- {
- /* Make a copy of string so that if a GC relocates specs,
- `string' will still be valid. */
- string = alloca (SBYTES (specs) + 1);
- memcpy (string, SSDATA (specs), SBYTES (specs) + 1);
- }
+ /* Make a copy of string so that if a GC relocates specs,
+ `string' will still be valid. */
+ string = xlispstrdupa (specs);
else
{
Lisp_Object input;
doc: /* Move point N characters forward (backward if N is negative).
On reaching end or beginning of buffer, stop and signal error.
Interactively, N is the numeric prefix argument.
+If N is omitted or nil, move point 1 character forward.
Depending on the bidirectional context, the movement may be to the
right or to the left on the screen. This is in contrast with
doc: /* Move point N characters backward (forward if N is negative).
On attempt to pass beginning or end of buffer, stop and signal error.
Interactively, N is the numeric prefix argument.
+If N is omitted or nil, move point 1 character backward.
Depending on the bidirectional context, the movement may be to the
right or to the left on the screen. This is in contrast with
#include "character.h"
#include "buffer.h"
+#include <verify.h>
+
static Lisp_Object Qzlib_dll;
#ifdef WINDOWSNT
struct decompress_unwind_data *data = ddata;
fn_inflateEnd (data->stream);
- /* Delete any uncompressed data already inserted and restore point. */
+ /* Delete any uncompressed data already inserted on error. */
if (data->start)
- {
- del_range (data->start, PT);
- SET_PT (data->old_point);
- }
+ del_range (data->start, PT);
+
+ /* Put point where it was, or if the buffer has shrunk because the
+ compressed data is bigger than the uncompressed, at
+ point-max. */
+ SET_PT (min (data->old_point, ZV));
}
DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0,
else
{
Lisp_Object status;
- status = init_zlib_functions () ? Qt : Qnil;
+ zlib_initialized = init_zlib_functions ();
+ status = zlib_initialized ? Qt : Qnil;
Vlibrary_cache = Fcons (Fcons (Qzlib_dll, status), Vlibrary_cache);
return status;
}
#ifdef WINDOWSNT
if (!zlib_initialized)
zlib_initialized = init_zlib_functions ();
+ if (!zlib_initialized)
+ return Qnil;
#endif
/* This is a unibyte buffer, so character positions and bytes are
stream.avail_in = 0;
stream.next_in = Z_NULL;
- /* The magic number 32 apparently means "autodect both the gzip and
+ /* The magic number 32 apparently means "autodetect both the gzip and
zlib formats" according to zlib.h. */
if (fn_inflateInit2 (&stream, MAX_WBITS + 32) != Z_OK)
return Qnil;
do
{
/* Maximum number of bytes that one 'inflate' call should read and write.
- zlib requires that these values not exceed UINT_MAX.
- Do not make avail_out too large, as that might unduly delay C-g. */
+ Do not make avail_out too large, as that might unduly delay C-g.
+ zlib requires that avail_in and avail_out not exceed UINT_MAX. */
ptrdiff_t avail_in = min (iend - pos_byte, UINT_MAX);
- ptrdiff_t avail_out = min (1 << 14, UINT_MAX);
-
- ptrdiff_t decompressed;
+ int avail_out = 16 * 1024;
+ int decompressed;
if (GAP_SIZE < avail_out)
make_gap (avail_out - GAP_SIZE);
/* Return the number of glyphs to reserve for a marginal area of
window W. TOTAL_GLYPHS is the number of glyphs in a complete
display line of window W. MARGIN gives the width of the marginal
- area in canonical character units. MARGIN should be an integer
- or a float. */
+ area in canonical character units. */
static int
-margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin)
+margin_glyphs_to_reserve (struct window *w, int total_glyphs, int margin)
{
- int n;
-
- if (NUMBERP (margin))
+ if (margin > 0)
{
int width = w->total_cols;
- double d = max (0, XFLOATINT (margin));
+ double d = max (0, margin);
d = min (width / 2 - 1, d);
- n = (int) ((double) total_glyphs / width * d);
+ return (int) ((double) total_glyphs / width * d);
}
- else
- n = 0;
-
- return n;
+ return 0;
}
/* Return true if ROW's hash value is correct.
/* Window end is invalid, if inside of the rows that
are invalidated below. */
- if (INTEGERP (w->window_end_vpos)
- && XFASTINT (w->window_end_vpos) >= i)
+ if (w->window_end_vpos >= i)
w->window_end_valid = 0;
while (i < matrix->nrows)
if (showing_window_margins_p (XWINDOW (w->contents)))
return 1;
}
- else if (!NILP (w->left_margin_cols) || !NILP (w->right_margin_cols))
+ else if (w->left_margin_cols > 0 || w->right_margin_cols > 0)
return 1;
w = NILP (w->next) ? 0 : XWINDOW (w->next);
eassert (desired_row->enabled_p);
/* Update display of the left margin area, if there is one. */
- if (!desired_row->full_width_p
- && !NILP (w->left_margin_cols))
+ if (!desired_row->full_width_p && w->left_margin_cols > 0)
{
changed_p = 1;
update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
}
/* Update display of the right margin area, if there is one. */
- if (!desired_row->full_width_p
- && !NILP (w->right_margin_cols))
+ if (!desired_row->full_width_p && w->right_margin_cols > 0)
{
changed_p = 1;
update_marginal_area (w, RIGHT_MARGIN_AREA, vpos);
int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos);
int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- if (INTEGERP (w->left_margin_cols))
- x += XFASTINT (w->left_margin_cols);
-
- /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
+ x += max (0, w->left_margin_cols);
cursor_to (f, y, x);
}
}
If the current buffer is unibyte, multibyte strings are converted
to unibyte for insertion.
+If an overlay begins at the insertion point, the inserted text falls
+outside the overlay; if a nonempty overlay ends at the insertion
+point, the inserted text falls inside that overlay.
+
usage: (insert-before-markers &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
#endif
#ifdef G_SLICE_ALWAYS_MALLOC
- /* This is used by the Cygwin build. */
+ /* This is used by the Cygwin build. It's not needed starting with
+ cygwin-1.7.24, but it doesn't do any harm. */
xputenv ("G_SLICE=always-malloc");
#endif
}
#ifdef DOS_NT
- beg = alloca (SBYTES (filename) + 1);
- memcpy (beg, SSDATA (filename), SBYTES (filename) + 1);
+ beg = xlispstrdupa (filename);
#else
beg = SSDATA (filename);
#endif
#endif
/* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */
- nm = alloca (SBYTES (name) + 1);
- memcpy (nm, SSDATA (name), SBYTES (name) + 1);
+ nm = xlispstrdupa (name);
#ifdef DOS_NT
/* Note if special escape prefix is present, but remove for now. */
/* Always work on a copy of the string, in case GC happens during
decode of environment variables, causing the original Lisp_String
data to be relocated. */
- nm = alloca (SBYTES (filename) + 1);
- memcpy (nm, SDATA (filename), SBYTES (filename) + 1);
+ nm = xlispstrdupa (filename);
#ifdef DOS_NT
dostounix_filename (nm, multibyte);
return make_string (name, namelen);
}
+void
+clear_font_cache (struct frame *f)
+{
+ struct font_driver_list *driver_list = f->font_driver_list;
+
+ for (; driver_list; driver_list = driver_list->next)
+ if (driver_list->on)
+ {
+ Lisp_Object val, tmp, cache = driver_list->driver->get_cache (f);
+
+ val = XCDR (cache);
+ while (! NILP (val)
+ && ! EQ (XCAR (XCAR (val)), driver_list->driver->type))
+ val = XCDR (val);
+ eassert (! NILP (val));
+ tmp = XCDR (XCAR (val));
+ if (XINT (XCAR (tmp)) == 0)
+ {
+ font_clear_cache (f, XCAR (val), driver_list->driver);
+ XSETCDR (cache, XCDR (val));
+ }
+ }
+}
+
DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
- doc: /* Clear font cache. */)
+ doc: /* Clear font cache of each frame. */)
(void)
{
Lisp_Object list, frame;
FOR_EACH_FRAME (list, frame)
- {
- struct frame *f = XFRAME (frame);
- struct font_driver_list *driver_list = f->font_driver_list;
-
- for (; driver_list; driver_list = driver_list->next)
- if (driver_list->on)
- {
- Lisp_Object cache = driver_list->driver->get_cache (f);
- Lisp_Object val, tmp;
-
- val = XCDR (cache);
- while (! NILP (val)
- && ! EQ (XCAR (XCAR (val)), driver_list->driver->type))
- val = XCDR (val);
- eassert (! NILP (val));
- tmp = XCDR (XCAR (val));
- if (XINT (XCAR (tmp)) == 0)
- {
- font_clear_cache (f, XCAR (val), driver_list->driver);
- XSETCDR (cache, XCDR (val));
- }
- }
- }
+ clear_font_cache (XFRAME (frame));
return Qnil;
}
Lisp_Object spec);
extern void font_prepare_for_face (struct frame *f, struct face *face);
extern void font_done_for_face (struct frame *f, struct face *face);
+extern void clear_font_cache (struct frame *);
extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec);
extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name);
? FRAME_TTY (XFRAME (selected_frame))->name
: NULL));
if (!NILP (tty))
- {
- name = alloca (SBYTES (tty) + 1);
- memcpy (name, SSDATA (tty), SBYTES (tty));
- name[SBYTES (tty)] = 0;
- }
+ name = xlispstrdupa (tty);
tty_type = get_future_frame_param
(Qtty_type, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
? FRAME_TTY (XFRAME (selected_frame))->type
: NULL));
if (!NILP (tty_type))
- {
- type = alloca (SBYTES (tty_type) + 1);
- memcpy (type, SSDATA (tty_type), SBYTES (tty_type));
- type[SBYTES (tty_type)] = 0;
- }
+ type = xlispstrdupa (tty_type);
t = init_tty (name, type, 0); /* Errors are not fatal. */
}
/* Don't let the frame remain selected. */
if (f == sf)
{
- Lisp_Object tail, frame1;
-
- /* Look for another visible frame on the same terminal. */
- frame1 = next_frame (frame, Qvisible);
+ Lisp_Object tail;
+ Lisp_Object frame1 = Qnil;
+
+ /* Look for another visible frame on the same terminal.
+ Do not call next_frame here because it may loop forever.
+ See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15025. */
+ FOR_EACH_FRAME (tail, frame1)
+ if (!EQ (frame, frame1)
+ && (FRAME_TERMINAL (XFRAME (frame))
+ == FRAME_TERMINAL (XFRAME (frame1)))
+ && FRAME_VISIBLE_P (XFRAME (frame1)))
+ break;
/* If there is none, find *some* other frame. */
if (NILP (frame1) || EQ (frame1, frame))
and OTOH leaving out that one pixel leaves behind
traces of the cursor, if it was in column zero
before drawing non-empty margin area. */
- && NILP (w->left_margin_cols))
+ && w->left_margin_cols == 0)
? 1 : 0);
p.bx = x - wd;
p.nx = wd;
id = x_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].img = bitmap;
dpyinfo->bitmaps[id - 1].refcount = 1;
- dpyinfo->bitmaps[id - 1].file = xmalloc (SBYTES (file) + 1);
+ dpyinfo->bitmaps[id - 1].file = xlispstrdup (file);
dpyinfo->bitmaps[id - 1].depth = 1;
dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap);
dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap);
- strcpy (dpyinfo->bitmaps[id - 1].file, SSDATA (file));
return id;
#endif
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
dpyinfo->bitmaps[id - 1].have_mask = 0;
dpyinfo->bitmaps[id - 1].refcount = 1;
- dpyinfo->bitmaps[id - 1].file = xmalloc (SBYTES (file) + 1);
+ dpyinfo->bitmaps[id - 1].file = xlispstrdup (file);
dpyinfo->bitmaps[id - 1].depth = 1;
dpyinfo->bitmaps[id - 1].height = height;
dpyinfo->bitmaps[id - 1].width = width;
- strcpy (dpyinfo->bitmaps[id - 1].file, SSDATA (file));
return id;
#endif /* HAVE_X_WINDOWS */
struct image_cache *
make_image_cache (void)
{
- struct image_cache *c = xzalloc (sizeof *c);
- int size;
+ struct image_cache *c = xmalloc (sizeof *c);
- size = 50;
- c->images = xmalloc (size * sizeof *c->images);
- c->size = size;
- size = IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
- c->buckets = xzalloc (size);
+ c->size = 50;
+ c->used = c->refcount = 0;
+ c->images = xmalloc (c->size * sizeof *c->images);
+ c->buckets = xzalloc (IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets);
return c;
}
IMAGEMAGICK_WIDTH,
IMAGEMAGICK_MAX_HEIGHT,
IMAGEMAGICK_MAX_WIDTH,
+ IMAGEMAGICK_FORMAT,
IMAGEMAGICK_ROTATION,
IMAGEMAGICK_CROP,
IMAGEMAGICK_LAST
{":width", IMAGE_INTEGER_VALUE, 0},
{":max-height", IMAGE_INTEGER_VALUE, 0},
{":max-width", IMAGE_INTEGER_VALUE, 0},
+ {":format", IMAGE_SYMBOL_VALUE, 0},
{":rotation", IMAGE_NUMBER_VALUE, 0},
{":crop", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
};
description = (char *) MagickRelinquishMemory (description);
}
+/* Possibly give ImageMagick some extra help to determine the image
+ type by supplying a "dummy" filename based on the Content-Type. */
+
+static char *
+imagemagick_filename_hint (Lisp_Object spec, char hint_buffer[MaxTextExtent])
+{
+ Lisp_Object symbol = intern ("image-format-suffixes");
+ Lisp_Object val = find_symbol_value (symbol);
+ Lisp_Object format;
+
+ if (! CONSP (val))
+ return NULL;
+
+ format = image_spec_value (spec, intern (":format"), NULL);
+ val = Fcar_safe (Fcdr_safe (Fassq (format, val)));
+ if (! STRINGP (val))
+ return NULL;
+
+ /* It's OK to truncate the hint if it has MaxTextExtent or more bytes,
+ as ImageMagick would ignore the extra bytes anyway. */
+ snprintf (hint_buffer, MaxTextExtent, "/tmp/foo.%s", SSDATA (val));
+ return hint_buffer;
+}
+
+/* Animated images (e.g., GIF89a) are composed from one "master image"
+ (which is the first one, and then there's a number of images that
+ follow. If following images have non-transparent colors, these are
+ composed "on top" of the master image. So, in general, one has to
+ compute ann the preceding images to be able to display a particular
+ sub-image.
+
+ Computing all the preceding images is too slow, so we maintain a
+ cache of previously computed images. We have to maintain a cache
+ separate from the image cache, because the images may be scaled
+ before display. */
+
+struct animation_cache
+{
+ char *signature;
+ MagickWand *wand;
+ int index;
+ EMACS_TIME update_time;
+ struct animation_cache *next;
+};
+
+static struct animation_cache *animation_cache = NULL;
+
+static struct animation_cache *
+imagemagick_create_cache (char *signature)
+{
+ struct animation_cache *cache = xmalloc (sizeof *cache);
+ cache->signature = signature;
+ cache->wand = 0;
+ cache->index = 0;
+ cache->next = 0;
+ cache->update_time = current_emacs_time ();
+ return cache;
+}
+
+/* Discard cached images that haven't been used for a minute. */
+static void
+imagemagick_prune_animation_cache (void)
+{
+ struct animation_cache **pcache = &animation_cache;
+ EMACS_TIME old = sub_emacs_time (current_emacs_time (),
+ make_emacs_time (60, 0));
+
+ while (*pcache)
+ {
+ struct animation_cache *cache = *pcache;
+ if (EMACS_TIME_LE (old, cache->update_time))
+ pcache = &cache->next;
+ else
+ {
+ DestroyString (cache->signature);
+ if (cache->wand)
+ DestroyMagickWand (cache->wand);
+ *pcache = cache->next;
+ xfree (cache);
+ }
+ }
+}
+
+static struct animation_cache *
+imagemagick_get_animation_cache (MagickWand *wand)
+{
+ char *signature = MagickGetImageSignature (wand);
+ struct animation_cache *cache;
+
+ imagemagick_prune_animation_cache ();
+ cache = animation_cache;
+
+ if (! cache)
+ {
+ animation_cache = imagemagick_create_cache (signature);
+ return animation_cache;
+ }
+
+ while (strcmp (signature, cache->signature) &&
+ cache->next)
+ cache = cache->next;
+
+ if (strcmp (signature, cache->signature))
+ {
+ cache->next = imagemagick_create_cache (signature);
+ return cache->next;
+ }
+
+ DestroyString (signature);
+ cache->update_time = current_emacs_time ();
+ return cache;
+}
+
+static MagickWand *
+imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
+{
+ int i;
+ MagickWand *composite_wand;
+ size_t dest_width, dest_height;
+ struct animation_cache *cache = imagemagick_get_animation_cache (super_wand);
+
+ MagickSetIteratorIndex (super_wand, 0);
+
+ if (ino == 0 || cache->wand == NULL || cache->index > ino)
+ {
+ composite_wand = MagickGetImage (super_wand);
+ if (cache->wand)
+ DestroyMagickWand (cache->wand);
+ }
+ else
+ composite_wand = cache->wand;
+
+ dest_width = MagickGetImageWidth (composite_wand);
+ dest_height = MagickGetImageHeight (composite_wand);
+
+ for (i = max (1, cache->index + 1); i <= ino; i++)
+ {
+ MagickWand *sub_wand;
+ PixelIterator *source_iterator, *dest_iterator;
+ PixelWand **source, **dest;
+ size_t source_width, source_height;
+ ssize_t source_left, source_top;
+ MagickPixelPacket pixel;
+ DisposeType dispose;
+ ptrdiff_t lines = 0;
+
+ MagickSetIteratorIndex (super_wand, i);
+ sub_wand = MagickGetImage (super_wand);
+
+ MagickGetImagePage (sub_wand, &source_width, &source_height,
+ &source_left, &source_top);
+
+ /* This flag says how to handle transparent pixels. */
+ dispose = MagickGetImageDispose (sub_wand);
+
+ source_iterator = NewPixelIterator (sub_wand);
+ if (! source_iterator)
+ {
+ DestroyMagickWand (composite_wand);
+ DestroyMagickWand (sub_wand);
+ cache->wand = NULL;
+ image_error ("Imagemagick pixel iterator creation failed",
+ Qnil, Qnil);
+ return NULL;
+ }
+
+ dest_iterator = NewPixelIterator (composite_wand);
+ if (! dest_iterator)
+ {
+ DestroyMagickWand (composite_wand);
+ DestroyMagickWand (sub_wand);
+ DestroyPixelIterator (source_iterator);
+ cache->wand = NULL;
+ image_error ("Imagemagick pixel iterator creation failed",
+ Qnil, Qnil);
+ return NULL;
+ }
+
+ /* The sub-image may not start at origin, so move the destination
+ iterator to where the sub-image should start. */
+ if (source_top > 0)
+ {
+ PixelSetIteratorRow (dest_iterator, source_top);
+ lines = source_top;
+ }
+
+ while ((source = PixelGetNextIteratorRow (source_iterator, &source_width))
+ != NULL)
+ {
+ ptrdiff_t x;
+
+ /* Sanity check. This shouldn't happen, but apparently
+ does in some pictures. */
+ if (++lines >= dest_height)
+ break;
+
+ dest = PixelGetNextIteratorRow (dest_iterator, &dest_width);
+ for (x = 0; x < source_width; x++)
+ {
+ /* Sanity check. This shouldn't happen, but apparently
+ also does in some pictures. */
+ if (x + source_left > dest_width)
+ break;
+ /* Normally we only copy over non-transparent pixels,
+ but if the disposal method is "Background", then we
+ copy over all pixels. */
+ if (dispose == BackgroundDispose ||
+ PixelGetAlpha (source[x]))
+ {
+ PixelGetMagickColor (source[x], &pixel);
+ PixelSetMagickColor (dest[x + source_left], &pixel);
+ }
+ }
+ PixelSyncIterator (dest_iterator);
+ }
+
+ DestroyPixelIterator (source_iterator);
+ DestroyPixelIterator (dest_iterator);
+ DestroyMagickWand (sub_wand);
+ }
+
+ /* Cache a copy for the next iteration. The current wand will be
+ destroyed by the caller. */
+ cache->wand = CloneMagickWand (composite_wand);
+ cache->index = ino;
+
+ return composite_wand;
+}
+
+
/* Helper function for imagemagick_load, which does the actual loading
given contents and size, apart from frame and image structures,
passed from imagemagick_load. Uses librimagemagick to do most of
XImagePtr ximg;
int x, y;
MagickWand *image_wand;
- MagickWand *ping_wand;
PixelIterator *iterator;
PixelWand **pixels, *bg_wand = NULL;
MagickPixelPacket pixel;
int desired_width, desired_height;
double rotation;
int pixelwidth;
+ char hint_buffer[MaxTextExtent];
+ char *filename_hint = NULL;
/* Handle image index for image types who can contain more than one image.
Interface :index is same as for GIF. First we "ping" the image to see how
MagickWandGenesis ();
image = image_spec_value (img->spec, QCindex, NULL);
ino = INTEGERP (image) ? XFASTINT (image) : 0;
- ping_wand = NewMagickWand ();
- /* MagickSetResolution (ping_wand, 2, 2); (Bug#10112) */
+ image_wand = NewMagickWand ();
- status = filename
- ? MagickPingImage (ping_wand, filename)
- : MagickPingImageBlob (ping_wand, contents, size);
+ if (filename)
+ status = MagickReadImage (image_wand, filename);
+ else
+ {
+ filename_hint = imagemagick_filename_hint (img->spec, hint_buffer);
+ MagickSetFilename (image_wand, filename_hint);
+ status = MagickReadImageBlob (image_wand, contents, size);
+ }
if (status == MagickFalse)
{
- imagemagick_error (ping_wand);
- DestroyMagickWand (ping_wand);
+ imagemagick_error (image_wand);
+ DestroyMagickWand (image_wand);
return 0;
}
- if (ino < 0 || ino >= MagickGetNumberImages (ping_wand))
+ if (ino < 0 || ino >= MagickGetNumberImages (image_wand))
{
image_error ("Invalid image number `%s' in image `%s'",
image, img->spec);
- DestroyMagickWand (ping_wand);
+ DestroyMagickWand (image_wand);
return 0;
}
- if (MagickGetNumberImages (ping_wand) > 1)
+ if (MagickGetNumberImages (image_wand) > 1)
img->lisp_data =
Fcons (Qcount,
- Fcons (make_number (MagickGetNumberImages (ping_wand)),
+ Fcons (make_number (MagickGetNumberImages (image_wand)),
img->lisp_data));
- DestroyMagickWand (ping_wand);
-
- /* Now we know how many images are inside the file. If it's not a
- bundle, the number is one. Load the image data. */
-
- image_wand = NewMagickWand ();
-
- if ((filename
- ? MagickReadImage (image_wand, filename)
- : MagickReadImageBlob (image_wand, contents, size))
- == MagickFalse)
+ /* If we have an animated image, get the new wand based on the
+ "super-wand". */
+ if (MagickGetNumberImages (image_wand) > 1)
{
- imagemagick_error (image_wand);
- goto imagemagick_error;
+ MagickWand *super_wand = image_wand;
+ image_wand = imagemagick_compute_animated_image (super_wand, ino);
+ if (! image_wand)
+ image_wand = super_wand;
+ else
+ DestroyMagickWand (super_wand);
}
/* Retrieve the frame's background color, for use later. */
end_kbd_macro ();
}
- update_mode_lines++;
-
Vunread_command_events = Qnil;
discard_tty_input ();
extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
extern char *xstrdup (const char *);
+extern char *xlispstrdup (Lisp_Object);
extern void xputenv (const char *);
extern char *egetenv (const char *);
+/* Copy Lisp string to temporary (allocated on stack) C string. */
+
+#define xlispstrdupa(string) \
+ memcpy (alloca (SBYTES (string) + 1), \
+ SSDATA (string), SBYTES (string) + 1)
+
/* Set up the name of the machine we're running on. */
extern void init_system_name (void);
memory_full (SIZE_MAX); \
} while (0)
+/* Do a `for' loop over alist values. */
+
+#define FOR_EACH_ALIST_VALUE(head_var, list_var, value_var) \
+ for (list_var = head_var; \
+ (CONSP (list_var) && (value_var = XCDR (XCAR (list_var)), 1)); \
+ list_var = XCDR (list_var))
/* Check whether it's time for GC, and run it if so. */
}
DEFUN ("set-marker", Fset_marker, Sset_marker, 2, 3, 0,
- doc: /* Position MARKER before character number POSITION in BUFFER,
-which defaults to the current buffer. If POSITION is nil,
-makes marker point nowhere so it no longer slows down
+ doc: /* Position MARKER before character number POSITION in BUFFER.
+If BUFFER is omitted or nil, it defaults to the current buffer. If
+POSITION is nil, makes marker point nowhere so it no longer slows down
editing in any buffer. Returns MARKER. */)
(Lisp_Object marker, Lisp_Object position, Lisp_Object buffer)
{
x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
-
- /* Make sure the cursor gets redrawn. */
- cursor_type_changed = 1;
}
-\f
/* called to set mouse pointer color, but all other terms use it to
initialize pointer types (and don't set the color ;) */
x_activate_menubar (struct frame *f)
{
#ifdef NS_IMPL_COCOA
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
ns_update_menubar (f, true, nil);
ns_check_pending_open_menu ();
#endif
+#endif
}
/* Update menu in menuNeedsUpdate only while tracking menus. */
trackingMenu = ([notification name] == NSMenuDidBeginTrackingNotification
? 1 : 0);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (! trackingMenu) ns_check_menu_open (nil);
+#endif
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
{
++trackingMenu;
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
// On 10.6 we get repeated calls, only the one for NSSystemDefined is "real".
if ([[NSApp currentEvent] type] != NSSystemDefined) return;
#endif
/* CGFloat on GNUStep may be 4 or 8 byte, but functions expect float* for some
versions.
- On Cocoa, functions expect CGFloat*. Make compatible type. */
-#if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \
- GNUSTEP_GUI_MINOR_VERSION >= 22
+ On Cocoa >= 10.5, functions expect CGFloat*. Make compatible type. */
+#ifdef NS_IMPL_COCOA
+
+#ifndef NS_HAVE_NSINTEGER
+#if defined (__LP64__) && __LP64__
+typedef double CGFloat;
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+#else
+typedef float CGFloat;
+typedef int NSInteger;
+typedef unsigned int NSUInteger;
+#endif /* not LP64 */
+#endif /* not NS_HAVE_NSINTEGER */
+
+typedef CGFloat EmacsCGFloat;
+
+#elif GNUSTEP_GUI_MAJOR_VERSION > 0 || GNUSTEP_GUI_MINOR_VERSION >= 22
typedef CGFloat EmacsCGFloat;
#else
typedef float EmacsCGFloat;
@end
#endif
-#ifndef NS_HAVE_NSINTEGER
-#if defined (__LP64__) && __LP64__
-typedef double CGFloat;
-typedef long NSInteger;
-typedef unsigned long NSUInteger;
-#else
-typedef float CGFloat;
-typedef int NSInteger;
-typedef unsigned int NSUInteger;
-#endif /* not LP64 */
-#endif /* not NS_HAVE_NSINTEGER */
-
#endif /* __OBJC__ */
v = [view frame];
r.origin.y = (v.size.height - r.size.height - r.origin.y);
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (window))
- fringe_extended_p = (WINDOW_LEFTMOST_P (window)
- && WINDOW_LEFT_FRINGE_WIDTH (window)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window)
- || WINDOW_LEFT_MARGIN_COLS (window) == 0));
- else
- fringe_extended_p = (WINDOW_RIGHTMOST_P (window)
- && WINDOW_RIGHT_FRINGE_WIDTH (window)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window)
- || WINDOW_RIGHT_MARGIN_COLS (window) == 0));
+ fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (window);
XSETWINDOW (win, window);
block_input ();
#define DATAGRAM_CONN_P(proc) (0)
#endif
+/* FOR_EACH_PROCESS (LIST_VAR, PROC_VAR) followed by a statement is
+ a `for' loop which iterates over processes from Vprocess_alist. */
+
+#define FOR_EACH_PROCESS(list_var, proc_var) \
+ FOR_EACH_ALIST_VALUE (Vprocess_alist, list_var, proc_var)
+
/* These setters are used only in this file, so they can be private. */
static void
pset_buffer (struct Lisp_Process *p, Lisp_Object val)
#ifndef WINDOWSNT
/* Wait for child_setup to complete in case that vfork is
actually defined as fork. The descriptor
- XPROCESS (proc)->open_fd[EXEC_MOINTOR_OUTPUT]
+ XPROCESS (proc)->open_fd[EXEC_MONITOR_OUTPUT]
of a pipe is closed at the child side either by close-on-exec
on successful execve or the _exit call in child_setup. */
{
if (inchannel >= 0)
{
+ p->infd = -1;
+ p->outfd = -1;
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (inchannel))
{
static void
handle_child_signal (int sig)
{
- Lisp_Object tail;
+ Lisp_Object tail, proc;
/* Find the process that signaled us, and record its status. */
= (MOST_NEGATIVE_FIXNUM <= TYPE_MINIMUM (pid_t)
&& TYPE_MAXIMUM (pid_t) <= MOST_POSITIVE_FIXNUM);
Lisp_Object head = XCAR (tail);
- Lisp_Object xpid = XCAR (head);
+ Lisp_Object xpid;
+ if (! CONSP (head))
+ continue;
+ xpid = XCAR (head);
if (all_pids_are_fixnums ? INTEGERP (xpid) : NUMBERP (xpid))
{
pid_t deleted_pid;
}
/* Otherwise, if it is asynchronous, it is in Vprocess_alist. */
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_PROCESS (tail, proc)
{
- Lisp_Object proc = XCDR (XCAR (tail));
struct Lisp_Process *p = XPROCESS (proc);
int status;
that we run, we get called again to handle their status changes. */
update_tick = process_tick;
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
+ FOR_EACH_PROCESS (tail, proc)
{
Lisp_Object symbol;
- register struct Lisp_Process *p;
-
- proc = Fcdr (XCAR (tail));
- p = XPROCESS (proc);
+ register struct Lisp_Process *p = XPROCESS (proc);
if (p->tick != p->update_tick)
{
buf = Fget_buffer (buffer);
if (NILP (buf)) return Qnil;
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
- {
- proc = Fcdr (XCAR (tail));
- if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf))
- return proc;
- }
+ FOR_EACH_PROCESS (tail, proc)
+ if (EQ (XPROCESS (proc)->buffer, buf))
+ return proc;
#endif /* subprocesses */
return Qnil;
}
#ifdef subprocesses
Lisp_Object tail, proc;
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
- {
- proc = XCDR (XCAR (tail));
- if (PROCESSP (proc)
- && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer)))
- {
- if (NETCONN_P (proc) || SERIALCONN_P (proc))
- Fdelete_process (proc);
- else if (XPROCESS (proc)->infd >= 0)
- process_send_signal (proc, SIGHUP, Qnil, 1);
- }
- }
+ FOR_EACH_PROCESS (tail, proc)
+ if (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))
+ {
+ if (NETCONN_P (proc) || SERIALCONN_P (proc))
+ Fdelete_process (proc);
+ else if (XPROCESS (proc)->infd >= 0)
+ process_send_signal (proc, SIGHUP, Qnil, 1);
+ }
#else /* subprocesses */
/* Since we have no subprocesses, this does nothing. */
#endif /* subprocesses */
#include <unistd.h>
#ifdef __x86_64__
+#ifdef ENABLE_CHECKING
+#define STATIC_HEAP_SIZE (28 * 1024 * 1024)
+#else
+#define STATIC_HEAP_SIZE (19 * 1024 * 1024)
+#endif
+#else /* x86 */
+#ifdef ENABLE_CHECKING
#define STATIC_HEAP_SIZE (18 * 1024 * 1024)
#else
#define STATIC_HEAP_SIZE (13 * 1024 * 1024)
#endif
+#endif /* x86 */
int debug_sheap = 0;
char bss_sbrk_buffer[STATIC_HEAP_SIZE];
char *bss_sbrk_ptr;
+char *max_bss_sbrk_ptr;
int bss_sbrk_did_unexec;
void *
{
if (!bss_sbrk_ptr)
{
- bss_sbrk_ptr = bss_sbrk_buffer;
+ max_bss_sbrk_ptr = bss_sbrk_ptr = bss_sbrk_buffer;
#ifdef CYGWIN
sbrk (BLOCKSIZE); /* force space for fork to work */
#endif
if (debug_sheap)
printf ("allocated 0x%08x size %d\n", ret, request_size);
bss_sbrk_ptr += (int) request_size;
+ if (bss_sbrk_ptr > max_bss_sbrk_ptr)
+ max_bss_sbrk_ptr = bss_sbrk_ptr;
return ret;
}
}
report_sheap_usage (int die_if_pure_storage_exceeded)
{
char buf[200];
- sprintf (buf, "Static heap usage: %d of %d bytes",
- bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE);
+ sprintf (buf, "Maximum static heap usage: %d of %d bytes",
+ max_bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE);
/* Don't log messages, cause at this point, we're not allowed to create
buffers. */
message1_nolog (buf);
DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "^p",
doc: /* Move point forward ARG words (backward if ARG is negative).
+If ARG is omitted or nil, move point forward one word.
Normally returns t.
If an edge of the buffer or a field boundary is reached, point is left there
and the function returns nil. Field boundaries are not noticed if
{
struct terminal *t;
- if (!name)
- emacs_abort ();
+ eassert (name);
for (t = terminal_list; t; t = t->next_terminal)
{
{
struct tty_output *t = xzalloc (sizeof *t);
- if (! FRAME_TERMCAP_P (f))
- emacs_abort ();
+ eassert (FRAME_TERMCAP_P (f));
t->display_info = FRAME_TERMINAL (f)->display_info.tty;
static void
tty_free_frame_resources (struct frame *f)
{
- if (! FRAME_TERMCAP_P (f))
- emacs_abort ();
+ eassert (FRAME_TERMCAP_P (f));
if (FRAME_FACE_CACHE (f))
free_frame_faces (f);
static void
tty_free_frame_resources (struct frame *f)
{
- if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f))
- emacs_abort ();
+ eassert (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f));
if (FRAME_FACE_CACHE (f))
free_frame_faces (f);
if (!terminal->name)
return;
- if (terminal->type != output_termcap)
- emacs_abort ();
+ eassert (terminal->type == output_termcap);
tty = terminal->display_info.tty;
x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
-
- /* Make sure the cursor gets redrawn. */
- cursor_type_changed = 1;
}
-\f
+
void
x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
HWND hwnd;
SCROLLINFO si;
struct scroll_bar *bar
- = XSCROLL_BAR (Fmake_vector (make_number (VECSIZE (struct scroll_bar)), Qnil));
+ = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, fringe_extended_p, PVEC_OTHER);
Lisp_Object barobj;
block_input ();
XSETINT (bar->start, 0);
XSETINT (bar->end, 0);
bar->dragging = Qnil;
- bar->fringe_extended_p = Qnil;
+ bar->fringe_extended_p = 0;
/* Requires geometry to be set before call to create the real window */
struct scroll_bar *bar;
int top, height, left, sb_left, width, sb_width;
int window_y, window_height;
- int fringe_extended_p;
+ bool fringe_extended_p;
/* Get window dimensions. */
window_box (w, -1, 0, &window_y, 0, &window_height);
else
sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- fringe_extended_p = (WINDOW_LEFTMOST_P (w)
- && WINDOW_LEFT_FRINGE_WIDTH (w)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- || WINDOW_LEFT_MARGIN_COLS (w) == 0));
- else
- fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
- && WINDOW_RIGHT_FRINGE_WIDTH (w)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+ fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
hwnd = SCROLL_BAR_W32_WINDOW (bar);
/* If already correctly positioned, do nothing. */
- if ( XINT (bar->left) == sb_left
- && XINT (bar->top) == top
- && XINT (bar->width) == sb_width
- && XINT (bar->height) == height
- && !NILP (bar->fringe_extended_p) == fringe_extended_p )
+ if (XINT (bar->left) == sb_left
+ && XINT (bar->top) == top
+ && XINT (bar->width) == sb_width
+ && XINT (bar->height) == height
+ && bar->fringe_extended_p == fringe_extended_p)
{
/* Redraw after clear_frame. */
if (!my_show_window (f, hwnd, SW_NORMAL))
unblock_input ();
}
}
- bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+ bar->fringe_extended_p = fringe_extended_p;
w32_set_scroll_bar_thumb (bar, portion, position, whole);
XSETVECTOR (barobj, bar);
terminal = w32_create_terminal (dpyinfo);
/* Set the name of the terminal. */
- terminal->name = xmalloc (SBYTES (display_name) + 1);
- strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
+ terminal->name = xlispstrdup (display_name);
dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;
being dragged, this is Qnil. */
Lisp_Object dragging;
- /* t if the background of the fringe that is adjacent to a scroll
+ /* 1 if the background of the fringe that is adjacent to a scroll
bar is extended to the gap between the fringe and the bar. */
- Lisp_Object fringe_extended_p;
+ /* Note: this could be a bit field, but we need to take its address
+ in ALLOCATE_PSEUDOVECTOR (see x_scroll_bar_create). */
+ bool fringe_extended_p;
};
/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
static void select_window_1 (Lisp_Object, bool);
+static struct window *set_window_fringes (struct window *, Lisp_Object,
+ Lisp_Object, Lisp_Object);
+static struct window *set_window_margins (struct window *, Lisp_Object,
+ Lisp_Object);
+static struct window *set_window_scroll_bars (struct window *, Lisp_Object,
+ Lisp_Object, Lisp_Object);
+static void apply_window_adjustment (struct window *);
+
/* This is the window in which the terminal's cursor should
be left when nothing is being done with it. This must
always be a leaf window, and its buffer is selected by
w->display_table = val;
}
static void
-wset_left_fringe_width (struct window *w, Lisp_Object val)
-{
- w->left_fringe_width = val;
-}
-static void
-wset_left_margin_cols (struct window *w, Lisp_Object val)
-{
- w->left_margin_cols = val;
-}
-static void
wset_new_normal (struct window *w, Lisp_Object val)
{
w->new_normal = val;
w->pointm = val;
}
static void
-wset_right_fringe_width (struct window *w, Lisp_Object val)
-{
- w->right_fringe_width = val;
-}
-static void
-wset_right_margin_cols (struct window *w, Lisp_Object val)
-{
- w->right_margin_cols = val;
-}
-static void
-wset_scroll_bar_width (struct window *w, Lisp_Object val)
-{
- w->scroll_bar_width = val;
-}
-static void
wset_start (struct window *w, Lisp_Object val)
{
w->start = val;
set_buffer_internal (old_buffer);
}
else
- XSETINT (value, BUF_Z (b) - XFASTINT (w->window_end_pos));
+ XSETINT (value, BUF_Z (b) - w->window_end_pos);
return value;
}
if (NILP (noforce))
w->force_start = 1;
w->update_mode_line = 1;
- if (!EQ (window, selected_window))
+ if (w != XWINDOW (selected_window))
/* Enforce full redisplay. FIXME: make it more selective. */
windows_or_buffers_changed++;
n->phys_cursor_width = -1;
n->must_be_updated_p = 0;
n->pseudo_window_p = 0;
- wset_window_end_vpos (n, make_number (0));
- wset_window_end_pos (n, make_number (0));
+ n->window_end_vpos = 0;
+ n->window_end_pos = 0;
n->window_end_valid = 0;
}
if (WINDOW_RIGHT_MARGIN_COLS (w) > 0)
{
if (WINDOW_LEFT_MARGIN_COLS (w) > 0)
- {
- wset_left_margin_cols (w, make_number (margin_cols / 2));
- wset_right_margin_cols (w, make_number (margin_cols / 2));
- }
+ w->left_margin_cols = w->right_margin_cols = margin_cols / 2;
else
- wset_right_margin_cols (w, make_number (margin_cols));
+ w->right_margin_cols = margin_cols;
}
else
- wset_left_margin_cols (w, make_number (margin_cols));
+ w->left_margin_cols = margin_cols;
return 1;
}
\f
bset_display_count (b, make_number (XINT (BVAR (b, display_count)) + 1));
bset_display_time (b, Fcurrent_time ());
- wset_window_end_pos (w, make_number (0));
- wset_window_end_vpos (w, make_number (0));
+ w->window_end_pos = 0;
+ w->window_end_vpos = 0;
memset (&w->last_cursor, 0, sizeof w->last_cursor);
if (!(keep_margins_p && samebuf))
if (!keep_margins_p)
{
/* Set left and right marginal area width etc. from buffer. */
-
- /* This may call adjust_window_margins three times, so
- temporarily disable window margins. */
- Lisp_Object save_left = w->left_margin_cols;
- Lisp_Object save_right = w->right_margin_cols;
-
- wset_left_margin_cols (w, Qnil);
- wset_right_margin_cols (w, Qnil);
-
- Fset_window_fringes (window,
- BVAR (b, left_fringe_width), BVAR (b, right_fringe_width),
- BVAR (b, fringes_outside_margins));
-
- Fset_window_scroll_bars (window,
- BVAR (b, scroll_bar_width),
- BVAR (b, vertical_scroll_bar_type), Qnil);
-
- wset_left_margin_cols (w, save_left);
- wset_right_margin_cols (w, save_right);
-
- Fset_window_margins (window,
- BVAR (b, left_margin_cols), BVAR (b, right_margin_cols));
+ set_window_fringes (w, BVAR (b, left_fringe_width),
+ BVAR (b, right_fringe_width),
+ BVAR (b, fringes_outside_margins));
+ set_window_scroll_bars (w, BVAR (b, scroll_bar_width),
+ BVAR (b, vertical_scroll_bar_type), Qnil);
+ set_window_margins (w, BVAR (b, left_margin_cols),
+ BVAR (b, right_margin_cols));
+ apply_window_adjustment (w);
}
if (run_hooks_p)
wset_start (w, Fmake_marker ());
wset_pointm (w, Fmake_marker ());
wset_vertical_scroll_bar_type (w, Qt);
- wset_window_end_pos (w, make_number (0));
- wset_window_end_vpos (w, make_number (0));
/* These Lisp fields are marked specially so they're not set to nil by
allocate_window. */
wset_prev_buffers (w, Qnil);
/* Initialize non-Lisp data. Note that allocate_window zeroes out all
non-Lisp data, so do it only for slots which should not be zero. */
w->nrows_scale_factor = w->ncols_scale_factor = 1;
+ w->left_fringe_width = w->right_fringe_width = -1;
w->phys_cursor_type = -1;
w->phys_cursor_width = -1;
+ w->scroll_bar_width = -1;
w->column_number_displayed = -1;
/* Reset window_list. */
memset (&n->last_cursor, 0, sizeof n->last_cursor);
/* Get special geometry settings from reference window. */
- wset_left_margin_cols (n, r->left_margin_cols);
- wset_right_margin_cols (n, r->right_margin_cols);
- wset_left_fringe_width (n, r->left_fringe_width);
- wset_right_fringe_width (n, r->right_fringe_width);
+ n->left_margin_cols = r->left_margin_cols;
+ n->right_margin_cols = r->right_margin_cols;
+ n->left_fringe_width = r->left_fringe_width;
+ n->right_fringe_width = r->right_fringe_width;
n->fringes_outside_margins = r->fringes_outside_margins;
- wset_scroll_bar_width (n, r->scroll_bar_width);
+ n->scroll_bar_width = r->scroll_bar_width;
wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type);
/* Directly assign orthogonal coordinates and sizes. */
w->hscroll = XFASTINT (p->hscroll);
w->min_hscroll = XFASTINT (p->min_hscroll);
wset_display_table (w, p->display_table);
- wset_left_margin_cols (w, p->left_margin_cols);
- wset_right_margin_cols (w, p->right_margin_cols);
- wset_left_fringe_width (w, p->left_fringe_width);
- wset_right_fringe_width (w, p->right_fringe_width);
+ w->left_margin_cols = XINT (p->left_margin_cols);
+ w->right_margin_cols = XINT (p->right_margin_cols);
+ w->left_fringe_width = XINT (p->left_fringe_width);
+ w->right_fringe_width = XINT (p->right_fringe_width);
w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
- wset_scroll_bar_width (w, p->scroll_bar_width);
+ w->scroll_bar_width = XINT (p->scroll_bar_width);
wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type);
wset_dedicated (w, p->dedicated);
wset_combination_limit (w, p->combination_limit);
XSETFASTINT (p->hscroll, w->hscroll);
XSETFASTINT (p->min_hscroll, w->min_hscroll);
p->display_table = w->display_table;
- p->left_margin_cols = w->left_margin_cols;
- p->right_margin_cols = w->right_margin_cols;
- p->left_fringe_width = w->left_fringe_width;
- p->right_fringe_width = w->right_fringe_width;
+ p->left_margin_cols = make_number (w->left_margin_cols);
+ p->right_margin_cols = make_number (w->right_margin_cols);
+ p->left_fringe_width = make_number (w->left_fringe_width);
+ p->right_fringe_width = make_number (w->right_fringe_width);
p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil;
- p->scroll_bar_width = w->scroll_bar_width;
+ p->scroll_bar_width = make_number (w->scroll_bar_width);
p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
p->dedicated = w->dedicated;
p->combination_limit = w->combination_limit;
XSETWINDOW_CONFIGURATION (tem, data);
return (tem);
}
+
+/* Called after W's margins, fringes or scroll bars was adjusted. */
+
+static void
+apply_window_adjustment (struct window *w)
+{
+ eassert (w);
+ adjust_window_margins (w);
+ clear_glyph_matrix (w->current_matrix);
+ w->window_end_valid = 0;
+ windows_or_buffers_changed++;
+ adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
+}
+
\f
/***********************************************************************
Marginal Areas
***********************************************************************/
+static struct window *
+set_window_margins (struct window *w, Lisp_Object left_width,
+ Lisp_Object right_width)
+{
+ int left, right;
+
+ /* FIXME: what about margins that are too wide? */
+ left = (NILP (left_width) ? 0
+ : (CHECK_NATNUM (left_width), XINT (left_width)));
+ right = (NILP (right_width) ? 0
+ : (CHECK_NATNUM (right_width), XINT (right_width)));
+
+ if (w->left_margin_cols != left || w->right_margin_cols != right)
+ {
+ w->left_margin_cols = left;
+ w->right_margin_cols = right;
+ return w;
+ }
+ return NULL;
+}
+
DEFUN ("set-window-margins", Fset_window_margins, Sset_window_margins,
2, 3, 0,
doc: /* Set width of marginal areas of window WINDOW.
Second arg LEFT-WIDTH specifies the number of character cells to
reserve for the left marginal area. Optional third arg RIGHT-WIDTH
does the same for the right marginal area. A nil width parameter
-means no margin. */)
+means no margin.
+
+Return t if any margin was actually changed and nil otherwise. */)
(Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width)
{
- struct window *w = decode_live_window (window);
-
- /* Translate negative or zero widths to nil.
- Margins that are too wide have to be checked elsewhere. */
-
- if (!NILP (left_width))
- {
- CHECK_NUMBER (left_width);
- if (XINT (left_width) <= 0)
- left_width = Qnil;
- }
-
- if (!NILP (right_width))
- {
- CHECK_NUMBER (right_width);
- if (XINT (right_width) <= 0)
- right_width = Qnil;
- }
-
- if (!EQ (w->left_margin_cols, left_width)
- || !EQ (w->right_margin_cols, right_width))
- {
- wset_left_margin_cols (w, left_width);
- wset_right_margin_cols (w, right_width);
-
- adjust_window_margins (w);
-
- ++windows_or_buffers_changed;
- adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
- }
-
- return Qnil;
+ struct window *w = set_window_margins (decode_live_window (window),
+ left_width, right_width);
+ return w ? (apply_window_adjustment (w), Qt) : Qnil;
}
(Lisp_Object window)
{
struct window *w = decode_live_window (window);
- return Fcons (w->left_margin_cols, w->right_margin_cols);
+ return Fcons (w->left_margin_cols ? make_number (w->left_margin_cols) : Qnil,
+ w->right_margin_cols ? make_number (w->right_margin_cols) : Qnil);
}
Fringes
***********************************************************************/
+static struct window *
+set_window_fringes (struct window *w, Lisp_Object left_width,
+ Lisp_Object right_width, Lisp_Object outside_margins)
+{
+ int left, right, outside = !NILP (outside_margins);
+
+ left = (NILP (left_width) ? -1
+ : (CHECK_NATNUM (left_width), XINT (left_width)));
+ right = (NILP (right_width) ? -1
+ : (CHECK_NATNUM (right_width), XINT (right_width)));
+
+ /* Do nothing on a tty or if nothing to actually change. */
+ if (FRAME_WINDOW_P (WINDOW_XFRAME (w))
+ && (w->left_fringe_width != left
+ || w->right_fringe_width != right
+ || w->fringes_outside_margins != outside))
+ {
+ w->left_fringe_width = left;
+ w->right_fringe_width = right;
+ w->fringes_outside_margins = outside;
+ return w;
+ }
+ return NULL;
+}
+
DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
2, 4, 0,
doc: /* Set the fringe widths of window WINDOW.
the command `set-fringe-style'.
If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes
outside of the display margins. By default, fringes are drawn between
-display marginal areas and the text area. */)
- (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, Lisp_Object outside_margins)
-{
- struct window *w = decode_live_window (window);
- int outside = !NILP (outside_margins);
-
- if (!NILP (left_width))
- CHECK_NATNUM (left_width);
- if (!NILP (right_width))
- CHECK_NATNUM (right_width);
-
- /* Do nothing on a tty. */
- if (FRAME_WINDOW_P (WINDOW_XFRAME (w))
- && (!EQ (w->left_fringe_width, left_width)
- || !EQ (w->right_fringe_width, right_width)
- || w->fringes_outside_margins != outside))
- {
- wset_left_fringe_width (w, left_width);
- wset_right_fringe_width (w, right_width);
- w->fringes_outside_margins = outside;
-
- adjust_window_margins (w);
-
- clear_glyph_matrix (w->current_matrix);
- w->window_end_valid = 0;
-
- ++windows_or_buffers_changed;
- adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
- }
+display marginal areas and the text area.
- return Qnil;
+Return t if any fringe was actually changed and nil otherwise. */)
+ (Lisp_Object window, Lisp_Object left_width,
+ Lisp_Object right_width, Lisp_Object outside_margins)
+{
+ struct window *w
+ = set_window_fringes (decode_live_window (window),
+ left_width, right_width, outside_margins);
+ return w ? (apply_window_adjustment (w), Qt) : Qnil;
}
Scroll bars
***********************************************************************/
-DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
- Sset_window_scroll_bars, 2, 4, 0,
- doc: /* Set width and type of scroll bars of window WINDOW.
-WINDOW must be a live window and defaults to the selected one.
-
-Second parameter WIDTH specifies the pixel width for the scroll bar;
-this is automatically adjusted to a multiple of the frame column width.
-Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
-bar: left, right, or nil.
-If WIDTH is nil, use the frame's scroll-bar width.
-If VERTICAL-TYPE is t, use the frame's scroll-bar type.
-Fourth parameter HORIZONTAL-TYPE is currently unused. */)
- (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, Lisp_Object horizontal_type)
+static struct window *
+set_window_scroll_bars (struct window *w, Lisp_Object width,
+ Lisp_Object vertical_type, Lisp_Object horizontal_type)
{
- struct window *w = decode_live_window (window);
+ int iwidth = (NILP (width) ? -1 : (CHECK_NATNUM (width), XINT (width)));
- if (!NILP (width))
- {
- CHECK_RANGED_INTEGER (width, 0, INT_MAX);
-
- if (XINT (width) == 0)
- vertical_type = Qnil;
- }
+ if (iwidth == 0)
+ vertical_type = Qnil;
if (!(NILP (vertical_type)
|| EQ (vertical_type, Qleft)
|| EQ (vertical_type, Qt)))
error ("Invalid type of vertical scroll bar");
- if (!EQ (w->scroll_bar_width, width)
+ if (w->scroll_bar_width != iwidth
|| !EQ (w->vertical_scroll_bar_type, vertical_type))
{
- wset_scroll_bar_width (w, width);
+ w->scroll_bar_width = iwidth;
wset_vertical_scroll_bar_type (w, vertical_type);
+ return w;
+ }
+ return NULL;
+}
- adjust_window_margins (w);
-
- clear_glyph_matrix (w->current_matrix);
- w->window_end_valid = 0;
+DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
+ Sset_window_scroll_bars, 2, 4, 0,
+ doc: /* Set width and type of scroll bars of window WINDOW.
+WINDOW must be a live window and defaults to the selected one.
- ++windows_or_buffers_changed;
- adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
- }
+Second parameter WIDTH specifies the pixel width for the scroll bar;
+this is automatically adjusted to a multiple of the frame column width.
+Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
+bar: left, right, or nil.
+If WIDTH is nil, use the frame's scroll-bar width.
+If VERTICAL-TYPE is t, use the frame's scroll-bar type.
+Fourth parameter HORIZONTAL-TYPE is currently unused.
- return Qnil;
+Return t if scroll bars was actually changed and nil otherwise. */)
+ (Lisp_Object window, Lisp_Object width,
+ Lisp_Object vertical_type, Lisp_Object horizontal_type)
+{
+ struct window *w
+ = set_window_scroll_bars (decode_live_window (window),
+ width, vertical_type, horizontal_type);
+ return w ? (apply_window_adjustment (w), Qt) : Qnil;
}
it yet, or if the frame doesn't have any scroll bars, this is nil. */
Lisp_Object vertical_scroll_bar;
- /* Width of left and right marginal areas. A value of nil means
- no margin. */
- Lisp_Object left_margin_cols;
- Lisp_Object right_margin_cols;
-
- /* Width of left and right fringes.
- A value of nil or t means use frame values. */
- Lisp_Object left_fringe_width;
- Lisp_Object right_fringe_width;
-
- /* Pixel width of scroll bars.
- A value of nil or t means use frame values. */
- Lisp_Object scroll_bar_width;
-
/* Type of vertical scroll bar. A value of nil means
no scroll bar. A value of t means use frame value. */
Lisp_Object vertical_scroll_bar_type;
- /* Z - the buffer position of the last glyph in the current
- matrix of W. Only valid if window_end_valid is nonzero. */
- Lisp_Object window_end_pos;
-
- /* Glyph matrix row of the last glyph in the current matrix
- of W. Only valid if window_end_valid is nonzero. */
- Lisp_Object window_end_vpos;
-
/* Display-table to use for displaying chars in this window.
Nil means use the buffer's own display-table. */
Lisp_Object display_table;
/* This is handy for undrawing the cursor. */
int phys_cursor_ascent, phys_cursor_height;
+ /* Width of left and right fringes, in pixels.
+ A value of -1 means use frame values. */
+ int left_fringe_width;
+ int right_fringe_width;
+
+ /* Width of left and right marginal areas in columns.
+ A value of 0 means no margin. */
+ int left_margin_cols;
+ int right_margin_cols;
+
+ /* Pixel width of scroll bars.
+ A value of -1 means use frame values. */
+ int scroll_bar_width;
+
+ /* Z - the buffer position of the last glyph in the current
+ matrix of W. Only valid if window_end_valid is nonzero. */
+ ptrdiff_t window_end_pos;
+
+ /* Glyph matrix row of the last glyph in the current matrix
+ of W. Only valid if window_end_valid is nonzero. */
+ int window_end_vpos;
+
/* Non-zero if this window is a minibuffer window. */
unsigned mini : 1;
w->vertical_scroll_bar = val;
}
WINDOW_INLINE void
-wset_window_end_pos (struct window *w, Lisp_Object val)
-{
- w->window_end_pos = val;
-}
-WINDOW_INLINE void
-wset_window_end_vpos (struct window *w, Lisp_Object val)
-{
- w->window_end_vpos = val;
-}
-WINDOW_INLINE void
wset_prev_buffers (struct window *w, Lisp_Object val)
{
w->prev_buffers = val;
/* Width of left margin area in columns. */
-#define WINDOW_LEFT_MARGIN_COLS(W) \
- (NILP (W->left_margin_cols) \
- ? 0 \
- : XINT (W->left_margin_cols))
+#define WINDOW_LEFT_MARGIN_COLS(W) (W->left_margin_cols)
/* Width of right marginal area in columns. */
-#define WINDOW_RIGHT_MARGIN_COLS(W) \
- (NILP (W->right_margin_cols) \
- ? 0 \
- : XINT (W->right_margin_cols))
+#define WINDOW_RIGHT_MARGIN_COLS(W) (W->right_margin_cols)
/* Width of left margin area in pixels. */
-#define WINDOW_LEFT_MARGIN_WIDTH(W) \
- (NILP (W->left_margin_cols) \
- ? 0 \
- : (XINT (W->left_margin_cols) \
- * WINDOW_FRAME_COLUMN_WIDTH (W)))
+#define WINDOW_LEFT_MARGIN_WIDTH(W) \
+ (W->left_margin_cols * WINDOW_FRAME_COLUMN_WIDTH (W))
/* Width of right marginal area in pixels. */
-#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
- (NILP (W->right_margin_cols) \
- ? 0 \
- : (XINT (W->right_margin_cols) \
- * WINDOW_FRAME_COLUMN_WIDTH (W)))
+#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
+ (W->right_margin_cols * WINDOW_FRAME_COLUMN_WIDTH (W))
/* Total width of fringes reserved for drawing truncation bitmaps,
continuation bitmaps and alike. The width is in canonical char
able to split windows horizontally nicely. */
#define WINDOW_FRINGE_COLS(W) \
- ((INTEGERP (W->left_fringe_width) \
- || INTEGERP (W->right_fringe_width)) \
- ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \
- + WINDOW_RIGHT_FRINGE_WIDTH (W) \
+ ((W->left_fringe_width >= 0 \
+ && W->right_fringe_width >= 0) \
+ ? ((W->left_fringe_width \
+ + W->right_fringe_width \
+ WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
/ WINDOW_FRAME_COLUMN_WIDTH (W)) \
: FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
/* Pixel-width of the left and right fringe. */
#define WINDOW_LEFT_FRINGE_WIDTH(W) \
- (INTEGERP (W->left_fringe_width) \
- ? XFASTINT (W->left_fringe_width) \
+ (W->left_fringe_width >= 0 ? W->left_fringe_width \
: FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
- (INTEGERP (W->right_fringe_width) \
- ? XFASTINT (W->right_fringe_width) \
+ (W->right_fringe_width >= 0 ? W->right_fringe_width \
: FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
/* Total width of fringes in pixels. */
nonzero. */
#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
- (INTEGERP (w->scroll_bar_width) \
- ? XFASTINT (w->scroll_bar_width) \
+ (w->scroll_bar_width >= 0 ? w->scroll_bar_width \
: FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
/* Width that a scroll bar in window W should have, if there is one.
this is still nonzero. */
#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
- (INTEGERP (w->scroll_bar_width) \
- ? ((XFASTINT (w->scroll_bar_width) \
+ (w->scroll_bar_width >= 0 \
+ ? ((w->scroll_bar_width \
+ WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \
/ WINDOW_FRAME_COLUMN_WIDTH (w)) \
: FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
(window_box_left ((W), TEXT_AREA) + (X))
-/* This is the window in which the terminal's cursor should
- be left when nothing is being done with it. This must
- always be a leaf window, and its buffer is selected by
- the top level editing loop at the end of each command.
+/* Nonzero if the background of the window W's fringe that is adjacent to
+ a scroll bar is extended to the gap between the fringe and the bar. */
+
+#define WINDOW_FRINGE_EXTENDED_P(w) \
+ (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
+ ? (WINDOW_LEFTMOST_P (w) \
+ && WINDOW_LEFT_FRINGE_WIDTH (w) \
+ && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) \
+ || WINDOW_LEFT_MARGIN_COLS (w) == 0)) \
+ : (WINDOW_RIGHTMOST_P (w) \
+ && WINDOW_RIGHT_FRINGE_WIDTH (w) \
+ && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) \
+ || WINDOW_RIGHT_MARGIN_COLS (w) == 0)))
- This value is always the same as
- FRAME_SELECTED_WINDOW (selected_frame). */
+/* This is the window in which the terminal's cursor should be left when
+ nothing is being done with it. This must always be a leaf window, and its
+ buffer is selected by the top level editing loop at the end of each command.
+
+ This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */
extern Lisp_Object selected_window;
extern int windows_or_buffers_changed;
-/* Nonzero means a frame's cursor type has been changed. */
-
-extern int cursor_type_changed;
-
/* If *ROWS or *COLS are too small a size for FRAME, set them to the
minimum allowable size. */
/* Nonzero means a frame's cursor type has been changed. */
-int cursor_type_changed;
+static int cursor_type_changed;
/* Nonzero after display_mode_line if %l was used and it displayed a
line number. */
if (area == TEXT_AREA)
{
- if (INTEGERP (w->left_margin_cols))
- cols -= XFASTINT (w->left_margin_cols);
- if (INTEGERP (w->right_margin_cols))
- cols -= XFASTINT (w->right_margin_cols);
+ cols -= max (0, w->left_margin_cols);
+ cols -= max (0, w->right_margin_cols);
pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w);
}
else if (area == LEFT_MARGIN_AREA)
{
- cols = (INTEGERP (w->left_margin_cols)
- ? XFASTINT (w->left_margin_cols) : 0);
+ cols = max (0, w->left_margin_cols);
pixels = 0;
}
else if (area == RIGHT_MARGIN_AREA)
{
- cols = (INTEGERP (w->right_margin_cols)
- ? XFASTINT (w->right_margin_cols) : 0);
+ cols = max (0, w->right_margin_cols);
pixels = 0;
}
}
#endif /* HAVE_WINDOW_SYSTEM */
-\f
+static void
+adjust_window_ends (struct window *w, struct glyph_row *row, bool current)
+{
+ eassert (w);
+ w->window_end_pos = Z - MATRIX_ROW_END_CHARPOS (row);
+ w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
+ w->window_end_vpos
+ = MATRIX_ROW_VPOS (row, current ? w->current_matrix : w->desired_matrix);
+}
+
/***********************************************************************
Lisp form evaluation
***********************************************************************/
if (!MINI_WINDOW_P (w) && w->window_end_valid)
{
struct glyph_row *row;
- eassert ((row = MATRIX_ROW (w->current_matrix,
- XFASTINT (w->window_end_vpos)),
+ eassert ((row = MATRIX_ROW (w->current_matrix, w->window_end_vpos),
!row->enabled_p
|| MATRIX_ROW_DISPLAYS_TEXT_P (row)
|| MATRIX_ROW_VPOS (row, w->current_matrix) == 0));
next_element_from_display_vector (struct it *it)
{
Lisp_Object gc;
+ int prev_face_id = it->face_id;
+ int next_face_id;
/* Precondition. */
eassert (it->dpvec && it->current.dpvec_index >= 0);
if (GLYPH_CODE_P (gc))
{
+ struct face *this_face, *prev_face, *next_face;
+
it->c = GLYPH_CODE_CHAR (gc);
it->len = CHAR_BYTES (it->c);
it->face_id = merge_faces (it->f, Qt, lface_id,
it->saved_face_id);
}
+
+ /* Glyphs in the display vector could have the box face, so we
+ need to set the related flags in the iterator, as
+ appropriate. */
+ this_face = FACE_FROM_ID (it->f, it->face_id);
+ prev_face = FACE_FROM_ID (it->f, prev_face_id);
+
+ /* Is this character the first character of a box-face run? */
+ it->start_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX
+ && (!prev_face
+ || prev_face->box == FACE_NO_BOX));
+
+ /* For the last character of the box-face run, we need to look
+ either at the next glyph from the display vector, or at the
+ face we saw before the display vector. */
+ next_face_id = it->saved_face_id;
+ if (it->current.dpvec_index < it->dpend - it->dpvec - 1)
+ {
+ if (it->dpvec_face_id >= 0)
+ next_face_id = it->dpvec_face_id;
+ else
+ {
+ int lface_id =
+ GLYPH_CODE_FACE (it->dpvec[it->current.dpvec_index + 1]);
+
+ if (lface_id > 0)
+ next_face_id = merge_faces (it->f, Qt, lface_id,
+ it->saved_face_id);
+ }
+ }
+ next_face = FACE_FROM_ID (it->f, next_face_id);
+ it->end_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX
+ && (!next_face
+ || next_face->box == FACE_NO_BOX));
+ it->face_box_p = this_face && this_face->box != FACE_NO_BOX;
}
else
/* Display table entry is invalid. Return a space. */
&& it->current_x == it->last_visible_x - 1
&& it->c != '\n'
&& it->c != '\t'
- && it->vpos < XFASTINT (it->w->window_end_vpos))
+ && it->vpos < it->w->window_end_vpos)
{
it->continuation_lines_width += it->current_x;
it->current_x = it->hpos = it->max_ascent = it->max_descent = 0;
adjusted. */
if (MATRIX_ROW_DISPLAYS_TEXT_P (it.glyph_row - 1))
{
- if (XFASTINT (w->window_end_vpos) < this_line_vpos)
- wset_window_end_vpos (w, make_number (this_line_vpos));
+ if (w->window_end_vpos < this_line_vpos)
+ w->window_end_vpos = this_line_vpos;
}
- else if (XFASTINT (w->window_end_vpos) == this_line_vpos
+ else if (w->window_end_vpos == this_line_vpos
&& this_line_vpos > 0)
- wset_window_end_vpos (w, make_number (this_line_vpos - 1));
+ w->window_end_vpos = this_line_vpos - 1;
w->window_end_valid = 0;
/* Update hint: No need to try to scroll in update_window. */
{
min_distance = distance;
pos = it.current.pos;
- move_it_by_lines (&it, 1);
+ if (it.line_wrap == WORD_WRAP)
+ {
+ /* Under WORD_WRAP, move_it_by_lines is likely to
+ overshoot and stop not at the first, but the
+ second character from the left margin. So in
+ that case, we need a more tight control on the X
+ coordinate of the iterator than move_it_by_lines
+ promises in its contract. The method is to first
+ go to the last (rightmost) visible character of a
+ line, then move to the leftmost character on the
+ next line in a separate call. */
+ move_it_to (&it, ZV, it.last_visible_x, it.current_y, -1,
+ MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
+ move_it_to (&it, ZV, 0,
+ it.current_y + it.max_ascent + it.max_descent, -1,
+ MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
+ }
+ else
+ move_it_by_lines (&it, 1);
}
/* Set the window start there. */
if-statement below. Now, this field is converted to
ptrdiff_t, thus zero means invalid position in a buffer. */
eassert (w->last_point > 0);
+ /* Likewise there was a check whether window_end_vpos is nil or larger
+ than the window. Now window_end_vpos is int and so never nil, but
+ let's leave eassert to check whether it fits in the window. */
+ eassert (w->window_end_vpos < w->current_matrix->nrows);
/* Handle case where text has not changed, only point, and it has
not moved off the frame. */
since the handling of this_line_start_pos, etc., in redisplay
handles the same cases. */
&& !EQ (window, minibuf_window)
- /* When splitting windows or for new windows, it happens that
- redisplay is called with a nil window_end_vpos or one being
- larger than the window. This should really be fixed in
- window.c. I don't have this on my list, now, so we do
- approximately the same as the old redisplay code. --gerd. */
- && INTEGERP (w->window_end_vpos)
- && XFASTINT (w->window_end_vpos) < w->current_matrix->nrows
&& (FRAME_WINDOW_P (f)
|| !overlay_arrow_in_current_buffer_p ()))
{
start = marker_position (w->start) - BUF_BEGV (buf);
/* I don't think this is guaranteed to be right. For the
moment, we'll pretend it is. */
- end = BUF_Z (buf) - XFASTINT (w->window_end_pos) - BUF_BEGV (buf);
+ end = BUF_Z (buf) - w->window_end_pos - BUF_BEGV (buf);
if (end < start)
end = start;
&& !current_buffer->clip_changed
&& !window_outdated (w));
- /* When windows_or_buffers_changed is non-zero, we can't rely on
- the window end being valid, so set it to nil there. */
+ /* When windows_or_buffers_changed is non-zero, we can't rely
+ on the window end being valid, so set it to zero there. */
if (windows_or_buffers_changed)
{
/* If window starts on a continuation line, maybe adjust the
compute_window_start_on_continuation_line (w);
w->window_end_valid = 0;
+ /* If so, we also can't rely on current matrix
+ and should not fool try_cursor_movement below. */
+ current_matrix_up_to_date_p = 0;
}
/* Some sanity checks. */
line.) */
if (w->cursor.vpos < 0)
{
- if (w->window_end_valid && PT >= Z - XFASTINT (w->window_end_pos))
+ if (w->window_end_valid && PT >= Z - w->window_end_pos)
{
clear_glyph_matrix (w->desired_matrix);
move_it_by_lines (&it, 1);
}
/* If bottom moved off end of frame, change mode line percentage. */
- if (XFASTINT (w->window_end_pos) <= 0
- && Z != IT_CHARPOS (it))
+ if (w->window_end_pos <= 0 && Z != IT_CHARPOS (it))
w->update_mode_line = 1;
/* Set window_end_pos to the offset of the last character displayed
if (last_text_row)
{
eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row));
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- wset_window_end_pos
- (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
+ adjust_window_ends (w, last_text_row, 0);
eassert
(MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->desired_matrix,
- XFASTINT (w->window_end_vpos))));
+ w->window_end_vpos)));
}
else
{
w->window_end_bytepos = Z_BYTE - ZV_BYTE;
- wset_window_end_pos (w, make_number (Z - ZV));
- wset_window_end_vpos (w, make_number (0));
+ w->window_end_pos = Z - ZV;
+ w->window_end_vpos = 0;
}
/* But that is not valid info until redisplay finishes. */
The value of last_text_row is the last displayed line
containing text. */
if (last_reused_text_row)
- {
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row);
- wset_window_end_pos
- (w, make_number (Z
- - MATRIX_ROW_END_CHARPOS (last_reused_text_row)));
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (last_reused_text_row,
- w->current_matrix)));
- }
+ adjust_window_ends (w, last_reused_text_row, 1);
else if (last_text_row)
- {
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- wset_window_end_pos
- (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (last_text_row,
- w->desired_matrix)));
- }
+ adjust_window_ends (w, last_text_row, 0);
else
{
/* This window must be completely empty. */
w->window_end_bytepos = Z_BYTE - ZV_BYTE;
- wset_window_end_pos (w, make_number (Z - ZV));
- wset_window_end_vpos (w, make_number (0));
+ w->window_end_pos = Z - ZV;
+ w->window_end_vpos = 0;
}
w->window_end_valid = 0;
the window end is in reused rows which in turn means that
only its vpos can have changed. */
if (last_text_row)
- {
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- wset_window_end_pos
- (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (last_text_row,
- w->desired_matrix)));
- }
+ adjust_window_ends (w, last_text_row, 0);
else
- {
- wset_window_end_vpos
- (w, make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled));
- }
+ w->window_end_vpos -= nrows_scrolled;
w->window_end_valid = 0;
w->desired_matrix->no_scrolling_p = 1;
/* A value of window_end_pos >= END_UNCHANGED means that the window
end is in the range of changed text. If so, there is no
unchanged row at the end of W's current matrix. */
- if (XFASTINT (w->window_end_pos) >= END_UNCHANGED)
+ if (w->window_end_pos >= END_UNCHANGED)
return NULL;
/* Set row to the last row in W's current matrix displaying text. */
- row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
+ row = MATRIX_ROW (w->current_matrix, w->window_end_vpos);
/* If matrix is entirely empty, no unchanged row exists. */
if (MATRIX_ROW_DISPLAYS_TEXT_P (row))
buffer positions in the current matrix to current buffer
positions for characters not in changed text. */
ptrdiff_t Z_old =
- MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
+ MATRIX_ROW_END_CHARPOS (row) + w->window_end_pos;
ptrdiff_t Z_BYTE_old =
MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
ptrdiff_t last_unchanged_pos, last_unchanged_pos_old;
This case happens with stealth-fontification. Note that although
the display is unchanged, glyph positions in the matrix have to
be adjusted, of course. */
- row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
+ row = MATRIX_ROW (w->current_matrix, w->window_end_vpos);
if (MATRIX_ROW_DISPLAYS_TEXT_P (row)
&& ((last_changed_charpos < CHARPOS (start)
&& CHARPOS (start) == BEGV)
/* Compute how many chars/bytes have been added to or removed
from the buffer. */
- Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
+ Z_old = MATRIX_ROW_END_CHARPOS (row) + w->window_end_pos;
Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
Z_delta = Z - Z_old;
Z_delta_bytes = Z_BYTE - Z_BYTE_old;
{
/* We have to compute the window end anew since text
could have been added/removed after it. */
- wset_window_end_pos
- (w, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
+ w->window_end_pos = Z - MATRIX_ROW_END_CHARPOS (row);
+ w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
/* Set the cursor. */
row = row_containing_pos (w, PT, r0, NULL, 0);
/* Give up if the window ends in strings. Overlay strings
at the end are difficult to handle, so don't try. */
- row = MATRIX_ROW (current_matrix, XFASTINT (w->window_end_vpos));
+ row = MATRIX_ROW (current_matrix, w->window_end_vpos);
if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row))
GIVE_UP (20);
/* Set last_row to the glyph row in the current matrix where the
window end line is found. It has been moved up or down in
the matrix by dvpos. */
- int last_vpos = XFASTINT (w->window_end_vpos) + dvpos;
+ int last_vpos = w->window_end_vpos + dvpos;
struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos);
/* If last_row is the window end line, it should display text. */
}
/* Update window_end_pos and window_end_vpos. */
- if (first_unchanged_at_end_row
- && !last_text_row_at_end)
+ if (first_unchanged_at_end_row && !last_text_row_at_end)
{
/* Window end line if one of the preserved rows from the current
matrix. Set row to the last row displaying text in current
row = find_last_row_displaying_text (w->current_matrix, &it,
first_unchanged_at_end_row);
eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row));
-
- wset_window_end_pos (w, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
- w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (row, w->current_matrix)));
+ adjust_window_ends (w, row, 1);
eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "A"));
}
else if (last_text_row_at_end)
{
- wset_window_end_pos
- (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)));
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end);
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (last_text_row_at_end,
- desired_matrix)));
+ adjust_window_ends (w, last_text_row_at_end, 0);
eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "B"));
}
/* We have displayed either to the end of the window or at the
end of the window, i.e. the last row with text is to be found
in the desired matrix. */
- wset_window_end_pos
- (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
- w->window_end_bytepos
- = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- wset_window_end_vpos
- (w, make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)));
+ adjust_window_ends (w, last_text_row, 0);
eassert (w->window_end_bytepos >= 0);
}
else if (first_unchanged_at_end_row == NULL
/* Displayed to end of window, but no line containing text was
displayed. Lines were deleted at the end of the window. */
int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
- int vpos = XFASTINT (w->window_end_vpos);
+ int vpos = w->window_end_vpos;
struct glyph_row *current_row = current_matrix->rows + vpos;
struct glyph_row *desired_row = desired_matrix->rows + vpos;
}
eassert (row != NULL);
- wset_window_end_vpos (w, make_number (vpos + 1));
- wset_window_end_pos (w, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
+ w->window_end_vpos = vpos + 1;
+ w->window_end_pos = Z - MATRIX_ROW_END_CHARPOS (row);
w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "C"));
else
emacs_abort ();
- IF_DEBUG (debug_end_pos = XFASTINT (w->window_end_pos);
- debug_end_vpos = XFASTINT (w->window_end_vpos));
+ IF_DEBUG (debug_end_pos = w->window_end_pos;
+ debug_end_vpos = w->window_end_vpos);
/* Record that display has not been completed. */
w->window_end_valid = 0;
ptrdiff_t pos = marker_position (w->start);
ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
- if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b))
+ if (w->window_end_pos <= BUF_Z (b) - BUF_ZV (b))
{
if (pos <= BUF_BEGV (b))
return "All";
case 'P':
{
ptrdiff_t toppos = marker_position (w->start);
- ptrdiff_t botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
+ ptrdiff_t botpos = BUF_Z (b) - w->window_end_pos;
ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
if (botpos >= BUF_ZV (b))
}
else
FRAME_BLINK_OFF_CURSOR (f) = DEFAULT_CURSOR;
+
+ /* Make sure the cursor gets redrawn. */
+ cursor_type_changed = 1;
}
/* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */
rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2);
if (r1 == NULL)
- r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
+ r1 = MATRIX_ROW (w->current_matrix, w->window_end_vpos);
/* If the before-string or display-string contains newlines,
rows_from_pos_range skips to its last row. Move back. */
if (!NILP (before_string) || !NILP (disp_string))
}
if (r2 == NULL)
{
- r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
+ r2 = MATRIX_ROW (w->current_matrix, w->window_end_vpos);
hlinfo->mouse_face_past_end = 1;
}
else if (!NILP (after_string))
/* If the after-string has newlines, advance to its last row. */
struct glyph_row *next;
struct glyph_row *last
- = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
+ = MATRIX_ROW (w->current_matrix, w->window_end_vpos);
for (next = r2 + 1;
next <= last
: Qnil;
Lisp_Object lim2 =
NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
- ? make_number (BUF_Z (XBUFFER (buffer))
- - XFASTINT (w->window_end_pos))
+ ? make_number (BUF_Z (XBUFFER (buffer)) - w->window_end_pos)
: Qnil;
if (NILP (overlay))
if (clear_fonts_p
|| ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT)
{
-#if 0
- /* Not yet implemented. */
- clear_font_cache (frame);
-#endif
-
/* From time to time see if we can unload some fonts. This also
frees all realized faces on all frames. Fonts needed by
faces will be loaded again when faces are realized again. */
struct frame *f = XFRAME (frame);
if (FRAME_WINDOW_P (f)
&& FRAME_X_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS)
- free_all_realized_faces (frame);
+ {
+ clear_font_cache (f);
+ free_all_realized_faces (frame);
+ }
}
}
else
x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
-
- /* Make sure the cursor gets redrawn. */
- cursor_type_changed = 1;
}
-\f
+
static void
x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int top, height, left, sb_left, width, sb_width;
int window_y, window_height;
#ifdef USE_TOOLKIT_SCROLL_BARS
- int fringe_extended_p;
+ bool fringe_extended_p;
#endif
/* Get window dimensions. */
#endif
#ifdef USE_TOOLKIT_SCROLL_BARS
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- fringe_extended_p = (WINDOW_LEFTMOST_P (w)
- && WINDOW_LEFT_FRINGE_WIDTH (w)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- || WINDOW_LEFT_MARGIN_COLS (w) == 0));
- else
- fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
- && WINDOW_RIGHT_FRINGE_WIDTH (w)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+ fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
#endif
/* Does the scroll bar exist yet? */
dpyinfo->display = dpy;
/* Set the name of the terminal. */
- terminal->name = xmalloc (SBYTES (display_name) + 1);
- memcpy (terminal->name, SSDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
+ terminal->name = xlispstrdup (display_name);
#if 0
XSetAfterFunction (x_current_display, x_trace_wire);
select_visual (dpyinfo);
dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen);
dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen);
- dpyinfo->client_leader_window = 0;
- dpyinfo->grabbed = 0;
- dpyinfo->reference_count = 0;
dpyinfo->icon_bitmap_id = -1;
- dpyinfo->n_fonts = 0;
- dpyinfo->bitmaps = 0;
- dpyinfo->bitmaps_size = 0;
- dpyinfo->bitmaps_last = 0;
- dpyinfo->scratch_cursor_gc = 0;
- hlinfo->mouse_face_mouse_frame = 0;
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
hlinfo->mouse_face_window = Qnil;
hlinfo->mouse_face_overlay = Qnil;
- hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
- hlinfo->mouse_face_defer = 0;
- hlinfo->mouse_face_hidden = 0;
- dpyinfo->x_focus_frame = 0;
- dpyinfo->x_focus_event_frame = 0;
- dpyinfo->x_highlight_frame = 0;
dpyinfo->wm_type = X_WMTYPE_UNKNOWN;
/* See if we can construct pixel values from RGB values. */
- dpyinfo->red_bits = dpyinfo->blue_bits = dpyinfo->green_bits = 0;
- dpyinfo->red_offset = dpyinfo->blue_offset = dpyinfo->green_offset = 0;
-
if (dpyinfo->visual->class == TrueColor)
{
get_bits_and_offset (dpyinfo->visual->red_mask,
}
dpyinfo->x_dnd_atoms_size = 8;
- dpyinfo->x_dnd_atoms_length = 0;
dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms
* dpyinfo->x_dnd_atoms_size);
- dpyinfo->net_supported_atoms = NULL;
- dpyinfo->nr_net_supported_atoms = 0;
- dpyinfo->net_supported_window = 0;
-
connection = ConnectionNumber (dpyinfo->display);
dpyinfo->connection = connection;
dpyinfo->gray
/* 1 if the background of the fringe that is adjacent to a scroll
bar is extended to the gap between the fringe and the bar. */
- unsigned int fringe_extended_p : 1;
+ unsigned fringe_extended_p : 1;
};
/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
+2013-08-14 Daniel Hackney <dan@haxney.org>
+
+ * package-test.el: Remove tar-package-building functions. Tar file
+ used for testing is included in the repository.
+ (package-test-install-texinfo, package-test-cleanup-built-files):
+ Remove.
+
+2013-08-13 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * automated/python-tests.el (python-imenu-create-index-4)
+ (python-imenu-create-flat-index-2): New tests.
+
2013-08-05 Glenn Morris <rgm@gnu.org>
* automated/mule-util.el: New file, with tests extracted from
(expand-file-name "archive-contents" package-test-data-dir)
"Path to a static copy of \"archive-contents\".")
-(defvar package-test-built-file-suffixes '(".tar" "/dir" "/*.info")
- "Remove these files when cleaning up a built package.")
-
(cl-defmacro with-package-test ((&optional &key file
basedir
install
(let ((help-xref-following t))
,@body)))
-(autoload 'makeinfo-buffer "makeinfo")
-(defvar compilation-in-progress)
-
-(defun package-test-install-texinfo (file)
- "Install from texinfo FILE.
-
-FILE should be a .texinfo file relative to the current
-`default-directory'"
- (require 'info)
- (let* ((full-file (expand-file-name file))
- (info-file (replace-regexp-in-string "\\.texi\\'" ".info" full-file))
- (old-info-defn (symbol-function 'Info-revert-find-node)))
- (require 'info)
- (setf (symbol-function 'Info-revert-find-node) #'ignore)
- (with-current-buffer (find-file-literally full-file)
- (unwind-protect
- (progn
- (makeinfo-buffer)
- ;; Give `makeinfo-buffer' a chance to finish
- (while compilation-in-progress
- (sit-for 0.1))
- (call-process "ginstall-info" nil nil nil
- (format "--info-dir=%s" default-directory)
- (format "%s" info-file)))
- (kill-buffer)
- (setf (symbol-function 'Info-revert-find-node) old-info-defn)))))
-
(defun package-test-strip-version (dir)
(replace-regexp-in-string "-pkg\\.el\\'" "" (package--description-file dir)))
'(lambda (item) (file-expand-wildcards (concat base item)))
suffix-list))
-(defun package-test-cleanup-built-files (dir)
- "Remove files which were the result of creating a tar archive.
-
-DIR is the base name of the package directory, without the trailing slash"
- (let* ((pkg-dirname (file-name-nondirectory dir)))
- (dolist (file (package-test-suffix-matches dir package-test-built-file-suffixes))
- (delete-file file))))
-
(defvar tar-parse-info)
(declare-function tar-header-name "tar-mode" (cl-x) t) ; defstruct
(cons "foo2 (def)" (copy-marker 77)))))
(python-imenu-create-index)))))
+(ert-deftest python-imenu-create-index-4 ()
+ (python-tests-with-temp-buffer
+ "
+class Foo(object):
+ class Bar(object):
+ def __init__(self):
+ pass
+
+ def __str__(self):
+ pass
+
+ def __init__(self):
+ pass
+"
+ (goto-char (point-max))
+ (should (equal
+ (list
+ (list
+ "Foo (class)"
+ (cons "*class definition*" (copy-marker 2))
+ (list
+ "Bar (class)"
+ (cons "*class definition*" (copy-marker 21))
+ (cons "__init__ (def)" (copy-marker 44))
+ (cons "__str__ (def)" (copy-marker 90)))
+ (cons "__init__ (def)" (copy-marker 135))))
+ (python-imenu-create-index)))))
+
(ert-deftest python-imenu-create-flat-index-1 ()
(python-tests-with-temp-buffer
"
(cons "Baz.Frob.c" (copy-marker 626)))
(python-imenu-create-flat-index)))))
+(ert-deftest python-imenu-create-flat-index-2 ()
+ (python-tests-with-temp-buffer
+ "
+class Foo(object):
+ class Bar(object):
+ def __init__(self):
+ pass
+
+ def __str__(self):
+ pass
+
+ def __init__(self):
+ pass
+"
+ (goto-char (point-max))
+ (should (equal
+ (list
+ (cons "Foo" (copy-marker 2))
+ (cons "Foo.Bar" (copy-marker 21))
+ (cons "Foo.Bar.__init__" (copy-marker 44))
+ (cons "Foo.Bar.__str__" (copy-marker 90))
+ (cons "Foo.__init__" (copy-marker 135)))
+ (python-imenu-create-flat-index)))))
+
\f
;;; Misc helpers