mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-15 10:37:53 +00:00
emacs: 24.5 -> 25.1
This commit removes all references to emacs24 with the exception of emacs24-macports. The two folders in `pkgs/applications/editors` named `emacs-24` and `emacs-24` are consolidated to a new `emacs` folder. Various parts in nixpkgs also referenced `emacs24Packages` (pinned to `emacs24`) explicitly where `emacsPackages` (non-pinned) is more appropriate. These references get fixed by this commit too.
This commit is contained in:
parent
20fb07dc4a
commit
01e44ac1f9
@ -59,17 +59,17 @@
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><varname>emacs</varname></term>
|
||||
<term><varname>emacs24</varname></term>
|
||||
<term><varname>emacs25</varname></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The latest stable version of Emacs 24 using the <link
|
||||
The latest stable version of Emacs 25 using the <link
|
||||
xlink:href="http://www.gtk.org">GTK+ 2</link> widget
|
||||
toolkit.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>emacs24-nox</varname></term>
|
||||
<term><varname>emacs25-nox</varname></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Emacs 24 built without any dependency on X11
|
||||
@ -86,15 +86,6 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>emacs25pre</varname></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A pretest version of what will become the first
|
||||
version of Emacs 25.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
source $stdenv/setup
|
||||
|
||||
# This hook is supposed to be run on Linux. It patches the proper locations of
|
||||
# the crt{1,i,n}.o files into the build to ensure that Emacs is linked with
|
||||
# *our* versions, not the ones found in the system, as it would do by default.
|
||||
# On other platforms, this appears to be unnecessary.
|
||||
preConfigure() {
|
||||
for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
|
||||
substituteInPlace $i --replace /bin/pwd pwd
|
||||
done
|
||||
|
||||
case "${system}" in
|
||||
x86_64-linux) glibclibdir=lib64 ;;
|
||||
i686-linux) glibclibdir=lib ;;
|
||||
*) return;
|
||||
esac
|
||||
|
||||
libc=$(cat ${NIX_CC}/nix-support/orig-libc)
|
||||
echo "libc: $libc"
|
||||
|
||||
for i in src/s/*.h src/m/*.h; do
|
||||
substituteInPlace $i \
|
||||
--replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \
|
||||
--replace /usr/${glibclibdir}/crti.o $libc/${glibclibdir}/crti.o \
|
||||
--replace /usr/${glibclibdir}/crtn.o $libc/${glibclibdir}/crtn.o \
|
||||
--replace /usr/lib/crt1.o $libc/${glibclibdir}/crt1.o \
|
||||
--replace /usr/lib/crti.o $libc/${glibclibdir}/crti.o \
|
||||
--replace /usr/lib/crtn.o $libc/${glibclibdir}/crtn.o
|
||||
done
|
||||
}
|
||||
|
||||
preInstall () {
|
||||
for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
|
||||
substituteInPlace $i --replace /bin/pwd pwd
|
||||
done
|
||||
}
|
||||
|
||||
genericBuild
|
@ -1,111 +0,0 @@
|
||||
{ stdenv, lib, fetchurl, ncurses, xlibsWrapper, libXaw, libXpm, Xaw3d
|
||||
, pkgconfig, gettext, libXft, dbus, libpng, libjpeg, libungif
|
||||
, libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
|
||||
, alsaLib, cairo, acl, gpm, AppKit, CoreWLAN, Kerberos, GSS, ImageIO
|
||||
, withX ? !stdenv.isDarwin
|
||||
, withGTK3 ? false, gtk3 ? null
|
||||
, withGTK2 ? true, gtk2
|
||||
, enableTTYTrueColor ? false
|
||||
}:
|
||||
|
||||
assert (libXft != null) -> libpng != null; # probably a bug
|
||||
assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise
|
||||
assert withGTK2 -> withX || stdenv.isDarwin;
|
||||
assert withGTK3 -> withX || stdenv.isDarwin;
|
||||
assert withGTK2 -> !withGTK3 && gtk2 != null;
|
||||
assert withGTK3 -> !withGTK2 && gtk3 != null;
|
||||
|
||||
let
|
||||
toolkit =
|
||||
if withGTK3 then "gtk3"
|
||||
else if withGTK2 then "gtk2"
|
||||
else "lucid";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "emacs-24.5";
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/emacs/${name}.tar.xz";
|
||||
sha256 = "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx";
|
||||
};
|
||||
|
||||
patches = lib.optionals stdenv.isDarwin [
|
||||
./at-fdcwd.patch
|
||||
] ++ lib.optionals enableTTYTrueColor [
|
||||
# Modified TTY True Color patch from: https://gist.github.com/choppsv1/36aacdd696d505566088
|
||||
# To use, pass --color=true-color, which will default to using ';'
|
||||
# as the separator.
|
||||
# Alternatively, set $EMACS_TRUE_COLOR_SEPARATOR to ';' or ':'.
|
||||
./tty-true-color.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's|/usr/share/locale|${gettext}/share/locale|g' lisp/international/mule-cmds.el
|
||||
# emacs runs then dumps itself. In the process, it keeps a copy of the
|
||||
# PATH env var, holding all the build inputs in it's closure.
|
||||
# Prevent that by running the self-dumping emacs with an empty PATH.
|
||||
sed -i 's|^RUN_TEMACS = |&PATH= |' src/Makefile.in
|
||||
'';
|
||||
|
||||
buildInputs =
|
||||
[ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo acl gpm gettext ]
|
||||
++ stdenv.lib.optional stdenv.isLinux dbus
|
||||
++ stdenv.lib.optionals withX
|
||||
[ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
|
||||
imagemagick gconf ]
|
||||
++ stdenv.lib.optional (withX && withGTK2) gtk2
|
||||
++ stdenv.lib.optional (withX && withGTK3) gtk3
|
||||
++ stdenv.lib.optional (stdenv.isDarwin && withX) cairo;
|
||||
|
||||
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AppKit GSS ImageIO ];
|
||||
|
||||
configureFlags =
|
||||
if stdenv.isDarwin
|
||||
then [ "--with-ns" "--disable-ns-self-contained" ]
|
||||
else if withX
|
||||
then [ "--with-x-toolkit=${toolkit}" "--with-xft" ]
|
||||
else [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
|
||||
"--with-gif=no" "--with-tiff=no" ];
|
||||
|
||||
NIX_CFLAGS_COMPILE =
|
||||
[ "-ffreestanding" ] # needed due to glibc 2.24 upgrade (see https://sourceware.org/glibc/wiki/Release/2.24#Known_Issues)
|
||||
++ stdenv.lib.optional (stdenv.isDarwin && withX) "-I${cairo.dev}/include/cairo";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/emacs/site-lisp/
|
||||
cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
mkdir -p $out/Applications
|
||||
mv nextstep/Emacs.app $out/Applications
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "GNU Emacs 24, the extensible, customizable text editor";
|
||||
homepage = http://www.gnu.org/software/emacs/;
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ chaoflow lovek323 peti the-kenny jwiegley ];
|
||||
platforms = platforms.all;
|
||||
|
||||
longDescription = ''
|
||||
GNU Emacs is an extensible, customizable text editor—and more. At its
|
||||
core is an interpreter for Emacs Lisp, a dialect of the Lisp
|
||||
programming language with extensions to support text editing.
|
||||
|
||||
The features of GNU Emacs include: content-sensitive editing modes,
|
||||
including syntax coloring, for a wide variety of file types including
|
||||
plain text, source code, and HTML; complete built-in documentation,
|
||||
including a tutorial for new users; full Unicode support for nearly all
|
||||
human languages and their scripts; highly customizable, using Emacs
|
||||
Lisp code or a graphical interface; a large number of extensions that
|
||||
add other functionality, including a project planner, mail and news
|
||||
reader, debugger interface, calendar, and more. Many of these
|
||||
extensions are distributed with GNU Emacs; others are available
|
||||
separately.
|
||||
'';
|
||||
};
|
||||
}
|
@ -1,428 +0,0 @@
|
||||
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el
|
||||
index 98108ce..21814a9 100644
|
||||
--- a/lisp/term/tty-colors.el
|
||||
+++ b/lisp/term/tty-colors.el
|
||||
@@ -764,7 +764,8 @@
|
||||
(auto . 0)
|
||||
(ansi8 . 8)
|
||||
(always . 8)
|
||||
- (yes . 8))
|
||||
+ (yes . 8)
|
||||
+ (true-color . 16777216))
|
||||
"An alist of supported standard tty color modes and their aliases.")
|
||||
|
||||
(defun tty-color-alist (&optional _frame)
|
||||
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
|
||||
index c673749..244cf7f 100644
|
||||
--- a/lisp/term/xterm.el
|
||||
+++ b/lisp/term/xterm.el
|
||||
@@ -674,6 +674,15 @@ versions of xterm."
|
||||
;; are more colors to support, compute them now.
|
||||
(when (> ncolors 0)
|
||||
(cond
|
||||
+ ((= (display-color-cells (selected-frame)) 16777216) ; 24-bit xterm
|
||||
+ (let ((idx (length xterm-standard-colors)))
|
||||
+ ;; Insert standard X colors after the standard xterm ones
|
||||
+ (mapc (lambda (color)
|
||||
+ (if (not (assoc (car color) xterm-standard-colors))
|
||||
+ (progn
|
||||
+ (tty-color-define (car color) idx (cdr color))
|
||||
+ (setq idx (1+ idx)))))
|
||||
+ color-name-rgb-alist)))
|
||||
((= ncolors 240) ; 256-color xterm
|
||||
;; 216 non-gray colors first
|
||||
(let ((r 0) (g 0) (b 0))
|
||||
diff --git a/src/dispextern.h b/src/dispextern.h
|
||||
index 239c442..5760b84 100644
|
||||
--- a/src/dispextern.h
|
||||
+++ b/src/dispextern.h
|
||||
@@ -1739,9 +1739,15 @@ struct face
|
||||
INLINE bool
|
||||
face_tty_specified_color (unsigned long color)
|
||||
{
|
||||
- return color < FACE_TTY_DEFAULT_BG_COLOR;
|
||||
+ return (color < FACE_TTY_DEFAULT_BG_COLOR);
|
||||
}
|
||||
|
||||
+INLINE bool
|
||||
+face_tty_specified_24_bit_color (unsigned long color)
|
||||
+{
|
||||
+ /* 24 bit colors have 24th but not 25th bit set */
|
||||
+ return ((color & (0x03 << 24)) == (0x01 << 24));
|
||||
+}
|
||||
/* Non-zero if FACE was realized for unibyte use. */
|
||||
|
||||
#define FACE_UNIBYTE_P(FACE) ((FACE)->charset < 0)
|
||||
diff --git a/src/term.c b/src/term.c
|
||||
index 8312491..b14aded 100644
|
||||
--- a/src/term.c
|
||||
+++ b/src/term.c
|
||||
@@ -1915,18 +1915,40 @@ turn_on_face (struct frame *f, int face_id)
|
||||
const char *ts;
|
||||
char *p;
|
||||
|
||||
- ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
|
||||
+ if (face_tty_specified_24_bit_color(fg))
|
||||
+ ts = tty->standout_mode ? tty->TS_set_rgb_background : tty->TS_set_rgb_foreground;
|
||||
+ else
|
||||
+ ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
|
||||
if (face_tty_specified_color (fg) && ts)
|
||||
{
|
||||
- p = tparam (ts, NULL, 0, fg, 0, 0, 0);
|
||||
+ if (!face_tty_specified_24_bit_color(fg))
|
||||
+ p = tparam (ts, NULL, 0, fg, 0, 0, 0);
|
||||
+ else
|
||||
+ {
|
||||
+ const unsigned char r = (fg >> 16) & 0xFF,
|
||||
+ g = (fg >> 8) & 0xFF,
|
||||
+ b = fg & 0xFF;
|
||||
+ p = tparam (ts, NULL, 0, (int)r, (int)g, (int)b, 0);
|
||||
+ }
|
||||
OUTPUT (tty, p);
|
||||
xfree (p);
|
||||
}
|
||||
|
||||
- ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
|
||||
+ if (face_tty_specified_24_bit_color(bg))
|
||||
+ ts = tty->standout_mode ? tty->TS_set_rgb_foreground : tty->TS_set_rgb_background;
|
||||
+ else
|
||||
+ ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
|
||||
if (face_tty_specified_color (bg) && ts)
|
||||
{
|
||||
- p = tparam (ts, NULL, 0, bg, 0, 0, 0);
|
||||
+ if (!face_tty_specified_24_bit_color(bg))
|
||||
+ p = tparam (ts, NULL, 0, bg, 0, 0, 0);
|
||||
+ else
|
||||
+ {
|
||||
+ const unsigned char r = (bg >> 16) & 0xFF,
|
||||
+ g = (bg >> 8) & 0xFF,
|
||||
+ b = bg & 0xFF;
|
||||
+ p = tparam (ts, NULL, 0, (int)r, (int)g, (int)b, 0);
|
||||
+ }
|
||||
OUTPUT (tty, p);
|
||||
xfree (p);
|
||||
}
|
||||
@@ -2028,6 +2050,8 @@ TERMINAL does not refer to a text terminal. */)
|
||||
struct terminal *t = get_tty_terminal (terminal, 0);
|
||||
if (!t)
|
||||
return make_number (0);
|
||||
+ else if (t->display_info.tty->TS_set_rgb_foreground)
|
||||
+ return make_number (16777216); /* 24 bit True Color */
|
||||
else
|
||||
return make_number (t->display_info.tty->TN_max_colors);
|
||||
}
|
||||
@@ -2043,6 +2067,8 @@ static int default_no_color_video;
|
||||
static char *default_orig_pair;
|
||||
static char *default_set_foreground;
|
||||
static char *default_set_background;
|
||||
+static char *default_set_rgb_foreground;
|
||||
+static char *default_set_rgb_background;
|
||||
|
||||
/* Save or restore the default color-related capabilities of this
|
||||
terminal. */
|
||||
@@ -2055,6 +2081,8 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save)
|
||||
dupstring (&default_orig_pair, tty->TS_orig_pair);
|
||||
dupstring (&default_set_foreground, tty->TS_set_foreground);
|
||||
dupstring (&default_set_background, tty->TS_set_background);
|
||||
+ dupstring (&default_set_rgb_foreground, tty->TS_set_rgb_foreground);
|
||||
+ dupstring (&default_set_rgb_background, tty->TS_set_rgb_background);
|
||||
default_max_colors = tty->TN_max_colors;
|
||||
default_max_pairs = tty->TN_max_pairs;
|
||||
default_no_color_video = tty->TN_no_color_video;
|
||||
@@ -2064,6 +2092,8 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save)
|
||||
tty->TS_orig_pair = default_orig_pair;
|
||||
tty->TS_set_foreground = default_set_foreground;
|
||||
tty->TS_set_background = default_set_background;
|
||||
+ tty->TS_set_rgb_foreground = default_set_rgb_foreground;
|
||||
+ tty->TS_set_rgb_background = default_set_rgb_background;
|
||||
tty->TN_max_colors = default_max_colors;
|
||||
tty->TN_max_pairs = default_max_pairs;
|
||||
tty->TN_no_color_video = default_no_color_video;
|
||||
@@ -2088,6 +2118,7 @@ tty_setup_colors (struct tty_display_info *tty, int mode)
|
||||
tty->TN_max_pairs = 0;
|
||||
tty->TN_no_color_video = 0;
|
||||
tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL;
|
||||
+ tty->TS_set_rgb_foreground = tty->TS_set_rgb_background = NULL;
|
||||
break;
|
||||
case 0: /* default colors, if any */
|
||||
default:
|
||||
@@ -2102,10 +2133,45 @@ tty_setup_colors (struct tty_display_info *tty, int mode)
|
||||
tty->TS_set_foreground = "\033[3%dm";
|
||||
tty->TS_set_background = "\033[4%dm";
|
||||
#endif
|
||||
+ tty->TS_set_rgb_foreground = NULL;
|
||||
+ tty->TS_set_rgb_background = NULL;
|
||||
tty->TN_max_colors = 8;
|
||||
tty->TN_max_pairs = 64;
|
||||
tty->TN_no_color_video = 0;
|
||||
break;
|
||||
+ case 16777216: /* RGB colors */
|
||||
+ tty->TS_orig_pair = "\033[0m";
|
||||
+
|
||||
+ /* if the user hasn't explicitly chosen the ":" separator, use ";". */
|
||||
+ char * true_color_separator = getenv ("EMACS_TRUE_COLOR_SEPARATOR");
|
||||
+ if (true_color_separator && strcmp (true_color_separator, ":") == 0)
|
||||
+ {
|
||||
+ /* XXX chopps use ITU T.421 ':' separator */
|
||||
+ /* TODO This should be extracted from terminfo/termcap. */
|
||||
+#ifdef TERMINFO
|
||||
+ tty->TS_set_rgb_foreground = "\033[38:2:%p1%d:%p2%d:%p3%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48:2:%p1%d:%p2%d:%p3%dm";
|
||||
+#else
|
||||
+ tty->TS_set_rgb_foreground = "\033[38:2:%d:%d:%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48:2:%d:%d:%dm";
|
||||
+#endif
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* TODO This should be extracted from terminfo/termcap. */
|
||||
+#ifdef TERMINFO
|
||||
+ tty->TS_set_rgb_foreground = "\033[38;2;%p1%d;%p2%d;%p3%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48;2;%p1%d;%p2%d;%p3%dm";
|
||||
+#else
|
||||
+ tty->TS_set_rgb_foreground = "\033[38;2;%d;%d;%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48;2;%d;%d;%dm";
|
||||
+#endif
|
||||
+ }
|
||||
+
|
||||
+ tty->TN_max_colors = 16777216;
|
||||
+ /*tty->TN_max_pairs = 64; TODO */
|
||||
+ tty->TN_no_color_video = 0;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4201,6 +4267,38 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
|
||||
tty->TN_no_color_video = tgetnum ("NC");
|
||||
if (tty->TN_no_color_video == -1)
|
||||
tty->TN_no_color_video = 0;
|
||||
+
|
||||
+
|
||||
+ /* Allow the user to opt-in to True Color support. */
|
||||
+ char * true_color_separator = getenv ("EMACS_TRUE_COLOR_SEPARATOR");
|
||||
+ if (true_color_separator && strcmp (true_color_separator, ";") == 0)
|
||||
+ {
|
||||
+ /* TODO This should be extracted from terminfo/termcap. */
|
||||
+#ifdef TERMINFO
|
||||
+ tty->TS_set_rgb_foreground = "\033[38;2;%p1%d;%p2%d;%p3%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48;2;%p1%d;%p2%d;%p3%dm";
|
||||
+#else
|
||||
+ tty->TS_set_rgb_foreground = "\033[38;2;%d;%d;%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48;2;%d;%d;%dm";
|
||||
+#endif
|
||||
+ }
|
||||
+ else if (true_color_separator && strcmp (true_color_separator, ":") == 0)
|
||||
+ {
|
||||
+ /* XXX chopps use ITU T.421 ':' separator */
|
||||
+ /* TODO This should be extracted from terminfo/termcap. */
|
||||
+#ifdef TERMINFO
|
||||
+ tty->TS_set_rgb_foreground = "\033[38:2:%p1%d:%p2%d:%p3%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48:2:%p1%d:%p2%d:%p3%dm";
|
||||
+#else
|
||||
+ tty->TS_set_rgb_foreground = "\033[38:2:%d:%d:%dm";
|
||||
+ tty->TS_set_rgb_background = "\033[48:2:%d:%d:%dm";
|
||||
+#endif
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ tty->TS_set_rgb_foreground = NULL;
|
||||
+ tty->TS_set_rgb_background = NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
tty_default_color_capabilities (tty, 1);
|
||||
diff --git a/src/termchar.h b/src/termchar.h
|
||||
index d8066d7..e48d583 100644
|
||||
--- a/src/termchar.h
|
||||
+++ b/src/termchar.h
|
||||
@@ -157,6 +157,10 @@ struct tty_display_info
|
||||
const char *TS_set_foreground;
|
||||
const char *TS_set_background;
|
||||
|
||||
+ /* Support for 24bit RGB color terminals. */
|
||||
+ const char *TS_set_rgb_foreground;
|
||||
+ const char *TS_set_rgb_background;
|
||||
+
|
||||
int TF_hazeltine; /* termcap hz flag. */
|
||||
int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
|
||||
int TF_standout_motion; /* termcap mi flag: can move while in standout mode. */
|
||||
diff --git a/src/xfaces.c b/src/xfaces.c
|
||||
index 29c91f7..347ebf8 100644
|
||||
--- a/src/xfaces.c
|
||||
+++ b/src/xfaces.c
|
||||
@@ -382,7 +382,7 @@ static ptrdiff_t lface_id_to_name_size;
|
||||
|
||||
/* TTY color-related functions (defined in tty-colors.el). */
|
||||
|
||||
-static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values;
|
||||
+static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values, Qtty_color_canonicalize;
|
||||
|
||||
/* The name of the function used to compute colors on TTYs. */
|
||||
|
||||
@@ -943,54 +943,80 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color,
|
||||
if (!STRINGP (color) || NILP (Ffboundp (Qtty_color_desc)))
|
||||
return 0;
|
||||
|
||||
- XSETFRAME (frame, f);
|
||||
-
|
||||
- color_desc = call2 (Qtty_color_desc, color, frame);
|
||||
- if (CONSP (color_desc) && CONSP (XCDR (color_desc)))
|
||||
+ if (f->output_method == output_termcap
|
||||
+ && f->output_data.tty->display_info->TS_set_rgb_foreground
|
||||
+ && !NILP (Ffboundp (Qtty_color_standard_values)))
|
||||
{
|
||||
- Lisp_Object rgb;
|
||||
-
|
||||
- if (! INTEGERP (XCAR (XCDR (color_desc))))
|
||||
- return 0;
|
||||
+ /* Terminal supports 3 byte RGB colors. */
|
||||
+ if (!NILP (Ffboundp (Qtty_color_canonicalize)))
|
||||
+ color = call1(Qtty_color_canonicalize, color);
|
||||
|
||||
- tty_color->pixel = XINT (XCAR (XCDR (color_desc)));
|
||||
+ color_desc = call1 (Qtty_color_standard_values, color);
|
||||
+ if (! parse_rgb_list (color_desc, tty_color))
|
||||
+ return 0;
|
||||
|
||||
- rgb = XCDR (XCDR (color_desc));
|
||||
- if (! parse_rgb_list (rgb, tty_color))
|
||||
- return 0;
|
||||
+ /* Map XColor to 3 byte values. */
|
||||
+ tty_color->pixel = 1 << 24 /* Set bit 24 to mark RGB values. */
|
||||
+ | (tty_color->red / 256) << 16
|
||||
+ | (tty_color->green / 256) << 8
|
||||
+ | (tty_color->blue / 256);
|
||||
|
||||
- /* Should we fill in STD_COLOR too? */
|
||||
if (std_color)
|
||||
- {
|
||||
- /* Default STD_COLOR to the same as TTY_COLOR. */
|
||||
- *std_color = *tty_color;
|
||||
-
|
||||
- /* Do a quick check to see if the returned descriptor is
|
||||
- actually _exactly_ equal to COLOR, otherwise we have to
|
||||
- lookup STD_COLOR separately. If it's impossible to lookup
|
||||
- a standard color, we just give up and use TTY_COLOR. */
|
||||
- if ((!STRINGP (XCAR (color_desc))
|
||||
- || NILP (Fstring_equal (color, XCAR (color_desc))))
|
||||
- && !NILP (Ffboundp (Qtty_color_standard_values)))
|
||||
- {
|
||||
- /* Look up STD_COLOR separately. */
|
||||
- rgb = call1 (Qtty_color_standard_values, color);
|
||||
- if (! parse_rgb_list (rgb, std_color))
|
||||
- return 0;
|
||||
- }
|
||||
- }
|
||||
+ *std_color = *tty_color;
|
||||
|
||||
return 1;
|
||||
}
|
||||
- else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist"))))
|
||||
- /* We were called early during startup, and the colors are not
|
||||
- yet set up in tty-defined-color-alist. Don't return a failure
|
||||
- indication, since this produces the annoying "Unable to
|
||||
- load color" messages in the *Messages* buffer. */
|
||||
- return 1;
|
||||
else
|
||||
- /* tty-color-desc seems to have returned a bad value. */
|
||||
- return 0;
|
||||
+ {
|
||||
+ XSETFRAME (frame, f);
|
||||
+
|
||||
+ color_desc = call2 (Qtty_color_desc, color, frame);
|
||||
+ if (CONSP (color_desc) && CONSP (XCDR (color_desc)))
|
||||
+ {
|
||||
+ Lisp_Object rgb;
|
||||
+
|
||||
+ if (! INTEGERP (XCAR (XCDR (color_desc))))
|
||||
+ return 0;
|
||||
+
|
||||
+ tty_color->pixel = XINT (XCAR (XCDR (color_desc)));
|
||||
+
|
||||
+ rgb = XCDR (XCDR (color_desc));
|
||||
+ if (! parse_rgb_list (rgb, tty_color))
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Should we fill in STD_COLOR too? */
|
||||
+ if (std_color)
|
||||
+ {
|
||||
+ /* Default STD_COLOR to the same as TTY_COLOR. */
|
||||
+ *std_color = *tty_color;
|
||||
+
|
||||
+ /* Do a quick check to see if the returned descriptor is
|
||||
+ actually _exactly_ equal to COLOR, otherwise we have to
|
||||
+ lookup STD_COLOR separately. If it's impossible to lookup
|
||||
+ a standard color, we just give up and use TTY_COLOR. */
|
||||
+ if ((!STRINGP (XCAR (color_desc))
|
||||
+ || NILP (Fstring_equal (color, XCAR (color_desc))))
|
||||
+ && !NILP (Ffboundp (Qtty_color_standard_values)))
|
||||
+ {
|
||||
+ /* Look up STD_COLOR separately. */
|
||||
+ rgb = call1 (Qtty_color_standard_values, color);
|
||||
+ if (! parse_rgb_list (rgb, std_color))
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist"))))
|
||||
+ /* We were called early during startup, and the colors are not
|
||||
+ yet set up in tty-defined-color-alist. Don't return a failure
|
||||
+ indication, since this produces the annoying "Unable to
|
||||
+ load color" messages in the *Messages* buffer. */
|
||||
+ return 1;
|
||||
+ else
|
||||
+ /* tty-color-desc seems to have returned a bad value. */
|
||||
+ return 0;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* A version of defined_color for non-X frames. */
|
||||
@@ -1008,7 +1034,9 @@ tty_defined_color (struct frame *f, const char *color_name,
|
||||
color_def->green = 0;
|
||||
|
||||
if (*color_name)
|
||||
- status = tty_lookup_color (f, build_string (color_name), color_def, NULL);
|
||||
+ {
|
||||
+ status = tty_lookup_color (f, build_string (color_name), color_def, NULL);
|
||||
+ }
|
||||
|
||||
if (color_def->pixel == FACE_TTY_DEFAULT_COLOR && *color_name)
|
||||
{
|
||||
@@ -5780,6 +5808,7 @@ map_tty_color (struct frame *f, struct face *face,
|
||||
unsigned long default_pixel =
|
||||
foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR;
|
||||
unsigned long pixel = default_pixel;
|
||||
+ XColor true_color;
|
||||
#ifdef MSDOS
|
||||
unsigned long default_other_pixel =
|
||||
foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR;
|
||||
@@ -5798,7 +5827,18 @@ map_tty_color (struct frame *f, struct face *face,
|
||||
{
|
||||
/* Associations in tty-defined-color-alist are of the form
|
||||
(NAME INDEX R G B). We need the INDEX part. */
|
||||
- pixel = XINT (XCAR (XCDR (def)));
|
||||
+ if (f->output_method == output_termcap
|
||||
+ && f->output_data.tty->display_info->TS_set_rgb_foreground
|
||||
+ && parse_rgb_list (XCDR (XCDR(def)), &true_color))
|
||||
+ {
|
||||
+ /* Map XColor to 3 byte values. */
|
||||
+ pixel = 1 << 24 /* Set bit 24 to mark RGB values. */
|
||||
+ | (true_color.red / 256) << 16
|
||||
+ | (true_color.green / 256) << 8
|
||||
+ | (true_color.blue / 256);
|
||||
+ }
|
||||
+ else
|
||||
+ pixel = XINT (XCAR (XCDR (def)));
|
||||
}
|
||||
|
||||
if (pixel == default_pixel && STRINGP (color))
|
||||
@@ -6460,6 +6500,7 @@ syms_of_xfaces (void)
|
||||
DEFSYM (Qwindow_divider, "window-divider");
|
||||
DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel");
|
||||
DEFSYM (Qwindow_divider_last_pixel, "window-divider-last-pixel");
|
||||
+ DEFSYM (Qtty_color_canonicalize, "tty-color-canonicalize");
|
||||
DEFSYM (Qtty_color_desc, "tty-color-desc");
|
||||
DEFSYM (Qtty_color_standard_values, "tty-color-standard-values");
|
||||
DEFSYM (Qtty_color_by_index, "tty-color-by-index");
|
@ -1,15 +0,0 @@
|
||||
diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h
|
||||
index 84ede3e..8e8f42e 100644
|
||||
--- a/lib/careadlinkat.h
|
||||
+++ b/lib/careadlinkat.h
|
||||
@@ -23,6 +23,10 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#ifndef AT_FDCWD
|
||||
+#define AT_FDCWD -2
|
||||
+#endif
|
||||
+
|
||||
struct allocator;
|
||||
|
||||
/* Assuming the current directory is FD, get the symbolic link value
|
@ -1,17 +0,0 @@
|
||||
;; NixOS specific load-path
|
||||
(setq load-path
|
||||
(append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
|
||||
(split-string (or (getenv "NIX_PROFILES") ""))))
|
||||
load-path))
|
||||
|
||||
;;; Make `woman' find the man pages
|
||||
(eval-after-load 'woman
|
||||
'(setq woman-manpath
|
||||
(append (reverse (mapcar (lambda (x) (concat x "/share/man/"))
|
||||
(split-string (or (getenv "NIX_PROFILES") ""))))
|
||||
woman-manpath)))
|
||||
|
||||
;; Make tramp work for remote NixOS machines
|
||||
;;; NOTE: You might want to add
|
||||
(eval-after-load 'tramp
|
||||
'(add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))
|
@ -23,15 +23,14 @@ let
|
||||
else if withGTK2 then "gtk2"
|
||||
else "lucid";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "emacs-25.1-rc2";
|
||||
name = "emacs-25.1";
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "ftp://alpha.gnu.org/gnu/emacs/pretest/${name}.tar.xz";
|
||||
sha256 = "1hffvyvl50mrivdv6lp92sbxi3l2zhblj8npmpbzk47zpl1mzm2v";
|
||||
url = "mirror://gnu//emacs/${name}.tar.xz";
|
||||
sha256 = "0cwgyiyymnx4xdg99dm2drfxcyhy2jmyf0rkr9fwj9mwwf77kwhr";
|
||||
};
|
||||
|
||||
patches = lib.optionals stdenv.isDarwin [
|
||||
@ -39,35 +38,36 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's|/usr/share/locale|${gettext}/share/locale|g' lisp/international/mule-cmds.el
|
||||
substituteInPlace lisp/international/mule-cmds.el \
|
||||
--replace "/usr/share/locale" "${gettext}/share/locale"
|
||||
'';
|
||||
|
||||
buildInputs =
|
||||
[ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo acl gpm gettext
|
||||
autoconf automake ]
|
||||
++ stdenv.lib.optional stdenv.isLinux dbus
|
||||
++ stdenv.lib.optionals withX
|
||||
++ lib.optional stdenv.isLinux dbus
|
||||
++ lib.optionals withX
|
||||
[ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
|
||||
imagemagick gconf ]
|
||||
++ stdenv.lib.optional (withX && withGTK2) gtk2
|
||||
++ stdenv.lib.optional (withX && withGTK3) gtk3
|
||||
++ stdenv.lib.optional (stdenv.isDarwin && withX) cairo
|
||||
++ stdenv.lib.optionals withXwidgets [webkitgtk24x wrapGAppsHook glib_networking];
|
||||
++ lib.optional (withX && withGTK2) gtk2
|
||||
++ lib.optional (withX && withGTK3) gtk3
|
||||
++ lib.optional (stdenv.isDarwin && withX) cairo
|
||||
++ lib.optionals withXwidgets [ webkitgtk24x wrapGAppsHook glib_networking ];
|
||||
|
||||
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AppKit GSS ImageIO ];
|
||||
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AppKit GSS ImageIO ];
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
configureFlags =
|
||||
(if stdenv.isDarwin
|
||||
configureFlags = [ "--with-modules" ] ++
|
||||
(if stdenv.isDarwin
|
||||
then [ "--with-ns" "--disable-ns-self-contained" ]
|
||||
else if withX
|
||||
then [ "--with-x-toolkit=${toolkit}" "--with-xft" ]
|
||||
else [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
|
||||
"--with-gif=no" "--with-tiff=no" ])
|
||||
++ stdenv.lib.optional withXwidgets "--with-xwidgets";
|
||||
++ lib.optional withXwidgets "--with-xwidgets";
|
||||
|
||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.isDarwin && withX)
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && withX)
|
||||
"-I${cairo.dev}/include/cairo";
|
||||
|
||||
preBuild = ''
|
||||
@ -77,13 +77,13 @@ stdenv.mkDerivation rec {
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/emacs/site-lisp/
|
||||
cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
mkdir -p $out/Applications
|
||||
mv nextstep/Emacs.app $out/Applications
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "GNU Emacs 25 (pre), the extensible, customizable text editor";
|
||||
description = "The extensible, customizable GNU text editor";
|
||||
homepage = http://www.gnu.org/software/emacs/;
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ chaoflow lovek323 peti the-kenny jwiegley ];
|
@ -773,7 +773,7 @@ self: super: {
|
||||
local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" )
|
||||
pushd >/dev/null $lispdir
|
||||
for i in *.el; do
|
||||
emacs -Q -L . -L ${pkgs.emacs24Packages.haskellMode}/share/emacs/site-lisp \
|
||||
emacs -Q -L . -L ${pkgs.emacsPackages.haskellMode}/share/emacs/site-lisp \
|
||||
--batch --eval "(byte-compile-disable-warning 'cl-functions)" \
|
||||
-f batch-byte-compile $i
|
||||
done
|
||||
@ -790,7 +790,7 @@ self: super: {
|
||||
local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" )
|
||||
pushd >/dev/null $lispdir
|
||||
for i in *.el; do
|
||||
emacs -Q -L . -L ${pkgs.emacs24Packages.haskellMode}/share/emacs/site-lisp \
|
||||
emacs -Q -L . -L ${pkgs.emacsPackages.haskellMode}/share/emacs/site-lisp \
|
||||
--batch --eval "(byte-compile-disable-warning 'cl-functions)" \
|
||||
-f batch-byte-compile $i
|
||||
done
|
||||
|
@ -12844,12 +12844,12 @@ in
|
||||
|
||||
elvis = callPackage ../applications/editors/elvis { };
|
||||
|
||||
emacs = emacs24;
|
||||
emacsPackages = emacs24Packages;
|
||||
emacsPackagesNg = emacs24PackagesNg;
|
||||
emacsMelpa = emacs24PackagesNg; # for backward compatibility
|
||||
emacs = emacs25;
|
||||
emacsPackages = emacs25Packages;
|
||||
emacsPackagesNg = emacs25PackagesNg;
|
||||
emacsMelpa = emacs25PackagesNg; # for backward compatibility
|
||||
|
||||
emacs24 = callPackage ../applications/editors/emacs-24 {
|
||||
emacs25 = callPackage ../applications/editors/emacs {
|
||||
# use override to enable additional features
|
||||
libXaw = xorg.libXaw;
|
||||
Xaw3d = null;
|
||||
@ -12861,31 +12861,19 @@ in
|
||||
inherit (darwin.apple_sdk.frameworks) AppKit CoreWLAN GSS Kerberos ImageIO;
|
||||
};
|
||||
|
||||
emacs24-nox = lowPrio (appendToName "nox" (emacs24.override {
|
||||
emacs25-nox = lowPrio (appendToName "nox" (emacs25.override {
|
||||
withX = false;
|
||||
withGTK2 = false;
|
||||
withGTK3 = false;
|
||||
}));
|
||||
|
||||
emacs24Macport_24_5 = lowPrio (callPackage ../applications/editors/emacs-24/macport-24.5.nix {
|
||||
emacs24Macport_24_5 = lowPrio (callPackage ../applications/editors/emacs/macport-24.5.nix {
|
||||
inherit (darwin.apple_sdk.frameworks)
|
||||
AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit
|
||||
ImageCaptureCore GSS ImageIO;
|
||||
});
|
||||
emacs24Macport = self.emacs24Macport_24_5;
|
||||
|
||||
emacs25pre = lowPrio (callPackage ../applications/editors/emacs-25 {
|
||||
# use override to enable additional features
|
||||
libXaw = xorg.libXaw;
|
||||
Xaw3d = null;
|
||||
gconf = null;
|
||||
alsaLib = null;
|
||||
imagemagick = null;
|
||||
acl = null;
|
||||
gpm = null;
|
||||
inherit (darwin.apple_sdk.frameworks) AppKit CoreWLAN GSS Kerberos ImageIO;
|
||||
});
|
||||
|
||||
emacsPackagesGen = emacs: self: let callPackage = newScope self; in rec {
|
||||
inherit emacs;
|
||||
|
||||
@ -13039,7 +13027,7 @@ in
|
||||
cask = callPackage ../applications/editors/emacs-modes/cask { };
|
||||
};
|
||||
|
||||
emacs24Packages = emacsPackagesGen emacs24 pkgs.emacs24Packages;
|
||||
emacs25Packages = emacsPackagesGen emacs25 pkgs.emacs25Packages;
|
||||
|
||||
emacsPackagesNgGen = emacs: import ./emacs-packages.nix {
|
||||
overrides = (config.emacsPackageOverrides or (p: {})) pkgs;
|
||||
@ -13064,9 +13052,9 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
emacs24PackagesNg = emacsPackagesNgGen emacs24;
|
||||
emacs25PackagesNg = emacsPackagesNgGen emacs25;
|
||||
|
||||
emacs24WithPackages = emacs24PackagesNg.emacsWithPackages;
|
||||
emacs25WithPackages = emacs25PackagesNg.emacsWithPackages;
|
||||
emacsWithPackages = emacsPackagesNg.emacsWithPackages;
|
||||
|
||||
# inherit (gnome3) empathy;
|
||||
@ -14286,7 +14274,7 @@ in
|
||||
|
||||
notmuch = callPackage ../applications/networking/mailreaders/notmuch {
|
||||
# No need to build Emacs - notmuch.el works just fine without
|
||||
# byte-compilation. Use emacs24Packages.notmuch if you want to
|
||||
# byte-compilation. Use emacsPackages.notmuch if you want to
|
||||
# byte-compiled files
|
||||
emacs = null;
|
||||
sphinx = pythonPackages.sphinx;
|
||||
|
@ -39,7 +39,7 @@ with import ./release-lib.nix { inherit supportedSystems; };
|
||||
dhcp = linux;
|
||||
diffutils = all;
|
||||
e2fsprogs = linux;
|
||||
emacs24 = gtkSupported;
|
||||
emacs25 = gtkSupported;
|
||||
enscript = all;
|
||||
file = all;
|
||||
findutils = all;
|
||||
|
@ -90,7 +90,7 @@ let
|
||||
|
||||
# Language packages disabled in https://github.com/NixOS/nixpkgs/commit/ccd1029f58a3bb9eca32d81bf3f33cb4be25cc66
|
||||
|
||||
#emacs24PackagesNg = packagePlatforms pkgs.emacs24PackagesNg;
|
||||
#emacsPackagesNg = packagePlatforms pkgs.emacsPackagesNg;
|
||||
#rPackages = packagePlatforms pkgs.rPackages;
|
||||
ocamlPackages = { };
|
||||
perlPackages = { };
|
||||
|
Loading…
Reference in New Issue
Block a user