-madmutt
-madmutt_dotlock
-
*.li
-alias.c
-buffy.c
-charset.c
-crypt.c
-score.c
+.*.sw?
+.tags
+
+/madmutt
+/madmutt_dotlock
+
+/alias.c
+/buffy.c
+/charset.c
+/crypt.c
+/score.c
+
+/config.h
+/charset.gperf
+/keymap_defs.h
+/keymap_alldefs.h
-config.h
-charset.gperf
-keymap_defs.h
-keymap_alldefs.h
+/.build*
+/build
CMakeCache.txt
CMakeFiles
OPTION(WITH_GPGME "Use GPGME [default: on]" ON)
OPTION(WITH_NNTP "Build NNTP support [default: off]")
OPTION(WITH_IDN "Use GNU libidn for domain names [default: off]")
-OPTION(WITH_SLANG "Use S-Lang instead of ncurses [default:off]")
OPTION(USE_FLOCK "Use flock to lock files [default: off]")
OPTION(USE_FCNTL "Use fcntl to lock files [default: on]" ON)
INCLUDE(CheckLibraryExists)
INCLUDE(UsePkgConfig)
-IF(WITH_SLANG)
- IF(EXISTS ${CMAKE_INSTALL_PREFIX}/include/slang)
- INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include/slang)
- ELSEIF(EXISTS /usr/include/slang)
- INCLUDE_DIRECTORIES(/usr/include/slang)
- ENDIF(EXISTS ${CMAKE_INSTALL_PREFIX}/include/slang)
- CHECK_LIBRARY_EXISTS(slang SLtt_get_terminfo "" USE_SLANG_CURSES)
- IF(NOT USE_SLANG_CURSES)
- MESSAGE(FATAL_ERROR "s-lang not found")
- ENDIF(NOT USE_SLANG_CURSES)
-ELSE(WITH_SLANG)
- IF(HAVE_NCURSESW_NCURSES_H)
- SET(CMAKE_REQUIRED_INCLUDES "ncursesw/ncurses.h")
- SET(MUTTLIBS "${MUTTLIBS} -lncursesw")
- ELSEIF(HAVE_NCURSES_H)
- SET(CMAKE_REQUIRED_INCLUDES "ncurses.h")
- SET(MUTTLIBS "${MUTTLIBS} -lncurses")
- ELSEIF(HAVE_NCURSES_H OR HAVE_NCURSES_NCURSES_H)
- SET(CMAKE_REQUIRED_INCLUDES "ncurses/ncurses.h")
- SET(MUTTLIBS "${MUTTLIBS} -lncurses")
- ELSE(HAVE_NCURSESW_NCURSES_H)
- MESSAGE(FATAL_ERROR "could not find ncurses.h")
- ENDIF(HAVE_NCURSESW_NCURSES_H)
- SET(CMAKE_REQUIRED_LIBRARIES ${MUTTLIBS})
- CHECK_FUNCTION_EXISTS(start_color HAVE_START_COLOR)
- CHECK_FUNCTION_EXISTS(typeahead HAVE_TYPEAHEAD)
- CHECK_FUNCTION_EXISTS(bkgdset HAVE_BKGDSET)
- CHECK_FUNCTION_EXISTS(curs_set HAVE_CURS_SET)
- CHECK_FUNCTION_EXISTS(meta HAVE_META)
- CHECK_FUNCTION_EXISTS(use_default_colors HAVE_USE_DEFAULT_COLORS)
- CHECK_FUNCTION_EXISTS(resizeterm HAVE_RESIZETERM)
- SET(CMAKE_REQUIRED_LIBRARIES)
- SET(CMAKE_REQUIRED_INCLUDES)
-ENDIF(WITH_SLANG)
+IF(HAVE_NCURSESW_NCURSES_H)
+ SET(CMAKE_REQUIRED_INCLUDES "ncursesw/ncurses.h")
+ SET(MUTTLIBS "${MUTTLIBS} -lncursesw")
+ELSEIF(HAVE_NCURSES_H)
+ SET(CMAKE_REQUIRED_INCLUDES "ncurses.h")
+ SET(MUTTLIBS "${MUTTLIBS} -lncurses")
+ELSEIF(HAVE_NCURSES_H OR HAVE_NCURSES_NCURSES_H)
+ SET(CMAKE_REQUIRED_INCLUDES "ncurses/ncurses.h")
+ SET(MUTTLIBS "${MUTTLIBS} -lncurses")
+ELSE(HAVE_NCURSESW_NCURSES_H)
+ MESSAGE(FATAL_ERROR "could not find ncurses.h")
+ENDIF(HAVE_NCURSESW_NCURSES_H)
+SET(CMAKE_REQUIRED_LIBRARIES ${MUTTLIBS})
+CHECK_FUNCTION_EXISTS(start_color HAVE_START_COLOR)
+CHECK_FUNCTION_EXISTS(typeahead HAVE_TYPEAHEAD)
+CHECK_FUNCTION_EXISTS(bkgdset HAVE_BKGDSET)
+CHECK_FUNCTION_EXISTS(curs_set HAVE_CURS_SET)
+CHECK_FUNCTION_EXISTS(meta HAVE_META)
+CHECK_FUNCTION_EXISTS(use_default_colors HAVE_USE_DEFAULT_COLORS)
+CHECK_FUNCTION_EXISTS(resizeterm HAVE_RESIZETERM)
+SET(CMAKE_REQUIRED_LIBRARIES)
+SET(CMAKE_REQUIRED_INCLUDES)
PKGCONFIG(lua5.1 lua_INCDIR lua_LINKDIR lua_LDFLAGS lua_CFLAGS)
MESSAGE(STATUS "found lua5.1 at: INCDIR ${lua_INCDIR}")
#cmakedefine USE_FLOCK 1
#cmakedefine USE_HCACHE 1
#cmakedefine USE_NNTP 1
-#cmakedefine USE_SLANG_CURSES 1
*
* Notes:
*
- * - If you want to bind \n or \r, use M_ENTER_S so that it will work
- * correctly under both ncurses and S-Lang
- *
* - If you need to bind a control char, use the octal value because the \cX
* construct does not work at this level.
*
ITEM("tag-prefix-cond", OP_TAG_PREFIX_COND, NULL)
ITEM("end-cond", OP_END_COND, NULL)
ITEM("shell-escape", OP_SHELL_ESCAPE, "!")
- ITEM("select-entry", OP_GENERIC_SELECT_ENTRY, M_ENTER_S)
+ ITEM("select-entry", OP_GENERIC_SELECT_ENTRY, "\n")
ITEM("search", OP_SEARCH, "/")
ITEM("search-reverse", OP_SEARCH_REVERSE, "\033/")
ITEM("search-opposite", OP_SEARCH_OPPOSITE, NULL)
#ifdef USE_NNTP
ITEM("catchup", OP_CATCHUP, "y")
#endif
- ITEM("display-message", OP_DISPLAY_MESSAGE, M_ENTER_S)
+ ITEM("display-message", OP_DISPLAY_MESSAGE, "\n")
ITEM("buffy-list", OP_BUFFY_LIST, ".")
ITEM("sync-mailbox", OP_MAIN_SYNC_FOLDER, "$")
ITEM("display-address", OP_DISPLAY_ADDRESS, "@")
ITEM("search", OP_SEARCH, "/")
ITEM("search-reverse", OP_SEARCH_REVERSE, "\033/")
ITEM("search-opposite", OP_SEARCH_OPPOSITE, NULL)
- ITEM("next-line", OP_NEXT_LINE, M_ENTER_S)
+ ITEM("next-line", OP_NEXT_LINE, "\n")
ITEM("jump", OP_JUMP, NULL)
ITEM("next-unread", OP_MAIN_NEXT_UNREAD, NULL)
ITEM("previous-new", OP_MAIN_PREV_NEW, NULL)
ITEM("list-reply", OP_LIST_REPLY, "L")
ITEM("forward-message", OP_FORWARD_MESSAGE, "f")
ITEM("view-text", OP_ATTACH_VIEW_TEXT, "T")
- ITEM("view-attach", OP_VIEW_ATTACH, M_ENTER_S)
+ ITEM("view-attach", OP_VIEW_ATTACH, "\n")
ITEM("delete-entry", OP_DELETE, "d")
ITEM("undelete-entry", OP_UNDELETE, "u")
ITEM("collapse-parts", OP_ATTACH_COLLAPSE, "v")
ITEM("toggle-unlink", OP_COMPOSE_TOGGLE_UNLINK, "u")
ITEM("toggle-recode", OP_COMPOSE_TOGGLE_RECODE, NULL)
ITEM("update-encoding", OP_COMPOSE_UPDATE_ENCODING, "U")
- ITEM("view-attach", OP_VIEW_ATTACH, M_ENTER_S)
+ ITEM("view-attach", OP_VIEW_ATTACH, "\n")
ITEM("send-message", OP_COMPOSE_SEND_MESSAGE, "y")
ITEM("pipe-entry", OP_PIPE, "|")
ITEM("pgp-menu", OP_COMPOSE_PGP_MENU, "p")
ENDLIST
LIST(OpMix)
- ITEM("accept", OP_MIX_USE, M_ENTER_S)
+ ITEM("accept", OP_MIX_USE, "\n")
ITEM("append", OP_MIX_APPEND, "a")
ITEM("insert", OP_MIX_INSERT, "i")
ITEM("delete", OP_MIX_DELETE, "d")
#ifdef KEY_ENTER
{"<Enter>", KEY_ENTER},
#endif
- {"<Return>", M_ENTER_C},
+ {"<Return>", '\n'},
{"<Esc>", '\033'},
{"<Tab>", '\t'},
{"<Space>", ' '},
if (!IsEndwin)
refresh ();
mutt_curs_set (-1);
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
/* We don't receive SIGWINCH when suspended; however, no harm is done by
* just assuming we received one, and triggering the 'resize' anyway. */
SigWinch = 1;
#endif
break;
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
case SIGWINCH:
SigWinch = 1;
break;
errno = save_errno;
}
-#ifdef USE_SLANG_CURSES
-int mutt_intr_hook (void)
-{
- return (-1);
-}
-#endif /* USE_SLANG_CURSES */
-
void mutt_signal_initialize (void)
{
struct sigaction act;
sigaction (SIGCONT, &act, NULL);
sigaction (SIGTSTP, &act, NULL);
sigaction (SIGINT, &act, NULL);
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
sigaction (SIGWINCH, &act, NULL);
#endif
/* we don't want to mess with stopped children */
act.sa_flags |= SA_NOCLDSTOP;
sigaction (SIGCHLD, &act, NULL);
-
-#ifdef USE_SLANG_CURSES
- /* This bit of code is required because of the implementation of
- * SLcurses_wgetch(). If a signal is received (like SIGWINCH) when we
- * are in blocking mode, SLsys_getkey() will not return an error unless
- * a handler function is defined and it returns -1. This is needed so
- * that if the user resizes the screen while at a prompt, it will just
- * abort and go back to the main-menu.
- */
- SLang_getkey_intr_hook = mutt_intr_hook;
-#endif
}
/* signals which are important to block while doing critical ops */
sigaddset (&Sigset, SIGHUP);
sigaddset (&Sigset, SIGTSTP);
sigaddset (&Sigset, SIGINT);
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
sigaddset (&Sigset, SIGWINCH);
#endif
sigprocmask (SIG_BLOCK, &Sigset, 0);
{"red", COLOR_RED},
{"white", COLOR_WHITE},
{"yellow", COLOR_YELLOW},
-#if defined (USE_SLANG_CURSES) || defined (HAVE_USE_DEFAULT_COLORS)
+#if defined (HAVE_USE_DEFAULT_COLORS)
{"default", COLOR_DEFAULT},
#endif
{0, 0}
start_color ();
}
-#ifdef USE_SLANG_CURSES
-static char *get_color_name (char *dest, size_t destlen, int val)
-{
- static char *missing[3] = { "brown", "lightgray", "default" };
- int i;
-
- switch (val) {
- case COLOR_YELLOW:
- m_strcpy(dest, destlen, missing[0]);
- return dest;
-
- case COLOR_WHITE:
- m_strcpy(dest, destlen, missing[1]);
- return dest;
-
- case COLOR_DEFAULT:
- m_strcpy(dest, destlen, missing[2]);
- return dest;
- }
-
- for (i = 0; Colors[i].name; i++) {
- if (Colors[i].value == val) {
- m_strcpy(dest, destlen, Colors[i].name);
- return dest;
- }
- }
-
- /* Sigh. If we got this far, the color is of the form 'colorN'
- * Slang can handle this itself, so just return 'colorN'
- */
-
- snprintf (dest, destlen, "color%d", val);
- return dest;
-}
-#endif
-
int mutt_alloc_color (int fg, int bg)
{
COLOR_LIST *p = ColorList;
int i;
-#if defined (USE_SLANG_CURSES)
- char fgc[STRING], bgc[STRING];
-#endif
-
/* check to see if this color is already allocated to save space */
while (p) {
if (p->fg == fg && p->bg == bg) {
p->bg = bg;
p->fg = fg;
-#if defined (USE_SLANG_CURSES)
- if (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
- SLtt_set_color (i, NULL, get_color_name (fgc, sizeof (fgc), fg),
- get_color_name (bgc, sizeof (bgc), bg));
- else
-#elif defined (HAVE_USE_DEFAULT_COLORS)
+#if defined (HAVE_USE_DEFAULT_COLORS)
if (fg == COLOR_DEFAULT)
fg = -1;
if (bg == COLOR_DEFAULT)
flushinp ();
}
-#if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
+#if defined(HAVE_CURS_SET)
/* The argument can take 3 values:
* -1: restore the value of the last call
* 0: make the cursor invisible
move (menu->current - menu->top + menu->offset, COLS - 1);
mutt_refresh ();
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
if (SigWinch) {
mutt_flushinp ();
mutt_resize_screen ();
#include <lib-lib/lib-lib.h>
#include "mutt.h"
-#ifdef USE_SLANG_CURSES
-
-#ifndef unix /* this symbol is not defined by the hp-ux compiler (sigh) */
-#define unix
-#endif /* unix */
-
-#include "slcurses.h"
-
-#define KEY_DC SL_KEY_DELETE
-#define KEY_IC SL_KEY_IC
-
-/*
- * ncurses and SLang seem to send different characters when the Enter key is
- * pressed, so define some macros to properly detect the Enter key.
- */
-#define M_ENTER_C '\r'
-#define M_ENTER_S "\r"
-
-#else
-
-#ifdef HAVE_NCURSESW_NCURSES_H
+#if defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h>
-#else
-#ifdef HAVE_NCURSES_NCURSES_H
+#elif defined(HAVE_NCURSES_NCURSES_H)
#include <ncurses/ncurses.h>
-#else
-#ifdef HAVE_NCURSES_H
+#elif defined(HAVE_NCURSES_H)
#include <ncurses.h>
#else
#include <curses.h>
#endif
-#endif
-#endif
-
-#define M_ENTER_C '\n'
-#define M_ENTER_S "\n"
-
-#endif /* USE_SLANG_CURSES */
/* AIX defines ``lines'' in <term.h>, but it's used as a var name in
* various places in Mutt
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
#define BEEP() do { if (mod_core.beep) beep(); } while (0)
-#if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
+#if !defined(HAVE_CURS_SET)
#define curs_set(x)
#endif
-#if !defined(USE_SLANG_CURSES) && defined(HAVE_BKGDSET)
+#if defined(HAVE_BKGDSET)
#define BKGDSET(x) bkgdset (ColorDefs[x] | ' ')
#else
#define BKGDSET(x)
#endif
-#if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
+#if defined(HAVE_CURS_SET)
void mutt_curs_set (int);
#else
#define mutt_curs_set(x)
mutt_curs_set (1);
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
if (SigWinch) {
mutt_resize_screen ();
menu->redraw = REDRAW_FULL;
#include <lib-lib/lib-lib.h>
-#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+#if defined(HAVE_RESIZETERM)
#include <termios.h>
#ifdef HAVE_SYS_IOCTL_H
int fd;
struct winsize w;
-#ifdef HAVE_RESIZETERM
- int SLtt_Screen_Rows, SLtt_Screen_Cols;
-#endif
+ int rows, cols;
- SLtt_Screen_Rows = -1;
- SLtt_Screen_Cols = -1;
+ rows = -1;
+ cols = -1;
if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
- SLtt_Screen_Rows = w.ws_row;
- SLtt_Screen_Cols = w.ws_col;
+ rows = w.ws_row;
+ cols = w.ws_col;
}
close (fd);
}
- if (SLtt_Screen_Rows <= 0) {
+ if (rows <= 0) {
if ((cp = getenv ("LINES")) != NULL) {
- SLtt_Screen_Rows = atoi (cp);
+ rows = atoi (cp);
}
else
- SLtt_Screen_Rows = 24;
+ rows = 24;
}
- if (SLtt_Screen_Cols <= 0) {
+ if (cols <= 0) {
if ((cp = getenv ("COLUMNS")) != NULL)
- SLtt_Screen_Cols = atoi (cp);
+ cols = atoi (cp);
else
- SLtt_Screen_Cols = 80;
+ cols = 80;
}
-#ifdef USE_SLANG_CURSES
- delwin (stdscr);
- SLsmg_reset_smg ();
- SLsmg_init_smg ();
- stdscr = newwin (0, 0, 0, 0);
- keypad (stdscr, TRUE);
-#else
- resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols);
-#endif
+ resizeterm (rows, cols);
}
-#endif /* defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) */
+#endif /* defined(HAVE_RESIZETERM) */
#ifdef NCURSES_VERSION
printf (" ncurses %s\n", NCURSES_VERSION);
-#elif defined(USE_SLANG_CURSES)
- printf (" slang %d\n", SLANG_VERSION);
#endif
#ifdef _LIBICONV_VERSION
{
km_init (); /* must come before mutt_init */
-#ifdef USE_SLANG_CURSES
- SLtt_Ignore_Beep = 1; /* don't do that #*$@^! annoying visual beep! */
- SLsmg_Display_Eight_Bit = 128; /* characters above this are printable */
- SLtt_set_color (0, NULL, "default", "default");
-#else
/* should come before initscr() so that ncurses 4.2 doesn't try to install
its own SIGWINCH handler */
mutt_signal_initialize ();
-#endif
if (initscr () == NULL) {
puts _("Error initializing terminal.");
static short InHelp = 0;
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
static struct resize {
int line;
int SearchCompiled;
/* display the line */
format_line (lineInfo, n, buf, flags, &a, cnt, &ch, &vch, &col, &special);
- /* avoid a bug in ncurses... */
-#ifndef USE_SLANG_CURSES
- if (col == 0) {
- SETCOLOR (MT_COLOR_NORMAL);
- addch (' ');
- }
-#endif
-
/* end the last color pattern (needed by S-Lang) */
if (special || (col != COLS && (flags & (M_SHOWCOLOR | M_SEARCH))))
resolve_color (*lineInfo, n, vch, flags, 0, &a);
bkgdset (def_color | ' ');
#endif
}
-
- /* ncurses always wraps lines when you get to the right side of the
- * screen, but S-Lang seems to only wrap if the next character is *not*
- * a newline (grr!).
- */
-#ifndef USE_SLANG_CURSES
- if (col < COLS)
-#endif
- addch ('\n');
+ addch ('\n');
/*
* reset the color back to normal. This *must* come after the
SETCOLOR (MT_COLOR_NORMAL);
}
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
if (Resize != NULL) {
if ((SearchCompiled = Resize->SearchCompiled)) {
REGCOMP
mutt_query_exit ();
continue;
}
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+#if defined (HAVE_RESIZETERM)
else if (SigWinch) {
mutt_resize_screen ();