merge from trunk

This commit is contained in:
Tom Tromey 2013-06-13 11:29:06 -06:00
commit 5ccb7e7b1e
131 changed files with 3946 additions and 1848 deletions

2
.gitignore vendored
View file

@ -10,8 +10,10 @@ lib/Makefile.in
src/config.in
autom4te.cache
makefile
TAGS
*~
/README.W32
/bin/
/site-lisp/
/leim/ja-dic/

View file

@ -1,8 +1,45 @@
2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
--without-all should imply --with-file-notification=no. (Bug#14569)
* configure.ac (with_file_notification): Default to $with_features.
2013-06-09 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:
2013-06-02 sig2str: port to C++
2013-05-29 c-ctype, regex, verify: port to gcc -std=c90 -pedantic
2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
* configure.ac (HAVE_GLIB): Only set XGSELOBJ if HAVE_NS = no.
(with_file_notification): Don't set to gfile if with_ns = yes.
2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
* Makefile.in (msys_to_w32): Modify to support d:\foo file names.
(msys_lisppath_to_w32, msys_prefix_subst, msys_sed_sh_escape):
New variables.
(epaths-force-w32): Use them. (Bug#14513)
2013-06-03 Michael Albinus <michael.albinus@gmx.de>
* configure.ac (HAVE_GFILENOTIFY): Check for gio >= 2.24.
2013-06-03 Eli Zaretskii <eliz@gnu.org>
* configure.ac (HAVE_GFILENOTIFY): Do not change $LIBS.
(GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): Substitute.
2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
* configure.ac (HAVE_GLIB): Add GLib check. Set XGSELOBJ if GLib is
used. Remove xgselect.o from XOBJ.
2013-06-03 Michael Albinus <michael.albinus@gmx.de>
* configure.ac (file-notification): New option, replaces inotify option.
(HAVE_W32): Remove w32notify.o.
(with_file_notification): Add checks for glib and w32. Adapt check
(with_file_notification): Add checks for glib and w32. Adapt check
for inotify.
(Summary): Add entry for file notification.
@ -92,7 +129,7 @@
2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
* configure.ac: Remove -with-acl option, since Gnulib does that for
us now.
(LIBACL_LIBS): Remove; no longer needed.
@ -464,7 +501,7 @@
2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
Fix permissions bugs with setgid directories etc. (Bug#13125)
Fix permissions bugs with setgid directories etc. (Bug#13125)
* configure.ac (BSD4_2): Remove; no longer needed.
2012-12-13 Glenn Morris <rgm@gnu.org>
@ -2154,7 +2191,7 @@
2012-02-05 Christoph Scholtes <cschol2112@googlemail.com>
* make-dist (README.W32): Include file in source tarball. (Bug#9750)
* make-dist (README.W32): Include file in source tarball. (Bug#9750)
* lib/makefile.w32-in (PRAGMA_SYSTEM_HEADER): Move to platform
specific makefiles to support getopt_.h generation with MSVC.

View file

@ -318,14 +318,37 @@ epaths-force: FRC
-e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
# Convert MSYS-style /x/foo file name into x:/foo that Windows can grok.
msys_to_w32=sed -e 's,^/\([A-Za-z]\)/,\1:/,'
# Convert MSYS-style /x/foo or Windows-style x:\foo file names
# into x:/foo that Windows can grok.
msys_to_w32=sed -e 's,\\\\,/,g' -e 's,^/\([A-Za-z]\)/,\1:/,'
# Transform directory search path and its components. Original can
# be MSYS or Windows style. Set path separator to ";", directory
# separator to "/" and transform MSYS-style "/c/" to "c:/".
# Remove empty path components and escape semicolons.
msys_lisppath_to_w32=sed -e 's,\\\\,/,g' \
-e 's,\(^\|[:;]\)\([A-Za-z]\):/,\1/\2/,g' \
-e 's/:/;/g' -e 's,\(^\|;\)/\([A-Za-z]\)/,\1\2:/,g' \
-e 's/;\+/;/g' -e 's/^;//' -e 's/;$$//' -e 's/;/\\\\;/g'
# Replace "${prefix}" with '%emacs_dir%' (which expands to install
# directory at runtime).
msys_prefix_subst=sed -e 's!\(^\|;\)'"$${prefixpattern}"'\([;/]\|$$\)!\1%emacs_dir%\2!g'
# Quote Sed special characters (except backslash and newline) with
# a double backslash.
msys_sed_sh_escape=sed -e 's/[];$$*.^[]/\\\\&/g'
# The w32 build needs a slightly different editing, and it uses
# nt/epaths.nt as the template.
# Use the value of ${locallisppath} supplied by `configure',
# to support the --enable-locallisppath argument.
epaths-force-w32: FRC
@(w32srcdir=`echo "${srcdir}" | ${msys_to_w32}` ; \
prefixpattern=`echo '${prefix}' | ${msys_to_w32} | ${msys_sed_sh_escape}` ; \
locallisppath=`echo '${locallisppath}' | ${msys_lisppath_to_w32} | ${msys_prefix_subst}` ; \
sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
-e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${locallisppath}"'";' \
-e '/^.*#/s/@VER@/${version}/g' \
-e '/^.*#/s/@CFG@/${configuration}/g' \
-e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \

View file

@ -1,9 +1,12 @@
2013-06-13 Glenn Morris <rgm@gnu.org>
* admin.el (manual-style-string): Use new file manual.css.
2013-06-02 Eric Ludlam <zappo@gnu.org>
* grammars/srecode-template.wy (variable): Accept a single number
as a variable value. Allows the 'priority' to be set to a number.
(wisent-srecode-template-lexer): Move number up so it can be
created.
(wisent-srecode-template-lexer): Move number up so it can be created.
2013-05-16 Glenn Morris <rgm@gnu.org>

View file

@ -271,7 +271,7 @@ Root must be the root of an Emacs source tree."
<meta name=\"DC.title\" content=\"gnu.org\">\n\n")
(defconst manual-style-string "<style type=\"text/css\">
@import url('/style.css');\n</style>\n")
@import url('/s/emacs/manual.css');\n</style>\n")
(defun manual-misc-html (name root html-node-dir html-mono-dir)
(let ((texi (expand-file-name (format "doc/misc/%s.texi" name) root)))

View file

@ -316,3 +316,48 @@ When finished, use
bzr bisect reset
or simply delete the entire branch if you created it just for this.
* Commit emails
** Old method: bzr-hookless-email
https://launchpad.net/bzr-hookless-email
Runs hourly via cron. Must ask Savannah admins to enable/disable it
for each branch. Stores the last revision that it mailed as
last_revision_mailed in branch.conf on the server. Breaks with bzr 2.6:
http://lists.gnu.org/archive/html/savannah-hackers-public/2013-05/msg00000.html
Fix from https://bugs.launchpad.net/bzr-hookless-email/+bug/988195
only partially works. Breaks again on every merge commit:
https://lists.ubuntu.com/archives/bazaar/2013q2/075520.html
http://lists.gnu.org/archive/html/savannah-hackers-public/2013-05/msg00024.html
You can force it to skip the merge commit by changing the value for
last_revision_mailed, eg:
bzr config last_revision_mailed=xfq.free@gmail.com-20130603233720-u1aumaxvf3o0rlai -d bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/trunk/
** New method: bzr-email plugin
https://launchpad.net/bzr-email
http://lists.gnu.org/archive/html/savannah-hackers-public/2013-06/msg00007.html
Runs on commit. Projects can enable it themselves by using `bzr
config' to set post_commit_to option for a branch. See `bzr help email'
(if you have the plugin installed) for other options.
Note: if you have the bzr-email plugin installed locally, then when
you commit to the Emacs repository it will also try to send a commit
email from your local machine. If your machine is not configured to
send external mail, this will just fail. In any case, you may prefer
to either remove the plugin from your machine, or disable it for Emacs
branches. You can do this either by editing branch.conf in your Emacs
branches, to override the server setting (untested; not sure this
works), or by adding an entry to ~/.bazaar/locations.conf:
[bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/*/]
post_commit_to = ""
You have to use locations.conf rather than bazaar.conf because the
latter has a lower priority than branch.conf.

View file

@ -437,6 +437,8 @@ GCONF_CFLAGS = @GCONF_CFLAGS@
GCONF_LIBS = @GCONF_LIBS@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GETOPT_H = @GETOPT_H@
GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
GMALLOC_OBJ = @GMALLOC_OBJ@
GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
GNULIB_ATOLL = @GNULIB_ATOLL@
@ -941,6 +943,7 @@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
NEXT_TIME_H = @NEXT_TIME_H@
NEXT_UNISTD_H = @NEXT_UNISTD_H@
NOTIFY_OBJ = @NOTIFY_OBJ@
NS_OBJ = @NS_OBJ@
NS_OBJC_OBJ = @NS_OBJC_OBJ@
NTDIR = @NTDIR@
@ -1132,6 +1135,7 @@ WINT_T_SUFFIX = @WINT_T_SUFFIX@
XARGS_LIMIT = @XARGS_LIMIT@
XFT_CFLAGS = @XFT_CFLAGS@
XFT_LIBS = @XFT_LIBS@
XGSELOBJ = @XGSELOBJ@
XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
XINERAMA_LIBS = @XINERAMA_LIBS@
XMENU_OBJ = @XMENU_OBJ@

View file

@ -132,7 +132,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
/* Define to 1 if futimesat mishandles a NULL file name. */
#undef FUTIMESAT_NULL_BUG
@ -547,12 +547,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `get_current_dir_name' function. */
#undef HAVE_GET_CURRENT_DIR_NAME
/* Define to 1 to use glib's notify. */
/* Define to 1 if using GFile. */
#undef HAVE_GFILENOTIFY
/* Define to 1 if you have a gif (or ungif) library. */
#undef HAVE_GIF
/* Define to 1 if GLib is linked in. */
#undef HAVE_GLIB
/* Define if using GnuTLS. */
#undef HAVE_GNUTLS
@ -1036,9 +1039,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
/* Define to 1 if you have the <sys/inotify.h> header file. */
#undef HAVE_SYS_INOTIFY_H
/* Define to 1 if you have the <sys/inttypes.h> header file. */
#undef HAVE_SYS_INTTYPES_H
@ -1502,7 +1502,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to nonzero if you want access control list support. */
#undef USE_ACL
/* Define to 1 if if using file notifications. */
/* Define to 1 if using file notifications. */
#undef USE_FILE_NOTIFY
/* Define to 1 if using GTK. */
@ -1845,3 +1845,4 @@ Local Variables:
mode: c
End:
*/

185
autogen/configure vendored
View file

@ -1288,6 +1288,7 @@ canonical
configuration
version
copyright
XGSELOBJ
KRB4LIB
DESLIB
KRB5LIB
@ -1325,6 +1326,9 @@ FONTCONFIG_LIBS
FONTCONFIG_CFLAGS
LIBXMU
LIBXTR6
NOTIFY_OBJ
GFILENOTIFY_LIBS
GFILENOTIFY_CFLAGS
LIBGNUTLS_LIBS
LIBGNUTLS_CFLAGS
LIBSELINUX_LIBS
@ -1529,7 +1533,7 @@ with_gconf
with_gsettings
with_selinux
with_gnutls
with_inotify
with_file_notification
with_makeinfo
with_compress_info
with_pkg_config_prog
@ -2257,7 +2261,9 @@ Optional Packages:
--without-gsettings don't compile with GSettings support
--without-selinux don't compile with SELinux support
--without-gnutls don't use -lgnutls for SSL/TLS support
--without-inotify don't compile with inotify (file-watch) support
--with-file-notification=LIB
use a file notification library (LIB one of: yes,
gfile, inotify, w32, no)
--without-makeinfo don't require makeinfo for building manuals
--without-compress-info don't compress the installed Info pages
--with-pkg-config-prog=FILENAME
@ -4332,11 +4338,24 @@ else
fi
# Check whether --with-inotify was given.
if test "${with_inotify+set}" = set; then :
withval=$with_inotify;
# Check whether --with-file-notification was given.
if test "${with_file_notification+set}" = set; then :
withval=$with_file_notification; case "${withval}" in
y | ye | yes ) val=yes ;;
n | no ) val=no ;;
g | gf | gfi | gfil | gfile ) val=gfile ;;
i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;;
w | w3 | w32 ) val=w32 ;;
* ) as_fn_error "\`--with-file-notification=$withval' is invalid;
this option's value should be \`yes', \`no', \`gfile', \`inotify' or \`w32'.
\`yes' is a synonym for \`w32' on MS-Windows, and for \`gfile' otherwise." "$LINENO" 5
;;
esac
with_file_notification=$val
else
with_inotify=$with_features
with_file_notification=$with_features
fi
@ -10236,7 +10255,6 @@ fi
W32_RES_LINK="-Wl,emacs.res"
else
W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
W32_OBJ="$W32_OBJ w32notify.o"
W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
W32_RES_LINK="\$(EMACSRES)"
@ -12007,32 +12025,124 @@ fi
if test "${with_inotify}" = "yes"; then
for ac_header in sys/inotify.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
NOTIFY_OBJ=
NOTIFY_SUMMARY=no
if test "${with_file_notification}" = "yes"; then
if test "${opsys}" = "mingw32"; then
with_file_notification=w32
else
if test "${with_ns}" != yes; then
with_file_notification=gfile
fi
fi
fi
if test "${with_file_notification}" = "gfile"; then
succeeded=no
if test "$PKG_CONFIG" = "no" ; then
HAVE_GFILENOTIFY=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 >= 2.24" >&5
$as_echo_n "checking for gio-2.0 >= 2.24... " >&6; }
if "$PKG_CONFIG" --exists "gio-2.0 >= 2.24" 2>&5 &&
GFILENOTIFY_CFLAGS=`"$PKG_CONFIG" --cflags "gio-2.0 >= 2.24" 2>&5` &&
GFILENOTIFY_LIBS=`"$PKG_CONFIG" --libs "gio-2.0 >= 2.24" 2>&5`; then
edit_cflags="
s,///*,/,g
s/^/ /
s/ -I/ $isystem/g
s/^ //
"
GFILENOTIFY_CFLAGS=`$as_echo "$GFILENOTIFY_CFLAGS" | sed -e "$edit_cflags"`
GFILENOTIFY_LIBS=`$as_echo "$GFILENOTIFY_LIBS" | sed -e 's,///*,/,g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes CFLAGS='$GFILENOTIFY_CFLAGS' LIBS='$GFILENOTIFY_LIBS'" >&5
$as_echo "yes CFLAGS='$GFILENOTIFY_CFLAGS' LIBS='$GFILENOTIFY_LIBS'" >&6; }
succeeded=yes
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
GFILENOTIFY_CFLAGS=""
GFILENOTIFY_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so. Do it in a subshell
## to capture any diagnostics in invoking pkg-config.
GFILENOTIFY_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gio-2.0 >= 2.24") 2>&1`
fi
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
HAVE_GFILENOTIFY=yes
else
HAVE_GFILENOTIFY=no
fi
if test "$HAVE_GFILENOTIFY" = "yes"; then
$as_echo "#define HAVE_GFILENOTIFY 1" >>confdefs.h
NOTIFY_OBJ=gfilenotify.o
NOTIFY_SUMMARY="yes -lgio (gfile)"
fi
fi
if test "${with_file_notification}" = "inotify"; then
ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_inotify_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_INOTIFY_H 1
_ACEOF
fi
done
if test "$ac_cv_header_sys_inotify_h" = yes ; then
ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
if test "x$ac_cv_func_inotify_init1" = x""yes; then :
fi
fi
fi
if test "$ac_cv_func_inotify_init1" = yes; then
if test "$ac_cv_func_inotify_init1" = yes; then
$as_echo "#define HAVE_INOTIFY 1" >>confdefs.h
NOTIFY_OBJ=inotify.o
NOTIFY_SUMMARY="yes -lglibc (inotify)"
fi
fi
fi
if test "${with_file_notification}" = "w32"; then
ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
if test "x$ac_cv_header_windows_h" = x""yes; then :
fi
if test "$ac_cv_header_windows_h" = yes ; then
$as_echo "#define HAVE_W32NOTIFY 1" >>confdefs.h
NOTIFY_OBJ=w32notify.o
NOTIFY_SUMMARY="yes (w32)"
fi
fi
if test -n "$NOTIFY_OBJ"; then
$as_echo "#define USE_FILE_NOTIFY 1" >>confdefs.h
fi
HAVE_XAW3D=no
LUCID_LIBW=
@ -16061,6 +16171,40 @@ fi
done
XGSELOBJ=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GLib is linked in" >&5
$as_echo_n "checking whether GLib is linked in... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <glib.h>
int
main ()
{
g_print ("Hello world");
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
links_glib=yes
else
links_glib=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $links_glib" >&5
$as_echo "$links_glib" >&6; }
if test "${links_glib}" = "yes"; then
$as_echo "#define HAVE_GLIB 1" >>confdefs.h
if test "$HAVE_NS" = no;then
XGSELOBJ=xgselect.o
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
if test "${emacs_cv_langinfo_codeset+set}" = set; then :
@ -17025,7 +17169,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then
$as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h
XMENU_OBJ=xmenu.o
XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o"
XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
FONT_OBJ=xfont.o
if test "$HAVE_XFT" = "yes"; then
FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
@ -28413,6 +28557,7 @@ echo " Does Emacs use -lgpm? ${HAVE_GPM}"
echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}"
echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}"
echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}"
echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}"

View file

@ -86,7 +86,7 @@ AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
])dnl
dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
dnl Create a new --with option that defaults to $enable_features.
dnl Create a new --with option that defaults to $with_features.
dnl NAME is the base name of the option. The shell variable with_NAME
dnl will be set either to 'no' (for a plain --without-NAME) or to
dnl 'yes' (if the option is not specified). Note that the shell
@ -216,7 +216,7 @@ this option's value should be `yes', `no', `gfile', `inotify' or `w32'.
esac
with_file_notification=$val
],
[with_file_notification=yes])
[with_file_notification=$with_features])
## For the times when you want to build Emacs but don't have
## a suitable makeinfo, and can live without the manuals.
@ -2317,19 +2317,21 @@ if test "${with_file_notification}" = "yes"; then
if test "${opsys}" = "mingw32"; then
with_file_notification=w32
else
with_file_notification=gfile
if test "${with_ns}" != yes; then
with_file_notification=gfile
fi
fi
fi
dnl g_file_monitor exists since glib 2.18. It has been tested under
dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED
dnl has been added in glib 2.24. It has been tested under
dnl GNU/Linux only. We take precedence over inotify, but this makes
dnl only sense when glib has been compiled with inotify support. How
dnl to check?
if test "${with_file_notification}" = "gfile"; then
PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.18, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no)
PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no)
if test "$HAVE_GFILENOTIFY" = "yes"; then
AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
LIBS="$LIBS $GFILENOTIFY_LIBS"
NOTIFY_OBJ=gfilenotify.o
NOTIFY_SUMMARY="yes -lgio (gfile)"
fi
@ -2359,6 +2361,8 @@ if test -n "$NOTIFY_OBJ"; then
AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.])
fi
AC_SUBST(NOTIFY_OBJ)
AC_SUBST(GFILENOTIFY_CFLAGS)
AC_SUBST(GFILENOTIFY_LIBS)
dnl Do not put whitespace before the #include statements below.
dnl Older compilers (eg sunos4 cc) choke on it.
@ -3612,6 +3616,25 @@ AC_FUNC_FORK
AC_CHECK_FUNCS(snprintf)
dnl Check this late. It depends on what other libraries (lrsvg, Gtk+ etc)
dnl Emacs uses.
XGSELOBJ=
AC_MSG_CHECKING([whether GLib is linked in])
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <glib.h>
]],
[[g_print ("Hello world");]])],
[links_glib=yes],
[links_glib=no])
AC_MSG_RESULT([$links_glib])
if test "${links_glib}" = "yes"; then
AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.])
if test "$HAVE_NS" = no;then
XGSELOBJ=xgselect.o
fi
fi
AC_SUBST(XGSELOBJ)
dnl Adapted from Haible's version.
AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
@ -4398,7 +4421,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then
AC_DEFINE(HAVE_X_WINDOWS, 1,
[Define to 1 if you want to use the X window system.])
XMENU_OBJ=xmenu.o
XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o"
XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
FONT_OBJ=xfont.o
if test "$HAVE_XFT" = "yes"; then
FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"

View file

@ -1,8 +1,22 @@
2013-06-02 Michael Albinus <michael.albinus@gmx.de>
2013-06-11 Glenn Morris <rgm@gnu.org>
* cmdargs.texi (General Variables): Use "unix:path=/dev/null" as
dummy value for $DBUS_SESSION_BUS_ADDRESS. It also suppresses
autolaunching of the D-Bus session bus.
* maintaining.texi (VC Directory Commands): Copyedit.
(Branches): Put back milder version of pre 2013-06-07 text.
2013-06-09 Xue Fuqiao <xfq.free@gmail.com>
* vc1-xtra.texi (Revision Tags): Add a cross reference.
(CVS Options): Fix the default value of `vc-cvs-stay-local'.
2013-06-07 Xue Fuqiao <xfq.free@gmail.com>
* maintaining.texi (Branches): Remove text copied from other sources.
2013-06-05 Alan Mackenzie <acm@muc.de>
* search.texi (Isearch Scroll): Rename to "Not Exiting Isearch".
(Not Exiting Isearch): Document new user option
`isearch-allow-prefix'. (Bug#9706)
2013-06-03 Juri Linkov <juri@jurta.org>
@ -10,6 +24,19 @@
with the key prefix `M-s h'. Document old command `highlight-phrase'.
Document new command `highlight-symbol-at-point'.
2013-06-02 Xue Fuqiao <xfq.free@gmail.com>
* maintaining.texi (Branches): Add motivations for branching.
(VC Mode Line): Fix typo.
(VC Directory Commands): Mention `vc-dir-hide-up-to-date' with
prefix argument.
2013-06-02 Michael Albinus <michael.albinus@gmx.de>
* cmdargs.texi (General Variables): Use "unix:path=/dev/null" as
dummy value for $DBUS_SESSION_BUS_ADDRESS. It also suppresses
autolaunching of the D-Bus session bus.
2013-06-01 Glenn Morris <rgm@gnu.org>
* programs.texi (Semantic): Fix typo.

View file

@ -396,14 +396,14 @@ Searching and Replacement
Incremental Search
* Basic Isearch:: Basic incremental search commands.
* Repeat Isearch:: Searching for the same string again.
* Error in Isearch:: When your string is not found.
* Special Isearch:: Special input in incremental search.
* Isearch Yank:: Commands that grab text into the search string
or else edit the search string.
* Isearch Scroll:: Scrolling during an incremental search.
* Isearch Minibuffer:: Incremental search of the minibuffer history.
* Basic Isearch:: Basic incremental search commands.
* Repeat Isearch:: Searching for the same string again.
* Error in Isearch:: When your string is not found.
* Special Isearch:: Special input in incremental search.
* Isearch Yank:: Commands that grab text into the search string
or else edit the search string.
* Not Exiting Isearch:: Prefix argument and scrolling commands.
* Isearch Minibuffer:: Incremental search of the minibuffer history.
Replacement Commands

View file

@ -379,7 +379,7 @@ merge-based version control system, a @samp{-} character indicates
that the work file is unmodified, and @samp{:} indicates that it has
been modified. @samp{!} indicates that the file contains conflicts as
result of a recent merge operation (@pxref{Merging}), or that the file
was removed from the version control. Finally, @samp{?} means that
was removed from the version control. Finally, @samp{?} means that
the file is under version control, but is missing from the working
tree.
@ -1203,7 +1203,8 @@ files and directories.
@item x
Hide files with @samp{up-to-date} status
(@code{vc-dir-hide-up-to-date}).
(@code{vc-dir-hide-up-to-date}). With a prefix argument, hide items
whose state is that of the item at point.
@end table
@findex vc-dir-mark
@ -1266,10 +1267,10 @@ bring them back at a later time).
@cindex branch (version control)
One use of version control is to support multiple independent lines
of development, which are called @dfn{branches}. Branches are used
for maintaining separate ``stable'' and ``development'' versions of a
program, and for developing unrelated features in isolation from one
another.
of development, which are called @dfn{branches}. Amongst other
things, branches can be used for maintaining separate ``stable'' and
``development'' versions of a program, and for developing unrelated
features in isolation from one another.
VC's support for branch operations is currently fairly limited. For
decentralized version control systems, it provides commands for

View file

@ -52,14 +52,14 @@ Incremental search backward (@code{isearch-backward}).
@end table
@menu
* Basic Isearch:: Basic incremental search commands.
* Repeat Isearch:: Searching for the same string again.
* Error in Isearch:: When your string is not found.
* Special Isearch:: Special input in incremental search.
* Isearch Yank:: Commands that grab text into the search string
or else edit the search string.
* Isearch Scroll:: Scrolling during an incremental search.
* Isearch Minibuffer:: Incremental search of the minibuffer history.
* Basic Isearch:: Basic incremental search commands.
* Repeat Isearch:: Searching for the same string again.
* Error in Isearch:: When your string is not found.
* Special Isearch:: Special input in incremental search.
* Isearch Yank:: Commands that grab text into the search string
or else edit the search string.
* Not Exiting Isearch:: Prefix argument and scrolling commands.
* Isearch Minibuffer:: Incremental search of the minibuffer history.
@end menu
@node Basic Isearch
@ -332,9 +332,28 @@ alternative method to add the character after point is to enter the
minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f}
at the end of the search string in the minibuffer.
@node Isearch Scroll
@subsection Scrolling During Incremental Search
@node Not Exiting Isearch
@subsection Not Exiting Incremental Search
This subsection describes two categories of commands which you can
type without exiting the current incremental search, even though they
are not themselves part of incremental search.
@table @asis
@item Prefix Arguments
@vindex isearch-allow-prefix
In incremental search, when you enter a prefix argument
(@pxref{Arguments}), by default it will apply either to the next
action in the search or to the command that exits the search.
In previous versions of Emacs, entering a prefix argument always
terminated the search. You can revert to this behavior by setting the
variable @code{isearch-allow-prefix} to @code{nil}.
When @code{isearch-allow-scroll} is non-@code{nil} (see below),
prefix arguments always have the default behavior described above.
@item Scrolling Commands
@vindex isearch-allow-scroll
Normally, scrolling commands exit incremental search. If you change
the variable @code{isearch-allow-scroll} to a non-@code{nil} value,
@ -366,6 +385,7 @@ This feature can be applied to any command that doesn't permanently
change point, the buffer contents, the match data, the current buffer,
or the selected window and frame. The command must not itself attempt
an incremental search.
@end table
@node Isearch Minibuffer
@subsection Searching the Minibuffer

View file

@ -199,21 +199,28 @@ through VC@. Most later systems (including CVS, Subversion, bzr, git,
and hg) have a native tag facility, and VC uses it where available;
those tags will be visible even when you bypass VC.
In a file-oriented VCS, when you rename a registered file you need
to rename its master along with it; the command @code{vc-rename-file}
will do this automatically. If you are using SCCS, you must also
update the records of the tag, to mention the file by its new name
(@code{vc-rename-file} does this, too). An old tag that refers to a
master file that no longer exists under the recorded name is invalid;
VC can no longer retrieve it. It would be beyond the scope of this
manual to explain enough about RCS and SCCS to explain how to update
the tags by hand. Using @code{vc-rename-file} makes the tag remain
valid for retrieval, but it does not solve all problems. For example,
some of the files in your program probably refer to others by name.
At the very least, the makefile probably mentions the file that you
renamed. If you retrieve an old tag, the renamed file is retrieved
under its new name, which is not the name that the makefile expects.
So the program won't really work as retrieved.
In file-based version control systems, when you rename a registered
file you need to rename its master along with it; the command
@code{vc-rename-file} will do this automatically
@iftex
(@pxref{VC Delete/Rename,,,emacs, the Emacs Manual}).
@end iftex
@ifnottex
(@pxref{VC Delete/Rename}).
@end ifnottex
If you are using SCCS, you must also update the records of the tag, to
mention the file by its new name (@code{vc-rename-file} does this,
too). An old tag that refers to a master file that no longer exists
under the recorded name is invalid; VC can no longer retrieve it. It
would be beyond the scope of this manual to explain enough about RCS
and SCCS to explain how to update the tags by hand. Using
@code{vc-rename-file} makes the tag remain valid for retrieval, but it
does not solve all problems. For example, some of the files in your
program probably refer to others by name. At the very least, the
makefile probably mentions the file that you renamed. If you retrieve
an old tag, the renamed file is retrieved under its new name, which is
not the name that the makefile expects. So the program won't really
work as retrieved.
@node Version Headers
@subsubsection Inserting Version Control Headers
@ -377,12 +384,12 @@ ends that support it, including CVS@. In the following, we will talk
only about @code{vc-cvs-stay-local}, but everything applies to
@code{vc-stay-local} as well.
If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines
the version control status of each file using only the entry in the
local CVS subdirectory and the information returned by previous CVS
commands. As a consequence, if you have modified a file and somebody
else has checked in other changes, you will not be notified of the
conflict until you try to commit.
If @code{vc-cvs-stay-local} is @code{only-file} (the default), VC
determines the version control status of each file using only the
entry in the local CVS subdirectory and the information returned by
previous CVS commands. As a consequence, if you have modified a file
and somebody else has checked in other changes, you will not be
notified of the conflict until you try to commit.
If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the
remote repository @emph{before} it decides what to do in

View file

@ -1,3 +1,22 @@
2013-06-11 Xue Fuqiao <xfq.free@gmail.com>
* files.texi (File Name Expansion): Make the example more
intuitive.
2013-06-10 Paul Eggert <eggert@cs.ucla.edu>
Documentation fix for 'ls' and hard links.
* compile.texi (Compilation Functions):
* files.texi (File Attributes, Changing Files):
Use current format for GNU 'ls' output.
(File Attributes): Fix problem introduced in previous change:
the link count is the number of hard links, not the number
of hard links + 1.
2013-06-10 Xue Fuqiao <xfq.free@gmail.com>
* files.texi (File Attributes): Fix typo.
2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
* functions.texi (Lambda Expressions): Lambda expressions don't

View file

@ -181,8 +181,8 @@ after compiling it. Interactively, @var{load} is the prefix argument.
@example
@group
% ls -l push*
-rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el
$ ls -l push*
-rw-r--r-- 1 lewis lewis 791 Oct 5 20:31 push.el
@end group
@group
@ -191,9 +191,9 @@ after compiling it. Interactively, @var{load} is the prefix argument.
@end group
@group
% ls -l push*
-rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el
-rw-rw-rw- 1 lewis 638 Oct 8 20:25 push.elc
$ ls -l push*
-rw-r--r-- 1 lewis lewis 791 Oct 5 20:31 push.el
-rw-rw-rw- 1 lewis lewis 638 Oct 8 20:25 push.elc
@end group
@end example
@end deffn
@ -232,7 +232,7 @@ If @var{noforce} is non-@code{nil}, this function does not recompile
files that have an up-to-date @samp{.elc} file.
@example
% emacs -batch -f batch-byte-compile *.el
$ emacs -batch -f batch-byte-compile *.el
@end example
@end defun

View file

@ -1139,8 +1139,8 @@ both others and group, and that the sticky bit is set.
@end group
@group
% ls -l diffs
-rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs
$ ls -l diffs
-rw-rw-rw- 1 lewis lewis 3063 Oct 30 16:00 diffs
@end group
@end example
@ -1166,17 +1166,17 @@ target. However, they both recursively follow symbolic links at all
levels of parent directories.
@defun file-nlinks filename
This functions returns the number of names (i.e., hard links) that
file @var{filename} has. If the file does not exist, then this function
This function returns the number of names (i.e., hard links) that
file @var{filename} has. If the file does not exist, this function
returns @code{nil}. Note that symbolic links have no effect on this
function, because they are not considered to be names of the files they
link to.
function, because they are not considered to be names of the files
they link to.
@example
@group
% ls -l foo*
-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo
-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo1
$ ls -l foo*
-rw-rw-rw- 2 rms rms 4 Aug 19 01:27 foo
-rw-rw-rw- 2 rms rms 4 Aug 19 01:27 foo1
@end group
@group
@ -1477,9 +1477,9 @@ In the first part of the following example, we list two files,
@example
@group
% ls -li fo*
81908 -rw-rw-rw- 1 rms 29 Aug 18 20:32 foo
84302 -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3
$ ls -li fo*
81908 -rw-rw-rw- 1 rms rms 29 Aug 18 20:32 foo
84302 -rw-rw-rw- 1 rms rms 24 Aug 18 20:31 foo3
@end group
@end example
@ -1494,10 +1494,10 @@ the files again. This shows two names for one file, @file{foo} and
@end group
@group
% ls -li fo*
81908 -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo2
84302 -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3
$ ls -li fo*
81908 -rw-rw-rw- 2 rms rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 2 rms rms 29 Aug 18 20:32 foo2
84302 -rw-rw-rw- 1 rms rms 24 Aug 18 20:31 foo3
@end group
@end example
@ -1519,10 +1519,10 @@ contents of @file{foo3} are lost.
@end group
@group
% ls -li fo*
81908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo2
81908 -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo3
$ ls -li fo*
81908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo
81908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo2
81908 -rw-rw-rw- 3 rms rms 29 Aug 18 20:32 foo3
@end group
@end example
@ -2105,10 +2105,6 @@ start with @samp{~}.) Otherwise, the current buffer's value of
(expand-file-name "foo" "/usr/spool/")
@result{} "/usr/spool/foo"
@end group
@group
(expand-file-name "$HOME/foo")
@result{} "/xcssun/users/rms/lewis/$HOME/foo"
@end group
@end example
If the part of the combined file name before the first slash is
@ -2142,7 +2138,14 @@ This is for the sake of filesystems that have the concept of a
@file{/../} is interpreted exactly the same as @file{/}.
Note that @code{expand-file-name} does @emph{not} expand environment
variables; only @code{substitute-in-file-name} does that.
variables; only @code{substitute-in-file-name} does that:
@example
@group
(expand-file-name "$HOME/foo")
@result{} "/xcssun/users/rms/lewis/$HOME/foo"
@end group
@end example
Note also that @code{expand-file-name} does not follow symbolic links
at any level. This results in a difference between the way

View file

@ -1,3 +1,18 @@
2013-06-10 Aidan Gauland <aidalgol@amuri.net>
* eshell.texi (Input/Output): Expand to cover new visual-command
options, eshell-visual-subcommands and eshell-visual-options.
Divide into separate Visual Commands and Redirection sections.
2013-06-10 Glenn Morris <rgm@gnu.org>
* epa.texi (Cryptographic operations on files): Update epa-decrypt-file.
2013-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Article Date):
Fix description of gnus-article-update-date-headers.
2013-05-28 Xue Fuqiao <xfq.free@gmail.com>
* erc.texi (Special Features): ERC is being maintained within

View file

@ -240,8 +240,9 @@ you answered yes, it will let you select the signing keys.
@node Cryptographic operations on files
@section Cryptographic operations on files
@deffn Command epa-decrypt-file file
Decrypt @var{file}.
@deffn Command epa-decrypt-file file &optional output
Decrypt @var{file}. If you do not specify the name @var{output} to
use for the decrypted file, this function prompts for the value to use.
@end deffn
@deffn Command epa-verify-file file

View file

@ -701,14 +701,25 @@ groups ``eshell-glob'' and ``eshell-pred''.
@node Input/Output
@chapter Input/Output
Since Eshell does not communicate with a terminal like most command
shells, IO is a little different. If you try to run programs from
within Eshell that are not line-oriented, such as programs that use
ncurses, you will just get garbage output, since the Eshell buffer is
not a terminal emulator. Eshell solves this problem by running
specified commands in Emacs's terminal emulator; to let Eshell know
which commands need to be run in a terminal, add them to the list
@var{eshell-visual-commands}.
shells, IO is a little different.
@section Visual Commands
If you try to run programs from within Eshell that are not
line-oriented, such as programs that use ncurses, you will just get
garbage output, since the Eshell buffer is not a terminal emulator.
Eshell solves this problem by running such programs in Emacs's
terminal emulator.
Programs that need a terminal to display output properly are referred
to in this manual as ``visual commands,'' because they are not simply
line-oriented. You must tell Eshell which commands are visual, by
adding them to @var{eshell-visual-commands}; for commands that are
visual for only certain @emph{sub}-commands -- e.g. @samp{git log} but
not @samp{git status} -- use @var{eshell-visual-subcommands}; and for
commands that are visual only when passed certain options, use
@var{eshell-visual-options}.
@section Redirection
Redirection is mostly the same in Eshell as it is in other command
shells. The output redirection operators @code{>} and @code{>>} as
well as pipes are supported, but there is not yet any support for

View file

@ -9517,18 +9517,9 @@ Say how much time has elapsed between the article was posted and now
Date: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago
@end example
This line is updated continually by default. The frequency (in
seconds) is controlled by the @code{gnus-article-update-date-headers}
variable.
If you wish to switch updating off, say:
@vindex gnus-article-update-date-headers
@lisp
(setq gnus-article-update-date-headers nil)
@end lisp
in your @file{~/.gnus.el} file.
To make this line updated continually, set the
@code{gnus-article-update-date-headers} variable to the frequency in
seconds (the default is @code{nil}).
@item W T o
@kindex W T o (Summary)

View file

@ -1,3 +1,7 @@
2013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
* NEWS: Document new prog-mode symbol prettify support.
2013-06-03 Tassilo Horn <tsdh@gnu.org>
* NEWS: Document eshell visual subcommands and options.

View file

