Merge from trunk.
This commit is contained in:
commit
cc24ef09f8
69 changed files with 1371 additions and 934 deletions
35
ChangeLog
35
ChangeLog
|
@ -1,3 +1,38 @@
|
|||
2013-12-08 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* configure.ac (HAVE_RSVG) [mingw32]: Don't link against librsvg
|
||||
statically.
|
||||
|
||||
2013-12-08 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* configure.ac: Simplify supression of GTK deprecation warning.
|
||||
Move -DGDK_DISABLE_DEPRECATION_WARNINGS out of the command line
|
||||
and into config.h, to shorten the command line when doing 'make'.
|
||||
Don't AC_SUBST GTK_CFLAGS, as this is not needed.
|
||||
|
||||
Use libcrypto's checksum implementations if available, for speed.
|
||||
On commonly used platform libcrypto uses architecture-specific
|
||||
assembly code, which is significantly faster than the C code we
|
||||
were using. See Pádraig Brady's note in
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2013-12/msg00000.html>.
|
||||
Merge from gnulib, incorporating:
|
||||
2013-12-07 md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
|
||||
2013-12-07 md5, sha1, sha256, sha512: add 'auto', and set-default method
|
||||
2013-12-04 include_next: minimize code duplication
|
||||
2013-12-03 md5, sha1, sha256, sha512: support mandating use of openssl
|
||||
2013-12-02 md5, sha1, sha256, sha512: use openssl routines if available
|
||||
* configure.ac (--without-all): Set with_openssl_default too.
|
||||
Use gl_SET_CRYPTO_CHECK_DEFAULT to default to 'auto'.
|
||||
(HAVE_LIB_CRYPTO): New var.
|
||||
Say whether Emacs is configured to use a crypto library.
|
||||
* lib/gl_openssl.h, m4/absolute-header.m4, m4/gl-openssl.m4:
|
||||
New files, copied from gnulib.
|
||||
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
|
||||
* lib/md5.c, lib/md5.h, lib/sha1.c, lib/sha1.h:
|
||||
* lib/sha256.c, lib/sha256.h, lib/sha512.c, lib/sha512.h:
|
||||
* m4/include_next.m4, m4/md5.m4, m4/sha1.m4, m4/sha256.m4, m4/sha512.m4:
|
||||
Update from gnulib.
|
||||
|
||||
2013-12-01 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* .dir-locals.el (log-edit-move): Add the "Author: " header.
|
||||
|
|
24
configure.ac
24
configure.ac
|
@ -94,8 +94,9 @@ AC_ARG_WITH(all,
|
|||
[AS_HELP_STRING([--without-all],
|
||||
[omit almost all features and build
|
||||
small executable with minimal dependencies])],
|
||||
with_features=$withval,
|
||||
with_features=yes)
|
||||
[with_features=$withval
|
||||
with_openssl_default=$withval],
|
||||
[with_features=yes])
|
||||
|
||||
dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
|
||||
dnl Create a new --with option that defaults to being disabled.
|
||||
|
@ -2135,6 +2136,10 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" =
|
|||
if test $HAVE_RSVG = yes; then
|
||||
AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])
|
||||
CFLAGS="$CFLAGS $RSVG_CFLAGS"
|
||||
# Windows loads librsvg dynamically
|
||||
if test "${opsys}" = "mingw32"; then
|
||||
RSVG_LIBS=
|
||||
fi
|
||||
LIBS="$RSVG_LIBS $LIBS"
|
||||
fi
|
||||
fi
|
||||
|
@ -2184,8 +2189,10 @@ if test "${opsys}" != "mingw32"; then
|
|||
gtk_term_header=gtkutil.h
|
||||
USE_GTK_TOOLKIT="GTK3"
|
||||
if test "x$ac_enable_gtk_deprecation_warnings" = x; then
|
||||
GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS"
|
||||
GTK_CFLAGS="$GTK_CFLAGS -DGLIB_DISABLE_DEPRECATION_WARNINGS"
|
||||
AC_DEFINE([GDK_DISABLE_DEPRECATION_WARNINGS], [1],
|
||||
[Define to 1 to disable GTK+/GDK deprecation warnings.])
|
||||
AC_DEFINE([GLIB_DISABLE_DEPRECATION_WARNINGS], [1],
|
||||
[Define to 1 to disable Glib deprecation warnings.])
|
||||
fi
|
||||
else
|
||||
check_gtk2=yes
|
||||
|
@ -2211,7 +2218,6 @@ fi
|
|||
|
||||
if test x"$pkg_check_gtk" = xyes; then
|
||||
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
|
@ -4691,6 +4697,7 @@ CFLAGS=$pre_PKG_CONFIG_CFLAGS
|
|||
LIBS="$LIB_PTHREAD $pre_PKG_CONFIG_LIBS"
|
||||
gl_ASSERT_NO_GNULIB_POSIXCHECK
|
||||
gl_ASSERT_NO_GNULIB_TESTS
|
||||
gl_SET_CRYPTO_CHECK_DEFAULT([auto])
|
||||
gl_INIT
|
||||
CFLAGS=$SAVE_CFLAGS
|
||||
LIBS=$SAVE_LIBS
|
||||
|
@ -4842,6 +4849,12 @@ else
|
|||
acl_summary=no
|
||||
fi
|
||||
|
||||
if test -n "$LIB_CRYPTO"; then
|
||||
HAVE_LIB_CRYPTO=yes
|
||||
else
|
||||
HAVE_LIB_CRYPTO=no
|
||||
fi
|
||||
|
||||
echo "
|
||||
Configured for \`${canonical}'.
|
||||
|
||||
|
@ -4881,6 +4894,7 @@ 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 access control lists? ${acl_summary}"
|
||||
echo " Does Emacs use a crypto library? ${HAVE_LIB_CRYPTO} $LIB_CRYPTO"
|
||||
echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
|
||||
echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}"
|
||||
echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2013-12-08 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* msdog.texi (Windows Keyboard): Fix typo.
|
||||
|
||||
2013-11-30 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* Makefile.in (distclean): Remove Makefile.
|
||||
|
|
|
@ -482,7 +482,7 @@ the variable @code{w32-alt-is-meta} to a @code{nil} value.
|
|||
@kbd{Alt-@key{TAB}}, for its own use. These key combinations are
|
||||
intercepted by the system before Emacs can see them. You can use the
|
||||
@code{w32-register-hot-key} function to allow a key sequence to be
|
||||
seen by Emacs instead of being grabbed by Windows. This functions
|
||||
seen by Emacs instead of being grabbed by Windows. This function
|
||||
registers a key sequence as a @dfn{hot key}, overriding the special
|
||||
meaning of that key sequence for Windows. (MS-Windows is told that
|
||||
the key sequence is a hot key only when one of the Emacs windows has
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2013-12-08 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* display.texi (Progress, Face Remapping):
|
||||
* processes.texi (Serial Ports):
|
||||
* windows.texi (Recombining Windows): Fix typos. (Bug#16089)
|
||||
|
||||
2013-12-04 Juri Linkov <juri@jurta.org>
|
||||
|
||||
* searching.texi (Search and Replace): Fix `unread-command-events'
|
||||
|
|
|
@ -439,7 +439,7 @@ that it prints a message in the echo area unconditionally.
|
|||
|
||||
The first two arguments have the same meaning as for
|
||||
@code{progress-reporter-update}. Optional @var{new-message} allows
|
||||
you to change the message of the @var{reporter}. Since this functions
|
||||
you to change the message of the @var{reporter}. Since this function
|
||||
always updates the echo area, such a change will be immediately
|
||||
presented to the user.
|
||||
@end defun
|
||||
|
@ -2683,7 +2683,7 @@ and @code{face-remap-reset-base} functions; it is intended for major
|
|||
modes to remap faces in the buffers they control.
|
||||
|
||||
@defun face-remap-add-relative face &rest specs
|
||||
This functions adds the face spec in @var{specs} as relative
|
||||
This function adds the face spec in @var{specs} as relative
|
||||
remappings for face @var{face} in the current buffer. The remaining
|
||||
arguments, @var{specs}, should form either a list of face names, or a
|
||||
property list of attribute/value pairs.
|
||||
|
|
|
@ -2613,7 +2613,7 @@ Here is an example:
|
|||
@cindex stopbits, in serial connections
|
||||
@cindex flowcontrol, in serial connections
|
||||
|
||||
This functions configures a serial port connection. Arguments are
|
||||
This function configures a serial port connection. Arguments are
|
||||
specified as keyword/argument pairs. Attributes that are not given
|
||||
are re-initialized from the process's current configuration (available
|
||||
via the function @code{process-contact}), or set to reasonable default
|
||||
|
|
|
@ -1164,7 +1164,7 @@ vertical combination @var{W1}.
|
|||
|
||||
@cindex window combination limit
|
||||
@defun set-window-combination-limit window limit
|
||||
This functions sets the @dfn{combination limit} of the window
|
||||
This function sets the @dfn{combination limit} of the window
|
||||
@var{window} to @var{limit}. This value can be retrieved via the
|
||||
function @code{window-combination-limit}. See below for its effects;
|
||||
note that it is only meaningful for internal windows. The
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2013-12-08 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* dbus.texi (Properties and Annotations): Fix typo.
|
||||
|
||||
2013-12-06 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi: Don't include Emacs version within Org's version.
|
||||
|
|
|
@ -760,7 +760,7 @@ If there are no properties, @code{nil} is returned. Example:
|
|||
@end defun
|
||||
|
||||
@defun dbus-get-all-managed-objects bus service path
|
||||
This functions returns all objects at @var{bus}, @var{service},
|
||||
This function returns all objects at @var{bus}, @var{service},
|
||||
@var{path}, and the children of @var{path}. The result is a list of
|
||||
objects. Every object is a cons of an existing path name, and the
|
||||
list of available interface objects. An interface object is another
|
||||
|
|
11
etc/NEWS
11
etc/NEWS
|
@ -661,6 +661,17 @@ whether it is safe to use Bash's --noediting option. These days
|
|||
|
||||
*** Add more Ruby file types to `auto-mode-alist'.
|
||||
|
||||
** JS Mode
|
||||
|
||||
*** Better indentation of multiple-variable declarations.
|
||||
If declaration spans several lines, variables on the following lines
|
||||
are lined up to the first one.
|
||||
|
||||
*** We now recognize and better indent continuations in array
|
||||
comprehensions.
|
||||
|
||||
*** New option `js-switch-indent-offset`.
|
||||
|
||||
|
||||
* New Modes and Packages in Emacs 24.4
|
||||
|
||||
|
|
116
lib/gl_openssl.h
Normal file
116
lib/gl_openssl.h
Normal file
|
@ -0,0 +1,116 @@
|
|||
/* gl_openssl.h -- wrap openssl crypto hash routines in gnulib interface
|
||||
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Pádraig Brady */
|
||||
|
||||
#ifndef GL_OPENSSL_NAME
|
||||
# error "Please define GL_OPENSSL_NAME to 1,5,256 etc."
|
||||
#endif
|
||||
|
||||
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||
# error "Please include config.h first."
|
||||
#endif
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef GL_OPENSSL_INLINE
|
||||
# define GL_OPENSSL_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
/* Concatenate two preprocessor tokens. */
|
||||
#define _GLCRYPTO_CONCAT_(prefix, suffix) prefix##suffix
|
||||
#define _GLCRYPTO_CONCAT(prefix, suffix) _GLCRYPTO_CONCAT_ (prefix, suffix)
|
||||
|
||||
#if GL_OPENSSL_NAME == 5
|
||||
# define OPENSSL_ALG md5
|
||||
#else
|
||||
# define OPENSSL_ALG _GLCRYPTO_CONCAT (sha, GL_OPENSSL_NAME)
|
||||
#endif
|
||||
|
||||
/* Context type mappings. */
|
||||
#if BASE_OPENSSL_TYPE != GL_OPENSSL_NAME
|
||||
# undef BASE_OPENSSL_TYPE
|
||||
# if GL_OPENSSL_NAME == 224
|
||||
# define BASE_OPENSSL_TYPE 256
|
||||
# elif GL_OPENSSL_NAME == 384
|
||||
# define BASE_OPENSSL_TYPE 512
|
||||
# endif
|
||||
# define md5_CTX MD5_CTX
|
||||
# define sha1_CTX SHA_CTX
|
||||
# define sha224_CTX SHA256_CTX
|
||||
# define sha224_ctx sha256_ctx
|
||||
# define sha256_CTX SHA256_CTX
|
||||
# define sha384_CTX SHA512_CTX
|
||||
# define sha384_ctx sha512_ctx
|
||||
# define sha512_CTX SHA512_CTX
|
||||
# undef _gl_CTX
|
||||
# undef _gl_ctx
|
||||
# define _gl_CTX _GLCRYPTO_CONCAT (OPENSSL_ALG, _CTX) /* openssl type. */
|
||||
# define _gl_ctx _GLCRYPTO_CONCAT (OPENSSL_ALG, _ctx) /* gnulib type. */
|
||||
|
||||
struct _gl_ctx { _gl_CTX CTX; };
|
||||
#endif
|
||||
|
||||
/* Function name mappings. */
|
||||
#define md5_prefix MD5
|
||||
#define sha1_prefix SHA1
|
||||
#define sha224_prefix SHA224
|
||||
#define sha256_prefix SHA256
|
||||
#define sha384_prefix SHA384
|
||||
#define sha512_prefix SHA512
|
||||
#define _GLCRYPTO_PREFIX _GLCRYPTO_CONCAT (OPENSSL_ALG, _prefix)
|
||||
#define OPENSSL_FN(suffix) _GLCRYPTO_CONCAT (_GLCRYPTO_PREFIX, suffix)
|
||||
#define GL_CRYPTO_FN(suffix) _GLCRYPTO_CONCAT (OPENSSL_ALG, suffix)
|
||||
|
||||
GL_OPENSSL_INLINE void
|
||||
GL_CRYPTO_FN (_init_ctx) (struct _gl_ctx *ctx)
|
||||
{ (void) OPENSSL_FN (_Init) ((_gl_CTX *) ctx); }
|
||||
|
||||
/* These were never exposed by gnulib. */
|
||||
#if ! (GL_OPENSSL_NAME == 224 || GL_OPENSSL_NAME == 384)
|
||||
GL_OPENSSL_INLINE void
|
||||
GL_CRYPTO_FN (_process_bytes) (const void *buf, size_t len, struct _gl_ctx *ctx)
|
||||
{ OPENSSL_FN (_Update) ((_gl_CTX *) ctx, buf, len); }
|
||||
|
||||
GL_OPENSSL_INLINE void
|
||||
GL_CRYPTO_FN (_process_block) (const void *buf, size_t len, struct _gl_ctx *ctx)
|
||||
{ GL_CRYPTO_FN (_process_bytes) (buf, len, ctx); }
|
||||
#endif
|
||||
|
||||
GL_OPENSSL_INLINE void *
|
||||
GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *res)
|
||||
{ OPENSSL_FN (_Final) (res, (_gl_CTX *) ctx); return res; }
|
||||
|
||||
GL_OPENSSL_INLINE void *
|
||||
GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *res)
|
||||
{ return OPENSSL_FN () ((const unsigned char *) buf, len, res); }
|
||||
|
||||
GL_OPENSSL_INLINE void *
|
||||
GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *res)
|
||||
{
|
||||
/* Assume any unprocessed bytes in ctx are not to be ignored. */
|
||||
_gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
|
||||
OPENSSL_FN (_Final) (res, &tmp_ctx);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Undef so we can include multiple times. */
|
||||
#undef GL_CRYPTO_FN
|
||||
#undef OPENSSL_FN
|
||||
#undef _GLCRYPTO_PREFIX
|
||||
#undef OPENSSL_ALG
|
||||
#undef GL_OPENSSL_NAME
|
||||
|
||||
_GL_INLINE_HEADER_END
|
|
@ -33,6 +33,15 @@ libgnu_a_LIBADD = $(gl_LIBOBJS)
|
|||
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
|
||||
EXTRA_libgnu_a_SOURCES =
|
||||
|
||||
## begin gnulib module absolute-header
|
||||
|
||||
# Use this preprocessor expression to decide whether #include_next works.
|
||||
# Do not rely on a 'configure'-time test for this, since the expression
|
||||
# might appear in an installed header, which is used by some other compiler.
|
||||
HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
|
||||
|
||||
## end gnulib module absolute-header
|
||||
|
||||
## begin gnulib module alloca-opt
|
||||
|
||||
BUILT_SOURCES += $(ALLOCA_H)
|
||||
|
@ -152,7 +161,7 @@ EXTRA_DIST += count-trailing-zeros.h
|
|||
|
||||
libgnu_a_SOURCES += md5.c
|
||||
|
||||
EXTRA_DIST += md5.h
|
||||
EXTRA_DIST += gl_openssl.h md5.h
|
||||
|
||||
## end gnulib module crypto/md5
|
||||
|
||||
|
@ -160,7 +169,7 @@ EXTRA_DIST += md5.h
|
|||
|
||||
libgnu_a_SOURCES += sha1.c
|
||||
|
||||
EXTRA_DIST += sha1.h
|
||||
EXTRA_DIST += gl_openssl.h sha1.h
|
||||
|
||||
## end gnulib module crypto/sha1
|
||||
|
||||
|
@ -168,7 +177,7 @@ EXTRA_DIST += sha1.h
|
|||
|
||||
libgnu_a_SOURCES += sha256.c
|
||||
|
||||
EXTRA_DIST += sha256.h
|
||||
EXTRA_DIST += gl_openssl.h sha256.h
|
||||
|
||||
## end gnulib module crypto/sha256
|
||||
|
||||
|
@ -176,7 +185,7 @@ EXTRA_DIST += sha256.h
|
|||
|
||||
libgnu_a_SOURCES += sha512.c
|
||||
|
||||
EXTRA_DIST += sha512.h
|
||||
EXTRA_DIST += gl_openssl.h sha512.h
|
||||
|
||||
## end gnulib module crypto/sha512
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_OPENSSL_MD5
|
||||
# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
|
||||
#endif
|
||||
#include "md5.h"
|
||||
|
||||
#include <stdalign.h>
|
||||
|
@ -61,6 +64,7 @@
|
|||
# error "invalid BLOCKSIZE"
|
||||
#endif
|
||||
|
||||
#if ! HAVE_OPENSSL_MD5
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
64-byte boundary. (RFC 1321, 3.1: Step 1) */
|
||||
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
@ -128,6 +132,7 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
|
|||
|
||||
return md5_read_ctx (ctx, resbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
|
@ -202,6 +207,7 @@ md5_stream (FILE *stream, void *resblock)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if ! HAVE_OPENSSL_MD5
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -459,3 +465,4 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
|
|||
ctx->C = C;
|
||||
ctx->D = D;
|
||||
}
|
||||
#endif
|
||||
|
|
20
lib/md5.h
20
lib/md5.h
|
@ -23,6 +23,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
# if HAVE_OPENSSL_MD5
|
||||
# include <openssl/md5.h>
|
||||
# endif
|
||||
|
||||
#define MD5_DIGEST_SIZE 16
|
||||
#define MD5_BLOCK_SIZE 64
|
||||
|
||||
|
@ -57,6 +61,10 @@
|
|||
extern "C" {
|
||||
# endif
|
||||
|
||||
# if HAVE_OPENSSL_MD5
|
||||
# define GL_OPENSSL_NAME 5
|
||||
# include "gl_openssl.h"
|
||||
# else
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct md5_ctx
|
||||
{
|
||||
|
@ -106,11 +114,6 @@ extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
|
|||
extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
|
||||
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int __md5_stream (FILE *stream, void *resblock) __THROW;
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -118,6 +121,13 @@ extern int __md5_stream (FILE *stream, void *resblock) __THROW;
|
|||
extern void *__md5_buffer (const char *buffer, size_t len,
|
||||
void *resblock) __THROW;
|
||||
|
||||
# endif
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int __md5_stream (FILE *stream, void *resblock) __THROW;
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_OPENSSL_SHA1
|
||||
# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
|
||||
#endif
|
||||
#include "sha1.h"
|
||||
|
||||
#include <stdalign.h>
|
||||
|
@ -46,6 +49,7 @@
|
|||
# error "invalid BLOCKSIZE"
|
||||
#endif
|
||||
|
||||
#if ! HAVE_OPENSSL_SHA1
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
64-byte boundary. (RFC 1321, 3.1: Step 1) */
|
||||
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
@ -116,6 +120,7 @@ sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
|
|||
|
||||
return sha1_read_ctx (ctx, resbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Compute SHA1 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
|
@ -190,6 +195,7 @@ sha1_stream (FILE *stream, void *resblock)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if ! HAVE_OPENSSL_SHA1
|
||||
/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -424,3 +430,4 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
|
|||
e = ctx->E += e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
21
lib/sha1.h
21
lib/sha1.h
|
@ -22,12 +22,20 @@
|
|||
# include <stdio.h>
|
||||
# include <stdint.h>
|
||||
|
||||
# if HAVE_OPENSSL_SHA1
|
||||
# include <openssl/sha.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
#define SHA1_DIGEST_SIZE 20
|
||||
|
||||
# if HAVE_OPENSSL_SHA1
|
||||
# define GL_OPENSSL_NAME 1
|
||||
# include "gl_openssl.h"
|
||||
# else
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha1_ctx
|
||||
{
|
||||
|
@ -42,7 +50,6 @@ struct sha1_ctx
|
|||
uint32_t buffer[32];
|
||||
};
|
||||
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha1_init_ctx (struct sha1_ctx *ctx);
|
||||
|
||||
|
@ -73,17 +80,19 @@ extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
|
|||
extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Compute SHA1 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 20 bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha1_stream (FILE *stream, void *resblock);
|
||||
|
||||
/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
|
||||
|
||||
# endif
|
||||
/* Compute SHA1 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 20 bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha1_stream (FILE *stream, void *resblock);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_OPENSSL_SHA256
|
||||
# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
|
||||
#endif
|
||||
#include "sha256.h"
|
||||
|
||||
#include <stdalign.h>
|
||||
|
@ -45,6 +48,7 @@
|
|||
# error "invalid BLOCKSIZE"
|
||||
#endif
|
||||
|
||||
#if ! HAVE_OPENSSL_SHA256
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
64-byte boundary. */
|
||||
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
@ -163,6 +167,7 @@ sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
|
|||
sha256_conclude_ctx (ctx);
|
||||
return sha224_read_ctx (ctx, resbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Compute SHA256 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 32 bytes
|
||||
|
@ -308,6 +313,7 @@ sha224_stream (FILE *stream, void *resblock)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if ! HAVE_OPENSSL_SHA256
|
||||
/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -567,3 +573,4 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
|
|||
h = ctx->state[7] += h;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
30
lib/sha256.h
30
lib/sha256.h
|
@ -21,10 +21,23 @@
|
|||
# include <stdio.h>
|
||||
# include <stdint.h>
|
||||
|
||||
# if HAVE_OPENSSL_SHA256
|
||||
# include <openssl/sha.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
enum { SHA224_DIGEST_SIZE = 224 / 8 };
|
||||
enum { SHA256_DIGEST_SIZE = 256 / 8 };
|
||||
|
||||
# if HAVE_OPENSSL_SHA256
|
||||
# define GL_OPENSSL_NAME 224
|
||||
# include "gl_openssl.h"
|
||||
# define GL_OPENSSL_NAME 256
|
||||
# include "gl_openssl.h"
|
||||
# else
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha256_ctx
|
||||
{
|
||||
|
@ -35,9 +48,6 @@ struct sha256_ctx
|
|||
uint32_t buffer[32];
|
||||
};
|
||||
|
||||
enum { SHA224_DIGEST_SIZE = 224 / 8 };
|
||||
enum { SHA256_DIGEST_SIZE = 256 / 8 };
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha256_init_ctx (struct sha256_ctx *ctx);
|
||||
extern void sha224_init_ctx (struct sha256_ctx *ctx);
|
||||
|
@ -71,12 +81,6 @@ extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
|
|||
extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Compute SHA256 (SHA224) message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 32 (28) bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha256_stream (FILE *stream, void *resblock);
|
||||
extern int sha224_stream (FILE *stream, void *resblock);
|
||||
|
||||
/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -84,6 +88,14 @@ extern int sha224_stream (FILE *stream, void *resblock);
|
|||
extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
|
||||
extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
|
||||
|
||||
# endif
|
||||
/* Compute SHA256 (SHA224) message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 32 (28) bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha256_stream (FILE *stream, void *resblock);
|
||||
extern int sha224_stream (FILE *stream, void *resblock);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_OPENSSL_SHA512
|
||||
# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
|
||||
#endif
|
||||
#include "sha512.h"
|
||||
|
||||
#include <stdalign.h>
|
||||
|
@ -52,6 +55,7 @@
|
|||
# error "invalid BLOCKSIZE"
|
||||
#endif
|
||||
|
||||
#if ! HAVE_OPENSSL_SHA512
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
128-byte boundary. */
|
||||
static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
@ -171,6 +175,7 @@ sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
|
|||
sha512_conclude_ctx (ctx);
|
||||
return sha384_read_ctx (ctx, resbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Compute SHA512 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 64 bytes
|
||||
|
@ -316,6 +321,7 @@ sha384_stream (FILE *stream, void *resblock)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if ! HAVE_OPENSSL_SHA512
|
||||
/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -619,3 +625,4 @@ sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
|
|||
h = ctx->state[7] = u64plus (ctx->state[7], h);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
31
lib/sha512.h
31
lib/sha512.h
|
@ -19,13 +19,25 @@
|
|||
# define SHA512_H 1
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
# include "u64.h"
|
||||
|
||||
# if HAVE_OPENSSL_SHA512
|
||||
# include <openssl/sha.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
enum { SHA384_DIGEST_SIZE = 384 / 8 };
|
||||
enum { SHA512_DIGEST_SIZE = 512 / 8 };
|
||||
|
||||
# if HAVE_OPENSSL_SHA512
|
||||
# define GL_OPENSSL_NAME 384
|
||||
# include "gl_openssl.h"
|
||||
# define GL_OPENSSL_NAME 512
|
||||
# include "gl_openssl.h"
|
||||
# else
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha512_ctx
|
||||
{
|
||||
|
@ -36,9 +48,6 @@ struct sha512_ctx
|
|||
u64 buffer[32];
|
||||
};
|
||||
|
||||
enum { SHA384_DIGEST_SIZE = 384 / 8 };
|
||||
enum { SHA512_DIGEST_SIZE = 512 / 8 };
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha512_init_ctx (struct sha512_ctx *ctx);
|
||||
extern void sha384_init_ctx (struct sha512_ctx *ctx);
|
||||
|
@ -75,12 +84,6 @@ extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
|
|||
extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Compute SHA512 (SHA384) message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 64 (48) bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha512_stream (FILE *stream, void *resblock);
|
||||
extern int sha384_stream (FILE *stream, void *resblock);
|
||||
|
||||
/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
|
@ -88,6 +91,14 @@ extern int sha384_stream (FILE *stream, void *resblock);
|
|||
extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
|
||||
extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
|
||||
|
||||
# endif
|
||||
/* Compute SHA512 (SHA384) message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 64 (48) bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha512_stream (FILE *stream, void *resblock);
|
||||
extern int sha384_stream (FILE *stream, void *resblock);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
|
145
lisp/ChangeLog
145
lisp/ChangeLog
|
@ -1,7 +1,140 @@
|
|||
2013-12-09 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* autorevert.el (auto-revert-notify-add-watch): Do not handle
|
||||
symlinked files.
|
||||
|
||||
2013-12-09 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t
|
||||
after the end of a percent literal.
|
||||
|
||||
2013-12-09 Cameron Desautels <camdez@gmail.com> (tiny change)
|
||||
|
||||
* progmodes/ruby-mode.el (ruby-forward-string): Document. Handle
|
||||
caret-delimited strings (Bug#16079).
|
||||
|
||||
2013-12-09 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
|
||||
`ruby-use-smie' is t, use `smie-forward-sexp' instead of
|
||||
`ruby-parse-partial' (Bug#16078).
|
||||
|
||||
2013-12-09 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* subr.el (read-passwd): Disable show-paren-mode. (Bug#16091)
|
||||
|
||||
2013-12-08 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* progmodes/js.el (js-auto-indent-flag): Remove, was unused.
|
||||
(js-switch-indent-offset): New option.
|
||||
(js--proper-indentation): Use it. And handle the case when
|
||||
"default" is actually a key in an object literal.
|
||||
(js--same-line): New function.
|
||||
(js--multi-line-declaration-indentation): Use it.
|
||||
(js--indent-in-array-comp, js--array-comp-indentation): New
|
||||
functions.
|
||||
(js--proper-indentation): Use them, to handle array comprehension
|
||||
continuations.
|
||||
|
||||
2013-12-08 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* progmodes/flymake.el (flymake-highlight-line): Re-write.
|
||||
(flymake-make-overlay): Remove arg MOUSE-FACE.
|
||||
(flymake-save-string-to-file, flymake-read-file-to-string): Remove.
|
||||
|
||||
2013-12-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* emulation/cua-rect.el (cua--rectangle-highlight-for-redisplay):
|
||||
New function.
|
||||
(redisplay-highlight-region-function): Use it.
|
||||
|
||||
* emulation/cua-base.el (cua--explicit-region-start)
|
||||
(cua--last-region-shifted): Remove.
|
||||
(cua--deactivate): Use deactivate-mark.
|
||||
(cua--pre-command-handler-1): Don't handle shift-selection.
|
||||
(cua--post-command-handler-1): Don't change transient-mark-mode.
|
||||
(cua--select-keymaps): Use region-active-p rather than
|
||||
cua--explicit-region-start or cua--last-region-shifted.
|
||||
(cua-mode): Enable shift-select-mode.
|
||||
|
||||
2013-12-08 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* progmodes/flymake.el (flymake-popup-current-error-menu):
|
||||
Rename from flymake-display-err-menu-for-current-line. Reimplement.
|
||||
(flymake-posn-at-point-as-event, flymake-popup-menu)
|
||||
(flymake-make-emacs-menu): Remove. (Bug#16077)
|
||||
|
||||
2013-12-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* rect.el (rectangle-mark-mode): Activate mark even if
|
||||
transient-mark-mode is off (bug#16066).
|
||||
(rectangle--highlight-for-redisplay): Fix boundary condition when point
|
||||
is > mark and at bolp.
|
||||
|
||||
* emulation/cua-rect.el (cua--rectangle-region-extract): New function.
|
||||
(region-extract-function): Use it.
|
||||
(cua-mouse-save-then-kill-rectangle): Use cua-copy-region.
|
||||
(cua-copy-rectangle, cua-cut-rectangle, cua-delete-rectangle):
|
||||
Delete functions.
|
||||
(cua--init-rectangles): Don't re-remap copy-region-as-kill,
|
||||
kill-ring-save, kill-region, delete-char, delete-forward-char.
|
||||
Ignore self-insert-iso.
|
||||
|
||||
* emulation/cua-gmrk.el (cua--init-global-mark):
|
||||
Ignore `self-insert-iso'.
|
||||
|
||||
* emulation/cua-base.el (cua--prefix-copy-handler)
|
||||
(cua--prefix-cut-handler): Rely on region-extract-function rather than
|
||||
checking cua--rectangle.
|
||||
(cua-delete-region): Use region-extract-function.
|
||||
(cua-replace-region): Delete function.
|
||||
(cua-copy-region, cua-cut-region): Obey region-extract-function.
|
||||
(cua--pre-command-handler-1): Don't do the delete-selection thing.
|
||||
(cua--self-insert-char-p): Ignore `self-insert-iso'.
|
||||
(cua--init-keymaps): Don't remap delete-selection commands.
|
||||
(cua-mode): Use delete-selection-mode instead of rolling our own
|
||||
(bug#16085).
|
||||
|
||||
* menu-bar.el (clipboard-kill-ring-save, clipboard-kill-region):
|
||||
Obey region-extract-function.
|
||||
|
||||
Make registers and delete-selection-mode work on rectangles.
|
||||
* register.el (describe-register-1): Don't modify the register's value.
|
||||
(copy-to-register): Obey region-extract-function.
|
||||
* delsel.el (delete-active-region): Obey region-extract-function.
|
||||
|
||||
2013-12-08 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* progmodes/flymake.el (flymake, flymake-error-bitmap)
|
||||
(flymake-warning-bitmap, flymake-fringe-indicator-position)
|
||||
(flymake-compilation-prevents-syntax-check)
|
||||
(flymake-start-syntax-check-on-newline)
|
||||
(flymake-no-changes-timeout, flymake-gui-warnings-enabled)
|
||||
(flymake-start-syntax-check-on-find-file, flymake-log-level)
|
||||
(flymake-xml-program, flymake-master-file-dirs)
|
||||
(flymake-master-file-count-limit)
|
||||
(flymake-allowed-file-name-masks): Relocate.
|
||||
(flymake-makehash, flymake-float-time)
|
||||
(flymake-replace-regexp-in-string, flymake-split-string)
|
||||
(flymake-get-temp-dir): Remove.
|
||||
(flymake-popup-menu, flymake-nop, flymake-make-xemacs-menu)
|
||||
(flymake-current-row, flymake-selected-frame)
|
||||
(flymake-get-point-pixel-pos): Remove xemacs compatibity and
|
||||
related functions. (Bug#16077)
|
||||
|
||||
2013-12-07 Bozhidar Batsov <bozhidar@batsov.com>
|
||||
|
||||
* emacs-lisp/helpers.el (string-blank-p): Use `string-match-p'.
|
||||
|
||||
2013-12-07 Tassilo Horn <tsdh@gnu.org>
|
||||
|
||||
* help-fns.el (describe-function-1): Use new advice-* functions
|
||||
rather than old ad-* functions. Fix function type description and
|
||||
source links for advised functions and subrs.
|
||||
|
||||
2013-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* net/shr.el (shr-tag-img): Don't bug out on <img src="">
|
||||
data.
|
||||
* net/shr.el (shr-tag-img): Don't bug out on <img src=""> data.
|
||||
|
||||
2013-12-06 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
|
@ -13,8 +146,8 @@
|
|||
|
||||
2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* progmodes/ruby-mode.el (ruby-syntax-propertize-function): Touch
|
||||
up the last change.
|
||||
* progmodes/ruby-mode.el (ruby-syntax-propertize-function):
|
||||
Touch up the last change.
|
||||
|
||||
2013-12-06 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
|
@ -44,8 +177,8 @@
|
|||
|
||||
2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* progmodes/octave.el (inferior-octave-completion-table): Turn
|
||||
back into function, use `completion-table-with-cache'
|
||||
* progmodes/octave.el (inferior-octave-completion-table):
|
||||
Turn back into function, use `completion-table-with-cache'
|
||||
(Bug#11906). Update all references.
|
||||
|
||||
* minibuffer.el (completion-table-with-cache): New function.
|
||||
|
|
|
@ -5639,7 +5639,7 @@
|
|||
add handling of entry attributes using diary-pull-attrs.
|
||||
(mark-calendar-days-named, mark-calendar-days-named)
|
||||
(mark-calendar-date-pattern, mark-calendar-month)
|
||||
(add-to-diary-list): Add optional paramater `color' for passing
|
||||
(add-to-diary-list): Add optional parameter `color' for passing
|
||||
face attribute info through the callchain. Pass this parameter around.
|
||||
|
||||
2003-02-11 Stefan Monnier <monnier@cs.yale.edu>
|
||||
|
|
|
@ -504,13 +504,15 @@ will use an up-to-date value of `auto-revert-interval'"
|
|||
|
||||
(defun auto-revert-notify-add-watch ()
|
||||
"Enable file notification for current buffer's associated file."
|
||||
(when (string-match auto-revert-notify-exclude-dir-regexp
|
||||
(expand-file-name default-directory))
|
||||
;; We can assume that `buffer-file-name' and
|
||||
;; `auto-revert-use-notify' are non-nil.
|
||||
(when (or (string-match auto-revert-notify-exclude-dir-regexp
|
||||
(expand-file-name default-directory))
|
||||
(not (file-symlink-p buffer-file-name)))
|
||||
;; Fallback to file checks.
|
||||
(set (make-local-variable 'auto-revert-use-notify) nil))
|
||||
|
||||
(when (and buffer-file-name auto-revert-use-notify
|
||||
(not auto-revert-notify-watch-descriptor))
|
||||
(when (not auto-revert-notify-watch-descriptor)
|
||||
(setq auto-revert-notify-watch-descriptor
|
||||
(ignore-errors
|
||||
(file-notify-add-watch
|
||||
|
|
|
@ -78,8 +78,8 @@ any selection."
|
|||
"Delete the active region.
|
||||
If KILLP in not-nil, the active region is killed instead of deleted."
|
||||
(if killp
|
||||
(kill-region (point) (mark))
|
||||
(delete-region (point) (mark)))
|
||||
(kill-region (point) (mark) t)
|
||||
(funcall region-extract-function 'delete-only))
|
||||
t)
|
||||
|
||||
(defun delete-selection-helper (type)
|
||||
|
@ -197,9 +197,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
(define-key minibuffer-local-completion-map "\C-g" 'abort-recursive-edit)
|
||||
(define-key minibuffer-local-must-match-map "\C-g" 'abort-recursive-edit)
|
||||
(define-key minibuffer-local-isearch-map "\C-g" 'abort-recursive-edit)
|
||||
(dolist (sym '(self-insert-command self-insert-iso yank clipboard-yank
|
||||
insert-register delete-backward-char backward-delete-char-untabify
|
||||
delete-char newline-and-indent newline open-line))
|
||||
(dolist (sym '(self-insert-command yank clipboard-yank
|
||||
insert-register
|
||||
newline-and-indent newline open-line))
|
||||
(put sym 'delete-selection nil))
|
||||
;; continue standard unloading
|
||||
nil)
|
||||
|
|
|
@ -642,7 +642,7 @@ The environment used is the one when entering the activation frame at point."
|
|||
(define-key map "h" 'describe-mode)
|
||||
(define-key map "q" 'top-level)
|
||||
(define-key map "e" 'debugger-eval-expression)
|
||||
(define-key map "v" 'debugger-toggle-locals) ;"v" is for "v"ariables.
|
||||
(define-key map "v" 'debugger-toggle-locals) ; "v" is for "variables".
|
||||
(define-key map " " 'next-line)
|
||||
(define-key map "R" 'debugger-record-expression)
|
||||
(define-key map "\C-m" 'debug-help-follow)
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
(defsubst string-blank-p (string)
|
||||
"Check whether STRING is either empty or only whitespace."
|
||||
(string-empty-p (string-trim string)))
|
||||
(string-match-p "\\`[ \t\n\r]*\\'" string))
|
||||
|
||||
(provide 'helpers)
|
||||
|
||||
|
|
|
@ -96,10 +96,6 @@
|
|||
;; This is done by highlighting the first occurrence of "redo"
|
||||
;; and type "repeat" M-v M-v.
|
||||
|
||||
;; Note: Since CUA-mode duplicates the functionality of the
|
||||
;; delete-selection-mode, that mode is automatically disabled when
|
||||
;; CUA-mode is enabled.
|
||||
|
||||
|
||||
;; CUA mode indications
|
||||
;; --------------------
|
||||
|
@ -601,8 +597,6 @@ a cons (TYPE . COLOR), then both properties are affected."
|
|||
cua--last-killed-rectangle nil))
|
||||
|
||||
;; All behind cua--rectangle tests.
|
||||
(declare-function cua-copy-rectangle "cua-rect" (arg))
|
||||
(declare-function cua-cut-rectangle "cua-rect" (arg))
|
||||
(declare-function cua--rectangle-left "cua-rect" (&optional val))
|
||||
(declare-function cua--delete-rectangle "cua-rect" ())
|
||||
(declare-function cua--insert-rectangle "cua-rect"
|
||||
|
@ -631,13 +625,6 @@ a cons (TYPE . COLOR), then both properties are affected."
|
|||
|
||||
;;; Aux. variables
|
||||
|
||||
;; Current region was started using cua-set-mark.
|
||||
(defvar cua--explicit-region-start nil)
|
||||
(make-variable-buffer-local 'cua--explicit-region-start)
|
||||
|
||||
;; Latest region was started using shifted movement command.
|
||||
(defvar cua--last-region-shifted nil)
|
||||
|
||||
;; buffer + point prior to current command when rectangle is active
|
||||
;; checked in post-command hook to see if point was moved
|
||||
(defvar cua--buffer-and-point-before-command nil)
|
||||
|
@ -733,9 +720,7 @@ Repeating prefix key when region is active works as a single prefix key."
|
|||
(defun cua--prefix-copy-handler (arg)
|
||||
"Copy region/rectangle, then replay last key."
|
||||
(interactive "P")
|
||||
(if cua--rectangle
|
||||
(cua-copy-rectangle arg)
|
||||
(cua-copy-region arg))
|
||||
(cua-copy-region arg)
|
||||
(let ((keys (this-single-command-keys)))
|
||||
(setq unread-command-events
|
||||
(cons (aref keys (1- (length keys))) unread-command-events))))
|
||||
|
@ -743,9 +728,7 @@ Repeating prefix key when region is active works as a single prefix key."
|
|||
(defun cua--prefix-cut-handler (arg)
|
||||
"Cut region/rectangle, then replay last key."
|
||||
(interactive "P")
|
||||
(if cua--rectangle
|
||||
(cua-cut-rectangle arg)
|
||||
(cua-cut-region arg))
|
||||
(cua-cut-region arg)
|
||||
(let ((keys (this-single-command-keys)))
|
||||
(setq unread-command-events
|
||||
(cons (aref keys (1- (length keys))) unread-command-events))))
|
||||
|
@ -772,11 +755,9 @@ Repeating prefix key when region is active works as a single prefix key."
|
|||
deactivate-mark nil))
|
||||
|
||||
(defun cua--deactivate (&optional now)
|
||||
(setq cua--explicit-region-start nil)
|
||||
(if (not now)
|
||||
(setq deactivate-mark t)
|
||||
(setq mark-active nil)
|
||||
(run-hooks 'deactivate-mark-hook)))
|
||||
(deactivate-mark)))
|
||||
|
||||
(defun cua--filter-buffer-noprops (start end)
|
||||
(let ((str (filter-buffer-substring start end)))
|
||||
|
@ -815,10 +796,10 @@ Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
|
|||
(let ((start (mark)) (end (point)))
|
||||
(or (<= start end)
|
||||
(setq start (prog1 end (setq end start))))
|
||||
(setq cua--last-deleted-region-text (filter-buffer-substring start end))
|
||||
(setq cua--last-deleted-region-text
|
||||
(funcall region-extract-function t))
|
||||
(if cua-delete-copy-to-register-0
|
||||
(set-register ?0 cua--last-deleted-region-text))
|
||||
(delete-region start end)
|
||||
(setq cua--last-deleted-region-pos
|
||||
(cons (current-buffer)
|
||||
(and (consp buffer-undo-list)
|
||||
|
@ -826,17 +807,6 @@ Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
|
|||
(cua--deactivate)
|
||||
(/= start end)))
|
||||
|
||||
(defun cua-replace-region ()
|
||||
"Replace the active region with the character you type."
|
||||
(interactive)
|
||||
(let ((not-empty (and cua-delete-selection (cua-delete-region))))
|
||||
(unless (eq this-original-command this-command)
|
||||
(let ((overwrite-mode
|
||||
(and overwrite-mode
|
||||
not-empty
|
||||
(not (eq this-original-command 'self-insert-command)))))
|
||||
(cua--fallback)))))
|
||||
|
||||
(defun cua-copy-region (arg)
|
||||
"Copy the region to the kill ring.
|
||||
With numeric prefix arg, copy to register 0-9 instead."
|
||||
|
@ -848,11 +818,11 @@ With numeric prefix arg, copy to register 0-9 instead."
|
|||
(setq start (prog1 end (setq end start))))
|
||||
(cond
|
||||
(cua--register
|
||||
(copy-to-register cua--register start end nil))
|
||||
(copy-to-register cua--register start end nil 'region))
|
||||
((eq this-original-command 'clipboard-kill-ring-save)
|
||||
(clipboard-kill-ring-save start end))
|
||||
(clipboard-kill-ring-save start end 'region))
|
||||
(t
|
||||
(copy-region-as-kill start end)))
|
||||
(copy-region-as-kill start end 'region)))
|
||||
(if cua-keep-region-after-copy
|
||||
(cua--keep-active)
|
||||
(cua--deactivate))))
|
||||
|
@ -870,11 +840,11 @@ With numeric prefix arg, copy to register 0-9 instead."
|
|||
(setq start (prog1 end (setq end start))))
|
||||
(cond
|
||||
(cua--register
|
||||
(copy-to-register cua--register start end t))
|
||||
(copy-to-register cua--register start end t 'region))
|
||||
((eq this-original-command 'clipboard-kill-region)
|
||||
(clipboard-kill-region start end))
|
||||
(clipboard-kill-region start end 'region))
|
||||
(t
|
||||
(kill-region start end))))
|
||||
(kill-region start end 'region))))
|
||||
(cua--deactivate)))
|
||||
|
||||
;;; Generic commands for regions, rectangles, and global marks
|
||||
|
@ -883,7 +853,6 @@ With numeric prefix arg, copy to register 0-9 instead."
|
|||
"Cancel the active region, rectangle, or global mark."
|
||||
(interactive)
|
||||
(setq mark-active nil)
|
||||
(setq cua--explicit-region-start nil)
|
||||
(if (fboundp 'cua--cancel-rectangle)
|
||||
(cua--cancel-rectangle)))
|
||||
|
||||
|
@ -1130,14 +1099,12 @@ With a double \\[universal-argument] prefix argument, unconditionally set mark."
|
|||
(message "Mark cleared"))
|
||||
(t
|
||||
(push-mark-command nil nil)
|
||||
(setq cua--explicit-region-start t)
|
||||
(setq cua--last-region-shifted nil)
|
||||
(if cua-enable-region-auto-help
|
||||
(cua-help-for-region t)))))
|
||||
|
||||
;;; Scrolling commands which does not signal errors at top/bottom
|
||||
;;; of buffer at first key-press (instead moves to top/bottom
|
||||
;;; of buffer).
|
||||
;; Scrolling commands which do not signal errors at top/bottom
|
||||
;; of buffer at first key-press (instead moves to top/bottom
|
||||
;; of buffer).
|
||||
|
||||
(defun cua-scroll-up (&optional arg)
|
||||
"Scroll text of current window upward ARG lines; or near full screen if no ARG.
|
||||
|
@ -1221,53 +1188,13 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
|||
((not (symbolp this-command))
|
||||
nil)
|
||||
|
||||
;; Handle delete-selection property on non-movement commands
|
||||
((not (eq (get this-command 'CUA) 'move))
|
||||
(when (and mark-active (not deactivate-mark))
|
||||
(let* ((ds (or (get this-command 'delete-selection)
|
||||
(get this-command 'pending-delete)))
|
||||
(nc (cond
|
||||
((not ds) nil)
|
||||
((eq ds 'yank)
|
||||
'cua-paste)
|
||||
((eq ds 'kill)
|
||||
(if cua--rectangle
|
||||
'cua-copy-rectangle
|
||||
'cua-copy-region))
|
||||
((eq ds 'supersede)
|
||||
(if cua--rectangle
|
||||
'cua-delete-rectangle
|
||||
'cua-delete-region))
|
||||
(t
|
||||
(if cua--rectangle
|
||||
'cua-delete-rectangle ;; replace?
|
||||
'cua-replace-region)))))
|
||||
(if nc
|
||||
(setq this-original-command this-command
|
||||
this-command nc)))))
|
||||
|
||||
;; Handle shifted cursor keys and other movement commands.
|
||||
;; If region is not active, region is activated if key is shifted.
|
||||
;; If region is active, region is canceled if key is unshifted
|
||||
;; (and region not started with C-SPC).
|
||||
;; If rectangle is active, expand rectangle in specified direction and
|
||||
;; ignore the movement.
|
||||
(this-command-keys-shift-translated
|
||||
(unless mark-active
|
||||
(push-mark-command nil t))
|
||||
(setq cua--last-region-shifted t)
|
||||
(setq cua--explicit-region-start nil))
|
||||
nil)
|
||||
|
||||
;; Set mark if user explicitly said to do so
|
||||
((or cua--explicit-region-start cua--rectangle)
|
||||
(cua--rectangle ;FIXME: ??
|
||||
(unless mark-active
|
||||
(push-mark-command nil nil)))
|
||||
|
||||
;; Else clear mark after this command.
|
||||
(t
|
||||
;; If we set mark-active to nil here, the region highlight will not be
|
||||
;; removed by the direct_output_ commands.
|
||||
(setq deactivate-mark t)))
|
||||
(push-mark-command nil nil))))
|
||||
|
||||
;; Detect extension of rectangles by mouse or other movement
|
||||
(setq cua--buffer-and-point-before-command
|
||||
|
@ -1287,22 +1214,13 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
|||
(when (fboundp 'cua--rectangle-post-command)
|
||||
(cua--rectangle-post-command))
|
||||
(setq cua--buffer-and-point-before-command nil)
|
||||
(if (or (not mark-active) deactivate-mark)
|
||||
(setq cua--explicit-region-start nil))
|
||||
|
||||
;; Debugging
|
||||
(if cua--debug
|
||||
(cond
|
||||
(cua--rectangle (cua--rectangle-assert))
|
||||
(mark-active (message "Mark=%d Point=%d Expl=%s"
|
||||
(mark t) (point) cua--explicit-region-start))))
|
||||
(mark-active (message "Mark=%d Point=%d" (mark t) (point)))))
|
||||
|
||||
;; Disable transient-mark-mode if rectangle active in current buffer.
|
||||
(if (not (window-minibuffer-p))
|
||||
(setq transient-mark-mode (and (not cua--rectangle)
|
||||
(if cua-highlight-region-shift-only
|
||||
(not cua--explicit-region-start)
|
||||
t))))
|
||||
(if cua-enable-cursor-indications
|
||||
(cua--update-indications))
|
||||
|
||||
|
@ -1329,7 +1247,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
|||
;; Return DEF if current key sequence is self-inserting in
|
||||
;; global-map.
|
||||
(if (memq (global-key-binding (this-single-command-keys))
|
||||
'(self-insert-command self-insert-iso))
|
||||
'(self-insert-command))
|
||||
def nil))
|
||||
|
||||
(defvar cua-global-keymap (make-sparse-keymap)
|
||||
|
@ -1366,7 +1284,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
|||
cua-enable-cua-keys
|
||||
(not cua-inhibit-cua-keys)
|
||||
(or (eq cua-enable-cua-keys t)
|
||||
(not cua--explicit-region-start))
|
||||
(region-active-p))
|
||||
(not executing-kbd-macro)
|
||||
(not cua--prefix-override-timer)))
|
||||
(setq cua--ena-prefix-repeat-keymap
|
||||
|
@ -1377,7 +1295,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
|||
(and cua-enable-cua-keys
|
||||
(not cua-inhibit-cua-keys)
|
||||
(or (eq cua-enable-cua-keys t)
|
||||
cua--last-region-shifted)))
|
||||
(region-active-p))))
|
||||
(setq cua--ena-global-mark-keymap
|
||||
(and cua--global-mark-active
|
||||
(not (window-minibuffer-p)))))
|
||||
|
@ -1457,13 +1375,6 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
|||
(define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix)
|
||||
(define-key cua--region-keymap [(shift control c)] 'cua--shift-control-c-prefix)
|
||||
|
||||
;; replace current region
|
||||
(define-key cua--region-keymap [remap self-insert-command] 'cua-replace-region)
|
||||
(define-key cua--region-keymap [remap self-insert-iso] 'cua-replace-region)
|
||||
(define-key cua--region-keymap [remap insert-register] 'cua-replace-region)
|
||||
(define-key cua--region-keymap [remap newline-and-indent] 'cua-replace-region)
|
||||
(define-key cua--region-keymap [remap newline] 'cua-replace-region)
|
||||
(define-key cua--region-keymap [remap open-line] 'cua-replace-region)
|
||||
;; delete current region
|
||||
(define-key cua--region-keymap [remap delete-backward-char] 'cua-delete-region)
|
||||
(define-key cua--region-keymap [remap backward-delete-char] 'cua-delete-region)
|
||||
|
@ -1589,20 +1500,21 @@ shifted movement key, set `cua-highlight-region-shift-only'."
|
|||
(and (boundp 'delete-selection-mode) delete-selection-mode)
|
||||
(and (boundp 'pc-selection-mode) pc-selection-mode)
|
||||
shift-select-mode))
|
||||
(if (and (boundp 'delete-selection-mode) delete-selection-mode)
|
||||
(delete-selection-mode -1))
|
||||
(if cua-delete-selection
|
||||
(delete-selection-mode 1)
|
||||
(if (and (boundp 'delete-selection-mode) delete-selection-mode)
|
||||
(delete-selection-mode -1)))
|
||||
(if (and (boundp 'pc-selection-mode) pc-selection-mode)
|
||||
(pc-selection-mode -1))
|
||||
(cua--deactivate)
|
||||
(setq shift-select-mode nil)
|
||||
(setq transient-mark-mode (and cua-mode
|
||||
(if cua-highlight-region-shift-only
|
||||
(not cua--explicit-region-start)
|
||||
t))))
|
||||
(setq shift-select-mode t)
|
||||
(transient-mark-mode (if cua-highlight-region-shift-only -1 1)))
|
||||
(cua--saved-state
|
||||
(setq transient-mark-mode (car cua--saved-state))
|
||||
(if (nth 1 cua--saved-state)
|
||||
(delete-selection-mode 1))
|
||||
(delete-selection-mode 1)
|
||||
(if (and (boundp 'delete-selection-mode) delete-selection-mode)
|
||||
(delete-selection-mode -1)))
|
||||
(if (nth 2 cua--saved-state)
|
||||
(pc-selection-mode 1))
|
||||
(setq shift-select-mode (nth 3 cua--saved-state))
|
||||
|
|
|
@ -362,7 +362,6 @@ With prefix argument, don't jump to global mark when canceling it."
|
|||
(define-key cua--global-mark-keymap [remap backward-delete-char] 'cua-delete-backward-char-at-global-mark)
|
||||
(define-key cua--global-mark-keymap [remap backward-delete-char-untabify] 'cua-delete-backward-char-at-global-mark)
|
||||
(define-key cua--global-mark-keymap [remap self-insert-command] 'cua-insert-char-at-global-mark)
|
||||
(define-key cua--global-mark-keymap [remap self-insert-iso] 'cua-insert-char-at-global-mark)
|
||||
|
||||
;; Catch self-inserting characters which are "stolen" by other modes
|
||||
(define-key cua--global-mark-keymap [t]
|
||||
|
|
|
@ -461,7 +461,7 @@ If command is repeated at same position, delete the rectangle."
|
|||
(cua--deactivate))
|
||||
(cua-mouse-resize-rectangle event)
|
||||
(let ((cua-keep-region-after-copy t))
|
||||
(cua-copy-rectangle arg)
|
||||
(cua-copy-region arg)
|
||||
(setq cua--mouse-last-pos (cons (point) cua--last-killed-rectangle)))))
|
||||
|
||||
(defun cua--mouse-ignore (_event)
|
||||
|
@ -877,8 +877,7 @@ With prefix argument, activate previous rectangle if possible."
|
|||
(push-mark nil nil t)))
|
||||
(cua--activate-rectangle)
|
||||
(cua--rectangle-set-corners)
|
||||
(setq mark-active t
|
||||
cua--explicit-region-start t)
|
||||
(setq mark-active t)
|
||||
(if cua-enable-rectangle-auto-help
|
||||
(cua-help-for-rectangle t))))
|
||||
|
||||
|
@ -886,8 +885,7 @@ With prefix argument, activate previous rectangle if possible."
|
|||
"Cancel current rectangle."
|
||||
(interactive)
|
||||
(when cua--rectangle
|
||||
(setq mark-active nil
|
||||
cua--explicit-region-start nil)
|
||||
(setq mark-active nil)
|
||||
(cua--deactivate-rectangle)))
|
||||
|
||||
(defun cua-toggle-rectangle-mark ()
|
||||
|
@ -945,32 +943,6 @@ With prefix argument, toggle restriction."
|
|||
(interactive)
|
||||
(cua--rectangle-move 'right))
|
||||
|
||||
(defun cua-copy-rectangle (arg)
|
||||
(interactive "P")
|
||||
(setq arg (cua--prefix-arg arg))
|
||||
(cua--copy-rectangle-as-kill arg)
|
||||
(if cua-keep-region-after-copy
|
||||
(cua--keep-active)
|
||||
(cua--deactivate)))
|
||||
|
||||
(defun cua-cut-rectangle (arg)
|
||||
(interactive "P")
|
||||
(if buffer-read-only
|
||||
(cua-copy-rectangle arg)
|
||||
(setq arg (cua--prefix-arg arg))
|
||||
(goto-char (min (mark) (point)))
|
||||
(cua--copy-rectangle-as-kill arg)
|
||||
(cua--delete-rectangle))
|
||||
(cua--deactivate))
|
||||
|
||||
(defun cua-delete-rectangle ()
|
||||
(interactive)
|
||||
(goto-char (min (point) (mark)))
|
||||
(if cua-delete-copy-to-register-0
|
||||
(set-register ?0 (cua--extract-rectangle)))
|
||||
(cua--delete-rectangle)
|
||||
(cua--deactivate))
|
||||
|
||||
(defun cua-rotate-rectangle ()
|
||||
(interactive)
|
||||
(cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 0 1))
|
||||
|
@ -1402,6 +1374,38 @@ With prefix arg, indent to that column."
|
|||
(goto-char cua--rect-undo-set-point)
|
||||
(setq cua--rect-undo-set-point nil)))
|
||||
|
||||
(add-function :around region-extract-function
|
||||
#'cua--rectangle-region-extract)
|
||||
(add-function :around redisplay-highlight-region-function
|
||||
#'cua--rectangle-highlight-for-redisplay)
|
||||
|
||||
(defun cua--rectangle-highlight-for-redisplay (orig &rest args)
|
||||
(if (not cua--rectangle) (apply orig args)
|
||||
;; When cua--rectangle is active, just don't highlight at all, since we
|
||||
;; already do it elsewhere.
|
||||
))
|
||||
|
||||
(defun cua--rectangle-region-extract (orig &optional delete)
|
||||
(cond
|
||||
((not cua--rectangle) (funcall orig delete))
|
||||
((eq delete 'delete-only) (cua--delete-rectangle))
|
||||
(t
|
||||
(let* ((strs (cua--extract-rectangle))
|
||||
(str (mapconcat #'identity strs "\n")))
|
||||
(if delete (cua--delete-rectangle))
|
||||
(setq killed-rectangle strs)
|
||||
(setq cua--last-killed-rectangle
|
||||
(cons (and kill-ring (car kill-ring)) killed-rectangle))
|
||||
(when (eq last-command 'kill-region)
|
||||
;; Try to prevent kill-region from appending this to some
|
||||
;; earlier element.
|
||||
(setq last-command 'kill-region-dont-append))
|
||||
(when strs
|
||||
(put-text-property 0 (length str) 'yank-handler
|
||||
`(rectangle--insert-for-yank ,strs t)
|
||||
str)
|
||||
str)))))
|
||||
|
||||
;;; Initialization
|
||||
|
||||
(defun cua--rect-M/H-key (key cmd)
|
||||
|
@ -1414,11 +1418,6 @@ With prefix arg, indent to that column."
|
|||
(cua--rect-M/H-key ?\s 'cua-clear-rectangle-mark)
|
||||
(cua--M/H-key cua--region-keymap ?\s 'cua-toggle-rectangle-mark))
|
||||
|
||||
(define-key cua--rectangle-keymap [remap copy-region-as-kill] 'cua-copy-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap kill-region] 'cua-cut-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap delete-char] 'cua-delete-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap delete-forward-char] 'cua-delete-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap set-mark-command] 'cua-toggle-rectangle-mark)
|
||||
|
||||
(define-key cua--rectangle-keymap [remap forward-char] 'cua-resize-rectangle-right)
|
||||
|
@ -1440,7 +1439,6 @@ With prefix arg, indent to that column."
|
|||
(define-key cua--rectangle-keymap [remap backward-delete-char] 'cua-delete-char-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap backward-delete-char-untabify] 'cua-delete-char-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap self-insert-command] 'cua-insert-char-rectangle)
|
||||
(define-key cua--rectangle-keymap [remap self-insert-iso] 'cua-insert-char-rectangle)
|
||||
|
||||
;; Catch self-inserting characters which are "stolen" by other modes
|
||||
(define-key cua--rectangle-keymap [t]
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-12-08 Katsumi Yamaoka <yamaoka@jpl.org>
|
||||
|
||||
* gnus-msg.el (gnus-setup-message): Fix the type of argument passed to
|
||||
nnir-article-number and nnir-article-group.
|
||||
|
||||
2013-12-03 Vitalie Spinu <spinuvit@gmail.com>
|
||||
|
||||
* message.el (message-send-mail-with-sendmail):
|
||||
|
|
|
@ -433,12 +433,14 @@ Thank you for your help in stamping out bugs.
|
|||
(,buffer (buffer-name (current-buffer)))
|
||||
(,article (if (and (gnus-nnir-group-p gnus-newsgroup-name)
|
||||
gnus-article-reply)
|
||||
(nnir-article-number gnus-article-reply)
|
||||
(nnir-article-number (or (car-safe gnus-article-reply)
|
||||
gnus-article-reply))
|
||||
gnus-article-reply))
|
||||
(,yanked gnus-article-yanked-articles)
|
||||
(,group (if (and (gnus-nnir-group-p gnus-newsgroup-name)
|
||||
gnus-article-reply)
|
||||
(nnir-article-group gnus-article-reply)
|
||||
(nnir-article-group (or (car-safe gnus-article-reply)
|
||||
gnus-article-reply))
|
||||
gnus-newsgroup-name))
|
||||
(message-header-setup-hook
|
||||
(copy-sequence message-header-setup-hook))
|
||||
|
@ -446,7 +448,7 @@ Thank you for your help in stamping out bugs.
|
|||
(message-mode-hook (copy-sequence message-mode-hook)))
|
||||
(setq mml-buffer-list nil)
|
||||
(add-hook 'message-header-setup-hook (lambda ()
|
||||
(gnus-inews-insert-gcc ,group)))
|
||||
(gnus-inews-insert-gcc ,group)))
|
||||
;; message-newsreader and message-mailer were formerly set in
|
||||
;; gnus-inews-add-send-actions, but this is too late when
|
||||
;; message-generate-headers-first is used. --ansel
|
||||
|
|
|
@ -382,8 +382,6 @@ suitable file is found, return nil."
|
|||
(match-string 1 str))))
|
||||
(and src-file (file-readable-p src-file) src-file))))))
|
||||
|
||||
(declare-function ad-get-advice-info "advice" (function))
|
||||
|
||||
(defun help-fns--key-bindings (function)
|
||||
(when (commandp function)
|
||||
(let ((pt2 (with-current-buffer standard-output (point)))
|
||||
|
@ -531,27 +529,34 @@ FILE is the file where FUNCTION was probably defined."
|
|||
|
||||
;;;###autoload
|
||||
(defun describe-function-1 (function)
|
||||
(let* ((advised (and (symbolp function) (featurep 'advice)
|
||||
(ad-get-advice-info function)))
|
||||
(let* ((advised (and (symbolp function)
|
||||
(featurep 'nadvice)
|
||||
(advice--p (advice--symbol-function function))))
|
||||
;; If the function is advised, use the symbol that has the
|
||||
;; real definition, if that symbol is already set up.
|
||||
(real-function
|
||||
(or (and advised
|
||||
(let ((origname (cdr (assq 'origname advised))))
|
||||
(and (fboundp origname) origname)))
|
||||
(let* ((advised-fn (advice--cdr
|
||||
(advice--symbol-function function))))
|
||||
(while (advice--p advised-fn)
|
||||
(setq advised-fn (advice--cdr advised-fn)))
|
||||
advised-fn))
|
||||
function))
|
||||
;; Get the real definition.
|
||||
(def (if (symbolp real-function)
|
||||
(symbol-function real-function)
|
||||
function))
|
||||
(aliased (symbolp def))
|
||||
(real-def (if aliased
|
||||
(let ((f def))
|
||||
(while (and (fboundp f)
|
||||
(symbolp (symbol-function f)))
|
||||
(setq f (symbol-function f)))
|
||||
f)
|
||||
def))
|
||||
real-function))
|
||||
(aliased (or (symbolp def)
|
||||
;; Advised & aliased function.
|
||||
(and advised (symbolp real-function))))
|
||||
(real-def (cond
|
||||
(aliased (let ((f real-function))
|
||||
(while (and (fboundp f)
|
||||
(symbolp (symbol-function f)))
|
||||
(setq f (symbol-function f)))
|
||||
f))
|
||||
((subrp def) (intern (subr-name def)))
|
||||
(t def)))
|
||||
(file-name (find-lisp-object-file-name function def))
|
||||
(pt1 (with-current-buffer (help-buffer) (point)))
|
||||
(beg (if (and (or (byte-code-function-p def)
|
||||
|
@ -571,14 +576,20 @@ FILE is the file where FUNCTION was probably defined."
|
|||
(if (eq 'unevalled (cdr (subr-arity def)))
|
||||
(concat beg "special form")
|
||||
(concat beg "built-in function")))
|
||||
((byte-code-function-p def)
|
||||
(concat beg "compiled Lisp function"))
|
||||
;; Aliases are Lisp functions, so we need to check
|
||||
;; aliases before functions.
|
||||
(aliased
|
||||
(format "an alias for `%s'" real-def))
|
||||
((or (eq (car-safe def) 'macro)
|
||||
;; For advised macros, def is a lambda
|
||||
;; expression or a byte-code-function-p, so we
|
||||
;; need to check macros before functions.
|
||||
(macrop function))
|
||||
(concat beg "Lisp macro"))
|
||||
((byte-code-function-p def)
|
||||
(concat beg "compiled Lisp function"))
|
||||
((eq (car-safe def) 'lambda)
|
||||
(concat beg "Lisp function"))
|
||||
((eq (car-safe def) 'macro)
|
||||
(concat beg "Lisp macro"))
|
||||
((eq (car-safe def) 'closure)
|
||||
(concat beg "Lisp closure"))
|
||||
((autoloadp def)
|
||||
|
|
|
@ -545,17 +545,17 @@
|
|||
(let ((x-select-enable-clipboard t))
|
||||
(yank)))
|
||||
|
||||
(defun clipboard-kill-ring-save (beg end)
|
||||
(defun clipboard-kill-ring-save (beg end &optional region)
|
||||
"Copy region to kill ring, and save in the X clipboard."
|
||||
(interactive "r")
|
||||
(interactive "r\np")
|
||||
(let ((x-select-enable-clipboard t))
|
||||
(kill-ring-save beg end)))
|
||||
(kill-ring-save beg end region)))
|
||||
|
||||
(defun clipboard-kill-region (beg end)
|
||||
(defun clipboard-kill-region (beg end &optional region)
|
||||
"Kill the region, and save it in the X clipboard."
|
||||
(interactive "r")
|
||||
(interactive "r\np")
|
||||
(let ((x-select-enable-clipboard t))
|
||||
(kill-region beg end)))
|
||||
(kill-region beg end region)))
|
||||
|
||||
(defun menu-bar-enable-clipboard ()
|
||||
"Make CUT, PASTE and COPY (keys and menu bar items) use the clipboard.
|
||||
|
|
|
@ -1198,7 +1198,7 @@ contextual information."
|
|||
(todo type priority name tags contents width inlinetask info)
|
||||
"Format an inline task element for ASCII export.
|
||||
See `org-ascii-format-inlinetask-function' for a description
|
||||
of the paramaters."
|
||||
of the parameters."
|
||||
(let* ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))
|
||||
(width (or width org-ascii-inlinetask-width)))
|
||||
(org-ascii--indent-string
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;;; flymake.el --- a universal on-the-fly syntax checker
|
||||
;;; flymake.el --- a universal on-the-fly syntax checker -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
|
||||
;; Maintainer: Pavel Kobyakov <pk_at_work@yahoo.com>
|
||||
;; Maintainer: Leo Liu <sdl.web@gmail.com>
|
||||
;; Version: 0.3
|
||||
;; Keywords: c languages tools
|
||||
|
||||
|
@ -24,9 +24,9 @@
|
|||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Flymake is a minor Emacs mode performing on-the-fly syntax
|
||||
;; checks using the external syntax check tool (for C/C++ this
|
||||
;; is usually the compiler)
|
||||
;; Flymake is a minor Emacs mode performing on-the-fly syntax checks
|
||||
;; using the external syntax check tool (for C/C++ this is usually the
|
||||
;; compiler).
|
||||
|
||||
;;; Bugs/todo:
|
||||
|
||||
|
@ -36,188 +36,76 @@
|
|||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
(if (featurep 'xemacs) (require 'overlay))
|
||||
|
||||
(defvar flymake-is-running nil
|
||||
"If t, flymake syntax check process is running for the current buffer.")
|
||||
(make-variable-buffer-local 'flymake-is-running)
|
||||
(defgroup flymake nil
|
||||
"Universal on-the-fly syntax checker."
|
||||
:version "23.1"
|
||||
:group 'tools)
|
||||
|
||||
(defvar flymake-timer nil
|
||||
"Timer for starting syntax check.")
|
||||
(make-variable-buffer-local 'flymake-timer)
|
||||
(defcustom flymake-error-bitmap '(exclamation-mark error)
|
||||
"Bitmap (a symbol) used in the fringe for indicating errors.
|
||||
The value may also be a list of two elements where the second
|
||||
element specifies the face for the bitmap. For possible bitmap
|
||||
symbols, see `fringe-bitmaps'. See also `flymake-warning-bitmap'.
|
||||
|
||||
(defvar flymake-last-change-time nil
|
||||
"Time of last buffer change.")
|
||||
(make-variable-buffer-local 'flymake-last-change-time)
|
||||
The option `flymake-fringe-indicator-position' controls how and where
|
||||
this is used."
|
||||
:group 'flymake
|
||||
:version "24.3"
|
||||
:type '(choice (symbol :tag "Bitmap")
|
||||
(list :tag "Bitmap and face"
|
||||
(symbol :tag "Bitmap")
|
||||
(face :tag "Face"))))
|
||||
|
||||
(defvar flymake-check-start-time nil
|
||||
"Time at which syntax check was started.")
|
||||
(make-variable-buffer-local 'flymake-check-start-time)
|
||||
(defcustom flymake-warning-bitmap 'question-mark
|
||||
"Bitmap (a symbol) used in the fringe for indicating warnings.
|
||||
The value may also be a list of two elements where the second
|
||||
element specifies the face for the bitmap. For possible bitmap
|
||||
symbols, see `fringe-bitmaps'. See also `flymake-error-bitmap'.
|
||||
|
||||
(defvar flymake-check-was-interrupted nil
|
||||
"Non-nil if syntax check was killed by `flymake-compile'.")
|
||||
(make-variable-buffer-local 'flymake-check-was-interrupted)
|
||||
The option `flymake-fringe-indicator-position' controls how and where
|
||||
this is used."
|
||||
:group 'flymake
|
||||
:version "24.3"
|
||||
:type '(choice (symbol :tag "Bitmap")
|
||||
(list :tag "Bitmap and face"
|
||||
(symbol :tag "Bitmap")
|
||||
(face :tag "Face"))))
|
||||
|
||||
(defvar flymake-err-info nil
|
||||
"Sorted list of line numbers and lists of err info in the form (file, err-text).")
|
||||
(make-variable-buffer-local 'flymake-err-info)
|
||||
(defcustom flymake-fringe-indicator-position 'left-fringe
|
||||
"The position to put flymake fringe indicator.
|
||||
The value can be nil (do not use indicators), `left-fringe' or `right-fringe'.
|
||||
See `flymake-error-bitmap' and `flymake-warning-bitmap'."
|
||||
:group 'flymake
|
||||
:version "24.3"
|
||||
:type '(choice (const left-fringe)
|
||||
(const right-fringe)
|
||||
(const :tag "No fringe indicators" nil)))
|
||||
|
||||
(defvar flymake-new-err-info nil
|
||||
"Same as `flymake-err-info', effective when a syntax check is in progress.")
|
||||
(make-variable-buffer-local 'flymake-new-err-info)
|
||||
(defcustom flymake-compilation-prevents-syntax-check t
|
||||
"If non-nil, don't start syntax check if compilation is running."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
;;;; [[ cross-emacs compatibility routines
|
||||
(defsubst flymake-makehash (&optional test)
|
||||
"Create and return a new hash table using TEST to compare keys.
|
||||
It uses the function `make-hash-table' to make a hash-table if
|
||||
you use GNU Emacs, otherwise it uses `makehash'."
|
||||
(if (fboundp 'make-hash-table)
|
||||
(if test (make-hash-table :test test) (make-hash-table))
|
||||
(with-no-warnings
|
||||
(makehash test))))
|
||||
(defcustom flymake-start-syntax-check-on-newline t
|
||||
"Start syntax check if newline char was added/removed from the buffer."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
(defalias 'flymake-float-time
|
||||
(if (fboundp 'float-time)
|
||||
'float-time
|
||||
(if (featurep 'xemacs)
|
||||
(lambda ()
|
||||
(multiple-value-bind (s0 s1 s2) (values-list (current-time))
|
||||
(+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2)))))))
|
||||
(defcustom flymake-no-changes-timeout 0.5
|
||||
"Time to wait after last change before starting compilation."
|
||||
:group 'flymake
|
||||
:type 'number)
|
||||
|
||||
(defalias 'flymake-replace-regexp-in-string
|
||||
(if (eval-when-compile (fboundp 'replace-regexp-in-string))
|
||||
'replace-regexp-in-string
|
||||
(lambda (regexp rep str)
|
||||
(replace-in-string str regexp rep))))
|
||||
(defcustom flymake-gui-warnings-enabled t
|
||||
"Enables/disables GUI warnings."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
(defalias 'flymake-split-string
|
||||
(if (condition-case nil (equal (split-string " bc " " " t) '("bc"))
|
||||
(error nil))
|
||||
(lambda (str pattern) (split-string str pattern t))
|
||||
(lambda (str pattern)
|
||||
"Split STR into a list of substrings bounded by PATTERN.
|
||||
Zero-length substrings at the beginning and end of the list are omitted."
|
||||
(let ((split (split-string str pattern)))
|
||||
(while (equal (car split) "") (setq split (cdr split)))
|
||||
(setq split (nreverse split))
|
||||
(while (equal (car split) "") (setq split (cdr split)))
|
||||
(nreverse split)))))
|
||||
|
||||
(defalias 'flymake-get-temp-dir
|
||||
(if (fboundp 'temp-directory)
|
||||
'temp-directory
|
||||
(lambda () temporary-file-directory)))
|
||||
|
||||
(defun flymake-posn-at-point-as-event (&optional position window dx dy)
|
||||
"Return pixel position of top left corner of glyph at POSITION.
|
||||
|
||||
The position is relative to top left corner of WINDOW, as a
|
||||
mouse-1 click event (identical to the event that would be
|
||||
triggered by clicking mouse button 1 at the top left corner of
|
||||
the glyph).
|
||||
|
||||
POSITION and WINDOW default to the position of point in the
|
||||
selected window.
|
||||
|
||||
DX and DY specify optional offsets from the top left of the glyph."
|
||||
(unless window (setq window (selected-window)))
|
||||
(unless position (setq position (window-point window)))
|
||||
(unless dx (setq dx 0))
|
||||
(unless dy (setq dy 0))
|
||||
|
||||
(let* ((pos (posn-at-point position window))
|
||||
(x-y (posn-x-y pos))
|
||||
(edges (window-inside-pixel-edges window))
|
||||
(win-x-y (window-pixel-edges window)))
|
||||
;; adjust for window edges
|
||||
(setcar (nthcdr 2 pos)
|
||||
(cons (+ (car x-y) (car edges) (- (car win-x-y)) dx)
|
||||
(+ (cdr x-y) (cadr edges) (- (cadr win-x-y)) dy)))
|
||||
(list 'mouse-1 pos)))
|
||||
|
||||
(defun flymake-popup-menu (menu-data)
|
||||
"Pop up the flymake menu at point, using the data MENU-DATA.
|
||||
POS is a list of the form ((X Y) WINDOW), where X and Y are
|
||||
pixels positions from the top left corner of WINDOW's frame.
|
||||
MENU-DATA is a list of error and warning messages returned by
|
||||
`flymake-make-err-menu-data'."
|
||||
(if (featurep 'xemacs)
|
||||
(let* ((pos (flymake-get-point-pixel-pos))
|
||||
(x-pos (nth 0 pos))
|
||||
(y-pos (nth 1 pos))
|
||||
(fake-event-props '(button 1 x 1 y 1)))
|
||||
(setq fake-event-props (plist-put fake-event-props 'x x-pos))
|
||||
(setq fake-event-props (plist-put fake-event-props 'y y-pos))
|
||||
(popup-menu (flymake-make-xemacs-menu menu-data)
|
||||
(make-event 'button-press fake-event-props)))
|
||||
(x-popup-menu (if (eval-when-compile (fboundp 'posn-at-point))
|
||||
(flymake-posn-at-point-as-event)
|
||||
(list (flymake-get-point-pixel-pos) (selected-window)))
|
||||
(flymake-make-emacs-menu menu-data))))
|
||||
|
||||
(defun flymake-make-emacs-menu (menu-data)
|
||||
"Return a menu specifier using MENU-DATA.
|
||||
MENU-DATA is a list of error and warning messages returned by
|
||||
`flymake-make-err-menu-data'.
|
||||
See `x-popup-menu' for the menu specifier format."
|
||||
(let* ((menu-title (nth 0 menu-data))
|
||||
(menu-items (nth 1 menu-data))
|
||||
(menu-commands (mapcar (lambda (foo)
|
||||
(cons (nth 0 foo) (nth 1 foo)))
|
||||
menu-items)))
|
||||
(list menu-title (cons "" menu-commands))))
|
||||
|
||||
(if (featurep 'xemacs) (progn
|
||||
|
||||
(defun flymake-nop ()
|
||||
"Do nothing."
|
||||
nil)
|
||||
|
||||
(defun flymake-make-xemacs-menu (menu-data)
|
||||
"Return a menu specifier using MENU-DATA."
|
||||
(let* ((menu-title (nth 0 menu-data))
|
||||
(menu-items (nth 1 menu-data))
|
||||
(menu-commands nil))
|
||||
(setq menu-commands (mapcar (lambda (foo)
|
||||
(vector (nth 0 foo) (or (nth 1 foo) '(flymake-nop)) t))
|
||||
menu-items))
|
||||
(cons menu-title menu-commands)))
|
||||
|
||||
)) ;; xemacs
|
||||
|
||||
(unless (eval-when-compile (fboundp 'posn-at-point))
|
||||
|
||||
(defun flymake-current-row ()
|
||||
"Return current row number in current frame."
|
||||
(if (fboundp 'window-edges)
|
||||
(+ (car (cdr (window-edges))) (count-lines (window-start) (point)))
|
||||
(count-lines (window-start) (point))))
|
||||
|
||||
(defun flymake-selected-frame ()
|
||||
"Return the frame that is now selected."
|
||||
(if (fboundp 'window-edges)
|
||||
(selected-frame)
|
||||
(selected-window)))
|
||||
|
||||
(defun flymake-get-point-pixel-pos ()
|
||||
"Return point position in pixels: (x, y)."
|
||||
(let ((mouse-pos (mouse-position))
|
||||
(pixel-pos nil)
|
||||
(ret nil))
|
||||
(if (car (cdr mouse-pos))
|
||||
(progn
|
||||
(set-mouse-position (flymake-selected-frame) (current-column) (flymake-current-row))
|
||||
(setq pixel-pos (mouse-pixel-position))
|
||||
(set-mouse-position (car mouse-pos) (car (cdr mouse-pos)) (cdr (cdr mouse-pos)))
|
||||
(setq ret (list (car (cdr pixel-pos)) (cdr (cdr pixel-pos)))))
|
||||
(progn
|
||||
(setq ret '(0 0))))
|
||||
(flymake-log 3 "mouse pos is %s" ret)
|
||||
ret))
|
||||
|
||||
) ;; End of (unless (fboundp 'posn-at-point)
|
||||
|
||||
;;;; ]]
|
||||
(defcustom flymake-start-syntax-check-on-find-file t
|
||||
"Start syntax check on find file."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom flymake-log-level -1
|
||||
"Logging level, only messages with level lower or equal will be logged.
|
||||
|
@ -225,55 +113,6 @@ See `x-popup-menu' for the menu specifier format."
|
|||
:group 'flymake
|
||||
:type 'integer)
|
||||
|
||||
|
||||
;; (defcustom flymake-log-file-name "~/flymake.log"
|
||||
;; "Where to put the flymake log if logging is enabled.
|
||||
;;
|
||||
;; See `flymake-log-level' if you want to control what is logged."
|
||||
;; :group 'flymake
|
||||
;; :type 'string)
|
||||
|
||||
(defun flymake-log (level text &rest args)
|
||||
"Log a message at level LEVEL.
|
||||
If LEVEL is higher than `flymake-log-level', the message is
|
||||
ignored. Otherwise, it is printed using `message'.
|
||||
TEXT is a format control string, and the remaining arguments ARGS
|
||||
are the string substitutions (see the function `format')."
|
||||
(if (<= level flymake-log-level)
|
||||
(let* ((msg (apply 'format text args)))
|
||||
(message "%s" msg)
|
||||
;;(with-temp-buffer
|
||||
;; (insert msg)
|
||||
;; (insert "\n")
|
||||
;; (flymake-save-buffer-in-file "~/flymake.log") ; make log file name customizable
|
||||
;;)
|
||||
)))
|
||||
|
||||
(defun flymake-ins-after (list pos val)
|
||||
"Insert VAL into LIST after position POS.
|
||||
POS counts from zero."
|
||||
(let ((tmp (copy-sequence list)))
|
||||
(setcdr (nthcdr pos tmp) (cons val (nthcdr (1+ pos) tmp)))
|
||||
tmp))
|
||||
|
||||
(defun flymake-set-at (list pos val)
|
||||
"Set VAL at position POS in LIST.
|
||||
POS counts from zero."
|
||||
(let ((tmp (copy-sequence list)))
|
||||
(setcar (nthcdr pos tmp) val)
|
||||
tmp))
|
||||
|
||||
(defvar flymake-processes nil
|
||||
"List of currently active flymake processes.")
|
||||
|
||||
(defvar flymake-output-residual nil)
|
||||
(make-variable-buffer-local 'flymake-output-residual)
|
||||
|
||||
(defgroup flymake nil
|
||||
"Universal on-the-fly syntax checker."
|
||||
:version "23.1"
|
||||
:group 'tools)
|
||||
|
||||
(defcustom flymake-xml-program
|
||||
(if (executable-find "xmlstarlet") "xmlstarlet" "xml")
|
||||
"Program to use for XML validation."
|
||||
|
@ -281,6 +120,16 @@ POS counts from zero."
|
|||
:group 'flymake
|
||||
:version "24.4")
|
||||
|
||||
(defcustom flymake-master-file-dirs '("." "./src" "./UnitTest")
|
||||
"Dirs where to look for master files."
|
||||
:group 'flymake
|
||||
:type '(repeat (string)))
|
||||
|
||||
(defcustom flymake-master-file-count-limit 32
|
||||
"Max number of master files to check."
|
||||
:group 'flymake
|
||||
:type 'integer)
|
||||
|
||||
(defcustom flymake-allowed-file-name-masks
|
||||
'(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
|
||||
("\\.xml\\'" flymake-xml-init)
|
||||
|
@ -322,6 +171,56 @@ NAME is the file name function to use, default `flymake-get-real-file-name'."
|
|||
(const :tag "flymake-get-real-file-name" nil)
|
||||
function))))
|
||||
|
||||
(defvar-local flymake-is-running nil
|
||||
"If t, flymake syntax check process is running for the current buffer.")
|
||||
|
||||
(defvar-local flymake-timer nil
|
||||
"Timer for starting syntax check.")
|
||||
|
||||
(defvar-local flymake-last-change-time nil
|
||||
"Time of last buffer change.")
|
||||
|
||||
(defvar-local flymake-check-start-time nil
|
||||
"Time at which syntax check was started.")
|
||||
|
||||
(defvar-local flymake-check-was-interrupted nil
|
||||
"Non-nil if syntax check was killed by `flymake-compile'.")
|
||||
|
||||
(defvar-local flymake-err-info nil
|
||||
"Sorted list of line numbers and lists of err info in the form (file, err-text).")
|
||||
|
||||
(defvar-local flymake-new-err-info nil
|
||||
"Same as `flymake-err-info', effective when a syntax check is in progress.")
|
||||
|
||||
(defun flymake-log (level text &rest args)
|
||||
"Log a message at level LEVEL.
|
||||
If LEVEL is higher than `flymake-log-level', the message is
|
||||
ignored. Otherwise, it is printed using `message'.
|
||||
TEXT is a format control string, and the remaining arguments ARGS
|
||||
are the string substitutions (see the function `format')."
|
||||
(if (<= level flymake-log-level)
|
||||
(let* ((msg (apply 'format text args)))
|
||||
(message "%s" msg))))
|
||||
|
||||
(defun flymake-ins-after (list pos val)
|
||||
"Insert VAL into LIST after position POS.
|
||||
POS counts from zero."
|
||||
(let ((tmp (copy-sequence list)))
|
||||
(setcdr (nthcdr pos tmp) (cons val (nthcdr (1+ pos) tmp)))
|
||||
tmp))
|
||||
|
||||
(defun flymake-set-at (list pos val)
|
||||
"Set VAL at position POS in LIST.
|
||||
POS counts from zero."
|
||||
(let ((tmp (copy-sequence list)))
|
||||
(setcar (nthcdr pos tmp) val)
|
||||
tmp))
|
||||
|
||||
(defvar flymake-processes nil
|
||||
"List of currently active flymake processes.")
|
||||
|
||||
(defvar-local flymake-output-residual nil)
|
||||
|
||||
(defun flymake-get-file-name-mode-and-masks (file-name)
|
||||
"Return the corresponding entry from `flymake-allowed-file-name-masks'."
|
||||
(unless (stringp file-name)
|
||||
|
@ -356,7 +255,7 @@ Return nil if we cannot, non-nil if we can."
|
|||
(or (nth 2 (flymake-get-file-name-mode-and-masks file-name))
|
||||
'flymake-get-real-file-name))
|
||||
|
||||
(defvar flymake-find-buildfile-cache (flymake-makehash 'equal))
|
||||
(defvar flymake-find-buildfile-cache (make-hash-table :test #'equal))
|
||||
|
||||
(defun flymake-get-buildfile-from-cache (dir-name)
|
||||
"Look up DIR-NAME in cache and return its associated value.
|
||||
|
@ -400,16 +299,6 @@ Return t if so, nil if not."
|
|||
(equal (flymake-fix-file-name file-name-one)
|
||||
(flymake-fix-file-name file-name-two)))
|
||||
|
||||
(defcustom flymake-master-file-dirs '("." "./src" "./UnitTest")
|
||||
"Dirs where to look for master files."
|
||||
:group 'flymake
|
||||
:type '(repeat (string)))
|
||||
|
||||
(defcustom flymake-master-file-count-limit 32
|
||||
"Max number of master files to check."
|
||||
:group 'flymake
|
||||
:type 'integer)
|
||||
|
||||
;; This is bound dynamically to pass a parameter to a sort predicate below
|
||||
(defvar flymake-included-file-name)
|
||||
|
||||
|
@ -456,12 +345,9 @@ to the beginning of the list (File.h -> File.cpp moved to top)."
|
|||
(file-name-base file-one))
|
||||
(not (equal file-one file-two))))
|
||||
|
||||
(defcustom flymake-check-file-limit 8192
|
||||
(defvar flymake-check-file-limit 8192
|
||||
"Maximum number of chars to look at when checking possible master file.
|
||||
Nil means search the entire file."
|
||||
:group 'flymake
|
||||
:type '(choice (const :tag "No limit" nil)
|
||||
(integer :tag "Characters")))
|
||||
Nil means search the entire file.")
|
||||
|
||||
(defun flymake-check-patch-master-file-buffer
|
||||
(master-file-temp-buffer
|
||||
|
@ -537,6 +423,7 @@ instead of reading master file from disk."
|
|||
(flymake-log 2 "found master file %s" master-file-name))
|
||||
found))
|
||||
|
||||
;;; XXX: remove
|
||||
(defun flymake-replace-region (beg end rep)
|
||||
"Replace text in BUFFER in region (BEG END) with REP."
|
||||
(save-excursion
|
||||
|
@ -622,16 +509,6 @@ Create parent directories as needed."
|
|||
(write-region nil nil file-name nil 566)
|
||||
(flymake-log 3 "saved buffer %s in file %s" (buffer-name) file-name))
|
||||
|
||||
(defun flymake-save-string-to-file (file-name data)
|
||||
"Save string DATA to file FILE-NAME."
|
||||
(write-region data nil file-name nil 566))
|
||||
|
||||
(defun flymake-read-file-to-string (file-name)
|
||||
"Read contents of file FILE-NAME and return as a string."
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file-name)
|
||||
(buffer-substring (point-min) (point-max))))
|
||||
|
||||
(defun flymake-process-filter (process output)
|
||||
"Parse OUTPUT and highlight error lines.
|
||||
It's flymake process filter."
|
||||
|
@ -681,7 +558,7 @@ It's flymake process filter."
|
|||
(setq flymake-new-err-info nil)
|
||||
(setq flymake-err-info
|
||||
(flymake-fix-line-numbers
|
||||
flymake-err-info 1 (flymake-count-lines)))
|
||||
flymake-err-info 1 (count-lines (point-min) (point-max))))
|
||||
(flymake-delete-own-overlays)
|
||||
(flymake-highlight-err-lines flymake-err-info)
|
||||
(let (err-count warn-count)
|
||||
|
@ -689,7 +566,7 @@ It's flymake process filter."
|
|||
(setq warn-count (flymake-get-err-count flymake-err-info "w"))
|
||||
(flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)"
|
||||
(buffer-name) err-count warn-count
|
||||
(- (flymake-float-time) flymake-check-start-time))
|
||||
(- (float-time) flymake-check-start-time))
|
||||
(setq flymake-check-start-time nil)
|
||||
|
||||
(if (and (equal 0 err-count) (equal 0 warn-count))
|
||||
|
@ -810,47 +687,7 @@ line number outside the file being compiled."
|
|||
"Determine whether overlay OV was created by flymake."
|
||||
(and (overlayp ov) (overlay-get ov 'flymake-overlay)))
|
||||
|
||||
(defcustom flymake-error-bitmap '(exclamation-mark error)
|
||||
"Bitmap (a symbol) used in the fringe for indicating errors.
|
||||
The value may also be a list of two elements where the second
|
||||
element specifies the face for the bitmap. For possible bitmap
|
||||
symbols, see `fringe-bitmaps'. See also `flymake-warning-bitmap'.
|
||||
|
||||
The option `flymake-fringe-indicator-position' controls how and where
|
||||
this is used."
|
||||
:group 'flymake
|
||||
:version "24.3"
|
||||
:type '(choice (symbol :tag "Bitmap")
|
||||
(list :tag "Bitmap and face"
|
||||
(symbol :tag "Bitmap")
|
||||
(face :tag "Face"))))
|
||||
|
||||
(defcustom flymake-warning-bitmap 'question-mark
|
||||
"Bitmap (a symbol) used in the fringe for indicating warnings.
|
||||
The value may also be a list of two elements where the second
|
||||
element specifies the face for the bitmap. For possible bitmap
|
||||
symbols, see `fringe-bitmaps'. See also `flymake-error-bitmap'.
|
||||
|
||||
The option `flymake-fringe-indicator-position' controls how and where
|
||||
this is used."
|
||||
:group 'flymake
|
||||
:version "24.3"
|
||||
:type '(choice (symbol :tag "Bitmap")
|
||||
(list :tag "Bitmap and face"
|
||||
(symbol :tag "Bitmap")
|
||||
(face :tag "Face"))))
|
||||
|
||||
(defcustom flymake-fringe-indicator-position 'left-fringe
|
||||
"The position to put flymake fringe indicator.
|
||||
The value can be nil (do not use indicators), `left-fringe' or `right-fringe'.
|
||||
See `flymake-error-bitmap' and `flymake-warning-bitmap'."
|
||||
:group 'flymake
|
||||
:version "24.3"
|
||||
:type '(choice (const left-fringe)
|
||||
(const right-fringe)
|
||||
(const :tag "No fringe indicators" nil)))
|
||||
|
||||
(defun flymake-make-overlay (beg end tooltip-text face bitmap mouse-face)
|
||||
(defun flymake-make-overlay (beg end tooltip-text face bitmap)
|
||||
"Allocate a flymake overlay in range BEG and END."
|
||||
(when (not (flymake-region-has-flymake-overlays beg end))
|
||||
(let ((ov (make-overlay beg end nil t t))
|
||||
|
@ -861,7 +698,6 @@ See `flymake-error-bitmap' and `flymake-warning-bitmap'."
|
|||
bitmap
|
||||
(list bitmap)))))))
|
||||
(overlay-put ov 'face face)
|
||||
(overlay-put ov 'mouse-face mouse-face)
|
||||
(overlay-put ov 'help-echo tooltip-text)
|
||||
(overlay-put ov 'flymake-overlay t)
|
||||
(overlay-put ov 'priority 100)
|
||||
|
@ -913,42 +749,19 @@ Return t if it has at least one flymake overlay, nil if no overlay."
|
|||
Perhaps use text from LINE-ERR-INFO-LIST to enhance highlighting."
|
||||
(goto-char (point-min))
|
||||
(forward-line (1- line-no))
|
||||
(let* ((line-beg (point-at-bol))
|
||||
(line-end (point-at-eol))
|
||||
(beg line-beg)
|
||||
(end line-end)
|
||||
(tooltip-text (flymake-ler-text (nth 0 line-err-info-list)))
|
||||
(face nil)
|
||||
(bitmap nil))
|
||||
|
||||
(goto-char line-beg)
|
||||
(while (looking-at "[ \t]")
|
||||
(forward-char))
|
||||
|
||||
(setq beg (point))
|
||||
|
||||
(goto-char line-end)
|
||||
(while (and (looking-at "[ \t\r\n]") (> (point) 1))
|
||||
(backward-char))
|
||||
|
||||
(setq end (1+ (point)))
|
||||
|
||||
(when (<= end beg)
|
||||
(setq beg line-beg)
|
||||
(setq end line-end))
|
||||
|
||||
(when (= end beg)
|
||||
(goto-char end)
|
||||
(forward-line)
|
||||
(setq end (point)))
|
||||
|
||||
(if (> (flymake-get-line-err-count line-err-info-list "e") 0)
|
||||
(setq face 'flymake-errline
|
||||
bitmap flymake-error-bitmap)
|
||||
(setq face 'flymake-warnline
|
||||
bitmap flymake-warning-bitmap))
|
||||
|
||||
(flymake-make-overlay beg end tooltip-text face bitmap nil)))
|
||||
(pcase-let* ((beg (progn (back-to-indentation) (point)))
|
||||
(end (progn
|
||||
(end-of-line)
|
||||
(skip-chars-backward " \t\f\t\n" beg)
|
||||
(if (eq (point) beg)
|
||||
(line-beginning-position 2)
|
||||
(point))))
|
||||
(tooltip-text (mapconcat #'flymake-ler-text line-err-info-list "\n"))
|
||||
(`(,face ,bitmap)
|
||||
(if (> (flymake-get-line-err-count line-err-info-list "e") 0)
|
||||
(list 'flymake-errline flymake-error-bitmap)
|
||||
(list 'flymake-warnline flymake-warning-bitmap))))
|
||||
(flymake-make-overlay beg end tooltip-text face bitmap)))
|
||||
|
||||
(defun flymake-parse-err-lines (err-info-list lines)
|
||||
"Parse err LINES, store info in ERR-INFO-LIST."
|
||||
|
@ -978,7 +791,7 @@ Perhaps use text from LINE-ERR-INFO-LIST to enhance highlighting."
|
|||
Return last one as residual if it does not end with newline char.
|
||||
Returns ((LINES) RESIDUAL)."
|
||||
(when (and output (> (length output) 0))
|
||||
(let* ((lines (flymake-split-string output "[\n\r]+"))
|
||||
(let* ((lines (split-string output "[\n\r]+" t))
|
||||
(complete (equal "\n" (char-to-string (aref output (1- (length output))))))
|
||||
(residual nil))
|
||||
(when (not complete)
|
||||
|
@ -1036,19 +849,6 @@ Convert it to flymake internal format."
|
|||
Use `flymake-reformat-err-line-patterns-from-compile-el' to add patterns
|
||||
from compile.el")
|
||||
|
||||
;;(defcustom flymake-err-line-patterns
|
||||
;; '(
|
||||
;; ; MS Visual C++ 6.0
|
||||
;; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
|
||||
;; 1 3 4)
|
||||
;; ; jikes
|
||||
;; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\):[ \t\n]*\\(.+\\)\\)"
|
||||
;; 1 3 4))
|
||||
;; "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)"
|
||||
;; :group 'flymake
|
||||
;; :type '(repeat (string number number number))
|
||||
;;)
|
||||
|
||||
(define-obsolete-variable-alias 'flymake-warning-re 'flymake-warning-predicate "24.4")
|
||||
(defvar flymake-warning-predicate "^[wW]arning"
|
||||
"Predicate matching against error text to detect a warning.
|
||||
|
@ -1163,26 +963,24 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
(shell-quote-argument basedir)
|
||||
" DUMPVARS=INCLUDE_DIRS dumpvars"))
|
||||
(output (shell-command-to-string command-line))
|
||||
(lines (flymake-split-string output "\n"))
|
||||
(lines (split-string output "\n" t))
|
||||
(count (length lines))
|
||||
(idx 0)
|
||||
(inc-dirs nil))
|
||||
(while (and (< idx count) (not (string-match "^INCLUDE_DIRS=.*" (nth idx lines))))
|
||||
(setq idx (1+ idx)))
|
||||
(when (< idx count)
|
||||
(let* ((inc-lines (flymake-split-string (nth idx lines) " *-I"))
|
||||
(let* ((inc-lines (split-string (nth idx lines) " *-I" t))
|
||||
(inc-count (length inc-lines)))
|
||||
(while (> inc-count 0)
|
||||
(when (not (string-match "^INCLUDE_DIRS=.*" (nth (1- inc-count) inc-lines)))
|
||||
(push (flymake-replace-regexp-in-string "\"" "" (nth (1- inc-count) inc-lines)) inc-dirs))
|
||||
(push (replace-regexp-in-string "\"" "" (nth (1- inc-count) inc-lines)) inc-dirs))
|
||||
(setq inc-count (1- inc-count)))))
|
||||
(flymake-add-project-include-dirs-to-cache basedir inc-dirs)
|
||||
inc-dirs)))
|
||||
|
||||
(defcustom flymake-get-project-include-dirs-function 'flymake-get-project-include-dirs-imp
|
||||
"Function used to get project include dirs, one parameter: basedir name."
|
||||
:group 'flymake
|
||||
:type 'function)
|
||||
(defvar flymake-get-project-include-dirs-function #'flymake-get-project-include-dirs-imp
|
||||
"Function used to get project include dirs, one parameter: basedir name.")
|
||||
|
||||
(defun flymake-get-project-include-dirs (basedir)
|
||||
(funcall flymake-get-project-include-dirs-function basedir))
|
||||
|
@ -1190,9 +988,9 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
(defun flymake-get-system-include-dirs ()
|
||||
"System include dirs - from the 'INCLUDE' env setting."
|
||||
(let* ((includes (getenv "INCLUDE")))
|
||||
(if includes (flymake-split-string includes path-separator) nil)))
|
||||
(if includes (split-string includes path-separator t) nil)))
|
||||
|
||||
(defvar flymake-project-include-dirs-cache (flymake-makehash 'equal))
|
||||
(defvar flymake-project-include-dirs-cache (make-hash-table :test #'equal))
|
||||
|
||||
(defun flymake-get-project-include-dirs-from-cache (base-dir)
|
||||
(gethash base-dir flymake-project-include-dirs-cache))
|
||||
|
@ -1232,11 +1030,6 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
(error
|
||||
(flymake-log 1 "Failed to delete dir %s, error ignored" dir-name))))
|
||||
|
||||
(defcustom flymake-compilation-prevents-syntax-check t
|
||||
"If non-nil, don't start syntax check if compilation is running."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
(defun flymake-start-syntax-check ()
|
||||
"Start syntax checking for current buffer."
|
||||
(interactive)
|
||||
|
@ -1280,7 +1073,7 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
|
||||
(setq flymake-is-running t)
|
||||
(setq flymake-last-change-time nil)
|
||||
(setq flymake-check-start-time (flymake-float-time))
|
||||
(setq flymake-check-start-time (float-time))
|
||||
|
||||
(flymake-report-status nil "*")
|
||||
(flymake-log 2 "started process %d, command=%s, dir=%s"
|
||||
|
@ -1321,71 +1114,49 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
(flymake-stop-all-syntax-checks)
|
||||
(call-interactively 'compile))
|
||||
|
||||
(defcustom flymake-no-changes-timeout 0.5
|
||||
"Time to wait after last change before starting compilation."
|
||||
:group 'flymake
|
||||
:type 'number)
|
||||
|
||||
(defun flymake-on-timer-event (buffer)
|
||||
"Start a syntax check for buffer BUFFER if necessary."
|
||||
(when (buffer-live-p buffer)
|
||||
(with-current-buffer buffer
|
||||
(when (and (not flymake-is-running)
|
||||
flymake-last-change-time
|
||||
(> (- (flymake-float-time) flymake-last-change-time)
|
||||
(> (- (float-time) flymake-last-change-time)
|
||||
flymake-no-changes-timeout))
|
||||
|
||||
(setq flymake-last-change-time nil)
|
||||
(flymake-log 3 "starting syntax check as more than 1 second passed since last change")
|
||||
(flymake-start-syntax-check)))))
|
||||
|
||||
(defun flymake-current-line-no ()
|
||||
"Return number of current line in current buffer."
|
||||
(count-lines (point-min) (if (eobp) (point) (1+ (point)))))
|
||||
(define-obsolete-function-alias 'flymake-display-err-menu-for-current-line
|
||||
'flymake-popup-current-error-menu "24.4")
|
||||
|
||||
(defun flymake-count-lines ()
|
||||
"Return number of lines in buffer BUFFER."
|
||||
(count-lines (point-min) (point-max)))
|
||||
|
||||
(defun flymake-display-err-menu-for-current-line ()
|
||||
"Display a menu with errors/warnings for current line if it has errors and/or warnings."
|
||||
(interactive)
|
||||
(let* ((line-no (flymake-current-line-no))
|
||||
(line-err-info-list (nth 0 (flymake-find-err-info flymake-err-info line-no)))
|
||||
(menu-data (flymake-make-err-menu-data line-no line-err-info-list))
|
||||
(choice nil))
|
||||
(if menu-data
|
||||
(progn
|
||||
(setq choice (flymake-popup-menu menu-data))
|
||||
(flymake-log 3 "choice=%s" choice)
|
||||
(when choice
|
||||
(eval choice)))
|
||||
(flymake-log 1 "no errors for line %d" line-no))))
|
||||
|
||||
(defun flymake-make-err-menu-data (line-no line-err-info-list)
|
||||
"Make a (menu-title (item-title item-action)*) list with errors/warnings from LINE-ERR-INFO-LIST."
|
||||
(let* ((menu-items nil))
|
||||
(when line-err-info-list
|
||||
(let* ((count (length line-err-info-list))
|
||||
(menu-item-text nil))
|
||||
(while (> count 0)
|
||||
(setq menu-item-text (flymake-ler-text (nth (1- count) line-err-info-list)))
|
||||
(let* ((file (flymake-ler-file (nth (1- count) line-err-info-list)))
|
||||
(full-file (flymake-ler-full-file (nth (1- count) line-err-info-list)))
|
||||
(line (flymake-ler-line (nth (1- count) line-err-info-list))))
|
||||
(if file
|
||||
(setq menu-item-text (concat menu-item-text " - " file "(" (format "%d" line) ")")))
|
||||
(setq menu-items (cons (list menu-item-text
|
||||
(if file (list 'flymake-goto-file-and-line full-file line) nil))
|
||||
menu-items)))
|
||||
(setq count (1- count)))
|
||||
(flymake-log 3 "created menu-items with %d item(s)" (length menu-items))))
|
||||
(if menu-items
|
||||
(let* ((menu-title (format "Line %d: %d error(s), %d warning(s)" line-no
|
||||
(flymake-get-line-err-count line-err-info-list "e")
|
||||
(flymake-get-line-err-count line-err-info-list "w"))))
|
||||
(list menu-title menu-items))
|
||||
nil)))
|
||||
(defun flymake-popup-current-error-menu (&optional event)
|
||||
"Pop up a menu with errors/warnings for current line."
|
||||
(interactive (list last-nonmenu-event))
|
||||
(let* ((line-no (line-number-at-pos))
|
||||
(errors (or (car (flymake-find-err-info flymake-err-info line-no))
|
||||
(user-error "No errors for current line")))
|
||||
(menu (mapcar (lambda (x)
|
||||
(if (flymake-ler-file x)
|
||||
(cons (format "%s - %s(%d)"
|
||||
(flymake-ler-text x)
|
||||
(flymake-ler-file x)
|
||||
(flymake-ler-line x))
|
||||
x)
|
||||
(list (flymake-ler-text x))))
|
||||
errors))
|
||||
(event (if (mouse-event-p event)
|
||||
event
|
||||
(list 'mouse-1 (posn-at-point))))
|
||||
(title (format "Line %d: %d error(s), %d warning(s)"
|
||||
line-no
|
||||
(flymake-get-line-err-count errors "e")
|
||||
(flymake-get-line-err-count errors "w")))
|
||||
(choice (x-popup-menu event (list title (cons "" menu)))))
|
||||
(flymake-log 3 "choice=%s" choice)
|
||||
(when choice
|
||||
(flymake-goto-file-and-line (flymake-ler-full-file choice)
|
||||
(flymake-ler-line choice)))))
|
||||
|
||||
(defun flymake-goto-file-and-line (file line)
|
||||
"Try to get buffer for FILE and goto line LINE in it."
|
||||
|
@ -1396,17 +1167,9 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
(forward-line (1- line))))
|
||||
|
||||
;; flymake minor mode declarations
|
||||
(defvar flymake-mode-line nil)
|
||||
|
||||
(make-variable-buffer-local 'flymake-mode-line)
|
||||
|
||||
(defvar flymake-mode-line-e-w nil)
|
||||
|
||||
(make-variable-buffer-local 'flymake-mode-line-e-w)
|
||||
|
||||
(defvar flymake-mode-line-status nil)
|
||||
|
||||
(make-variable-buffer-local 'flymake-mode-line-status)
|
||||
(defvar-local flymake-mode-line nil)
|
||||
(defvar-local flymake-mode-line-e-w nil)
|
||||
(defvar-local flymake-mode-line-status nil)
|
||||
|
||||
(defun flymake-report-status (e-w &optional status)
|
||||
"Show status in mode line."
|
||||
|
@ -1425,11 +1188,6 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
"Display a warning to user."
|
||||
(message-box warning))
|
||||
|
||||
(defcustom flymake-gui-warnings-enabled t
|
||||
"Enables/disables GUI warnings."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
(defun flymake-report-fatal-status (status warning)
|
||||
"Display a warning and switch flymake mode off."
|
||||
(when flymake-gui-warnings-enabled
|
||||
|
@ -1439,17 +1197,8 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
|
|||
(flymake-log 0 "switched OFF Flymake mode for buffer %s due to fatal status %s, warning %s"
|
||||
(buffer-name) status warning))
|
||||
|
||||
(defcustom flymake-start-syntax-check-on-find-file t
|
||||
"Start syntax check on find file."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode flymake-mode
|
||||
"Toggle on-the-fly syntax checking.
|
||||
With a prefix argument ARG, enable the mode if ARG is positive,
|
||||
and disable it otherwise. If called from Lisp, enable the mode
|
||||
if ARG is omitted or nil."
|
||||
(define-minor-mode flymake-mode nil
|
||||
:group 'flymake :lighter flymake-mode-line
|
||||
(cond
|
||||
|
||||
|
@ -1505,19 +1254,14 @@ if ARG is omitted or nil."
|
|||
(flymake-mode 0)
|
||||
(flymake-log 1 "flymake mode turned OFF for buffer %s" (buffer-name)))
|
||||
|
||||
(defcustom flymake-start-syntax-check-on-newline t
|
||||
"Start syntax check if newline char was added/removed from the buffer."
|
||||
:group 'flymake
|
||||
:type 'boolean)
|
||||
|
||||
(defun flymake-after-change-function (start stop _len)
|
||||
"Start syntax check for current buffer if it isn't already running."
|
||||
;;+(flymake-log 0 "setting change time to %s" (flymake-float-time))
|
||||
;;+(flymake-log 0 "setting change time to %s" (float-time))
|
||||
(let((new-text (buffer-substring start stop)))
|
||||
(when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
|
||||
(flymake-log 3 "starting syntax check as new-line has been seen")
|
||||
(flymake-start-syntax-check))
|
||||
(setq flymake-last-change-time (flymake-float-time))))
|
||||
(setq flymake-last-change-time (float-time))))
|
||||
|
||||
(defun flymake-after-save-hook ()
|
||||
(if (local-variable-p 'flymake-mode (current-buffer)) ; (???) other way to determine whether flymake is active in buffer being saved?
|
||||
|
@ -1584,7 +1328,7 @@ if ARG is omitted or nil."
|
|||
(defun flymake-goto-next-error ()
|
||||
"Go to next error in err ring."
|
||||
(interactive)
|
||||
(let ((line-no (flymake-get-next-err-line-no flymake-err-info (flymake-current-line-no))))
|
||||
(let ((line-no (flymake-get-next-err-line-no flymake-err-info (line-number-at-pos))))
|
||||
(when (not line-no)
|
||||
(setq line-no (flymake-get-first-err-line-no flymake-err-info))
|
||||
(flymake-log 1 "passed end of file"))
|
||||
|
@ -1595,7 +1339,7 @@ if ARG is omitted or nil."
|
|||
(defun flymake-goto-prev-error ()
|
||||
"Go to previous error in err ring."
|
||||
(interactive)
|
||||
(let ((line-no (flymake-get-prev-err-line-no flymake-err-info (flymake-current-line-no))))
|
||||
(let ((line-no (flymake-get-prev-err-line-no flymake-err-info (line-number-at-pos))))
|
||||
(when (not line-no)
|
||||
(setq line-no (flymake-get-last-err-line-no flymake-err-info))
|
||||
(flymake-log 1 "passed beginning of file"))
|
||||
|
@ -1631,14 +1375,14 @@ if ARG is omitted or nil."
|
|||
;; trying to remove the leading / of absolute file names.
|
||||
(slash-pos (string-match "/" dir))
|
||||
(temp-dir (expand-file-name (substring dir (1+ slash-pos))
|
||||
(flymake-get-temp-dir))))
|
||||
temporary-file-directory)))
|
||||
|
||||
(file-truename (expand-file-name (file-name-nondirectory file-name)
|
||||
temp-dir))))
|
||||
|
||||
(defun flymake-delete-temp-directory (dir-name)
|
||||
"Attempt to delete temp dir created by `flymake-create-temp-with-folder-structure', do not fail on error."
|
||||
(let* ((temp-dir (flymake-get-temp-dir))
|
||||
(let* ((temp-dir temporary-file-directory)
|
||||
(suffix (substring dir-name (1+ (length temp-dir)))))
|
||||
|
||||
(while (> (length suffix) 0)
|
||||
|
@ -1648,17 +1392,10 @@ if ARG is omitted or nil."
|
|||
(file-truename (expand-file-name suffix temp-dir)))
|
||||
(setq suffix (file-name-directory suffix)))))
|
||||
|
||||
(defvar flymake-temp-source-file-name nil)
|
||||
(make-variable-buffer-local 'flymake-temp-source-file-name)
|
||||
|
||||
(defvar flymake-master-file-name nil)
|
||||
(make-variable-buffer-local 'flymake-master-file-name)
|
||||
|
||||
(defvar flymake-temp-master-file-name nil)
|
||||
(make-variable-buffer-local 'flymake-temp-master-file-name)
|
||||
|
||||
(defvar flymake-base-dir nil)
|
||||
(make-variable-buffer-local 'flymake-base-dir)
|
||||
(defvar-local flymake-temp-source-file-name nil)
|
||||
(defvar-local flymake-master-file-name nil)
|
||||
(defvar-local flymake-temp-master-file-name nil)
|
||||
(defvar-local flymake-base-dir nil)
|
||||
|
||||
(defun flymake-init-create-temp-buffer-copy (create-temp-f)
|
||||
"Make a temporary copy of the current buffer, save its name in buffer data and return the name."
|
||||
|
@ -1899,5 +1636,4 @@ Use CREATE-TEMP-F for creating temp copy."
|
|||
'flymake-create-temp-inplace))))
|
||||
|
||||
(provide 'flymake)
|
||||
|
||||
;;; flymake.el ends here
|
||||
|
|
|
@ -459,12 +459,13 @@ The value must be no less than minus `js-indent-level'."
|
|||
:group 'js
|
||||
:version "24.1")
|
||||
|
||||
(defcustom js-auto-indent-flag t
|
||||
"Whether to automatically indent when typing punctuation characters.
|
||||
If non-nil, the characters {}();,: also indent the current line
|
||||
in Javascript mode."
|
||||
:type 'boolean
|
||||
:group 'js)
|
||||
(defcustom js-switch-indent-offset 0
|
||||
"Number of additional spaces for indenting the contents of a switch block.
|
||||
The value must not be negative."
|
||||
:type 'integer
|
||||
:safe 'integerp
|
||||
:group 'js
|
||||
:version "24.4")
|
||||
|
||||
(defcustom js-flat-functions nil
|
||||
"Treat nested functions as top-level functions in `js-mode'.
|
||||
|
@ -1766,6 +1767,10 @@ nil."
|
|||
(list (cons 'c js-comment-lineup-func))))
|
||||
(c-get-syntactic-indentation (list (cons symbol anchor)))))
|
||||
|
||||
(defun js--same-line (pos)
|
||||
(and (>= pos (point-at-bol))
|
||||
(<= pos (point-at-eol))))
|
||||
|
||||
(defun js--multi-line-declaration-indentation ()
|
||||
"Helper function for `js--proper-indentation'.
|
||||
Return the proper indentation of the current line if it belongs to a declaration
|
||||
|
@ -1788,8 +1793,7 @@ statement spanning multiple lines; otherwise, return nil."
|
|||
(looking-at js--indent-operator-re)
|
||||
(js--backward-syntactic-ws))
|
||||
(not (eq (char-before) ?\;)))
|
||||
(and (>= pos (point-at-bol))
|
||||
(<= pos (point-at-eol)))))))
|
||||
(js--same-line pos)))))
|
||||
(condition-case nil
|
||||
(backward-sexp)
|
||||
(scan-error (setq at-opening-bracket t))))
|
||||
|
@ -1797,23 +1801,68 @@ statement spanning multiple lines; otherwise, return nil."
|
|||
(goto-char (match-end 0))
|
||||
(1+ (current-column)))))))
|
||||
|
||||
(defun js--indent-in-array-comp (bracket)
|
||||
"Return non-nil if we think we're in an array comprehension.
|
||||
In particular, return the buffer position of the first `for' kwd."
|
||||
(let ((end (point)))
|
||||
(save-excursion
|
||||
(goto-char bracket)
|
||||
(when (looking-at "\\[")
|
||||
(forward-char 1)
|
||||
(js--forward-syntactic-ws)
|
||||
(if (looking-at "[[{]")
|
||||
(let (forward-sexp-function) ; Use Lisp version.
|
||||
(forward-sexp) ; Skip destructuring form.
|
||||
(js--forward-syntactic-ws)
|
||||
(if (and (/= (char-after) ?,) ; Regular array.
|
||||
(looking-at "for"))
|
||||
(match-beginning 0)))
|
||||
;; To skip arbitrary expressions we need the parser,
|
||||
;; so we'll just guess at it.
|
||||
(if (and (> end (point)) ; Not empty literal.
|
||||
(re-search-forward "[^,]]* \\(for\\) " end t)
|
||||
;; Not inside comment or string literal.
|
||||
(not (nth 8 (parse-partial-sexp bracket (point)))))
|
||||
(match-beginning 1)))))))
|
||||
|
||||
(defun js--array-comp-indentation (bracket for-kwd)
|
||||
(if (js--same-line for-kwd)
|
||||
;; First continuation line.
|
||||
(save-excursion
|
||||
(goto-char bracket)
|
||||
(forward-char 1)
|
||||
(skip-chars-forward " \t")
|
||||
(current-column))
|
||||
(save-excursion
|
||||
(goto-char for-kwd)
|
||||
(current-column))))
|
||||
|
||||
(defun js--proper-indentation (parse-status)
|
||||
"Return the proper indentation for the current line."
|
||||
(save-excursion
|
||||
(back-to-indentation)
|
||||
(cond ((nth 4 parse-status)
|
||||
(cond ((nth 4 parse-status) ; inside comment
|
||||
(js--get-c-offset 'c (nth 8 parse-status)))
|
||||
((nth 8 parse-status) 0) ; inside string
|
||||
((js--ctrl-statement-indentation))
|
||||
((js--multi-line-declaration-indentation))
|
||||
((nth 3 parse-status) 0) ; inside string
|
||||
((eq (char-after) ?#) 0)
|
||||
((save-excursion (js--beginning-of-macro)) 4)
|
||||
;; Indent array comprehension continuation lines specially.
|
||||
((let ((bracket (nth 1 parse-status))
|
||||
beg)
|
||||
(and bracket
|
||||
(not (js--same-line bracket))
|
||||
(setq beg (js--indent-in-array-comp bracket))
|
||||
;; At or after the first loop?
|
||||
(>= (point) beg)
|
||||
(js--array-comp-indentation bracket beg))))
|
||||
((js--ctrl-statement-indentation))
|
||||
((js--multi-line-declaration-indentation))
|
||||
((nth 1 parse-status)
|
||||
;; A single closing paren/bracket should be indented at the
|
||||
;; same level as the opening statement. Same goes for
|
||||
;; "case" and "default".
|
||||
(let ((same-indent-p (looking-at
|
||||
"[]})]\\|\\_<case\\_>\\|\\_<default\\_>"))
|
||||
(let ((same-indent-p (looking-at "[]})]"))
|
||||
(switch-keyword-p (looking-at "default\\_>\\|case\\_>[^:]"))
|
||||
(continued-expr-p (js--continued-expression-p)))
|
||||
(goto-char (nth 1 parse-status)) ; go to the opening char
|
||||
(if (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
|
||||
|
@ -1821,17 +1870,26 @@ statement spanning multiple lines; otherwise, return nil."
|
|||
(skip-syntax-backward " ")
|
||||
(when (eq (char-before) ?\)) (backward-list))
|
||||
(back-to-indentation)
|
||||
(cond (same-indent-p
|
||||
(current-column))
|
||||
(continued-expr-p
|
||||
(+ (current-column) (* 2 js-indent-level)
|
||||
js-expr-indent-offset))
|
||||
(t
|
||||
(+ (current-column) js-indent-level
|
||||
(pcase (char-after (nth 1 parse-status))
|
||||
(?\( js-paren-indent-offset)
|
||||
(?\[ js-square-indent-offset)
|
||||
(?\{ js-curly-indent-offset))))))
|
||||
(let* ((in-switch-p (unless same-indent-p
|
||||
(looking-at "\\_<switch\\_>")))
|
||||
(same-indent-p (or same-indent-p
|
||||
(and switch-keyword-p
|
||||
in-switch-p)))
|
||||
(indent
|
||||
(cond (same-indent-p
|
||||
(current-column))
|
||||
(continued-expr-p
|
||||
(+ (current-column) (* 2 js-indent-level)
|
||||
js-expr-indent-offset))
|
||||
(t
|
||||
(+ (current-column) js-indent-level
|
||||
(pcase (char-after (nth 1 parse-status))
|
||||
(?\( js-paren-indent-offset)
|
||||
(?\[ js-square-indent-offset)
|
||||
(?\{ js-curly-indent-offset)))))))
|
||||
(if in-switch-p
|
||||
(+ indent js-switch-indent-offset)
|
||||
indent)))
|
||||
;; If there is something following the opening
|
||||
;; paren/bracket, everything else should be indented at
|
||||
;; the same level.
|
||||
|
|
|
@ -362,8 +362,8 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
|
|||
(and (memq (char-before)
|
||||
'(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\{ ?\\ ?& ?> ?< ?%
|
||||
?~ ?^))
|
||||
;; Make sure it's not the end of a regexp.
|
||||
(not (eq (car (syntax-after (1- (point)))) 7)))
|
||||
;; Not the end of a regexp or a percent literal.
|
||||
(not (memq (car (syntax-after (1- (point)))) '(7 15))))
|
||||
(and (eq (char-before) ?\?)
|
||||
(equal (save-excursion (ruby-smie--backward-token)) "?"))
|
||||
(and (eq (char-before) ?=)
|
||||
|
@ -614,11 +614,16 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
|
|||
(nreverse (ruby-imenu-create-index-in-block nil (point-min) nil)))
|
||||
|
||||
(defun ruby-accurate-end-of-block (&optional end)
|
||||
"TODO: document."
|
||||
"Jump to the end of the current block or END, whichever is closer."
|
||||
(let (state
|
||||
(end (or end (point-max))))
|
||||
(while (and (setq state (apply 'ruby-parse-partial end state))
|
||||
(>= (nth 2 state) 0) (< (point) end)))))
|
||||
(if ruby-use-smie
|
||||
(save-restriction
|
||||
(back-to-indentation)
|
||||
(narrow-to-region (point) end)
|
||||
(smie-forward-sexp))
|
||||
(while (and (setq state (apply 'ruby-parse-partial end state))
|
||||
(>= (nth 2 state) 0) (< (point) end))))))
|
||||
|
||||
(defun ruby-mode-variables ()
|
||||
"Set up initial buffer-local variables for Ruby mode."
|
||||
|
@ -790,11 +795,28 @@ Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'."
|
|||
(t nil)))))))))
|
||||
|
||||
(defun ruby-forward-string (term &optional end no-error expand)
|
||||
"TODO: document."
|
||||
"Move forward across one balanced pair of string delimiters.
|
||||
Skips escaped delimiters. If EXPAND is non-nil, also ignores
|
||||
delimiters in interpolated strings.
|
||||
|
||||
TERM should be a string containing either a single, self-matching
|
||||
delimiter (e.g. \"/\"), or a pair of matching delimiters with the
|
||||
close delimiter first (e.g. \"][\").
|
||||
|
||||
When non-nil, search is bounded by position END.
|
||||
|
||||
Throws an error if a balanced match is not found, unless NO-ERROR
|
||||
is non-nil, in which case nil will be returned.
|
||||
|
||||
This command assumes the character after point is an opening
|
||||
delimiter."
|
||||
(let ((n 1) (c (string-to-char term))
|
||||
(re (if expand
|
||||
(concat "[^\\]\\(\\\\\\\\\\)*\\([" term "]\\|\\(#{\\)\\)")
|
||||
(concat "[^\\]\\(\\\\\\\\\\)*[" term "]"))))
|
||||
(re (concat "[^\\]\\(\\\\\\\\\\)*\\("
|
||||
(if (string= term "^") ;[^] is not a valid regexp
|
||||
"\\^"
|
||||
(concat "[" term "]"))
|
||||
(when expand "\\|\\(#{\\)")
|
||||
"\\)")))
|
||||
(while (and (re-search-forward re end no-error)
|
||||
(if (match-beginning 3)
|
||||
(ruby-forward-string "}{" end no-error nil)
|
||||
|
|
134
lisp/rect.el
134
lisp/rect.el
|
@ -443,7 +443,9 @@ with a prefix argument, prompt for START-AT and FORMAT."
|
|||
Activates the region if needed. Only lasts until the region is deactivated."
|
||||
nil nil nil
|
||||
(when rectangle-mark-mode
|
||||
(unless (region-active-p) (push-mark-command t))))
|
||||
(unless (region-active-p)
|
||||
(push-mark)
|
||||
(activate-mark))))
|
||||
|
||||
(defun rectangle--extract-region (orig &optional delete)
|
||||
(if (not rectangle-mark-mode)
|
||||
|
@ -495,70 +497,72 @@ Activates the region if needed. Only lasts until the region is deactivated."
|
|||
(leftcol (min ptcol markcol))
|
||||
(rightcol (max ptcol markcol)))
|
||||
(goto-char start)
|
||||
(while (< (point) end)
|
||||
(let* ((mleft (move-to-column leftcol))
|
||||
(left (point))
|
||||
(mright (move-to-column rightcol))
|
||||
(right (point))
|
||||
(ol
|
||||
(if (not old)
|
||||
(let ((ol (make-overlay left right)))
|
||||
(overlay-put ol 'window window)
|
||||
(overlay-put ol 'face 'region)
|
||||
ol)
|
||||
(let ((ol (pop old)))
|
||||
(move-overlay ol left right (current-buffer))
|
||||
ol))))
|
||||
;; `move-to-column' may stop before the column (if bumping into
|
||||
;; EOL) or overshoot it a little, when column is in the middle
|
||||
;; of a char.
|
||||
(cond
|
||||
((< mleft leftcol) ;`leftcol' is past EOL.
|
||||
(overlay-put ol 'before-string
|
||||
(spaces-string (- leftcol mleft)))
|
||||
(setq mright (max mright leftcol)))
|
||||
((and (> mleft leftcol) ;`leftcol' is in the middle of a char.
|
||||
(eq (char-before left) ?\t))
|
||||
(setq left (1- left))
|
||||
(move-overlay ol left right)
|
||||
(goto-char left)
|
||||
(overlay-put ol 'before-string
|
||||
(spaces-string (- leftcol (current-column)))))
|
||||
((overlay-get ol 'before-string)
|
||||
(overlay-put ol 'before-string nil)))
|
||||
(cond
|
||||
((< mright rightcol) ;`rightcol' is past EOL.
|
||||
(let ((str (make-string (- rightcol mright) ?\s)))
|
||||
(put-text-property 0 (length str) 'face 'region str)
|
||||
;; If cursor happens to be here, draw it *before* rather than
|
||||
;; after this highlighted pseudo-text.
|
||||
(put-text-property 0 1 'cursor t str)
|
||||
(overlay-put ol 'after-string str)))
|
||||
((and (> mright rightcol) ;`rightcol' is in the middle of a char.
|
||||
(eq (char-before right) ?\t))
|
||||
(setq right (1- right))
|
||||
(move-overlay ol left right)
|
||||
(if (= rightcol leftcol)
|
||||
(overlay-put ol 'after-string nil)
|
||||
(goto-char right)
|
||||
(let ((str (make-string
|
||||
(- rightcol (max leftcol (current-column))) ?\s)))
|
||||
(put-text-property 0 (length str) 'face 'region str)
|
||||
(when (= left right)
|
||||
;; If cursor happens to be here, draw it *before* rather
|
||||
;; than after this highlighted pseudo-text.
|
||||
(put-text-property 0 1 'cursor 1 str))
|
||||
(overlay-put ol 'after-string str))))
|
||||
((overlay-get ol 'after-string)
|
||||
(overlay-put ol 'after-string nil)))
|
||||
(when (= leftcol rightcol)
|
||||
;; Make zero-width rectangles visible!
|
||||
(overlay-put ol 'after-string
|
||||
(concat (propertize " "
|
||||
'face '(region (:height 0.2)))
|
||||
(overlay-get ol 'after-string))))
|
||||
(push ol nrol))
|
||||
(forward-line 1))
|
||||
(while
|
||||
(let* ((mleft (move-to-column leftcol))
|
||||
(left (point))
|
||||
(mright (move-to-column rightcol))
|
||||
(right (point))
|
||||
(ol
|
||||
(if (not old)
|
||||
(let ((ol (make-overlay left right)))
|
||||
(overlay-put ol 'window window)
|
||||
(overlay-put ol 'face 'region)
|
||||
ol)
|
||||
(let ((ol (pop old)))
|
||||
(move-overlay ol left right (current-buffer))
|
||||
ol))))
|
||||
;; `move-to-column' may stop before the column (if bumping into
|
||||
;; EOL) or overshoot it a little, when column is in the middle
|
||||
;; of a char.
|
||||
(cond
|
||||
((< mleft leftcol) ;`leftcol' is past EOL.
|
||||
(overlay-put ol 'before-string
|
||||
(spaces-string (- leftcol mleft)))
|
||||
(setq mright (max mright leftcol)))
|
||||
((and (> mleft leftcol) ;`leftcol' is in the middle of a char.
|
||||
(eq (char-before left) ?\t))
|
||||
(setq left (1- left))
|
||||
(move-overlay ol left right)
|
||||
(goto-char left)
|
||||
(overlay-put ol 'before-string
|
||||
(spaces-string (- leftcol (current-column)))))
|
||||
((overlay-get ol 'before-string)
|
||||
(overlay-put ol 'before-string nil)))
|
||||
(cond
|
||||
((< mright rightcol) ;`rightcol' is past EOL.
|
||||
(let ((str (make-string (- rightcol mright) ?\s)))
|
||||
(put-text-property 0 (length str) 'face 'region str)
|
||||
;; If cursor happens to be here, draw it *before* rather than
|
||||
;; after this highlighted pseudo-text.
|
||||
(put-text-property 0 1 'cursor t str)
|
||||
(overlay-put ol 'after-string str)))
|
||||
((and (> mright rightcol) ;`rightcol's in the middle of a char.
|
||||
(eq (char-before right) ?\t))
|
||||
(setq right (1- right))
|
||||
(move-overlay ol left right)
|
||||
(if (= rightcol leftcol)
|
||||
(overlay-put ol 'after-string nil)
|
||||
(goto-char right)
|
||||
(let ((str (make-string
|
||||
(- rightcol (max leftcol (current-column)))
|
||||
?\s)))
|
||||
(put-text-property 0 (length str) 'face 'region str)
|
||||
(when (= left right)
|
||||
;; If cursor happens to be here, draw it *before* rather
|
||||
;; than after this highlighted pseudo-text.
|
||||
(put-text-property 0 1 'cursor 1 str))
|
||||
(overlay-put ol 'after-string str))))
|
||||
((overlay-get ol 'after-string)
|
||||
(overlay-put ol 'after-string nil)))
|
||||
(when (= leftcol rightcol)
|
||||
;; Make zero-width rectangles visible!
|
||||
(overlay-put ol 'after-string
|
||||
(concat (propertize " "
|
||||
'face '(region (:height 0.2)))
|
||||
(overlay-get ol 'after-string))))
|
||||
(push ol nrol)
|
||||
(and (zerop (forward-line 1))
|
||||
(<= (point) end))))
|
||||
(mapc #'delete-overlay old)
|
||||
`(rectangle ,(buffer-chars-modified-tick) ,start ,end ,@nrol))))))
|
||||
|
||||
|
|
|
@ -364,6 +364,7 @@ The Lisp value REGISTER is a character."
|
|||
(princ (car val))))
|
||||
|
||||
((stringp val)
|
||||
(setq val (copy-sequence val))
|
||||
(if (eq yank-excluded-properties t)
|
||||
(set-text-properties 0 (length val) nil val)
|
||||
(remove-list-of-text-properties 0 (length val)
|
||||
|
@ -417,19 +418,24 @@ Interactively, second arg is non-nil if prefix arg is supplied."
|
|||
(error "Register does not contain text"))))
|
||||
(if (not arg) (exchange-point-and-mark)))
|
||||
|
||||
(defun copy-to-register (register start end &optional delete-flag)
|
||||
(defun copy-to-register (register start end &optional delete-flag region)
|
||||
"Copy region into register REGISTER.
|
||||
With prefix arg, delete as well.
|
||||
Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
|
||||
START and END are buffer positions indicating what to copy."
|
||||
START and END are buffer positions indicating what to copy.
|
||||
The optional argument REGION if non-nil, indicates that we're not just copying
|
||||
some text between START and END, but we're copying the region."
|
||||
(interactive (list (register-read-with-preview "Copy to register: ")
|
||||
(region-beginning)
|
||||
(region-end)
|
||||
current-prefix-arg))
|
||||
(set-register register (filter-buffer-substring start end))
|
||||
current-prefix-arg
|
||||
t))
|
||||
(set-register register (if region
|
||||
(funcall region-extract-function delete-flag)
|
||||
(prog1 (filter-buffer-substring start end)
|
||||
(if delete-flag (delete-region start end)))))
|
||||
(setq deactivate-mark t)
|
||||
(cond (delete-flag
|
||||
(delete-region start end))
|
||||
(cond (delete-flag)
|
||||
((called-interactively-p 'interactive)
|
||||
(indicate-copied-region))))
|
||||
|
||||
|
|
|
@ -2038,6 +2038,7 @@ by doing (clear-string STRING)."
|
|||
(setq-local select-active-regions nil)
|
||||
(use-local-map read-passwd-map)
|
||||
(setq-local inhibit-modification-hooks nil) ;bug#15501.
|
||||
(setq-local show-paren-mode nil) ;bug#16091.
|
||||
(add-hook 'after-change-functions hide-chars-fun nil 'local))
|
||||
(unwind-protect
|
||||
(let ((enable-recursive-minibuffers t))
|
||||
|
|
102
m4/absolute-header.m4
Normal file
102
m4/absolute-header.m4
Normal file
|
@ -0,0 +1,102 @@
|
|||
# absolute-header.m4 serial 16
|
||||
dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Derek Price.
|
||||
|
||||
# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
|
||||
# ---------------------------------------
|
||||
# Find the absolute name of a header file, testing first if the header exists.
|
||||
# If the header were sys/inttypes.h, this macro would define
|
||||
# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h
|
||||
# in config.h
|
||||
# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
|
||||
# The three "///" are to pacify Sun C 5.8, which otherwise would say
|
||||
# "warning: #include of /usr/include/... may be non-portable".
|
||||
# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
|
||||
# Note: This macro assumes that the header file is not empty after
|
||||
# preprocessing, i.e. it does not only define preprocessor macros but also
|
||||
# provides some type/enum definitions or function/variable declarations.
|
||||
AC_DEFUN([gl_ABSOLUTE_HEADER],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_PREPROC_REQUIRE()dnl
|
||||
dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
|
||||
dnl until we can assume autoconf 2.64 or newer.
|
||||
m4_foreach_w([gl_HEADER_NAME], [$1],
|
||||
[AS_VAR_PUSHDEF([gl_absolute_header],
|
||||
[gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
|
||||
AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
|
||||
m4_defn([gl_absolute_header]),
|
||||
[AS_VAR_PUSHDEF([ac_header_exists],
|
||||
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
|
||||
AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
|
||||
if test AS_VAR_GET(ac_header_exists) = yes; then
|
||||
gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
|
||||
fi
|
||||
AS_VAR_POPDEF([ac_header_exists])dnl
|
||||
])dnl
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
|
||||
["AS_VAR_GET(gl_absolute_header)"],
|
||||
[Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
|
||||
AS_VAR_POPDEF([gl_absolute_header])dnl
|
||||
])dnl
|
||||
])# gl_ABSOLUTE_HEADER
|
||||
|
||||
# gl_ABSOLUTE_HEADER_ONE(HEADER)
|
||||
# ------------------------------
|
||||
# Like gl_ABSOLUTE_HEADER, except that:
|
||||
# - it assumes that the header exists,
|
||||
# - it uses the current CPPFLAGS,
|
||||
# - it does not cache the result,
|
||||
# - it is silent.
|
||||
AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])
|
||||
dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
|
||||
dnl that contain only a #include of other header files and no
|
||||
dnl non-comment tokens of their own. This leads to a failure to
|
||||
dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
|
||||
dnl and others. The workaround is to force preservation of comments
|
||||
dnl through option -C. This ensures all necessary #line directives
|
||||
dnl are present. GCC supports option -C as well.
|
||||
case "$host_os" in
|
||||
aix*) gl_absname_cpp="$ac_cpp -C" ;;
|
||||
*) gl_absname_cpp="$ac_cpp" ;;
|
||||
esac
|
||||
changequote(,)
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
dnl For the sake of native Windows compilers (excluding gcc),
|
||||
dnl treat backslash as a directory separator, like /.
|
||||
dnl Actually, these compilers use a double-backslash as
|
||||
dnl directory separator, inside the
|
||||
dnl # line "filename"
|
||||
dnl directives.
|
||||
gl_dirsep_regex='[/\\]'
|
||||
;;
|
||||
*)
|
||||
gl_dirsep_regex='\/'
|
||||
;;
|
||||
esac
|
||||
dnl A sed expression that turns a string into a basic regular
|
||||
dnl expression, for use within "/.../".
|
||||
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
|
||||
gl_header_literal_regex=`echo '$1' \
|
||||
| sed -e "$gl_make_literal_regex_sed"`
|
||||
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
|
||||
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
|
||||
s|^/[^/]|//&|
|
||||
p
|
||||
q
|
||||
}'
|
||||
changequote([,])
|
||||
dnl eval is necessary to expand gl_absname_cpp.
|
||||
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
|
||||
dnl so use subshell.
|
||||
AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]),
|
||||
[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
|
||||
sed -n "$gl_absolute_header_sed"`])
|
||||
])
|
48
m4/gl-openssl.m4
Normal file
48
m4/gl-openssl.m4
Normal file
|
@ -0,0 +1,48 @@
|
|||
# gl-openssl.m4 serial 3
|
||||
dnl Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_SET_CRYPTO_CHECK_DEFAULT],
|
||||
[
|
||||
m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1])
|
||||
])
|
||||
gl_SET_CRYPTO_CHECK_DEFAULT([no])
|
||||
|
||||
AC_DEFUN([gl_CRYPTO_CHECK],
|
||||
[
|
||||
m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT'])
|
||||
|
||||
AC_ARG_WITH([openssl],
|
||||
[AS_HELP_STRING([--with-openssl],
|
||||
[use libcrypto hash routines. Valid ARGs are:
|
||||
'yes', 'no', 'auto' => use if available,
|
||||
'optional' => use if available and warn if not available;
|
||||
default is ']gl_CRYPTO_CHECK_DEFAULT['])],
|
||||
[],
|
||||
[with_openssl=$with_openssl_default])
|
||||
|
||||
if test "x$1" = xMD5; then
|
||||
ALG_header=md5.h
|
||||
else
|
||||
ALG_header=sha.h
|
||||
fi
|
||||
|
||||
LIB_CRYPTO=
|
||||
AC_SUBST([LIB_CRYPTO])
|
||||
if test "x$with_openssl" != xno; then
|
||||
AC_CHECK_LIB([crypto], [$1],
|
||||
[AC_CHECK_HEADERS([openssl/$ALG_header],
|
||||
[LIB_CRYPTO=-lcrypto
|
||||
AC_DEFINE([HAVE_OPENSSL_$1], [1],
|
||||
[Define to 1 if libcrypto is used for $1.])])])
|
||||
if test "x$LIB_CRYPTO" = x; then
|
||||
if test "x$with_openssl" = xyes; then
|
||||
AC_MSG_ERROR([openssl development library not found for $1])
|
||||
elif test "x$with_openssl" = xoptional; then
|
||||
AC_MSG_WARN([openssl development library not found for $1])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
|
@ -38,6 +38,7 @@ AC_DEFUN([gl_EARLY],
|
|||
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
|
||||
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
|
||||
AC_REQUIRE([gl_PROG_AR_RANLIB])
|
||||
# Code from module absolute-header:
|
||||
# Code from module alloca-opt:
|
||||
# Code from module allocator:
|
||||
# Code from module at-internal:
|
||||
|
@ -847,6 +848,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/gettext.h
|
||||
lib/gettime.c
|
||||
lib/gettimeofday.c
|
||||
lib/gl_openssl.h
|
||||
lib/group-member.c
|
||||
lib/intprops.h
|
||||
lib/inttypes.in.h
|
||||
|
@ -921,6 +923,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/verify.h
|
||||
lib/xalloc-oversized.h
|
||||
m4/00gnulib.m4
|
||||
m4/absolute-header.m4
|
||||
m4/acl.m4
|
||||
m4/alloca.m4
|
||||
m4/byteswap.m4
|
||||
|
@ -953,6 +956,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/getopt.m4
|
||||
m4/gettime.m4
|
||||
m4/gettimeofday.m4
|
||||
m4/gl-openssl.m4
|
||||
m4/gnulib-common.m4
|
||||
m4/group-member.m4
|
||||
m4/include_next.m4
|
||||
|
|
|
@ -192,56 +192,9 @@ dnl until we can assume autoconf 2.64 or newer.
|
|||
if test AS_VAR_GET(gl_header_exists) = yes; then
|
||||
AS_VAR_POPDEF([gl_header_exists])
|
||||
])
|
||||
AC_LANG_CONFTEST(
|
||||
[AC_LANG_SOURCE(
|
||||
[[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
|
||||
)])
|
||||
dnl AIX "xlc -E" and "cc -E" omit #line directives for header
|
||||
dnl files that contain only a #include of other header files and
|
||||
dnl no non-comment tokens of their own. This leads to a failure
|
||||
dnl to detect the absolute name of <dirent.h>, <signal.h>,
|
||||
dnl <poll.h> and others. The workaround is to force preservation
|
||||
dnl of comments through option -C. This ensures all necessary
|
||||
dnl #line directives are present. GCC supports option -C as well.
|
||||
case "$host_os" in
|
||||
aix*) gl_absname_cpp="$ac_cpp -C" ;;
|
||||
*) gl_absname_cpp="$ac_cpp" ;;
|
||||
esac
|
||||
changequote(,)
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
dnl For the sake of native Windows compilers (excluding gcc),
|
||||
dnl treat backslash as a directory separator, like /.
|
||||
dnl Actually, these compilers use a double-backslash as
|
||||
dnl directory separator, inside the
|
||||
dnl # line "filename"
|
||||
dnl directives.
|
||||
gl_dirsep_regex='[/\\]'
|
||||
;;
|
||||
*)
|
||||
gl_dirsep_regex='\/'
|
||||
;;
|
||||
esac
|
||||
dnl A sed expression that turns a string into a basic regular
|
||||
dnl expression, for use within "/.../".
|
||||
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
|
||||
changequote([,])
|
||||
gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
|
||||
| sed -e "$gl_make_literal_regex_sed"`
|
||||
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
|
||||
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
|
||||
changequote(,)dnl
|
||||
s|^/[^/]|//&|
|
||||
changequote([,])dnl
|
||||
p
|
||||
q
|
||||
}'
|
||||
dnl eval is necessary to expand gl_absname_cpp.
|
||||
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
|
||||
dnl so use subshell.
|
||||
AS_VAR_SET(gl_next_header,
|
||||
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
|
||||
sed -n "$gl_absolute_header_sed"`'"'])
|
||||
gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
|
||||
AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
|
||||
AS_VAR_SET(gl_next_header, ['"'$gl_header'"'])
|
||||
m4_if([$2], [check],
|
||||
[else
|
||||
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# md5.m4 serial 13
|
||||
# md5.m4 serial 14
|
||||
dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -8,5 +8,7 @@ AC_DEFUN([gl_MD5],
|
|||
[
|
||||
dnl Prerequisites of lib/md5.c.
|
||||
AC_REQUIRE([gl_BIGENDIAN])
|
||||
:
|
||||
|
||||
dnl Determine HAVE_OPENSSL_MD5 and LIB_CRYPTO
|
||||
gl_CRYPTO_CHECK([MD5])
|
||||
])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# sha1.m4 serial 11
|
||||
# sha1.m4 serial 12
|
||||
dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -8,5 +8,7 @@ AC_DEFUN([gl_SHA1],
|
|||
[
|
||||
dnl Prerequisites of lib/sha1.c.
|
||||
AC_REQUIRE([gl_BIGENDIAN])
|
||||
:
|
||||
|
||||
dnl Determine HAVE_OPENSSL_SHA1 and LIB_CRYPTO
|
||||
gl_CRYPTO_CHECK([SHA1])
|
||||
])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# sha256.m4 serial 7
|
||||
# sha256.m4 serial 8
|
||||
dnl Copyright (C) 2005, 2008-2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -8,5 +8,7 @@ AC_DEFUN([gl_SHA256],
|
|||
[
|
||||
dnl Prerequisites of lib/sha256.c.
|
||||
AC_REQUIRE([gl_BIGENDIAN])
|
||||
:
|
||||
|
||||
dnl Determine HAVE_OPENSSL_SHA256 and LIB_CRYPTO
|
||||
gl_CRYPTO_CHECK([SHA256])
|
||||
])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# sha512.m4 serial 8
|
||||
# sha512.m4 serial 9
|
||||
dnl Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -8,5 +8,7 @@ AC_DEFUN([gl_SHA512],
|
|||
[
|
||||
dnl Prerequisites of lib/sha512.c.
|
||||
AC_REQUIRE([gl_BIGENDIAN])
|
||||
:
|
||||
|
||||
dnl Determine HAVE_OPENSSL_SHA512 and LIB_CRYPTO
|
||||
gl_CRYPTO_CHECK([SHA512])
|
||||
])
|
||||
|
|
141
src/ChangeLog
141
src/ChangeLog
|
@ -1,5 +1,66 @@
|
|||
2013-12-09 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* gtkutil.c (USE_NEW_GTK_FONT_CHOOSER) [HAVE_FREETYPE]:
|
||||
Avoid unused macro warning if configured --without-xft.
|
||||
|
||||
2013-12-09 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* alloc.c (Fmemory_limit): Avoid compiler warning. Return 0 always.
|
||||
|
||||
2013-12-08 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* nsterm.m (updateFrameSize:): Fix GNUStep toolbar not updating.
|
||||
|
||||
* emacs.c (main): Call fixup_locale a second time for GNUStep.
|
||||
|
||||
2013-12-08 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* frame.c (x_set_font): Mark frame as garbaged (Bug#16028).
|
||||
|
||||
2013-12-08 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Use libcrypto's checksum implementations if available, for speed.
|
||||
* Makefile.in (LIB_CRYPTO): New macro.
|
||||
(LIBES): Use it.
|
||||
|
||||
* frame.h (SET_FRAME_VISIBLE): Now an inline function.
|
||||
The macro didn't conform to C99 due to type mismatch,
|
||||
which caused compilation failure with Sun C 5.12,
|
||||
and it was confusing anyway. Include window.h to declare
|
||||
redisplay_other_windows.
|
||||
|
||||
2013-12-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* window.c (set_window_buffer): Update mode line (bug#16084).
|
||||
|
||||
2013-12-07 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Fix minor problems found by static checking.
|
||||
* keyboard.c (poll_for_input_1, input_polling_used):
|
||||
Define only if HAVE_NTGUI.
|
||||
* xmenu.c (popup_activate_callback): Omit unnecessary
|
||||
check against USE_X_TOOLKIT, which must be defined here anyway.
|
||||
* xterm.c, xterm.h (x_dispatch_event) [! (USE_X_TOOLKIT || USE_MOTIF)]:
|
||||
Now static.
|
||||
|
||||
2013-12-07 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* w32term.c (w32_read_socket): Fix int/Lisp_Object type mixup.
|
||||
|
||||
2013-12-07 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* gtkutil.c (tb_size_cb): Call xg_height_or_width_changed.
|
||||
|
||||
* nsterm.m (x_set_window_size): Remove fprintf.
|
||||
(init): Define always. Set applicationDidFinishLaunchingCalled
|
||||
for GNUStep.
|
||||
(applicationDidFinishLaunching:):
|
||||
Set applicationDidFinishLaunchingCalled.
|
||||
(applicationDidBecomeActive:): Call applicationDidFinishLaunching if
|
||||
not called.
|
||||
|
||||
* nsterm.h (EmacsApp): Add applicationDidFinishLaunchingCalled.
|
||||
|
||||
Pixel resize changes for NS (Bug#16049).
|
||||
* nsterm.m (x_set_window_size): Change parameters rows/cols to
|
||||
height/width. row/cols are locals.
|
||||
|
@ -7,8 +68,8 @@
|
|||
(updateFrameSize:): Remove gsextra. Adjust for pixelwise resize.
|
||||
(windowWillResize): Remove gsextra. Calculate extra as in
|
||||
updateFrameSize.
|
||||
(x_new_font): Don't change frame size if fullscreen. Change
|
||||
size pixelwise.
|
||||
(x_new_font): Don't change frame size if fullscreen.
|
||||
Change size pixelwise.
|
||||
|
||||
* nsfns.m (Fx_create_frame): Call change_frame_size twice as per
|
||||
comment in xfns.c. Change to pixelwise call.
|
||||
|
@ -210,8 +271,8 @@
|
|||
ON_RIGHT_DIVIDER and ON_BOTTOM_DIVIDER.
|
||||
(struct glyph_matrix): Replace window_left_col and
|
||||
window_top_line by window_pixel_left and window_pixel_top.
|
||||
(WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Minor
|
||||
rewrite.
|
||||
(WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P):
|
||||
Minor rewrite.
|
||||
(enum face_id): Add WINDOW_DIVIDER_FACE_ID.
|
||||
(draw_window_divider, move_it_to, x_draw_right_divider)
|
||||
(x_draw_bottom_divider, change_frame_size): Add or fix
|
||||
|
@ -226,8 +287,8 @@
|
|||
(init_display): Adjusts calls of change_frame_size.
|
||||
(change_frame_size, change_frame_size_1): Handle pixelwise
|
||||
changes.
|
||||
* frame.c (Qright_divider_width, Qbottom_divider_width): New
|
||||
Lisp objects.
|
||||
* frame.c (Qright_divider_width, Qbottom_divider_width):
|
||||
New Lisp objects.
|
||||
(set_menu_bar_lines_1, set_menu_bar_lines, make_frame)
|
||||
(make_terminal_frame, Fmake_terminal_frame, Fframe_parameters)
|
||||
(x_set_internal_border_width, x_set_vertical_scroll_bars)
|
||||
|
@ -238,15 +299,15 @@
|
|||
(Fframe_text_width, Fframe_text_height, Fscroll_bar_width)
|
||||
(Ffringe_width, Fborder_width, Fright_divider_width)
|
||||
(Fbottom_divider_width): New functions, defsubr them.
|
||||
(Fset_frame_height, Fset_frame_width, Fset_frame_size): New
|
||||
argument pixelwise.
|
||||
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
|
||||
New argument pixelwise.
|
||||
(struct frame_parm_table): New members Qright_divider_width and
|
||||
Qbottom_divider_width.
|
||||
(x_set_frame_parameters): Handle parameters for pixelwise sizes.
|
||||
(x_report_frame_params): Handle Qright_divider_width and
|
||||
Qbottom_divider_width.
|
||||
(x_set_right_divider_width, x_set_bottom_divider_width): New
|
||||
functions.
|
||||
(x_set_right_divider_width, x_set_bottom_divider_width):
|
||||
New functions.
|
||||
(frame_resize_pixelwise): New option.
|
||||
* frame.h (struct frame): Add tool_bar_height, menu_bar_height,
|
||||
new_pixelwise, right_divider_width and bottom_divider_width;
|
||||
|
@ -257,8 +318,8 @@
|
|||
FRAME_TEXT_WIDTH respectively.
|
||||
(FRAME_MENU_BAR_HEIGHT, FRAME_TOOL_BAR_HEIGHT)
|
||||
(FRAME_RIGHT_DIVIDER_WIDTH, FRAME_BOTTOM_DIVIDER_WIDTH)
|
||||
(FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH): New
|
||||
macros.
|
||||
(FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH):
|
||||
New macros.
|
||||
(FRAME_TOP_MARGIN_HEIGHT, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH)
|
||||
(FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH, FRAME_SCROLL_BAR_AREA_WIDTH)
|
||||
(SET_FRAME_COLS, SET_FRAME_WIDTH, SET_FRAME_HEIGHT)
|
||||
|
@ -268,8 +329,8 @@
|
|||
* fringe.c (draw_fringe_bitmap_1): Handle right divder.
|
||||
* gtkutil.c (xg_frame_resized, xg_frame_set_char_size)
|
||||
(x_wm_set_size_hint): Handle frame pixel sizes.
|
||||
* indent.c (compute_motion, Fcompute_motion): Call
|
||||
window_body_width instead of window_body_cols.
|
||||
* indent.c (compute_motion, Fcompute_motion):
|
||||
Call window_body_width instead of window_body_cols.
|
||||
* keyboard.c (Qright_divider, Qbottom_divider): New symbols.
|
||||
(make_lispy_position): Handle right and bottom dividers.
|
||||
(Fsuspend_emacs): Pixelize call of change_frame_size.
|
||||
|
@ -277,13 +338,13 @@
|
|||
* lisp.h: Extern set_frame_param.
|
||||
* nsfns.m (x_set_tool_bar_lines): Pixelize call of
|
||||
x_set_window_size.
|
||||
(Fx_create_frame): Add entry for vertical_drag_cursor. Pixelize
|
||||
call of change_frame_size.
|
||||
(Fx_create_frame): Add entry for vertical_drag_cursor.
|
||||
Pixelize call of change_frame_size.
|
||||
* nsterm.h (struct ns_output): Add vertical_drag_cursor.
|
||||
* nsterm.m (ns_update_window_end): Optionally draw right
|
||||
divider.
|
||||
(x_set_window_size): Add argument pixelwise. Call
|
||||
check_frame_size and change_frame_size with pixelwise zero.
|
||||
(x_set_window_size): Add argument pixelwise.
|
||||
Call check_frame_size and change_frame_size with pixelwise zero.
|
||||
(ns_draw_window_divider): New function.
|
||||
(ns_redisplay_interface): Add ns_draw_window_divider.
|
||||
(updateFrameSize:): Call change_frame_size with pixelwise zero.
|
||||
|
@ -294,12 +355,12 @@
|
|||
* w32fns.c (x_set_mouse_color): Handle vertical drag cursor.
|
||||
(x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
|
||||
(w32_createwindow): Use scroll bar area width.
|
||||
(w32_wnd_proc): Handle bottom divider width. For
|
||||
WM_WINDOWPOSCHANGING return zero if we resize pixelwise.
|
||||
(Fx_create_frame): Default divider width parameters. Caclulate
|
||||
sizes pixelwise. Add vertical drag cursor support.
|
||||
(x_create_tip_frame): Default divider widths to zero. Pixelize
|
||||
call to change_frame_size.
|
||||
(w32_wnd_proc): Handle bottom divider width.
|
||||
For WM_WINDOWPOSCHANGING return zero if we resize pixelwise.
|
||||
(Fx_create_frame): Default divider width parameters.
|
||||
Caclulate sizes pixelwise. Add vertical drag cursor support.
|
||||
(x_create_tip_frame): Default divider widths to zero.
|
||||
Pixelize call to change_frame_size.
|
||||
(Fx_show_tip): Add handling of divider widths. Pixelize window
|
||||
position and sizes.
|
||||
(Fw32_frame_rect): New function.
|
||||
|
@ -314,8 +375,8 @@
|
|||
(x_update_window_end): Handle right divider.
|
||||
(w32_draw_fringe_bitmap, x_scroll_run)
|
||||
(w32_set_vertical_scroll_bar): Pixelize scrollbar widths.
|
||||
(w32_read_socket): Handle SIZE_MAXIMIZED separately. Calculate
|
||||
new frame sizes pixelwise.
|
||||
(w32_read_socket): Handle SIZE_MAXIMIZED separately.
|
||||
Calculate new frame sizes pixelwise.
|
||||
(x_new_font): Pixelize call to x_set_window_size.
|
||||
(x_check_fullscreen): Pixelize call to change_frame_size.
|
||||
(x_set_window_size_1, x_set_window_size): New argument
|
||||
|
@ -334,16 +395,16 @@
|
|||
(Fset_window_new_pixel, window_resize_apply_total)
|
||||
(Fwindow_resize_apply_total): New functions.
|
||||
(window_body_height, window_body_width): Rename from
|
||||
window_body_lines. New argument PIXELWISE. Calculate
|
||||
pixelwise.
|
||||
window_body_lines. New argument PIXELWISE.
|
||||
Calculate pixelwise.
|
||||
(Fwindow_body_height, Fwindow_body_width): New argument
|
||||
PIXELWISE.
|
||||
(coordinates_in_window, window_relative_x_coord): Use window's
|
||||
pixel width instead of total width.
|
||||
(replace_window, recombine_windows): Initialize pixel values.
|
||||
(resize_root_window, resize_frame_windows, grow_mini_window)
|
||||
(shrink_mini_window): New argument PIXELWISE. Calculate
|
||||
pixelwise.
|
||||
(shrink_mini_window): New argument PIXELWISE.
|
||||
Calculate pixelwise.
|
||||
(Fdelete_other_windows_internal, adjust_window_margins)
|
||||
(window_resize_check, window_resize_apply)
|
||||
(Fdelete_window_internal, Fresize_mini_window_internal)
|
||||
|
@ -368,11 +429,11 @@
|
|||
slots in save_window_data and saved_window.
|
||||
(Fset_window_scroll_bars): Fix doc-string.
|
||||
(window_resize_pixelwise): New variable.
|
||||
(coordinates_in_window, Fcoordinates_in_window_p): Handle
|
||||
dividers.
|
||||
(coordinates_in_window, Fcoordinates_in_window_p):
|
||||
Handle dividers.
|
||||
(make_parent_window): Adjust sequence_number.
|
||||
(Fwindow_right_divider_width, Fwindow_bottom_divider_width): New
|
||||
functions.
|
||||
(Fwindow_right_divider_width, Fwindow_bottom_divider_width):
|
||||
New functions.
|
||||
* window.h (struct window): New members new_pixel, pixel_left,
|
||||
pixel_top, pixel_width, pixel_height. Restore sequence_number.
|
||||
(wset_new_pixel): New function.
|
||||
|
@ -406,10 +467,10 @@
|
|||
encountered.
|
||||
(Fwindow_text_pixel_size): New function.
|
||||
(resize_mini_window, update_tool_bar): Calculate pixelwise.
|
||||
(tool_bar_lines_needed): Rename to tool_bar_height. Calculate
|
||||
pixelwise.
|
||||
(Ftool_bar_lines_needed): Rename to Ftool_bar_height. Calculate
|
||||
pixelwise.
|
||||
(tool_bar_lines_needed): Rename to tool_bar_height.
|
||||
Calculate pixelwise.
|
||||
(Ftool_bar_lines_needed): Rename to Ftool_bar_height.
|
||||
Calculate pixelwise.
|
||||
(redisplay_tool_bar): Calculate pixelwise.
|
||||
(redisplay_window): Calculate pixelwise. Handle dividers.
|
||||
(draw_glyphs, x_clear_end_of_line, note_mouse_highlight)
|
||||
|
@ -424,8 +485,8 @@
|
|||
(x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
|
||||
(x_set_scroll_bar_default_width): Default actual width to 16.
|
||||
(Fx_create_frame): Set sizes pixelwise.
|
||||
(x_create_tip_frame): Default divider widths to zero. Pixelize
|
||||
call of change_frame_size.
|
||||
(x_create_tip_frame): Default divider widths to zero.
|
||||
Pixelize call of change_frame_size.
|
||||
(Fx_show_tip): Handle divider widths. Initial pixel position
|
||||
and sizes.
|
||||
(frame_parm_handler x_frame_parm_handlers): Add divider widths.
|
||||
|
|
|
@ -12845,8 +12845,8 @@
|
|||
longer DEFVARed: they are already declared in window.c.
|
||||
|
||||
* screen.c (window_from_coordinates): Use Fnext_window, even if
|
||||
MULTI_SCREEN, to obtain the next window. This is an test.
|
||||
Also, new paramater part returns text or modeline symbol.
|
||||
MULTI_SCREEN, to obtain the next window. This is a test.
|
||||
Also, new parameter part returns text or modeline symbol.
|
||||
(Flocate_window_from_coordinates): Pass &part to
|
||||
window_from_coordinates.
|
||||
(coordinates_in_window): Don't say modeline if window_height is 1,
|
||||
|
|
|
@ -139,6 +139,7 @@ M17N_FLT_LIBS = @M17N_FLT_LIBS@
|
|||
|
||||
LIB_ACL=@LIB_ACL@
|
||||
LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@
|
||||
LIB_CRYPTO=@LIB_CRYPTO@
|
||||
LIB_EACCESS=@LIB_EACCESS@
|
||||
LIB_FDATASYNC=@LIB_FDATASYNC@
|
||||
LIB_TIMER_TIME=@LIB_TIMER_TIME@
|
||||
|
@ -403,6 +404,7 @@ ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
|
|||
LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
|
||||
$(LIBX_OTHER) $(LIBSOUND) \
|
||||
$(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \
|
||||
$(LIB_CRYPTO) \
|
||||
$(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
|
||||
$(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \
|
||||
$(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
|
||||
|
|
|
@ -6633,7 +6633,12 @@ We divide the value by 1024 to make sure it fits in a Lisp integer. */)
|
|||
{
|
||||
Lisp_Object end;
|
||||
|
||||
#ifdef HAVE_NS
|
||||
/* Avoid warning. sbrk has no relation to memory allocated anyway. */
|
||||
XSETINT (end, 0);
|
||||
#else
|
||||
XSETINT (end, (intptr_t) (char *) sbrk (0) / 1024);
|
||||
#endif
|
||||
|
||||
return end;
|
||||
}
|
||||
|
|
|
@ -1217,6 +1217,11 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
|
|||
|
||||
#ifdef HAVE_NS
|
||||
ns_pool = ns_alloc_autorelease_pool ();
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
/* GNUStep stupidly resets our locale settings after we made them. */
|
||||
fixup_locale ();
|
||||
#endif
|
||||
|
||||
if (!noninteractive)
|
||||
{
|
||||
#ifdef NS_IMPL_COCOA
|
||||
|
|
|
@ -3597,7 +3597,7 @@ NFRAMES and BASE specify the activation frame to use, as in `backtrace-frame'.
|
|||
/* The specpdl entries normally contain the symbol being bound along with its
|
||||
`old_value', so it can be restored. The new value to which it is bound is
|
||||
available in one of two places: either in the current value of the
|
||||
variable (if it hasn't been rebount yet) or in the `old_value' slot of the
|
||||
variable (if it hasn't been rebound yet) or in the `old_value' slot of the
|
||||
next specpdl entry for it.
|
||||
`backtrace_eval_unrewind' happens to swap the role of `old_value'
|
||||
and "new value", so we abuse it here, to fetch the new value.
|
||||
|
|
|
@ -3314,9 +3314,13 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
|||
#endif
|
||||
/* Recalculate toolbar height. */
|
||||
f->n_tool_bar_rows = 0;
|
||||
|
||||
/* Ensure we redraw it. */
|
||||
clear_current_matrices (f);
|
||||
|
||||
/* Attempt to hunt down bug#16028. */
|
||||
SET_FRAME_GARBAGED (f);
|
||||
|
||||
recompute_basic_faces (f);
|
||||
|
||||
do_pending_window_change (0);
|
||||
|
|
13
src/frame.h
13
src/frame.h
|
@ -25,6 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
|
||||
#include "dispextern.h"
|
||||
#include "termhooks.h"
|
||||
#include "window.h"
|
||||
|
||||
INLINE_HEADER_BEGIN
|
||||
|
||||
|
@ -956,10 +957,14 @@ default_pixels_per_inch_y (void)
|
|||
if some changes were applied to it while it wasn't visible (and hence
|
||||
wasn't redisplayed). */
|
||||
|
||||
#define SET_FRAME_VISIBLE(f, v) \
|
||||
(((f)->visible == 0 || ((f)->visible == 2)) && ((v) == 1) \
|
||||
? redisplay_other_windows () : 0, \
|
||||
(f)->visible = (eassert (0 <= (v) && (v) <= 2), (v)))
|
||||
INLINE void
|
||||
SET_FRAME_VISIBLE (struct frame *f, int v)
|
||||
{
|
||||
eassert (0 <= v && v <= 2);
|
||||
if (v == 1 && f->visible != 1)
|
||||
redisplay_other_windows ();
|
||||
f->visible = v;
|
||||
}
|
||||
|
||||
/* Set iconify of frame F. */
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#define remove_submenu(w) gtk_menu_item_remove_submenu ((w))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FREETYPE
|
||||
#if GTK_CHECK_VERSION (3, 2, 0)
|
||||
#define USE_NEW_GTK_FONT_CHOOSER 1
|
||||
#else
|
||||
|
@ -89,6 +90,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#define gtk_font_chooser_set_font(x, y) \
|
||||
gtk_font_selection_dialog_set_font_name (x, y)
|
||||
#endif
|
||||
#endif /* HAVE_FREETYPE */
|
||||
|
||||
#ifndef HAVE_GTK3
|
||||
#ifdef USE_GTK_TOOLTIP
|
||||
|
@ -4350,7 +4352,7 @@ tb_size_cb (GtkWidget *widget,
|
|||
size hints if tool bar size changes. Seen on Fedora 18 at least. */
|
||||
struct frame *f = user_data;
|
||||
if (xg_update_tool_bar_sizes (f))
|
||||
x_wm_set_size_hint (f, 0, 0);
|
||||
xg_height_or_width_changed (f);
|
||||
}
|
||||
|
||||
/* Create a tool bar for frame F. */
|
||||
|
|
|
@ -1954,10 +1954,8 @@ int poll_suppress_count;
|
|||
|
||||
static struct atimer *poll_timer;
|
||||
|
||||
/* Poll for input, so that we catch a C-g if it comes in. This
|
||||
function is called from x_make_frame_visible, see comment
|
||||
there. */
|
||||
|
||||
#ifdef HAVE_NTGUI
|
||||
/* Poll for input, so that we catch a C-g if it comes in. */
|
||||
void
|
||||
poll_for_input_1 (void)
|
||||
{
|
||||
|
@ -1965,6 +1963,7 @@ poll_for_input_1 (void)
|
|||
&& !waiting_for_input)
|
||||
gobble_input ();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Timer callback function for poll_timer. TIMER is equal to
|
||||
poll_timer. */
|
||||
|
@ -2016,6 +2015,8 @@ start_polling (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_NTGUI
|
||||
|
||||
/* True if we are using polling to handle input asynchronously. */
|
||||
|
||||
bool
|
||||
|
@ -2030,6 +2031,7 @@ input_polling_used (void)
|
|||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Turn off polling. */
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ typedef float EmacsCGFloat;
|
|||
BOOL isFirst;
|
||||
#endif
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
BOOL applicationDidFinishLaunchingCalled;
|
||||
@public
|
||||
int nextappdefined;
|
||||
#endif
|
||||
|
|
25
src/nsterm.m
25
src/nsterm.m
|
@ -1320,8 +1320,6 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
[view setRows: rows andColumns: cols];
|
||||
[window setFrame: wr display: YES];
|
||||
|
||||
fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight);
|
||||
|
||||
/* This is a trick to compensate for Emacs' managing the scrollbar area
|
||||
as a fixed number of standard character columns. Instead of leaving
|
||||
blank space for the extra, we chopped it off above. Now for
|
||||
|
@ -4410,15 +4408,22 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
|
|||
|
||||
@implementation EmacsApp
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
|
||||
- (id)init
|
||||
{
|
||||
if (self = [super init])
|
||||
self->isFirst = YES;
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
|
||||
self->isFirst = YES;
|
||||
#endif
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
self->applicationDidFinishLaunchingCalled = NO;
|
||||
#endif
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
|
||||
- (void)run
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
@ -4605,6 +4610,9 @@ - (void)applicationDidFinishLaunching: (NSNotification *)notification
|
|||
-------------------------------------------------------------------------- */
|
||||
{
|
||||
NSTRACE (applicationDidFinishLaunching);
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
((EmacsApp *)self)->applicationDidFinishLaunchingCalled = YES;
|
||||
#endif
|
||||
[NSApp setServicesProvider: NSApp];
|
||||
ns_send_appdefined (-2);
|
||||
}
|
||||
|
@ -4732,6 +4740,10 @@ - (void)applicationDidBecomeActive: (NSNotification *)notification
|
|||
{
|
||||
NSTRACE (applicationDidBecomeActive);
|
||||
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
if (! applicationDidFinishLaunchingCalled)
|
||||
[self applicationDidFinishLaunching:notification];
|
||||
#endif
|
||||
//ns_app_active=YES;
|
||||
|
||||
ns_update_auto_hide_menu_bar ();
|
||||
|
@ -5670,6 +5682,11 @@ - (void) updateFrameSize: (BOOL) delay;
|
|||
|
||||
if (! [self isFullscreen])
|
||||
{
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
// GNUStep does not always update the tool bar height. Force it.
|
||||
if (toolbar) update_frame_tool_bar (emacsframe);
|
||||
#endif
|
||||
|
||||
extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
|
||||
+ FRAME_TOOLBAR_HEIGHT (emacsframe);
|
||||
}
|
||||
|
|
|
@ -4764,9 +4764,9 @@ w32_read_socket (struct terminal *terminal,
|
|||
record_asynch_buffer_change ();
|
||||
}
|
||||
|
||||
if (get_frame_param (f, Qfullscreen) == Qnil)
|
||||
if (EQ (get_frame_param (f, Qfullscreen), Qnil))
|
||||
set_frame_param (f, Qfullscreen, Qmaximized);
|
||||
else if (get_frame_param (f, Qfullscreen) != Qmaximized)
|
||||
else if (! EQ (get_frame_param (f, Qfullscreen), Qmaximized))
|
||||
set_frame_param (f, Qmaximized, Qmaximized);
|
||||
|
||||
break;
|
||||
|
@ -4803,9 +4803,9 @@ w32_read_socket (struct terminal *terminal,
|
|||
record_asynch_buffer_change ();
|
||||
}
|
||||
|
||||
if (get_frame_param (f, Qfullscreen) == Qmaximized)
|
||||
if (EQ (get_frame_param (f, Qfullscreen), Qmaximized))
|
||||
set_frame_param (f, Qfullscreen, Qnil);
|
||||
else if (get_frame_param (f, Qmaximized) != Qnil)
|
||||
else if (! EQ (get_frame_param (f, Qmaximized), Qnil))
|
||||
set_frame_param (f, Qmaximized, Qnil);
|
||||
|
||||
break;
|
||||
|
|
|
@ -3365,6 +3365,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
|
|||
/* Maybe we could move this into the `if' but it's not obviously safe and
|
||||
I doubt it's worth the trouble. */
|
||||
wset_redisplay (w);
|
||||
w->update_mode_line = true;
|
||||
|
||||
/* We must select BUFFER for running the window-scroll-functions. */
|
||||
/* We can't check ! NILP (Vwindow_scroll_functions) here
|
||||
|
|
|
@ -510,9 +510,7 @@ static void
|
|||
popup_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
|
||||
{
|
||||
popup_activated_flag = 1;
|
||||
#ifdef USE_X_TOOLKIT
|
||||
x_activate_timeout_atimer ();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -248,6 +248,9 @@ static void x_sync_with_move (struct frame *, int, int, int);
|
|||
static int handle_one_xevent (struct x_display_info *,
|
||||
const XEvent *, int *,
|
||||
struct input_event *);
|
||||
#if ! (defined USE_X_TOOLKIT || defined USE_MOTIF)
|
||||
static int x_dispatch_event (XEvent *, Display *);
|
||||
#endif
|
||||
/* Don't declare this _Noreturn because we want no
|
||||
interference with debugging failing X calls. */
|
||||
static void x_connection_closed (Display *, const char *);
|
||||
|
|
|
@ -945,7 +945,9 @@ extern void x_clear_area (Display *, Window, int, int, int, int);
|
|||
extern void x_mouse_leave (struct x_display_info *);
|
||||
#endif
|
||||
|
||||
#if defined USE_X_TOOLKIT || defined USE_MOTIF
|
||||
extern int x_dispatch_event (XEvent *, Display *);
|
||||
#endif
|
||||
extern int x_x_to_emacs_modifiers (struct x_display_info *, int);
|
||||
extern int x_display_pixel_height (struct x_display_info *);
|
||||
extern int x_display_pixel_width (struct x_display_info *);
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2013-12-08 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* indent/js.js: New file.
|
||||
|
||||
2013-12-05 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* automated/dbus-tests.el: New file.
|
||||
|
|
49
test/indent/js.js
Normal file
49
test/indent/js.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
var a = 1;
|
||||
b = 2;
|
||||
|
||||
let c = 1,
|
||||
d = 2;
|
||||
|
||||
var e = 100500,
|
||||
+ 1;
|
||||
|
||||
var f = bar('/protocols/')
|
||||
baz();
|
||||
|
||||
var h = 100500
|
||||
1;
|
||||
|
||||
const i = 1,
|
||||
j = 2;
|
||||
|
||||
var k = 1,
|
||||
l = [
|
||||
1, 2,
|
||||
3, 4
|
||||
],
|
||||
m = 5;
|
||||
|
||||
var n = function() {
|
||||
return 7;
|
||||
},
|
||||
o = 8;
|
||||
|
||||
foo(bar, function() {
|
||||
return 2;
|
||||
});
|
||||
|
||||
switch (b) {
|
||||
case "a":
|
||||
2;
|
||||
default:
|
||||
3;
|
||||
}
|
||||
|
||||
var p = {
|
||||
case: 'zzzz',
|
||||
default: 'donkey',
|
||||
tee: 'ornery'
|
||||
};
|
||||
|
||||
var evens = [e for each (e in range(0, 21))
|
||||
if (ed % 2 == 0)];
|
|
@ -299,3 +299,6 @@ def qux
|
|||
tee
|
||||
end
|
||||
end
|
||||
|
||||
%^abc^
|
||||
ddd
|
||||
|
|
Loading…
Add table
Reference in a new issue