Merge from mainline.
This commit is contained in:
commit
be6d99804b
48 changed files with 1175 additions and 4101 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,4 +1,4 @@
|
|||
2011-02-08 Paul Eggert <eggert@cs.ucla.edu>
|
||||
2011-02-10 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Import getloadavg module from gnulib.
|
||||
* .bzrignore: Add lib/stdlib.h.
|
||||
|
@ -19,6 +19,31 @@
|
|||
* aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
|
||||
* src/config.in: Regenerate.
|
||||
|
||||
2011-02-10 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* arg-nonnull.h, c++defs.h, warn-on-use.h: Fix licenses.
|
||||
Sync from gnulib, which has been patched to fix the problem
|
||||
with the license notices. Problem reported by Glenn Morris in
|
||||
<http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg00403.html>.
|
||||
|
||||
2011-02-09 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* .bzrignore: Ignore globals.h and related stamp.
|
||||
|
||||
2011-02-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* lib/Makefile.in, lib/gnulib.mk: Regenerate.
|
||||
This merges the following fix from gnulib:
|
||||
|
||||
2011-02-08 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
Split large sed scripts, for HP-UX sed.
|
||||
|
||||
2011-02-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* configure: Rebuild.
|
||||
* configure.in (NS_OBJC_OBJ): New subst.
|
||||
|
||||
2011-02-06 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
gnulib: allow multiple gnulib generated replacements to coexist
|
||||
|
|
|
@ -395,9 +395,14 @@ automatically sets a found version (if none is explicitly specified).
|
|||
*** To assign or reassign a bug to a package or list of packages:
|
||||
reassign 1234 emacs
|
||||
|
||||
Note that reassigning clears the list of found versions, even if the
|
||||
new packages includes the original one.
|
||||
|
||||
** To remove spam from the tracker, move it to the `spam' pseudo-package:
|
||||
reassign 123 spam
|
||||
|
||||
(Should not be necessary any more, now that the input is moderated.)
|
||||
|
||||
** To change the title of a bug:
|
||||
retitle 123 Some New Title
|
||||
|
||||
|
|
9
configure
vendored
9
configure
vendored
|
@ -926,6 +926,7 @@ GMALLOC_OBJ
|
|||
HAVE_XSERVER
|
||||
LIB_STANDARD
|
||||
NS_SUPPORT
|
||||
NS_OBJC_OBJ
|
||||
NS_OBJ
|
||||
TEMACS_LDFLAGS2
|
||||
LD_SWITCH_X_SITE_AUX_RPATH
|
||||
|
@ -1104,9 +1105,6 @@ LDFLAGS
|
|||
LIBS
|
||||
CPPFLAGS
|
||||
CPP
|
||||
CPPFLAGS
|
||||
CPP
|
||||
CPPFLAGS
|
||||
XMKMF'
|
||||
|
||||
|
||||
|
@ -8853,6 +8851,7 @@ fi
|
|||
|
||||
ns_frag=/dev/null
|
||||
NS_OBJ=
|
||||
NS_OBJC_OBJ=
|
||||
NS_SUPPORT=
|
||||
if test "${HAVE_NS}" = yes; then
|
||||
window_system=nextstep
|
||||
|
@ -8864,7 +8863,8 @@ if test "${HAVE_NS}" = yes; then
|
|||
prefix=${ns_appresdir}
|
||||
fi
|
||||
ns_frag=$srcdir/src/ns.mk
|
||||
NS_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o fontset.o fringe.o image.o"
|
||||
NS_OBJ="fontset.o fringe.o image.o"
|
||||
NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
|
||||
NS_SUPPORT="\${lispsource}/emacs-lisp/easymenu.elc \${lispsource}/term/ns-win.elc"
|
||||
fi
|
||||
CFLAGS="$tmp_CFLAGS"
|
||||
|
@ -8874,6 +8874,7 @@ CPPFLAGS="$tmp_CPPFLAGS"
|
|||
|
||||
|
||||
|
||||
|
||||
case "${window_system}" in
|
||||
x11 )
|
||||
HAVE_X_WINDOWS=yes
|
||||
|
|
|
@ -1516,6 +1516,7 @@ AC_SUBST(TEMACS_LDFLAGS2)
|
|||
|
||||
ns_frag=/dev/null
|
||||
NS_OBJ=
|
||||
NS_OBJC_OBJ=
|
||||
NS_SUPPORT=
|
||||
if test "${HAVE_NS}" = yes; then
|
||||
window_system=nextstep
|
||||
|
@ -1527,12 +1528,14 @@ if test "${HAVE_NS}" = yes; then
|
|||
prefix=${ns_appresdir}
|
||||
fi
|
||||
ns_frag=$srcdir/src/ns.mk
|
||||
NS_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o fontset.o fringe.o image.o"
|
||||
NS_OBJ="fontset.o fringe.o image.o"
|
||||
NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
|
||||
NS_SUPPORT="\${lispsource}/emacs-lisp/easymenu.elc \${lispsource}/term/ns-win.elc"
|
||||
fi
|
||||
CFLAGS="$tmp_CFLAGS"
|
||||
CPPFLAGS="$tmp_CPPFLAGS"
|
||||
AC_SUBST(NS_OBJ)
|
||||
AC_SUBST(NS_OBJC_OBJ)
|
||||
AC_SUBST(NS_SUPPORT)
|
||||
AC_SUBST(LIB_STANDARD)
|
||||
AC_SUBST_FILE(ns_frag)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2011-02-09 Reuben Thomas <rrt@sc3d.org>
|
||||
|
||||
* loading.texi (Hooks for Loading): Remove unnecessary advice
|
||||
about eval-after-load (Bug#7986).
|
||||
|
||||
2011-02-05 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* commands.texi (Accessing Mouse): Note that a header line is not
|
||||
|
|
|
@ -1000,10 +1000,6 @@ it immediately---there is no need to wait until the library is loaded.
|
|||
If you need to call functions defined by that library, you should load
|
||||
the library, preferably with @code{require} (@pxref{Named Features}).
|
||||
|
||||
But it is OK to use @code{eval-after-load} in your personal
|
||||
customizations if you don't feel that they must meet the design
|
||||
standards for programs meant for wider use.
|
||||
|
||||
@defvar after-load-alist
|
||||
This variable stores an alist built by @code{eval-after-load},
|
||||
containing the expressions to evaluate when certain libraries are
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2011-02-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* texinfo.tex: Update to version 2011-02-07.16.
|
||||
|
||||
2011-02-07 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* dbus.texi (Bus names): Adapt descriptions for
|
||||
|
|
6
etc/NEWS
6
etc/NEWS
|
@ -562,9 +562,9 @@ listing object name completions when being sent text via
|
|||
|
||||
** sregex.el is now obsolete, since rx.el is a strict superset.
|
||||
|
||||
** s-region.el is now declared obsolete, superceded by shift-select-mode
|
||||
enabled by default in 23.1.
|
||||
|
||||
** s-region.el and pc-select are now declared obsolete,
|
||||
superceded by shift-select-mode enabled by default in 23.1.
|
||||
** pc-mode.el is also declared obsolete.
|
||||
** gdb-mi
|
||||
|
||||
*** GDB User Interface migrated to GDB Machine Interface and now
|
||||
|
|
|
@ -1,3 +1,23 @@
|
|||
2011-02-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* make-docfile.c (EMACS_INTEGER): Rename from EMACS_INT.
|
||||
This avoids collision with config.h's EMACS_INT on some
|
||||
configurations. All uses changed.
|
||||
|
||||
2011-02-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* make-docfile.c: Unconditionally include stdlib.h.
|
||||
(generate_globals): New global.
|
||||
(xrealloc): New function.
|
||||
(main): Handle '-g'. Call start_globals, write_globals.
|
||||
(scan_file): Conditionally call put_filename.
|
||||
(start_globals): New function.
|
||||
(struct global): New.
|
||||
(num_globals, globals): New globals.
|
||||
(add_global, compare_globals, write_globals): New functions.
|
||||
(scan_c_file): Update for "-g".
|
||||
(scan_lisp_file): Fail if "-g".
|
||||
|
||||
2011-02-05 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* emacsclient.c: conform to C89 pointer rules
|
||||
|
|
|
@ -41,11 +41,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#undef chdir
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef MSDOS
|
||||
#include <fcntl.h>
|
||||
#endif /* MSDOS */
|
||||
#ifdef WINDOWSNT
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <direct.h>
|
||||
#endif /* WINDOWSNT */
|
||||
|
@ -70,6 +70,8 @@ int scan_file (char *filename);
|
|||
int scan_lisp_file (const char *filename, const char *mode);
|
||||
int scan_c_file (char *filename, const char *mode);
|
||||
void fatal (const char *s1, const char *s2) NO_RETURN;
|
||||
void start_globals (void);
|
||||
void write_globals (void);
|
||||
|
||||
#ifdef MSDOS
|
||||
/* s/msdos.h defines this as sys_chdir, but we're not linking with the
|
||||
|
@ -85,6 +87,9 @@ FILE *outfile;
|
|||
/* Name this program was invoked with. */
|
||||
char *progname;
|
||||
|
||||
/* Nonzero if this invocation is generating globals.h. */
|
||||
int generate_globals;
|
||||
|
||||
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
|
||||
|
||||
/* VARARGS1 */
|
||||
|
@ -116,6 +121,18 @@ xmalloc (unsigned int size)
|
|||
fatal ("virtual memory exhausted", 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Like realloc but get fatal error if memory is exhausted. */
|
||||
|
||||
void *
|
||||
xrealloc (void *arg, unsigned int size)
|
||||
{
|
||||
void *result = (void *) realloc (arg, size);
|
||||
if (result == NULL)
|
||||
fatal ("virtual memory exhausted", 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
|
@ -164,10 +181,18 @@ main (int argc, char **argv)
|
|||
}
|
||||
i += 2;
|
||||
}
|
||||
if (argc > i && !strcmp (argv[i], "-g"))
|
||||
{
|
||||
generate_globals = 1;
|
||||
++i;
|
||||
}
|
||||
|
||||
if (outfile == 0)
|
||||
fatal ("No output file specified", "");
|
||||
|
||||
if (generate_globals)
|
||||
start_globals ();
|
||||
|
||||
first_infile = i;
|
||||
for (; i < argc; i++)
|
||||
{
|
||||
|
@ -179,6 +204,10 @@ main (int argc, char **argv)
|
|||
if (j == i)
|
||||
err_count += scan_file (argv[i]);
|
||||
}
|
||||
|
||||
if (err_count == 0 && generate_globals)
|
||||
write_globals ();
|
||||
|
||||
return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -208,7 +237,8 @@ scan_file (char *filename)
|
|||
|
||||
size_t len = strlen (filename);
|
||||
|
||||
put_filename (filename);
|
||||
if (!generate_globals)
|
||||
put_filename (filename);
|
||||
if (len > 4 && !strcmp (filename + len - 4, ".elc"))
|
||||
return scan_lisp_file (filename, READ_BINARY);
|
||||
else if (len > 3 && !strcmp (filename + len - 3, ".el"))
|
||||
|
@ -216,6 +246,14 @@ scan_file (char *filename)
|
|||
else
|
||||
return scan_c_file (filename, READ_TEXT);
|
||||
}
|
||||
|
||||
void
|
||||
start_globals (void)
|
||||
{
|
||||
fprintf (outfile, "/* This file was auto-generated by make-docfile. */\n");
|
||||
fprintf (outfile, "/* DO NOT EDIT. */\n");
|
||||
fprintf (outfile, "struct emacs_globals {\n");
|
||||
}
|
||||
|
||||
char buf[128];
|
||||
|
||||
|
@ -516,6 +554,98 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
|
|||
|
||||
putc (')', out);
|
||||
}
|
||||
|
||||
/* The types of globals. */
|
||||
enum global_type
|
||||
{
|
||||
EMACS_INTEGER,
|
||||
BOOLEAN,
|
||||
LISP_OBJECT,
|
||||
INVALID
|
||||
};
|
||||
|
||||
/* A single global. */
|
||||
struct global
|
||||
{
|
||||
enum global_type type;
|
||||
char *name;
|
||||
};
|
||||
|
||||
/* All the variable names we saw while scanning C sources in `-g'
|
||||
mode. */
|
||||
int num_globals;
|
||||
int num_globals_allocated;
|
||||
struct global *globals;
|
||||
|
||||
static void
|
||||
add_global (enum global_type type, char *name)
|
||||
{
|
||||
/* Ignore the one non-symbol that can occur. */
|
||||
if (strcmp (name, "..."))
|
||||
{
|
||||
++num_globals;
|
||||
|
||||
if (num_globals_allocated == 0)
|
||||
{
|
||||
num_globals_allocated = 100;
|
||||
globals = xmalloc (num_globals_allocated * sizeof (struct global));
|
||||
}
|
||||
else if (num_globals == num_globals_allocated)
|
||||
{
|
||||
num_globals_allocated *= 2;
|
||||
globals = xrealloc (globals,
|
||||
num_globals_allocated * sizeof (struct global));
|
||||
}
|
||||
|
||||
globals[num_globals - 1].type = type;
|
||||
globals[num_globals - 1].name = name;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
compare_globals (const void *a, const void *b)
|
||||
{
|
||||
const struct global *ga = a;
|
||||
const struct global *gb = b;
|
||||
return strcmp (ga->name, gb->name);
|
||||
}
|
||||
|
||||
void
|
||||
write_globals (void)
|
||||
{
|
||||
int i;
|
||||
qsort (globals, num_globals, sizeof (struct global), compare_globals);
|
||||
for (i = 0; i < num_globals; ++i)
|
||||
{
|
||||
char *type;
|
||||
|
||||
switch (globals[i].type)
|
||||
{
|
||||
case EMACS_INTEGER:
|
||||
type = "EMACS_INT";
|
||||
break;
|
||||
case BOOLEAN:
|
||||
type = "int";
|
||||
break;
|
||||
case LISP_OBJECT:
|
||||
type = "Lisp_Object";
|
||||
break;
|
||||
default:
|
||||
fatal ("not a recognized DEFVAR_", 0);
|
||||
}
|
||||
|
||||
fprintf (outfile, " %s f_%s;\n", type, globals[i].name);
|
||||
fprintf (outfile, "#define %s globals.f_%s\n",
|
||||
globals[i].name, globals[i].name);
|
||||
while (i + 1 < num_globals
|
||||
&& !strcmp (globals[i].name, globals[i + 1].name))
|
||||
++i;
|
||||
}
|
||||
|
||||
fprintf (outfile, "};\n");
|
||||
fprintf (outfile, "extern struct emacs_globals globals;\n");
|
||||
}
|
||||
|
||||
|
||||
/* Read through a c file. If a .o file is named,
|
||||
the corresponding .c or .m file is read instead.
|
||||
|
@ -533,6 +663,7 @@ scan_c_file (char *filename, const char *mode)
|
|||
register int defvarflag;
|
||||
int minargs, maxargs;
|
||||
int extension = filename[strlen (filename) - 1];
|
||||
enum global_type type;
|
||||
|
||||
if (extension == 'o')
|
||||
filename[strlen (filename) - 1] = 'c';
|
||||
|
@ -599,8 +730,23 @@ scan_c_file (char *filename, const char *mode)
|
|||
|
||||
c = getc (infile);
|
||||
defvarperbufferflag = (c == 'P');
|
||||
if (generate_globals)
|
||||
{
|
||||
if (c == 'I')
|
||||
type = EMACS_INTEGER;
|
||||
else if (c == 'L')
|
||||
type = LISP_OBJECT;
|
||||
else if (c == 'B')
|
||||
type = BOOLEAN;
|
||||
else
|
||||
type = INVALID;
|
||||
}
|
||||
|
||||
c = getc (infile);
|
||||
/* We need to distinguish between DEFVAR_BOOL and
|
||||
DEFVAR_BUFFER_DEFAULTS. */
|
||||
if (generate_globals && type == BOOLEAN && c != 'O')
|
||||
type = INVALID;
|
||||
}
|
||||
else if (c == 'D')
|
||||
{
|
||||
|
@ -617,6 +763,10 @@ scan_c_file (char *filename, const char *mode)
|
|||
}
|
||||
else continue;
|
||||
|
||||
if (generate_globals && (!defvarflag || defvarperbufferflag
|
||||
|| type == INVALID))
|
||||
continue;
|
||||
|
||||
while (c != '(')
|
||||
{
|
||||
if (c < 0)
|
||||
|
@ -630,6 +780,34 @@ scan_c_file (char *filename, const char *mode)
|
|||
continue;
|
||||
c = read_c_string_or_comment (infile, -1, 0, 0);
|
||||
|
||||
if (generate_globals)
|
||||
{
|
||||
int i = 0;
|
||||
char *name;
|
||||
|
||||
/* Skip "," and whitespace. */
|
||||
do
|
||||
{
|
||||
c = getc (infile);
|
||||
}
|
||||
while (c == ',' || c == ' ' || c == '\t' || c == '\n' || c == '\r');
|
||||
|
||||
/* Read in the identifier. */
|
||||
do
|
||||
{
|
||||
buf[i++] = c;
|
||||
c = getc (infile);
|
||||
}
|
||||
while (! (c == ',' || c == ' ' || c == '\t' ||
|
||||
c == '\n' || c == '\r'));
|
||||
buf[i] = '\0';
|
||||
|
||||
name = xmalloc (i + 1);
|
||||
memcpy (name, buf, i + 1);
|
||||
add_global (type, name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* DEFVAR_LISP ("name", addr, "doc")
|
||||
DEFVAR_LISP ("name", addr /\* doc *\/)
|
||||
DEFVAR_LISP ("name", addr, doc: /\* doc *\/) */
|
||||
|
@ -845,6 +1023,9 @@ scan_lisp_file (const char *filename, const char *mode)
|
|||
register int c;
|
||||
char *saved_string = 0;
|
||||
|
||||
if (generate_globals)
|
||||
fatal ("scanning lisp file when -g specified", 0);
|
||||
|
||||
infile = fopen (filename, mode);
|
||||
if (infile == NULL)
|
||||
{
|
||||
|
|
|
@ -361,6 +361,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@
|
|||
NEXT_TIME_H = @NEXT_TIME_H@
|
||||
NEXT_UNISTD_H = @NEXT_UNISTD_H@
|
||||
NS_OBJ = @NS_OBJ@
|
||||
NS_OBJC_OBJ = @NS_OBJC_OBJ@
|
||||
NS_SUPPORT = @NS_SUPPORT@
|
||||
OBJEXT = @OBJEXT@
|
||||
OLDXMENU = @OLDXMENU@
|
||||
|
|
|
@ -1,3 +1,46 @@
|
|||
2011-02-10 Ken Manheimer <ken.manheimer@gmail.com>
|
||||
|
||||
* allout.el: Synopsis: Change allout user configuration so
|
||||
auto-activation is controlled solely by customization
|
||||
`allout-auto-activation'.
|
||||
|
||||
(allout-auto-activation-helper) (allout-setup): New autoloads
|
||||
implement new custom set procedure for allout-auto-activation.
|
||||
Also, explicitly invoke
|
||||
(allout-setup) after allout-auto-activation is custom-defined, to
|
||||
effect the settings in emacs sessions besides the few where
|
||||
allout-auto-activation customization is donea.
|
||||
(allout-auto-activation): Use allout-auto-activation-helper to
|
||||
:set. Revise the docstring.
|
||||
(allout-init): Reduce functionality to just customizing
|
||||
allout-auto-activation, and mark obsolete.
|
||||
(allout-mode): Respect string values for allout-auto-activation.
|
||||
Run allout-after-copy-or-kill-hook without any args.
|
||||
(allout-mode) (allout-layout) (allout-default-layout)
|
||||
(outlineify-sticky): Adjust docstring for new scheme.
|
||||
(allout-after-copy-or-kill-hook): No arguments - hook implementers
|
||||
should concentrate on the kill ring.
|
||||
|
||||
2011-02-09 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* progmodes/sh-script.el (sh-font-lock-open-heredoc): Fix case
|
||||
of here-doc that immediately follows a comment.
|
||||
|
||||
2011-02-09 Deniz Dogan <deniz.a.m.dogan@gmail.com>
|
||||
|
||||
* net/rcirc.el (rcirc-ctcp-sender-PING): Simplifying.
|
||||
|
||||
* net/rcirc.el (rcirc-cmd-ctcp): Use dedicated function when
|
||||
available.
|
||||
(rcirc-ctcp-sender-PING): New function.
|
||||
|
||||
2011-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* obsolete/pc-select.el: Rename from emulation/pc-select.el (bug#7940).
|
||||
Remove the mark/nomark handling, and activate shift-select-mode instead.
|
||||
|
||||
* obsolete/pc-mode.el: Rename from emulation/pc-mode.el.
|
||||
|
||||
2011-02-07 Jay Belanger <jay.p.belanger@gmail.com>
|
||||
|
||||
* calc/calc-units.el (math-logunits-quant): Add support for
|
||||
|
|
198
lisp/allout.el
198
lisp/allout.el
|
@ -62,18 +62,15 @@
|
|||
;; The latest development version and helpful notes are available at
|
||||
;; http://myriadicity.net/Sundry/EmacsAllout .
|
||||
;;
|
||||
;; The outline menubar additions provide quick reference to many of
|
||||
;; the features, and see the docstring of the variable `allout-init'
|
||||
;; for instructions on priming your Emacs session for automatic
|
||||
;; activation of allout-mode.
|
||||
;;
|
||||
;; See the docstring of the variables `allout-layout' and
|
||||
;; The outline menubar additions provide quick reference to many of the
|
||||
;; features. See the docstring of the variables `allout-layout' and
|
||||
;; `allout-auto-activation' for details on automatic activation of
|
||||
;; `allout-mode' as a minor mode. (It has changed since allout
|
||||
;; 3.x, for those of you that depend on the old method.)
|
||||
;; `allout-mode' as a minor mode. (`allout-init' is deprecated in favor of
|
||||
;; a purely customization-based method.)
|
||||
;;
|
||||
;; Note -- the lines beginning with `;;;_' are outline topic headers.
|
||||
;; Just `ESC-x eval-buffer' to give it a whirl.
|
||||
;; Customize `allout-auto-activation' to enable, then revisit this
|
||||
;; buffer to give it a whirl.
|
||||
|
||||
;; ken manheimer (ken dot manheimer at gmail dot com)
|
||||
|
||||
|
@ -271,35 +268,56 @@ See the existing keys for examples."
|
|||
:set 'allout-compose-and-institute-keymap
|
||||
)
|
||||
|
||||
;;;_ > allout-auto-activation-helper (var value)
|
||||
;;;###autoload
|
||||
(defun allout-auto-activation-helper (var value)
|
||||
"Institute `allout-auto-activation'.
|
||||
|
||||
Intended to be used as the `allout-auto-activation' :set function."
|
||||
(set-default var value)
|
||||
(allout-setup))
|
||||
;;;_ > allout-setup ()
|
||||
;;;###autoload
|
||||
(defun allout-setup ()
|
||||
"Do fundamental emacs session for allout auto-activation.
|
||||
|
||||
Establishes allout processing as part of visiting a file if
|
||||
`allout-auto-activation' is non-nil, or removes it otherwise.
|
||||
|
||||
The proper way to use this is through customizing the setting of
|
||||
`allout-auto-activation'."
|
||||
(if (not allout-auto-activation)
|
||||
(remove-hook 'find-file-hook 'allout-find-file-hook)
|
||||
(add-hook 'find-file-hook 'allout-find-file-hook)))
|
||||
;;;_ = allout-auto-activation
|
||||
;;;###autoload
|
||||
(defcustom allout-auto-activation nil
|
||||
"Regulates auto-activation modality of allout outlines -- see `allout-init'.
|
||||
"Configure allout outline mode auto-activation.
|
||||
|
||||
Setq-default by `allout-init' to regulate whether or not allout
|
||||
outline mode is automatically activated when the buffer-specific
|
||||
variable `allout-layout' is non-nil, and whether or not the layout
|
||||
dictated by `allout-layout' should be imposed on mode activation.
|
||||
Control whether and how allout outline mode is automatically
|
||||
activated when files are visited with non-nil buffer-specific
|
||||
file variable `allout-layout'.
|
||||
|
||||
With value t, auto-mode-activation and auto-layout are enabled.
|
||||
\(This also depends on `allout-find-file-hook' being installed in
|
||||
`find-file-hook', which is also done by `allout-init'.)
|
||||
When allout-auto-activation is \"On\" \(t), allout mode is
|
||||
activated in buffers with non-nil `allout-layout', and the
|
||||
specified layout is applied.
|
||||
|
||||
With value `ask', auto-mode-activation is enabled, and endorsement for
|
||||
With value \"ask\", auto-mode-activation is enabled, and endorsement for
|
||||
performing auto-layout is asked of the user each time.
|
||||
|
||||
With value `activate', only auto-mode-activation is enabled,
|
||||
auto-layout is not.
|
||||
With value \"activate\", only auto-mode-activation is enabled.
|
||||
Auto-layout is not.
|
||||
|
||||
With value nil, neither auto-mode-activation nor auto-layout are
|
||||
enabled.
|
||||
|
||||
See the docstring for `allout-init' for the proper interface to
|
||||
this variable."
|
||||
enabled, and allout auto-activation processing is removed from
|
||||
file visiting activities."
|
||||
:set 'allout-auto-activation-helper
|
||||
:type '(choice (const :tag "On" t)
|
||||
(const :tag "Ask about layout" "ask")
|
||||
(const :tag "Mode only" "activate")
|
||||
(const :tag "Off" nil))
|
||||
:group 'allout)
|
||||
(allout-setup)
|
||||
;;;_ = allout-default-layout
|
||||
(defcustom allout-default-layout '(-2 : 0)
|
||||
"Default allout outline layout specification.
|
||||
|
@ -311,7 +329,7 @@ layout specifications.
|
|||
A list value specifies a default layout for the current buffer,
|
||||
to be applied upon activation of `allout-mode'. Any non-nil
|
||||
value will automatically trigger `allout-mode', provided
|
||||
`allout-init' has been called to enable this behavior.
|
||||
`allout-auto-activation' has been customized to enable it.
|
||||
|
||||
The types of elements in the layout specification are:
|
||||
|
||||
|
@ -890,10 +908,10 @@ For details, see `allout-toggle-current-subtree-encryption's docstring."
|
|||
(defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring.
|
||||
"Buffer-specific setting for allout layout.
|
||||
|
||||
In buffers where this is non-nil (and if `allout-init' has been run, to
|
||||
enable this behavior), `allout-mode' will be automatically activated. The
|
||||
layout dictated by the value will be used to set the initial exposure when
|
||||
`allout-mode' is activated.
|
||||
In buffers where this is non-nil \(and if `allout-auto-activation'
|
||||
has been customized to enable this behavior), `allout-mode' will be
|
||||
automatically activated. The layout dictated by the value will be used to
|
||||
set the initial exposure when `allout-mode' is activated.
|
||||
|
||||
\*You should not setq-default this variable non-nil unless you want every
|
||||
visited file to be treated as an allout file.*
|
||||
|
@ -906,9 +924,9 @@ example, the following lines at the bottom of an Emacs Lisp file:
|
|||
;;;End:
|
||||
|
||||
dictate activation of `allout-mode' mode when the file is visited
|
||||
\(presuming allout-init was already run), followed by the
|
||||
equivalent of `(allout-expose-topic 0 : -1 -1 0)'. (This is
|
||||
the layout used for the allout.el source file.)
|
||||
\(presuming proper `allout-auto-activation' customization),
|
||||
followed by the equivalent of `(allout-expose-topic 0 : -1 -1 0)'.
|
||||
\(This is the layout used for the allout.el source file.)
|
||||
|
||||
`allout-default-layout' describes the specification format.
|
||||
`allout-layout' can additionally have the value `t', in which
|
||||
|
@ -1441,9 +1459,7 @@ This hook might be invoked multiple times by a single command.")
|
|||
(defvar allout-after-copy-or-kill-hook nil
|
||||
"*Hook that's run after copying outline text.
|
||||
|
||||
Functions on the hook should take two arguments:
|
||||
|
||||
START, END -- integers indicating the span containing the copied text.")
|
||||
Functions on the hook should not take any arguments.")
|
||||
;;;_ = allout-outside-normal-auto-fill-function
|
||||
(defvar allout-outside-normal-auto-fill-function nil
|
||||
"Value of normal-auto-fill-function outside of allout mode.
|
||||
|
@ -1621,84 +1637,19 @@ non-nil in a lasting way.")
|
|||
"If t, `allout-mode's last deactivation was deliberate.
|
||||
So `allout-post-command-business' should not reactivate it...")
|
||||
(make-variable-buffer-local 'allout-explicitly-deactivated)
|
||||
;;;_ > allout-init (&optional mode)
|
||||
(defun allout-init (&optional mode)
|
||||
"Prime `allout-mode' to enable/disable auto-activation, wrt `allout-layout'.
|
||||
;;;_ > allout-init (mode)
|
||||
(defun allout-init (mode)
|
||||
"DEPRECATED - configure allout activation by customizing
|
||||
`allout-auto-activation'. This function remains around, limited
|
||||
from what it did before, for backwards compatability.
|
||||
|
||||
MODE is one of the following symbols:
|
||||
MODE is the activation mode - see `allout-auto-activation' for
|
||||
valid values."
|
||||
|
||||
- nil (or no argument) deactivate auto-activation/layout;
|
||||
- `activate', enable auto-activation only;
|
||||
- `ask', enable auto-activation, and enable auto-layout but with
|
||||
confirmation for layout operation solicited from user each time;
|
||||
- `report', just report and return the current auto-activation state;
|
||||
- anything else (eg, t) for auto-activation and auto-layout, without
|
||||
any confirmation check.
|
||||
|
||||
Use this function to setup your Emacs session for automatic activation
|
||||
of allout outline mode, contingent to the buffer-specific setting of
|
||||
the `allout-layout' variable. (See `allout-layout' and
|
||||
`allout-expose-topic' docstrings for more details on auto layout).
|
||||
|
||||
`allout-init' works by setting up (or removing) the `allout-mode'
|
||||
find-file-hook, and giving `allout-auto-activation' a suitable
|
||||
setting.
|
||||
|
||||
To prime your Emacs session for full auto-outline operation, include
|
||||
the following two lines in your Emacs init file:
|
||||
|
||||
\(require 'allout)
|
||||
\(allout-init t)"
|
||||
|
||||
(interactive)
|
||||
(if (allout-called-interactively-p)
|
||||
(progn
|
||||
(setq mode
|
||||
(completing-read
|
||||
(concat "Select outline auto setup mode "
|
||||
"(empty for report, ? for options) ")
|
||||
'(("nil")("full")("activate")("deactivate")
|
||||
("ask") ("report") (""))
|
||||
nil
|
||||
t))
|
||||
(if (string= mode "")
|
||||
(setq mode 'report)
|
||||
(setq mode (intern-soft mode)))))
|
||||
(let
|
||||
;; convenience aliases, for consistent ref to respective vars:
|
||||
((hook 'allout-find-file-hook)
|
||||
(find-file-hook-var-name (if (boundp 'find-file-hook)
|
||||
'find-file-hook
|
||||
'find-file-hooks))
|
||||
(curr-mode 'allout-auto-activation))
|
||||
|
||||
(cond ((not mode)
|
||||
(set find-file-hook-var-name
|
||||
(delq hook (symbol-value find-file-hook-var-name)))
|
||||
(if (allout-called-interactively-p)
|
||||
(message "Allout outline mode auto-activation inhibited.")))
|
||||
((eq mode 'report)
|
||||
(if (not (memq hook (symbol-value find-file-hook-var-name)))
|
||||
(allout-init nil)
|
||||
;; Just punt and use the reports from each of the modes:
|
||||
(allout-init (symbol-value curr-mode))))
|
||||
(t (add-hook find-file-hook-var-name hook)
|
||||
(set curr-mode ; `set', not `setq'!
|
||||
(cond ((eq mode 'activate)
|
||||
(message
|
||||
"Outline mode auto-activation enabled.")
|
||||
'activate)
|
||||
((eq mode 'report)
|
||||
;; Return the current mode setting:
|
||||
(allout-init mode))
|
||||
((eq mode 'ask)
|
||||
(message
|
||||
(concat "Outline mode auto-activation and "
|
||||
"-layout (upon confirmation) enabled."))
|
||||
'ask)
|
||||
((message
|
||||
"Outline mode auto-activation and -layout enabled.")
|
||||
'full)))))))
|
||||
(custom-set-variables (list 'allout-auto-activation (format "%s" mode)))
|
||||
(format "%s" mode))
|
||||
(make-obsolete 'allout-init
|
||||
"customize 'allout-auto-activation' instead." "23.3")
|
||||
;;;_ > allout-setup-menubar ()
|
||||
(defun allout-setup-menubar ()
|
||||
"Populate the current buffer's menubar with `allout-mode' stuff."
|
||||
|
@ -1764,9 +1715,8 @@ and many other features.
|
|||
Below is a description of the key bindings, and then description
|
||||
of special `allout-mode' features and terminology. See also the
|
||||
outline menubar additions for quick reference to many of the
|
||||
features, and see the docstring of the function `allout-init' for
|
||||
instructions on priming your emacs session for automatic
|
||||
activation of `allout-mode'.
|
||||
features. Customize `allout-auto-activation' to prepare your
|
||||
emacs session for automatic activation of `allout-mode'.
|
||||
|
||||
The bindings are those listed in `allout-prefixed-keybindings'
|
||||
and `allout-unprefixed-keybindings'. We recommend customizing
|
||||
|
@ -1850,7 +1800,8 @@ M-x outlineify-sticky Activate outline mode for current buffer,
|
|||
Like above 'copy-exposed', but convert topic
|
||||
prefixes to section.subsection... numeric
|
||||
format.
|
||||
\\[eval-expression] (allout-init t) Setup Emacs session for outline mode
|
||||
\\[customize-variable] allout-auto-activation
|
||||
Prepare Emacs session for allout outline mode
|
||||
auto-activation.
|
||||
|
||||
Topic Encryption
|
||||
|
@ -2092,8 +2043,8 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
|
|||
(when (and allout-layout
|
||||
allout-auto-activation
|
||||
use-layout
|
||||
(and (not (eq allout-auto-activation 'activate))
|
||||
(if (eq allout-auto-activation 'ask)
|
||||
(and (not (string= allout-auto-activation "activate"))
|
||||
(if (string= allout-auto-activation "ask")
|
||||
(if (y-or-n-p (format "Expose %s with layout '%s'? "
|
||||
(buffer-name)
|
||||
use-layout))
|
||||
|
@ -3448,7 +3399,7 @@ Returns the qualifying command, if any, else nil."
|
|||
(defun allout-find-file-hook ()
|
||||
"Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'.
|
||||
|
||||
See `allout-init' for setup instructions."
|
||||
See `allout-auto-activation' for setup instructions."
|
||||
(if (and allout-auto-activation
|
||||
(not (allout-mode-p))
|
||||
allout-layout)
|
||||
|
@ -4394,7 +4345,7 @@ subtopics into siblings of the item."
|
|||
(if (and (not beg-hidden) (not end-hidden))
|
||||
(allout-unprotected (kill-line arg))
|
||||
(kill-line arg))
|
||||
(run-hook-with-args 'allout-after-copy-or-kill-hook beg end)
|
||||
(run-hooks 'allout-after-copy-or-kill-hook)
|
||||
(allout-deannotate-hidden beg end)
|
||||
|
||||
(if allout-numbered-bullet
|
||||
|
@ -4446,7 +4397,7 @@ Topic exposure is marked with text-properties, to be used by
|
|||
(unwind-protect ; for possible barf-if-buffer-read-only.
|
||||
(allout-unprotected (kill-region beg end))
|
||||
(allout-deannotate-hidden beg end)
|
||||
(run-hook-with-args 'allout-after-copy-or-kill-hook beg end)
|
||||
(run-hooks 'allout-after-copy-or-kill-hook)
|
||||
|
||||
(save-excursion
|
||||
(allout-renumber-to-depth depth))
|
||||
|
@ -4503,7 +4454,8 @@ Topic exposure is marked with text-properties, to be used by
|
|||
(allout-unprotected
|
||||
(let ((inhibit-read-only t)
|
||||
(buffer-undo-list t))
|
||||
(remove-text-properties begin end '(allout-was-hidden t)))))
|
||||
(remove-text-properties begin (min end (point-max))
|
||||
'(allout-was-hidden t)))))
|
||||
;;;_ > allout-hide-by-annotation (begin end)
|
||||
(defun allout-hide-by-annotation (begin end)
|
||||
"Translate text properties indicating exposure status into actual exposure."
|
||||
|
@ -6312,8 +6264,8 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info."
|
|||
(defun outlineify-sticky (&optional arg)
|
||||
"Activate outline mode and establish file var so it is started subsequently.
|
||||
|
||||
See doc-string for `allout-layout' and `allout-init' for details on
|
||||
setup for auto-startup."
|
||||
See `allout-layout' and customization of `allout-auto-activation'
|
||||
for details on preparing emacs for automatic allout activation."
|
||||
|
||||
(interactive "P")
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ Not documented
|
|||
;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from
|
||||
;;;;;; return block etypecase typecase ecase case load-time-value
|
||||
;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp
|
||||
;;;;;; gensym) "cl-macs" "cl-macs.el" "8b2ce9c2ec0e273606bb37c333c4bdde")
|
||||
;;;;;; gensym) "cl-macs" "cl-macs.el" "0904b956872432ae7cc5fa9abcefce63")
|
||||
;;; Generated autoloads from cl-macs.el
|
||||
|
||||
(autoload 'gensym "cl-macs" "\
|
||||
|
@ -389,7 +389,7 @@ This is equivalent to `(return-from nil RESULT)'.
|
|||
|
||||
(autoload 'return-from "cl-macs" "\
|
||||
Return from the block named NAME.
|
||||
This jump out to the innermost enclosing `(block NAME ...)' form,
|
||||
This jumps out to the innermost enclosing `(block NAME ...)' form,
|
||||
returning RESULT from that form (or nil if RESULT is omitted).
|
||||
This is compatible with Common Lisp, but note that `defun' and
|
||||
`defmacro' do not create implicit blocks as they do in Common Lisp.
|
||||
|
|
|
@ -1,985 +0,0 @@
|
|||
;;; pc-select.el --- emulate mark, cut, copy and paste from Motif
|
||||
;;; (or MAC GUI or MS-windoze (bah)) look-and-feel
|
||||
;;; including key bindings.
|
||||
|
||||
;; Copyright (C) 1995-1997, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE>
|
||||
;; Keywords: convenience emulations
|
||||
;; Created: 26 Sep 1995
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This package emulates the mark, copy, cut and paste look-and-feel of motif
|
||||
;; programs (which is the same as the MAC gui and (sorry for that) MS-Windows).
|
||||
;; It modifies the keybindings of the cursor keys and the next, prior,
|
||||
;; home and end keys. They will modify mark-active.
|
||||
;; You can still get the old behavior of cursor moving with the
|
||||
;; control sequences C-f, C-b, etc.
|
||||
;; This package uses transient-mark-mode and
|
||||
;; delete-selection-mode.
|
||||
;;
|
||||
;; In addition to that all key-bindings from the pc-mode are
|
||||
;; done here too (as suggested by RMS).
|
||||
;;
|
||||
;; As I found out after I finished the first version, s-region.el tries
|
||||
;; to do the same.... But my code is a little more complete and using
|
||||
;; delete-selection-mode is very important for the look-and-feel.
|
||||
;; Pete Forman <pete.forman@airgun.wg.waii.com> provided some motif
|
||||
;; compliant keybindings which I added. I had to modify them a little
|
||||
;; to add the -mark and -nomark functionality of cursor moving.
|
||||
;;
|
||||
;; Credits:
|
||||
;; Many thanks to all who made comments.
|
||||
;; Thanks to RMS and Ralf Muschall <prm@rz.uni-jena.de> for criticism.
|
||||
;; Kevin Cutts <cutts@ukraine.corp.mot.com> added the beginning-of-buffer
|
||||
;; and end-of-buffer functions which I modified a little.
|
||||
;; David Biesack <sasdjb@unx.sas.com> suggested some more cleanup.
|
||||
;; Thanks to Pete Forman <pete.forman@airgun.wg.waii.com>
|
||||
;; for additional motif keybindings.
|
||||
;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report
|
||||
;; concerning setting of this-command.
|
||||
;; Dan Nicolaescu <done@ece.arizona.ro> suggested suppressing the
|
||||
;; scroll-up/scroll-down error.
|
||||
;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and
|
||||
;; keybindings.
|
||||
;;
|
||||
;; Ok, some details about the idea of PC Selection mode:
|
||||
;;
|
||||
;; o The standard keys for moving around (right, left, up, down, home, end,
|
||||
;; prior, next, called "move-keys" from now on) will always de-activate
|
||||
;; the mark.
|
||||
;; o If you press "Shift" together with the "move-keys", the region
|
||||
;; you pass along is activated
|
||||
;; o You have the copy, cut and paste functions (as in many other programs)
|
||||
;; which will operate on the active region
|
||||
;; It was not possible to bind them to C-v, C-x and C-c for obvious
|
||||
;; emacs reasons.
|
||||
;; They will be bound according to the "old" behavior to S-delete (cut),
|
||||
;; S-insert (paste) and C-insert (copy). These keys do the same in many
|
||||
;; other programs.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Customization:
|
||||
(defgroup pc-select nil
|
||||
"Emulate pc bindings."
|
||||
:prefix "pc-select"
|
||||
:group 'emulations)
|
||||
|
||||
(defcustom pc-select-override-scroll-error t
|
||||
"Non-nil means don't generate error on scrolling past edge of buffer.
|
||||
This variable applies in PC Selection mode only.
|
||||
The scroll commands normally generate an error if you try to scroll
|
||||
past the top or bottom of the buffer. This is annoying when selecting
|
||||
text with these commands. If you set this variable to non-nil, these
|
||||
errors are suppressed."
|
||||
:type 'boolean
|
||||
:group 'pc-select)
|
||||
(define-obsolete-variable-alias 'pc-select-override-scroll-error
|
||||
'scroll-error-top-bottom
|
||||
"24.1")
|
||||
|
||||
(defcustom pc-select-selection-keys-only nil
|
||||
"Non-nil means only bind the basic selection keys when started.
|
||||
Other keys that emulate pc-behavior will be untouched.
|
||||
This gives mostly Emacs-like behavior with only the selection keys enabled."
|
||||
:type 'boolean
|
||||
:group 'pc-select)
|
||||
|
||||
(defcustom pc-select-meta-moves-sexps nil
|
||||
"Non-nil means move sexp-wise with Meta key, otherwise move word-wise."
|
||||
:type 'boolean
|
||||
:group 'pc-select)
|
||||
|
||||
(defcustom pc-selection-mode-hook nil
|
||||
"The hook to run when PC Selection mode is toggled."
|
||||
:type 'hook
|
||||
:group 'pc-select)
|
||||
|
||||
(defvar pc-select-saved-settings-alist nil
|
||||
"The values of the variables before PC Selection mode was toggled on.
|
||||
When PC Selection mode is toggled on, it sets quite a few variables
|
||||
for its own purposes. This alist holds the original values of the
|
||||
variables PC Selection mode had set, so that these variables can be
|
||||
restored to their original values when PC Selection mode is toggled off.")
|
||||
|
||||
(defvar pc-select-map nil
|
||||
"The keymap used as the global map when PC Selection mode is on." )
|
||||
|
||||
(defvar pc-select-saved-global-map nil
|
||||
"The global map that was in effect when PC Selection mode was toggled on.")
|
||||
|
||||
(defvar pc-select-key-bindings-alist nil
|
||||
"This alist holds all the key bindings PC Selection mode sets.")
|
||||
|
||||
(defvar pc-select-default-key-bindings nil
|
||||
"These key bindings always get set by PC Selection mode.")
|
||||
|
||||
(unless pc-select-default-key-bindings
|
||||
(let ((lst
|
||||
;; This is to avoid confusion with the delete-selection-mode.
|
||||
;; On simple displays you can't see that a region is active and
|
||||
;; will be deleted on the next keypress IMHO especially for
|
||||
;; copy-region-as-kill this is confusing.
|
||||
;; The same goes for exchange-point-and-mark
|
||||
'(("\M-w" . copy-region-as-kill-nomark)
|
||||
("\C-x\C-x" . exchange-point-and-mark-nomark)
|
||||
([S-right] . forward-char-mark)
|
||||
([right] . forward-char-nomark)
|
||||
([C-S-right] . forward-word-mark)
|
||||
([C-right] . forward-word-nomark)
|
||||
([S-left] . backward-char-mark)
|
||||
([left] . backward-char-nomark)
|
||||
([C-S-left] . backward-word-mark)
|
||||
([C-left] . backward-word-nomark)
|
||||
([S-down] . next-line-mark)
|
||||
([down] . next-line-nomark)
|
||||
|
||||
([S-end] . end-of-line-mark)
|
||||
([end] . end-of-line-nomark)
|
||||
([S-C-end] . end-of-buffer-mark)
|
||||
([C-end] . end-of-buffer-nomark)
|
||||
([S-M-end] . end-of-buffer-mark)
|
||||
([M-end] . end-of-buffer-nomark)
|
||||
|
||||
([S-next] . scroll-up-mark)
|
||||
([next] . scroll-up-nomark)
|
||||
|
||||
([S-up] . previous-line-mark)
|
||||
([up] . previous-line-nomark)
|
||||
|
||||
([S-home] . beginning-of-line-mark)
|
||||
([home] . beginning-of-line-nomark)
|
||||
([S-C-home] . beginning-of-buffer-mark)
|
||||
([C-home] . beginning-of-buffer-nomark)
|
||||
([S-M-home] . beginning-of-buffer-mark)
|
||||
([M-home] . beginning-of-buffer-nomark)
|
||||
|
||||
([M-S-down] . forward-line-mark)
|
||||
([M-down] . forward-line-nomark)
|
||||
([M-S-up] . backward-line-mark)
|
||||
([M-up] . backward-line-nomark)
|
||||
|
||||
([S-prior] . scroll-down-mark)
|
||||
([prior] . scroll-down-nomark)
|
||||
|
||||
;; Next four lines are from Pete Forman.
|
||||
([C-down] . forward-paragraph-nomark) ; KNextPara cDn
|
||||
([C-up] . backward-paragraph-nomark) ; KPrevPara cUp
|
||||
([S-C-down] . forward-paragraph-mark)
|
||||
([S-C-up] . backward-paragraph-mark))))
|
||||
|
||||
(setq pc-select-default-key-bindings lst)))
|
||||
|
||||
(defvar pc-select-extra-key-bindings nil
|
||||
"Key bindings to set only if `pc-select-selection-keys-only' is nil.")
|
||||
|
||||
;; The following keybindings are for standard ISO keyboards
|
||||
;; as they are used with IBM compatible PCs, IBM RS/6000,
|
||||
;; MACs, many X-Stations and probably more
|
||||
(unless pc-select-extra-key-bindings
|
||||
(let ((lst
|
||||
'(([S-insert] . yank)
|
||||
([C-insert] . copy-region-as-kill)
|
||||
([S-delete] . kill-region)
|
||||
|
||||
;; The following bindings are useful on Sun Type 3 keyboards
|
||||
;; They implement the Get-Delete-Put (copy-cut-paste)
|
||||
;; functions from sunview on the L6, L8 and L10 keys
|
||||
;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste.
|
||||
([f16] . copy-region-as-kill)
|
||||
([f18] . yank)
|
||||
([f20] . kill-region)
|
||||
|
||||
;; The following bindings are from Pete Forman.
|
||||
([f6] . other-window) ; KNextPane F6
|
||||
([C-delete] . kill-line) ; KEraseEndLine cDel
|
||||
("\M-\d" . undo) ; KUndo aBS
|
||||
|
||||
;; The following binding is taken from pc-mode.el
|
||||
;; as suggested by RMS.
|
||||
;; I only used the one that is not covered above.
|
||||
([C-M-delete] . kill-sexp)
|
||||
;; Next line proposed by Eli Barzilay
|
||||
([C-escape] . electric-buffer-list))))
|
||||
|
||||
(setq pc-select-extra-key-bindings lst)))
|
||||
|
||||
(defvar pc-select-meta-moves-sexps-key-bindings
|
||||
'((([M-S-right] . forward-sexp-mark)
|
||||
([M-right] . forward-sexp-nomark)
|
||||
([M-S-left] . backward-sexp-mark)
|
||||
([M-left] . backward-sexp-nomark))
|
||||
(([M-S-right] . forward-word-mark)
|
||||
([M-right] . forward-word-nomark)
|
||||
([M-S-left] . backward-word-mark)
|
||||
([M-left] . backward-word-nomark)))
|
||||
"The list of key bindings controlled by `pc-select-meta-moves-sexp'.
|
||||
The bindings in the car of this list get installed if
|
||||
`pc-select-meta-moves-sexp' is t, the bindings in the cadr of this
|
||||
list get installed otherwise.")
|
||||
|
||||
;; This is for tty. We don't turn on normal-erase-is-backspace,
|
||||
;; but bind keys as pc-selection-mode did before
|
||||
;; normal-erase-is-backspace was invented, to keep us back
|
||||
;; compatible.
|
||||
(defvar pc-select-tty-key-bindings
|
||||
'(([delete] . delete-char) ; KDelete Del
|
||||
([C-backspace] . backward-kill-word))
|
||||
"The list of key bindings controlled by `pc-select-selection-keys-only'.
|
||||
These key bindings get installed when running in a tty, but only if
|
||||
`pc-select-selection-keys-only' is nil.")
|
||||
|
||||
(defvar pc-select-old-M-delete-binding nil
|
||||
"Holds the old mapping of [M-delete] in the `function-key-map'.
|
||||
This variable holds the value associated with [M-delete] in the
|
||||
`function-key-map' before PC Selection mode had changed that
|
||||
association.")
|
||||
|
||||
;;;;
|
||||
;; misc
|
||||
;;;;
|
||||
|
||||
(provide 'pc-select)
|
||||
|
||||
(defun copy-region-as-kill-nomark (beg end)
|
||||
"Save the region as if killed, but don't kill it; deactivate mark.
|
||||
If `interprogram-cut-function' is non-nil, also save the text for a window
|
||||
system cut and paste.
|
||||
|
||||
Deactivating mark is to avoid confusion with `delete-selection-mode'
|
||||
and `transient-mark-mode'."
|
||||
(interactive "r")
|
||||
(copy-region-as-kill beg end)
|
||||
(setq mark-active nil)
|
||||
(message "Region saved"))
|
||||
|
||||
(defun exchange-point-and-mark-nomark ()
|
||||
"Like `exchange-point-and-mark' but without activating the mark."
|
||||
(interactive)
|
||||
(exchange-point-and-mark)
|
||||
(setq mark-active nil))
|
||||
|
||||
;;;;
|
||||
;; non-interactive
|
||||
;;;;
|
||||
(defun pc-select-ensure-mark ()
|
||||
;; make sure mark is active
|
||||
;; test if it is active, if it isn't, set it and activate it
|
||||
(or mark-active (set-mark-command nil))
|
||||
;; Remember who activated the mark.
|
||||
(setq mark-active 'pc-select))
|
||||
|
||||
(defun pc-select-maybe-deactivate-mark ()
|
||||
;; maybe switch off mark (only if *we* switched it on)
|
||||
(when (eq mark-active 'pc-select)
|
||||
(deactivate-mark)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;; forward and mark
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun forward-char-mark (&optional arg)
|
||||
"Ensure mark is active; move point right ARG characters (left if ARG negative).
|
||||
On reaching end of buffer, stop and signal error."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(forward-char arg))
|
||||
|
||||
(defun forward-word-mark (&optional arg)
|
||||
"Ensure mark is active; move point right ARG words (backward if ARG is negative).
|
||||
Normally returns t.
|
||||
If an edge of the buffer is reached, point is left there
|
||||
and nil is returned."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(forward-word arg))
|
||||
|
||||
(defun forward-line-mark (&optional arg)
|
||||
"Ensure mark is active; move cursor vertically down ARG lines."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(forward-line arg)
|
||||
(setq this-command 'forward-line)
|
||||
)
|
||||
|
||||
(defun forward-sexp-mark (&optional arg)
|
||||
"Ensure mark is active; move forward across one balanced expression (sexp).
|
||||
With argument, do it that many times. Negative arg -N means
|
||||
move backward across N balanced expressions."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(forward-sexp arg))
|
||||
|
||||
(defun forward-paragraph-mark (&optional arg)
|
||||
"Ensure mark is active; move forward to end of paragraph.
|
||||
With arg N, do it N times; negative arg -N means move backward N paragraphs.
|
||||
|
||||
A line which `paragraph-start' matches either separates paragraphs
|
||||
\(if `paragraph-separate' matches it also) or is the first line of a paragraph.
|
||||
A paragraph end is the beginning of a line which is not part of the paragraph
|
||||
to which the end of the previous line belongs, or the end of the buffer."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(forward-paragraph arg))
|
||||
|
||||
(defun next-line-mark (&optional arg)
|
||||
"Ensure mark is active; move cursor vertically down ARG lines.
|
||||
If there is no character in the target line exactly under the current column,
|
||||
the cursor is positioned after the character in that line which spans this
|
||||
column, or at the end of the line if it is not long enough.
|
||||
If there is no line in the buffer after this one, behavior depends on the
|
||||
value of `next-line-add-newlines'. If non-nil, it inserts a newline character
|
||||
to create a line, and moves the cursor to that line. Otherwise it moves the
|
||||
cursor to the end of the buffer \(if already at the end of the buffer, an error
|
||||
is signaled).
|
||||
|
||||
The command \\[set-goal-column] can be used to create
|
||||
a semipermanent goal column to which this command always moves.
|
||||
Then it does not try to move vertically. This goal column is stored
|
||||
in `goal-column', which is nil when there is none."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(with-no-warnings (next-line arg))
|
||||
(setq this-command 'next-line))
|
||||
|
||||
(defun end-of-line-mark (&optional arg)
|
||||
"Ensure mark is active; move point to end of current line.
|
||||
With argument ARG not nil or 1, move forward ARG - 1 lines first.
|
||||
If scan reaches end of buffer, stop there without error."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(end-of-line arg)
|
||||
(setq this-command 'end-of-line))
|
||||
|
||||
(defun backward-line-mark (&optional arg)
|
||||
"Ensure mark is active; move cursor vertically up ARG lines."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(if (null arg)
|
||||
(setq arg 1))
|
||||
(forward-line (- arg))
|
||||
(setq this-command 'forward-line)
|
||||
)
|
||||
|
||||
(defun scroll-down-mark (&optional arg)
|
||||
"Ensure mark is active; scroll down ARG lines; or near full screen if no ARG.
|
||||
A near full screen is `next-screen-context-lines' less than a full screen.
|
||||
Negative ARG means scroll upward.
|
||||
When calling from a program, supply a number as argument or nil.
|
||||
Attempting to scroll past the edge of buffer does not raise an
|
||||
error, unless `pc-select-override-scroll-error' is nil."
|
||||
(interactive "P")
|
||||
(pc-select-ensure-mark)
|
||||
(cond (pc-select-override-scroll-error
|
||||
(condition-case nil (scroll-down arg)
|
||||
(beginning-of-buffer (goto-char (point-min)))))
|
||||
(t (scroll-down arg))))
|
||||
|
||||
(defun end-of-buffer-mark (&optional arg)
|
||||
"Ensure mark is active; move point to the end of the buffer.
|
||||
With arg N, put point N/10 of the way from the end.
|
||||
|
||||
If the buffer is narrowed, this command uses the beginning and size
|
||||
of the accessible part of the buffer.
|
||||
|
||||
Don't use this command in Lisp programs!
|
||||
\(goto-char \(point-max)) is faster and avoids clobbering the mark."
|
||||
(interactive "P")
|
||||
(pc-select-ensure-mark)
|
||||
(let ((size (- (point-max) (point-min))))
|
||||
(goto-char (if arg
|
||||
(- (point-max)
|
||||
(if (> size 10000)
|
||||
;; Avoid overflow for large buffer sizes!
|
||||
(* (prefix-numeric-value arg)
|
||||
(/ size 10))
|
||||
(/ (* size (prefix-numeric-value arg)) 10)))
|
||||
(point-max))))
|
||||
;; If we went to a place in the middle of the buffer,
|
||||
;; adjust it to the beginning of a line.
|
||||
(if arg (forward-line 1)
|
||||
;; If the end of the buffer is not already on the screen,
|
||||
;; then scroll specially to put it near, but not at, the bottom.
|
||||
(if (let ((old-point (point)))
|
||||
(save-excursion
|
||||
(goto-char (window-start))
|
||||
(vertical-motion (window-height))
|
||||
(< (point) old-point)))
|
||||
(progn
|
||||
(overlay-recenter (point))
|
||||
(recenter -3)))))
|
||||
|
||||
;;;;;;;;;
|
||||
;;;;; no mark
|
||||
;;;;;;;;;
|
||||
|
||||
(defun forward-char-nomark (&optional arg)
|
||||
"Deactivate mark; move point right ARG characters \(left if ARG negative).
|
||||
On reaching end of buffer, stop and signal error."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(forward-char arg))
|
||||
|
||||
(defun forward-word-nomark (&optional arg)
|
||||
"Deactivate mark; move point right ARG words \(backward if ARG is negative).
|
||||
Normally returns t.
|
||||
If an edge of the buffer is reached, point is left there
|
||||
and nil is returned."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(forward-word arg))
|
||||
|
||||
(defun forward-line-nomark (&optional arg)
|
||||
"Deactivate mark; move cursor vertically down ARG lines."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(forward-line arg)
|
||||
(setq this-command 'forward-line)
|
||||
)
|
||||
|
||||
(defun forward-sexp-nomark (&optional arg)
|
||||
"Deactivate mark; move forward across one balanced expression (sexp).
|
||||
With argument, do it that many times. Negative arg -N means
|
||||
move backward across N balanced expressions."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(forward-sexp arg))
|
||||
|
||||
(defun forward-paragraph-nomark (&optional arg)
|
||||
"Deactivate mark; move forward to end of paragraph.
|
||||
With arg N, do it N times; negative arg -N means move backward N paragraphs.
|
||||
|
||||
A line which `paragraph-start' matches either separates paragraphs
|
||||
\(if `paragraph-separate' matches it also) or is the first line of a paragraph.
|
||||
A paragraph end is the beginning of a line which is not part of the paragraph
|
||||
to which the end of the previous line belongs, or the end of the buffer."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(forward-paragraph arg))
|
||||
|
||||
(defun next-line-nomark (&optional arg)
|
||||
"Deactivate mark; move cursor vertically down ARG lines.
|
||||
If there is no character in the target line exactly under the current column,
|
||||
the cursor is positioned after the character in that line which spans this
|
||||
column, or at the end of the line if it is not long enough.
|
||||
If there is no line in the buffer after this one, behavior depends on the
|
||||
value of `next-line-add-newlines'. If non-nil, it inserts a newline character
|
||||
to create a line, and moves the cursor to that line. Otherwise it moves the
|
||||
cursor to the end of the buffer (if already at the end of the buffer, an error
|
||||
is signaled).
|
||||
|
||||
The command \\[set-goal-column] can be used to create
|
||||
a semipermanent goal column to which this command always moves.
|
||||
Then it does not try to move vertically. This goal column is stored
|
||||
in `goal-column', which is nil when there is none."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(with-no-warnings (next-line arg))
|
||||
(setq this-command 'next-line))
|
||||
|
||||
(defun end-of-line-nomark (&optional arg)
|
||||
"Deactivate mark; move point to end of current line.
|
||||
With argument ARG not nil or 1, move forward ARG - 1 lines first.
|
||||
If scan reaches end of buffer, stop there without error."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(end-of-line arg)
|
||||
(setq this-command 'end-of-line))
|
||||
|
||||
(defun backward-line-nomark (&optional arg)
|
||||
"Deactivate mark; move cursor vertically up ARG lines."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(if (null arg)
|
||||
(setq arg 1))
|
||||
(forward-line (- arg))
|
||||
(setq this-command 'forward-line)
|
||||
)
|
||||
|
||||
(defun scroll-down-nomark (&optional arg)
|
||||
"Deactivate mark; scroll down ARG lines; or near full screen if no ARG.
|
||||
A near full screen is `next-screen-context-lines' less than a full screen.
|
||||
Negative ARG means scroll upward.
|
||||
When calling from a program, supply a number as argument or nil.
|
||||
Attempting to scroll past the edge of buffer does not raise an
|
||||
error, unless `pc-select-override-scroll-error' is nil."
|
||||
(interactive "P")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(cond (pc-select-override-scroll-error
|
||||
(condition-case nil (scroll-down arg)
|
||||
(beginning-of-buffer (goto-char (point-min)))))
|
||||
(t (scroll-down arg))))
|
||||
|
||||
(defun end-of-buffer-nomark (&optional arg)
|
||||
"Deactivate mark; move point to the end of the buffer.
|
||||
With arg N, put point N/10 of the way from the end.
|
||||
|
||||
If the buffer is narrowed, this command uses the beginning and size
|
||||
of the accessible part of the buffer.
|
||||
|
||||
Don't use this command in Lisp programs!
|
||||
\(goto-char (point-max)) is faster and avoids clobbering the mark."
|
||||
(interactive "P")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(let ((size (- (point-max) (point-min))))
|
||||
(goto-char (if arg
|
||||
(- (point-max)
|
||||
(if (> size 10000)
|
||||
;; Avoid overflow for large buffer sizes!
|
||||
(* (prefix-numeric-value arg)
|
||||
(/ size 10))
|
||||
(/ (* size (prefix-numeric-value arg)) 10)))
|
||||
(point-max))))
|
||||
;; If we went to a place in the middle of the buffer,
|
||||
;; adjust it to the beginning of a line.
|
||||
(if arg (forward-line 1)
|
||||
;; If the end of the buffer is not already on the screen,
|
||||
;; then scroll specially to put it near, but not at, the bottom.
|
||||
(if (let ((old-point (point)))
|
||||
(save-excursion
|
||||
(goto-char (window-start))
|
||||
(vertical-motion (window-height))
|
||||
(< (point) old-point)))
|
||||
(progn
|
||||
(overlay-recenter (point))
|
||||
(recenter -3)))))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;; backwards and mark
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun backward-char-mark (&optional arg)
|
||||
"Ensure mark is active; move point left ARG characters (right if ARG negative).
|
||||
On attempt to pass beginning or end of buffer, stop and signal error."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(backward-char arg))
|
||||
|
||||
(defun backward-word-mark (&optional arg)
|
||||
"Ensure mark is active; move backward until encountering the end of a word.
|
||||
With argument, do this that many times."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(backward-word arg))
|
||||
|
||||
(defun backward-sexp-mark (&optional arg)
|
||||
"Ensure mark is active; move backward across one balanced expression (sexp).
|
||||
With argument, do it that many times. Negative arg -N means
|
||||
move forward across N balanced expressions."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(backward-sexp arg))
|
||||
|
||||
(defun backward-paragraph-mark (&optional arg)
|
||||
"Ensure mark is active; move backward to start of paragraph.
|
||||
With arg N, do it N times; negative arg -N means move forward N paragraphs.
|
||||
|
||||
A paragraph start is the beginning of a line which is a
|
||||
`first-line-of-paragraph' or which is ordinary text and follows a
|
||||
paragraph-separating line; except: if the first real line of a
|
||||
paragraph is preceded by a blank line, the paragraph starts at that
|
||||
blank line.
|
||||
|
||||
See `forward-paragraph' for more information."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(backward-paragraph arg))
|
||||
|
||||
(defun previous-line-mark (&optional arg)
|
||||
"Ensure mark is active; move cursor vertically up ARG lines.
|
||||
If there is no character in the target line exactly over the current column,
|
||||
the cursor is positioned after the character in that line which spans this
|
||||
column, or at the end of the line if it is not long enough.
|
||||
|
||||
The command \\[set-goal-column] can be used to create
|
||||
a semipermanent goal column to which this command always moves.
|
||||
Then it does not try to move vertically.
|
||||
|
||||
If you are thinking of using this in a Lisp program, consider using
|
||||
`forward-line' with a negative argument instead. It is usually easier
|
||||
to use and more reliable (no dependence on goal column, etc.)."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(with-no-warnings (previous-line arg))
|
||||
(setq this-command 'previous-line))
|
||||
|
||||
(defun beginning-of-line-mark (&optional arg)
|
||||
"Ensure mark is active; move point to beginning of current line.
|
||||
With argument ARG not nil or 1, move forward ARG - 1 lines first.
|
||||
If scan reaches end of buffer, stop there without error."
|
||||
(interactive "p")
|
||||
(pc-select-ensure-mark)
|
||||
(beginning-of-line arg))
|
||||
|
||||
|
||||
(defun scroll-up-mark (&optional arg)
|
||||
"Ensure mark is active; scroll upward ARG lines; or near full screen if no ARG.
|
||||
A near full screen is `next-screen-context-lines' less than a full screen.
|
||||
Negative ARG means scroll downward.
|
||||
When calling from a program, supply a number as argument or nil.
|
||||
Attempting to scroll past the edge of buffer does not raise an
|
||||
error, unless `pc-select-override-scroll-error' is nil."
|
||||
(interactive "P")
|
||||
(pc-select-ensure-mark)
|
||||
(cond (pc-select-override-scroll-error
|
||||
(condition-case nil (scroll-up arg)
|
||||
(end-of-buffer (goto-char (point-max)))))
|
||||
(t (scroll-up arg))))
|
||||
|
||||
(defun beginning-of-buffer-mark (&optional arg)
|
||||
"Ensure mark is active; move point to the beginning of the buffer.
|
||||
With arg N, put point N/10 of the way from the beginning.
|
||||
|
||||
If the buffer is narrowed, this command uses the beginning and size
|
||||
of the accessible part of the buffer.
|
||||
|
||||
Don't use this command in Lisp programs!
|
||||
\(goto-char (point-min)) is faster and avoids clobbering the mark."
|
||||
(interactive "P")
|
||||
(pc-select-ensure-mark)
|
||||
(let ((size (- (point-max) (point-min))))
|
||||
(goto-char (if arg
|
||||
(+ (point-min)
|
||||
(if (> size 10000)
|
||||
;; Avoid overflow for large buffer sizes!
|
||||
(* (prefix-numeric-value arg)
|
||||
(/ size 10))
|
||||
(/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
|
||||
(point-min))))
|
||||
(if arg (forward-line 1)))
|
||||
|
||||
;;;;;;;;
|
||||
;;; no mark
|
||||
;;;;;;;;
|
||||
|
||||
(defun backward-char-nomark (&optional arg)
|
||||
"Deactivate mark; move point left ARG characters (right if ARG negative).
|
||||
On attempt to pass beginning or end of buffer, stop and signal error."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(backward-char arg))
|
||||
|
||||
(defun backward-word-nomark (&optional arg)
|
||||
"Deactivate mark; move backward until encountering the end of a word.
|
||||
With argument, do this that many times."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(backward-word arg))
|
||||
|
||||
(defun backward-sexp-nomark (&optional arg)
|
||||
"Deactivate mark; move backward across one balanced expression (sexp).
|
||||
With argument, do it that many times. Negative arg -N means
|
||||
move forward across N balanced expressions."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(backward-sexp arg))
|
||||
|
||||
(defun backward-paragraph-nomark (&optional arg)
|
||||
"Deactivate mark; move backward to start of paragraph.
|
||||
With arg N, do it N times; negative arg -N means move forward N paragraphs.
|
||||
|
||||
A paragraph start is the beginning of a line which is a
|
||||
`first-line-of-paragraph' or which is ordinary text and follows a
|
||||
paragraph-separating line; except: if the first real line of a
|
||||
paragraph is preceded by a blank line, the paragraph starts at that
|
||||
blank line.
|
||||
|
||||
See `forward-paragraph' for more information."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(backward-paragraph arg))
|
||||
|
||||
(defun previous-line-nomark (&optional arg)
|
||||
"Deactivate mark; move cursor vertically up ARG lines.
|
||||
If there is no character in the target line exactly over the current column,
|
||||
the cursor is positioned after the character in that line which spans this
|
||||
column, or at the end of the line if it is not long enough.
|
||||
|
||||
The command \\[set-goal-column] can be used to create
|
||||
a semipermanent goal column to which this command always moves.
|
||||
Then it does not try to move vertically."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(with-no-warnings (previous-line arg))
|
||||
(setq this-command 'previous-line))
|
||||
|
||||
(defun beginning-of-line-nomark (&optional arg)
|
||||
"Deactivate mark; move point to beginning of current line.
|
||||
With argument ARG not nil or 1, move forward ARG - 1 lines first.
|
||||
If scan reaches end of buffer, stop there without error."
|
||||
(interactive "p")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(beginning-of-line arg))
|
||||
|
||||
(defun scroll-up-nomark (&optional arg)
|
||||
"Deactivate mark; scroll upward ARG lines; or near full screen if no ARG.
|
||||
A near full screen is `next-screen-context-lines' less than a full screen.
|
||||
Negative ARG means scroll downward.
|
||||
When calling from a program, supply a number as argument or nil.
|
||||
Attempting to scroll past the edge of buffer does not raise an
|
||||
error, unless `pc-select-override-scroll-error' is nil."
|
||||
(interactive "P")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(cond (pc-select-override-scroll-error
|
||||
(condition-case nil (scroll-up arg)
|
||||
(end-of-buffer (goto-char (point-max)))))
|
||||
(t (scroll-up arg))))
|
||||
|
||||
(defun beginning-of-buffer-nomark (&optional arg)
|
||||
"Deactivate mark; move point to the beginning of the buffer.
|
||||
With arg N, put point N/10 of the way from the beginning.
|
||||
|
||||
If the buffer is narrowed, this command uses the beginning and size
|
||||
of the accessible part of the buffer.
|
||||
|
||||
Don't use this command in Lisp programs!
|
||||
\(goto-char (point-min)) is faster and avoids clobbering the mark."
|
||||
(interactive "P")
|
||||
(pc-select-maybe-deactivate-mark)
|
||||
(let ((size (- (point-max) (point-min))))
|
||||
(goto-char (if arg
|
||||
(+ (point-min)
|
||||
(if (> size 10000)
|
||||
;; Avoid overflow for large buffer sizes!
|
||||
(* (prefix-numeric-value arg)
|
||||
(/ size 10))
|
||||
(/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
|
||||
(point-min))))
|
||||
(if arg (forward-line 1)))
|
||||
|
||||
|
||||
(defun pc-select-define-keys (alist keymap)
|
||||
"Make KEYMAP have the key bindings specified in ALIST."
|
||||
(let ((lst alist))
|
||||
(while lst
|
||||
(define-key keymap (caar lst) (cdar lst))
|
||||
(setq lst (cdr lst)))))
|
||||
|
||||
(defun pc-select-restore-keys (alist keymap saved-map)
|
||||
"Use ALIST to restore key bindings from SAVED-MAP into KEYMAP.
|
||||
Go through all the key bindings in ALIST, and, for each key
|
||||
binding, if KEYMAP and ALIST still agree on the key binding,
|
||||
restore the previous value of that key binding from SAVED-MAP."
|
||||
(let ((lst alist))
|
||||
(while lst
|
||||
(when (equal (lookup-key keymap (caar lst)) (cdar lst))
|
||||
(define-key keymap (caar lst) (lookup-key saved-map (caar lst))))
|
||||
(setq lst (cdr lst)))))
|
||||
|
||||
(defmacro pc-select-add-to-alist (alist var val)
|
||||
"Ensure that ALIST contains the cons cell (VAR . VAL).
|
||||
If a cons cell whose car is VAR is already on the ALIST, update the
|
||||
cdr of that cell with VAL. Otherwise, make a new cons cell
|
||||
\(VAR . VAL), and prepend it onto ALIST."
|
||||
(let ((elt (make-symbol "elt")))
|
||||
`(let ((,elt (assq ',var ,alist)))
|
||||
(if ,elt
|
||||
(setcdr ,elt ,val)
|
||||
(setq ,alist (cons (cons ',var ,val) ,alist))))))
|
||||
|
||||
(defmacro pc-select-save-and-set-var (var newval)
|
||||
"Set VAR to NEWVAL; save the old value.
|
||||
The old value is saved on the `pc-select-saved-settings-alist'."
|
||||
`(when (boundp ',var)
|
||||
(pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)
|
||||
(setq ,var ,newval)))
|
||||
|
||||
(defmacro pc-select-save-and-set-mode (mode &optional arg mode-var)
|
||||
"Call the function MODE; save the old value of the variable MODE.
|
||||
MODE is presumed to be a function which turns on a minor mode. First,
|
||||
save the value of the variable MODE on `pc-select-saved-settings-alist'.
|
||||
Then, if ARG is specified, call MODE with ARG, otherwise call it with
|
||||
nil as an argument. If MODE-VAR is specified, save the value of the
|
||||
variable MODE-VAR (instead of the value of the variable MODE) on
|
||||
`pc-select-saved-settings-alist'."
|
||||
(unless mode-var (setq mode-var mode))
|
||||
`(when (fboundp ',mode)
|
||||
(pc-select-add-to-alist pc-select-saved-settings-alist
|
||||
,mode-var ,mode-var)
|
||||
(,mode ,arg)))
|
||||
|
||||
(defmacro pc-select-restore-var (var)
|
||||
"Restore the previous value of the variable VAR.
|
||||
Look up VAR's previous value in `pc-select-saved-settings-alist', and,
|
||||
if the value is found, set VAR to that value."
|
||||
(let ((elt (make-symbol "elt")))
|
||||
`(let ((,elt (assq ',var pc-select-saved-settings-alist)))
|
||||
(unless (null ,elt)
|
||||
(setq ,var (cdr ,elt))))))
|
||||
|
||||
(defmacro pc-select-restore-mode (mode)
|
||||
"Restore the previous state (either on or off) of the minor mode MODE.
|
||||
Look up the value of the variable MODE on `pc-select-saved-settings-alist'.
|
||||
If the value is non-nil, call the function MODE with an argument of
|
||||
1, otherwise call it with an argument of -1."
|
||||
(let ((elt (make-symbol "elt")))
|
||||
`(when (fboundp ',mode)
|
||||
(let ((,elt (assq ',mode pc-select-saved-settings-alist)))
|
||||
(unless (null ,elt)
|
||||
(,mode (if (cdr ,elt) 1 -1)))))))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode pc-selection-mode
|
||||
"Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style.
|
||||
|
||||
This mode enables Delete Selection mode and Transient Mark mode.
|
||||
|
||||
The arrow keys (and others) are bound to new functions
|
||||
which modify the status of the mark.
|
||||
|
||||
The ordinary arrow keys disable the mark.
|
||||
The shift-arrow keys move, leaving the mark behind.
|
||||
|
||||
C-LEFT and C-RIGHT move back or forward one word, disabling the mark.
|
||||
S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind.
|
||||
|
||||
M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark.
|
||||
S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark
|
||||
behind. To control whether these keys move word-wise or sexp-wise set the
|
||||
variable `pc-select-meta-moves-sexps' after loading pc-select.el but before
|
||||
turning PC Selection mode on.
|
||||
|
||||
C-DOWN and C-UP move back or forward a paragraph, disabling the mark.
|
||||
S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind.
|
||||
|
||||
HOME moves to beginning of line, disabling the mark.
|
||||
S-HOME moves to beginning of line, leaving the mark behind.
|
||||
With Ctrl or Meta, these keys move to beginning of buffer instead.
|
||||
|
||||
END moves to end of line, disabling the mark.
|
||||
S-END moves to end of line, leaving the mark behind.
|
||||
With Ctrl or Meta, these keys move to end of buffer instead.
|
||||
|
||||
PRIOR or PAGE-UP scrolls and disables the mark.
|
||||
S-PRIOR or S-PAGE-UP scrolls and leaves the mark behind.
|
||||
|
||||
S-DELETE kills the region (`kill-region').
|
||||
S-INSERT yanks text from the kill ring (`yank').
|
||||
C-INSERT copies the region into the kill ring (`copy-region-as-kill').
|
||||
|
||||
In addition, certain other PC bindings are imitated (to avoid this, set
|
||||
the variable `pc-select-selection-keys-only' to t after loading pc-select.el
|
||||
but before calling PC Selection mode):
|
||||
|
||||
F6 other-window
|
||||
DELETE delete-char
|
||||
C-DELETE kill-line
|
||||
M-DELETE kill-word
|
||||
C-M-DELETE kill-sexp
|
||||
C-BACKSPACE backward-kill-word
|
||||
M-BACKSPACE undo"
|
||||
;; FIXME: bring pc-bindings-mode here ?
|
||||
nil nil nil
|
||||
|
||||
:group 'pc-select
|
||||
:global t
|
||||
|
||||
(if pc-selection-mode
|
||||
(if (null pc-select-key-bindings-alist)
|
||||
(progn
|
||||
(setq pc-select-saved-global-map (copy-keymap (current-global-map)))
|
||||
(setq pc-select-key-bindings-alist
|
||||
(append pc-select-default-key-bindings
|
||||
(if pc-select-selection-keys-only
|
||||
nil
|
||||
pc-select-extra-key-bindings)
|
||||
(if pc-select-meta-moves-sexps
|
||||
(car pc-select-meta-moves-sexps-key-bindings)
|
||||
(cadr pc-select-meta-moves-sexps-key-bindings))
|
||||
(if (or pc-select-selection-keys-only
|
||||
(eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
nil
|
||||
pc-select-tty-key-bindings)))
|
||||
|
||||
(pc-select-define-keys pc-select-key-bindings-alist
|
||||
(current-global-map))
|
||||
|
||||
(unless (or pc-select-selection-keys-only
|
||||
(eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
;; it is not clear that we need the following line
|
||||
;; I hope it doesn't do too much harm to leave it in, though...
|
||||
(setq pc-select-old-M-delete-binding
|
||||
(lookup-key function-key-map [M-delete]))
|
||||
(define-key function-key-map [M-delete] [?\M-d]))
|
||||
|
||||
(when (and (not pc-select-selection-keys-only)
|
||||
(or (eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
(fboundp 'normal-erase-is-backspace-mode))
|
||||
(pc-select-save-and-set-mode normal-erase-is-backspace-mode 1
|
||||
normal-erase-is-backspace))
|
||||
;; the original author also had this above:
|
||||
;; (setq-default normal-erase-is-backspace t)
|
||||
;; However, the documentation for the variable says that
|
||||
;; "setting it with setq has no effect", so I'm removing it.
|
||||
|
||||
(pc-select-save-and-set-var highlight-nonselected-windows nil)
|
||||
(pc-select-save-and-set-var transient-mark-mode t)
|
||||
(pc-select-save-and-set-var mark-even-if-inactive t)
|
||||
(pc-select-save-and-set-mode delete-selection-mode 1))
|
||||
;;else
|
||||
;; If the user turned on pc-selection-mode a second time
|
||||
;; do not clobber the values of the variables that were
|
||||
;; saved from before pc-selection mode was activated --
|
||||
;; just make sure the values are the way we like them.
|
||||
(pc-select-define-keys pc-select-key-bindings-alist
|
||||
(current-global-map))
|
||||
(unless (or pc-select-selection-keys-only
|
||||
(eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
;; it is not clear that we need the following line
|
||||
;; I hope it doesn't do too much harm to leave it in, though...
|
||||
(define-key function-key-map [M-delete] [?\M-d]))
|
||||
(when (and (not pc-select-selection-keys-only)
|
||||
(or (eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
(fboundp 'normal-erase-is-backspace-mode))
|
||||
(normal-erase-is-backspace-mode 1))
|
||||
(setq highlight-nonselected-windows nil)
|
||||
(setq transient-mark-mode t)
|
||||
(setq mark-even-if-inactive t)
|
||||
(delete-selection-mode 1))
|
||||
;;else
|
||||
(when pc-select-key-bindings-alist
|
||||
(when (and (not pc-select-selection-keys-only)
|
||||
(or (eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt))))
|
||||
(pc-select-restore-mode normal-erase-is-backspace-mode))
|
||||
|
||||
(pc-select-restore-keys
|
||||
pc-select-key-bindings-alist (current-global-map)
|
||||
pc-select-saved-global-map)
|
||||
|
||||
(pc-select-restore-var highlight-nonselected-windows)
|
||||
(pc-select-restore-var transient-mark-mode)
|
||||
(pc-select-restore-var mark-even-if-inactive)
|
||||
(pc-select-restore-mode delete-selection-mode)
|
||||
(and pc-select-old-M-delete-binding
|
||||
(define-key function-key-map [M-delete]
|
||||
pc-select-old-M-delete-binding))
|
||||
(setq pc-select-key-bindings-alist nil
|
||||
pc-select-saved-settings-alist nil))))
|
||||
|
||||
;;; pc-select.el ends here
|
|
@ -1,3 +1,13 @@
|
|||
2011-02-07 Julien Danjou <julien@danjou.info>
|
||||
|
||||
* erc-track.el (erc-window-configuration-change): New function.
|
||||
This will allow to track buffer visibility when a command is
|
||||
finished to executed. Idea stolen from rcirc.
|
||||
(track): Put erc-window-configuration-change in
|
||||
window-configuration-change-hook.
|
||||
(erc-modified-channels-update): Remove
|
||||
erc-modified-channels-update from post-command-hook after update.
|
||||
|
||||
2011-01-31 Antoine Levitt <antoine.levitt@gmail.com> (tiny change)
|
||||
|
||||
* erc-track.el (track): Don't reset erc-modified-channels-object
|
||||
|
|
|
@ -653,7 +653,7 @@ module, otherwise the keybindings will not do anything useful."
|
|||
(defadvice switch-to-buffer (after erc-update (&rest args) activate)
|
||||
(erc-modified-channels-update))
|
||||
(add-hook 'window-configuration-change-hook
|
||||
'erc-modified-channels-update))
|
||||
'erc-window-configuration-change))
|
||||
(add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
|
||||
(add-hook 'erc-disconnected-hook 'erc-modified-channels-update))
|
||||
;; enable the tracking keybindings
|
||||
|
@ -675,7 +675,7 @@ module, otherwise the keybindings will not do anything useful."
|
|||
(if (featurep 'xemacs)
|
||||
(ad-disable-advice 'switch-to-buffer 'after 'erc-update)
|
||||
(remove-hook 'window-configuration-change-hook
|
||||
'erc-modified-channels-update))
|
||||
'erc-window-configuration-change))
|
||||
(remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
|
||||
(remove-hook 'erc-insert-post-hook 'erc-track-modified-channels))
|
||||
;; disable the tracking keybindings
|
||||
|
@ -730,6 +730,12 @@ only consider active buffers visible.")
|
|||
|
||||
;;; Tracking the channel modifications
|
||||
|
||||
(defun erc-window-configuration-change ()
|
||||
(unless (minibuffer-window-active-p (minibuffer-window))
|
||||
;; delay this until command has finished to make sure window is
|
||||
;; actually visible before clearing activity
|
||||
(add-hook 'post-command-hook 'erc-modified-channels-update)))
|
||||
|
||||
(defvar erc-modified-channels-update-inside nil
|
||||
"Variable to prevent running `erc-modified-channels-update' multiple
|
||||
times. Without it, you cannot debug `erc-modified-channels-display',
|
||||
|
@ -757,8 +763,9 @@ ARGS are ignored."
|
|||
(erc-modified-channels-remove-buffer buffer))))
|
||||
erc-modified-channels-alist)
|
||||
(when removed-channel
|
||||
(erc-modified-channels-display)
|
||||
(force-mode-line-update t)))))
|
||||
(erc-modified-channels-display)
|
||||
(force-mode-line-update t)))
|
||||
(remove-hook 'post-command-hook 'erc-modified-channels-update)))
|
||||
|
||||
(defvar erc-track-mouse-face (if (featurep 'xemacs)
|
||||
'modeline-mousable
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
2011-02-09 Lars Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* nntp.el (nntp-retrieve-group-data-early-disabled): Disable the async
|
||||
code for now, since it doesn't work for all users.
|
||||
|
||||
2011-02-09 Julien Danjou <julien@danjou.info>
|
||||
|
||||
* message.el (message-options): Make message-options really buffer
|
||||
local.
|
||||
|
||||
2011-02-08 Julien Danjou <julien@danjou.info>
|
||||
|
||||
* shr.el (shr-tag-body): Add support for text attribute in body
|
||||
markups.
|
||||
|
||||
* message.el (message-options): Make message-options a local variable.
|
||||
|
||||
2011-02-07 Lars Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* nnimap.el (nnimap-update-info): Refactor slightly.
|
||||
|
@ -7,6 +24,7 @@
|
|||
characters.
|
||||
(nnimap-process-quirk): Renamed function to avoid collision.
|
||||
(nnimap-update-info): Fix macrology bug-out.
|
||||
(nnimap-update-info): Simplify split history test.
|
||||
|
||||
2011-02-06 Lars Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
|
|
|
@ -1814,6 +1814,7 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
|
|||
|
||||
(defvar message-options nil
|
||||
"Some saved answers when sending message.")
|
||||
(make-variable-buffer-local 'message-options)
|
||||
|
||||
(defvar message-send-mail-real-function nil
|
||||
"Internal send mail function.")
|
||||
|
|
|
@ -1342,13 +1342,11 @@ textual parts.")
|
|||
;; Tell Gnus whether there are any \Recent messages in any of
|
||||
;; the groups.
|
||||
(let ((recent (cdr (assoc '%Recent flags))))
|
||||
(when (and active recent)
|
||||
(while recent
|
||||
(when (> (car recent) (cdr active))
|
||||
(push (list (cons (gnus-group-real-name group) 0))
|
||||
nnmail-split-history)
|
||||
(setq recent nil))
|
||||
(pop recent))))
|
||||
(when (and active
|
||||
recent
|
||||
(> (car (last recent)) (cdr active)))
|
||||
(push (list (cons (gnus-group-real-name group) 0))
|
||||
nnmail-split-history)))
|
||||
;; Note the active level for the next run-through.
|
||||
(gnus-group-set-parameter info 'active (gnus-active group))
|
||||
(gnus-group-set-parameter info 'uidvalidity uidvalidity)
|
||||
|
|
|
@ -774,7 +774,7 @@ command whose response triggered the error."
|
|||
(nntp-copy-to-buffer nntp-server-buffer (point-min) (point-max))
|
||||
'headers)))))
|
||||
|
||||
(deffoo nntp-retrieve-group-data-early (server infos)
|
||||
(deffoo nntp-retrieve-group-data-early-disabled (server infos)
|
||||
"Retrieve group info on INFOS."
|
||||
(nntp-with-open-group nil server
|
||||
(when (nntp-find-connection-buffer nntp-server-buffer)
|
||||
|
@ -793,7 +793,7 @@ command whose response triggered the error."
|
|||
nil command (gnus-group-real-name (gnus-info-group info)))))
|
||||
(length infos)))))
|
||||
|
||||
(deffoo nntp-finish-retrieve-group-infos (server infos count)
|
||||
(deffoo nntp-finish-retrieve-group-infos-disabled (server infos count)
|
||||
(nntp-with-open-group nil server
|
||||
(let ((buf (nntp-find-connection-buffer nntp-server-buffer))
|
||||
(method (gnus-find-method-for-group
|
||||
|
|
|
@ -696,7 +696,8 @@ ones, in case fg and bg are nil."
|
|||
|
||||
(defun shr-tag-body (cont)
|
||||
(let* ((start (point))
|
||||
(fgcolor (cdr (assq :fgcolor cont)))
|
||||
(fgcolor (cdr (or (assq :fgcolor cont)
|
||||
(assq :text cont))))
|
||||
(bgcolor (cdr (assq :bgcolor cont)))
|
||||
(shr-stylesheet (list (cons 'color fgcolor)
|
||||
(cons 'background-color bgcolor))))
|
||||
|
|
|
@ -2638,7 +2638,7 @@ will be inserted before the group at point."
|
|||
;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group
|
||||
;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
|
||||
;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
|
||||
;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "f163e17664a89a6f0aa2b15bfaaa65a4")
|
||||
;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "eb3de21aef70e4ca75f611f1c3c56aa1")
|
||||
;;; Generated autoloads from ibuf-ext.el
|
||||
|
||||
(autoload 'ibuffer-auto-mode "ibuf-ext" "\
|
||||
|
|
|
@ -2185,14 +2185,23 @@ With a prefix arg, prompt for new topic."
|
|||
|
||||
(defun rcirc-cmd-ctcp (args &optional process target)
|
||||
(if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args)
|
||||
(let ((target (match-string 1 args))
|
||||
(request (match-string 2 args)))
|
||||
(rcirc-send-string process
|
||||
(format "PRIVMSG %s \C-a%s\C-a"
|
||||
target (upcase request))))
|
||||
(let* ((target (match-string 1 args))
|
||||
(request (upcase (match-string 2 args)))
|
||||
(function (intern-soft (concat "rcirc-ctcp-sender-" request))))
|
||||
(if (fboundp function) ;; use special function if available
|
||||
(funcall function process target request)
|
||||
(rcirc-send-string process
|
||||
(format "PRIVMSG %s :\C-a%s\C-a"
|
||||
target request))))
|
||||
(rcirc-print process (rcirc-nick process) "ERROR" nil
|
||||
"usage: /ctcp NICK REQUEST")))
|
||||
|
||||
(defun rcirc-ctcp-sender-PING (process target request)
|
||||
"Send a CTCP PING message to TARGET."
|
||||
(let ((timestamp (format "%.0f" (float-time))))
|
||||
(rcirc-send-string process
|
||||
(format "PRIVMSG %s :\C-aPING %s\C-a" target timestamp))))
|
||||
|
||||
(defun rcirc-cmd-me (args &optional process target)
|
||||
(rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a"
|
||||
target args)))
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
;; Maintainer: FSF
|
||||
;; Keywords: emulations
|
||||
;; Obsolete-since: 24.1
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
417
lisp/obsolete/pc-select.el
Normal file
417
lisp/obsolete/pc-select.el
Normal file
|
@ -0,0 +1,417 @@
|
|||
;;; pc-select.el --- emulate mark, cut, copy and paste from Motif
|
||||
;;; (or MAC GUI or MS-windoze (bah)) look-and-feel
|
||||
;;; including key bindings.
|
||||
|
||||
;; Copyright (C) 1995-1997, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE>
|
||||
;; Keywords: convenience emulations
|
||||
;; Created: 26 Sep 1995
|
||||
;; Obsolete-since: 24.1
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This package emulates the mark, copy, cut and paste look-and-feel of motif
|
||||
;; programs (which is the same as the MAC gui and (sorry for that) MS-Windows).
|
||||
;; It modifies the keybindings of the cursor keys and the next, prior,
|
||||
;; home and end keys. They will modify mark-active.
|
||||
;; You can still get the old behavior of cursor moving with the
|
||||
;; control sequences C-f, C-b, etc.
|
||||
;; This package uses transient-mark-mode and
|
||||
;; delete-selection-mode.
|
||||
;;
|
||||
;; In addition to that all key-bindings from the pc-mode are
|
||||
;; done here too (as suggested by RMS).
|
||||
;;
|
||||
;; As I found out after I finished the first version, s-region.el tries
|
||||
;; to do the same.... But my code is a little more complete and using
|
||||
;; delete-selection-mode is very important for the look-and-feel.
|
||||
;; Pete Forman <pete.forman@airgun.wg.waii.com> provided some motif
|
||||
;; compliant keybindings which I added. I had to modify them a little
|
||||
;; to add the -mark and -nomark functionality of cursor moving.
|
||||
;;
|
||||
;; Credits:
|
||||
;; Many thanks to all who made comments.
|
||||
;; Thanks to RMS and Ralf Muschall <prm@rz.uni-jena.de> for criticism.
|
||||
;; Kevin Cutts <cutts@ukraine.corp.mot.com> added the beginning-of-buffer
|
||||
;; and end-of-buffer functions which I modified a little.
|
||||
;; David Biesack <sasdjb@unx.sas.com> suggested some more cleanup.
|
||||
;; Thanks to Pete Forman <pete.forman@airgun.wg.waii.com>
|
||||
;; for additional motif keybindings.
|
||||
;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report
|
||||
;; concerning setting of this-command.
|
||||
;; Dan Nicolaescu <done@ece.arizona.ro> suggested suppressing the
|
||||
;; scroll-up/scroll-down error.
|
||||
;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and
|
||||
;; keybindings.
|
||||
;;
|
||||
;; Ok, some details about the idea of PC Selection mode:
|
||||
;;
|
||||
;; o The standard keys for moving around (right, left, up, down, home, end,
|
||||
;; prior, next, called "move-keys" from now on) will always de-activate
|
||||
;; the mark.
|
||||
;; o If you press "Shift" together with the "move-keys", the region
|
||||
;; you pass along is activated
|
||||
;; o You have the copy, cut and paste functions (as in many other programs)
|
||||
;; which will operate on the active region
|
||||
;; It was not possible to bind them to C-v, C-x and C-c for obvious
|
||||
;; emacs reasons.
|
||||
;; They will be bound according to the "old" behavior to S-delete (cut),
|
||||
;; S-insert (paste) and C-insert (copy). These keys do the same in many
|
||||
;; other programs.
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Customization:
|
||||
(defgroup pc-select nil
|
||||
"Emulate pc bindings."
|
||||
:prefix "pc-select"
|
||||
:group 'emulations)
|
||||
|
||||
(define-obsolete-variable-alias 'pc-select-override-scroll-error
|
||||
'scroll-error-top-bottom
|
||||
"24.1")
|
||||
(defcustom pc-select-override-scroll-error t
|
||||
"Non-nil means don't generate error on scrolling past edge of buffer.
|
||||
This variable applies in PC Selection mode only.
|
||||
The scroll commands normally generate an error if you try to scroll
|
||||
past the top or bottom of the buffer. This is annoying when selecting
|
||||
text with these commands. If you set this variable to non-nil, these
|
||||
errors are suppressed."
|
||||
:type 'boolean
|
||||
:group 'pc-select)
|
||||
|
||||
(defcustom pc-select-selection-keys-only nil
|
||||
"Non-nil means only bind the basic selection keys when started.
|
||||
Other keys that emulate pc-behavior will be untouched.
|
||||
This gives mostly Emacs-like behavior with only the selection keys enabled."
|
||||
:type 'boolean
|
||||
:group 'pc-select)
|
||||
|
||||
(defcustom pc-select-meta-moves-sexps nil
|
||||
"Non-nil means move sexp-wise with Meta key, otherwise move word-wise."
|
||||
:type 'boolean
|
||||
:group 'pc-select)
|
||||
|
||||
(defcustom pc-selection-mode-hook nil
|
||||
"The hook to run when PC Selection mode is toggled."
|
||||
:type 'hook
|
||||
:group 'pc-select)
|
||||
|
||||
(defvar pc-select-saved-settings-alist nil
|
||||
"The values of the variables before PC Selection mode was toggled on.
|
||||
When PC Selection mode is toggled on, it sets quite a few variables
|
||||
for its own purposes. This alist holds the original values of the
|
||||
variables PC Selection mode had set, so that these variables can be
|
||||
restored to their original values when PC Selection mode is toggled off.")
|
||||
|
||||
(defvar pc-select-map nil
|
||||
"The keymap used as the global map when PC Selection mode is on." )
|
||||
|
||||
(defvar pc-select-saved-global-map nil
|
||||
"The global map that was in effect when PC Selection mode was toggled on.")
|
||||
|
||||
(defvar pc-select-key-bindings-alist nil
|
||||
"This alist holds all the key bindings PC Selection mode sets.")
|
||||
|
||||
(defvar pc-select-default-key-bindings nil
|
||||
"These key bindings always get set by PC Selection mode.")
|
||||
|
||||
(defvar pc-select-extra-key-bindings
|
||||
;; The following keybindings are for standard ISO keyboards
|
||||
;; as they are used with IBM compatible PCs, IBM RS/6000,
|
||||
;; MACs, many X-Stations and probably more.
|
||||
'(;; Commented out since it's been standard at least since Emacs-21.
|
||||
;;([S-insert] . yank)
|
||||
;;([C-insert] . copy-region-as-kill)
|
||||
;;([S-delete] . kill-region)
|
||||
|
||||
;; The following bindings are useful on Sun Type 3 keyboards
|
||||
;; They implement the Get-Delete-Put (copy-cut-paste)
|
||||
;; functions from sunview on the L6, L8 and L10 keys
|
||||
;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste.
|
||||
([f16] . copy-region-as-kill)
|
||||
([f18] . yank)
|
||||
([f20] . kill-region)
|
||||
|
||||
;; The following bindings are from Pete Forman.
|
||||
([f6] . other-window) ; KNextPane F6
|
||||
([C-delete] . kill-line) ; KEraseEndLine cDel
|
||||
("\M-\d" . undo) ; KUndo aBS
|
||||
|
||||
;; The following binding is taken from pc-mode.el
|
||||
;; as suggested by RMS.
|
||||
;; I only used the one that is not covered above.
|
||||
([C-M-delete] . kill-sexp)
|
||||
;; Next line proposed by Eli Barzilay
|
||||
([C-escape] . electric-buffer-list))
|
||||
"Key bindings to set only if `pc-select-selection-keys-only' is nil.")
|
||||
|
||||
(defvar pc-select-meta-moves-sexps-key-bindings
|
||||
'((([M-right] . forward-sexp)
|
||||
([M-left] . backward-sexp))
|
||||
(([M-right] . forward-word)
|
||||
([M-left] . backward-word)))
|
||||
"The list of key bindings controlled by `pc-select-meta-moves-sexp'.
|
||||
The bindings in the car of this list get installed if
|
||||
`pc-select-meta-moves-sexp' is t, the bindings in the cadr of this
|
||||
list get installed otherwise.")
|
||||
|
||||
;; This is for tty. We don't turn on normal-erase-is-backspace,
|
||||
;; but bind keys as pc-selection-mode did before
|
||||
;; normal-erase-is-backspace was invented, to keep us back
|
||||
;; compatible.
|
||||
(defvar pc-select-tty-key-bindings
|
||||
'(([delete] . delete-char) ; KDelete Del
|
||||
([C-backspace] . backward-kill-word))
|
||||
"The list of key bindings controlled by `pc-select-selection-keys-only'.
|
||||
These key bindings get installed when running in a tty, but only if
|
||||
`pc-select-selection-keys-only' is nil.")
|
||||
|
||||
(defvar pc-select-old-M-delete-binding nil
|
||||
"Holds the old mapping of [M-delete] in the `function-key-map'.
|
||||
This variable holds the value associated with [M-delete] in the
|
||||
`function-key-map' before PC Selection mode had changed that
|
||||
association.")
|
||||
|
||||
;;;;
|
||||
;; misc
|
||||
;;;;
|
||||
|
||||
(provide 'pc-select)
|
||||
|
||||
(defun pc-select-define-keys (alist keymap)
|
||||
"Make KEYMAP have the key bindings specified in ALIST."
|
||||
(let ((lst alist))
|
||||
(while lst
|
||||
(define-key keymap (caar lst) (cdar lst))
|
||||
(setq lst (cdr lst)))))
|
||||
|
||||
(defun pc-select-restore-keys (alist keymap saved-map)
|
||||
"Use ALIST to restore key bindings from SAVED-MAP into KEYMAP.
|
||||
Go through all the key bindings in ALIST, and, for each key
|
||||
binding, if KEYMAP and ALIST still agree on the key binding,
|
||||
restore the previous value of that key binding from SAVED-MAP."
|
||||
(let ((lst alist))
|
||||
(while lst
|
||||
(when (equal (lookup-key keymap (caar lst)) (cdar lst))
|
||||
(define-key keymap (caar lst) (lookup-key saved-map (caar lst))))
|
||||
(setq lst (cdr lst)))))
|
||||
|
||||
(defmacro pc-select-add-to-alist (alist var val)
|
||||
"Ensure that ALIST contains the cons cell (VAR . VAL).
|
||||
If a cons cell whose car is VAR is already on the ALIST, update the
|
||||
cdr of that cell with VAL. Otherwise, make a new cons cell
|
||||
\(VAR . VAL), and prepend it onto ALIST."
|
||||
(let ((elt (make-symbol "elt")))
|
||||
`(let ((,elt (assq ',var ,alist)))
|
||||
(if ,elt
|
||||
(setcdr ,elt ,val)
|
||||
(setq ,alist (cons (cons ',var ,val) ,alist))))))
|
||||
|
||||
(defmacro pc-select-save-and-set-var (var newval)
|
||||
"Set VAR to NEWVAL; save the old value.
|
||||
The old value is saved on the `pc-select-saved-settings-alist'."
|
||||
`(when (boundp ',var)
|
||||
(pc-select-add-to-alist pc-select-saved-settings-alist ,var ,var)
|
||||
(setq ,var ,newval)))
|
||||
|
||||
(defmacro pc-select-save-and-set-mode (mode &optional arg mode-var)
|
||||
"Call the function MODE; save the old value of the variable MODE.
|
||||
MODE is presumed to be a function which turns on a minor mode. First,
|
||||
save the value of the variable MODE on `pc-select-saved-settings-alist'.
|
||||
Then, if ARG is specified, call MODE with ARG, otherwise call it with
|
||||
nil as an argument. If MODE-VAR is specified, save the value of the
|
||||
variable MODE-VAR (instead of the value of the variable MODE) on
|
||||
`pc-select-saved-settings-alist'."
|
||||
(unless mode-var (setq mode-var mode))
|
||||
`(when (fboundp ',mode)
|
||||
(pc-select-add-to-alist pc-select-saved-settings-alist
|
||||
,mode-var ,mode-var)
|
||||
(,mode ,arg)))
|
||||
|
||||
(defmacro pc-select-restore-var (var)
|
||||
"Restore the previous value of the variable VAR.
|
||||
Look up VAR's previous value in `pc-select-saved-settings-alist', and,
|
||||
if the value is found, set VAR to that value."
|
||||
(let ((elt (make-symbol "elt")))
|
||||
`(let ((,elt (assq ',var pc-select-saved-settings-alist)))
|
||||
(unless (null ,elt)
|
||||
(setq ,var (cdr ,elt))))))
|
||||
|
||||
(defmacro pc-select-restore-mode (mode)
|
||||
"Restore the previous state (either on or off) of the minor mode MODE.
|
||||
Look up the value of the variable MODE on `pc-select-saved-settings-alist'.
|
||||
If the value is non-nil, call the function MODE with an argument of
|
||||
1, otherwise call it with an argument of -1."
|
||||
(let ((elt (make-symbol "elt")))
|
||||
`(when (fboundp ',mode)
|
||||
(let ((,elt (assq ',mode pc-select-saved-settings-alist)))
|
||||
(unless (null ,elt)
|
||||
(,mode (if (cdr ,elt) 1 -1)))))))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode pc-selection-mode
|
||||
"Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style.
|
||||
|
||||
This mode enables Delete Selection mode and Transient Mark mode.
|
||||
|
||||
The arrow keys (and others) are bound to new functions
|
||||
which modify the status of the mark.
|
||||
|
||||
The ordinary arrow keys disable the mark.
|
||||
The shift-arrow keys move, leaving the mark behind.
|
||||
|
||||
C-LEFT and C-RIGHT move back or forward one word, disabling the mark.
|
||||
S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind.
|
||||
|
||||
M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark.
|
||||
S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark
|
||||
behind. To control whether these keys move word-wise or sexp-wise set the
|
||||
variable `pc-select-meta-moves-sexps' after loading pc-select.el but before
|
||||
turning PC Selection mode on.
|
||||
|
||||
C-DOWN and C-UP move back or forward a paragraph, disabling the mark.
|
||||
S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind.
|
||||
|
||||
HOME moves to beginning of line, disabling the mark.
|
||||
S-HOME moves to beginning of line, leaving the mark behind.
|
||||
With Ctrl or Meta, these keys move to beginning of buffer instead.
|
||||
|
||||
END moves to end of line, disabling the mark.
|
||||
S-END moves to end of line, leaving the mark behind.
|
||||
With Ctrl or Meta, these keys move to end of buffer instead.
|
||||
|
||||
PRIOR or PAGE-UP scrolls and disables the mark.
|
||||
S-PRIOR or S-PAGE-UP scrolls and leaves the mark behind.
|
||||
|
||||
S-DELETE kills the region (`kill-region').
|
||||
S-INSERT yanks text from the kill ring (`yank').
|
||||
C-INSERT copies the region into the kill ring (`copy-region-as-kill').
|
||||
|
||||
In addition, certain other PC bindings are imitated (to avoid this, set
|
||||
the variable `pc-select-selection-keys-only' to t after loading pc-select.el
|
||||
but before calling PC Selection mode):
|
||||
|
||||
F6 other-window
|
||||
DELETE delete-char
|
||||
C-DELETE kill-line
|
||||
M-DELETE kill-word
|
||||
C-M-DELETE kill-sexp
|
||||
C-BACKSPACE backward-kill-word
|
||||
M-BACKSPACE undo"
|
||||
;; FIXME: bring pc-bindings-mode here ?
|
||||
nil nil nil
|
||||
|
||||
:group 'pc-select
|
||||
:global t
|
||||
|
||||
(if pc-selection-mode
|
||||
(if (null pc-select-key-bindings-alist)
|
||||
(progn
|
||||
(setq pc-select-saved-global-map (copy-keymap (current-global-map)))
|
||||
(setq pc-select-key-bindings-alist
|
||||
(append pc-select-default-key-bindings
|
||||
(if pc-select-selection-keys-only
|
||||
nil
|
||||
pc-select-extra-key-bindings)
|
||||
(if pc-select-meta-moves-sexps
|
||||
(car pc-select-meta-moves-sexps-key-bindings)
|
||||
(cadr pc-select-meta-moves-sexps-key-bindings))
|
||||
(if (or pc-select-selection-keys-only
|
||||
(eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
nil
|
||||
pc-select-tty-key-bindings)))
|
||||
|
||||
(pc-select-define-keys pc-select-key-bindings-alist
|
||||
(current-global-map))
|
||||
|
||||
(unless (or pc-select-selection-keys-only
|
||||
(eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
;; it is not clear that we need the following line
|
||||
;; I hope it doesn't do too much harm to leave it in, though...
|
||||
(setq pc-select-old-M-delete-binding
|
||||
(lookup-key function-key-map [M-delete]))
|
||||
(define-key function-key-map [M-delete] [?\M-d]))
|
||||
|
||||
(when (and (not pc-select-selection-keys-only)
|
||||
(or (eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
(fboundp 'normal-erase-is-backspace-mode))
|
||||
(pc-select-save-and-set-mode normal-erase-is-backspace-mode 1
|
||||
normal-erase-is-backspace))
|
||||
;; the original author also had this above:
|
||||
;; (setq-default normal-erase-is-backspace t)
|
||||
;; However, the documentation for the variable says that
|
||||
;; "setting it with setq has no effect", so I'm removing it.
|
||||
|
||||
(pc-select-save-and-set-var highlight-nonselected-windows nil)
|
||||
(pc-select-save-and-set-var transient-mark-mode t)
|
||||
(pc-select-save-and-set-var shift-select-mode t)
|
||||
(pc-select-save-and-set-var mark-even-if-inactive t)
|
||||
(pc-select-save-and-set-mode delete-selection-mode 1))
|
||||
;;else
|
||||
;; If the user turned on pc-selection-mode a second time
|
||||
;; do not clobber the values of the variables that were
|
||||
;; saved from before pc-selection mode was activated --
|
||||
;; just make sure the values are the way we like them.
|
||||
(pc-select-define-keys pc-select-key-bindings-alist
|
||||
(current-global-map))
|
||||
(unless (or pc-select-selection-keys-only
|
||||
(eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
;; it is not clear that we need the following line
|
||||
;; I hope it doesn't do too much harm to leave it in, though...
|
||||
(define-key function-key-map [M-delete] [?\M-d]))
|
||||
(when (and (not pc-select-selection-keys-only)
|
||||
(or (eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt)))
|
||||
(fboundp 'normal-erase-is-backspace-mode))
|
||||
(normal-erase-is-backspace-mode 1))
|
||||
(setq highlight-nonselected-windows nil)
|
||||
(setq transient-mark-mode t)
|
||||
(setq mark-even-if-inactive t)
|
||||
(delete-selection-mode 1))
|
||||
;;else
|
||||
(when pc-select-key-bindings-alist
|
||||
(when (and (not pc-select-selection-keys-only)
|
||||
(or (eq window-system 'x)
|
||||
(memq system-name '(ms-dos windows-nt))))
|
||||
(pc-select-restore-mode normal-erase-is-backspace-mode))
|
||||
|
||||
(pc-select-restore-keys
|
||||
pc-select-key-bindings-alist (current-global-map)
|
||||
pc-select-saved-global-map)
|
||||
|
||||
(pc-select-restore-var highlight-nonselected-windows)
|
||||
(pc-select-restore-var transient-mark-mode)
|
||||
(pc-select-restore-var shift-select-mode)
|
||||
(pc-select-restore-var mark-even-if-inactive)
|
||||
(pc-select-restore-mode delete-selection-mode)
|
||||
(and pc-select-old-M-delete-binding
|
||||
(define-key function-key-map [M-delete]
|
||||
pc-select-old-M-delete-binding))
|
||||
(setq pc-select-key-bindings-alist nil
|
||||
pc-select-saved-settings-alist nil))))
|
||||
(make-obsolete 'pc-selection-mode 'delete-selection-mode "24.1")
|
||||
|
||||
;;; pc-select.el ends here
|
|
@ -948,12 +948,12 @@ Point is at the beginning of the next line."
|
|||
;; We're looking at <<STRING, so we add "^STRING$" to the syntactic
|
||||
;; font-lock keywords to detect the end of this here document.
|
||||
(let ((str (replace-regexp-in-string "['\"]" "" string))
|
||||
(ppss (save-excursion (syntax-ppss (1- (point))))))
|
||||
(ppss (save-excursion (syntax-ppss eol))))
|
||||
(if (nth 4 ppss)
|
||||
;; The \n not only starts the heredoc but also closes a comment.
|
||||
;; Let's close the comment just before the \n.
|
||||
(put-text-property (1- (point)) (point) 'syntax-table '(12))) ;">"
|
||||
(if (or (nth 5 ppss) (> (count-lines start (point)) 1))
|
||||
(put-text-property (1- eol) eol 'syntax-table '(12))) ;">"
|
||||
(if (or (nth 5 ppss) (> (count-lines start eol) 1))
|
||||
;; If the sh-escaped-line-re part of sh-here-doc-open-re has matched
|
||||
;; several lines, make sure we refontify them together.
|
||||
;; Furthermore, if (nth 5 ppss) is non-nil (i.e. the \n is
|
||||
|
@ -961,7 +961,7 @@ Point is at the beginning of the next line."
|
|||
;; Don't bother fixing it now, but place a multiline property so
|
||||
;; that when jit-lock-context-* refontifies the rest of the
|
||||
;; buffer, it also refontifies the current line with it.
|
||||
(put-text-property start (point) 'syntax-multiline t))
|
||||
(put-text-property start (1+ eol) 'syntax-multiline t))
|
||||
(put-text-property eol (1+ eol) 'sh-here-doc-marker str)
|
||||
(prog1 sh-here-doc-syntax
|
||||
(goto-char (+ 2 start))))))
|
||||
|
@ -1083,33 +1083,33 @@ subshells can nest."
|
|||
(defun sh-syntax-propertize-function (start end)
|
||||
(goto-char start)
|
||||
(sh-syntax-propertize-here-doc end)
|
||||
(funcall
|
||||
(syntax-propertize-rules
|
||||
(funcall
|
||||
(syntax-propertize-rules
|
||||
(sh-here-doc-open-re
|
||||
(2 (sh-font-lock-open-heredoc
|
||||
(match-beginning 0) (match-string 1) (match-beginning 2))))
|
||||
("\\s|" (0 (prog1 nil (sh-syntax-propertize-here-doc end))))
|
||||
;; A `#' begins a comment when it is unquoted and at the
|
||||
;; beginning of a word. In the shell, words are separated by
|
||||
;; metacharacters. The list of special chars is taken from
|
||||
;; the single-unix spec of the shell command language (under
|
||||
;; `quoting') but with `$' removed.
|
||||
("[^|&;<>()`\\\"' \t\n]\\(#+\\)" (1 "_"))
|
||||
;; In a '...' the backslash is not escaping.
|
||||
("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote)))
|
||||
;; Make sure $@ and $? are correctly recognized as sexps.
|
||||
("\\$\\([?@]\\)" (1 "_"))
|
||||
;; Distinguish the special close-paren in `case'.
|
||||
(")" (0 (sh-font-lock-paren (match-beginning 0))))
|
||||
;; Highlight (possibly nested) subshells inside "" quoted
|
||||
;; regions correctly.
|
||||
;; A `#' begins a comment when it is unquoted and at the
|
||||
;; beginning of a word. In the shell, words are separated by
|
||||
;; metacharacters. The list of special chars is taken from
|
||||
;; the single-unix spec of the shell command language (under
|
||||
;; `quoting') but with `$' removed.
|
||||
("[^|&;<>()`\\\"' \t\n]\\(#+\\)" (1 "_"))
|
||||
;; In a '...' the backslash is not escaping.
|
||||
("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote)))
|
||||
;; Make sure $@ and $? are correctly recognized as sexps.
|
||||
("\\$\\([?@]\\)" (1 "_"))
|
||||
;; Distinguish the special close-paren in `case'.
|
||||
(")" (0 (sh-font-lock-paren (match-beginning 0))))
|
||||
;; Highlight (possibly nested) subshells inside "" quoted
|
||||
;; regions correctly.
|
||||
("\"\\(?:\\(?:[^\\\"]\\|\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)"
|
||||
(1 (ignore
|
||||
;; Save excursion because we want to also apply other
|
||||
;; syntax-propertize rules within the affected region.
|
||||
(1 (ignore
|
||||
;; Save excursion because we want to also apply other
|
||||
;; syntax-propertize rules within the affected region.
|
||||
(if (nth 8 (syntax-ppss))
|
||||
(goto-char (1+ (match-beginning 0)))
|
||||
(save-excursion
|
||||
(save-excursion
|
||||
(sh-font-lock-quoted-subshell end)))))))
|
||||
(point) end))
|
||||
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
2011-02-10 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* lwlib-Xaw.c, lwlib-Xlw.c, lwlib-Xm.c, lwlib-utils.c, lwlib.c:
|
||||
* xlwmenu.c: Standardize on <> for includes from the ../src directory.
|
||||
|
||||
2011-02-09 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* Makefile.in (@SET_MAKE@): New, set by configure.
|
||||
(globals): New variable and rule.
|
||||
(lwlib-utils.o, lwlib.o, lwlib-Xlw.o, lwlib-Xaw.o, lwlib-Xm.o)
|
||||
(xlwmenu.o): Add dependency on src/globals.h.
|
||||
|
||||
2011-01-31 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* lwlib-Xm.c (make_destroyed_instance):
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
srcdir=@srcdir@
|
||||
VPATH=@srcdir@
|
||||
@SET_MAKE@
|
||||
C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
|
||||
C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
|
||||
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
|
||||
|
@ -65,16 +66,22 @@ liblw.a: $(OBJS)
|
|||
$(AR) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
## lisp.h includes this.
|
||||
globals = ../src/globals.h
|
||||
|
||||
$(globals):
|
||||
cd ../src; $(MAKE) $(MFLAGS) globals.h
|
||||
|
||||
# Depend on Makefile so that we recompile if TOOLKIT_DEFINES changes.
|
||||
lwlib.o: $(srcdir)/lwlib.c Makefile
|
||||
$(CC) -c $(CPPFLAGS) $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c
|
||||
|
||||
lwlib-utils.o: lwlib-utils.c lwlib-utils.h
|
||||
lwlib.o: lwlib.c lwlib.h lwlib-int.h lwlib-Xaw.h lwlib-Xlw.h
|
||||
lwlib-Xlw.o: lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h
|
||||
lwlib-Xaw.o: lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
|
||||
lwlib-Xm.o: lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
|
||||
xlwmenu.o: xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h
|
||||
lwlib-utils.o: $(globals) lwlib-utils.c lwlib-utils.h
|
||||
lwlib.o: $(globals) lwlib.c lwlib.h lwlib-int.h lwlib-Xaw.h lwlib-Xlw.h
|
||||
lwlib-Xlw.o: $(globals) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h
|
||||
lwlib-Xaw.o: $(globals) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
|
||||
lwlib-Xm.o: $(globals) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
|
||||
xlwmenu.o: $(globals) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h
|
||||
|
||||
mostlyclean:
|
||||
$(RM) *.o core liblw.a \#*
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* The lwlib interface to Athena widgets.
|
||||
|
||||
Copyright (C) 1993 Chuck Thompson <cthomp@cs.uiuc.edu>
|
||||
Copyright (C) 1994, 2001-2011 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -27,7 +28,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#include <setjmp.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "../src/lisp.h"
|
||||
#include <lisp.h>
|
||||
|
||||
#include "lwlib-Xaw.h"
|
||||
|
||||
|
@ -833,4 +834,3 @@ xaw_creation_table [] =
|
|||
{"main", xaw_create_main},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* The lwlib interface to "xlwmenu" menus.
|
||||
Copyright (C) 1992 Lucid, Inc.
|
||||
Copyright (C) 1994, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 1992 Lucid, Inc.
|
||||
Copyright (C) 1994, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the Lucid Widget Library.
|
||||
|
||||
|
@ -24,7 +25,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#endif
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "lisp.h"
|
||||
#include <lisp.h>
|
||||
|
||||
#include "lwlib-Xlw.h"
|
||||
#include <X11/StringDefs.h>
|
||||
|
@ -272,4 +273,3 @@ xlw_destroy_instance (widget_instance *instance)
|
|||
if (instance->widget)
|
||||
XtDestroyWidget (instance->widget);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#include <X11/CoreP.h>
|
||||
#include <X11/CompositeP.h>
|
||||
|
||||
#include "../src/lisp.h"
|
||||
#include <lisp.h>
|
||||
|
||||
#include "lwlib-Xm.h"
|
||||
#include "lwlib-utils.h"
|
||||
|
@ -1956,4 +1956,3 @@ xm_manage_resizing (Widget w, Boolean flag)
|
|||
{
|
||||
XtVaSetValues (w, XtNallowShellResize, flag, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Defines some widget utility functions.
|
||||
|
||||
Copyright (C) 1992 Lucid, Inc.
|
||||
Copyright (C) 1994, 2001-2011 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -31,7 +32,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#undef rindex
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "../src/lisp.h"
|
||||
#include <lisp.h>
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/IntrinsicP.h>
|
||||
|
@ -173,4 +174,3 @@ XtSafelyDestroyWidget (Widget widget)
|
|||
abort ();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* A general interface to the widgets of different toolkits.
|
||||
|
||||
Copyright (C) 1992, 1993 Lucid, Inc.
|
||||
Copyright (C) 1994-1996, 1999-2011 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -24,7 +25,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#endif
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "../src/lisp.h"
|
||||
#include <lisp.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1418,4 +1419,3 @@ lw_separator_p (const char *label, enum menu_separator *type, int motif_p)
|
|||
|
||||
return separator_p;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Implements a lightweight menubar widget.
|
||||
|
||||
Copyright (C) 1992 Lucid, Inc.
|
||||
Copyright (C) 1994-1995, 1997, 1999-2011 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -26,7 +27,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#endif
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "lisp.h"
|
||||
#include <lisp.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
@ -56,7 +57,7 @@ extern int gray_bitmap_width;
|
|||
extern int gray_bitmap_height;
|
||||
extern char *gray_bitmap_bits;
|
||||
|
||||
#include "xterm.h"
|
||||
#include <xterm.h>
|
||||
|
||||
#else /* not emacs */
|
||||
|
||||
|
@ -2689,4 +2690,3 @@ pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event)
|
|||
((XMotionEvent*)event)->is_hint = 0;
|
||||
handle_motion_event (mw, (XMotionEvent*)event);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2011-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* makefile.w32-in (bootstrap-nmake, bootstrap-gmake): Make the
|
||||
"make-docfile" target in lib-src, before bootstrapping the src
|
||||
directory. Needed since building in src needs to run make-docfile
|
||||
to produce globals.h.
|
||||
|
||||
2011-02-04 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* config.nt (inline) [__GNUC__]: Define (for gnulib).
|
||||
|
|
|
@ -160,7 +160,7 @@ bootstrap-nmake: addsection cmdproxy
|
|||
cd ..\src
|
||||
$(MAKE) $(MFLAGS) clean
|
||||
cd ..\lib-src
|
||||
$(MAKE) $(MFLAGS) clean
|
||||
$(MAKE) $(MFLAGS) clean make-docfile
|
||||
cd ..\lib
|
||||
$(MAKE) $(MFLAGS) clean all
|
||||
cd ..\src
|
||||
|
@ -177,7 +177,7 @@ bootstrap-nmake: addsection cmdproxy
|
|||
bootstrap-gmake: addsection cmdproxy
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean make-docfile
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean all
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap
|
||||
$(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
2011-02-08 Paul Eggert <eggert@cs.ucla.edu>
|
||||
2011-02-10 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Import getloadavg module from gnulib.
|
||||
* deps.mk (getloadavg.o): Remove; gnulib now does this.
|
||||
|
@ -8,6 +8,47 @@
|
|||
* src/s/netbsd.h (HAVE_GETLOADAVG): Likewise.
|
||||
* config.in: Regenerate.
|
||||
|
||||
2011-02-10 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* Makefile.in (really-lwlib): Depend on globals.h, for parallel builds.
|
||||
|
||||
2011-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* makefile.w32-in (GLOBAL_SOURCES, SOME_MACHINE_OBJECTS, obj):
|
||||
New macros.
|
||||
(globals.h, gl-stamp): New targets.
|
||||
(clean): Clean gl-stamp and globals.h.
|
||||
|
||||
2011-02-09 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* Makefile.in (gl-stamp): Create globals.h here.
|
||||
(globals.h): Don't do it here.
|
||||
(mostlyclean): Clean globals.h and gl-stamp.
|
||||
|
||||
2011-02-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* Makefile.in ($(otherobj)): Depend on globals.h.
|
||||
Otherwise 'make -j10' failed on my host, because the build lacked
|
||||
necessary dependencies, e.g., vm-limit.o depends on globals.h.
|
||||
|
||||
2011-02-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* Makefile.in (NS_OBJC_OBJ): New variable.
|
||||
(base_obj): Rename from 'obj'.
|
||||
(obj): New variable.
|
||||
(globals.h, gl-stamp, $(obj)): New targets.
|
||||
(GLOBAL_SOURCES): New variable.
|
||||
* globals.h: Remove.
|
||||
* nsselect.m (Vselection_alist): Define. Reverts part of
|
||||
2011-01-19T22:11:33Z!jan.h.d@swipnet.se.
|
||||
* buffer.c: Don't use "no_cell" for name of kill-buffer-hook's
|
||||
variable.
|
||||
* xselect.c (Vselection_alist): Define. Reverts part of 2011-01-19T23:32:42Z!eggert@cs.ucla.edu.
|
||||
|
||||
2011-02-08 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* font.c (Ffont_get): Do not cache :otf value.
|
||||
|
||||
2011-02-07 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
conform to C89 pointer rules
|
||||
|
|
|
@ -106,7 +106,7 @@ LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
|
|||
|
||||
## This holds any special options for linking temacs only (ie, not
|
||||
## used by configure). Not used elsewhere because it sometimes
|
||||
## contains options that have to do with using Emacs's crt0,
|
||||
## contains options that have to do with using Emacs's crt0,
|
||||
## which are only good with temacs.
|
||||
LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
|
||||
|
||||
|
@ -190,7 +190,7 @@ OLDXMENU=@OLDXMENU@
|
|||
## If HAVE_X11 && !USE_GTK, $(OLDXMENU) ../src/$(OLDXMENU); else empty.
|
||||
## We use stamp-xmenu with these two deps to both ensure that lwlib
|
||||
## gets remade based on its dependencies in its own makefile,
|
||||
## and remake temacs if lwlib gets changed by this.
|
||||
## and remake temacs if lwlib gets changed by this.
|
||||
OLDXMENU_DEPS=@OLDXMENU_DEPS@
|
||||
|
||||
## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
|
||||
|
@ -241,12 +241,13 @@ MSDOS_SUPPORT_REAL = $(lispsource)/ls-lisp.elc $(lispsource)/disp-table.elc \
|
|||
$(lispsource)/dos-fns.elc $(lispsource)/dos-w32.elc $(lispsource)/dos-vars.elc \
|
||||
$(lispsource)/term/internal.elc $(lispsource)/term/pc-win.elc
|
||||
## $MSDOS_SUPPORT_REAL if MSDOS.
|
||||
MSDOS_SUPPORT =
|
||||
MSDOS_SUPPORT =
|
||||
|
||||
ns_appdir=@ns_appdir@
|
||||
ns_appbindir=@ns_appbindir@
|
||||
ns_appsrc=@ns_appsrc@
|
||||
NS_OBJ=@NS_OBJ@
|
||||
NS_OBJC_OBJ=@NS_OBJC_OBJ@
|
||||
NS_SUPPORT=@NS_SUPPORT@
|
||||
## Only set if NS_IMPL_GNUSTEP.
|
||||
GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
|
||||
|
@ -341,7 +342,7 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
|
|||
|
||||
## lastfile must follow all files whose initialized data areas should
|
||||
## be dumped as pure by dump-emacs.
|
||||
obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
|
||||
base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
|
||||
charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
|
||||
cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
|
||||
emacs.o keyboard.o macros.o keymap.o sysdep.o \
|
||||
|
@ -355,6 +356,7 @@ obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
|
|||
region-cache.o sound.o atimer.o \
|
||||
doprnt.o intervals.o textprop.o composite.o md5.o xml.o \
|
||||
$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)
|
||||
obj = $(base_obj) $(NS_OBJC_OBJ)
|
||||
|
||||
## Object files used on some machine or other.
|
||||
## These go in the DOC file on all machines in case they are needed.
|
||||
|
@ -645,6 +647,18 @@ $(libsrc)/make-docfile$(EXEEXT):
|
|||
buildobj.h: Makefile
|
||||
echo "#define BUILDOBJ \"$(obj) $(otherobj) " "\"" > buildobj.h
|
||||
|
||||
globals.h: gl-stamp; @true
|
||||
|
||||
GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
|
||||
|
||||
gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
|
||||
@rm -f gl-tmp
|
||||
$(libsrc)/make-docfile -d $(srcdir) -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
|
||||
$(srcdir)/../move-if-change gl-tmp globals.h
|
||||
echo timestamp > $@
|
||||
|
||||
$(obj) $(otherobj): globals.h
|
||||
|
||||
$(lib)/libgnu.a: $(config_h)
|
||||
cd $(lib) && $(MAKE) libgnu.a
|
||||
|
||||
|
@ -655,7 +669,7 @@ temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.
|
|||
## The following oldxmenu-related rules are only (possibly) used if
|
||||
## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
|
||||
## (provided we take a little care that OLDXMENU is never empty).
|
||||
really-lwlib:
|
||||
really-lwlib: globals.h
|
||||
cd $(lwlibdir); $(MAKE) $(MFLAGS) \
|
||||
CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)'
|
||||
@true # make -t should not create really-lwlib.
|
||||
|
@ -699,6 +713,7 @@ mostlyclean:
|
|||
rm -f ../etc/DOC
|
||||
rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT)
|
||||
rm -f buildobj.h
|
||||
rm -f globals.h gl-stamp
|
||||
clean: mostlyclean
|
||||
rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
|
||||
-rm -rf $(DEPDIR)
|
||||
|
|
|
@ -1320,7 +1320,7 @@ No argument or nil as argument means do this for the current buffer. */)
|
|||
}
|
||||
|
||||
/*
|
||||
DEFVAR_LISP ("kill-buffer-hook", no_cell, "\
|
||||
DEFVAR_LISP ("kill-buffer-hook", ..., "\
|
||||
Hook to be run (by `run-hooks', which see) when a buffer is killed.\n\
|
||||
The buffer being killed will be current while the hook is running.\n\
|
||||
See `kill-buffer'."
|
||||
|
|
|
@ -3982,7 +3982,6 @@ Layout tags. */)
|
|||
val = fontp->driver->otf_capability (fontp);
|
||||
else
|
||||
val = Fcons (Qnil, Qnil);
|
||||
font_put_extra (font, QCotf, val);
|
||||
}
|
||||
else
|
||||
val = Fcdr (val);
|
||||
|
|
2900
src/globals.h
2900
src/globals.h
File diff suppressed because it is too large
Load diff
|
@ -203,6 +203,38 @@ make-buildobj-SH:
|
|||
echo $(OBJ2) '\' >> buildobj.h
|
||||
echo '$(DQUOTE)' >> buildobj.h
|
||||
|
||||
GLOBAL_SOURCES = dosfns.c msdos.c \
|
||||
xterm.c xfns.c xmenu.c xselect.c xrdb.c xsmfns.c fringe.c image.c \
|
||||
fontset.c menu.c dbusbind.c \
|
||||
w32.c w32console.c w32fns.c w32heap.c w32inevt.c \
|
||||
w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c \
|
||||
font.c w32font.c w32uniscribe.c \
|
||||
dispnew.c frame.c scroll.c xdisp.c window.c bidi.c \
|
||||
charset.c coding.c category.c ccl.c character.c chartab.c \
|
||||
cm.c term.c terminal.c xfaces.c \
|
||||
emacs.c keyboard.c macros.c keymap.c sysdep.c \
|
||||
buffer.c filelock.c insdel.c marker.c \
|
||||
minibuf.c fileio.c dired.c filemode.c \
|
||||
cmds.c casetab.c casefiddle.c indent.c search.c regex.c undo.c \
|
||||
alloc.c data.c doc.c editfns.c callint.c \
|
||||
eval.c floatfns.c fns.c print.c lread.c \
|
||||
syntax.c bytecode.c \
|
||||
process.c callproc.c unexw32.c \
|
||||
region-cache.c sound.c atimer.c \
|
||||
doprnt.c intervals.c textprop.c composite.c md5.c
|
||||
SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
|
||||
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
|
||||
obj = $(GLOBAL_SOURCES:.c=.o)
|
||||
|
||||
globals.h: gl-stamp
|
||||
|
||||
gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES)
|
||||
- $(DEL) gl-tmp
|
||||
"../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
|
||||
cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h"
|
||||
- $(DEL) gl-tmp
|
||||
echo timestamp > $@
|
||||
|
||||
bootstrap: bootstrap-emacs
|
||||
|
||||
#
|
||||
|
@ -279,7 +311,7 @@ clean:
|
|||
- $(DEL) "s/*.h~" "m/*.h~"
|
||||
- $(DEL) $(COMPILER_TEMP_FILES)
|
||||
- $(DEL_TREE) $(OBJDIR)
|
||||
- $(DEL) stamp_BLD
|
||||
- $(DEL) stamp_BLD gl-stamp globals.h
|
||||
- $(DEL) buildobj.h
|
||||
|
||||
distclean: cleanall
|
||||
|
|
|
@ -39,6 +39,8 @@ Updated by Christian Limpach (chris@nice.ch)
|
|||
|
||||
Lisp_Object QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME;
|
||||
|
||||
static Lisp_Object Vselection_alist;
|
||||
|
||||
static Lisp_Object Qforeign_selection;
|
||||
|
||||
/* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */
|
||||
|
|
|
@ -126,6 +126,20 @@ static Lisp_Object Qforeign_selection;
|
|||
/* Defined in keyboard.c. */
|
||||
extern unsigned long last_event_timestamp;
|
||||
|
||||
/* This is an association list whose elements are of the form
|
||||
( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME)
|
||||
SELECTION-NAME is a lisp symbol, whose name is the name of an X Atom.
|
||||
SELECTION-VALUE is the value that emacs owns for that selection.
|
||||
It may be any kind of Lisp object.
|
||||
SELECTION-TIMESTAMP is the time at which emacs began owning this selection,
|
||||
as a cons of two 16-bit numbers (making a 32 bit time.)
|
||||
FRAME is the frame for which we made the selection.
|
||||
If there is an entry in this alist, then it can be assumed that Emacs owns
|
||||
that selection.
|
||||
The only (eq) parts of this list that are visible from Lisp are the
|
||||
selection-values. */
|
||||
static Lisp_Object Vselection_alist;
|
||||
|
||||
|
||||
|
||||
/* Define a queue to save up SELECTION_REQUEST_EVENT events for later
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2011-02-09 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* indent/shell.sh:
|
||||
* indent/shell.rc: New files.
|
||||
|
||||
2011-01-27 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* automated/font-parse-tests.el: Move from
|
||||
|
|
30
test/indent/shell.rc
Executable file
30
test/indent/shell.rc
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/rc
|
||||
|
||||
if (foo) {
|
||||
echo 1
|
||||
}
|
||||
if not {
|
||||
echo 2
|
||||
}
|
||||
|
||||
if (foo)
|
||||
echo 3 # KNOWN INDENT BUG
|
||||
if not
|
||||
echo 4 # KNOWN INDENT BUG
|
||||
|
||||
switch ($a) {
|
||||
case 3
|
||||
echo 4
|
||||
case 5
|
||||
echo 7
|
||||
for (i in a b c) {
|
||||
echo $i
|
||||
}
|
||||
for (i in a b c)
|
||||
echo "$i" # KNOWN INDENT BUG
|
||||
echo titi
|
||||
|
||||
case *
|
||||
echo other
|
||||
}
|
||||
|
98
test/indent/shell.sh
Executable file
98
test/indent/shell.sh
Executable file
|
@ -0,0 +1,98 @@
|
|||
#!/bin/sh
|
||||
|
||||
setlock -n /tmp/getmail.lock && echo getmail isn\'t running
|
||||
|
||||
# adsgsdg
|
||||
|
||||
foo () {
|
||||
|
||||
bar () {
|
||||
blilbi
|
||||
}
|
||||
|
||||
case toto
|
||||
in a) hello # KNOWN INDENT BUG
|
||||
;; b) hi # KNOWN INDENT BUG
|
||||
esac
|
||||
|
||||
case $toto in
|
||||
a) echo 1;; b) echo 2;;
|
||||
c) echo 3;;
|
||||
esac
|
||||
|
||||
case $as_nl`(ac_space=' '; set) 2>&1` in #(
|
||||
*${as_nl}ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes: double-quote
|
||||
# substitution turns \\\\ into \\, and sed turns \\ into \.
|
||||
sed -n \
|
||||
"s/'/'\\\\''/g;
|
||||
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p"
|
||||
;; #(
|
||||
*)
|
||||
# `set' quotes correctly as required by POSIX, so do not add
|
||||
# quotes.
|
||||
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
|
||||
;;
|
||||
esac |
|
||||
cat # KNOWN INDENT BUG
|
||||
|
||||
case toto in
|
||||
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
|
||||
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \
|
||||
| --exec=* | --exe=* | --ex=*)
|
||||
exec_prefix=$ac_optarg ;;
|
||||
5)
|
||||
hello ;;
|
||||
3) hello $(adfad)
|
||||
echo esac ;; # KNOWN INDENT BUG
|
||||
5) hello ;;
|
||||
4) hello ;&
|
||||
4) hello ;;&
|
||||
5) hello ;;
|
||||
5) hello ;;
|
||||
esac
|
||||
|
||||
echo "'" wfgfe
|
||||
|
||||
#!/bin/bash
|
||||
cat << EOF \
|
||||
| cat sadfsafd \
|
||||
sadfsafd "KNOWN INDENT BUG" \
|
||||
| tee -a bug.txt
|
||||
asdfsaf
|
||||
This is a test case for a bug in bash shell mode text highlighting
|
||||
EOF
|
||||
|
||||
cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
|
||||
help1
|
||||
EOF1
|
||||
help2
|
||||
EOF2
|
||||
}
|
||||
bar () {
|
||||
if [ $# == 0 ]; then
|
||||
while
|
||||
f # KNOWN INDENT BUG
|
||||
do
|
||||
bla;
|
||||
done
|
||||
echo "Highlighting is screwed up now"
|
||||
if [ 1 = 1 ]; then
|
||||
# adsgsdg
|
||||
echo "screwed up"
|
||||
fi
|
||||
|
||||
$@ $? $#
|
||||
|
||||
for f in *
|
||||
do
|
||||
sdfg
|
||||
done
|
||||
|
||||
if swrgfef
|
||||
then blas
|
||||
else sdf
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
Loading…
Add table
Reference in a new issue