@ -292,6 +292,10 @@ when it's nil).
*** `query-replace' skips invisible text when `search-invisible' is nil,
and opens overlays with hidden text when `search-invisible' is `open'.
+++
*** By default, prefix arguments do not now terminate Isearch mode.
Set `isearch-allow-prefix' to nil to restore old behavior.
** MH-E has been updated to MH-E version 8.5.
See MH-E-NEWS for details.
@ -361,6 +365,8 @@ External su and sudo commands are now the default; the internal,
TRAMP-using variants can still be used by enabling the eshell-tramp
module.
** New term.el option `term-suppress-hard-newline'.
** Obsolete packages:
*** longlines.el is obsolete; use visual-line-mode instead.
@ -396,7 +402,11 @@ It is layered as:
* Incompatible Lisp Changes in Emacs 24.4
** Default process filers and sentinels are not nil any more.
** overriding-terminal-local-map does not replace the local keymaps any more.
It used to disable the minor mode, major mode, and text-property keymaps,
whereas now it simply has higher precedence.
** Default process filters and sentinels are not nil any more.
Instead they default to a function which does what the nil value used to do.
** `read-event' does not return decoded chars in ttys any more.
@ -430,6 +440,15 @@ file using `set-file-extended-attributes'.
* Lisp Changes in Emacs 24.4
FIXME - someone who knows what they are talking about, please improve
this - see http://debbugs.gnu.org/14596
** The default file coding for Emacs Lisp files is now utf-8.
(See file-coding-system-alist.) In most cases, this change is
totally transparent. Files that contain unusual characters but do
not specify an explicit coding system may fail to load with obscure
errors. You should either convert them to utf-8 or add an explicit
coding: cookie.
** Obsoleted functions:
*** `dont-compile'
*** `lisp-complete-symbol'
@ -437,6 +456,7 @@ file using `set-file-extended-attributes'.
*** `minibuffer-completion-contents'
*** `isearch-nonincremental-exit-minibuffer'
*** `isearch-filter-visible'
*** `generic-make-keywords-list'
** `with-wrapper-hook' is obsoleted by `add-function'.
The few hooks that used with-wrapper-hook are replaced as follows:
@ -2834,6 +2854,11 @@ should be derived.
modes, e.g. (add-hook 'prog-mode-hook 'flyspell-prog-mode) to enable
on-the-fly spell checking for comments and strings.
**** New option, `prog-prettify-symbols' lets the user control symbol
prettify (replacing a string like "lambda" with the Greek lambda
character. The mode derived from `prog-mode' must call
`prog-prettify-install' with its own custom alist, which can be empty.
*** New hook `change-major-mode-after-body-hook', run by
`run-mode-hooks' just before any other mode hooks.

View file

@ -136,7 +136,8 @@ extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
/* ASCII optimizations. */

View file

@ -27,9 +27,17 @@
/* Size of a buffer needed to hold a signal name like "HUP". */
# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1)
#ifdef __cplusplus
extern "C" {
#endif
int sig2str (int, char *);
int str2sig (char const *, int *);
#ifdef __cplusplus
}
#endif
#endif
/* An upper bound on signal numbers allowed by the system. */

View file

@ -31,7 +31,9 @@
Use this only with GCC. If we were willing to slow 'configure'
down we could also use it with other compilers, but since this
affects only the quality of diagnostics, why bother? */
# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus
# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
&& (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
&& !defined __cplusplus)
# define _GL_HAVE__STATIC_ASSERT 1
# endif
/* The condition (99 < __GNUC__) is temporary, until we know about the

View file

@ -1,9 +1,412 @@
2013-06-13 Michael Albinus <michael.albinus@gmx.de>
Implement changes in Secret Service API. Make it backward compatible.
* net/secrets.el (secrets-struct-secret-content-type): New defonst.
(secrets-create-item): Use it. Prefix properties with interface.
2013-06-13 Michael Hoffman <9qobl2n02@sneakemail.com> (tiny change)
* term.el (term-suppress-hard-newline): New option. (Bug#12017)
(term-emulate-terminal): Respect term-suppress-hard-newline.
2013-06-13 E Sabof <esabof@gmail.com> (tiny change)
* image-dired.el (image-dired-dired-toggle-marked-thumbs):
Only remove a `thumb-file' overlay. (Bug#14548)
2013-06-12 Grégoire Jadi <daimrod@gmail.com>
* mail/reporter.el (reporter-submit-bug-report):
Handle missing package-name. (Bug#14600)
2013-06-12 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
* textmodes/reftex-cite.el (reftex-cite-regexp-hist)
(reftex-citation-prompt, reftex-default-bibliography)
(reftex-bib-or-thebib, reftex-get-bibfile-list)
(reftex-pop-to-bibtex-entry, reftex-extract-bib-entries)
(reftex-bib-sort-author, reftex-bib-sort-year)
(reftex-bib-sort-year-reverse, reftex-get-crossref-alist)
(reftex-extract-bib-entries-from-thebibliography)
(reftex-get-bibkey-default, reftex-get-bib-names)
(reftex-parse-bibtex-entry, reftex-get-bib-field)
(reftex-format-bib-entry, reftex-parse-bibitem)
(reftex-format-bibitem, reftex-do-citation)
(reftex-figure-out-cite-format, reftex-offer-bib-menu)
(reftex-restrict-bib-matches, reftex-extract-bib-file)
(reftex-insert-bib-matches, reftex-format-citation)
(reftex-make-cite-echo-string, reftex-bibtex-selection-callback)
(reftex-create-bibtex-file): Add docstrings, mostly by converting
existing comments into docstrings.
2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
* ibuf-ext.el (ibuffer-mark-help-buffers): Doc fix.
2013-06-12 Andreas Schwab <schwab@suse.de>
* international/mule.el (auto-coding-alist): Use utf-8-emacs-unix
for auto-save files.
2013-06-12 Glenn Morris <rgm@gnu.org>
* ido.el (ido-delete-ignored-files): Remove.
(ido-wide-find-dirs-or-files, ido-make-file-list-1):
Go back to calling ido-ignore-item-p directly.
2013-06-12 Eyal Lotem <eyal.lotem@gmail.com> (tiny change)
* ido.el (ido-wide-find-dirs-or-files): Respect ido-case-fold.
* ido.el (ido-delete-ignored-files): New function,
split from ido-make-file-list-1.
(ido-wide-find-dirs-or-files): Maybe ignore files. (Bug#13003)
(ido-make-file-list-1): Use ido-delete-ignored-files.
2013-06-12 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (inferior-octave-startup)
(inferior-octave-completion-table)
(inferior-octave-track-window-width-change)
(octave-eldoc-function-signatures, octave-help)
(octave-find-definition): Use single quoted strings.
(inferior-octave-startup-args): Change default value.
(inferior-octave-startup): Do not hard code "-i" and
"--no-line-editing".
(inferior-octave-resync-dirs): Add optional arg NOERROR.
(inferior-octave-directory-tracker): Use it.
(octave-goto-function-definition): Robustify.
(octave-help): Support highlighting operators in 'See also'.
(octave-find-definition): Find subfunctions only in Octave mode.
2013-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
* help-fns.el (help-fns--compiler-macro): If the handler function is
named, then put a link to it.
* help-mode.el (help-function-cmacro): Adjust regexp for cl-lib names.
* emacs-lisp/cl-macs.el (cl--compiler-macro-typep): New function.
(cl-typep): Use it.
(cl-eval-when): Simplify debug spec.
(cl-define-compiler-macro): Use eval-and-compile. Give a name to the
compiler-macro function instead of setting `compiler-macro-file'.
2013-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
Daniel Hackney <dan@haxney.org>
First part of Daniel Hackney's patch to package.el.
* emacs-lisp/package.el: Use defstruct.
(package-desc): New, main struct.
(package--bi-desc, package--ac-desc): New structs, used to describe the
format in external files.
(package-desc-vers): Replace with package-desc-version accessor.
(package-desc-doc): Replace with package-desc-summary accessor.
(package-activate-1): Remove `package' arg since the pkg-vec now
includes the name.
(define-package): Use package-desc-from-define.
(package-unpack-single): Change file-name arg to be a symbol.
(package--add-to-archive-contents): Use package-desc-create and new
accessor functions to package--ac-desc.
(package-buffer-info, package-tar-file-info): Return a package-desc.
(package-install-from-buffer): Remove `type' argument. Change pkg-info
arg to be a package-desc.
(package-install-file): Adjust accordingly. Use \' to match EOS.
(package--from-builtin): New function.
(describe-package-1, package-menu--generate): Use it.
(package--make-autoloads-and-compile): Change name arg to be a symbol.
(package-generate-autoloads): Idem and return the name of the file.
* emacs-lisp/package-x.el (package-upload-buffer-internal):
Change pkg-info arg to be a package-desc.
Use package-make-ac-desc.
(package-upload-file): Use \' to match EOS.
* finder.el (finder-compile-keywords): Use package-make-builtin.
2013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
* vc/vc.el (vc-deduce-fileset): Change error message.
(vc-read-backend): New function.
(vc-next-action): Use it.
* subr.el (function-arity): Remove (mistakenly added) (bug#14590).
* progmodes/prolog.el (prolog-make-keywords-regexp): Remove.
(prolog-font-lock-keywords): Use regexp-opt instead.
Don't manually highlight strings.
(prolog-mode-variables): Simplify comment-start-skip.
(prolog-consult-compile): Use display-buffer. Remove unused old-filter.
* emacs-lisp/generic.el (generic--normalise-comments)
(generic-set-comment-syntax, generic-set-comment-vars): New functions.
(generic-mode-set-comments): Use them.
(generic-bracket-support): Use setq-local.
(generic-make-keywords-list): Declare obsolete.
2013-06-11 Glenn Morris <rgm@gnu.org>
* emacs-lisp/lisp-mode.el (lisp-mode-variables):
Prettify after setting font-lock-defaults. (Bug#14574)
2013-06-11 Juanma Barranquero <lekktu@gmail.com>
* replace.el (query-replace, occur-read-regexp-defaults-function)
(replace-search):
* subr.el (declare-function, number-sequence, local-set-key)
(substitute-key-definition, locate-user-emacs-file)
(with-silent-modifications, split-string, eval-after-load):
Fix typos, remove unneeded backslashes and reflow some docstrings.
2013-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
* international/mule-conf.el (file-coding-system-alist): Use utf-8 as
default for Elisp files.
2013-06-11 Glenn Morris <rgm@gnu.org>
* vc/log-view.el (log-view-mode-map): Inherit from special-mode-map,
although define-derived-mode was doing this anyway. (Bug#14583)
2013-06-10 Juanma Barranquero <lekktu@gmail.com>
* allout.el (allout-encryption-plaintext-sanitization-regexps):
Fix make-variable-buffer-local call to refer to the correct variable.
2013-06-10 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-term.el (eshell-visual-commands)
(eshell-visual-subcommands, eshell-visual-options):
Add summary line to docstrings. Add cross-references.
2013-06-10 Glenn Morris <rgm@gnu.org>
* epa.el (epa-read-file-name): New function. (Bug#14510)
(epa-decrypt-file): Make plain-file optional. Use epa-read-file-name.
2013-06-09 Xue Fuqiao <xfq.free@gmail.com>
* vc/vc-cvs.el (vc-cvs-stay-local): Doc fix.
* vc/vc-hooks.el (vc-stay-local): Doc fix.
2013-06-09 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-term.el (eshell-visual-command-p): Fix bug that caused
output redirection to be ignored with visual commands.
2013-06-09 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-term.el (eshell-visual-command-p): New function.
(eshell-term-initialize): Move long lambda to separate function
eshell-visual-command-p.
* eshell/em-dirs.el (eshell-dirs-initialise):
* eshell/em-script.el (eshell-script-initialize):
Add missing #' to lambda.
2013-06-08 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (octave-add-log-current-defun): New function.
(octave-mode): Set add-log-current-defun-function.
(octave-goto-function-definition): Do not move point if not found.
(octave-find-definition): Enhance to try subfunctions first.
2013-06-08 Glenn Morris <rgm@gnu.org>
* emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word):
Improve previous change, to handle non-explicit nil.
2013-06-07 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/smie.el: Improve show-paren-mode behavior.
(smie--opener/closer-at-point): New function.
(smie--matching-block-data): Use it. Don't match from right after an
opener or right before a closer. Obey smie-blink-matching-inners.
Don't signal a mismatch for repeated inners like "switch..case..case".
2013-06-07 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (octave-mode): Set comment-use-global-state
to t. (Bug#14303)
(octave-function-header-regexp): Fix. (Bug#14570)
(octave-help-mode-finish-hook, octave-help-mode-finish):
Remove. Just use temp-buffer-show-hook.
* newcomment.el (comment-search-backward): Revert last change.
(Bug#14434)
* emacs-lisp/smie.el (smie--matching-block-data): Minor simplification.
2013-06-07 Eli Zaretskii <eliz@gnu.org>
* Makefile.in (TAGS TAGS-LISP): Pass the (long) list of *.el files
through xargs, to avoid failure due to MS-Windows limitations on
command-line length.
2013-06-06 Glenn Morris <rgm@gnu.org>
* font-lock.el (lisp-font-lock-keywords-2):
Treat user-error like error.
* emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word):
Handle explicit nil arguments. (Bug#14565)
2013-06-05 Alan Mackenzie <acm@muc.de>
* isearch.el (isearch-allow-prefix): New user option.
(isearch-other-meta-char): Don't exit isearch when a prefix
argument is typed whilst `isearch-allow-prefix' is non-nil.
(Bug#9706)
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
* autorevert.el (auto-revert-notify-handler): Use memq.
Hide assertion failure.
* skeleton.el: Use cl-lib.
(skeleton-further-elements): Use defvar-local.
(skeleton-insert): Use cl-progv.
2013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
* progmodes/prog-mode.el (prog-prettify-symbols)
(prog-prettify-install): Update docstrings.
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el: Move all the prog-mode code to prog-mode.el.
* progmodes/prog-mode.el: New file.
* loadup.el: Add prog-mode.el.
2013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
* simple.el (prog-prettify-symbols): Add version.
(prog-prettify-install): Add convenience function to prettify symbols.
* progmodes/perl-mode.el (perl--augmented-font-lock-keywords)
(perl--augmented-font-lock-keywords-1)
(perl--augmented-font-lock-keywords-2, perl-mode): Remove unneeded
variables and use it.
* progmodes/cfengine.el (cfengine3--augmented-font-lock-keywords)
(cfengine3-mode): Remove unneeded variable and use it.
* emacs-lisp/lisp-mode.el (lisp--augmented-font-lock-keywords)
(lisp--augmented-font-lock-keywords-1)
(lisp--augmented-font-lock-keywords-2, lisp-mode-variables):
Remove unneeded variables and use it.
2013-06-05 João Távora <joaotavora@gmail.com>
* net/tls.el (open-tls-stream): Remove unneeded buffer contents up
to point when opening the connection. (Bug#14380)
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (load-history-regexp, load-history-filename-element)
(eval-after-load, after-load-functions, do-after-load-evaluation)
(eval-next-after-load, display-delayed-warnings)
(collapse-delayed-warnings, delayed-warnings-hook): Move after the
definition of save-match-data.
(overriding-local-map): Remove accidental obsolescence declaration.
* emacs-lisp/edebug.el (edebug-result): Move before first use.
2013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
Generalize symbol prettify support to prog-mode and implement it
for perl-mode, cfengine3-mode, and emacs-lisp-mode.
* simple.el (prog-prettify-symbols-alist, prog-prettify-symbols)
(prog--prettify-font-lock-compose-symbol)
(prog-prettify-font-lock-symbols-keywords): New variables and
functions to support symbol prettification.
* emacs-lisp/lisp-mode.el (lisp--augmented-font-lock-keywords)
(lisp--augmented-font-lock-keywords-1)
(lisp--augmented-font-lock-keywords-2, lisp-mode-variables)
(lisp--prettify-symbols-alist): Implement prettify of lambda.
* progmodes/cfengine.el (cfengine3--augmented-font-lock-keywords)
(cfengine3--prettify-symbols-alist, cfengine3-mode):
Implement prettify of -> => :: strings.
* progmodes/perl-mode.el (perl-prettify-symbols)
(perl--font-lock-compose-symbol)
(perl--font-lock-symbols-keywords): Move to prog-mode.
(perl--prettify-symbols-alist): Prettify -> => :: strings.
(perl-font-lock-keywords-1)
(perl-font-lock-keywords-2): Remove explicit prettify support.
(perl--augmented-font-lock-keywords)
(perl--augmented-font-lock-keywords-1)
(perl--augmented-font-lock-keywords-2, perl-mode):
Implement prettify support.
2013-06-05 Leo Liu <sdl.web@gmail.com>
Re-implement smie matching block highlight using
show-paren-data-function. (Bug#14395)
* emacs-lisp/smie.el (smie-matching-block-highlight)
(smie--highlight-matching-block-overlay)
(smie--highlight-matching-block-lastpos)
(smie-highlight-matching-block)
(smie-highlight-matching-block-mode): Remove.
(smie--matching-block-data-cache): New variable.
(smie--matching-block-data): New function.
(smie-setup): Use smie--matching-block-data for
show-paren-data-function.
* progmodes/octave.el (octave-mode-menu): Fix.
(octave-find-definition): Skip garbage lines.
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
Fix compilation error with simultaneous dynamic+lexical scoping.
Add warning when a defvar appears after the first let-binding.
* emacs-lisp/bytecomp.el (byte-compile-lexical-variables): New var.
(byte-compile-close-variables): Initialize it.
(byte-compile--declare-var): New function.
(byte-compile-file-form-defvar)
(byte-compile-file-form-define-abbrev-table)
(byte-compile-file-form-custom-declare-variable): Use it.
(byte-compile-make-lambda-lexenv): Change the argument. Simplify.
(byte-compile-lambda): Share call to byte-compile-arglist-vars.
(byte-compile-bind): Handle dynamic bindings that shadow
lexical bindings.
(byte-compile-unbind): Make arg non-optional.
(byte-compile-let): Simplify.
* emacs-lisp/cconv.el (byte-compile-lexical-variables): Declare var.
(cconv--analyse-function, cconv-analyse-form): Populate it.
Protect byte-compile-bound-variables to limit the scope of defvars.
(cconv-analyse-form): Add missing rule for (defvar <foo>).
Remove unneeded rule for `declare'.
* emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): Use macroexp-let2
so as to avoid depending on cl-adjoin at run-time.
* emacs-lisp/cl-lib.el (cl-pushnew): Use backquotes.
* emacs-lisp/macroexp.el (macroexp--compiling-p): New function.
(macroexp--warn-and-return): Use it.
2013-06-05 Leo Liu <sdl.web@gmail.com>
* eshell/esh-mode.el (eshell-mode): Fix key bindings.
2013-06-04 Leo Liu <sdl.web@gmail.com>
* progmodes/compile.el (compile-goto-error): Add optional arg NOMSG.
(compilation-auto-jump): Suppress the "Mark set" message to give
way to exit message.
2013-06-04 Alan Mackenzie <acm@muc.de>
Remove faulty optimisation from indentation calculation.
* progmodes/cc-engine.el (c-guess-basic-syntax): Don't calculate
search limit based on 2000 characters back from indent-point.
2013-06-03 Tassilo Horn <tsdh@gnu.org>
* eshell/em-term.el (cl-lib): Require `cl-lib'.
2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/lisp.el: Use lexical-binding.
(lisp--local-variables-1, lisp--local-variables): New functions.
(lisp--local-variables-completion-table): New var.
(lisp-completion-at-point): Use it to provide completion of let-bound vars.
(lisp-completion-at-point): Use it complete let-bound vars.
* emacs-lisp/lisp-mode.el (eval-sexp-add-defvars): Expand macros
eagerly (bug#14422).
@ -15,9 +418,9 @@
(auto-revert-notify-event-p, auto-revert-notify-event-file-name)
(auto-revert-notify-handler): Handle also gfilenotify.
* subr.el: (file-notify-handle-event): New defun. Replacing ...
* subr.el (file-notify-handle-event): New defun. Replacing ...
(inotify-event-p, inotify-handle-event, w32notify-handle-event):
Removed.
Remove.
2013-06-03 Juri Linkov <juri@jurta.org>
@ -43,10 +446,15 @@
2013-06-03 Tassilo Horn <tsdh@gnu.org>
* eshell/em-term.el (eshell-term-initialize): Use
`cl-intersection' rather than `intersection'.
* eshell/em-term.el (eshell-term-initialize):
Use `cl-intersection' rather than `intersection'.
2013-06-02 Eric Ludlam <zappo@gnu.org>
2013-06-02 Xue Fuqiao <xfq.free@gmail.com>
* vc/log-view.el: Doc fix.
(log-view-mode-map): Copy keymap from `special-mode-map'.
2013-06-02 Eric Ludlam <zappo@gnu.org>
* emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
(eieio-error-unsupported-class-tags, eieio-skip-typecheck)
@ -93,7 +501,7 @@
(eieiomt-optimizing-obarray, eieiomt-install)
(eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
(eieio-generic-form, eieio-defmethod, make-obsolete)
(eieio-defgeneric, make-obsolete): Moved to eieio-core.el
(eieio-defgeneric, make-obsolete): Move to eieio-core.el
(defclass): Remove `eval-and-compile' from macro.
(call-next-method, shared-initialize): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
@ -122,10 +530,10 @@
(eshell-find-interpreter): Add new second parameter ARGS.
* eshell/em-script.el (eshell-script-initialize): Add second arg
to the function added as MATCH to `eshell-interpreter-alist'
to the function added as MATCH to `eshell-interpreter-alist'.
* eshell/em-dirs.el (eshell-dirs-initialize): Add second arg to
the function added as MATCH to `eshell-interpreter-alist'
the function added as MATCH to `eshell-interpreter-alist'.
* eshell/em-term.el (eshell-visual-subcommands): New defcustom.
(eshell-visual-options): New defcustom.
@ -185,8 +593,8 @@
2013-05-31 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p): New
function, checks if point is inside a literal that allows
* progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):
New function, checks if point is inside a literal that allows
expression expansion.
(ruby-syntax-propertize-expansion): Use it.
(ruby-syntax-propertize-function): Bind `case-fold-search' to nil
@ -297,7 +705,7 @@
* emacs-lisp/trace.el (trace--read-args): Provide a default.
* emacs-lisp/lisp-mode.el (lisp-mode-shared-map): Inherit from
prog-mode-map.
prog-mode-map (bug#14504).
2013-05-29 Leo Liu <sdl.web@gmail.com>
@ -329,7 +737,7 @@
2013-05-28 Aidan Gauland <aidalgol@amuri.net>
* eshell/em-unix.el: Added -r option to cp
* eshell/em-unix.el: Add -r option to cp.
2013-05-28 Glenn Morris <rgm@gnu.org>
@ -2030,7 +2438,7 @@
* comint.el (comint-dynamic-complete-functions, comint-mode-map):
`comint-dynamic-complete' is obsolete since 24.1, replaced by
`completion-at-point'. (Bug#13774)
`completion-at-point'. (Bug#13774)
* startup.el (normal-no-mouse-startup-screen): Bug fix, the
default key binding for `describe-distribution' has been moved to
@ -2059,7 +2467,8 @@
* comint.el (comint-redirect-original-filter-function): Remove.
(comint-redirect-cleanup, comint-redirect-send-command-to-process):
* vc/vc-cvs.el (vc-cvs-annotate-process-filter,vc-cvs-annotate-command):
* vc/vc-cvs.el (vc-cvs-annotate-process-filter)
(vc-cvs-annotate-command):
* progmodes/octave-inf.el (inferior-octave-send-list-and-digest):
* progmodes/prolog.el (prolog-consult-compile):
* progmodes/gdb-mi.el (gdb, gdb--check-interpreter):
@ -2081,9 +2490,9 @@
2013-04-19 Masatake YAMATO <yamato@redhat.com>
* progmodes/sh-script.el (sh-imenu-generic-expression):
Handle function names with a single character. (Bug#14111)
Handle function names with a single character. (Bug#14111)
2013-04-19 Dima Kogan <dima@secretsauce.net> (tiny change)
2013-04-19 Dima Kogan <dima@secretsauce.net> (tiny change)
* progmodes/gud.el (gud-perldb-marker-filter): Understand position info
for subroutines defined in an eval (bug#14182).
@ -3193,7 +3602,7 @@
Correct the position of point in some line-up functions.
* progmodes/cc-align.el (c-lineup-whitesmith-in-block)
(c-lineup-assignments, c-lineup-gcc-asm-reg ): take position of
(c-lineup-assignments, c-lineup-gcc-asm-reg ): Take position of
point at column 0 rather than at a random place in the line.
2013-03-05 Michael Albinus <michael.albinus@gmx.de>
@ -4728,7 +5137,7 @@
2013-01-12 Eli Zaretskii <eliz@gnu.org>
* autorevert.el (auto-revert-notify-handler): Fix filtering of
file notification by ACTION. For filtering by file name, compare
file notification by ACTION. For filtering by file name, compare
only the non-directory part of the file name.
2013-01-12 Stefan Monnier <monnier@iro.umontreal.ca>
@ -4811,7 +5220,7 @@
2013-01-11 Julien Danjou <julien@danjou.info>
* color.el (color-rgb-to-hsv): Fix conversion computing in case min and
max are almost equal. Also return the correct value for V which is
max are almost equal. Also return the correct value for V which is
already between 0 and 1.
2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
@ -5265,7 +5674,7 @@
2012-12-31 Jürgen Hötzel <juergen@archlinux.org>
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
(No device connected, invalid device name). (Bug #13299)
(No device connected, invalid device name). (Bug #13299)
2012-12-31 Martin Rudalics <rudalics@gmx.at>
@ -5650,7 +6059,7 @@
2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
Fix permissions bugs with setgid directories etc. (Bug#13125)
Fix permissions bugs with setgid directories etc. (Bug#13125)
* files.el (backup-buffer): Don't rely on 9th output of
file-attributes, as it's now a placeholder. Instead, use the new
optional arg of file-ownership-preserved-p.
@ -6108,7 +6517,7 @@
* textmodes/ispell.el (ispell-init-process)
(ispell-start-process, ispell-internal-change-dictionary):
Make sure personal dictionary name is expanded after initial
`default-directory' value. Use expanded strings for
`default-directory' value. Use expanded strings for
keep/restart checks and for value (Bug#13019).
2012-12-03 Jay Belanger <jay.p.belanger@gmail.com>
@ -6790,7 +7199,7 @@
* play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
Don't signal an error with a score that is too low to add to the
list of top scores. (Bug#12779)
list of top scores. (Bug#12779)
2012-11-17 Chong Yidong <cyd@gnu.org>
@ -6859,7 +7268,7 @@
* window.el (record-window-buffer)
(display-buffer-record-window): When copying the markers to
window-point preserve window-point-insertion-type. (Bug#12588)
window-point preserve window-point-insertion-type. (Bug#12588)
2012-11-16 Glenn Morris <rgm@gnu.org>
@ -6947,8 +7356,8 @@
(ad-advice-definition): Redefine as functions.
(ad-advice-classes): Move before first use.
(ad-make-origname, ad-set-orig-definition, ad-clear-orig-definition)
(ad-make-mapped-call, ad-make-advised-docstring,ad-make-plain-docstring)
(ad--defalias-fset): Remove functions.
(ad-make-mapped-call, ad-make-advised-docstring)
(ad-make-plain-docstring, ad--defalias-fset): Remove functions.
(ad-make-advicefunname, ad-clear-advicefunname-definition): New funs.
(ad-get-orig-definition): Rewrite.
(ad-make-advised-definition-docstring): Change base docstring.
@ -7200,7 +7609,7 @@
2012-11-09 Vincent Belaïche <vincentb1@users.sourceforge.net>
* ses.el: symbol to coordinate mapping is made by symbol property
* ses.el: Symbol to coordinate mapping is made by symbol property
`ses-cell'. This means that the same mapping is done for all SES
sheets. That is good enough for cells with standard A1 names, but
not for named cell. So a hash map is added for the latter.
@ -7296,7 +7705,7 @@
buffer and calls `ispell-buffer' with debugging enabled.
* textmodes/ispell.el (ispell-region): Do not prefix sent string by
comment in autoconf mode. (Bug#12768)
comment in autoconf mode. (Bug#12768)
2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
@ -8441,13 +8850,13 @@
* textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure
that entries with whitespace at various places are found.
Doc fix. Include entries that are cross-referenced from cited entries.
Doc fix. Include entries that are cross-referenced from cited entries.
Include @String definitions in the resulting bib file. Add header
and footer defined in `reftex-create-bibtex-header' and
`reftex-create-bibtex-footer'.
(reftex-do-citation): Make it possible again to insert
non-existent entries. Save match data when asking for optional
arguments. Return all keys, not just the first one.
arguments. Return all keys, not just the first one.
(reftex-all-used-citation-keys): Fix regexp to correctly extract
all citations in the same line.
(reftex-parse-bibtex-entry): Accept additional optional argument
@ -8507,7 +8916,7 @@
* textmodes/reftex-sel.el
(reftex-select-cycle-ref-style-internal): Adapt to new structure
of `reftex-ref-style-alist'. Remove code for testing macro type.
of `reftex-ref-style-alist'. Remove code for testing macro type.
(reftex-select-toggle-varioref)
(reftex-select-toggle-fancyref): Remove.
(reftex-select-cycle-ref-style-internal)
@ -9049,7 +9458,7 @@
* textmodes/bibtex.el (bibtex-autokey-transcriptions):
Transcribe also LaTeX hyphenation.
(bibtex-reformat): Bug fix. Do not quote twice the elements of
(bibtex-reformat): Bug fix. Do not quote twice the elements of
bibtex-reformat-previous-options.
2012-09-23 Roland Winkler <winkler@gnu.org>
@ -11135,7 +11544,7 @@
* progmodes/python.el (python-shell-send-setup-max-wait): Delete var.
(python-shell-make-comint): accept-process-output at startup.
(run-python-internal): Set inferior-python-mode-hook to nil.
(python-shell-internal-get-or-create-process): call sit-for.
(python-shell-internal-get-or-create-process): Call sit-for.
(python-preoutput-result): Add obsolete alias.
(python-shell-internal-send-string): Use it.
(python-shell-send-setup-code): Remove call to
@ -11327,7 +11736,7 @@
2012-07-27 Fabián Ezequiel Gallina <fgallina@cuca>
Consistent completion in inferior python with emacs -nw.
* progmodes/python.el (inferior-python-mode): replace "<tab>"
* progmodes/python.el (inferior-python-mode): Replace "<tab>"
binding in inferior-python-mode-map with "\t".
(python-shell-completion-complete-at-point)
(python-completion-complete-at-point): Remove interactive spec.
@ -12076,7 +12485,7 @@
(xml-name-start-char-re, xml-name-char-re, xml-name-re)
(xml-names-re, xml-nmtoken-re, xml-nmtokens-re, xml-char-ref-re)
(xml-entity-ref, xml-pe-reference-re)
(xml-reference-re,xml-att-value-re, xml-tokenized-type-re)
(xml-reference-re, xml-att-value-re, xml-tokenized-type-re)
(xml-notation-type-re, xml-enumeration-re, xml-enumerated-type-re)
(xml-att-type-re, xml-default-decl-re, xml-att-def-re)
(xml-entity-value-re): Use syntax references in regexps where
@ -18891,8 +19300,8 @@
* progmodes/verilog-mode.el (verilog-read-defines): Fix reading
parameters with embedded comments. Reported by Ray Stevens.
(verilog-calc-1, verilog-fork-wait-re) (verilog-forward-sexp,
verilog-wait-fork-re): Fix indentation of "wait fork", bug407.
(verilog-calc-1, verilog-fork-wait-re, verilog-forward-sexp)
(verilog-wait-fork-re): Fix indentation of "wait fork", bug407.
Reported by Tim Holt.
(verilog-auto): Fix AUTOing a upper module then AUTOing module
instantiated by upper module causing wrong expansion until AUTOed a
@ -20461,7 +20870,7 @@
2011-10-07 Chong Yidong <cyd@stupidchicken.com>
* bindings.el ([M-left],[M-right]): Bind to left-word and
* bindings.el ([M-left], [M-right]): Bind to left-word and
right-word respectively.
2011-10-07 Glenn Morris <rgm@gnu.org>
@ -25783,15 +26192,15 @@
2011-05-10 Jim Meyering <meyering@redhat.com>
Fix doubled-word typos.
* international/quail.el (quail-insert-kbd-layout): and and -> and
* kermit.el: and and -> and
* net/ldap.el (ldap-search-internal): to to -> to
* international/quail.el (quail-insert-kbd-layout): and and -> and.
* kermit.el: and and -> and.
* net/ldap.el (ldap-search-internal): to to -> to.
* progmodes/vhdl-mode.el (vhdl-offsets-alist): Likewise.
* progmodes/js.el (js-mode): and and -> and
* textmodes/artist.el (artist-move-to-xy): at at -> at
(artist-draw-region-trim-line-endings): if if -> if
* progmodes/js.el (js-mode): and and -> and.
* textmodes/artist.el (artist-move-to-xy): at at -> at.
(artist-draw-region-trim-line-endings): if if -> if.
And Safetyc -> Safety.
* textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a
* textmodes/reftex-dcr.el (reftex-view-crossref): at at -> at a.
2011-05-10 Glenn Morris <rgm@gnu.org>
Stefan Monnier <monnier@iro.umontreal.ca>

View file

@ -777,7 +777,7 @@
1987-12-21 Richard Stallman (rms@frosted-flakes)
* window.el (split-widow-{vertically,horizontally}):
* window.el (split-window-{vertically,horizontally}):
Make the arg optional.
1987-12-09 Richard Stallman (rms@frosted-flakes)
@ -1392,7 +1392,7 @@
* shell.el: Minor doc fixes.
* rmail.el (rmail-get-new-mail):
Handle errors competently. (Don't attempt to
Handle errors competently. (Don't attempt to
handle them, rather than botching the job)
* rmail.el (rmail-insert-inbox-text):
@ -3032,7 +3032,7 @@
Rename "kill" -> "delete" for both function-names and documentation.
Define C-d as Buffer-menu-delete-backwards. (also in ebuff-menu)
Define C-d as Buffer-menu-delete-backwards (also in ebuff-menu).
Save space: Merge buffer-menu-{execute,do-saves,do-kills}.

View file

@ -209,8 +209,9 @@ update-authors:
$(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
els=`echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
${ETAGS} -o $@ $$els
rm -f $@; touch $@; \
echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,," | \
xargs $(XARGS_LIMIT) ${ETAGS} -a -o $@
# The src/Makefile.in has its own set of dependencies and when they decide
# that one Lisp file needs to be re-compiled, we had better recompile it as

View file

@ -1561,7 +1561,7 @@ Each value can be a regexp or a list with a regexp followed by a
substitution string. If it's just a regexp, all its matches are removed
before the text is encrypted. If it's a regexp and a substitution, the
substitution is used against the regexp matches, a la `replace-match'.")
(make-variable-buffer-local 'allout-encryption-text-removal-regexps)
(make-variable-buffer-local 'allout-encryption-plaintext-sanitization-regexps)
;;;_ = allout-encryption-ciphertext-rejection-regexps
(defvar allout-encryption-ciphertext-rejection-regexps nil
"Variable for regexps matching plaintext to remove before encryption.

View file

@ -578,7 +578,7 @@ will use an up-to-date value of `auto-revert-interval'"
((featurep 'w32notify) (nth 2 event)))))
(defun auto-revert-notify-handler (event)
"Handle an event returned from file notification."
"Handle an EVENT returned from file notification."
(when (auto-revert-notify-event-p event)
(let* ((descriptor (auto-revert-notify-event-descriptor event))
(action (auto-revert-notify-event-action event))
@ -591,10 +591,12 @@ will use an up-to-date value of `auto-revert-interval'"
(cl-assert descriptor)
(cond
((featurep 'gfilenotify)
(cl-assert (or (eq 'attribute-changed action)
(eq 'changed action)
(eq 'created action)
(eq 'deleted action))))
(cl-assert (memq action '(attribute-changed changed created deleted
;; FIXME: I keep getting this action, so I
;; added it here, but I have no idea what
;; I'm doing. --Stef
changes-done-hint))
t))
((featurep 'inotify)
(cl-assert (or (memq 'attrib action)
(memq 'create action)

View file

@ -366,7 +366,7 @@ For example, in the C statement:
If the cursor is on 'this', will move point to the ; after entry.")
(defun semantic-ctxt-end-of-symbol-default (&optional point)
"Move poin to the end of the current symbol under POINT.
"Move point to the end of the current symbol under POINT.
This will move past type/field names when applicable.
Depends on `semantic-type-relation-separator-character', and will
work on C like languages."
@ -422,18 +422,18 @@ work on C like languages."
;; Skip the separator and the symbol.
(goto-char (match-end 0))
(if (looking-at "\\w\\|\\s_")
;; Skip symbols
(forward-sexp 1)
;; No symbol, exit the search...
(setq continuesearch nil))
(setq end (point)))
;; Cont...
)
;; Restore position if we go to far....
(error (goto-char end)) )

View file

@ -396,7 +396,7 @@ decoration API found in this library."
(let ((predicate (semantic-decorate-style-predicate name))
(highlighter (semantic-decorate-style-highlighter name))
(predicatedef (semantic-decorate-style-predicate-default name))
(highlighterdef (semantic-decorate-style-highlighter-default name))
(highlighterdef (semantic-decorate-style-highlighter-default name))
(defaultenable (if (plist-member flags :enabled)
(plist-get flags :enabled)
t))
@ -422,14 +422,14 @@ decoration API found in this library."
(add-to-list 'semantic-decoration-styles
(cons ',(symbol-name name)
,defaultenable))
;; If there is a load file, then create the autload tokens for
;; If there is a load file, then create the autoload tokens for
;; those functions to load the token, but only if the fsym
;; doesn't exist yet.
(when (stringp ,loadfile)
(unless (fboundp ',predicatedef)
(autoload ',predicatedef ',loadfile "Return non-nil to decorate TAG."
nil 'function))
(unless (fboundp ',highlighterdef)
(autoload ',highlighterdef ',loadfile "Decorate TAG."
nil 'function))

View file

@ -411,6 +411,9 @@ specify different fields to sort on."
(defvar byte-compile-bound-variables nil
"List of dynamic variables bound in the context of the current form.
This list lives partly on the stack.")
(defvar byte-compile-lexical-variables nil
"List of variables that have been treated as lexical.
Filled in `cconv-analyse-form' but initialized and consulted here.")
(defvar byte-compile-const-variables nil
"List of variables declared as constants during compilation of this file.")
(defvar byte-compile-free-references)
@ -1489,6 +1492,7 @@ extra args."
(byte-compile--outbuffer nil)
(byte-compile-function-environment nil)
(byte-compile-bound-variables nil)
(byte-compile-lexical-variables nil)
(byte-compile-const-variables nil)
(byte-compile-free-references nil)
(byte-compile-free-assignments nil)
@ -2245,15 +2249,24 @@ list that represents a doc string reference.
(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar)
(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar)
(defun byte-compile-file-form-defvar (form)
(when (and (symbolp (nth 1 form))
(not (string-match "[-*/:$]" (symbol-name (nth 1 form))))
(defun byte-compile--declare-var (sym)
(when (and (symbolp sym)
(not (string-match "[-*/:$]" (symbol-name sym)))
(byte-compile-warning-enabled-p 'lexical))
(byte-compile-warn "global/dynamic var `%s' lacks a prefix"
(nth 1 form)))
(push (nth 1 form) byte-compile-bound-variables)
(if (eq (car form) 'defconst)
(push (nth 1 form) byte-compile-const-variables))
sym))
(when (memq sym byte-compile-lexical-variables)
(setq byte-compile-lexical-variables
(delq sym byte-compile-lexical-variables))
(byte-compile-warn "Variable `%S' declared after its first use" sym))
(push sym byte-compile-bound-variables))
(defun byte-compile-file-form-defvar (form)
(let ((sym (nth 1 form)))
(byte-compile--declare-var sym)
(if (eq (car form) 'defconst)
(push sym byte-compile-const-variables)))
(if (and (null (cddr form)) ;No `value' provided.
(eq (car form) 'defvar)) ;Just a declaration.
nil
@ -2267,7 +2280,7 @@ list that represents a doc string reference.
'byte-compile-file-form-define-abbrev-table)
(defun byte-compile-file-form-define-abbrev-table (form)
(if (eq 'quote (car-safe (car-safe (cdr form))))
(push (car-safe (cdr (cadr form))) byte-compile-bound-variables))
(byte-compile--declare-var (car-safe (cdr (cadr form)))))
(byte-compile-keep-pending form))
(put 'custom-declare-variable 'byte-hunk-handler
@ -2275,7 +2288,7 @@ list that represents a doc string reference.
(defun byte-compile-file-form-custom-declare-variable (form)
(when (byte-compile-warning-enabled-p 'callargs)
(byte-compile-nogroup-warn form))
(push (nth 1 (nth 1 form)) byte-compile-bound-variables)
(byte-compile--declare-var (nth 1 (nth 1 form)))
(byte-compile-keep-pending form))
(put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
@ -2576,19 +2589,16 @@ If FORM is a lambda or a macro, byte-compile it as a function."
"Return a list of the variables in the lambda argument list ARGLIST."
(remq '&rest (remq '&optional arglist)))
(defun byte-compile-make-lambda-lexenv (form)
(defun byte-compile-make-lambda-lexenv (args)
"Return a new lexical environment for a lambda expression FORM."
;; See if this is a closure or not
(let ((args (byte-compile-arglist-vars (cadr form))))
(let ((lexenv nil))
;; Fill in the initial stack contents
(let ((stackpos 0))
;; Add entries for each argument
(dolist (arg args)
(push (cons arg stackpos) lexenv)
(setq stackpos (1+ stackpos)))
;; Return the new lexical environment
lexenv))))
(let* ((lexenv nil)
(stackpos 0))
;; Add entries for each argument.
(dolist (arg args)
(push (cons arg stackpos) lexenv)
(setq stackpos (1+ stackpos)))
;; Return the new lexical environment.
lexenv))
(defun byte-compile-make-args-desc (arglist)
(let ((mandatory 0)
@ -2626,9 +2636,9 @@ for symbols generated by the byte compiler itself."
(byte-compile-set-symbol-position 'lambda))
(byte-compile-check-lambda-list (nth 1 fun))
(let* ((arglist (nth 1 fun))
(arglistvars (byte-compile-arglist-vars arglist))
(byte-compile-bound-variables
(append (and (not lexical-binding)
(byte-compile-arglist-vars arglist))
(append (if (not lexical-binding) arglistvars)
byte-compile-bound-variables))
(body (cdr (cdr fun)))
(doc (if (stringp (car body))
@ -2676,7 +2686,8 @@ for symbols generated by the byte compiler itself."
;; args (since lambda expressions should be
;; closed by now).
(and lexical-binding
(byte-compile-make-lambda-lexenv fun))
(byte-compile-make-lambda-lexenv
arglistvars))
reserved-csts)))
;; Build the actual byte-coded function.
(cl-assert (eq 'byte-code (car-safe compiled)))
@ -3435,32 +3446,38 @@ discarding."
(byte-defop-compiler (/ byte-quo) byte-compile-quo)
(byte-defop-compiler nconc)
;; Is this worth it? Both -before and -after are written in C.
(defun byte-compile-char-before (form)
(cond ((= 2 (length form))
(cond ((or (= 1 (length form))
(and (= 2 (length form)) (not (nth 1 form))))
(byte-compile-form '(char-after (1- (point)))))
((= 2 (length form))
(byte-compile-form (list 'char-after (if (numberp (nth 1 form))
(1- (nth 1 form))
`(1- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(char-after (1- (point)))))
`(1- (or ,(nth 1 form)
(point)))))))
(t (byte-compile-subr-wrong-args form "0-1"))))
;; backward-... ==> forward-... with negated argument.
;; Is this worth it? Both -backward and -forward are written in C.
(defun byte-compile-backward-char (form)
(cond ((= 2 (length form))
(cond ((or (= 1 (length form))
(and (= 2 (length form)) (not (nth 1 form))))
(byte-compile-form '(forward-char -1)))
((= 2 (length form))
(byte-compile-form (list 'forward-char (if (numberp (nth 1 form))
(- (nth 1 form))
`(- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(forward-char -1)))
`(- (or ,(nth 1 form) 1))))))
(t (byte-compile-subr-wrong-args form "0-1"))))
(defun byte-compile-backward-word (form)
(cond ((= 2 (length form))
(cond ((or (= 1 (length form))
(and (= 2 (length form)) (not (nth 1 form))))
(byte-compile-form '(forward-word -1)))
((= 2 (length form))
(byte-compile-form (list 'forward-word (if (numberp (nth 1 form))
(- (nth 1 form))
`(- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(forward-word -1)))
`(- (or ,(nth 1 form) 1))))))
(t (byte-compile-subr-wrong-args form "0-1"))))
(defun byte-compile-list (form)
@ -3862,9 +3879,8 @@ that suppresses all warnings during execution of BODY."
"Emit byte-codes to push the initialization value for CLAUSE on the stack.
Return the offset in the form (VAR . OFFSET)."
(let* ((var (if (consp clause) (car clause) clause)))
;; We record the stack position even of dynamic bindings and
;; variables in non-stack lexical environments; we'll put
;; them in the proper place below.
;; We record the stack position even of dynamic bindings; we'll put
;; them in the proper place later.
(prog1 (cons var byte-compile-depth)
(if (consp clause)
(byte-compile-form (cadr clause))
@ -3882,33 +3898,41 @@ Return the offset in the form (VAR . OFFSET)."
INIT-LEXENV should be a lexical-environment alist describing the
positions of the init value that have been pushed on the stack.
Return non-nil if the TOS value was popped."
;; The presence of lexical bindings mean that we may have to
;; The mix of lexical and dynamic bindings mean that we may have to
;; juggle things on the stack, to move them to TOS for
;; dynamic binding.
(cond ((not (byte-compile-not-lexical-var-p var))
;; VAR is a simple stack-allocated lexical variable
(push (assq var init-lexenv)
byte-compile--lexical-environment)
nil)
((eq var (caar init-lexenv))
;; VAR is dynamic and is on the top of the
;; stack, so we can just bind it like usual
(byte-compile-dynamic-variable-bind var)
t)
(t
;; VAR is dynamic, but we have to get its
;; value out of the middle of the stack
(let ((stack-pos (cdr (assq var init-lexenv))))
(byte-compile-stack-ref stack-pos)
(byte-compile-dynamic-variable-bind var)
;; Now we have to store nil into its temporary
;; stack position to avoid problems with GC
(byte-compile-push-constant nil)
(byte-compile-stack-set stack-pos))
nil)))
(if (and lexical-binding (not (byte-compile-not-lexical-var-p var)))
;; VAR is a simple stack-allocated lexical variable.
(progn (push (assq var init-lexenv)
byte-compile--lexical-environment)
nil)
;; VAR should be dynamically bound.
(while (assq var byte-compile--lexical-environment)
;; This dynamic binding shadows a lexical binding.
(setq byte-compile--lexical-environment
(remq (assq var byte-compile--lexical-environment)
byte-compile--lexical-environment)))
(cond
((eq var (caar init-lexenv))
;; VAR is dynamic and is on the top of the
;; stack, so we can just bind it like usual.
(byte-compile-dynamic-variable-bind var)
t)
(t
;; VAR is dynamic, but we have to get its
;; value out of the middle of the stack.
(let ((stack-pos (cdr (assq var init-lexenv))))
(byte-compile-stack-ref stack-pos)
(byte-compile-dynamic-variable-bind var)
;; Now we have to store nil into its temporary
;; stack position so it doesn't prevent the value from being GC'd.
;; FIXME: Not worth the trouble.
;; (byte-compile-push-constant nil)
;; (byte-compile-stack-set stack-pos)
)
nil))))
(defun byte-compile-unbind (clauses init-lexenv
&optional preserve-body-value)
(defun byte-compile-unbind (clauses init-lexenv preserve-body-value)
"Emit byte-codes to unbind the variables bound by CLAUSES.
CLAUSES is a `let'-style variable binding list. INIT-LEXENV should be a
lexical-environment alist describing the positions of the init value that
@ -3916,7 +3940,7 @@ have been pushed on the stack. If PRESERVE-BODY-VALUE is true,
then an additional value on the top of the stack, above any lexical binding
slots, is preserved, so it will be on the top of the stack after all
binding slots have been popped."
;; Unbind dynamic variables
;; Unbind dynamic variables.
(let ((num-dynamic-bindings 0))
(dolist (clause clauses)
(unless (assq (if (consp clause) (car clause) clause)
@ -3927,14 +3951,15 @@ binding slots have been popped."
;; Pop lexical variables off the stack, possibly preserving the
;; return value of the body.
(when init-lexenv
;; INIT-LEXENV contains all init values left on the stack
;; INIT-LEXENV contains all init values left on the stack.
(byte-compile-discard (length init-lexenv) preserve-body-value)))
(defun byte-compile-let (form)
"Generate code for the `let' form FORM."
"Generate code for the `let' or `let*' form FORM."
(let ((clauses (cadr form))
(init-lexenv nil))
(when (eq (car form) 'let)
(init-lexenv nil)
(is-let (eq (car form) 'let)))
(when is-let
;; First compute the binding values in the old scope.
(dolist (var clauses)
(push (byte-compile-push-binding-init var) init-lexenv)))
@ -3946,28 +3971,20 @@ binding slots have been popped."
;; For `let', do it in reverse order, because it makes no
;; semantic difference, but it is a lot more efficient since the
;; values are now in reverse order on the stack.
(dolist (var (if (eq (car form) 'let) (reverse clauses) clauses))
(unless (eq (car form) 'let)
(dolist (var (if is-let (reverse clauses) clauses))
(unless is-let
(push (byte-compile-push-binding-init var) init-lexenv))
(let ((var (if (consp var) (car var) var)))
(cond ((null lexical-binding)
;; If there are no lexical bindings, we can do things simply.
(byte-compile-dynamic-variable-bind var))
((byte-compile-bind var init-lexenv)
(pop init-lexenv)))))
(if (byte-compile-bind var init-lexenv)
(pop init-lexenv))))
;; Emit the body.
(let ((init-stack-depth byte-compile-depth))
(byte-compile-body-do-effect (cdr (cdr form)))
;; Unbind the variables.
(if lexical-binding
;; Unbind both lexical and dynamic variables.
(progn
(cl-assert (or (eq byte-compile-depth init-stack-depth)
(eq byte-compile-depth (1+ init-stack-depth))))
(byte-compile-unbind clauses init-lexenv (> byte-compile-depth
init-stack-depth)))
;; Unbind dynamic variables.
(byte-compile-out 'byte-unbind (length clauses)))))))
;; Unbind both lexical and dynamic variables.
(cl-assert (or (eq byte-compile-depth init-stack-depth)
(eq byte-compile-depth (1+ init-stack-depth))))
(byte-compile-unbind clauses init-lexenv
(> byte-compile-depth init-stack-depth))))))

View file

@ -81,7 +81,6 @@
;; and other oddities.
;; - new byte codes for unwind-protect, catch, and condition-case so that
;; closures aren't needed at all.
;; - inline source code of different binding mode by first compiling it.
;; - a reference to a var that is known statically to always hold a constant
;; should be turned into a byte-constant rather than a byte-stack-ref.
;; Hmm... right, that's called constant propagation and could be done here,
@ -95,6 +94,7 @@
;; (defmacro dlet (binders &rest body)
;; ;; Works in both lexical and non-lexical mode.
;; (declare (indent 1) (debug let))
;; `(progn
;; ,@(mapcar (lambda (binder)
;; `(defvar ,(if (consp binder) (car binder) binder)))
@ -489,6 +489,7 @@ places where they originally did not directly appear."
(unless (fboundp 'byte-compile-not-lexical-var-p)
;; Only used to test the code in non-lexbind Emacs.
(defalias 'byte-compile-not-lexical-var-p 'boundp))
(defvar byte-compile-lexical-variables)
(defun cconv--analyse-use (vardata form varkind)
"Analyze the use of a variable.
@ -530,6 +531,7 @@ FORM is the parent form that binds this var."
;; outside of it.
(envcopy
(mapcar (lambda (vdata) (list (car vdata) nil nil nil nil)) env))
(byte-compile-bound-variables byte-compile-bound-variables)
(newenv envcopy))
;; Push it before recursing, so cconv-freevars-alist contains entries in
;; the order they'll be used by closure-convert-rec.
@ -541,6 +543,7 @@ FORM is the parent form that binds this var."
(format "Argument %S is not a lexical variable" arg)))
((eq ?& (aref (symbol-name arg) 0)) nil) ;Ignore &rest, &optional, ...
(t (let ((varstruct (list arg nil nil nil nil)))
(cl-pushnew arg byte-compile-lexical-variables)
(push (cons (list arg) (cdr varstruct)) newvars)
(push varstruct newenv)))))
(dolist (form body) ;Analyze body forms.
@ -579,6 +582,7 @@ and updates the data stored in ENV."
(let ((orig-env env)
(newvars nil)
(var nil)
(byte-compile-bound-variables byte-compile-bound-variables)
(value nil))
(dolist (binder binders)
(if (not (consp binder))
@ -592,6 +596,7 @@ and updates the data stored in ENV."
(cconv-analyse-form value (if (eq letsym 'let*) env orig-env)))
(unless (byte-compile-not-lexical-var-p var)
(cl-pushnew var byte-compile-lexical-variables)
(let ((varstruct (list var nil nil nil nil)))
(push (cons binder (cdr varstruct)) newvars)
(push varstruct env))))
@ -616,7 +621,8 @@ and updates the data stored in ENV."
(`((lambda . ,_) . ,_) ; First element is lambda expression.
(byte-compile-log-warning
"Use of deprecated ((lambda ...) ...) form" t :warning)
(format "Use of deprecated ((lambda %s ...) ...) form" (nth 1 (car form)))
t :warning)
(dolist (exp `((function ,(car form)) . ,(cdr form)))
(cconv-analyse-form exp env)))
@ -645,6 +651,7 @@ and updates the data stored in ENV."
(`(track-mouse . ,body)
(cconv--analyse-function () body env form))
(`(defvar ,var) (push var byte-compile-bound-variables))
(`(,(or `defconst `defvar) ,var ,value . ,_)
(push var byte-compile-bound-variables)
(cconv-analyse-form value env))
@ -668,7 +675,9 @@ and updates the data stored in ENV."
;; seem worth the trouble.
(dolist (form forms) (cconv-analyse-form form nil)))
(`(declare . ,_) nil) ;The args don't contain code.
;; `declare' should now be macro-expanded away (and if they're not, we're
;; in trouble because they *can* contain code nowadays).
;; (`(declare . ,_) nil) ;The args don't contain code.
(`(,_ . ,body-forms) ; First element is a function or whatever.
(dolist (form body-forms) (cconv-analyse-form form env)))

View file

@ -156,8 +156,8 @@ an element already on the list.
;; earlier and should have triggered them already.
(with-no-warnings ,place)
(setq ,place (cons ,var ,place))))
(list 'setq place (cl-list* 'cl-adjoin x place keys)))
(cl-list* 'cl-callf2 'cl-adjoin x place keys)))
`(setq ,place (cl-adjoin ,x ,place ,@keys)))
`(cl-callf2 cl-adjoin ,x ,place ,@keys)))
(defun cl--set-elt (seq n val)
(if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val)))

View file

@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'.
;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
;;;;;; "cl-macs" "cl-macs.el" "b839ad3781c4f2f849df0639b4eba166")
;;;;;; "cl-macs" "cl-macs.el" "fd824d987086eafec0b1cb2efa8312f4")
;;; Generated autoloads from cl-macs.el
(autoload 'cl--compiler-macro-list* "cl-macs" "\
@ -699,9 +699,10 @@ OPTION is either a single keyword or (KEYWORD VALUE) where
KEYWORD can be one of :conc-name, :constructor, :copier, :predicate,
:type, :named, :initial-offset, :print-function, or :include.
Each SLOT may instead take the form (SLOT SLOT-OPTS...), where
SLOT-OPTS are keyword-value pairs for that slot. Currently, only
one keyword is supported, `:read-only'. If this has a non-nil
Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
pairs for that slot.
Currently, only one keyword is supported, `:read-only'. If this has a non-nil
value, that slot cannot be set via `setf'.
\(fn NAME SLOTS...)" nil t)
@ -724,6 +725,8 @@ TYPE is a Common Lisp-style type specifier.
\(fn OBJECT TYPE)" nil nil)
(eval-and-compile (put 'cl-typep 'compiler-macro #'cl--compiler-macro-typep))
(autoload 'cl-check-type "cl-macs" "\
Verify that FORM is of type TYPE; signal an error if not.
STRING is an optional description of the desired type.

View file

@ -584,7 +584,7 @@ If `load' is in WHEN, BODY is evaluated when loaded after top-level compile.
If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level.
\(fn (WHEN...) BODY...)"
(declare (indent 1) (debug ((&rest &or "compile" "load" "eval") body)))
(declare (indent 1) (debug (sexp body)))
(if (and (fboundp 'cl--compiling-file) (cl--compiling-file)
(not cl--not-toplevel) (not (boundp 'for-effect))) ;Horrible kludge.
(let ((comp (or (memq 'compile when) (memq :compile-toplevel when)))
@ -2276,9 +2276,10 @@ OPTION is either a single keyword or (KEYWORD VALUE) where
KEYWORD can be one of :conc-name, :constructor, :copier, :predicate,
:type, :named, :initial-offset, :print-function, or :include.
Each SLOT may instead take the form (SLOT SLOT-OPTS...), where
SLOT-OPTS are keyword-value pairs for that slot. Currently, only
one keyword is supported, `:read-only'. If this has a non-nil
Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
pairs for that slot.
Currently, only one keyword is supported, `:read-only'. If this has a non-nil
value, that slot cannot be set via `setf'.
\(fn NAME SLOTS...)"
@ -2574,9 +2575,16 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc."
(defun cl-typep (object type) ; See compiler macro below.
"Check that OBJECT is of type TYPE.
TYPE is a Common Lisp-style type specifier."
(declare (compiler-macro cl--compiler-macro-typep))
(let ((cl--object object)) ;; Yuck!!
(eval (cl--make-type-test 'cl--object type))))
(defun cl--compiler-macro-typep (form val type)
(if (macroexp-const-p type)
(macroexp-let2 macroexp-copyable-p temp val
(cl--make-type-test temp (cl--const-expr-val type)))
form))
;;;###autoload
(defmacro cl-check-type (form type &optional string)
"Verify that FORM is of type TYPE; signal an error if not.
@ -2635,19 +2643,13 @@ and then returning foo."
(let ((p args) (res nil))
(while (consp p) (push (pop p) res))
(setq args (nconc (nreverse res) (and p (list '&rest p)))))
`(cl-eval-when (compile load eval)
(put ',func 'compiler-macro
(cl-function (lambda ,(if (memq '&whole args) (delq '&whole args)
(cons '_cl-whole-arg args))
,@body)))
;; This is so that describe-function can locate
;; the macro definition.
(let ((file ,(or buffer-file-name
(and (boundp 'byte-compile-current-file)
(stringp byte-compile-current-file)
byte-compile-current-file))))
(if file (put ',func 'compiler-macro-file
(purecopy (file-name-nondirectory file)))))))
(let ((fname (make-symbol (concat (symbol-name func) "--cmacro"))))
`(eval-and-compile
;; Name the compiler-macro function, so that `symbol-file' can find it.
(cl-defun ,fname ,(if (memq '&whole args) (delq '&whole args)
(cons '_cl-whole-arg args))
,@body)
(put ',func 'compiler-macro #',fname))))
;;;###autoload
(defun cl-compiler-macroexpand (form)
@ -2763,22 +2765,16 @@ surrounded by (cl-block NAME ...).
;;;###autoload
(defun cl--compiler-macro-adjoin (form a list &rest keys)
(if (and (cl--simple-expr-p a) (cl--simple-expr-p list)
(not (memq :key keys)))
`(if (cl-member ,a ,list ,@keys) ,list (cons ,a ,list))
form))
(if (memq :key keys) form
(macroexp-let2 macroexp-copyable-p va a
(macroexp-let2 macroexp-copyable-p vlist list
`(if (cl-member ,va ,vlist ,@keys) ,vlist (cons ,va ,vlist))))))
(defun cl--compiler-macro-get (_form sym prop &optional def)
(if def
`(cl-getf (symbol-plist ,sym) ,prop ,def)
`(get ,sym ,prop)))
(cl-define-compiler-macro cl-typep (&whole form val type)
(if (macroexp-const-p type)
(macroexp-let2 macroexp-copyable-p temp val
(cl--make-type-test temp (cl--const-expr-val type)))
form))
(dolist (y '(cl-first cl-second cl-third cl-fourth
cl-fifth cl-sixth cl-seventh
cl-eighth cl-ninth cl-tenth

View file

@ -472,6 +472,8 @@ the option `edebug-all-forms'."
(or (fboundp 'edebug-original-eval-defun)
(defalias 'edebug-original-eval-defun (symbol-function 'eval-defun)))
(defvar edebug-result) ; The result of the function call returned by body.
;; We should somehow arrange to be able to do this
;; without actually replacing the eval-defun command.
(defun edebug-eval-defun (edebug-it)
@ -487,7 +489,7 @@ With a prefix argument, instrument the code for Edebug.
Setting option `edebug-all-defs' to a non-nil value reverses the meaning
of the prefix argument. Code is then instrumented when this function is
invoked without a prefix argument
invoked without a prefix argument.
If acting on a `defun' for FUNCTION, and the function was instrumented,
`Edebug: FUNCTION' is printed in the minibuffer. If not instrumented,
@ -2106,7 +2108,6 @@ expressions; a `progn' form will be returned enclosing these forms."
(defvar edebug-coverage) ; the coverage results of each expression of function.
(defvar edebug-buffer) ; which buffer the function is in.
(defvar edebug-result) ; the result of the function call returned by body
(defvar edebug-outside-executing-macro)
(defvar edebug-outside-defining-kbd-macro)

View file

@ -93,6 +93,8 @@
;;; Code:
(eval-when-compile (require 'pcase))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Internal Variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -224,18 +226,11 @@ Some generic modes are defined in `generic-x.el'."
(funcall (intern mode)))
;;; Comment Functionality
(defun generic-mode-set-comments (comment-list)
"Set up comment functionality for generic mode."
(let ((st (make-syntax-table))
(chars nil)
(comstyles))
(make-local-variable 'comment-start)
(make-local-variable 'comment-start-skip)
(make-local-variable 'comment-end)
;; Go through all the comments
(defun generic--normalise-comments (comment-list)
(let ((normalized '()))
(dolist (start comment-list)
(let (end (comstyle ""))
(let (end)
;; Normalize
(when (consp start)
(setq end (cdr start))
@ -244,58 +239,79 @@ Some generic modes are defined in `generic-x.el'."
(cond
((characterp end) (setq end (char-to-string end)))
((zerop (length end)) (setq end "\n")))
(push (cons start end) normalized)))
(nreverse normalized)))
;; Setup the vars for `comment-region'
(if comment-start
;; We have already setup a comment-style, so use style b
(progn
(setq comstyle "b")
(setq comment-start-skip
(concat comment-start-skip "\\|" (regexp-quote start) "+\\s-*")))
;; First comment-style
(setq comment-start start)
(setq comment-end (if (string-equal end "\n") "" end))
(setq comment-start-skip (concat (regexp-quote start) "+\\s-*")))
(defun generic-set-comment-syntax (st comment-list)
"Set up comment functionality for generic mode."
(let ((chars nil)
(comstyles)
(comstyle "")
(comment-start nil))
;; Reuse comstyles if necessary
(setq comstyle
;; Go through all the comments.
(pcase-dolist (`(,start . ,end) comment-list)
(let ((comstyle
;; Reuse comstyles if necessary.
(or (cdr (assoc start comstyles))
(cdr (assoc end comstyles))
comstyle))
;; Otherwise, use a style not yet in use.
(if (not (rassoc "" comstyles)) "")
(if (not (rassoc "b" comstyles)) "b")
"c")))
(push (cons start comstyle) comstyles)
(push (cons end comstyle) comstyles)
;; Setup the syntax table
;; Setup the syntax table.
(if (= (length start) 1)
(modify-syntax-entry (string-to-char start)
(modify-syntax-entry (aref start 0)
(concat "< " comstyle) st)
(let ((c0 (elt start 0)) (c1 (elt start 1)))
;; Store the relevant info but don't update yet
(let ((c0 (aref start 0)) (c1 (aref start 1)))
;; Store the relevant info but don't update yet.
(push (cons c0 (concat (cdr (assoc c0 chars)) "1")) chars)
(push (cons c1 (concat (cdr (assoc c1 chars))
(concat "2" comstyle))) chars)))
(if (= (length end) 1)
(modify-syntax-entry (string-to-char end)
(modify-syntax-entry (aref end 0)
(concat ">" comstyle) st)
(let ((c0 (elt end 0)) (c1 (elt end 1)))
;; Store the relevant info but don't update yet
(let ((c0 (aref end 0)) (c1 (aref end 1)))
;; Store the relevant info but don't update yet.
(push (cons c0 (concat (cdr (assoc c0 chars))
(concat "3" comstyle))) chars)
(push (cons c1 (concat (cdr (assoc c1 chars)) "4")) chars)))))
;; Process the chars that were part of a 2-char comment marker
(with-syntax-table st ;For `char-syntax'.
(dolist (cs (nreverse chars))
(modify-syntax-entry (car cs)
(concat (char-to-string (char-syntax (car cs)))
" " (cdr cs))
st))
st)))))
(defun generic-set-comment-vars (comment-list)
(when comment-list
(setq-local comment-start (caar comment-list))
(setq-local comment-end
(let ((end (cdar comment-list)))
(if (string-equal end "\n") "" end)))
(setq-local comment-start-skip
(concat (regexp-opt (mapcar #'car comment-list))
"+[ \t]*"))
(setq-local comment-end-skip
(concat "[ \t]*" (regexp-opt (mapcar #'cdr comment-list))))))
(defun generic-mode-set-comments (comment-list)
"Set up comment functionality for generic mode."
(let ((st (make-syntax-table))
(comment-list (generic--normalise-comments comment-list)))
(generic-set-comment-syntax st comment-list)
(generic-set-comment-vars comment-list)
(set-syntax-table st)))
(defun generic-bracket-support ()
"Imenu support for [KEYWORD] constructs found in INF, INI and Samba files."
(setq imenu-generic-expression
'((nil "^\\[\\(.*\\)\\]" 1))
imenu-case-fold-search t))
(setq-local imenu-generic-expression '((nil "^\\[\\(.*\\)\\]" 1)))
(setq-local imenu-case-fold-search t))
;;;###autoload
(defun generic-make-keywords-list (keyword-list face &optional prefix suffix)
@ -306,6 +322,7 @@ expression that matches these keywords and concatenates it with
PREFIX and SUFFIX. Then it returns a construct based on this
regular expression that can be used as an element of
`font-lock-keywords'."
(declare (obsolete regexp-opt "24.4"))
(unless (listp keyword-list)
(error "Keywords argument must be a list of strings"))
(list (concat prefix "\\_<"

View file

@ -225,11 +225,13 @@ font-lock keywords will not be case sensitive."
(setq-local syntax-begin-function 'beginning-of-defun)
(setq font-lock-defaults
`((lisp-font-lock-keywords
lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
lisp-font-lock-keywords-1
lisp-font-lock-keywords-2)
nil ,keywords-case-insensitive nil nil
(font-lock-mark-block-function . mark-defun)
(font-lock-syntactic-face-function
. lisp-font-lock-syntactic-face-function))))
. lisp-font-lock-syntactic-face-function)))
(prog-prettify-install lisp--prettify-symbols-alist))
(defun lisp-outline-level ()
"Lisp mode `outline-level' function."
@ -448,6 +450,9 @@ All commands in `lisp-mode-shared-map' are inherited by this map.")
:type 'hook
:group 'lisp)
(defconst lisp--prettify-symbols-alist
'(("lambda" . )))
(define-derived-mode emacs-lisp-mode prog-mode "Emacs-Lisp"
"Major mode for editing Lisp code to run in Emacs.
Commands:

View file

@ -111,15 +111,20 @@ and also to avoid outputting the warning during normal execution."
(funcall (eval (cadr form)))
(byte-compile-constant nil)))
(defun macroexp--compiling-p ()
"Return non-nil if we're macroexpanding for the compiler."
;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this
;; macro-expansion will be processed by the byte-compiler, we check
;; circumstantial evidence.
(member '(declare-function . byte-compile-macroexpand-declare-function)
macroexpand-all-environment))
(defun macroexp--warn-and-return (msg form)
(let ((when-compiled (lambda () (byte-compile-log-warning msg t))))
(cond
((null msg) form)
;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this
;; macro-expansion will be processed by the byte-compiler, we check
;; circumstantial evidence.
((member '(declare-function . byte-compile-macroexpand-declare-function)
macroexpand-all-environment)
((macroexp--compiling-p)
`(progn
(macroexp--funcall-if-compiled ',when-compiled)
,form))

View file

@ -162,9 +162,11 @@ DESCRIPTION is the text of the news item."
description
archive-url))
(defun package-upload-buffer-internal (pkg-info extension &optional archive-url)
(declare-function lm-commentary "lisp-mnt" (&optional file))
(defun package-upload-buffer-internal (pkg-desc extension &optional archive-url)
"Upload a package whose contents are in the current buffer.
PKG-INFO is the package info, see `package-buffer-info'.
PKG-DESC is the `package-desc'.
EXTENSION is the file extension, a string. It can be either
\"el\" or \"tar\".
@ -196,18 +198,18 @@ if it exists."
(error "Aborted")))
(save-excursion
(save-restriction
(let* ((file-type (cond
((equal extension "el") 'single)
((equal extension "tar") 'tar)
(t (error "Unknown extension `%s'" extension))))
(file-name (aref pkg-info 0))
(pkg-name (intern file-name))
(requires (aref pkg-info 1))
(desc (if (string= (aref pkg-info 2) "")
(let* ((file-type (package-desc-kind pkg-desc))
(pkg-name (package-desc-name pkg-desc))
(requires (package-desc-reqs pkg-desc))
(desc (if (eq (package-desc-summary pkg-desc)
package--default-summary)
(read-string "Description of package: ")
(aref pkg-info 2)))
(pkg-version (aref pkg-info 3))
(commentary (aref pkg-info 4))
(package-desc-summary pkg-desc)))
(pkg-version (package-desc-version pkg-desc))
(commentary
(pcase file-type
(`single (lm-commentary))
(`tar nil))) ;; FIXME: Get it from the README file.
(split-version (version-to-list pkg-version))
(pkg-buffer (current-buffer)))
@ -215,7 +217,8 @@ if it exists."
;; from `package-archive-upload-base' otherwise.
(let ((contents (or (package--archive-contents-from-url archive-url)
(package--archive-contents-from-file)))
(new-desc (vector split-version requires desc file-type)))
(new-desc (package-make-ac-desc
split-version requires desc file-type)))
(if (> (car contents) package-archive-version)
(error "Unrecognized archive version %d" (car contents)))
(let ((elt (assq pkg-name (cdr contents))))
@ -232,6 +235,7 @@ if it exists."
;; this and the package itself. For now we assume ELPA is
;; writable via file primitives.
(let ((print-level nil)
(print-quoted t)
(print-length nil))
(write-region (concat (pp-to-string contents) "\n")
nil
@ -241,29 +245,29 @@ if it exists."
;; If there is a commentary section, write it.
(when commentary
(write-region commentary nil
(expand-file-name
(concat (symbol-name pkg-name) "-readme.txt")
package-archive-upload-base)))
(expand-file-name
(concat (symbol-name pkg-name) "-readme.txt")
package-archive-upload-base)))
(set-buffer pkg-buffer)
(write-region (point-min) (point-max)
(expand-file-name
(concat file-name "-" pkg-version "." extension)
(format "%s-%s.%s" pkg-name pkg-version extension)
package-archive-upload-base)
nil nil nil 'excl)
;; Write a news entry.
(and package-update-news-on-upload
archive-url
(package--update-news (concat file-name "." extension)
(package--update-news (format "%s.%s" pkg-name extension)
pkg-version desc archive-url))
;; special-case "package": write a second copy so that the
;; installer can easily find the latest version.
(if (string= file-name "package")
(if (eq pkg-name 'package)
(write-region (point-min) (point-max)
(expand-file-name
(concat file-name "." extension)
(format "%s.%s" pkg-name extension)
package-archive-upload-base)
nil nil nil 'ask))))))))
@ -275,8 +279,8 @@ destination, prompt for one."
(save-excursion
(save-restriction
;; Find the package in this buffer.
(let ((pkg-info (package-buffer-info)))
(package-upload-buffer-internal pkg-info "el")))))
(let ((pkg-desc (package-buffer-info)))
(package-upload-buffer-internal pkg-desc "el")))))
(defun package-upload-file (file)
"Upload the Emacs Lisp package FILE to the package archive.
@ -288,12 +292,13 @@ destination, prompt for one."
(interactive "fPackage file name: ")
(with-temp-buffer
(insert-file-contents-literally file)
(let ((info (cond
((string-match "\\.tar$" file) (package-tar-file-info file))
((string-match "\\.el$" file) (package-buffer-info))
(t (error "Unrecognized extension `%s'"
(file-name-extension file))))))
(package-upload-buffer-internal info (file-name-extension file)))))
(let ((pkg-desc
(cond
((string-match "\\.tar\\'" file) (package-tar-file-info file))
((string-match "\\.el\\'" file) (package-buffer-info))
(t (error "Unrecognized extension `%s'"
(file-name-extension file))))))
(package-upload-buffer-internal pkg-desc (file-name-extension file)))))
(defun package-gnus-summary-upload ()
"Upload a package contained in the current *Article* buffer.

View file

@ -170,6 +170,8 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
(require 'tabulated-list)
(defgroup package nil
@ -262,11 +264,8 @@ Lower version numbers than this will probably be understood as well.")
;; We don't prime the cache since it tends to get out of date.
(defvar package-archive-contents nil
"Cache of the contents of the Emacs Lisp Package Archive.
This is an alist mapping package names (symbols) to package
descriptor vectors. These are like the vectors for `package-alist'
but have extra entries: one which is 'tar for tar packages and
'single for single-file packages, and one which is the name of
the archive from which it came.")
This is an alist mapping package names (symbols) to
`package--desc' structures.")
(put 'package-archive-contents 'risky-local-variable t)
(defcustom package-user-dir (locate-user-emacs-file "elpa")
@ -297,6 +296,62 @@ contrast, `package-user-dir' contains packages for personal use."
:group 'package
:version "24.1")
(defvar package--default-summary "No description available.")
(cl-defstruct (package-desc
;; Rename the default constructor from `make-package-desc'.
(:constructor package-desc-create)
;; Has the same interface as the old `define-package',
;; which is still used in the "foo-pkg.el" files. Extra
;; options can be supported by adding additional keys.
(:constructor
package-desc-from-define
(name-string version-string &optional summary requirements
&key kind archive
&aux
(name (intern name-string))
(version (version-to-list version-string))
(reqs (mapcar #'(lambda (elt)
(list (car elt)
(version-to-list (cadr elt))))
(if (eq 'quote (car requirements))
(nth 1 requirements)
requirements))))))
"Structure containing information about an individual package.
Slots:
`name' Name of the package, as a symbol.
`version' Version of the package, as a version list.
`summary' Short description of the package, typically taken from
the first line of the file.
`reqs' Requirements of the package. A list of (PACKAGE
VERSION-LIST) naming the dependent package and the minimum
required version.
`kind' The distribution format of the package. Currently, it is
either `single' or `tar'.
`archive' The name of the archive (as a string) whence this
package came."
name
version
(summary package--default-summary)
reqs
kind
archive)
;; Package descriptor format used in finder-inf.el and package--builtins.
(cl-defstruct (package--bi-desc
(:constructor package-make-builtin (version summary))
(:type vector))
version
reqs
summary)
;; The value is precomputed in finder-inf.el, but don't load that
;; until it's needed (i.e. when `package-initialize' is called).
(defvar package--builtins nil
@ -305,27 +360,14 @@ The actual value is initialized by loading the library
`finder-inf'; this is not done until it is needed, e.g. by the
function `package-built-in-p'.
Each element has the form (PKG . DESC), where PKG is a package
name (a symbol) and DESC is a vector that describes the package.
The vector DESC has the form [VERSION-LIST REQS DOCSTRING].
VERSION-LIST is a version list.
REQS is a list of packages required by the package, each
requirement having the form (NAME VL), where NAME is a string
and VL is a version list.
DOCSTRING is a brief description of the package.")
Each element has the form (PKG . PACKAGE-BI-DESC), where PKG is a package
name (a symbol) and DESC is a `package--bi-desc' structure.")
(put 'package--builtins 'risky-local-variable t)
(defvar package-alist nil
"Alist of all packages available for activation.
Each element has the form (PKG . DESC), where PKG is a package
name (a symbol) and DESC is a vector that describes the package.
The vector DESC has the form [VERSION-LIST REQS DOCSTRING].
VERSION-LIST is a version list.
REQS is a list of packages required by the package, each
requirement having the form (NAME VL) where NAME is a string
and VL is a version list.
DOCSTRING is a brief description of the package.
name (a symbol) and DESC is a `package-desc' structure.
This variable is set automatically by `package-load-descriptor',
called via `package-initialize'. To change which packages are
@ -339,7 +381,10 @@ loaded and/or activated, customize `package-load-list'.")
(defvar package-obsolete-alist nil
"Representation of obsolete packages.
Like `package-alist', but maps package name to a second alist.
The inner alist is keyed by version.")
The inner alist is keyed by version.
Each element of the list is (NAME . VERSION-ALIST), where each
entry in VERSION-ALIST is (VERSION-LIST . PACKAGE-DESC).")
(put 'package-obsolete-alist 'risky-local-variable t)
(defun package-version-join (vlist)
@ -430,26 +475,16 @@ the package by calling `package-load-descriptor'."
;; Actually load the descriptor:
(package-load-descriptor dir subdir))))
(defsubst package-desc-vers (desc)
"Extract version from a package description vector."
(aref desc 0))
(define-obsolete-function-alias 'package-desc-vers 'package-desc-version "24.4")
(defsubst package-desc-reqs (desc)
"Extract requirements from a package description vector."
(aref desc 1))
(define-obsolete-function-alias 'package-desc-doc 'package-desc-summary "24.4")
(defsubst package-desc-doc (desc)
"Extract doc string from a package description vector."
(aref desc 2))
(defsubst package-desc-kind (desc)
"Extract the kind of download from an archive package description vector."
(aref desc 3))
(defun package--dir (name version)
;; FIXME: Keep this as a field in the package-desc.
"Return the directory where a package is installed, or nil if none.
NAME and VERSION are both strings."
(let* ((subdir (concat name "-" version))
NAME is a symbol and VERSION is a string."
(let* ((subdir (format "%s-%s" name version))
(dir-list (cons package-user-dir package-directory-list))
pkg-dir)
(while dir-list
@ -460,9 +495,9 @@ NAME and VERSION are both strings."
(setq dir-list (cdr dir-list)))))
pkg-dir))
(defun package-activate-1 (package pkg-vec)
(let* ((name (symbol-name package))
(version-str (package-version-join (package-desc-vers pkg-vec)))
(defun package-activate-1 (pkg-desc)
(let* ((name (package-desc-name pkg-desc))
(version-str (package-version-join (package-desc-version pkg-desc)))
(pkg-dir (package--dir name version-str)))
(unless pkg-dir
(error "Internal error: unable to find directory for `%s-%s'"
@ -475,8 +510,8 @@ NAME and VERSION are both strings."
(push pkg-dir Info-directory-list))
;; Add to load path, add autoloads, and activate the package.
(push pkg-dir load-path)
(load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
(push package package-activated-list)
(load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t)
(push name package-activated-list)
;; Don't return nil.
t))
@ -489,7 +524,12 @@ specifying the minimum acceptable version."
(version-list-<= min-version (version-to-list emacs-version))
(let ((elt (assq package package--builtins)))
(and elt (version-list-<= min-version
(package-desc-vers (cdr elt)))))))
(package--bi-desc-version (cdr elt)))))))
(defun package--from-builtin (bi-desc)
(package-desc-create :name (pop bi-desc)
:version (package--bi-desc-version bi-desc)
:summary (package--bi-desc-summary bi-desc)))
;; This function goes ahead and activates a newer version of a package
;; if an older one was already activated. This is not ideal; we'd at
@ -504,7 +544,7 @@ Return nil if the package could not be activated."
available-version found)
;; Check if PACKAGE is available in `package-alist'.
(when pkg-vec
(setq available-version (package-desc-vers pkg-vec)
(setq available-version (package-desc-version pkg-vec)
found (version-list-<= min-version available-version)))
(cond
;; If no such package is found, maybe it's built-in.
@ -525,7 +565,7 @@ Return nil if the package could not be activated."
Required package `%s-%s' is unavailable"
package (car fail) (package-version-join (cadr fail)))
;; If all goes well, activate the package itself.
(package-activate-1 package pkg-vec)))))))
(package-activate-1 pkg-vec)))))))
(defun package-mark-obsolete (package pkg-vec)
"Put package on the obsolete list, if not already there."
@ -533,11 +573,11 @@ Required package `%s-%s' is unavailable"
(if elt
;; If this obsolete version does not exist in the list, update
;; it the list.
(unless (assoc (package-desc-vers pkg-vec) (cdr elt))
(setcdr elt (cons (cons (package-desc-vers pkg-vec) pkg-vec)
(unless (assoc (package-desc-version pkg-vec) (cdr elt))
(setcdr elt (cons (cons (package-desc-version pkg-vec) pkg-vec)
(cdr elt))))
;; Make a new association.
(push (cons package (list (cons (package-desc-vers pkg-vec)
(push (cons package (list (cons (package-desc-version pkg-vec)
pkg-vec)))
package-obsolete-alist))))
@ -555,21 +595,17 @@ REQUIREMENTS is a list of dependencies on other packages.
EXTRA-PROPERTIES is currently unused."
(let* ((name (intern name-string))
(version (version-to-list version-string))
(new-pkg-desc
(cons name
(vector version
(mapcar
(lambda (elt)
(list (car elt)
(version-to-list (car (cdr elt)))))
requirements)
docstring)))
(new-pkg-desc (cons name
(package-desc-from-define name-string
version-string
docstring
requirements)))
(old-pkg (assq name package-alist)))
(cond
;; If there's no old package, just add this to `package-alist'.
((null old-pkg)
(push new-pkg-desc package-alist))
((version-list-< (package-desc-vers (cdr old-pkg)) version)
((version-list-< (package-desc-version (cdr old-pkg)) version)
;; Remove the old package and declare it obsolete.
(package-mark-obsolete name (cdr old-pkg))
(setq package-alist (cons new-pkg-desc
@ -577,7 +613,7 @@ EXTRA-PROPERTIES is currently unused."
;; You can have two packages with the same version, e.g. one in
;; the system package directory and one in your private
;; directory. We just let the first one win.
((not (version-list-= (package-desc-vers (cdr old-pkg)) version))
((not (version-list-= (package-desc-version (cdr old-pkg)) version))
;; The package is born obsolete.
(package-mark-obsolete name (cdr new-pkg-desc))))))
@ -603,14 +639,15 @@ EXTRA-PROPERTIES is currently unused."
(defun package-generate-autoloads (name pkg-dir)
(require 'autoload) ;Load before we let-bind generated-autoload-file!
(let* ((auto-name (concat name "-autoloads.el"))
(let* ((auto-name (format "%s-autoloads.el" name))
;;(ignore-name (concat name "-pkg.el"))
(generated-autoload-file (expand-file-name auto-name pkg-dir))
(version-control 'never))
(package-autoload-ensure-default-file generated-autoload-file)
(update-directory-autoloads pkg-dir)
(let ((buf (find-buffer-visiting generated-autoload-file)))
(when buf (kill-buffer buf)))))
(when buf (kill-buffer buf)))
auto-name))
(defvar tar-parse-info)
(declare-function tar-untar-buffer "tar-mode" ())
@ -644,57 +681,62 @@ untar into a directory named DIR; otherwise, signal an error."
;; FIXME: should we delete PKG-DIR if it exists?
(let* ((default-directory (file-name-as-directory package-user-dir)))
(package-untar-buffer dirname)
(package--make-autoloads-and-compile name pkg-dir))))
(package--make-autoloads-and-compile package pkg-dir))))
(defun package--make-autoloads-and-compile (name pkg-dir)
"Generate autoloads and do byte-compilation for package named NAME.
PKG-DIR is the name of the package directory."
(package-generate-autoloads name pkg-dir)
(let ((load-path (cons pkg-dir load-path)))
(let ((auto-name (package-generate-autoloads name pkg-dir))
(load-path (cons pkg-dir load-path)))
;; We must load the autoloads file before byte compiling, in
;; case there are magic cookies to set up non-trivial paths.
(load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
(load auto-name nil t)
;; FIXME: Compilation should be done as a separate, optional, step.
;; E.g. for multi-package installs, we should first install all packages
;; and then compile them.
(byte-recompile-directory pkg-dir 0 t)))
(defun package--write-file-no-coding (file-name)
(let ((buffer-file-coding-system 'no-conversion))
(write-region (point-min) (point-max) file-name)))
(defun package-unpack-single (file-name version desc requires)
(defun package-unpack-single (name version desc requires)
"Install the contents of the current buffer as a package."
;; Special case "package".
(if (string= file-name "package")
;; Special case "package". FIXME: Should this still be supported?
(if (eq name 'package)
(package--write-file-no-coding
(expand-file-name (concat file-name ".el") package-user-dir))
(let* ((pkg-dir (expand-file-name (concat file-name "-"
(expand-file-name (format "%s.el" name) package-user-dir))
(let* ((pkg-dir (expand-file-name (format "%s-%s" name
(package-version-join
(version-to-list version)))
package-user-dir))
(el-file (expand-file-name (concat file-name ".el") pkg-dir))
(pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir)))
(el-file (expand-file-name (format "%s.el" name) pkg-dir))
(pkg-file (expand-file-name (format "%s-pkg.el" name) pkg-dir)))
(make-directory pkg-dir t)
(package--write-file-no-coding el-file)
(let ((print-level nil)
(print-quoted t)
(print-length nil))
(write-region
(concat
(prin1-to-string
(list 'define-package
file-name
(symbol-name name)
version
desc
(list 'quote
;; Turn version lists into string form.
(mapcar
(lambda (elt)
(list (car elt)
(package-version-join (cadr elt))))
requires))))
(when requires ;Don't bother quoting nil.
(list 'quote
;; Turn version lists into string form.
(mapcar
(lambda (elt)
(list (car elt)
(package-version-join (cadr elt))))
requires)))))
"\n")
nil
pkg-file
nil nil nil 'excl))
(package--make-autoloads-and-compile file-name pkg-dir))))
(package--make-autoloads-and-compile name pkg-dir))))
(defmacro package--with-work-buffer (location file &rest body)
"Run BODY in a buffer containing the contents of FILE at LOCATION.
@ -744,7 +786,7 @@ It will move point to somewhere in the headers."
(let ((location (package-archive-base name))
(file (concat (symbol-name name) "-" version ".el")))
(package--with-work-buffer location file
(package-unpack-single (symbol-name name) version desc requires))))
(package-unpack-single name version desc requires))))
(defun package-download-tar (name version)
"Download and install a tar package."
@ -762,7 +804,7 @@ MIN-VERSION should be a version list."
(let ((pkg-desc (assq package package-alist)))
(if pkg-desc
(version-list-<= min-version
(package-desc-vers (cdr pkg-desc)))
(package-desc-version (cdr pkg-desc)))
;; Also check built-in packages.
(package-built-in-p package min-version))))
@ -785,7 +827,7 @@ not included in this list."
(unless (package-installed-p next-pkg next-version)
;; A package is required, but not installed. It might also be
;; blocked via `package-load-list'.
(let ((pkg-desc (assq next-pkg package-archive-contents))
(let ((pkg-desc (cdr (assq next-pkg package-archive-contents)))
hold)
(when (setq hold (assq next-pkg package-load-list))
(setq hold (cadr hold))
@ -805,17 +847,17 @@ but version %s required"
(symbol-name next-pkg)
(package-version-join next-version)))
(unless (version-list-<= next-version
(package-desc-vers (cdr pkg-desc)))
(package-desc-version pkg-desc))
(error
"Need package `%s-%s', but only %s is available"
(symbol-name next-pkg) (package-version-join next-version)
(package-version-join (package-desc-vers (cdr pkg-desc)))))
(package-version-join (package-desc-version pkg-desc))))
;; Move to front, so it gets installed early enough (bug#14082).
(setq package-list (cons next-pkg (delq next-pkg package-list)))
(setq package-list
(package-compute-transaction package-list
(package-desc-reqs
(cdr pkg-desc))))))))
pkg-desc)))))))
package-list)
(defun package-read-from-string (str)
@ -867,13 +909,29 @@ If the archive version is too new, signal an error."
(dolist (package contents)
(package--add-to-archive-contents package archive)))))
;; Package descriptor objects used inside the "archive-contents" file.
;; Changing this defstruct implies changing the format of the
;; "archive-contents" files.
(cl-defstruct (package--ac-desc
(:constructor package-make-ac-desc (version reqs summary kind))
(:copier nil)
(:type vector))
version reqs summary kind)
(defun package--add-to-archive-contents (package archive)
"Add the PACKAGE from the given ARCHIVE if necessary.
Also, add the originating archive to the end of the package vector."
(let* ((name (car package))
(version (package-desc-vers (cdr package)))
(entry (cons name
(vconcat (cdr package) (vector archive))))
PACKAGE should have the form (NAME . PACKAGE--AC-DESC).
Also, add the originating archive to the `package-desc' structure."
(let* ((name (car package))
(pkg-desc
(package-desc-create
:name name
:version (package--ac-desc-version (cdr package))
:reqs (package--ac-desc-reqs (cdr package))
:summary (package--ac-desc-summary (cdr package))
:kind (package--ac-desc-kind (cdr package))
:archive archive))
(entry (cons name pkg-desc))
(existing-package (assq name package-archive-contents))
(pinned-to-archive (assoc name package-pinned-packages)))
(cond ((and pinned-to-archive
@ -881,9 +939,9 @@ Also, add the originating archive to the end of the package vector."
(not (equal (cdr pinned-to-archive) archive)))
nil)
((not existing-package)
(add-to-list 'package-archive-contents entry))
((version-list-< (package-desc-vers (cdr existing-package))
version)
(push entry package-archive-contents))
((version-list-< (package-desc-version (cdr existing-package))
(package-desc-version pkg-desc))
;; Replace the entry with this one.
(setq package-archive-contents
(cons entry
@ -902,14 +960,14 @@ using `package-compute-transaction'."
;; `package-load-list', download the held version.
(hold (cadr (assq elt package-load-list)))
(v-string (or (and (stringp hold) hold)
(package-version-join (package-desc-vers desc))))
(package-version-join (package-desc-version desc))))
(kind (package-desc-kind desc)))
(cond
((eq kind 'tar)
(package-download-tar elt v-string))
((eq kind 'single)
(package-download-single elt v-string
(package-desc-doc desc)
(package-desc-summary desc)
(package-desc-reqs desc)))
(t
(error "Unknown package kind: %s" (symbol-name kind))))
@ -961,17 +1019,7 @@ Otherwise return nil."
(error nil))))
(defun package-buffer-info ()
"Return a vector describing the package in the current buffer.
The vector has the form
[FILENAME REQUIRES DESCRIPTION VERSION COMMENTARY]
FILENAME is the file name, a string, sans the \".el\" extension.
REQUIRES is a list of requirements, each requirement having the
form (NAME VER); NAME is a string and VER is a version list.
DESCRIPTION is the package description, a string.
VERSION is the version, a string.
COMMENTARY is the commentary section, a string, or nil if none.
"Return a `package-desc' describing the package in the current buffer.
If the buffer does not contain a conforming package, signal an
error. If there is a package, narrow the buffer to the file's
@ -990,25 +1038,18 @@ boundaries."
(require 'lisp-mnt)
;; Use some headers we've invented to drive the process.
(let* ((requires-str (lm-header "package-requires"))
(requires (if requires-str
(package-read-from-string requires-str)))
;; Prefer Package-Version; if defined, the package author
;; probably wants us to use it. Otherwise try Version.
(pkg-version
(or (package-strip-rcs-id (lm-header "package-version"))
(package-strip-rcs-id (lm-header "version"))))
(commentary (lm-commentary)))
(package-strip-rcs-id (lm-header "version")))))
(unless pkg-version
(error
"Package lacks a \"Version\" or \"Package-Version\" header"))
;; Turn string version numbers into list form.
(setq requires
(mapcar
(lambda (elt)
(list (car elt)
(version-to-list (car (cdr elt)))))
requires))
(vector file-name requires desc pkg-version commentary))))
(package-desc-from-define
file-name pkg-version desc
(if requires-str (package-read-from-string requires-str))
:kind 'single))))
(defun package-tar-file-info (file)
"Find package information for a tar file.
@ -1025,67 +1066,46 @@ The return result is a vector like `package-buffer-info'."
(pkg-def-contents (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/"
pkg-name "-pkg.el")))
(pkg-def-parsed (package-read-from-string pkg-def-contents)))
(unless (eq (car pkg-def-parsed) 'define-package)
(error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
(let ((name-str (nth 1 pkg-def-parsed))
(version-string (nth 2 pkg-def-parsed))
(docstring (nth 3 pkg-def-parsed))
(requires (nth 4 pkg-def-parsed))
(readme (shell-command-to-string
;; Requires GNU tar.
(concat "tar -xOf " file " "
pkg-name "-" pkg-version "/README"))))
(unless (equal pkg-version version-string)
(let ((pkg-desc
(apply #'package-desc-from-define (append (cdr pkg-def-parsed)
'(:kind tar)))))
(unless (equal pkg-version
(package-version-join (package-desc-version pkg-desc)))
(error "Package has inconsistent versions"))
(unless (equal pkg-name name-str)
(unless (equal pkg-name (symbol-name (package-desc-name pkg-desc)))
(error "Package has inconsistent names"))
;; Kind of a hack.
(if (string-match ": Not found in archive" readme)
(setq readme nil))
;; Turn string version numbers into list form.
(if (eq (car requires) 'quote)
(setq requires (car (cdr requires))))
(setq requires
(mapcar (lambda (elt)
(list (car elt)
(version-to-list (cadr elt))))
requires))
(vector pkg-name requires docstring version-string readme)))))
pkg-desc))))
;;;###autoload
(defun package-install-from-buffer (pkg-info type)
(defun package-install-from-buffer (pkg-desc)
"Install a package from the current buffer.
When called interactively, the current buffer is assumed to be a
single .el file that follows the packaging guidelines; see info
node `(elisp)Packaging'.
When called from Lisp, PKG-INFO is a vector describing the
information, of the type returned by `package-buffer-info'; and
TYPE is the package type (either `single' or `tar')."
(interactive (list (package-buffer-info) 'single))
When called from Lisp, PKG-DESC is a `package-desc' describing the
information)."
(interactive (list (package-buffer-info)))
(save-excursion
(save-restriction
(let* ((file-name (aref pkg-info 0))
(requires (aref pkg-info 1))
(desc (if (string= (aref pkg-info 2) "")
"No description available."
(aref pkg-info 2)))
(pkg-version (aref pkg-info 3)))
(let* ((name (package-desc-name pkg-desc))
(requires (package-desc-reqs pkg-desc))
(desc (package-desc-summary pkg-desc))
(pkg-version (package-desc-version pkg-desc)))
;; Download and install the dependencies.
(let ((transaction (package-compute-transaction nil requires)))
(package-download-transaction transaction))
;; Install the package itself.
(cond
((eq type 'single)
(package-unpack-single file-name pkg-version desc requires))
((eq type 'tar)
(package-unpack (intern file-name) pkg-version))
(t
(error "Unknown type: %s" (symbol-name type))))
(pcase (package-desc-kind pkg-desc)
(`single (package-unpack-single name pkg-version desc requires))
(`tar (package-unpack name pkg-version))
(type (error "Unknown type: %S" type)))
;; Try to activate it.
(package-initialize)))))
@ -1097,10 +1117,10 @@ The file can either be a tar file or an Emacs Lisp file."
(with-temp-buffer
(insert-file-contents-literally file)
(cond
((string-match "\\.el$" file)
(package-install-from-buffer (package-buffer-info) 'single))
((string-match "\\.tar$" file)
(package-install-from-buffer (package-tar-file-info file) 'tar))
((string-match "\\.el\\'" file)
(package-install-from-buffer (package-buffer-info)))
((string-match "\\.tar\\'" file)
(package-install-from-buffer (package-tar-file-info file)))
(t (error "Unrecognized extension `%s'" (file-name-extension file))))))
(defun package-delete (name version)
@ -1118,7 +1138,7 @@ The file can either be a tar file or an Emacs Lisp file."
(defun package-archive-base (name)
"Return the archive containing the package NAME."
(let ((desc (cdr (assq (intern-soft name) package-archive-contents))))
(cdr (assoc (aref desc (- (length desc) 1)) package-archives))))
(cdr (assoc (package-desc-archive desc) package-archives))))
(defun package--download-one-archive (archive file)
"Retrieve an archive file FILE from ARCHIVE, and cache it.
@ -1163,7 +1183,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(package-read-all-archive-contents)
(unless no-activate
(dolist (elt package-alist)
(package-activate (car elt) (package-desc-vers (cdr elt)))))
(package-activate (car elt) (package-desc-version (cdr elt)))))
(setq package--initialized t))
@ -1210,22 +1230,22 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(cond
;; Loaded packages are in `package-alist'.
((setq desc (cdr (assq package package-alist)))
(setq version (package-version-join (package-desc-vers desc)))
(setq version (package-version-join (package-desc-version desc)))
(if (setq pkg-dir (package--dir package-name version))
(insert "an installed package.\n\n")
;; This normally does not happen.
(insert "a deleted package.\n\n")))
;; Available packages are in `package-archive-contents'.
((setq desc (cdr (assq package package-archive-contents)))
(setq version (package-version-join (package-desc-vers desc))
archive (aref desc (- (length desc) 1))
(setq version (package-version-join (package-desc-version desc))
archive (package-desc-archive desc)
installable t)
(if built-in
(insert "a built-in package.\n\n")
(insert "an uninstalled package.\n\n")))
(built-in
(setq desc (cdr built-in)
version (package-version-join (package-desc-vers desc)))
(setq desc (package--from-builtin built-in)
version (package-version-join (package-desc-version desc)))
(insert "a built-in package.\n\n"))
(t
(insert "an orphan package.\n\n")))
@ -1246,7 +1266,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(insert "'.")))
(installable
(if built-in
(insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face)
(insert (propertize "Built-in."
'font-lock-face 'font-lock-builtin-face)
" Alternate version available")
(insert "Available"))
(insert " from " archive)
@ -1261,7 +1282,8 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
'package-symbol package
'action 'package-install-button-action)))
(built-in
(insert (propertize "Built-in." 'font-lock-face 'font-lock-builtin-face)))
(insert (propertize "Built-in."
'font-lock-face 'font-lock-builtin-face)))
(t (insert "Deleted.")))
(insert "\n")
(and version (> (length version) 0)
@ -1286,7 +1308,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(help-insert-xref-button text 'help-package name))
(insert "\n")))
(insert " " (propertize "Summary" 'font-lock-face 'bold)
": " (if desc (package-desc-doc desc)) "\n\n")
": " (if desc (package-desc-summary desc)) "\n\n")
(if built-in
;; For built-in packages, insert the commentary.
@ -1418,10 +1440,10 @@ If the alist stored in the symbol LISTNAME lacks an entry for a
package PACKAGE with descriptor DESC, add one. The alist is
keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is
a symbol and VERSION-LIST is a version list."
`(let* ((version (package-desc-vers ,desc))
`(let* ((version (package-desc-version ,desc))
(key (cons ,package version)))
(unless (assoc key ,listname)
(push (list key ,status (package-desc-doc ,desc)) ,listname))))
(push (list key ,status (package-desc-summary ,desc)) ,listname))))
(defun package-menu--generate (remember-pos packages)
"Populate the Package Menu.
@ -1444,7 +1466,7 @@ or a list of package names (symbols) to display."
(setq name (car elt))
(when (and (not (eq name 'emacs)) ; Hide the `emacs' package.
(or (eq packages t) (memq name packages)))
(package--push name (cdr elt) "built-in" info-list)))
(package--push name (package--from-builtin elt) "built-in" info-list)))
;; Available and disabled packages:
(dolist (elt package-archive-contents)

View file

@ -957,7 +957,7 @@ If non-nil, it will blink not only for \"begin..end\" but also for \"if...else\"
(let ((ender (funcall smie-backward-token-function)))
(cond
((not (and ender (rassoc ender smie-closer-alist)))
;; This not is one of the begin..end we know how to check.
;; This is not one of the begin..end we know how to check.
(blink-matching-check-mismatch start end))
((not start) t)
((eq t (car (rassoc ender smie-closer-alist))) nil)
@ -1012,6 +1012,9 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
(or (eq (char-before) last-command-event)
(not (memq (char-before)
smie-blink-matching-triggers)))
;; FIXME: For octave's "switch ... case ... case" we flash
;; `switch' at the end of the first `case' and we burp
;; "mismatch" at the end of the second `case'.
(or smie-blink-matching-inners
(not (numberp (nth 2 (assoc token smie-grammar))))))
;; The major mode might set blink-matching-check-function
@ -1021,87 +1024,90 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
(let ((blink-matching-check-function #'smie-blink-matching-check))
(blink-matching-open))))))))
(defface smie-matching-block-highlight '((t (:inherit highlight)))
"Face used to highlight matching block."
:group 'smie)
(defvar-local smie--matching-block-data-cache nil)
(defvar smie--highlight-matching-block-overlay nil)
(defvar-local smie--highlight-matching-block-lastpos -1)
(defun smie--opener/closer-at-point ()
"Return (OPENER TOKEN START END) or nil.
OPENER is non-nil if TOKEN is an opener and nil if it's a closer."
(let* ((start (point))
;; Move to a previous position outside of a token.
(_ (funcall smie-backward-token-function))
;; Move to the end of the token before point.
(btok (funcall smie-forward-token-function))
(bend (point)))
(cond
;; Token before point is a closer?
((and (>= bend start) (rassoc btok smie-closer-alist))
(funcall smie-backward-token-function)
(when (< (point) start)
(prog1 (list nil btok (point) bend)
(goto-char bend))))
;; Token around point is an opener?
((and (> bend start) (assoc btok smie-closer-alist))
(funcall smie-backward-token-function)
(when (<= (point) start) (list t btok (point) bend)))
((<= bend start)
(let ((atok (funcall smie-forward-token-function))
(aend (point)))
(cond
((< aend start) nil) ;Hopefully shouldn't happen.
;; Token after point is a closer?
((assoc atok smie-closer-alist)
(funcall smie-backward-token-function)
(when (<= (point) start)
(list t atok (point) aend)))))))))
(defun smie-highlight-matching-block ()
(when (and smie-closer-alist
(/= (point) smie--highlight-matching-block-lastpos))
(unless (overlayp smie--highlight-matching-block-overlay)
(setq smie--highlight-matching-block-overlay
(make-overlay (point) (point))))
(setq smie--highlight-matching-block-lastpos (point))
(let ((beg-of-tok
(lambda (&optional start)
"Move to the beginning of current token at START."
(let* ((token)
(start (or start (point)))
(beg (progn
(defun smie--matching-block-data (orig &rest args)
"A function suitable for `show-paren-data-function' (which see)."
(if (or (null smie-closer-alist)
(eq (point) (car smie--matching-block-data-cache)))
(or (cdr smie--matching-block-data-cache)
(apply orig args))
(setq smie--matching-block-data-cache (list (point)))
(unless (nth 8 (syntax-ppss))
(condition-case nil
(let ((here (smie--opener/closer-at-point)))
(when (and here
(or smie-blink-matching-inners
(not (numberp
(nth (if (nth 0 here) 1 2)
(assoc (nth 1 here) smie-grammar))))))
(let ((there
(cond
((car here) ; Opener.
(let ((data (smie-forward-sexp 'halfsexp))
(tend (point)))
(unless (car data)
(funcall smie-backward-token-function)
(forward-comment (point-max))
(point)))
(end (progn
(setq token (funcall smie-forward-token-function))
(forward-comment (- (point)))
(point))))
(if (and (<= beg start) (<= start end)
(or (assoc token smie-closer-alist)
(rassoc token smie-closer-alist)))
(progn (goto-char beg) token)
(goto-char start)
nil))))
(highlight
(lambda (beg end)
(move-overlay smie--highlight-matching-block-overlay
beg end (current-buffer))
(overlay-put smie--highlight-matching-block-overlay
'face 'smie-matching-block-highlight))))
(overlay-put smie--highlight-matching-block-overlay 'face nil)
(unless (nth 8 (syntax-ppss))
(save-excursion
(condition-case nil
(let ((token
(or (funcall beg-of-tok)
(funcall beg-of-tok
(prog1 (point)
(funcall smie-forward-token-function))))))
(cond
((assoc token smie-closer-alist) ; opener
(forward-sexp 1)
(let ((end (point))
(closer (funcall smie-backward-token-function)))
(when (rassoc closer smie-closer-alist)
(funcall highlight (point) end))))
((rassoc token smie-closer-alist) ; closer
(funcall smie-forward-token-function)
(forward-sexp -1)
(let ((beg (point))
(opener (funcall smie-forward-token-function)))
(when (assoc opener smie-closer-alist)
(funcall highlight beg (point)))))))
(scan-error)))))))
(defvar smie--highlight-matching-block-timer nil)
;;;###autoload
(define-minor-mode smie-highlight-matching-block-mode nil
:global t :group 'smie
(when (timerp smie--highlight-matching-block-timer)
(cancel-timer smie--highlight-matching-block-timer))
(setq smie--highlight-matching-block-timer nil)
(if smie-highlight-matching-block-mode
(progn
(remove-hook 'post-self-insert-hook #'smie-blink-matching-open 'local)
(setq smie--highlight-matching-block-timer
(run-with-idle-timer 0.2 t #'smie-highlight-matching-block)))
(when smie--highlight-matching-block-overlay
(delete-overlay smie--highlight-matching-block-overlay)
(setq smie--highlight-matching-block-overlay nil))
(kill-local-variable 'smie--highlight-matching-block-lastpos)))
(list (member (cons (nth 1 here) (nth 2 data))
smie-closer-alist)
(point) tend))))
(t ;Closer.
(let ((data (smie-backward-sexp 'halfsexp))
(htok (nth 1 here)))
(if (car data)
(let* ((hprec (nth 2 (assoc htok smie-grammar)))
(ttok (nth 2 data))
(tprec (nth 1 (assoc ttok smie-grammar))))
(when (and (numberp hprec) ;Here is an inner.
(eq hprec tprec))
(goto-char (nth 1 data))
(let ((tbeg (point)))
(funcall smie-forward-token-function)
(list t tbeg (point)))))
(let ((tbeg (point)))
(funcall smie-forward-token-function)
(list (member (cons (nth 2 data) htok)
smie-closer-alist)
tbeg (point)))))))))
;; Update the cache.
(setcdr smie--matching-block-data-cache
(list (nth 2 here) (nth 3 here)
(nth 1 there) (nth 2 there)
(not (nth 0 there)))))))
(scan-error nil))
(goto-char (car smie--matching-block-data-cache)))
(apply #'smie--matching-block-data orig args)))
;;; The indentation engine.
@ -1799,9 +1805,10 @@ KEYWORDS are additional arguments, which can use the following keywords:
(setq-local smie-closer-alist ca)
;; Only needed for interactive calls to blink-matching-open.
(setq-local blink-matching-check-function #'smie-blink-matching-check)
(unless smie-highlight-matching-block-mode
(add-hook 'post-self-insert-hook
#'smie-blink-matching-open 'append 'local))
(add-hook 'post-self-insert-hook
#'smie-blink-matching-open 'append 'local)
(add-function :around (local 'show-paren-data-function)
#'smie--matching-block-data)
;; Setup smie-blink-matching-triggers. Rather than wait for SPC to
;; blink, try to blink as soon as we type the last char of a block ender.
(let ((closers (sort (mapcar #'cdr smie-closer-alist) #'string-lessp))

View file

@ -620,21 +620,24 @@ If SECRET is non-nil, list secret keys instead of public keys."
(floor (* (/ current (float total)) 100))))
(message "%s..." prompt))))
(defun epa-read-file-name (input)
"Interactively read an output file name based on INPUT file name."
(setq input (file-name-sans-extension (expand-file-name input)))
(expand-file-name
(read-file-name
(concat "To file (default " (file-name-nondirectory input) ") ")
(file-name-directory input)
input)))
;;;###autoload
(defun epa-decrypt-file (decrypt-file plain-file)
"Decrypt DECRYPT-FILE into PLAIN-FILE."
(defun epa-decrypt-file (decrypt-file &optional plain-file)
"Decrypt DECRYPT-FILE into PLAIN-FILE.
If you do not specify PLAIN-FILE, this functions prompts for the value to use."
(interactive
(let (file default-name plain)
(setq file (read-file-name "File to decrypt: "))
(setq default-name (file-name-sans-extension (expand-file-name file)))
(setq plain (expand-file-name
(read-file-name
(concat "To file (default "
(file-name-nondirectory default-name)
") ")
(file-name-directory default-name)
default-name)))
(let* ((file (read-file-name "File to decrypt: "))
(plain (epa-read-file-name file)))
(list file plain)))
(or plain-file (setq plain-file (epa-read-file-name decrypt-file)))
(setq decrypt-file (expand-file-name decrypt-file))
(let ((context (epg-make-context epa-protocol)))
(epg-context-set-passphrase-callback context

View file

@ -207,8 +207,8 @@ Thus, this does not include the current directory.")
(when eshell-cd-on-directory
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
(cons (cons (lambda (file args)
(eshell-lone-directory-p file))
(cons (cons #'(lambda (file args)
(eshell-lone-directory-p file))
'eshell-dirs-substitute-cd)
eshell-interpreter-alist)))

View file

@ -61,9 +61,10 @@ This includes when running `eshell-command'."
"Initialize the script parsing code."
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
(cons '((lambda (file args)
(string= (file-name-nondirectory file)
"eshell")) . eshell/source)
(cons (cons #'(lambda (file args)
(string= (file-name-nondirectory file)
"eshell"))
'eshell/source)
eshell-interpreter-alist))
(make-local-variable 'eshell-complex-commands)
(setq eshell-complex-commands

View file

@ -31,6 +31,7 @@
;;; Code:
(require 'cl-lib)
(require 'esh-util)
(require 'esh-ext)
(eval-when-compile (require 'eshell))
@ -61,13 +62,19 @@ which commands are considered visual in nature."
"less" "more" ; M-x view-file
"lynx" "ncftp" ; w3.el, ange-ftp
"pine" "tin" "trn" "elm") ; GNUS!!
"A list of commands that present their output in a visual fashion."
"A list of commands that present their output in a visual fashion.
Commands listed here are run in a term buffer.
See also `eshell-visual-subcommands' and `eshell-visual-options'."
:type '(repeat string)
:group 'eshell-term)
(defcustom eshell-visual-subcommands
nil
"An alist of the form
"An alist of subcommands that present their output in a visual fashion.
An alist of the form
((COMMAND1 SUBCOMMAND1 SUBCOMMAND2...)
(COMMAND2 SUBCOMMAND1 ...))
@ -77,7 +84,9 @@ visual fashion. A likely entry is
(\"git\" \"log\" \"diff\" \"show\")
because git shows logs and diffs using a pager by default."
because git shows logs and diffs using a pager by default.
See also `eshell-visual-commands' and `eshell-visual-options'."
:type '(repeat (cons (string :tag "Command")
(repeat (string :tag "Subcommand"))))
:version "24.4"
@ -96,7 +105,9 @@ fashion. For example, a sensible entry would be
(\"git\" \"--help\")
because \"git <command> --help\" shows the command's
documentation with a pager."
documentation with a pager.
See also `eshell-visual-commands' and `eshell-visual-subcommands'."
:type '(repeat (cons (string :tag "Command")
(repeat (string :tag "Option"))))
:version "24.4"
@ -131,18 +142,23 @@ character to the invoked process."
"Initialize the `term' interface code."
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
(cons (cons (function
(lambda (command args)
(let ((command (file-name-nondirectory command)))
(or (member command eshell-visual-commands)
(member (car args)
(cdr (assoc command eshell-visual-subcommands)))
(cl-intersection args
(cdr (assoc command eshell-visual-options))
:test 'string=)))))
(cons (cons #'eshell-visual-command-p
'eshell-exec-visual)
eshell-interpreter-alist)))
(defun eshell-visual-command-p (command args)
"Returns non-nil when given a visual command.
If either COMMAND or a subcommand in ARGS (e.g. git log) is a
visual command, returns non-nil."
(let ((command (file-name-nondirectory command)))
(and (eshell-interactive-output-p)
(or (member command eshell-visual-commands)
(member (car args)
(cdr (assoc command eshell-visual-subcommands)))
(cl-intersection args
(cdr (assoc command eshell-visual-options))
:test 'string=)))))
(defun eshell-exec-visual (&rest args)
"Run the specified PROGRAM in a terminal emulation buffer.
ARGS are passed to the program. At the moment, no piping of input is

View file

@ -326,11 +326,8 @@ and the hook `eshell-exit-hook'."
(if mode-line-elt
(setcar mode-line-elt 'eshell-command-running-string))))
(define-key eshell-mode-map [return] 'eshell-send-input)
(define-key eshell-mode-map [(control ?m)] 'eshell-send-input)
(define-key eshell-mode-map [(control ?j)] 'eshell-send-input)
(define-key eshell-mode-map [(meta return)] 'eshell-queue-input)
(define-key eshell-mode-map [(meta control ?m)] 'eshell-queue-input)
(define-key eshell-mode-map "\r" 'eshell-send-input)
(define-key eshell-mode-map "\M-\r" 'eshell-queue-input)
(define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output)
(define-key eshell-mode-map [(control ?a)] 'eshell-bol)

View file

@ -206,7 +206,8 @@ from; the default is `load-path'."
(setq version (ignore-errors (version-to-list version)))
(setq entry (assq package package--builtins))
(cond ((null entry)
(push (cons package (vector version nil summary))
(push (cons package
(package-make-builtin version summary))
package--builtins))
((eq base-name package)
(setq desc (cdr entry))

View file

@ -2328,7 +2328,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
(1 font-lock-keyword-face)
(2 font-lock-constant-face nil t))
;; Erroneous structures.
("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\_>" 1 font-lock-warning-face)
("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|\\(?:user-\\)?error\\|signal\\)\\_>" 1 font-lock-warning-face)
;; Words inside \\[] tend to be for `substitute-command-keys'.
("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
(1 font-lock-constant-face prepend))

View file

@ -1,3 +1,112 @@
2013-06-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* shr.el (shr-expand-url): Expansion should chop off the bits after the
last slash.
* eww.el (eww-tag-select): Use the first value as the default value.
2013-06-13 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
* eww.el (eww): Prepend urls with http:// if scheme is missing.
(eww-mode): Use `define-derived-mode'.
(eww-parse-headers): Parse headers from beginning of buffer so that
file:// links work.
2013-06-13 Katsumi Yamaoka <yamaoka@jpl.org>
* eww.el (eww-detect-charset): Detect charset from the <meta> tag.
2013-06-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
* shr.el (shr-tag-svg): Ignore SVG elements, because we don't know how
to handle them at all.
2013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-convert-widgets): Make widgets from non-tabular layouts
work, too.
(eww-tag-select): Implement <select>.
2013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de>
* sieve-manage.el (sieve-manage-open): work with STARTTLS: shorten
stream managing functions by using open-protocol-stream to do most of
the work. Has the nice benefit of enabling STARTTLS.
Wait for capabilities after STARTTLS: following RFC5804, the server
sends new capabilities after successfully establishing a TLS connection
with the client. The client should update the cached list of
capabilities, but we just ignore the answer for now.
(sieve-manage-network-p, sieve-manage-network-open)
(sieve-manage-starttls-p, sieve-manage-starttls-open)
(sieve-manage-forward, sieve-manage-streams)
(sieve-manage-stream-alist): Remove unneeded functions neither in the
API, nor called by any other function.
Enable Multibyte for SieveManage buffers: The parser won't properly
handle umlauts and line endings unless multibyte is turned on in the
process buffer.
2013-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-tag-input): Support password fields.
(eww-submit): Support POST.
2013-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-tag-form): Protect against degenerate forms.
* shr.el (shr-expand-url): Expand URLs that start with a slash
correctly.
* eww.el (eww-submit): Get submit button logic right.
* shr.el (shr-final-table-render): New variable to signal when we're
doing the final table rendering so that we can collect more data at
that point.
* eww.el (eww-submit): Make form submission work.
(eww-tag-input): Implement submit buttons.
(eww-click-radio): Implement radio and checkboxes.
(eww-submit): Handle hidden elements.
* shr.el (shr-descend): Allow other packages to override (or provide)
rendering of elements.
(shr-expand-url): Strip query strings from URLs before expanding them.
* eww.el: Don't require cl-lib.
(eww-tag-form): Start form support.
* eww.el: Start writing a new, tiny web browser.
(eww-previous-url): New command.
(eww-quit): New command.
2013-06-10 Albert Krewinkel <krewinkel@moltkeplatz.de>
* sieve.el: Put point at beginning of buffer when viewing a script.
(sieve-open-server): respect the PORT parameter. Show the correct port
number in sieve-buffer's header. Fixed code to also work with a string
as port specifier. Properly close the connection on pressing 'q'. Make
sieve-manage-quit close the connection and process buffer. Also, remove
duplicate keybinding for 'q'.
2013-06-10 Roy Hashimoto <roy.hashimoto@gmail.com> (tiny change)
* mm-view.el (mm-pkcs7-signed-magic): Allow newline in the regexp and
make it easier to read.
(mm-pkcs7-enveloped-magic): Ditto.
2013-06-06 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-ems.el (gnus-image-type-available-p): Test `display-images-p'
before `image-type-available-p' to avoid loading the image libraries
needlessly.
2013-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (article-date-ut, article-update-date-lapsed): Don't
assume Date header begins with "Date", that may be customized into
something like "X-Sent" using gnus-article-time-format.
(article-transform-date): Allow multi-line Date header.
2013-06-02 David Engster <deng@randomsample.de>
* registry.el (initialize-instance, registry-lookup)

367
lisp/gnus/eww.el Normal file
View file

@ -0,0 +1,367 @@
;;; eww.el --- Emacs Web Wowser
;; Copyright (C) 2013 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: html
;; 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/>.
;;; Commentary:
;;; Code:
(eval-when-compile (require 'cl))
(require 'shr)
(require 'url)
(require 'mm-url)
(defvar eww-current-url nil)
(defvar eww-history nil)
;;;###autoload
(defun eww (url)
"Fetch URL and render the page."
(interactive "sUrl: ")
(unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
(setq url (concat "http://" url)))
(url-retrieve url 'eww-render (list url)))
(defun eww-detect-charset (html-p)
(let ((case-fold-search t)
(pt (point)))
(or (and html-p
(re-search-forward
"<meta[\t\n\r ]+[^>]*charset=\\([^\t\n\r \"/>]+\\)" nil t)
(goto-char pt)
(match-string 1))
(and (looking-at
"[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)")
(match-string 1)))))
(defun eww-render (status url &optional point)
(let* ((headers (eww-parse-headers))
(content-type
(mail-header-parse-content-type
(or (cdr (assoc "content-type" headers))
"text/plain")))
(charset (intern
(downcase
(or (cdr (assq 'charset (cdr content-type)))
(eww-detect-charset (equal (car content-type)
"text/html"))
"utf8"))))
(data-buffer (current-buffer)))
(unwind-protect
(progn
(cond
((equal (car content-type) "text/html")
(eww-display-html charset url))
((string-match "^image/" (car content-type))
(eww-display-image))
(t
(eww-display-raw charset)))
(when point
(goto-char point)))
(kill-buffer data-buffer))))
(defun eww-parse-headers ()
(let ((headers nil))
(goto-char (point-min))
(while (and (not (eobp))
(not (eolp)))
(when (looking-at "\\([^:]+\\): *\\(.*\\)")
(push (cons (downcase (match-string 1))
(match-string 2))
headers))
(forward-line 1))
(unless (eobp)
(forward-line 1))
headers))
(defun eww-display-html (charset url)
(unless (eq charset 'utf8)
(decode-coding-region (point) (point-max) charset))
(let ((document
(list
'base (list (cons 'href url))
(libxml-parse-html-region (point) (point-max)))))
(eww-setup-buffer)
(setq eww-current-url url)
(let ((inhibit-read-only t)
(shr-external-rendering-functions
'((form . eww-tag-form)
(input . eww-tag-input)
(select . eww-tag-select))))
(shr-insert-document document)
(eww-convert-widgets))
(goto-char (point-min))))
(defun eww-display-raw (charset)
(let ((data (buffer-substring (point) (point-max))))
(eww-setup-buffer)
(let ((inhibit-read-only t))
(insert data))
(goto-char (point-min))))
(defun eww-display-image ()
(let ((data (buffer-substring (point) (point-max))))
(eww-setup-buffer)
(let ((inhibit-read-only t))
(shr-put-image data nil))
(goto-char (point-min))))
(defun eww-setup-buffer ()
(pop-to-buffer (get-buffer-create "*eww*"))
(remove-overlays)
(setq widget-field-list nil)
(let ((inhibit-read-only t))
(erase-buffer))
(eww-mode))
(defvar eww-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
(define-key map "q" 'eww-quit)
(define-key map "g" 'eww-reload)
(define-key map [tab] 'widget-forward)
(define-key map [backtab] 'widget-backward)
(define-key map [delete] 'scroll-down-command)
(define-key map "\177" 'scroll-down-command)
(define-key map " " 'scroll-up-command)
(define-key map "p" 'eww-previous-url)
;;(define-key map "n" 'eww-next-url)
map))
(define-derived-mode eww-mode nil "eww"
"Mode for browsing the web.
\\{eww-mode-map}"
(set (make-local-variable 'eww-current-url) 'author)
(set (make-local-variable 'browse-url-browser-function) 'eww-browse-url))
(defun eww-browse-url (url &optional new-window)
(let ((url-request-extra-headers
(append '(("User-Agent" . "eww/1.0"))
url-request-extra-headers)))
(push (list eww-current-url (point))
eww-history)
(eww url)))
(defun eww-quit ()
"Exit the Emacs Web Wowser."
(interactive)
(setq eww-history nil)
(kill-buffer (current-buffer)))
(defun eww-previous-url ()
"Go to the previously displayed page."
(interactive)
(when (zerop (length eww-history))
(error "No previous page"))
(let ((prev (pop eww-history)))
(url-retrieve (car prev) 'eww-render (list (car prev) (cadr prev)))))
(defun eww-reload ()
"Reload the current page."
(interactive)
(url-retrieve eww-current-url 'eww-render
(list eww-current-url (point))))
;; Form support.
(defvar eww-form nil)
(defun eww-tag-form (cont)
(let ((eww-form
(list (assq :method cont)
(assq :action cont)))
(start (point)))
(shr-ensure-paragraph)
(shr-generic cont)
(shr-ensure-paragraph)
(when (> (point) start)
(put-text-property start (1+ start)
'eww-form eww-form))))
(defun eww-tag-input (cont)
(let* ((start (point))
(type (downcase (or (cdr (assq :type cont))
"text")))
(widget
(cond
((equal type "submit")
(list
'push-button
:notify 'eww-submit
:name (cdr (assq :name cont))
:eww-form eww-form
(or (cdr (assq :value cont)) "Submit")))
((or (equal type "radio")
(equal type "checkbox"))
(list 'checkbox
:notify 'eww-click-radio
:name (cdr (assq :name cont))
:checkbox-value (cdr (assq :value cont))
:checkbox-type type
:eww-form eww-form
(cdr (assq :checked cont))))
((equal type "hidden")
(list 'hidden
:name (cdr (assq :name cont))
:value (cdr (assq :value cont))))
(t
(list
'editable-field
:size (string-to-number
(or (cdr (assq :size cont))
"40"))
:value (or (cdr (assq :value cont)) "")
:secret (and (equal type "password") ?*)
:action 'eww-submit
:name (cdr (assq :name cont))
:eww-form eww-form)))))
(if (eq (car widget) 'hidden)
(when shr-final-table-render
(nconc eww-form (list widget)))
(apply 'widget-create widget))
(put-text-property start (point) 'eww-widget widget)
(insert " ")))
(defun eww-tag-select (cont)
(shr-ensure-paragraph)
(let ((menu (list 'menu-choice
:name (cdr (assq :name cont))
:eww-form eww-form))
(options nil)
(start (point)))
(dolist (elem cont)
(when (eq (car elem) 'option)
(when (cdr (assq :selected (cdr elem)))
(nconc menu (list :value
(cdr (assq :value (cdr elem))))))
(push (list 'item
:value (cdr (assq :value (cdr elem)))
:tag (cdr (assq 'text (cdr elem))))
options)))
;; If we have no selected values, default to the first value.
(unless (plist-get (cdr menu) :value)
(nconc menu (list :value (nth 2 (car options)))))
(nconc menu options)
(apply 'widget-create menu)
(put-text-property start (point) 'eww-widget menu)
(shr-ensure-paragraph)))
(defun eww-click-radio (widget &rest ignore)
(let ((form (plist-get (cdr widget) :eww-form))
(name (plist-get (cdr widget) :name)))
(when (equal (plist-get (cdr widget) :type) "radio")
(if (widget-value widget)
;; Switch all the other radio buttons off.
(dolist (overlay (overlays-in (point-min) (point-max)))
(let ((field (plist-get (overlay-properties overlay) 'button)))
(when (and (eq (plist-get (cdr field) :eww-form) form)
(equal name (plist-get (cdr field) :name)))
(unless (eq field widget)
(widget-value-set field nil)))))
(widget-value-set widget t)))
(eww-fix-widget-keymap)))
(defun eww-submit (widget &rest ignore)
(let ((form (plist-get (cdr widget) :eww-form))
(first-button t)
values)
(dolist (overlay (sort (overlays-in (point-min) (point-max))
(lambda (o1 o2)
(< (overlay-start o1) (overlay-start o2)))))
(let ((field (or (plist-get (overlay-properties overlay) 'field)
(plist-get (overlay-properties overlay) 'button)
(plist-get (overlay-properties overlay) 'eww-hidden))))
(when (eq (plist-get (cdr field) :eww-form) form)
(let ((name (plist-get (cdr field) :name)))
(when name
(cond
((eq (car field) 'checkbox)
(when (widget-value field)
(push (cons name (plist-get (cdr field) :checkbox-value))
values)))
((eq (car field) 'eww-hidden)
(push (cons name (plist-get (cdr field) :value))
values))
((eq (car field) 'push-button)
;; We want the values from buttons if we hit a button,
;; or we're submitting something and this is the first
;; button displayed.
(when (or (and (eq (car widget) 'push-button)
(eq widget field))
(and (not (eq (car widget) 'push-button))
(eq (car field) 'push-button)
first-button))
(setq first-button nil)
(push (cons name (widget-value field))
values)))
(t
(push (cons name (widget-value field))
values))))))))
(dolist (elem form)
(when (and (consp elem)
(eq (car elem) 'hidden))
(push (cons (plist-get (cdr elem) :name)
(plist-get (cdr elem) :value))
values)))
(let ((shr-base eww-current-url))
(if (and (stringp (cdr (assq :method form)))
(equal (downcase (cdr (assq :method form))) "post"))
(let ((url-request-method "POST")
(url-request-extra-headers
'(("Content-Type" . "application/x-www-form-urlencoded")))
(url-request-data (mm-url-encode-www-form-urlencoded values)))
(eww-browse-url (shr-expand-url (cdr (assq :action form)))))
(eww-browse-url
(shr-expand-url
(concat
(cdr (assq :action form))
"?"
(mm-url-encode-www-form-urlencoded values))))))))
(defun eww-convert-widgets ()
(let ((start (point-min))
widget)
;; Some widgets come from different buffers (rendered for tables),
;; so we need to nix out the list of widgets and recreate them.
(setq widget-field-list nil
widget-field-new nil)
(while (setq start (next-single-property-change start 'eww-widget))
(setq widget (get-text-property start 'eww-widget))
(goto-char start)
(let ((end (next-single-property-change start 'eww-widget)))
(dolist (overlay (overlays-in start end))
(when (or (plist-get (overlay-properties overlay) 'button)
(plist-get (overlay-properties overlay) 'field))
(delete-overlay overlay)))
(delete-region start end))
(apply 'widget-create widget))
(widget-setup)
(eww-fix-widget-keymap)))
(defun eww-fix-widget-keymap ()
(dolist (overlay (overlays-in (point-min) (point-max)))
(when (plist-get (overlay-properties overlay) 'button)
(overlay-put overlay 'local-map widget-keymap))))
(provide 'eww)
;;; eww.el ends here

View file

@ -3430,15 +3430,13 @@ possible values."
(visible-date (mail-fetch-field "Date"))
pos date bface eface)
(save-excursion
(goto-char (point-min))
(when (re-search-forward "^Date:" nil t)
(setq bface (get-text-property (point-at-bol) 'face)
eface (get-text-property (1- (point-at-eol)) 'face)))
;; Delete any old Date headers.
(if date-position
(progn
(goto-char date-position)
(setq date (get-text-property (point) 'original-date))
(when (looking-at "[^:]+:[\t ]*")
(setq bface (get-text-property (match-beginning 0) 'face)
eface (get-text-property (match-end 0) 'face)))
(delete-region (point)
(progn
(gnus-article-forward-header)
@ -3454,12 +3452,26 @@ possible values."
(narrow-to-region pos (if (search-forward "\n\n" nil t)
(1+ (match-beginning 0))
(point-max)))
(goto-char (point-min))
(while (re-search-forward "^Date:" nil t)
(setq date (get-text-property (match-beginning 0) 'original-date))
(delete-region (point-at-bol) (progn
(gnus-article-forward-header)
(point))))
(while (setq pos (text-property-not-all pos (point-max)
'gnus-date-type nil))
(setq date (get-text-property pos 'original-date))
(goto-char pos)
(when (looking-at "[^:]+:[\t ]*")
(setq bface (get-text-property (match-beginning 0) 'face)
eface (get-text-property (match-end 0) 'face)))
(delete-region pos (or (text-property-any pos (point-max)
'gnus-date-type nil)
(point-max))))
(unless date ;; the 1st time
(goto-char (point-min))
(while (re-search-forward "^Date:[\t ]*" nil t)
(setq date (get-text-property (match-beginning 0)
'original-date)
bface (get-text-property (match-beginning 0) 'face)
eface (get-text-property (match-end 0) 'face))
(delete-region (point-at-bol) (progn
(gnus-article-forward-header)
(point)))))
(when (and (not date)
visible-date)
(setq date visible-date))
@ -3476,20 +3488,25 @@ possible values."
(list type))
(t
type)))
(insert (article-make-date-line date (or this-type 'ut)) "\n")
(forward-line -1)
(beginning-of-line)
(put-text-property (point) (1+ (point))
'original-date date)
(put-text-property (point) (1+ (point))
'gnus-date-type this-type)
(goto-char
(prog1
(point)
(add-text-properties
(point)
(progn
(insert (article-make-date-line date (or this-type 'ut)) "\n")
(point))
(list 'original-date date 'gnus-date-type this-type))))
;; Do highlighting.
(when (looking-at "\\([^:]+\\): *\\(.*\\)$")
(put-text-property (match-beginning 1) (1+ (match-end 1))
'face bface)
(put-text-property (match-beginning 2) (match-end 2)
'face eface))
(forward-line 1)))
(when (looking-at
"\\([^:]+:\\)[\t ]*\\(\\(?:[^\t\n ]+[\t ]+\\)*[^\t\n ]+\\)?")
(put-text-property (match-beginning 1) (match-end 1) 'face bface)
(when (match-beginning 2)
(put-text-property (match-beginning 2) (match-end 2) 'face eface))
(while (and (zerop (forward-line 1))
(looking-at "[\t ]+\\(\\(?:[^\t\n ]+[\t ]+\\)*[^\t\n ]+\\)?"))
(when (match-beginning 1)
(put-text-property (match-beginning 1) (match-end 1) 'face eface))))))
(defun article-make-date-line (date type)
"Return a DATE line of TYPE."
@ -3669,25 +3686,26 @@ function and want to see what the date was before converting."
(when (eq major-mode 'gnus-article-mode)
(let ((old-line (count-lines (point-min) (point)))
(old-column (- (point) (line-beginning-position)))
(window-start
(window-start (get-buffer-window (current-buffer)))))
(goto-char (point-min))
(while (re-search-forward "^Date:" nil t)
(let ((type (get-text-property (match-beginning 0)
'gnus-date-type)))
(when (memq type '(lapsed combined-lapsed user-format))
(when (and window-start
(not (= window-start
(save-excursion
(forward-line 1)
(point)))))
(setq window-start nil))
(save-excursion
(article-date-ut type t (match-beginning 0)))
(forward-line 1)
(when window-start
(set-window-start (get-buffer-window (current-buffer))
(point))))))
(window-start (window-start w))
(pos (point-min))
type next end)
(while (setq pos (text-property-not-all pos (point-max)
'gnus-date-type nil))
(setq next (or (next-single-property-change pos
'gnus-date-type)
(point-max)))
(setq type (get-text-property pos 'gnus-date-type))
(when (memq type '(lapsed combined-lapsed user-defined))
(article-date-ut type t pos)
(setq end (or (next-single-property-change pos
'gnus-date-type)
(point-max)))
(when window-start
(if (/= window-start next)
(setq window-start nil)
(set-window-start w end)))
(setq next end))
(setq pos next))
(goto-char (point-min))
(when (> old-column 0)
(setq old-line (1- old-line)))

View file

@ -165,10 +165,10 @@
(defun gnus-image-type-available-p (type)
(and (fboundp 'image-type-available-p)
(image-type-available-p type)
(if (fboundp 'display-images-p)
(display-images-p)
t)))
t)
(image-type-available-p type)))
(defun gnus-create-image (file &optional type data-p &rest props)
(let ((face (plist-get props :face)))

View file

@ -660,14 +660,26 @@ If MODE is not set, try to find mode automatically."
;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
(defvar mm-pkcs7-signed-magic
"\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\
\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x02")
(concat
"0"
"\\(\\(\x80\\)"
"\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
"\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
"\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
"\\)"
"\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x02"))
;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
(defvar mm-pkcs7-enveloped-magic
"\x30\x5c\x28\x80\x5c\x7c\x81\x2e\x5c\x7c\x82\x2e\x2e\x5c\x7c\x83\x2e\x2e\
\x2e\x5c\x29\x06\x09\x5c\x2a\x86\x48\x86\xf7\x0d\x01\x07\x03")
(concat
"0"
"\\(\\(\x80\\)"
"\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
"\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
"\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
"\\)"
"\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x03"))
(defun mm-view-pkcs7-get-type (handle)
(mm-with-unibyte-buffer

View file

@ -114,6 +114,8 @@ cid: URL as the argument.")
(defvar shr-stylesheet nil)
(defvar shr-base nil)
(defvar shr-ignore-cache nil)
(defvar shr-external-rendering-functions nil)
(defvar shr-final-table-render nil)
(defvar shr-map
(let ((map (make-sparse-keymap)))
@ -291,7 +293,12 @@ size, and full-buffer size."
(nreverse result)))
(defun shr-descend (dom)
(let ((function (intern (concat "shr-tag-" (symbol-name (car dom))) obarray))
(let ((function
(or
;; Allow other packages to override (or provide) rendering
;; of elements.
(cdr (assq (car dom) shr-external-rendering-functions))
(intern (concat "shr-tag-" (symbol-name (car dom))) obarray)))
(style (cdr (assq :style (cdr dom))))
(shr-stylesheet shr-stylesheet)
(start (point)))
@ -478,20 +485,30 @@ size, and full-buffer size."
(not failed)))
(defun shr-expand-url (url)
(cond
;; Absolute URL.
((or (not url)
(string-match "\\`[a-z]*:" url)
(not shr-base))
url)
((and (string-match "\\`//" url)
(string-match "\\`[a-z]*:" shr-base))
(concat (match-string 0 shr-base) url))
((and (not (string-match "/\\'" shr-base))
(not (string-match "\\`/" url)))
(concat shr-base "/" url))
(t
(concat shr-base url))))
(if (or (not url)
(string-match "\\`[a-z]*:" url)
(not shr-base))
;; Absolute URL.
url
(let ((base shr-base))
;; Chop off query string.
(when (string-match "\\`\\([^?]+\\)[?]" base)
(setq base (match-string 1 base)))
;; Chop off the bit after the last slash.
(when (string-match "\\`\\(.*\\)[/][^/]+" base)
(setq base (match-string 1 base)))
(cond
((and (string-match "\\`//" url)
(string-match "\\`[a-z]*:" base))
(concat (match-string 0 base) url))
((and (not (string-match "/\\'" base))
(not (string-match "\\`/" url)))
(concat base "/" url))
((and (string-match "\\`/" url)
(string-match "\\(\\`[^:]*://[^/]+\\)/" base))
(concat (match-string 1 base) url))
(t
(concat base url))))))
(defun shr-ensure-newline ()
(unless (zerop (current-column))
@ -877,6 +894,9 @@ ones, in case fg and bg are nil."
(defun shr-tag-comment (cont)
)
(defun shr-tag-svg (cont)
)
(defun shr-tag-sup (cont)
(let ((start (point)))
(shr-generic cont)
@ -945,7 +965,8 @@ ones, in case fg and bg are nil."
plist)))
(defun shr-tag-base (cont)
(setq shr-base (cdr (assq :href cont))))
(setq shr-base (cdr (assq :href cont)))
(shr-generic cont))
(defun shr-tag-a (cont)
(let ((url (cdr (assq :href cont)))
@ -1167,7 +1188,8 @@ ones, in case fg and bg are nil."
(frame-width))
(setq truncate-lines t))
;; Then render the table again with these new "hard" widths.
(shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))
(let ((shr-final-table-render t))
(shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)))
;; Finally, insert all the images after the table. The Emacs buffer
;; model isn't strong enough to allow us to put the images actually
;; into the tables.

View file

@ -3,6 +3,7 @@
;; Copyright (C) 2001-2013 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
;; Albert Krewinkel <tarleb@moltkeplatz.de>
;; This file is part of GNU Emacs.
@ -66,6 +67,7 @@
;; 2001-10-31 Committed to Oort Gnus.
;; 2002-07-27 Added DELETESCRIPT. Suggested by Ned Ludd.
;; 2002-08-03 Use SASL library.
;; 2013-06-05 Enabled STARTTLS support, fixed bit rot.
;;; Code:
@ -82,7 +84,6 @@
(require 'sasl)
(require 'starttls))
(autoload 'sasl-find-mechanism "sasl")
(autoload 'starttls-open-stream "starttls")
(autoload 'auth-source-search "auth-source")
;; User customizable variables:
@ -107,23 +108,6 @@
:type 'string
:group 'sieve-manage)
(defcustom sieve-manage-streams '(network starttls shell)
"Priority of streams to consider when opening connection to server."
:group 'sieve-manage)
(defcustom sieve-manage-stream-alist
'((network sieve-manage-network-p sieve-manage-network-open)
(shell sieve-manage-shell-p sieve-manage-shell-open)
(starttls sieve-manage-starttls-p sieve-manage-starttls-open))
"Definition of network streams.
\(NAME CHECK OPEN)
NAME names the stream, CHECK is a function returning non-nil if the
server support the stream and OPEN is a function for opening the
stream."
:group 'sieve-manage)
(defcustom sieve-manage-authenticators '(digest-md5
cram-md5
scram-md5
@ -156,8 +140,7 @@ for doing the actual authentication."
:group 'sieve-manage)
(defcustom sieve-manage-default-stream 'network
"Default stream type to use for `sieve-manage'.
Must be a name of a stream in `sieve-manage-stream-alist'."
"Default stream type to use for `sieve-manage'."
:version "24.1"
:type 'symbol
:group 'sieve-manage)
@ -185,17 +168,21 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
(defvar sieve-manage-capability nil)
;; Internal utility functions
(defmacro sieve-manage-disable-multibyte ()
"Enable multibyte in the current buffer."
(unless (featurep 'xemacs)
'(set-buffer-multibyte nil)))
(defun sieve-manage-make-process-buffer ()
(with-current-buffer
(generate-new-buffer (format " *sieve %s:%s*"
sieve-manage-server
sieve-manage-port))
(mapc 'make-local-variable sieve-manage-local-variables)
(mm-enable-multibyte)
(buffer-disable-undo)
(current-buffer)))
(defun sieve-manage-erase (&optional p buffer)
(let ((buffer (or buffer (current-buffer))))
(and sieve-manage-log
(with-current-buffer (get-buffer-create sieve-manage-log)
(sieve-manage-disable-multibyte)
(mm-enable-multibyte)
(buffer-disable-undo)
(goto-char (point-max))
(insert-buffer-substring buffer (with-current-buffer buffer
@ -204,71 +191,32 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
(point-max)))))))
(delete-region (point-min) (or p (point-max))))
(defun sieve-manage-open-1 (buffer)
(defun sieve-manage-open-server (server port &optional stream buffer)
"Open network connection to SERVER on PORT.
Return the buffer associated with the connection."
(with-current-buffer buffer
(sieve-manage-erase)
(setq sieve-manage-state 'initial
sieve-manage-process
(condition-case ()
(funcall (nth 2 (assq sieve-manage-stream
sieve-manage-stream-alist))
"sieve" buffer sieve-manage-server sieve-manage-port)
((error quit) nil)))
(when sieve-manage-process
(while (and (eq sieve-manage-state 'initial)
(memq (process-status sieve-manage-process) '(open run)))
(message "Waiting for response from %s..." sieve-manage-server)
(accept-process-output sieve-manage-process 1))
(message "Waiting for response from %s...done" sieve-manage-server)
(and (memq (process-status sieve-manage-process) '(open run))
sieve-manage-process))))
;; Streams
(defun sieve-manage-network-p (buffer)
t)
(defun sieve-manage-network-open (name buffer server port)
(let* ((port (or port sieve-manage-default-port))
(coding-system-for-read sieve-manage-coding-system-for-read)
(coding-system-for-write sieve-manage-coding-system-for-write)
(process (open-network-stream name buffer server port)))
(when process
(while (and (memq (process-status process) '(open run))
(set-buffer buffer) ;; XXX "blue moon" nntp.el bug
(goto-char (point-min))
(not (sieve-manage-parse-greeting-1)))
(accept-process-output process 1)
(sit-for 1))
(sieve-manage-erase nil buffer)
(when (memq (process-status process) '(open run))
process))))
(defun sieve-manage-starttls-p (buffer)
(condition-case ()
(progn
(require 'starttls)
(call-process "starttls"))
(error nil)))
(defun sieve-manage-starttls-open (name buffer server port)
(let* ((port (or port sieve-manage-default-port))
(coding-system-for-read sieve-manage-coding-system-for-read)
(coding-system-for-write sieve-manage-coding-system-for-write)
(process (starttls-open-stream name buffer server port))
done)
(when process
(while (and (memq (process-status process) '(open run))
(set-buffer buffer) ;; XXX "blue moon" nntp.el bug
(goto-char (point-min))
(not (sieve-manage-parse-greeting-1)))
(accept-process-output process 1)
(sit-for 1))
(sieve-manage-erase nil buffer)
(sieve-manage-send "STARTTLS")
(starttls-negotiate process))
(when (memq (process-status process) '(open run))
process)))
(setq sieve-manage-state 'initial)
(destructuring-bind (proc . props)
(open-protocol-stream
"SIEVE" buffer server port
:type stream
:capability-command "CAPABILITY\r\n"
:end-of-command "^\\(OK\\|NO\\).*\n"
:success "^OK.*\n"
:return-list t
:starttls-function
'(lambda (capabilities)
(when (string-match "\\bSTARTTLS\\b" capabilities)
"STARTTLS\r\n")))
(setq sieve-manage-process proc)
(setq sieve-manage-capability
(sieve-manage-parse-capability (getf props :capabilities)))
;; Ignore new capabilities issues after successful STARTTLS
(when (and (memq stream '(nil network starttls))
(eq (getf props :type) 'tls))
(sieve-manage-drop-next-answer))
(current-buffer))))
;; Authenticators
(defun sieve-sasl-auth (buffer mech)
@ -396,63 +344,33 @@ Optional argument AUTH indicates authenticator to use, see
If nil, chooses the best stream the server is capable of.
Optional argument BUFFER is buffer (buffer, or string naming buffer)
to work in."
(or port (setq port sieve-manage-default-port))
(setq buffer (or buffer (format " *sieve* %s:%s" server port)))
(with-current-buffer (get-buffer-create buffer)
(mapc 'make-local-variable sieve-manage-local-variables)
(sieve-manage-disable-multibyte)
(buffer-disable-undo)
(setq sieve-manage-server (or server sieve-manage-server))
(setq sieve-manage-port port)
(setq sieve-manage-stream (or stream sieve-manage-stream))
(setq sieve-manage-port (or port sieve-manage-default-port))
(with-current-buffer (or buffer (sieve-manage-make-process-buffer))
(setq sieve-manage-server (or server
sieve-manage-server)
sieve-manage-stream (or stream
sieve-manage-stream
sieve-manage-default-stream)
sieve-manage-auth (or auth
sieve-manage-auth))
(message "sieve: Connecting to %s..." sieve-manage-server)
(if (let ((sieve-manage-stream
(or sieve-manage-stream sieve-manage-default-stream)))
(sieve-manage-open-1 buffer))
;; Choose stream.
(let (stream-changed)
(message "sieve: Connecting to %s...done" sieve-manage-server)
(when (null sieve-manage-stream)
(let ((streams sieve-manage-streams))
(while (setq stream (pop streams))
(if (funcall (nth 1 (assq stream
sieve-manage-stream-alist)) buffer)
(setq stream-changed
(not (eq (or sieve-manage-stream
sieve-manage-default-stream)
stream))
sieve-manage-stream stream
streams nil)))
(unless sieve-manage-stream
(error "Couldn't figure out a stream for server"))))
(when stream-changed
(message "sieve: Reconnecting with stream `%s'..."
sieve-manage-stream)
(sieve-manage-close buffer)
(if (sieve-manage-open-1 buffer)
(message "sieve: Reconnecting with stream `%s'...done"
sieve-manage-stream)
(message "sieve: Reconnecting with stream `%s'...failed"
sieve-manage-stream))
(setq sieve-manage-capability nil))
(if (sieve-manage-opened buffer)
;; Choose authenticator
(when (and (null sieve-manage-auth)
(not (eq sieve-manage-state 'auth)))
(let ((auths sieve-manage-authenticators))
(while (setq auth (pop auths))
(if (funcall (nth 1 (assq
auth
sieve-manage-authenticator-alist))
buffer)
(setq sieve-manage-auth auth
auths nil)))
(unless sieve-manage-auth
(error "Couldn't figure out authenticator for server"))))))
(message "sieve: Connecting to %s...failed" sieve-manage-server))
(when (sieve-manage-opened buffer)
(sieve-manage-open-server sieve-manage-server
sieve-manage-port
sieve-manage-stream
(current-buffer))
(when (sieve-manage-opened (current-buffer))
;; Choose authenticator
(when (and (null sieve-manage-auth)
(not (eq sieve-manage-state 'auth)))
(dolist (auth sieve-manage-authenticators)
(when (funcall (nth 1 (assq auth sieve-manage-authenticator-alist))
buffer)
(setq sieve-manage-auth auth)
(return)))
(unless sieve-manage-auth
(error "Couldn't figure out authenticator for server")))
(sieve-manage-erase)
buffer)))
(current-buffer))))
(defun sieve-manage-authenticate (&optional buffer)
"Authenticate on server in BUFFER.
@ -544,12 +462,22 @@ If NAME is nil, return the full server list of capabilities."
;; Protocol parsing routines
(defun sieve-manage-wait-for-answer ()
(let ((pattern "^\\(OK\\|NO\\).*\n")
pos)
(while (not pos)
(setq pos (search-forward-regexp pattern nil t))
(goto-char (point-min))
(sleep-for 0 50))
pos))
(defun sieve-manage-drop-next-answer ()
(sieve-manage-wait-for-answer)
(sieve-manage-erase))
(defun sieve-manage-ok-p (rsp)
(string= (downcase (or (car-safe rsp) "")) "ok"))
(defsubst sieve-manage-forward ()
(or (eobp) (forward-char)))
(defun sieve-manage-is-okno ()
(when (looking-at (concat
"^\\(OK\\|NO\\)\\( (\\([^)]+\\))\\)?\\( \\(.*\\)\\)?"
@ -571,21 +499,15 @@ If NAME is nil, return the full server list of capabilities."
(sieve-manage-erase)
rsp))
(defun sieve-manage-parse-capability-1 ()
"Accept a managesieve greeting."
(let (str)
(while (setq str (sieve-manage-is-string))
(if (eq (char-after) ? )
(progn
(sieve-manage-forward)
(push (list str (sieve-manage-is-string))
sieve-manage-capability))
(push (list str) sieve-manage-capability))
(forward-line)))
(when (re-search-forward (concat "^OK.*" sieve-manage-server-eol) nil t)
(setq sieve-manage-state 'nonauth)))
(defalias 'sieve-manage-parse-greeting-1 'sieve-manage-parse-capability-1)
(defun sieve-manage-parse-capability (str)
"Parse managesieve capability string `STR'.
Set variable `sieve-manage-capability' to "
(let ((capas (remove-if #'null
(mapcar #'split-string-and-unquote
(split-string str "\n")))))
(when (string= "OK" (caar (last capas)))
(setq sieve-manage-state 'nonauth))
capas))
(defun sieve-manage-is-string ()
(cond ((looking-at "\"\\([^\"]+\\)\"")
@ -639,7 +561,7 @@ If NAME is nil, return the full server list of capabilities."
(setq cmdstr (concat cmdstr sieve-manage-client-eol))
(and sieve-manage-log
(with-current-buffer (get-buffer-create sieve-manage-log)
(sieve-manage-disable-multibyte)
(mm-enable-multibyte)
(buffer-disable-undo)
(goto-char (point-max))
(insert cmdstr)))

View file

@ -109,7 +109,6 @@ require \"fileinto\";
;; various
(define-key map "?" 'sieve-help)
(define-key map "h" 'sieve-help)
(define-key map "q" 'kill-buffer)
;; activating
(define-key map "m" 'sieve-activate)
(define-key map "u" 'sieve-deactivate)
@ -152,6 +151,8 @@ require \"fileinto\";
(defun sieve-manage-quit ()
"Quit."
(interactive)
(sieve-manage-close sieve-manage-buffer)
(kill-buffer sieve-manage-buffer)
(kill-buffer (current-buffer)))
(defun sieve-activate (&optional pos)
@ -206,6 +207,7 @@ require \"fileinto\";
(insert sieve-template))
(sieve-mode)
(setq sieve-buffer-script-name name)
(beginning-of-buffer)
(message
(substitute-command-keys
"Press \\[sieve-upload] to upload script to server."))))
@ -256,10 +258,9 @@ Used to bracket operations which move point in the sieve-buffer."
(setq buffer-read-only nil)
(erase-buffer)
(buffer-disable-undo)
(insert "\
Server : " server ":" (or port sieve-manage-default-port) "
")
(let* ((port (or port sieve-manage-default-port))
(header (format "Server : %s:%s\n\n" server port)))
(insert header))
(set (make-local-variable 'sieve-buffer-header-end)
(point-max)))
@ -305,7 +306,7 @@ Server : " server ":" (or port sieve-manage-default-port) "
(with-current-buffer
(or ;; open server
(set (make-local-variable 'sieve-manage-buffer)
(sieve-manage-open server))
(sieve-manage-open server port))
(error "Error opening server %s" server))
(sieve-manage-authenticate)))

View file

@ -435,14 +435,19 @@ suitable file is found, return nil."
(let ((handler (function-get function 'compiler-macro)))
(when handler
(insert "\nThis function has a compiler macro")
(let ((lib (get function 'compiler-macro-file)))
;; FIXME: rather than look at the compiler-macro-file property,
;; just look at `handler' itself.
(when (stringp lib)
(insert (format " in `%s'" lib))
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function-cmacro function lib))))
(if (symbolp handler)
(progn
(insert (format " `%s'" handler))
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function handler)))
;; FIXME: Obsolete since 24.4.
(let ((lib (get function 'compiler-macro-file)))
(when (stringp lib)
(insert (format " in `%s'" lib))
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function-cmacro function lib)))))
(insert ".\n"))))
(defun help-fns--signature (function doc real-def real-function)

View file

@ -204,7 +204,7 @@ The format is (FUNCTION ARGS...).")
(message "Unable to find location in file"))))
'help-echo (purecopy "mouse-2, RET: find function's definition"))
(define-button-type 'help-function-cmacro
(define-button-type 'help-function-cmacro ; FIXME: Obsolete since 24.4.
:supertype 'help-xref
'help-function (lambda (fun file)
(setq file (locate-library file t))
@ -213,7 +213,7 @@ The format is (FUNCTION ARGS...).")
(pop-to-buffer (find-file-noselect file))
(goto-char (point-min))
(if (re-search-forward
(format "^[ \t]*(define-compiler-macro[ \t]+%s"
(format "^[ \t]*(\\(cl-\\)?define-compiler-macro[ \t]+%s"
(regexp-quote (symbol-name fun))) nil t)
(forward-line 0)
(message "Unable to find location in file")))

View file

@ -1523,7 +1523,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
;;;###autoload
(defun ibuffer-mark-help-buffers ()
"Mark buffers like *Help*, *Apropos*, *Info*."
"Mark buffers whose major mode is in variable `ibuffer-help-buffer-modes'."
(interactive)
(ibuffer-mark-on-buffer
#'(lambda (buf)

View file

@ -2652,7 +2652,7 @@ will be inserted before the group at point."
;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group
;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "9950bdf995e4b5e962a17d754a35f2c6")
;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "2c628e6cde385119c5f7b43cc1efe1a1")
;;; Generated autoloads from ibuf-ext.el
(autoload 'ibuffer-auto-mode "ibuf-ext" "\
@ -2984,7 +2984,7 @@ Mark all buffers whose associated file does not exist.
\(fn)" t nil)
(autoload 'ibuffer-mark-help-buffers "ibuf-ext" "\
Mark buffers like *Help*, *Apropos*, *Info*.
Mark buffers whose major mode is in variable `ibuffer-help-buffer-modes'.
\(fn)" t nil)

View file

@ -3276,14 +3276,18 @@ for first matching file."
(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
(let ((filenames
(split-string
(shell-command-to-string
(concat "find "
(shell-quote-argument dir)
" -name "
(shell-quote-argument
(concat (if prefix "" "*") file "*"))
" -type " (if finddir "d" "f") " -print"))))
(delq nil
(mapcar (lambda (name)
(unless (ido-ignore-item-p name ido-ignore-files t)
name))
(split-string
(shell-command-to-string
(concat "find "
(shell-quote-argument dir)
(if ido-case-fold " -iname " " -name ")
(shell-quote-argument
(concat (if prefix "" "*") file "*"))
" -type " (if finddir "d" "f") " -print"))))))
filename d f
res)
(while filenames
@ -3297,7 +3301,7 @@ for first matching file."
res))
(defun ido-flatten-merged-list (items)
;; Create a list of directory names based on a merged directory list.
"Create a list of directory names based on a merged directory list."
(let (res)
(while items
(let* ((item (car items))
@ -3400,7 +3404,7 @@ for first matching file."
res))
(defun ido-make-buffer-list-1 (&optional frame visible)
;; Return list of non-ignored buffer names
"Return list of non-ignored buffer names."
(delq nil
(mapcar
(lambda (x)
@ -3410,12 +3414,12 @@ for first matching file."
(buffer-list frame))))
(defun ido-make-buffer-list (default)
;; Return the current list of buffers.
;; Currently visible buffers are put at the end of the list.
;; The hook `ido-make-buffer-list-hook' is run after the list has been
;; created to allow the user to further modify the order of the buffer names
;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
;; it is put to the start of the list.
"Return the current list of buffers.
Currently visible buffers are put at the end of the list.
The hook `ido-make-buffer-list-hook' is run after the list has been
created to allow the user to further modify the order of the buffer names
in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
it is put to the start of the list."
(let* ((ido-current-buffers (ido-get-buffers-in-frames 'current))
(ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers)))
(if ido-temp-list
@ -3457,9 +3461,9 @@ This is to make them appear as if they were \"virtual buffers\"."
(nreverse (mapcar #'car ido-virtual-buffers))))))
(defun ido-make-choice-list (default)
;; Return the current list of choices.
;; If DEFAULT is non-nil, and corresponds to an element of choices,
;; it is put to the start of the list.
"Return the current list of choices.
If DEFAULT is non-nil, and corresponds to an element of choices,
it is put to the start of the list."
(let ((ido-temp-list ido-choice-list))
(if default
(progn
@ -3471,7 +3475,7 @@ This is to make them appear as if they were \"virtual buffers\"."
ido-temp-list))
(defun ido-to-end (items)
;; Move the elements from ITEMS to the end of `ido-temp-list'
"Move the elements from ITEMS to the end of `ido-temp-list'."
(mapc
(lambda (elem)
(setq ido-temp-list (delq elem ido-temp-list)))
@ -3515,8 +3519,8 @@ This is to make them appear as if they were \"virtual buffers\"."
(file-name-all-completions "" dir))))
(defun ido-file-name-all-completions (dir)
;; Return name of all files in DIR
;; Uses and updates ido-dir-file-cache
"Return name of all files in DIR.
Uses and updates `ido-dir-file-cache'."
(cond
((ido-is-unc-root dir)
(mapcar
@ -3565,7 +3569,7 @@ This is to make them appear as if they were \"virtual buffers\"."
(ido-file-name-all-completions-1 dir))))
(defun ido-remove-cached-dir (dir)
;; Remove dir from ido-dir-file-cache
"Remove DIR from `ido-dir-file-cache'."
(if (and ido-dir-file-cache
(stringp dir) (> (length dir) 0))
(let ((cached (assoc dir ido-dir-file-cache)))
@ -3574,8 +3578,8 @@ This is to make them appear as if they were \"virtual buffers\"."
(defun ido-make-file-list-1 (dir &optional merged)
;; Return list of non-ignored files in DIR
;; If MERGED is non-nil, each file is cons'ed with DIR
"Return list of non-ignored files in DIR
If MERGED is non-nil, each file is cons'ed with DIR."
(and (or (ido-is-tramp-root dir) (ido-is-unc-root dir)
(file-directory-p dir))
(delq nil
@ -3586,11 +3590,11 @@ This is to make them appear as if they were \"virtual buffers\"."
(ido-file-name-all-completions dir)))))
(defun ido-make-file-list (default)
;; Return the current list of files.
;; Currently visible files are put at the end of the list.
;; The hook `ido-make-file-list-hook' is run after the list has been
;; created to allow the user to further modify the order of the file names
;; in this list.
"Return the current list of files.
Currently visible files are put at the end of the list.
The hook `ido-make-file-list-hook' is run after the list has been
created to allow the user to further modify the order of the file names
in this list."
(let ((ido-temp-list (ido-make-file-list-1 ido-current-directory)))
(setq ido-temp-list (sort ido-temp-list
(if ido-file-extensions-order
@ -3631,8 +3635,8 @@ This is to make them appear as if they were \"virtual buffers\"."
ido-temp-list))
(defun ido-make-dir-list-1 (dir &optional merged)
;; Return list of non-ignored subdirs in DIR
;; If MERGED is non-nil, each subdir is cons'ed with DIR
"Return list of non-ignored subdirs in DIR.
If MERGED is non-nil, each subdir is cons'ed with DIR."
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
(delq nil
(mapcar
@ -3642,10 +3646,10 @@ This is to make them appear as if they were \"virtual buffers\"."
(ido-file-name-all-completions dir)))))
(defun ido-make-dir-list (default)
;; Return the current list of directories.
;; The hook `ido-make-dir-list-hook' is run after the list has been
;; created to allow the user to further modify the order of the
;; directory names in this list.
"Return the current list of directories.
The hook `ido-make-dir-list-hook' is run after the list has been
created to allow the user to further modify the order of the
directory names in this list."
(let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory)))
(setq ido-temp-list (sort ido-temp-list #'ido-file-lessp))
(ido-to-end ;; move . files to end
@ -3676,10 +3680,9 @@ This is to make them appear as if they were \"virtual buffers\"."
(defvar ido-bufs-in-frame)
(defun ido-get-buffers-in-frames (&optional current)
;; Return the list of buffers that are visible in the current frame.
;; If optional argument `current' is given, restrict searching to the
;; current frame, rather than all frames, regardless of value of
;; `ido-all-frames'.
"Return the list of buffers that are visible in the current frame.
If optional argument CURRENT is given, restrict searching to the current
frame, rather than all frames, regardless of value of `ido-all-frames'."
(let ((ido-bufs-in-frame nil))
(walk-windows 'ido-get-bufname nil
(if current
@ -3688,7 +3691,7 @@ This is to make them appear as if they were \"virtual buffers\"."
ido-bufs-in-frame))
(defun ido-get-bufname (win)
;; Used by `ido-get-buffers-in-frames' to walk through all windows
"Used by `ido-get-buffers-in-frames' to walk through all windows."
(let ((buf (buffer-name (window-buffer win))))
(unless (or (member buf ido-bufs-in-frame)
(member buf ido-ignore-item-temp-list))
@ -3701,7 +3704,7 @@ This is to make them appear as if they were \"virtual buffers\"."
;;; FIND MATCHING ITEMS
(defun ido-set-matches-1 (items &optional do-full)
;; Return list of matches in items
"Return list of matches in ITEMS."
(let* ((case-fold-search ido-case-fold)
(slash (and (not ido-enable-prefix) (ido-final-slash ido-text)))
(text (if slash (substring ido-text 0 -1) ido-text))
@ -3789,13 +3792,13 @@ This is to make them appear as if they were \"virtual buffers\"."
(defun ido-set-matches ()
;; Set `ido-matches' to the list of items matching prompt
"Set `ido-matches' to the list of items matching prompt."
(when ido-rescan
(setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate))
ido-rotate nil)))
(defun ido-ignore-item-p (name re-list &optional ignore-ext)
;; Return t if the buffer or file NAME should be ignored.
"Return t if the buffer or file NAME should be ignored."
(or (member name ido-ignore-item-temp-list)
(and
ido-process-ignore-lists re-list
@ -3835,7 +3838,7 @@ This is to make them appear as if they were \"virtual buffers\"."
(defvar ido-change-word-sub)
(defun ido-find-common-substring (items subs)
;; Return common string following SUBS in each element of ITEMS.
"Return common string following SUBS in each element of ITEMS."
(let (res
alist
ido-change-word-sub)
@ -3855,8 +3858,8 @@ This is to make them appear as if they were \"virtual buffers\"."
comp))))
(defun ido-word-matching-substring (word)
;; Return part of WORD before 1st match to `ido-change-word-sub'.
;; If `ido-change-word-sub' cannot be found in WORD, return nil.
"Return part of WORD before first match to `ido-change-word-sub'.
If `ido-change-word-sub' cannot be found in WORD, return nil."
(let ((case-fold-search ido-case-fold))
(let ((m (string-match ido-change-word-sub (ido-name word))))
(if m
@ -3865,7 +3868,7 @@ This is to make them appear as if they were \"virtual buffers\"."
nil))))
(defun ido-makealist (res)
;; Return dotted pair (RES . 1).
"Return dotted pair (RES . 1)."
(cons res 1))
(defun ido-choose-completion-string (choice &rest ignored)
@ -4048,8 +4051,8 @@ Record command in `command-history' if optional RECORD is non-nil."
(defun ido-buffer-window-other-frame (buffer)
;; Return window pointer if BUFFER is visible in another frame.
;; If BUFFER is visible in the current frame, return nil.
"Return window pointer if BUFFER is visible in another frame.
If BUFFER is visible in the current frame, return nil."
(let ((blist (ido-get-buffers-in-frames 'current)))
;;If the buffer is visible in current frame, return nil
(if (member buffer blist)
@ -4533,9 +4536,8 @@ For details of keybindings, see `ido-find-file'."
))))
(defun ido-completions (name)
;; Return the string that is displayed after the user's text.
;; Modified from `icomplete-completions'.
"Return the string that is displayed after the user's text.
Modified from `icomplete-completions'."
(let* ((comps ido-matches)
(ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
ido-merged-indicator))

View file

@ -156,8 +156,9 @@
(require 'format-spec)
(require 'widget)
(require 'cl-lib)
(eval-when-compile
(require 'cl-lib)
(require 'wid-edit))
(defgroup image-dired nil
@ -657,9 +658,12 @@ previous -ARG, if ARG<0) files."
(string-match-p (image-file-name-regexp) image-file))
(setq thumb-file (image-dired-get-thumbnail-image image-file))
;; If image is not already added, then add it.
(let ((cur-ov (overlays-in (point) (1+ (point)))))
(if cur-ov
(delete-overlay (car cur-ov))
(let* ((cur-ovs (overlays-in (point) (1+ (point))))
(thumb-ov (car (cl-remove-if-not
(lambda (ov) (overlay-get ov 'thumb-file))
cur-ovs))))
(if thumb-ov
(delete-overlay thumb-ov)
(put-image thumb-file image-pos)
(setq overlay
(cl-loop for o in (overlays-in (point) (1+ (point)))

View file

@ -1508,6 +1508,7 @@ for decoding and encoding files, process I/O, etc."
(setq file-coding-system-alist
(mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
'(("\\.elc\\'" . utf-8-emacs)
("\\.el\\'" . utf-8)
("\\.utf\\(-8\\)?\\'" . utf-8)
("\\.xml\\'" . xml-find-file-coding-system)
;; We use raw-text for reading loaddefs.el so that if it

View file

@ -1691,7 +1691,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'"
("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion)
("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion)
("\\.pdf\\'" . no-conversion)
("/#[^/]+#\\'" . emacs-mule)))
("/#[^/]+#\\'" . utf-8-emacs-unix)))
"Alist of filename patterns vs corresponding coding systems.
Each element looks like (REGEXP . CODING-SYSTEM).
A file whose name matches REGEXP is decoded by CODING-SYSTEM on reading.

View file

@ -2152,6 +2152,15 @@ If nil, scrolling commands will first cancel Isearch mode."
:type 'boolean
:group 'isearch)
(defcustom isearch-allow-prefix t
"Whether prefix arguments are allowed during incremental search.
If non-nil, entering a prefix argument will not terminate the
search. This option is ignored \(presumed t) when
`isearch-allow-scroll' is set."
:version "24.4"
:type 'boolean
:group 'isearch)
(defun isearch-string-out-of-window (isearch-point)
"Test whether the search string is currently outside of the window.
Return nil if it's completely visible, or if point is visible,
@ -2304,12 +2313,19 @@ Isearch mode."
(setq prefix-arg arg)
(apply 'isearch-unread keylist)
(isearch-edit-string))
;; Handle a scrolling function.
((and isearch-allow-scroll
(progn (setq key (isearch-reread-key-sequence-naturally keylist))
(setq keylist (listify-key-sequence key))
(setq main-event (aref key 0))
(setq scroll-command (isearch-lookup-scroll-key key))))
;; Handle a scrolling function or prefix argument.
((progn
(setq key (isearch-reread-key-sequence-naturally keylist)
keylist (listify-key-sequence key)
main-event (aref key 0))
(or (and isearch-allow-scroll
(setq scroll-command (isearch-lookup-scroll-key key)))
(and isearch-allow-prefix
(let (overriding-terminal-local-map)
(setq scroll-command (key-binding key))
(memq scroll-command
'(universal-argument
negative-argument digit-argument))))))
;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a
;; complete key sequence, possibly as modified by function-key-map,
;; not merely the one or two event fragment which invoked

View file

@ -210,6 +210,7 @@
(load "textmodes/page")
(load "register")
(load "textmodes/paragraphs")
(load "progmodes/prog-mode")
(load "emacs-lisp/lisp-mode")
(load "textmodes/text-mode")
(load "textmodes/fill")

View file

@ -341,10 +341,10 @@ mail-sending package is used for editing and sending the message."
(mail-position-on-field "to")
(insert address)
;; insert problem summary if available
(if (and reporter-prompt-for-summary-p problem pkgname)
(progn
(mail-position-on-field "subject")
(insert pkgname "; " problem)))
(when (and reporter-prompt-for-summary-p problem)
(mail-position-on-field "subject")
(if pkgname (insert pkgname "; "))
(insert problem))
;; move point to the body of the message
(mail-text)
(forward-line 1)

View file

@ -208,9 +208,9 @@ It returns t if not."
;; <arg name="Prompt" type="o" direction="out"/>
;; </method>
;; <method name="GetSecrets">
;; <arg name="items" type="ao" direction="in"/>
;; <arg name="session" type="o" direction="in"/>
;; <arg name="secrets" type="a{o(oayay)}" direction="out"/>
;; <arg name="items" type="ao" direction="in"/>
;; <arg name="session" type="o" direction="in"/>
;; <arg name="secrets" type="a{o(oayays)}" direction="out"/>
;; </method>
;; <method name="ReadAlias">
;; <arg name="name" type="s" direction="in"/>
@ -234,7 +234,7 @@ It returns t if not."
;; <interface name="org.freedesktop.Secret.Collection">
;; <property name="Items" type="ao" access="read"/>
;; <property name="Label" type="s" access="readwrite"/>
;; <property name="Locked" type="s" access="read"/>
;; <property name="Locked" type="b" access="read"/>
;; <property name="Created" type="t" access="read"/>
;; <property name="Modified" type="t" access="read"/>
;; <method name="Delete">
@ -245,11 +245,11 @@ It returns t if not."
;; <arg name="results" type="ao" direction="out"/>
;; </method>
;; <method name="CreateItem">
;; <arg name="props" type="a{sv}" direction="in"/>
;; <arg name="secret" type="(oayay)" direction="in"/>
;; <arg name="replace" type="b" direction="in"/>
;; <arg name="item" type="o" direction="out"/>
;; <arg name="prompt" type="o" direction="out"/>
;; <arg name="props" type="a{sv}" direction="in"/>
;; <arg name="secret" type="(oayays)" direction="in"/>
;; <arg name="replace" type="b" direction="in"/>
;; <arg name="item" type="o" direction="out"/>
;; <arg name="prompt" type="o" direction="out"/>
;; </method>
;; <signal name="ItemCreated">
;; <arg name="item" type="o"/>
@ -293,11 +293,11 @@ It returns t if not."
;; <arg name="prompt" type="o" direction="out"/>
;; </method>
;; <method name="GetSecret">
;; <arg name="session" type="o" direction="in"/>
;; <arg name="secret" type="(oayay)" direction="out"/>
;; <arg name="session" type="o" direction="in"/>
;; <arg name="secret" type="(oayays)" direction="out"/>
;; </method>
;; <method name="SetSecret">
;; <arg name="secret" type="(oayay)" direction="in"/>
;; <arg name="secret" type="(oayays)" direction="in"/>
;; </method>
;; </interface>
;;
@ -305,10 +305,22 @@ It returns t if not."
;; OBJECT PATH session
;; ARRAY BYTE parameters
;; ARRAY BYTE value
;; STRING content_type ;; Added 2011/2/9
(defconst secrets-interface-item-type-generic "org.freedesktop.Secret.Generic"
"The default item type we are using.")
(defconst secrets-struct-secret-content-type
(when (string-equal
(dbus-introspect-get-signature
:session secrets-service secrets-path secrets-interface-service
"GetSecrets" "out")
"a{o(oayays)}")
'("text/plain"))
"The content_type of a secret struct.
It must be wrapped as list, because we add it via `append'. This
is an interface introduced in 2011.")
(defconst secrets-interface-session "org.freedesktop.Secret.Session"
"A session tracks state between the service and a client application.")
@ -616,16 +628,21 @@ The object path of the created item is returned."
;; Properties.
(append
`(:array
(:dict-entry "Label" (:variant ,item))
(:dict-entry
"Type" (:variant ,secrets-interface-item-type-generic)))
(:dict-entry ,(concat secrets-interface-item ".Label")
(:variant ,item))
(:dict-entry ,(concat secrets-interface-item ".Type")
(:variant ,secrets-interface-item-type-generic)))
(when props
`((:dict-entry
"Attributes" (:variant ,(append '(:array) props))))))
`((:dict-entry ,(concat secrets-interface-item ".Attributes")
(:variant ,(append '(:array) props))))))
;; Secret.
`(:struct :object-path ,secrets-session-path
(:array :signature "y") ;; no parameters.
,(dbus-string-to-byte-array password))
(append
`(:struct :object-path ,secrets-session-path
(:array :signature "y") ;; No parameters.
,(dbus-string-to-byte-array password))
;; We add the content_type. In backward compatibility
;; mode, nil is appended, which means nothing.
secrets-struct-secret-content-type)
;; Do not replace. Replace does not seem to work.
nil))
(secrets-prompt (cadr result))

View file

@ -286,7 +286,10 @@ NOT trusted. Accept anyway? " host)))))
(format "Host name in certificate doesn't \
match `%s'. Connect anyway? " host))))))
(setq done nil)
(delete-process process)))
(delete-process process))
;; Delete all the informational messages that could confuse
;; future uses of `buffer'.
(delete-region (point-min) (point)))
(message "Opening TLS connection to `%s'...%s"
host (if done "done" "failed"))
(when use-temp-buffer

View file

@ -485,29 +485,27 @@ and raises an error or returns nil if NOERROR is non-nil."
Moves point to inside the comment and returns the position of the
comment-starter. If no comment is found, moves point to LIMIT
and raises an error or returns nil if NOERROR is non-nil."
(let (found end)
(while (and (not found)
(re-search-backward comment-start-skip limit t))
(setq end (match-end 0))
(unless (and comment-use-syntax
(nth 8 (syntax-ppss (or (match-end 1)
(match-beginning 0)))))
(setq found t)))
(if (not found)
(unless noerror (error "No comment"))
(beginning-of-line)
(let ((cs (comment-search-forward end t))
(pt (point)))
(if (not cs)
(progn (beginning-of-line)
(comment-search-backward limit noerror))
(while (progn (goto-char cs)
(comment-forward)
(and (< (point) end)
(setq cs (comment-search-forward end t))))
(setq pt (point)))
(goto-char pt)
cs)))))
;; FIXME: If a comment-start appears inside a comment, we may erroneously
;; stop there. This can be rather bad in general, but since
;; comment-search-backward is only used to find the comment-column (in
;; comment-set-column) and to find the comment-start string (via
;; comment-beginning) in indent-new-comment-line, it should be harmless.
(if (not (re-search-backward comment-start-skip limit t))
(unless noerror (error "No comment"))
(beginning-of-line)
(let* ((end (match-end 0))
(cs (comment-search-forward end t))
(pt (point)))
(if (not cs)
(progn (beginning-of-line)
(comment-search-backward limit noerror))
(while (progn (goto-char cs)
(comment-forward)
(and (< (point) end)
(setq cs (comment-search-forward end t))))
(setq pt (point)))
(goto-char pt)
cs))))
(defun comment-beginning ()
"Find the beginning of the enclosing comment.

View file

@ -9355,10 +9355,6 @@ comment at the start of cc-engine.el for more info."
containing-sexp nil)))
(setq lim (1+ containing-sexp))))
(setq lim (point-min)))
(when (c-beginning-of-macro)
(goto-char indent-point)
(let ((lim1 (c-determine-limit 2000)))
(setq lim (max lim lim1))))
;; If we're in a parenthesis list then ',' delimits the
;; "statements" rather than being an operator (with the

View file

@ -527,6 +527,11 @@ Intended as the value of `indent-line-function'."
;; Doze path separators.
(modify-syntax-entry ?\\ "." table))
(defconst cfengine3--prettify-symbols-alist
'(("->" . ?→)
("=>" . ?⇒)
("::" . ?∷)))
;;;###autoload
(define-derived-mode cfengine3-mode prog-mode "CFE3"
"Major mode for editing CFEngine3 input.
@ -538,8 +543,11 @@ to the action header."
(cfengine-common-syntax cfengine3-mode-syntax-table)
(set (make-local-variable 'indent-line-function) #'cfengine3-indent-line)
(setq font-lock-defaults
'(cfengine3-font-lock-keywords nil nil nil beginning-of-defun))
'(cfengine3-font-lock-keywords
nil nil nil beginning-of-defun))
(prog-prettify-install cfengine3--prettify-symbols-alist)
;; Use defuns as the essential syntax block.
(set (make-local-variable 'beginning-of-defun-function)

View file

@ -1002,7 +1002,7 @@ POS and RES.")
(let ((win (get-buffer-window buffer 0)))
(if win (set-window-point win pos)))
(if compilation-auto-jump-to-first-error
(compile-goto-error))))
(compile-goto-error nil t))))
;; This function is the central driver, called when font-locking to gather
;; all information needed to later jump to corresponding source code.
@ -2317,7 +2317,7 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
(defalias 'compile-mouse-goto-error 'compile-goto-error)
(defun compile-goto-error (&optional event)
(defun compile-goto-error (&optional event nomsg)
"Visit the source for the error message at point.
Use this command in a compilation log buffer. Sets the mark at point there."
(interactive (list last-input-event))
@ -2328,7 +2328,7 @@ Use this command in a compilation log buffer. Sets the mark at point there."
(if (get-text-property (point) 'compilation-directory)
(dired-other-window
(car (get-text-property (point) 'compilation-directory)))
(push-mark)
(push-mark nil nomsg)
(setq compilation-current-error (point))
(next-error-internal)))

View file

@ -89,7 +89,7 @@ Used in `octave-mode' and `inferior-octave-mode' buffers.")
(defvar octave-function-header-regexp
(concat "^\\s-*\\_<\\(function\\)\\_>"
"\\([^=;\n]*=[ \t]*\\|[ \t]*\\)\\(\\(?:\\w\\|\\s_\\)+\\)\\_>")
"\\([^=;(\n]*=[ \t]*\\|[ \t]*\\)\\(\\(?:\\w\\|\\s_\\)+\\)\\_>")
"Regexp to match an Octave function header.
The string `function' and its name are given by the first and third
parenthetical grouping.")
@ -153,10 +153,10 @@ parenthetical grouping.")
'eldoc-mode))
:style toggle :selected (or eldoc-post-insert-mode eldoc-mode)
:help "Display function signatures after typing `SPC' or `('"]
["Delimiter Matching" smie-highlight-matching-block-mode
:style toggle :selected smie-highlight-matching-block-mode
["Delimiter Matching" show-paren-mode
:style toggle :selected show-paren-mode
:help "Highlight matched pairs such as `if ... end'"
:visible (fboundp 'smie-highlight-matching-block-mode)]
:visible (fboundp 'smie--matching-block-data)]
["Auto Fill" auto-fill-mode
:style toggle :selected auto-fill-function
:help "Automatic line breaking"]
@ -540,6 +540,7 @@ definitions can also be stored in files and used in batch mode."
;; a ";" at those places where it's correct (i.e. outside of parens).
(setq-local electric-layout-rules '((?\; . after)))
(setq-local comment-use-global-state t)
(setq-local comment-start octave-comment-start)
(setq-local comment-end "")
(setq-local comment-start-skip octave-comment-start-skip)
@ -563,6 +564,8 @@ definitions can also be stored in files and used in batch mode."
(setq-local imenu-generic-expression octave-mode-imenu-generic-expression)
(setq-local imenu-case-fold-search nil)
(setq-local add-log-current-defun-function #'octave-add-log-current-defun)
(add-hook 'completion-at-point-functions 'octave-completion-at-point nil t)
(add-hook 'before-save-hook 'octave-sync-function-file-names nil t)
(setq-local beginning-of-defun-function 'octave-beginning-of-defun)
@ -605,12 +608,13 @@ startup."
:group 'octave
:version "24.4")
(defcustom inferior-octave-startup-args nil
(defcustom inferior-octave-startup-args '("-i" "--no-line-editing")
"List of command line arguments for the inferior Octave process.
For example, for suppressing the startup message and using `traditional'
mode, set this to (\"-q\" \"--traditional\")."
mode, include \"-q\" and \"--traditional\"."
:type '(repeat string)
:group 'octave)
:group 'octave
:version "24.4")
(defcustom inferior-octave-mode-hook nil
"Hook to be run when Inferior Octave mode is started."
@ -664,6 +668,7 @@ in the Inferior Octave buffer.")
:abbrev-table octave-abbrev-table
(setq comint-prompt-regexp inferior-octave-prompt)
(setq-local comment-use-global-state t)
(setq-local comment-start octave-comment-start)
(setq-local comment-end "")
(setq comment-column 32)
@ -719,13 +724,13 @@ startup file, `~/.emacs-octave'."
(substring inferior-octave-buffer 1 -1)
inferior-octave-buffer
inferior-octave-program
(append (list "-i" "--no-line-editing")
;; --no-gui is introduced in Octave > 3.7
(when (zerop (process-file inferior-octave-program
nil nil nil
"--no-gui" "--help"))
(list "--no-gui"))
inferior-octave-startup-args))))
(append
inferior-octave-startup-args
;; --no-gui is introduced in Octave > 3.7
(and (not (member "--no-gui" inferior-octave-startup-args))
(zerop (process-file inferior-octave-program
nil nil nil "--no-gui" "--help"))
'("--no-gui"))))))
(set-process-filter proc 'inferior-octave-output-digest)
(setq inferior-octave-process proc
inferior-octave-output-list nil
@ -755,10 +760,10 @@ startup file, `~/.emacs-octave'."
(inferior-octave-send-list-and-digest (list "PS2\n"))
(when (string-match "\\(PS2\\|ans\\) = *$"
(car inferior-octave-output-list))
(inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n")))
(inferior-octave-send-list-and-digest (list "PS2 ('> ');\n")))
(inferior-octave-send-list-and-digest
(list "disp(getenv(\"OCTAVE_SRCDIR\"))\n"))
(list "disp (getenv ('OCTAVE_SRCDIR'))\n"))
(process-put proc 'octave-srcdir
(unless (equal (car inferior-octave-output-list) "")
(car inferior-octave-output-list)))
@ -767,19 +772,19 @@ startup file, `~/.emacs-octave'."
(inferior-octave-send-list-and-digest
(list "more off;\n"
(unless (equal inferior-octave-output-string ">> ")
"PS1 (\"\\\\s> \");\n")
"PS1 ('\\s> ');\n")
(when (and inferior-octave-startup-file
(file-exists-p inferior-octave-startup-file))
(format "source (\"%s\");\n" inferior-octave-startup-file))))
(format "source ('%s');\n" inferior-octave-startup-file))))
(when inferior-octave-output-list
(insert-before-markers
(mapconcat 'identity inferior-octave-output-list "\n")))
;; And finally, everything is back to normal.
(set-process-filter proc 'comint-output-filter)
;; Just in case, to be sure a cd in the startup file
;; won't have detrimental effects.
(inferior-octave-resync-dirs)
;; Just in case, to be sure a cd in the startup file won't have
;; detrimental effects.
(with-demoted-errors (inferior-octave-resync-dirs))
;; Generate a proper prompt, which is critical to
;; `comint-history-isearch-backward-regexp'. Bug#14433.
(comint-send-string proc "\n")))
@ -795,7 +800,7 @@ startup file, `~/.emacs-octave'."
(unless (and (equal (car cache) command)
(< (float-time) (+ 5 (cadr cache))))
(inferior-octave-send-list-and-digest
(list (concat "completion_matches (\"" command "\");\n")))
(list (format "completion_matches ('%s');\n" command)))
(setq cache (list command (float-time)
(delete-consecutive-dups
(sort inferior-octave-output-list 'string-lessp)))))
@ -894,8 +899,8 @@ output is passed to the filter `inferior-octave-output-digest'."
"Tracks `cd' commands issued to the inferior Octave process.
Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
(when inferior-octave-directory-tracker-resync
(setq inferior-octave-directory-tracker-resync nil)
(inferior-octave-resync-dirs))
(or (inferior-octave-resync-dirs 'noerror)
(setq inferior-octave-directory-tracker-resync nil)))
(cond
((string-match "^[ \t]*cd[ \t;]*$" string)
(cd "~"))
@ -907,13 +912,17 @@ Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
(error-message-string err)
(match-string 1 string)))))))
(defun inferior-octave-resync-dirs ()
(defun inferior-octave-resync-dirs (&optional noerror)
"Resync the buffer's idea of the current directory.
This command queries the inferior Octave process about its current
directory and makes this the current buffer's default directory."
(interactive)
(inferior-octave-send-list-and-digest '("disp (pwd ())\n"))
(cd (car inferior-octave-output-list)))
(condition-case err
(progn
(cd (car inferior-octave-output-list))
t)
(error (unless noerror (signal (car err) (cdr err))))))
(defcustom inferior-octave-minimal-columns 80
"The minimal column width for the inferior Octave process."
@ -931,7 +940,7 @@ directory and makes this the current buffer's default directory."
(when (and inferior-octave-process
(process-live-p inferior-octave-process))
(inferior-octave-send-list-and-digest
(list (format "putenv(\"COLUMNS\", \"%s\");\n" width)))))))
(list (format "putenv ('COLUMNS', '%s');\n" width)))))))
;;; Miscellaneous useful functions
@ -975,16 +984,17 @@ directory and makes this the current buffer's default directory."
(defun octave-goto-function-definition (fn)
"Go to the function definition of FN in current buffer."
(goto-char (point-min))
(let ((search
(lambda (re sub)
(let (done)
(while (and (not done) (re-search-forward re nil t))
(let ((orig (point)) found)
(goto-char (point-min))
(while (and (not found) (re-search-forward re nil t))
(when (and (equal (match-string sub) fn)
(not (nth 8 (syntax-ppss))))
(setq done t)))
(or done (goto-char (point-min)))))))
(pcase (file-name-extension (buffer-file-name))
(setq found t)))
(unless found (goto-char orig))
found))))
(pcase (and buffer-file-name (file-name-extension buffer-file-name))
(`"cc" (funcall search
"\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
(t (funcall search octave-function-header-regexp 3)))))
@ -1345,8 +1355,6 @@ The block marked is the one that contains point or follows point."
(forward-line 1))))
t)))
;;; Completions
(defun octave-completion-at-point ()
"Find the text to complete and the corresponding table."
(let* ((beg (save-excursion (skip-syntax-backward "w_") (point)))
@ -1363,6 +1371,16 @@ The block marked is the one that contains point or follows point."
(define-obsolete-function-alias 'octave-complete-symbol
'completion-at-point "24.1")
(defun octave-add-log-current-defun ()
"A function for `add-log-current-defun-function' (which see)."
(save-excursion
(end-of-line)
(and (beginning-of-defun)
(re-search-forward octave-function-header-regexp
(line-end-position) t)
(match-string 3))))
;;; Electric characters && friends
(define-skeleton octave-insert-defun
@ -1387,7 +1405,7 @@ entered without parens)."
"function " > str \n
_ \n
"endfunction" > \n)
;;; Communication with the inferior Octave process
(defun octave-kill-process ()
"Kill inferior Octave process and its buffer."
@ -1506,9 +1524,7 @@ code line."
(defun octave-eldoc-function-signatures (fn)
(unless (equal fn (car octave-eldoc-cache))
(inferior-octave-send-list-and-digest
(list (format "\
if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
fn fn)))
(list (format "print_usage ('%s');\n" fn)))
(let (result)
(dolist (line inferior-octave-output-list)
(when (string-match
@ -1605,20 +1621,11 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
(when (or help-xref-stack help-xref-forward-stack)
(insert "\n"))))
(defvar octave-help-mode-finish-hook nil
"Octave specific hook for `temp-buffer-show-hook'.")
(defun octave-help-mode-finish ()
(when (eq major-mode 'octave-help-mode)
(run-hooks 'octave-help-mode-finish-hook)))
(add-hook 'temp-buffer-show-hook 'octave-help-mode-finish)
(defun octave-help (fn)
"Display the documentation of FN."
(interactive (list (octave-completing-read)))
(inferior-octave-send-list-and-digest
(list (format "help \"%s\"\n" fn)))
(list (format "help ('%s');\n" fn)))
(let ((lines inferior-octave-output-list)
(inhibit-read-only t))
(when (string-match "error: \\(.*\\)$" (car lines))
@ -1654,12 +1661,15 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n"
(help-insert-xref-button (file-relative-name file dir)
'octave-help-file fn)
(insert "'")))
;; Make 'See also' clickable
;; Make 'See also' clickable.
(with-syntax-table octave-mode-syntax-table
(when (re-search-forward "^\\s-*See also:" nil t)
(let ((end (save-excursion (re-search-forward "^\\s-*$" nil t))))
(while (re-search-forward "\\_<\\(?:\\sw\\|\\s_\\)+\\_>" end t)
(make-text-button (match-beginning 0) (match-end 0)
(while (re-search-forward
;; Match operators and symbols.
"\\(?1:\\s.+?\\)\\(?:$\\|[,;]\\|\\s-\\)\\|\\_<\\(?1:\\(?:\\sw\\|\\s_\\)+\\)\\_>"
end t)
(make-text-button (match-beginning 1) (match-end 1)
:type 'octave-help-function)))))
(octave-help-mode)))))
@ -1710,23 +1720,30 @@ If the environment variable OCTAVE_SRCDIR is set, it is searched first."
Functions implemented in C++ can be found if
`octave-source-directories' is set correctly."
(interactive (list (octave-completing-read)))
(inferior-octave-send-list-and-digest
;; help NAME is more verbose
(list (format "\
if iskeyword(\"%s\") disp(\"`%s' is a keyword\") else which(\"%s\") endif\n"
fn fn fn)))
(let* ((line (car inferior-octave-output-list))
(file (when (and line (string-match "from the file \\(.*\\)$" line))
(match-string 1 line))))
(if (not file)
(user-error "%s" (or line (format "`%s' not found" fn)))
(require 'etags)
(ring-insert find-tag-marker-ring (point-marker))
(setq file (funcall octave-find-definition-filename-function file))
(when file
(find-file file)
(octave-goto-function-definition fn)))))
(require 'etags)
(let ((orig (point)))
(if (and (derived-mode-p 'octave-mode)
(octave-goto-function-definition fn))
(ring-insert find-tag-marker-ring (copy-marker orig))
(inferior-octave-send-list-and-digest
;; help NAME is more verbose
(list (format "\
if iskeyword('%s') disp('`%s'' is a keyword') else which('%s') endif\n"
fn fn fn)))
(let (line file)
;; Skip garbage lines such as
;; warning: fmincg.m: possible Matlab-style ....
(while (and (not file) (consp inferior-octave-output-list))
(setq line (pop inferior-octave-output-list))
(when (string-match "from the file \\(.*\\)$" line)
(setq file (match-string 1 line))))
(if (not file)
(user-error "%s" (or line (format "`%s' not found" fn)))
(ring-insert find-tag-marker-ring (point-marker))
(setq file (funcall octave-find-definition-filename-function file))
(when file
(find-file file)
(octave-goto-function-definition fn)))))))
(provide 'octave)
;;; octave.el ends here

View file

@ -158,44 +158,10 @@
;; Regexps updated with help from Tom Tromey <tromey@cambric.colorado.edu> and
;; Jim Campbell <jec@murzim.ca.boeing.com>.
(defcustom perl-prettify-symbols t
"If non-nil, some symbols will be displayed using Unicode chars."
:version "24.4"
:type 'boolean)
(defconst perl--prettify-symbols-alist
'(;;("andalso" . ?∧) ("orelse" . ?) ("as" . ?≡)("not" . ?¬)
;;("div" . ?÷) ("*" . ?×) ("o" . ?○)
("->" . ?→)
'(("->" . ?→)
("=>" . ?⇒)
;;("<-" . ?←) ("<>" . ?≠) (">=" . ?≥) ("<=" . ?≤) ("..." . ?⋯)
("::" . ?∷)
))
(defun perl--font-lock-compose-symbol ()
"Compose a sequence of ascii chars into a symbol.
Regexp match data 0 points to the chars."
;; Check that the chars should really be composed into a symbol.
(let* ((start (match-beginning 0))
(end (match-end 0))
(syntaxes (if (eq (char-syntax (char-after start)) ?w)
'(?w) '(?. ?\\))))
(if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
(memq (char-syntax (or (char-after end) ?\ )) syntaxes)
(nth 8 (syntax-ppss)))
;; No composition for you. Let's actually remove any composition
;; we may have added earlier and which is now incorrect.
(remove-text-properties start end '(composition))
;; That's a symbol alright, so add the composition.
(compose-region start end (cdr (assoc (match-string 0)
perl--prettify-symbols-alist)))))
;; Return nil because we're not adding any face property.
nil)
(defun perl--font-lock-symbols-keywords ()
(when perl-prettify-symbols
`((,(regexp-opt (mapcar 'car perl--prettify-symbols-alist) t)
(0 (perl--font-lock-compose-symbol))))))
("::" . ?∷)))
(defconst perl-font-lock-keywords-1
'(;; What is this for?
@ -243,8 +209,7 @@ Regexp match data 0 points to the chars."
;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'.
("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?"
(1 font-lock-keyword-face) (2 font-lock-constant-face nil t))
("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face)
,@(perl--font-lock-symbols-keywords)))
("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face)))
"Gaudy level highlighting for Perl mode.")
(defvar perl-font-lock-keywords perl-font-lock-keywords-1
@ -685,13 +650,15 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
(setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
(setq-local comment-indent-function #'perl-comment-indent)
(setq-local parse-sexp-ignore-comments t)
;; Tell font-lock.el how to handle Perl.
(setq font-lock-defaults '((perl-font-lock-keywords
perl-font-lock-keywords-1
perl-font-lock-keywords-2)
nil nil ((?\_ . "w")) nil
perl-font-lock-keywords-1
perl-font-lock-keywords-2)
nil nil ((?\_ . "w")) nil
(font-lock-syntactic-face-function
. perl-font-lock-syntactic-face-function)))
(prog-prettify-install perl--prettify-symbols-alist)
(setq-local syntax-propertize-function #'perl-syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions
#'syntax-propertize-multiline 'append 'local)

119
lisp/progmodes/prog-mode.el Normal file
View file

@ -0,0 +1,119 @@
;;; prog-mode.el --- Generic major mode for programming -*- lexical-binding: t -*-
;; Copyright (C) 2013 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
;; Package: emacs
;; 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/>.
;;; Commentary:
;; This major mode is mostly intended as a parent of other programming
;; modes. All major modes for programming languages should derive from this
;; mode so that users can put generic customization on prog-mode-hook.
;;; Code:
(eval-when-compile (require 'cl-lib))
(defgroup prog-mode nil
"Generic programming mode, from which others derive."
:group 'languages)
(defvar prog-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [?\C-\M-q] 'prog-indent-sexp)
map)
"Keymap used for programming modes.")
(defun prog-indent-sexp (&optional defun)
"Indent the expression after point.
When interactively called with prefix, indent the enclosing defun
instead."
(interactive "P")
(save-excursion
(when defun
(end-of-line)
(beginning-of-defun))
(let ((start (point))
(end (progn (forward-sexp 1) (point))))
(indent-region start end nil))))
(defvar prog-prettify-symbols-alist nil)
(defcustom prog-prettify-symbols nil
"Whether symbols should be prettified.
When set to an alist in the form `((STRING . CHARACTER)...)' it
will augment the mode's native prettify alist."
:type '(choice
(const :tag "No thanks" nil)
(const :tag "Mode defaults" t)
(alist :tag "Mode defaults augmented with your own list"
:key-type string :value-type character))
:version "24.4")
(defun prog--prettify-font-lock-compose-symbol (alist)
"Compose a sequence of ascii chars into a symbol.
Regexp match data 0 points to the chars."
;; Check that the chars should really be composed into a symbol.
(let* ((start (match-beginning 0))
(end (match-end 0))
(syntaxes (if (eq (char-syntax (char-after start)) ?w)
'(?w) '(?. ?\\))))
(if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
(memq (char-syntax (or (char-after end) ?\ )) syntaxes)
(nth 8 (syntax-ppss)))
;; No composition for you. Let's actually remove any composition
;; we may have added earlier and which is now incorrect.
(remove-text-properties start end '(composition))
;; That's a symbol alright, so add the composition.
(compose-region start end (cdr (assoc (match-string 0) alist)))))
;; Return nil because we're not adding any face property.
nil)
(defun prog-prettify-font-lock-symbols-keywords ()
(when prog-prettify-symbols
(let ((alist (append prog-prettify-symbols-alist
(if (listp prog-prettify-symbols)
prog-prettify-symbols
nil))))
`((,(regexp-opt (mapcar 'car alist) t)
(0 (prog--prettify-font-lock-compose-symbol ',alist)))))))
(defun prog-prettify-install (alist)
"Install prog-mode support to prettify symbols according to ALIST.
ALIST is in the format `((STRING . CHARACTER)...)' like
`prog-prettify-symbols'.
Internally, `font-lock-add-keywords' is called."
(setq-local prog-prettify-symbols-alist alist)
(let ((keywords (prog-prettify-font-lock-symbols-keywords)))
(if keywords (font-lock-add-keywords nil keywords))))
;;;###autoload
(define-derived-mode prog-mode fundamental-mode "Prog"
"Major mode for editing programming language source code."
(set (make-local-variable 'require-final-newline) mode-require-final-newline)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
;; Any programming language is always written left to right.
(setq bidi-paragraph-direction 'left-to-right))
(provide 'prog-mode)
;;; prog-mode.el ends here

View file

@ -1149,11 +1149,7 @@ VERSION is of the format (Major . Minor)"
(set (make-local-variable 'comment-start) "%")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-add) 1)
(set (make-local-variable 'comment-start-skip)
;; This complex regexp makes sure that comments cannot start
;; inside quoted atoms or strings
(format "^\\(\\(%s\\|%s\\|[^\n\'\"%%]\\)*\\)\\(/\\*+ *\\|%%+ *\\)"
prolog-quoted-atom-regexp prolog-string-regexp))
(set (make-local-variable 'comment-start-skip) "\\(?:/\\*+ *\\|%%+ *\\)")
(set (make-local-variable 'parens-require-spaces) nil)
;; Initialize Prolog system specific variables
(dolist (var '(prolog-keywords prolog-types prolog-mode-specificators
@ -1739,8 +1735,7 @@ This function must be called from the source code buffer."
(real-file buffer-file-name)
(command-string (prolog-build-prolog-command compilep file
real-file first-line))
(process (get-process "prolog"))
(old-filter (process-filter process)))
(process (get-process "prolog")))
(with-current-buffer buffer
(delete-region (point-min) (point-max))
;; FIXME: Wasn't this supposed to use prolog-inferior-mode?
@ -1759,8 +1754,7 @@ This function must be called from the source code buffer."
'prolog-parse-sicstus-compilation-errors))
(setq buffer-read-only nil)
(insert command-string "\n"))
(save-selected-window
(pop-to-buffer buffer))
(display-buffer buffer)
(setq prolog-process-flag t
prolog-consult-compile-output ""
prolog-consult-compile-first-line (if first-line (1- first-line) 0)
@ -1954,20 +1948,6 @@ If COMPILEP is non-nil, compile, otherwise consult."
;;-------------------------------------------------------------------
;; Auxiliary functions
(defun prolog-make-keywords-regexp (keywords &optional protect)
"Create regexp from the list of strings KEYWORDS.
If PROTECT is non-nil, surround the result regexp by word breaks."
(let ((regexp
(if (fboundp 'regexp-opt)
;; Emacs 20
;; Avoid compile warnings under earlier versions by using eval
(eval '(regexp-opt keywords))
;; Older Emacsen
(concat (mapconcat 'regexp-quote keywords "\\|")))
))
(if protect
(concat "\\<\\(" regexp "\\)\\>")
regexp)))
(defun prolog-font-lock-object-matcher (bound)
"Find SICStus objects method name for font lock.
@ -2084,20 +2064,16 @@ Argument BOUND is a buffer position limiting searching."
(if (eq prolog-system 'mercury)
(concat
"\\<\\("
(prolog-make-keywords-regexp prolog-keywords-i)
(regexp-opt prolog-keywords-i)
"\\|"
(prolog-make-keywords-regexp
(regexp-opt
prolog-determinism-specificators-i)
"\\)\\>")
(concat
"^[?:]- *\\("
(prolog-make-keywords-regexp prolog-keywords-i)
(regexp-opt prolog-keywords-i)
"\\)\\>"))
1 prolog-builtin-face))
(quoted_atom (list prolog-quoted-atom-regexp
2 'font-lock-string-face 'append))
(string (list prolog-string-regexp
1 'font-lock-string-face 'append))
;; SICStus specific patterns
(sicstus-object-methods
(if (eq prolog-system 'sicstus)
@ -2107,17 +2083,17 @@ Argument BOUND is a buffer position limiting searching."
(types
(if (eq prolog-system 'mercury)
(list
(prolog-make-keywords-regexp prolog-types-i t)
(regexp-opt prolog-types-i 'words)
0 'font-lock-type-face)))
(modes
(if (eq prolog-system 'mercury)
(list
(prolog-make-keywords-regexp prolog-mode-specificators-i t)
(regexp-opt prolog-mode-specificators-i 'words)
0 'font-lock-constant-face)))
(directives
(if (eq prolog-system 'mercury)
(list
(prolog-make-keywords-regexp prolog-directives-i t)
(regexp-opt prolog-directives-i 'words)
0 'prolog-warning-face)))
;; Inferior mode specific patterns
(prompt
@ -2211,8 +2187,6 @@ Argument BOUND is a buffer position limiting searching."
(list
head-predicates
head-predicates-1
quoted_atom
string
variables
important-elements
important-elements-1

View file

@ -246,7 +246,7 @@ Matching is independent of case if `case-fold-search' is non-nil and
FROM-STRING has no uppercase letters. Replacement transfers the case
pattern of the old text to the new text, if `case-replace' and
`case-fold-search' are non-nil and FROM-STRING has no uppercase
letters. \(Transferring the case pattern means that if the old text
letters. (Transferring the case pattern means that if the old text
matched is all caps, or capitalized, then its replacement is upcased
or capitalized.)
@ -1175,8 +1175,8 @@ is called only during interactive use.
For example, to check for occurrence of symbol at point use
\(setq occur-read-regexp-defaults-function
'find-tag-default-as-regexp\).")
(setq occur-read-regexp-defaults-function
'find-tag-default-as-regexp).")
(defun occur-read-regexp-defaults ()
"Return the latest regexp from `regexp-history'.
@ -1874,7 +1874,7 @@ It is called with three arguments, as if it were
(defun replace-search (search-string limit regexp-flag delimited-flag
case-fold-search)
"Search for the next occurence of SEARCH-STRING to replace."
"Search for the next occurrence of SEARCH-STRING to replace."
;; Let-bind global isearch-* variables to values used
;; to search the next replacement. These let-bindings
;; should be effective both at the time of calling

View file

@ -372,34 +372,6 @@ Other major modes are defined by comparison with this one."
"Parent major mode from which special major modes should inherit."
(setq buffer-read-only t))
;; Major mode meant to be the parent of programming modes.
(defvar prog-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [?\C-\M-q] 'prog-indent-sexp)
map)
"Keymap used for programming modes.")
(defun prog-indent-sexp (&optional defun)
"Indent the expression after point.
When interactively called with prefix, indent the enclosing defun
instead."
(interactive "P")
(save-excursion
(when defun
(end-of-line)
(beginning-of-defun))
(let ((start (point))
(end (progn (forward-sexp 1) (point))))
(indent-region start end nil))))
(define-derived-mode prog-mode fundamental-mode "Prog"
"Major mode for editing programming language source code."
(set (make-local-variable 'require-final-newline) mode-require-final-newline)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
;; Any programming language is always written left to right.
(setq bidi-paragraph-direction 'left-to-right))
;; Making and deleting lines.
(defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard))

View file

@ -31,6 +31,8 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
;; page 1: statement skeleton language definition & interpreter
;; page 2: paired insertion
;; page 3: mirror-mode, an example for setting up paired insertion
@ -84,13 +86,11 @@ The variables `v1' and `v2' are still set when calling this.")
"When non-nil, indent rigidly under current line for element `\\n'.
Else use mode's `indent-line-function'.")
(defvar skeleton-further-elements ()
(defvar-local skeleton-further-elements ()
"A buffer-local varlist (see `let') of mode specific skeleton elements.
These variables are bound while interpreting a skeleton. Their value may
in turn be any valid skeleton element if they are themselves to be used as
skeleton elements.")
(make-variable-buffer-local 'skeleton-further-elements)
(defvar skeleton-subprompt
(substitute-command-keys
@ -260,8 +260,10 @@ When done with skeleton, but before going back to `_'-point call
skeleton-modified skeleton-point resume: help input v1 v2)
(setq skeleton-positions nil)
(unwind-protect
(eval `(let ,skeleton-further-elements
(skeleton-internal-list skeleton str)))
(cl-progv
(mapcar #'car skeleton-further-elements)
(mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
(skeleton-internal-list skeleton str))
(run-hooks 'skeleton-end-hook)
(sit-for 0)
(or (pos-visible-in-window-p beg)

View file

@ -1,4 +1,4 @@
;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8 -*-
;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8; lexical-binding:t -*-
;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2013 Free Software
;; Foundation, Inc.
@ -39,13 +39,13 @@ Each element of this list holds the arguments to one call to `defcustom'.")
(setq custom-declare-variable-list
(cons arguments custom-declare-variable-list)))
(defmacro declare-function (fn file &optional arglist fileonly)
(defmacro declare-function (_fn _file &optional _arglist _fileonly)
"Tell the byte-compiler that function FN is defined, in FILE.
Optional ARGLIST is the argument list used by the function. The
FILE argument is not used by the byte-compiler, but by the
Optional ARGLIST is the argument list used by the function.
The FILE argument is not used by the byte-compiler, but by the
`check-declare' package, which checks that FILE contains a
definition for FN. ARGLIST is used by both the byte-compiler and
`check-declare' to check for consistency.
definition for FN. ARGLIST is used by both the byte-compiler
and `check-declare' to check for consistency.
FILE can be either a Lisp file (in which case the \".el\"
extension is optional), or a C file. C files are expanded
@ -396,9 +396,9 @@ non-nil."
(defun number-sequence (from &optional to inc)
"Return a sequence of numbers from FROM to TO (both inclusive) as a list.
INC is the increment used between numbers in the sequence and defaults to 1.
So, the Nth element of the list is \(+ FROM \(* N INC)) where N counts from
So, the Nth element of the list is (+ FROM (* N INC)) where N counts from
zero. TO is only included if there is an N for which TO = FROM + N * INC.
If TO is nil or numerically equal to FROM, return \(FROM).
If TO is nil or numerically equal to FROM, return (FROM).
If INC is positive and TO is less than FROM, or INC is negative
and TO is larger than FROM, return nil.
If INC is zero and TO is neither nil nor numerically equal to
@ -408,11 +408,11 @@ This function is primarily designed for integer arguments.
Nevertheless, FROM, TO and INC can be integer or float. However,
floating point arithmetic is inexact. For instance, depending on
the machine, it may quite well happen that
\(number-sequence 0.4 0.6 0.2) returns the one element list \(0.4),
whereas \(number-sequence 0.4 0.8 0.2) returns a list with three
\(number-sequence 0.4 0.6 0.2) returns the one element list (0.4),
whereas (number-sequence 0.4 0.8 0.2) returns a list with three
elements. Thus, if some of the arguments are floats and one wants
to make sure that TO is included, one may have to explicitly write
TO as \(+ FROM \(* N INC)) or use a variable whose value was
TO as (+ FROM (* N INC)) or use a variable whose value was
computed with this exact expression. Alternatively, you can,
of course, also replace TO with a slightly larger value
\(or a slightly more negative value if INC is negative)."
@ -784,8 +784,8 @@ KEY is a key sequence; noninteractively, it is a string or vector
of characters or event types, and non-ASCII characters with codes
above 127 (such as ISO Latin-1) can be included if you use a vector.
The binding goes in the current buffer's local map,
which in most cases is shared with all other buffers in the same major mode."
The binding goes in the current buffer's local map, which in most
cases is shared with all other buffers in the same major mode."
(interactive "KSet key locally: \nCSet key %s locally to command: ")
(let ((map (current-local-map)))
(or map
@ -821,7 +821,7 @@ in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
If you don't specify OLDMAP, you can usually get the same results
in a cleaner way with command remapping, like this:
\(define-key KEYMAP [remap OLDDEF] NEWDEF)
(define-key KEYMAP [remap OLDDEF] NEWDEF)
\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)"
;; Don't document PREFIX in the doc string because we don't want to
;; advertise it. It's meant for recursive calls only. Here's its
@ -1478,11 +1478,48 @@ ELEMENT is added at the end.
The return value is the new value of LIST-VAR.
This is handy to add some elements to configuration variables,
but please do not abuse it in Elisp code, where you are usually better off
using `push' or `cl-pushnew'.
If you want to use `add-to-list' on a variable that is not defined
until a certain package is loaded, you should put the call to `add-to-list'
into a hook function that will be run only after loading the package.
`eval-after-load' provides one way to do this. In some cases
other hooks, such as major mode hooks, can do the job."
(declare
(compiler-macro
(lambda (exp)
;; FIXME: Something like this could be used for `set' as well.
(if (or (not (eq 'quote (car-safe list-var)))
(special-variable-p (cadr list-var))
(and append compare-fn))
exp
(let* ((sym (cadr list-var))
(msg (format "`add-to-list' can't use lexical var `%s'; use `push' or `cl-pushnew'"
sym))
;; Big ugly hack so we only output a warning during
;; byte-compilation, and so we can use
;; byte-compile-not-lexical-var-p to silence the warning
;; when a defvar has been seen but not yet executed.
(warnfun (lambda ()
;; FIXME: We should also emit a warning for let-bound
;; variables with dynamic binding.
(when (assq sym byte-compile--lexical-environment)
(byte-compile-log-warning msg t :error))))
(code
(if append
(macroexp-let2 macroexp-copyable-p x element
`(unless (member ,x ,sym)
(setq ,sym (append ,sym (list ,x)))))
(require 'cl-lib)
`(cl-pushnew ,element ,sym
:test ,(or compare-fn '#'equal)))))
(if (not (macroexp--compiling-p))
code
`(progn
(macroexp--funcall-if-compiled ',warnfun)
,code)))))))
(if (cond
((null compare-fn)
(member element (symbol-value list-var)))
@ -1710,7 +1747,7 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
(nconc found (list (cons toggle keymap)) rest))
(push (cons toggle keymap) minor-mode-map-alist)))))))
;;; Load history
;;;; Load history
(defsubst autoloadp (object)
"Non-nil if OBJECT is an autoload."
@ -1792,173 +1829,6 @@ and the file name is displayed in the echo area."
(message "No library %s in search path" library)))
file))
;;;; Specifying things to do later.
(defun load-history-regexp (file)
"Form a regexp to find FILE in `load-history'.
FILE, a string, is described in the function `eval-after-load'."
(if (file-name-absolute-p file)
(setq file (file-truename file)))
(concat (if (file-name-absolute-p file) "\\`" "\\(\\`\\|/\\)")
(regexp-quote file)
(if (file-name-extension file)
""
;; Note: regexp-opt can't be used here, since we need to call
;; this before Emacs has been fully started. 2006-05-21
(concat "\\(" (mapconcat 'regexp-quote load-suffixes "\\|") "\\)?"))
"\\(" (mapconcat 'regexp-quote jka-compr-load-suffixes "\\|")
"\\)?\\'"))
(defun load-history-filename-element (file-regexp)
"Get the first elt of `load-history' whose car matches FILE-REGEXP.
Return nil if there isn't one."
(let* ((loads load-history)
(load-elt (and loads (car loads))))
(save-match-data
(while (and loads
(or (null (car load-elt))
(not (string-match file-regexp (car load-elt)))))
(setq loads (cdr loads)
load-elt (and loads (car loads)))))
load-elt))
(put 'eval-after-load 'lisp-indent-function 1)
(defun eval-after-load (file form)
"Arrange that if FILE is loaded, FORM will be run immediately afterwards.
If FILE is already loaded, evaluate FORM right now.
If a matching file is loaded again, FORM will be evaluated again.
If FILE is a string, it may be either an absolute or a relative file
name, and may have an extension \(e.g. \".el\") or may lack one, and
additionally may or may not have an extension denoting a compressed
format \(e.g. \".gz\").
When FILE is absolute, this first converts it to a true name by chasing
symbolic links. Only a file of this name \(see next paragraph regarding
extensions) will trigger the evaluation of FORM. When FILE is relative,
a file whose absolute true name ends in FILE will trigger evaluation.
When FILE lacks an extension, a file name with any extension will trigger
evaluation. Otherwise, its extension must match FILE's. A further
extension for a compressed format \(e.g. \".gz\") on FILE will not affect
this name matching.
Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
is evaluated at the end of any file that `provide's this feature.
If the feature is provided when evaluating code not associated with a
file, FORM is evaluated immediately after the provide statement.
Usually FILE is just a library name like \"font-lock\" or a feature name
like 'font-lock.
This function makes or adds to an entry on `after-load-alist'."
;; Add this FORM into after-load-alist (regardless of whether we'll be
;; evaluating it now).
(let* ((regexp-or-feature
(if (stringp file)
(setq file (purecopy (load-history-regexp file)))
file))
(elt (assoc regexp-or-feature after-load-alist)))
(unless elt
(setq elt (list regexp-or-feature))
(push elt after-load-alist))
;; Make sure `form' is evalled in the current lexical/dynamic code.
(setq form `(funcall ',(eval `(lambda () ,form) lexical-binding)))
;; Is there an already loaded file whose name (or `provide' name)
;; matches FILE?
(prog1 (if (if (stringp file)
(load-history-filename-element regexp-or-feature)
(featurep file))
(eval form))
(when (symbolp regexp-or-feature)
;; For features, the after-load-alist elements get run when `provide' is
;; called rather than at the end of the file. So add an indirection to
;; make sure that `form' is really run "after-load" in case the provide
;; call happens early.
(setq form
`(if load-file-name
(let ((fun (make-symbol "eval-after-load-helper")))
(fset fun `(lambda (file)
(if (not (equal file ',load-file-name))
nil
(remove-hook 'after-load-functions ',fun)
,',form)))
(add-hook 'after-load-functions fun))
;; Not being provided from a file, run form right now.
,form)))
;; Add FORM to the element unless it's already there.
(unless (member form (cdr elt))
(nconc elt (list form))))))
(defvar after-load-functions nil
"Special hook run after loading a file.
Each function there is called with a single argument, the absolute
name of the file just loaded.")
(defun do-after-load-evaluation (abs-file)
"Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
ABS-FILE, a string, should be the absolute true name of a file just loaded.
This function is called directly from the C code."
;; Run the relevant eval-after-load forms.
(mapc #'(lambda (a-l-element)
(when (and (stringp (car a-l-element))
(string-match-p (car a-l-element) abs-file))
;; discard the file name regexp
(mapc #'eval (cdr a-l-element))))
after-load-alist)
;; Complain when the user uses obsolete files.
(when (string-match-p "/obsolete/[^/]*\\'" abs-file)
(run-with-timer 0 nil
(lambda (file)
(message "Package %s is obsolete!"
(substring file 0
(string-match "\\.elc?\\>" file))))
(file-name-nondirectory abs-file)))
;; Finally, run any other hook.
(run-hook-with-args 'after-load-functions abs-file))
(defun eval-next-after-load (file)
"Read the following input sexp, and run it whenever FILE is loaded.
This makes or adds to an entry on `after-load-alist'.
FILE should be the name of a library, with no directory name."
(declare (obsolete eval-after-load "23.2"))
(eval-after-load file (read)))
(defun display-delayed-warnings ()
"Display delayed warnings from `delayed-warnings-list'.
Used from `delayed-warnings-hook' (which see)."
(dolist (warning (nreverse delayed-warnings-list))
(apply 'display-warning warning))
(setq delayed-warnings-list nil))
(defun collapse-delayed-warnings ()
"Remove duplicates from `delayed-warnings-list'.
Collapse identical adjacent warnings into one (plus count).
Used from `delayed-warnings-hook' (which see)."
(let ((count 1)
collapsed warning)
(while delayed-warnings-list
(setq warning (pop delayed-warnings-list))
(if (equal warning (car delayed-warnings-list))
(setq count (1+ count))
(when (> count 1)
(setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
(cddr warning)))
(setq count 1))
(push warning collapsed)))
(setq delayed-warnings-list (nreverse collapsed))))
;; At present this is only used for Emacs internals.
;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
(defvar delayed-warnings-hook '(collapse-delayed-warnings
display-delayed-warnings)
"Normal hook run to process and display delayed warnings.
By default, this hook contains functions to consolidate the
warnings listed in `delayed-warnings-list', display them, and set
`delayed-warnings-list' back to nil.")
;;;; Process stuff.
@ -2054,8 +1924,8 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
;; disable quail's input methods, so although read-key-sequence
;; always inherits the input method, in practice read-key does not
;; inherit the input method (at least not if it's based on quail).
(let ((overriding-terminal-local-map read-key-empty-map)
(overriding-local-map nil)
(let ((overriding-terminal-local-map nil)
(overriding-local-map read-key-empty-map)
(echo-keystrokes 0)
(old-global-map (current-global-map))
(timer (run-with-idle-timer
@ -2670,7 +2540,7 @@ Set this to nil at your own risk..."
(defun locate-user-emacs-file (new-name &optional old-name)
"Return an absolute per-user Emacs-specific file name.
If NEW-NAME exists in `user-emacs-directory', return it.
Else If OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
Else if OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.
Else return NEW-NAME in `user-emacs-directory', creating the
directory if it does not exist."
(convert-standard-filename
@ -3361,7 +3231,7 @@ than cosmetic ones, undo data may become corrupted.
This macro will run BODY normally, but doesn't count its buffer
modifications as being buffer modifications. This affects things
like buffer-modified-p, checking whether the file is locked by
like `buffer-modified-p', checking whether the file is locked by
someone else, running buffer modification hooks, and other things
of that nature.
@ -3666,7 +3536,7 @@ which separates, but is not part of, the substrings. If nil it defaults to
`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
OMIT-NULLS is forced to t.
If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so
If OMIT-NULLS is t, zero-length substrings are omitted from the list (so
that for the default value of SEPARATORS leading and trailing whitespace
are effectively trimmed). If nil, all zero-length substrings are retained,
which correctly parses CSV format, for example.
@ -3824,6 +3694,173 @@ consisting of STR followed by an invisible left-to-right mark
(if (string-match "\\cR" str)
(concat str (propertize (string ?\x200e) 'invisible t))
str))
;;;; Specifying things to do later.
(defun load-history-regexp (file)
"Form a regexp to find FILE in `load-history'.
FILE, a string, is described in the function `eval-after-load'."
(if (file-name-absolute-p file)
(setq file (file-truename file)))
(concat (if (file-name-absolute-p file) "\\`" "\\(\\`\\|/\\)")
(regexp-quote file)
(if (file-name-extension file)
""
;; Note: regexp-opt can't be used here, since we need to call
;; this before Emacs has been fully started. 2006-05-21
(concat "\\(" (mapconcat 'regexp-quote load-suffixes "\\|") "\\)?"))
"\\(" (mapconcat 'regexp-quote jka-compr-load-suffixes "\\|")
"\\)?\\'"))
(defun load-history-filename-element (file-regexp)
"Get the first elt of `load-history' whose car matches FILE-REGEXP.
Return nil if there isn't one."
(let* ((loads load-history)
(load-elt (and loads (car loads))))
(save-match-data
(while (and loads
(or (null (car load-elt))
(not (string-match file-regexp (car load-elt)))))
(setq loads (cdr loads)
load-elt (and loads (car loads)))))
load-elt))
(put 'eval-after-load 'lisp-indent-function 1)
(defun eval-after-load (file form)
"Arrange that if FILE is loaded, FORM will be run immediately afterwards.
If FILE is already loaded, evaluate FORM right now.
If a matching file is loaded again, FORM will be evaluated again.
If FILE is a string, it may be either an absolute or a relative file
name, and may have an extension (e.g. \".el\") or may lack one, and
additionally may or may not have an extension denoting a compressed
format (e.g. \".gz\").
When FILE is absolute, this first converts it to a true name by chasing
symbolic links. Only a file of this name (see next paragraph regarding
extensions) will trigger the evaluation of FORM. When FILE is relative,
a file whose absolute true name ends in FILE will trigger evaluation.
When FILE lacks an extension, a file name with any extension will trigger
evaluation. Otherwise, its extension must match FILE's. A further
extension for a compressed format (e.g. \".gz\") on FILE will not affect
this name matching.
Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
is evaluated at the end of any file that `provide's this feature.
If the feature is provided when evaluating code not associated with a
file, FORM is evaluated immediately after the provide statement.
Usually FILE is just a library name like \"font-lock\" or a feature name
like 'font-lock.
This function makes or adds to an entry on `after-load-alist'."
;; Add this FORM into after-load-alist (regardless of whether we'll be
;; evaluating it now).
(let* ((regexp-or-feature
(if (stringp file)
(setq file (purecopy (load-history-regexp file)))
file))
(elt (assoc regexp-or-feature after-load-alist)))
(unless elt
(setq elt (list regexp-or-feature))
(push elt after-load-alist))
;; Make sure `form' is evalled in the current lexical/dynamic code.
(setq form `(funcall ',(eval `(lambda () ,form) lexical-binding)))
;; Is there an already loaded file whose name (or `provide' name)
;; matches FILE?
(prog1 (if (if (stringp file)
(load-history-filename-element regexp-or-feature)
(featurep file))
(eval form))
(when (symbolp regexp-or-feature)
;; For features, the after-load-alist elements get run when `provide' is
;; called rather than at the end of the file. So add an indirection to
;; make sure that `form' is really run "after-load" in case the provide
;; call happens early.
(setq form
`(if load-file-name
(let ((fun (make-symbol "eval-after-load-helper")))
(fset fun `(lambda (file)
(if (not (equal file ',load-file-name))
nil
(remove-hook 'after-load-functions ',fun)
,',form)))
(add-hook 'after-load-functions fun))
;; Not being provided from a file, run form right now.
,form)))
;; Add FORM to the element unless it's already there.
(unless (member form (cdr elt))
(nconc elt (list form))))))
(defvar after-load-functions nil
"Special hook run after loading a file.
Each function there is called with a single argument, the absolute
name of the file just loaded.")
(defun do-after-load-evaluation (abs-file)
"Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
ABS-FILE, a string, should be the absolute true name of a file just loaded.
This function is called directly from the C code."
;; Run the relevant eval-after-load forms.
(mapc #'(lambda (a-l-element)
(when (and (stringp (car a-l-element))
(string-match-p (car a-l-element) abs-file))
;; discard the file name regexp
(mapc #'eval (cdr a-l-element))))
after-load-alist)
;; Complain when the user uses obsolete files.
(when (string-match-p "/obsolete/[^/]*\\'" abs-file)
(run-with-timer 0 nil
(lambda (file)
(message "Package %s is obsolete!"
(substring file 0
(string-match "\\.elc?\\>" file))))
(file-name-nondirectory abs-file)))
;; Finally, run any other hook.
(run-hook-with-args 'after-load-functions abs-file))
(defun eval-next-after-load (file)
"Read the following input sexp, and run it whenever FILE is loaded.
This makes or adds to an entry on `after-load-alist'.
FILE should be the name of a library, with no directory name."
(declare (obsolete eval-after-load "23.2"))
(eval-after-load file (read)))
(defun display-delayed-warnings ()
"Display delayed warnings from `delayed-warnings-list'.
Used from `delayed-warnings-hook' (which see)."
(dolist (warning (nreverse delayed-warnings-list))
(apply 'display-warning warning))
(setq delayed-warnings-list nil))
(defun collapse-delayed-warnings ()
"Remove duplicates from `delayed-warnings-list'.
Collapse identical adjacent warnings into one (plus count).
Used from `delayed-warnings-hook' (which see)."
(let ((count 1)
collapsed warning)
(while delayed-warnings-list
(setq warning (pop delayed-warnings-list))
(if (equal warning (car delayed-warnings-list))
(setq count (1+ count))
(when (> count 1)
(setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
(cddr warning)))
(setq count 1))
(push warning collapsed)))
(setq delayed-warnings-list (nreverse collapsed))))
;; At present this is only used for Emacs internals.
;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
(defvar delayed-warnings-hook '(collapse-delayed-warnings
display-delayed-warnings)
"Normal hook run to process and display delayed warnings.
By default, this hook contains functions to consolidate the
warnings listed in `delayed-warnings-list', display them, and set
`delayed-warnings-list' back to nil.")
;;;; invisibility specs
@ -4197,32 +4234,6 @@ use `called-interactively-p'."
(declare (obsolete called-interactively-p "23.2"))
(called-interactively-p 'interactive))
(defun function-arity (f &optional num)
"Return the (MIN . MAX) arity of F.
If the maximum arity is infinite, MAX is `many'.
F can be a function or a macro.
If NUM is non-nil, return non-nil iff F can be called with NUM args."
(if (symbolp f) (setq f (indirect-function f)))
(if (eq (car-safe f) 'macro) (setq f (cdr f)))
(let ((res
(if (subrp f)
(let ((x (subr-arity f)))
(if (eq (cdr x) 'unevalled) (cons (car x) 'many)))
(let* ((args (if (consp f) (cadr f) (aref f 0)))
(max (length args))
(opt (memq '&optional args))
(rest (memq '&rest args))
(min (- max (length opt))))
(if opt
(cons min (if rest 'many (1- max)))
(if rest
(cons (- max (length rest)) 'many)
(cons min max)))))))
(if (not num)
res
(and (>= num (car res))
(or (eq 'many (cdr res)) (<= num (cdr res)))))))
(defun set-temporary-overlay-map (map &optional keep-pred)
"Set MAP as a temporary keymap taking precedence over most other keymaps.
Note that this does NOT take precedence over the \"overriding\" maps

View file

@ -560,6 +560,13 @@ This variable is buffer-local."
:type 'boolean
:group 'term)
(defcustom term-suppress-hard-newline nil
"Non-nil means interpreter should not break long lines with newlines.
This means text can automatically reflow if the window is resized."
:version "24.4"
:type 'boolean
:group 'term)
;; Where gud-display-frame should put the debugging arrow. This is
;; set by the marker-filter, which scans the debugger's output for
;; indications of the current pc.
@ -2828,8 +2835,9 @@ See `term-prompt-regexp'."
(setq count (length decoded-substring))
(setq temp (- (+ (term-horizontal-column) count)
term-width))
(cond ((<= temp 0)) ;; All count chars fit in line.
((> count temp) ;; Some chars fit.
(cond ((or term-suppress-hard-newline (<= temp 0)))
;; All count chars fit in line.
((> count temp) ;; Some chars fit.
;; This iteration, handle only what fits.
(setq count (- count temp))
(setq count-bytes

View file

@ -25,18 +25,16 @@
;;; Code:
(eval-when-compile (require 'cl))
(provide 'reftex-cite)
(require 'reftex)
;;;
;; Variables and constants
;;; Variables and constants
(defvar reftex-cite-regexp-hist nil
"The history list of regular expressions used for citations")
;; The history list of regular expressions used for citations
(defvar reftex-cite-regexp-hist nil)
;; Prompt and help string for citation selection
(defconst reftex-citation-prompt
"Select: [n]ext [p]revious [r]estrict [ ]full_entry [q]uit RET [?]Help+more")
"Select: [n]ext [p]revious [r]estrict [ ]full_entry [q]uit RET [?]Help+more"
"Prompt and help string for citation selection")
(defconst reftex-citation-help
" n / p Go to next/previous entry (Cursor motion works as well).
@ -51,8 +49,7 @@
e / E Create BibTeX file with all (marked/unmarked) entries
a / A Put all (marked) entries into one/many \\cite commands.")
;; Find bibtex files
;;; Find bibtex files
(defmacro reftex-with-special-syntax-for-bib (&rest body)
`(let ((saved-syntax (syntax-table)))
(unwind-protect
@ -62,8 +59,8 @@
(set-syntax-table saved-syntax))))
(defun reftex-default-bibliography ()
;; Return the expanded value of `reftex-default-bibliography'.
;; The expanded value is cached.
"Return the expanded value of variable `reftex-default-bibliography'.
The expanded value is cached."
(unless (eq (get 'reftex-default-bibliography :reftex-raw)
reftex-default-bibliography)
(put 'reftex-default-bibliography :reftex-expanded
@ -74,9 +71,8 @@
(get 'reftex-default-bibliography :reftex-expanded))
(defun reftex-bib-or-thebib ()
;; Tests if BibTeX or \begin{thebibliography} should be used for the
;; citation
;; Find the bof of the current file
"Test if BibTeX or \begin{thebibliography} should be used for the citation.
Find the bof of the current file"
(let* ((docstruct (symbol-value reftex-docstruct-symbol))
(rest (or (member (list 'bof (buffer-file-name)) docstruct)
docstruct))
@ -94,11 +90,11 @@
(if thebib 'thebib nil))))
(defun reftex-get-bibfile-list ()
;; Return list of bibfiles for current document.
;; When using the chapterbib or bibunits package you should either
;; use the same database files everywhere, or separate parts using
;; different databases into different files (included into the mater file).
;; Then this function will return the applicable database files.
"Return list of bibfiles for current document.
When using the chapterbib or bibunits package you should either
use the same database files everywhere, or separate parts using
different databases into different files (included into the mater file).
Then this function will return the applicable database files."
;; Ensure access to scanning info
(reftex-access-scan-info)
@ -115,16 +111,14 @@
(cdr (assq 'bib (symbol-value reftex-docstruct-symbol)))
(error "\\bibliography statement missing or .bib files not found")))
;; Find a certain reference in any of the BibTeX files.
;;; Find a certain reference in any of the BibTeX files.
(defun reftex-pop-to-bibtex-entry (key file-list &optional mark-to-kill
highlight item return)
;; Find BibTeX KEY in any file in FILE-LIST in another window.
;; If MARK-TO-KILL is non-nil, mark new buffer to kill.
;; If HIGHLIGHT is non-nil, highlight the match.
;; If ITEM in non-nil, search for bibitem instead of database entry.
;; If RETURN is non-nil, just return the entry and restore point.
"Find BibTeX KEY in any file in FILE-LIST in another window.
If MARK-TO-KILL is non-nil, mark new buffer to kill.
If HIGHLIGHT is non-nil, highlight the match.
If ITEM in non-nil, search for bibitem instead of database entry.
If RETURN is non-nil, just return the entry and restore point."
(let* ((re
(if item
(concat "\\\\bibitem[ \t]*\\(\\[[^]]*\\]\\)?[ \t]*{"
@ -178,12 +172,11 @@
(progn (forward-list 1) (point)))
(error (min (point-max) (+ 300 (point)))))))
;; Parse bibtex buffers
;;; Parse bibtex buffers
(defun reftex-extract-bib-entries (buffers)
;; Extract bib entries which match regexps from BUFFERS.
;; BUFFERS is a list of buffers or file names.
;; Return list with entries."
"Extract bib entries which match regexps from BUFFERS.
BUFFERS is a list of buffers or file names.
Return list with entries."
(let* (re-list first-re rest-re
(buffer-list (if (listp buffers) buffers (list buffers)))
found-list entry buffer1 buffer alist
@ -309,6 +302,8 @@
(t found-list))))
(defun reftex-bib-sort-author (e1 e2)
"Compare bib entries E1 and E2 by author.
The name of the first different author/editor is used."
(let ((al1 (reftex-get-bib-names "author" e1))
(al2 (reftex-get-bib-names "author" e2)))
(while (and al1 al2 (string= (car al1) (car al2)))
@ -320,15 +315,17 @@
(not (stringp (car al1))))))
(defun reftex-bib-sort-year (e1 e2)
"Compare bib entries E1 and E2 by year in ascending order."
(< (string-to-number (or (cdr (assoc "year" e1)) "0"))
(string-to-number (or (cdr (assoc "year" e2)) "0"))))
(defun reftex-bib-sort-year-reverse (e1 e2)
"Compare bib entries E1 and E2 by year in descending order."
(> (string-to-number (or (cdr (assoc "year" e1)) "0"))
(string-to-number (or (cdr (assoc "year" e2)) "0"))))
(defun reftex-get-crossref-alist (entry)
;; return the alist from a crossref entry
"Return the alist from a crossref ENTRY."
(let ((crkey (cdr (assoc "crossref" entry)))
start)
(save-excursion
@ -347,10 +344,9 @@
;; Parse the bibliography environment
(defun reftex-extract-bib-entries-from-thebibliography (files)
;; Extract bib-entries from the \begin{thebibliography} environment.
;; Parsing is not as good as for the BibTeX database stuff.
;; The environment should be located in file FILE.
"Extract bib-entries from the \begin{thebibliography} environment.
Parsing is not as good as for the BibTeX database stuff.
The environment should be located in FILES."
(let* (start end buf entries re re-list file default)
(unless files
(error "Need file name to find thebibliography environment"))
@ -430,8 +426,8 @@
entries))
(defun reftex-get-bibkey-default ()
;; Return the word before the cursor. If the cursor is in a
;; citation macro, return the word before the macro.
"Return the word before the cursor.
If the cursor is in a citation macro, return the word before the macro."
(let* ((macro (reftex-what-macro 1)))
(save-excursion
(if (and macro (string-match "cite" (car macro)))
@ -439,10 +435,10 @@
(skip-chars-backward "^a-zA-Z0-9")
(reftex-this-word))))
;; Parse and format individual entries
;;; Parse and format individual entries
(defun reftex-get-bib-names (field entry)
;; Return a list with the author or editor names in ENTRY
"Return a list with the author or editor names in ENTRY.
If FIELD is empty try \"editor\" field."
(let ((names (reftex-get-bib-field field entry)))
(if (equal "" names)
(setq names (reftex-get-bib-field "editor" entry)))
@ -457,7 +453,9 @@
(split-string names "\n")))
(defun reftex-parse-bibtex-entry (entry &optional from to raw)
; if RAW is non-nil, keep double quotes/curly braces delimiting fields
"Parse BibTeX ENTRY.
If ENTRY is nil then parse the entry in current buffer between FROM and TO.
If RAW is non-nil, keep double quotes/curly braces delimiting fields."
(let (alist key start field)
(save-excursion
(save-restriction
@ -518,7 +516,8 @@
alist))
(defun reftex-get-bib-field (fieldname entry &optional format)
;; Extract the field FIELDNAME from an ENTRY
"Extract the field FIELDNAME from ENTRY.
If FORMAT is non-nil `format' entry accordingly."
(let ((cell (assoc fieldname entry)))
(if cell
(if format
@ -527,7 +526,7 @@
"")))
(defun reftex-format-bib-entry (entry)
;; Format a BibTeX ENTRY so that it is nice to look at
"Format a BibTeX ENTRY so that it is nice to look at."
(let*
((auth-list (reftex-get-bib-names "author" entry))
(authors (mapconcat 'identity auth-list ", "))
@ -570,7 +569,7 @@
(concat key "\n " authors " " year " " extra "\n " title "\n\n")))
(defun reftex-parse-bibitem (item)
;; Parse a \bibitem entry
"Parse a \bibitem entry in ITEM."
(let ((key "") (text ""))
(when (string-match "\\`{\\([^}]+\\)}\\([^\000]*\\)" item)
(setq key (match-string 1 item)
@ -586,7 +585,7 @@
(cons "&entry" (concat key " " text)))))
(defun reftex-format-bibitem (item)
;; Format a \bibitem entry so that it is (relatively) nice to look at.
"Format a \bibitem entry in ITEM so that it is (relatively) nice to look at."
(let ((text (reftex-get-bib-field "&text" item))
(key (reftex-get-bib-field "&key" item))
(lines nil))
@ -603,7 +602,7 @@
(put-text-property 0 (length text) 'face reftex-bib-author-face text))
(concat key "\n " text "\n\n")))
;; Make a citation
;;; Make a citation
;;;###autoload
(defun reftex-citation (&optional no-insert format-key)
@ -627,7 +626,6 @@ The regular expression uses an expanded syntax: && is interpreted as `and'.
Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'.
While entering the regexp, completion on knows citation keys is possible.
`=' is a good regular expression to match all entries in all files."
(interactive)
;; check for recursive edit
@ -645,8 +643,7 @@ While entering the regexp, completion on knows citation keys is possible.
(reftex-kill-temporary-buffers)))
(defun reftex-do-citation (&optional arg no-insert format-key)
;; This really does the work of reftex-citation.
"This really does the work of `reftex-citation'."
(let* ((format (reftex-figure-out-cite-format arg no-insert format-key))
(docstruct-symbol reftex-docstruct-symbol)
(selected-entries (reftex-offer-bib-menu))
@ -743,8 +740,8 @@ While entering the regexp, completion on knows citation keys is possible.
(mapcar 'car selected-entries)))
(defun reftex-figure-out-cite-format (arg &optional no-insert format-key)
;; Check if there is already a cite command at point and change cite format
;; in order to only add another reference in the same cite command.
"Check if there is already a cite command at point and change cite format
in order to only add another reference in the same cite command."
(let ((macro (car (reftex-what-macro 1)))
(cite-format-value (reftex-get-cite-format))
key format)
@ -802,8 +799,7 @@ While entering the regexp, completion on knows citation keys is possible.
(defvar reftex-select-bib-map)
(defun reftex-offer-bib-menu ()
;; Offer bib menu and return list of selected items
"Offer bib menu and return list of selected items."
(let ((bibtype (reftex-bib-or-thebib))
found-list rtn key data selected-entries)
(while
@ -917,7 +913,7 @@ While entering the regexp, completion on knows citation keys is possible.
selected-entries))
(defun reftex-restrict-bib-matches (found-list)
;; Limit FOUND-LIST with more regular expressions
"Limit FOUND-LIST with more regular expressions."
(let ((re-list (split-string (read-string
"RegExp [ && RegExp...]: "
nil 'reftex-cite-regexp-hist)
@ -940,7 +936,7 @@ While entering the regexp, completion on knows citation keys is possible.
found-list)))
(defun reftex-extract-bib-file (all &optional marked complement)
;; Limit FOUND-LIST with more regular expressions
"Limit FOUND-LIST with more regular expressions."
(let ((file (read-file-name "File to create: ")))
(find-file-other-window file)
(if (> (buffer-size) 0)
@ -963,7 +959,7 @@ While entering the regexp, completion on knows citation keys is possible.
(goto-char (point-min))))
(defun reftex-insert-bib-matches (list)
;; Insert the bib matches and number them correctly
"Insert the bib matches and number them correctly."
(let ((mouse-face
(if (memq reftex-highlight-selection '(mouse both))
reftex-mouse-selected-face
@ -996,8 +992,7 @@ While entering the regexp, completion on knows citation keys is possible.
last)))))
(defun reftex-format-citation (entry format)
;; Format a citation from the info in the BibTeX ENTRY
"Format a citation from the info in the BibTeX ENTRY according to FORMAT."
(unless (stringp format) (setq format "\\cite{%l}"))
(if (and reftex-comment-citations
@ -1064,7 +1059,7 @@ While entering the regexp, completion on knows citation keys is possible.
format)
(defun reftex-make-cite-echo-string (entry docstruct-symbol)
;; Format a bibtex entry for the echo area and cache the result.
"Format a bibtex ENTRY for the echo area and cache the result."
(let* ((key (reftex-get-bib-field "&key" entry))
(string
(let* ((reftex-cite-punctuation '(" " " & " " etal.")))
@ -1088,9 +1083,9 @@ While entering the regexp, completion on knows citation keys is possible.
string))
(defun reftex-bibtex-selection-callback (data ignore no-revisit)
;; Callback function to be called from the BibTeX selection, in
;; order to display context. This function is relatively slow and not
;; recommended for follow mode. It works OK for individual lookups.
"Callback function to be called from the BibTeX selection, in
order to display context. This function is relatively slow and not
recommended for follow mode. It works OK for individual lookups."
(let ((win (selected-window))
(key (reftex-get-bib-field "&key" data))
bibfile-list item bibtype)
@ -1157,7 +1152,7 @@ While entering the regexp, completion on knows citation keys is possible.
alist))))
(defun reftex-create-bibtex-file (bibfile)
"Create a new BibTeX database file with all entries referenced in document.
"Create a new BibTeX database BIBFILE with all entries referenced in document.
The command prompts for a filename and writes the collected
entries to that file. Only entries referenced in the current
document with any \\cite-like macros are used. The sequence in
@ -1247,5 +1242,5 @@ created files in the variables `reftex-create-bibtex-header' or
(message "%d entries extracted and copied to new database"
(length entries))))
(provide 'reftex-cite)
;;; reftex-cite.el ends here

View file

@ -49,7 +49,8 @@
(reftex-access-scan-info '(16)))
(defun reftex-do-parse (rescan &optional file)
"Do a document rescan. When allowed, do only a partial scan from FILE."
"Do a document rescan.
When allowed, do only a partial scan from FILE."
;; Normalize the rescan argument
(setq rescan (cond ((eq rescan t) t)
@ -191,7 +192,7 @@ of master file."
(defvar index-tags)
(defun reftex-parse-from-file (file docstruct master-dir)
;; Scan the buffer for labels and save them in a list.
"Scan the buffer for labels and save them in a list."
(let ((regexp (reftex-everything-regexp))
(bound 0)
file-found tmp include-file
@ -350,8 +351,7 @@ of master file."
docstruct))
(defun reftex-locate-bibliography-files (master-dir &optional files)
;; Scan buffer for bibliography macro and return file list.
"Scan buffer for bibliography macro and return file list."
(unless files
(save-excursion
(goto-char (point-min))
@ -379,10 +379,10 @@ of master file."
(delq nil files)))
(defun reftex-replace-label-list-segment (old insert &optional entirely)
;; Replace the segment in OLD which corresponds to INSERT.
;; Works with side effects, directly changes old.
;; If entirely is t, just return INSERT.
;; This function also makes sure the old toc markers do not point anywhere.
"Replace the segment in OLD which corresponds to INSERT.
Works with side effects, directly changes old.
If ENTIRELY is t, just return INSERT.
This function also makes sure the old toc markers do not point anywhere."
(cond
(entirely
@ -404,8 +404,8 @@ of master file."
new))))
(defun reftex-section-info (file)
;; Return a section entry for the current match.
;; Careful: This function expects the match-data to be still in place!
"Return a section entry for the current match.
Careful: This function expects the match-data to be still in place!"
(let* ((marker (set-marker (make-marker) (1- (match-beginning 3))))
(macro (reftex-match-string 3))
(prefix (save-match-data
@ -440,9 +440,9 @@ of master file."
literal (marker-position marker))))
(defun reftex-ensure-index-support (&optional abort)
;; When index support is turned off, ask to turn it on and
;; set the current prefix argument so that `reftex-access-scan-info'
;; will rescan the entire document.
"When index support is turned off, ask to turn it on and
set the current prefix argument so that `reftex-access-scan-info'
will rescan the entire document."
(cond
(reftex-support-index t)
((y-or-n-p "Turn on index support and rescan entire document? ")
@ -460,8 +460,8 @@ of master file."
(defvar test-dummy)
(defun reftex-index-info (file)
;; Return an index entry for the current match.
;; Careful: This function expects the match-data to be still in place!
"Return an index entry for the current match.
Careful: This function expects the match-data to be still in place!"
(catch 'exit
(let* ((macro (reftex-match-string 10))
(bom (match-beginning 10))
@ -508,7 +508,7 @@ of master file."
(list 'index index-tag context file bom arg key showkey sortkey key-end))))
(defun reftex-short-context (env parse &optional bound derive)
;; Get about one line of useful context for the label definition at point.
"Get about one line of useful context for the label definition at point."
(if (consp parse)
(setq parse (if derive (cdr parse) (car parse))))
@ -568,9 +568,9 @@ of master file."
"INVALID VALUE OF PARSE"))))
(defun reftex-where-am-I ()
;; Return the docstruct entry above point. Actually returns a cons
;; cell in which the cdr is a flag indicating if the information is
;; exact (t) or approximate (nil).
"Return the docstruct entry above point.
Actually returns a cons cell in which the cdr is a flag indicating
if the information is exact (t) or approximate (nil)."
(let ((docstruct (symbol-value reftex-docstruct-symbol))
(cnt 0) rtn rtn-if-no-other
@ -748,10 +748,10 @@ of master file."
)
(defsubst reftex-move-to-previous-arg (&optional bound)
;; Assuming that we are in front of a macro argument,
;; move backward to the closing parenthesis of the previous argument.
;; This function understands the splitting of macros over several lines
;; in TeX.
"Assuming that we are in front of a macro argument,
move backward to the closing parenthesis of the previous argument.
This function understands the splitting of macros over several lines
in TeX."
(cond
;; Just to be quick:
((memq (preceding-char) '(?\] ?\})))
@ -764,28 +764,27 @@ of master file."
(t nil)))
(defun reftex-what-macro-safe (which &optional bound)
;; reftex-what-macro with special syntax table.
"Call `reftex-what-macro' with special syntax table."
(reftex-with-special-syntax
(reftex-what-macro which bound)))
(defun reftex-what-macro (which &optional bound)
;; Find out if point is within the arguments of any TeX-macro.
;; The return value is either ("\\macro" . (point)) or a list of them.
"Find out if point is within the arguments of any TeX-macro.
The return value is either (\"\\macro\" . (point)) or a list of them.
;; If WHICH is nil, immediately return nil.
;; If WHICH is 1, return innermost enclosing macro.
;; If WHICH is t, return list of all macros enclosing point.
;; If WHICH is a list of macros, look only for those macros and return the
;; name of the first macro in this list found to enclose point.
;; If the optional BOUND is an integer, bound backwards directed
;; searches to this point. If it is nil, limit to nearest \section -
;; like statement.
;; This function is pretty stable, but can be fooled if the text contains
;; things like \macro{aa}{bb} where \macro is defined to take only one
;; argument. As RefTeX cannot know this, the string "bb" would still be
;; considered an argument of macro \macro.
If WHICH is nil, immediately return nil.
If WHICH is 1, return innermost enclosing macro.
If WHICH is t, return list of all macros enclosing point.
If WHICH is a list of macros, look only for those macros and return the
name of the first macro in this list found to enclose point.
If the optional BOUND is an integer, bound backwards directed
searches to this point. If it is nil, limit to nearest \\section -
like statement.
This function is pretty stable, but can be fooled if the text contains
things like \\macro{aa}{bb} where \\macro is defined to take only one
argument. As RefTeX cannot know this, the string \"bb\" would still be
considered an argument of macro \\macro."
(unless reftex-section-regexp (reftex-compile-variables))
(catch 'exit
(if (null which) (throw 'exit nil))
@ -832,20 +831,19 @@ of master file."
(nreverse cmd-list)))))
(defun reftex-what-environment (which &optional bound)
;; Find out if point is inside a LaTeX environment.
;; The return value is (e.g.) either ("equation" . (point)) or a list of
;; them.
"Find out if point is inside a LaTeX environment.
The return value is (e.g.) either (\"equation\" . (point)) or a list of
them.
;; If WHICH is nil, immediately return nil.
;; If WHICH is 1, return innermost enclosing environment.
;; If WHICH is t, return list of all environments enclosing point.
;; If WHICH is a list of environments, look only for those environments and
;; return the name of the first environment in this list found to enclose
;; point.
;; If the optional BOUND is an integer, bound backwards directed searches to
;; this point. If it is nil, limit to nearest \section - like statement.
If WHICH is nil, immediately return nil.
If WHICH is 1, return innermost enclosing environment.
If WHICH is t, return list of all environments enclosing point.
If WHICH is a list of environments, look only for those environments and
return the name of the first environment in this list found to enclose
point.
If the optional BOUND is an integer, bound backwards directed searches to
this point. If it is nil, limit to nearest \\section - like statement."
(unless reftex-section-regexp (reftex-compile-variables))
(catch 'exit
(save-excursion
@ -870,18 +868,17 @@ of master file."
(nreverse env-list)))))
(defun reftex-what-special-env (which &optional bound)
;; Run the special environment parsers and return the matches.
;;
;; The return value is (e.g.) either ("my-parser-function" . (point))
;; or a list of them.
"Run the special environment parsers and return the matches.
;; If WHICH is nil, immediately return nil.
;; If WHICH is 1, return innermost enclosing environment.
;; If WHICH is t, return list of all environments enclosing point.
;; If WHICH is a list of environments, look only for those environments and
;; return the name of the first environment in this list found to enclose
;; point.
The return value is (e.g.) either (\"my-parser-function\" . (point))
or a list of them.
If WHICH is nil, immediately return nil.
If WHICH is 1, return innermost enclosing environment.
If WHICH is t, return list of all environments enclosing point.
If WHICH is a list of environments, look only for those environments and
return the name of the first environment in this list found to enclose
point."
(unless reftex-section-regexp (reftex-compile-variables))
(catch 'exit
(save-excursion
@ -911,10 +908,10 @@ of master file."
(car specials))))))
(defsubst reftex-move-to-next-arg (&optional ignore)
;; Assuming that we are at the end of a macro name or a macro argument,
;; move forward to the opening parenthesis of the next argument.
;; This function understands the splitting of macros over several lines
;; in TeX.
"Assuming that we are at the end of a macro name or a macro argument,
move forward to the opening parenthesis of the next argument.
This function understands the splitting of macros over several lines
in TeX."
(cond
;; Just to be quick:
((memq (following-char) '(?\[ ?\{)))
@ -930,8 +927,8 @@ of master file."
(reftex-nth-arg (nth 5 entry) (nth 6 entry))))
(defun reftex-nth-arg (n &optional opt-args)
;; Return the nth following {} or [] parentheses content.
;; OPT-ARGS is a list of argument numbers which are optional.
"Return the Nth following {} or [] parentheses content.
OPT-ARGS is a list of argument numbers which are optional."
;; If we are sitting at a macro start, skip to end of macro name.
(and (eq (following-char) ?\\) (skip-chars-forward "a-zA-Z*\\\\"))
@ -974,8 +971,8 @@ of master file."
(error nil)))
(defun reftex-context-substring (&optional to-end)
;; Return up to 150 chars from point
;; When point is just after a { or [, limit string to matching parenthesis
"Return up to 150 chars from point.
When point is just after a { or [, limit string to matching parenthesis"
(cond
(to-end
;; Environment - find next \end
@ -1007,8 +1004,7 @@ of master file."
(defvar reftex-section-numbers (make-vector reftex-max-section-depth 0))
(defun reftex-init-section-numbers (&optional toc-entry appendix)
;; Initialize the section numbers with zeros or with what is found
;; in the toc entry.
"Initialize the section numbers with zeros or with what is found in the TOC-ENTRY."
(let* ((level (or (nth 5 toc-entry) -1))
(numbers (nreverse (split-string (or (nth 6 toc-entry) "") "\\.")))
(depth (1- (length reftex-section-numbers)))
@ -1026,8 +1022,8 @@ of master file."
(put 'reftex-section-numbers 'appendix appendix))
(defun reftex-section-number (&optional level star)
;; Return a string with the current section number.
;; When LEVEL is non-nil, increase section numbers on that level.
"Return a string with the current section number.
When LEVEL is non-nil, increase section numbers on that level."
(let* ((depth (1- (length reftex-section-numbers))) idx n (string "")
(appendix (get 'reftex-section-numbers 'appendix))
(partspecial (and (not reftex-part-resets-chapter)
@ -1073,7 +1069,7 @@ of master file."
string))))
(defun reftex-roman-number (n)
;; Return as a string the roman number equal to N.
"Return as a string the roman number equal to N."
(let ((nrest n)
(string "")
(list '((1000 . "M") ( 900 . "CM") ( 500 . "D") ( 400 . "CD")

View file

@ -1,9 +1,9 @@
;;; log-view.el --- Major mode for browsing RCS/CVS/SCCS log output -*- lexical-binding: t -*-
;;; log-view.el --- Major mode for browsing revision log histories -*- lexical-binding: t -*-
;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: rcs, sccs, cvs, log, vc, tools
;; Keywords: tools, vc
;; This file is part of GNU Emacs.
@ -24,10 +24,12 @@
;; Major mode to browse revision log histories.
;; Currently supports the format output by:
;; RCS, SCCS, CVS, Subversion, and DaRCS.
;; SCCS, RCS, CVS, Subversion, DaRCS, and Mercurial.
;; Examples of log output:
;;;; SCCS:
;;;; RCS/CVS:
;; ----------------------------
@ -43,8 +45,6 @@
;; Change release version from 21.4 to 22.1 throughout.
;; Change development version from 21.3.50 to 22.0.50.
;;;; SCCS:
;;;; Subversion:
;; ------------------------------------------------------------------------
@ -117,18 +117,25 @@
(defvar cvs-force-command)
(defgroup log-view nil
"Major mode for browsing log output of RCS/CVS/SCCS."
"Major mode for browsing log output of revision log histories."
:group 'pcl-cvs
:prefix "log-view-")
(easy-mmode-defmap log-view-mode-map
'(
;; FIXME: (copy-keymap special-mode-map) instead
("z" . kill-this-buffer)
("q" . quit-window)
("g" . revert-buffer)
("\C-m" . log-view-toggle-entry-display)
("-" . negative-argument)
("0" . digit-argument)
("1" . digit-argument)
("2" . digit-argument)
("3" . digit-argument)
("4" . digit-argument)
("5" . digit-argument)
("6" . digit-argument)
("7" . digit-argument)
("8" . digit-argument)
("9" . digit-argument)
("\C-m" . log-view-toggle-entry-display)
("m" . log-view-toggle-mark-entry)
("e" . log-view-modify-change-comment)
("d" . log-view-diff)
@ -145,6 +152,7 @@
("\M-n" . log-view-file-next)
("\M-p" . log-view-file-prev))
"Log-View's keymap."
:inherit special-mode-map
:group 'log-view)
(easy-menu-define log-view-mode-menu log-view-mode-map
@ -275,6 +283,7 @@ The match group number 1 should match the revision number itself.")
(easy-mmode-define-navigation log-view-file log-view-file-re "file")
(defun log-view-goto-rev (rev)
"Go to revision REV."
(goto-char (point-min))
(ignore-errors
(while (not (equal rev (log-view-current-tag)))
@ -288,6 +297,7 @@ The match group number 1 should match the revision number itself.")
(defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$")
(defun log-view-current-file ()
"Return the current file."
(save-excursion
(forward-line 1)
(or (re-search-backward log-view-file-re nil t)
@ -340,7 +350,7 @@ if POS is omitted or nil, it defaults to point."
(defun log-view-toggle-mark-entry ()
"Toggle the marked state for the log entry at point.
Individual log entries can be marked and unmarked. The marked
Individual log entries can be marked and unmarked. The marked
entries are denoted by changing their background color.
`log-view-get-marked' returns the list of tags for the marked
log entries."
@ -479,7 +489,8 @@ It assumes that a log entry starts with a line matching
(funcall f))))
(defun log-view-find-revision (pos)
"Visit the version at point."
"Visit the version at POS.
If called interactively, visit the version at point."
(interactive "d")
(unless log-view-per-file-logs
(when (> (length log-view-vc-fileset) 1)
@ -521,7 +532,8 @@ It assumes that a log entry starts with a line matching
(log-view-extract-comment)))
(defun log-view-annotate-version (pos)
"Annotate the version at point."
"Annotate the version at POS.
If called interactively, annotate the version at point."
(interactive "d")
(unless log-view-per-file-logs
(when (> (length log-view-vc-fileset) 1)

View file

@ -115,7 +115,7 @@ This is only meaningful if you don't use the implicit checkout model
This avoids slow queries over the network and instead uses heuristics
and past information to determine the current status of a file.
If value is the symbol `only-file' `vc-dir' will connect to the
If value is the symbol `only-file', `vc-dir' will connect to the
server, but heuristics will be used to determine the status for
all other VC operations.

View file

@ -128,7 +128,7 @@ See also variable `vc-consult-headers'."
This avoids slow queries over the network and instead uses heuristics
and past information to determine the current status of a file.
If value is the symbol `only-file' `vc-dir' will connect to the
If value is the symbol `only-file', `vc-dir' will connect to the
server, but heuristics will be used to determine the status for
all other VC operations.

View file

@ -115,10 +115,10 @@
;; Return non-nil if FILE is registered in this backend. Both this
;; function as well as `state' should be careful to fail gracefully
;; in the event that the backend executable is absent. It is
;; preferable that this function's body is autoloaded, that way only
;; preferable that this function's *body* is autoloaded, that way only
;; calling vc-registered does not cause the backend to be loaded
;; (all the vc-FOO-registered functions are called to try to find
;; the controlling backend for FILE.
;; the controlling backend for FILE).
;;
;; * state (file)
;;
@ -233,6 +233,7 @@
;; The implementation should pass the value of vc-register-switches
;; to the backend command. (Note: in older versions of VC, this
;; command took a single file argument and not a list.)
;; The REV argument is a historical leftover and is never used.
;;
;; - init-revision (file)
;;
@ -999,7 +1000,7 @@ current buffer."
nil)
(list (vc-backend-for-registration (buffer-file-name))
(list buffer-file-name))))
(t (error "No fileset is available here")))))
(t (error "File is not under version control")))))
(defun vc-dired-deduce-fileset ()
(let ((backend (vc-responsible-backend default-directory)))
@ -1041,6 +1042,11 @@ current buffer."
(eq p q)
(and (member p '(edited added removed)) (member q '(edited added removed)))))
(defun vc-read-backend (prompt)
(intern
(completing-read prompt (mapcar 'symbol-name vc-handled-backends)
nil 'require-match)))
;; Here's the major entry point.
;;;###autoload
@ -1099,8 +1105,9 @@ For old-style locking-based version control systems, like RCS:
((or (eq state 'up-to-date) (and verbose (eq state 'needs-update)))
(cond
(verbose
;; go to a different revision
;; Go to a different revision.
(let* ((revision
;; FIXME: Provide completion.
(read-string "Branch, revision, or backend to move to: "))
(revision-downcase (downcase revision)))
(if (member
@ -1161,15 +1168,10 @@ For old-style locking-based version control systems, like RCS:
(message "No files remain to be committed")
(if (not verbose)
(vc-checkin ready-for-commit backend)
(let* ((revision (read-string "New revision or backend: "))
(revision-downcase (downcase revision)))
(if (member
revision-downcase
(mapcar (lambda (arg) (downcase (symbol-name arg)))
vc-handled-backends))
(let ((vsym (intern revision-downcase)))
(dolist (file files) (vc-transfer-file file vsym)))
(vc-checkin ready-for-commit backend revision)))))))
(let ((new-backend (vc-read-backend "New backend: ")))
(if new-backend
(dolist (file files)
(vc-transfer-file file new-backend))))))))
;; locked by somebody else (locking VCSes only)
((stringp state)
;; In the old days, we computed the revision once and used it on

View file

@ -1,3 +1,18 @@
2013-06-07 Eli Zaretskii <eliz@gnu.org>
* INSTALL.MSYS: mingw-get is not a GUI program (yet).
msys-automake is not suitable for MinGW builds. Mention the
--enable-locallisppath switch to msysconfig.sh. Suggested by
Óscar Fuentes <ofv@wanadoo.es>.
2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
* epaths.nt (PATH_SITELOADSEARCH): Fix commentary.
2013-06-03 Eli Zaretskii <eliz@gnu.org>
* config.nt: Add HAVE_GFILENOTIFY, HAVE_W32NOTIFY and USE_FILE_NOTIFY.
2013-06-03 Eli Zaretskii <eliz@gnu.org>
* inc/sys/time.h (struct timeval): Remove the _W64 guards.
@ -93,7 +108,7 @@
2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
* config.nt (HAVE_ACL_SET_FILE): Rename from HAVE_POSIX_ACL.
* inc/ms-w32.h (EOPNOTSUPP): New macro.
@ -621,7 +636,7 @@
2012-09-01 Daniel Colascione <dancol@dancol.org>
* inc/ms-w32.h (TERM_HEADER): Add for refactoring
* inc/ms-w32.h (TERM_HEADER): Add for refactoring.
2012-08-22 Juanma Barranquero <lekktu@gmail.com>
@ -919,8 +934,8 @@
(install-other-dirs-nmake, install-other-dirs-gmake): Depend on `all'.
(install-shortcuts): Depend on $(INSTALL_DIR)/bin. Copy addpm.exe
here.
(maybe-copy-distfiles-CMD, maybe-copy-distfiles-SH, dist): Depend
on create-tmp-dist-dir.
(maybe-copy-distfiles-CMD, maybe-copy-distfiles-SH, dist):
Depend on create-tmp-dist-dir.
* nmake.defs (DIRNAME): New variable.
(IFNOTSAMEDIR): Use $(DIRNAME)_same-dir.tst instead of

View file

@ -92,9 +92,9 @@ Windows 9X as well).
** Installing MinGW and MSYS using mingw-get
A nice GUI installer, called mingw-get, is available for those who
don't like to mess with manual installations. You can download it
from here:
A nice installer, called mingw-get, is available for those who don't
like to mess with manual installations. You can download it from
here:
https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
@ -110,7 +110,6 @@ Windows 9X as well).
. msys-base
. mingw-developer-toolkit
. msys-automake
(We recommend that you refrain from installing the MSYS Texinfo
package, which is part of msys-base, because it might produce mixed
@ -188,11 +187,11 @@ Windows 9X as well).
Each package might list other packages as prerequisites on its
download page (under "Runtime requirements"); download those as
well. (Using the GUI installer mingw-get will fetch those
prerequisites automatically for you.) A missing prerequisite will
manifest itself by the program failing to run and presenting a
pop-up dialog that states the missing or incompatible DLL; be sure
to find and install these missing DLLs.
well. (Using the mingw-get installer will fetch those prerequisites
automatically for you.) A missing prerequisite will manifest itself
by the program failing to run and presenting a pop-up dialog that
states the missing or incompatible DLL; be sure to find and install
these missing DLLs.
Once you think you have MinGW installed, test the installation by
building a trivial "hello, world!" program, and make sure that it
@ -228,8 +227,8 @@ Windows 9X as well).
repository): Automake and Autoconf. They are available from
here:
http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
MSYS packages are distributed as .tar.lzma compressed archives. To
install the packages manually, we recommend to use the Windows port
@ -256,11 +255,11 @@ Windows 9X as well).
Each package might list other packages as prerequisites on its
download page (under "Runtime requirements"); download those as
well. (Using the GUI installer mingw-get will fetch those
prerequisites automatically for you.) A missing prerequisite will
manifest itself by the program failing to run and presenting a
pop-up dialog that states the missing or incompatible DLL; be sure
to find and install these missing DLLs.
well. (Using the mingw-get installer will fetch those prerequisites
automatically for you.) A missing prerequisite will manifest itself
by the program failing to run and presenting a pop-up dialog that
states the missing or incompatible DLL; be sure to find and install
these missing DLLs.
MSYS packages should be installed in a separate tree from MinGW.
For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
@ -344,9 +343,9 @@ Windows 9X as well).
Do NOT use Windows-style x:/foo/bar file names on the configure
script command line; use the MSYS-style /x/foo/bar instead. Using
Windows-style file names was reported to cause subtle and hard to
figure out problems during the build. This applies both to
--prefix= switch and the absolute file name of msysconfig.sh, if you
are building outside of the source tree.
figure out problems during the build. This applies both to the
command switches, such as --prefix=, and to the absolute file name
of msysconfig.sh, if you are building outside of the source tree.
You can pass additional options to the configure script, for the
full list type
@ -370,6 +369,15 @@ Windows 9X as well).
to specify... Perhaps you may wish to revisit your installation
decisions now.
If you have a global site-lisp directory from previous Emacs
installation, and you want Emacs to continue using it, specify it
via the --enable-locallisppath switch to msysconfig.sh, like this:
./nt/msysconfig.sh --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp"
Use the normal MSYS /d/foo/bar style to specify directories by their
absolute file names.
A few frequently used options are needed when you want to produce an
unoptimized binary with runtime checks enabled:

View file

@ -547,6 +547,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if using GFile. */
#undef HAVE_GFILENOTIFY
/* Define to 1 if you have the `get_current_dir_name' function. */
#undef HAVE_GET_CURRENT_DIR_NAME
@ -1141,6 +1144,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 to use w32notify. */
#define HAVE_W32NOTIFY 1
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
@ -1497,6 +1503,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to nonzero if you want access control list support. */
#undef USE_ACL
/* Define to 1 if using file notifications. */
#define USE_FILE_NOTIFY 1
/* Define to 1 if using GTK. */
#undef USE_GTK

View file

@ -41,10 +41,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim"
/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
These are the site-lisp directories, typically something like
These are the site-lisp directories. Configure sets this to
${locallisppath}, which typically defaults to something like:
<datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp
Configure prepends any $locallisppath, as set by the
--enable-locallisppath argument.
but can be overridden by the --enable-locallisppath argument.
This is combined with PATH_LOADSEARCH to make the default load-path.
If the --no-site-lisp option is used, this piece is excluded.
*/

View file

@ -1,3 +1,209 @@
2013-06-13 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
* fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479)
2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
* fileio.c (expand_file_name): Doc fix.
2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
* process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
Wait for self, not for 0. This can't hurt on GNU or similar
system, and may help with Cygwin.
* keyboard.c: Don't use PROP (...) as an lvalue.
(parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
Use set_prop (A, B), not PROP (A) = B.
2013-06-10 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (get_it_property): Use it->window instead of generating
a Lisp object from it->w.
2013-06-09 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (get_it_property): If it->object is a buffer, pass to
get-char-property the window that is being rendered, instead of
the buffer, to support window-specific overlays. (Bug#14575)
(compute_display_string_pos): When W is NULL, use the current
buffer as the object to pass to get-char-property.
(Fcurrent_bidi_paragraph_direction): Assign NULL to the window
pointer member of the bidi iterator, since no window is pertinent
to this function.
2013-06-08 Eli Zaretskii <eliz@gnu.org>
* bidi.c (bidi_fetch_char): Accept additional argument, the window
being displayed, and pass it to compute_display_string_pos.
(bidi_level_of_next_char, bidi_resolve_explicit_1)
(bidi_paragraph_init): All callers changed.
* xdisp.c (init_from_display_pos, init_iterator)
(handle_single_display_spec, next_overlay_string)
(get_overlay_strings_1, reseat_1, reseat_to_string)
(push_prefix_prop, Fcurrent_bidi_paragraph_direction):
Set bidi_it.w member from it->w.
(compute_display_string_pos): Accept additional argument, the
window being displayed, and pass it to Fget_char_property.
(Bug#14575)
* dispextern.h (struct bidi_it): New member w, the window being
displayed.
(compute_display_string_pos): Adjust prototype.
2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
* xgselect.c: Remove unneeded include xterm.h.
* process.c (wait_reading_process_output): Check for NS before GLIB.
GLIB may be linked in due to rsvg, but ns_select must be called.
* xgselect.c (xg_select): Remove call to window_system_available
and g_main_context_pending at the top, so Gdk events (i.e. file
notify) are processed when Emacs is started with -nw.
2013-06-07 Eli Zaretskii <eliz@gnu.org>
* Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
(ctagsfiles3): New variable, includes only *.m files.
(TAGS): Use an explicit language name in the regular expressions,
to avoid transformation of '/SOMETHING' by MSYS to
'c:\MSYS\SOMETHING'.
2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
* epaths.in: Fix commentary to PATH_SITELOADSEARCH.
2013-06-06 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (note_mouse_highlight): When mouse-highlight is off,
still need to set the mouse pointer shape and activate help-echo.
(Bug#14558)
2013-06-06 Paul Eggert <eggert@cs.ucla.edu>
A few porting etc. fixes for the new file monitor code.
See the thread containing
<http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
* gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
(Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
(dir_monitor_callback, Fgfile_rm_watch):
Use assq_no_quit instead of Fassoc, for speed.
(dir_monitor_callback, Fgfile_rm_watch):
eassert that the monitor is a fixnum.
(dir_monitor_callback): No need for CDR_SAFE.
Simplify building of lisp with alternative tails.
(Fgfile_add_watch, Fgfile_rm_watch):
Do not assume glib functions set errno reliably on failure.
(Fgfile_add_watch): Check that the monitor survives the XIL trick,
and signal an error otherwise.
(Fgfile_rm_watch): Prefer CONSP to !NILP.
Use Fdelq instead of Fdelete, for speed.
2013-06-05 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
don't insist on being invoked on a highlighted tool-bar button.
Avoids losing tool-bar functionality when mouse-highlight is nil.
(note_tool_bar_highlight, note_mode_line_or_margin_highlight):
Don't highlight when mouse-highlight is nil.
(note_mouse_highlight): When mouse-highlight is nil, don't return
right away; instead, run tool-bar and mode-line highlight
subroutine, clear any existing highlight, and revert the mouse
pointer to its default shape. (Bug#14558)
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
* lisp.mk (lisp): Add prog-mode.el.
2013-06-05 Paul Eggert <eggert@cs.ucla.edu>
Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
* process.c (dummy_handler): New function.
(lib_child_handler): New static var.
(handle_child_signal): Invoke it.
(catch_child_signal): If a library has set up a signal handler,
save it into lib_child_handler.
(init_process_emacs): If using glib and not on Windows, tickle glib's
child-handling code so that it initializes its private SIGCHLD handler.
* syssignal.h (SA_SIGINFO): Default to 0.
* xterm.c (x_term_init): Remove D-bus hack that I installed on May
31; it should no longer be needed now.
2013-06-05 Michael Albinus <michael.albinus@gmx.de>
* emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
* gfilenotify.c (globals_of_gfilenotify): New function.
(syms_of_gfilenotify): Move global initialization there.
* lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
* keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
* keyboard.c (menu_bar_items, tool_bar_items):
* doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
not override local keymaps any more.
2013-06-04 Eli Zaretskii <eliz@gnu.org>
* window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
2013-06-03 Eli Zaretskii <eliz@gnu.org>
* w32console.c (initialize_w32_display): Return the dimensions of
the console window via 2 additional arguments, not via the current
frame. This avoids crashes due to overrunning the bounds of
frame's decode_mode_spec_buffer, which is not resized following
the change of the frame dimensions from the initial 10x10.
* w32term.h (w32_initialize_display_info): Adjust prototype.
* term.c (init_tty): Take dimensions of the frame from the values
returned by initialize_w32_display.
* Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
(ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
(LIBES): Add $(GFILENOTIFY_LIBS).
* w32inevt.c (handle_file_notifications): Add dummy implementation
for !HAVE_W32NOTIFY.
* w32term.c: Wrap code with HAVE_W32NOTIFY.
2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
* xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
* process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
* Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
Fix minor problems found by static checking.
* data.c (pure_write_error):
Use xsignal2, not Fsignal, as Fsignal might return.
* eval.c (set_backtrace_debug_on_exit): Now static.
(backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
No longer inline. EXTERN_INLINE is needed only for functions
defined in .h files. Reindent function header as per GNU style.
(backtrace_p, backtrace_top, backtrace_next):
Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
compiler or linker. Add extern decls to pacify gcc -Wall.
* frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
Now static.
* frame.c (free_monitors): Define only on platforms that need it.
* nsterm.m (ns_term_init):
* process.c (catch_child_signal):
Don't worry about whether SIGCHLD is defined, as SIGCHLD is
defined on all porting targets these days.
* process.c, process.h (catch_child_signal):
Make it extern only if NS_IMPL_GNUSTEP is defined.
2013-06-03 Eli Zaretskii <eliz@gnu.org>
* w32.c (gettimeofday): Make the signature identical to prototype
@ -151,8 +357,8 @@
(update_frame_tool_bar): Update code for GNUStep.
(clearAll): New method.
(addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
identifierToItem setObject and activeIdentifiers addObject before
argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
Move identifierToItem setObject and activeIdentifiers addObject before
call to insertItemWithItemIdentifier.
(validateVisibleItems): Fix indentation.
(toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
@ -166,19 +372,19 @@
Use F suffix on floats.
(ns_char_width): Returns CGFloat.
(ns_ascii_average_width): w is CGFloat instead of float.
(nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
(nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
DPSxshow.
(ns_glyph_metrics): CGFloat instead of float.
* nsfns.m (x_set_foreground_color, x_set_background_color): Use
EmacsCGFloat.
(ns_implicitly_set_icon_type, Fx_create_frame): Make static, remove
unused variables.
(Fns_read_file_name): Keep track if panel is for save. Use
ns_filename_from_panel/ns_directory_from_panel.
* nsfns.m (x_set_foreground_color, x_set_background_color):
Use EmacsCGFloat.
(ns_implicitly_set_icon_type, Fx_create_frame): Make static,
remove unused variables.
(Fns_read_file_name): Keep track if panel is for save.
Use ns_filename_from_panel/ns_directory_from_panel.
(Fns_list_services): delegate only used for COCOA.
(Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep. Just
return the input if GNUStep.
(Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
Just return the input if GNUStep.
(x_screen_planes): Remove.
(Fxw_color_values): Use EmacsCGFloat
(Fns_display_monitor_attributes_list): Only get screen number for
@ -294,7 +500,7 @@
2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
* xdisp.c (reseat_at_previous_visible_line_start):
Already declared in dispextern.h, so remove it here.
Already declared in dispextern.h, so remove it here.
(move_it_vertically_backward): Likewise.
2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@ -305,7 +511,7 @@
Mention `display-monitor-attributes-list' in docstrings.
* nsfns.m (ns_get_screen): Remove function. All uses removed.
(check_ns_display_info): Sync with check_x_display_info in xfns.c.
(check_ns_display_info): Sync with check_x_display_info in xfns.c.
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
(Fx_display_backing_store, Fx_display_visual_class)
@ -461,7 +667,7 @@
2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
* Makefile.in (LIB_ACL): New macro.
(LIBACL_LIBS): Remove.
(LIBES): Use LIB_ACL, not LIBACL_LIBS.
@ -2894,11 +3100,10 @@
2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
* xterm.c (scroll-bar-adjust-thumb-portion): New variable to
determine whether scroll bar thumb size should be adjusted or
not. Use variable for MOTIF.
determine whether scroll bar thumb size should be adjusted or not.
Use variable for MOTIF.
* gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
GTK.
* gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
@ -3443,7 +3648,7 @@
2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
Fix permissions bugs with setgid directories etc. (Bug#13125)
Fix permissions bugs with setgid directories etc. (Bug#13125)
* dired.c (Ffile_attributes): Return t as the 9th attribute,
to mark it as a placeholder. The old value was often wrong.
The only user of this attribute has been changed to use
@ -4544,7 +4749,7 @@
* w32term.c (x_window_to_scroll_bar): Likewise.
* window.c (window_list): Likewise.
* xdisp.c (x_consider_frame_title): Likewise.
* xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
* xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
* xfns.c (x_window_to_frame, x_any_window_to_frame)
(x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
* xmenu.c (menubar_id_to_frame): Likewise.
@ -17776,7 +17981,7 @@
Fix memory allocation problems in Cygwin build (Bug#9273).
* unexcw.c ( __malloc_initialized): Declare external variable.
* unexcw.c (__malloc_initialized): Declare external variable.
(fixup_executable): Force the dumped emacs to reinitialize malloc.
* gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):

View file

@ -15447,7 +15447,7 @@
* xterm.c (XTread_socket_hook): For X11, on map and unmap events
check the window manager hints for iconification status.
* xterm.c (x_make_widow_icon): For X11, just request
* xterm.c (x_make_window_icon): For X11, just request
iconification of the window manager.
1989-05-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu)

View file

@ -160,6 +160,8 @@ GTK_OBJ=@GTK_OBJ@
## inotify.o if HAVE_INOTIFY.
## w32notify.o if HAVE_W32NOTIFY.
NOTIFY_OBJ = @NOTIFY_OBJ@
GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
## -ltermcap, or -lncurses, or -lcurses, or "".
LIBS_TERMCAP=@LIBS_TERMCAP@
@ -205,10 +207,13 @@ LIBXMENU=@LIBXMENU@
## xmenu.o if HAVE_X_WINDOWS, else empty.
XMENU_OBJ=@XMENU_OBJ@
## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o if
## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o if
## HAVE_X_WINDOWS, else empty.
XOBJ=@XOBJ@
# xgselect.o if linking with GLib, else empty
XGSELOBJ=@XGSELOBJ@
TOOLKIT_LIBW=@TOOLKIT_LIBW@
## Only used if HAVE_X11, in LIBX_OTHER.
@ -342,7 +347,7 @@ ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
$(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \
$(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
$(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
$(LIBGNUTLS_CFLAGS) \
$(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
@ -372,7 +377,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
profiler.o \
thread.o systhread.o \
$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
$(W32_OBJ) $(WINDOW_SYSTEM_OBJ)
$(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
obj = $(base_obj) $(NS_OBJC_OBJ)
## Object files used on some machine or other.
@ -425,7 +430,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
$(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
$(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
$(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
$(LIB_MATH)
$(GFILENOTIFY_LIBS) $(LIB_MATH)
all: emacs$(EXEEXT) $(OTHER_FILES)
.PHONY: all
@ -584,13 +589,16 @@ extraclean: distclean
## Arrange to make a tags table TAGS-LISP for ../lisp,
## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
ctagsfiles1 = [xyzXYZ]*.[hcm]
ctagsfiles2 = [a-wA-W]*.[hcm]
ctagsfiles1 = [xyzXYZ]*.[hc]
ctagsfiles2 = [a-wA-W]*.[hc]
ctagsfiles3 = [a-zA-Z]*.m
TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE)
../lib-src/etags --include=TAGS-LISP --include=$(lwlibdir)/TAGS \
--regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
$(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE)
--regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
$(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE) \
--regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
$(srcdir)/$(ctagsfiles3)
frc:
TAGS-LISP: frc
$(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS=../lib-src/etags

Some files were not shown because too many files have changed in this diff Show more