1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00
Commit Graph

392 Commits

Author SHA1 Message Date
Marco Migliori
a75e8dd35c new -remote command: reload() 2017-05-16 20:55:33 +02:00
Witold Filipczyk
257422f28c Reorganisation of code to make C++ happy 2016-04-20 22:21:31 +02:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
2e7a7a5ca3 Compilation fixes for C++ 2016-04-20 20:57:09 +02:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
1b06539694 Explicit cast to (const char *) in strcasestr for C++ 2016-04-20 20:11:08 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
67673f5fe5 new -> new_ for C++ compatibility 2016-04-20 18:42:22 +02:00
Witold Filipczyk
2e721e051a template -> template_ for C++ compatibility 2016-04-20 18:05:00 +02:00
Witold Filipczyk
69986f1bd1 Multiplication instead of pow calls and minor style changes. 2016-01-31 12:38:18 +01:00
Martin Miller
28b7bd1ec2 Transfer changes for ascii link labeling 2016-01-31 10:23:08 +01:00
Witold Filipczyk
46767f6bf0 Introduced the document.browse.show_refresh_link option.
Whether to show Refresh: link line. Default 1.
2015-01-02 14:53:18 +01:00
Fabienne Ducroquet
3379fc988c Respect alphabetical order for the actions
I didn’t respect the right order when I added the functions to move up and down
by half a page a few years ago.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 16:38:57 +01:00
Fabienne Ducroquet
60a5fce0f0 Add a function to put the current line at the top of the screen
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 10:01:34 +01:00
Kalle Olavi Niemitalo
31242e8029 doxygen: Document tree parameter of prepare_mustsave_flags
Doxygen complained that not all parameters of prepare_mustsave_flags
were documented.
2012-11-18 20:17:40 +02:00
Kalle Olavi Niemitalo
cd0f6feec3 bug 764: Convert sentinel to struct option
unregister_options() requires as a sentinel an instance of struct
option where option.name is NULL.  However, the NULL_OPTION_INFO macro
used for these sentinels actually initializes a struct option_init
instead.  Make register_options() overwrite the NULL_OPTION_INFO with
a sentinel in the correct format.  This probably makes a difference
only on platforms where null pointers don't have all bits zero.
(cherry picked from elinks-0.12 commit 8ac10e00d4)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
9e11e30fe3 bug 764, LUA: option_types[OPT_INT].set needs long *
l_set_option() was passing the address of an int to
option_types[OPT_INT].set and option_types[OPT_BOOL].set.
That looks correct but is not: both function pointers
point to num_set(), which actually reads *(long *) str.
Change l_set_option() to pass the address of a long instead,
and add comments about this dependency.
(cherry picked from elinks-0.11 commit 8766e3829f)
(cherry picked from elinks-0.12 commit 0797f04921)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
237d30b936 bug 1084: Allow '+' and '*' in names in option manager
ELinks already allowed '+' and '*' in the names of options when
reading a configuration file.  The option manager however didn't
let the user add such options.  Allow the characters there too.

These characters are needed especially in the mime.type tree,
where '*' is used as a replacement for '.'.  For example:

set mime.type.audio.prs*sid = "sid"
set mime.type.application.atom+xml = "atom"

This commit changes one gettextised string.
(cherry picked from elinks-0.12 commit 064ff3921d)
2012-11-03 23:01:21 +02:00
Kalle Olavi Niemitalo
58d2fe8eeb config/options: More Doxygen markup
No changes in program logic or data layout.
(cherry picked from elinks-0.12 commit 972afa1c26)

Conflicts:
	src/config/options.c:
		0.13.GIT has a new function get_option_shadow, now
		doxygenized likewise.
2012-11-03 22:17:47 +02:00
Kalle Olavi Niemitalo
8b00e1ef70 bug 764: Initialize the right member of union option_value
INIT_OPTION used to initialize union option_value at compile time by
casting the default value to LIST_OF(struct option) *, which is the
type of the first member.  On sparc64 and other big-endian systems
where sizeof(int) < sizeof(struct list_head *), this tended to leave
option->value.number as zero, thus messing up OPT_INT and OPT_BOOL
at least.  OPT_LONG however tended to work right.

This would be easy to fix with C99 designated initializers,
but doc/hacking.txt says ELinks must be kept C89 compatible.
Another solution would be to make register_options() read the
value from option->value.tree (the first member), cast it back
to the right type, and write it to the appropriate member;
but that would still require somewhat dubious conversions
between integers, data pointers, and function pointers.

So here's a rather more invasive solution.  Add struct option_init,
which is somewhat similar to struct option but has non-overlapping
members for different types of values, to ensure nothing is lost
in compile-time conversions.  Move unsigned char *path from struct
option_info to struct option_init, and replace struct option_info
with a union that contains struct option_init and struct option.
Now, this union can be initialized with no portability problems,
and register_options() then moves the values from struct option_init
to their final places in struct option.

In my x86 ELinks build with plenty of options configured in, this
change bloated the text section by 340 bytes but compressed the data
section by 2784 bytes, presumably because union option_info is a
pointer smaller than struct option_info was.
(cherry picked from elinks-0.12 commit e5f6592ee2)

Conflicts:
	src/protocol/fsp/fsp.c: All options had been removed in 0.13.GIT.
	src/protocol/smb/smb2.c: Ditto.
2012-11-03 22:16:32 +02:00
Fabienne Ducroquet
83945b677c Add document.browse.scrolling.vertical_overlap
Add an option to specify the number of overlapping lines when scrolling
page by page (0 by default because this is ELinks' current behaviour).

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2010-09-14 20:42:32 +00:00
Fabienne Ducroquet
6211b8e725 Add half-page-down and half-page-up commands
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2010-09-14 20:42:32 +00:00
Witold Filipczyk
0ec2f8eaa8 Show IP of the document in the status bar.
config options:
ui.show_ip (0/1) default 0
status.showip-text - colors
2010-03-30 14:45:19 +02:00
Kalle Olavi Niemitalo
ef548e5728 Merge branch 'elinks-0.12'
Conflicts:
	src/session/download.c
	src/session/download.h
	src/viewer/text/view.c
2009-07-24 18:32:25 +03:00
Kalle Olavi Niemitalo
23fd2d58f4 Make struct action const
With GCC 4.3.1 on i686, this changes the sizes of sections as follows:

section            before       after   change
.text              682428      682492      +64
.rodata            212668      216352    +3684
.data               58092       54444    -3648
.debug_info       1482388     1482472      +84
.debug_abbrev      153714      153723       +9
.debug_line        272299      272319      +20
.debug_loc         540394      540372      -22
.debug_ranges      113784      113792       +8
Total             3917695     3917894     +199

The surprising .text change comes from src/config/dialogs.o.
Some of that is in get_keybinding_text(), where GCC changes the
order of basic blocks and apparently misses some optimizations.
2009-07-19 21:15:39 +03:00
Kalle Olavi Niemitalo
126d2d1be3 Remove enum {main,edit,menu}_action_offset
Remove enum main_action_offset, enum edit_action_offset, and enum
menu_action_offset.  It seems the original plan (in commit
174eabf1a448d3f084a318aab77805828f35c42e on 2005-05-16) was to include
the action flags in the action IDs, perhaps with something like:

	ACT_##map##_##action = ACT_##map##_OFFSET_##action | flags

However, this OR operation was never implemented; each ACT_*_*
constant had the same value as the corresponding ACT_*_OFFSET_*,
and the code that looked for flags in action IDs found only zeroes.
Then on 2005-06-10, a separate action.flags member was added, and
the flag checks were corrected to read that instead.  So, it seems
safe to say that the original plan has been discarded and the offset
enumerations won't be needed.
2009-07-19 02:32:41 +03:00
Miciah Dashiel Butler Masters
f1dee0d04f Drop special handling of ctrl-l
Drop special handling of ctrl-l in handle_interlink_event.

To make sure that the 'redraw' action works everywhere, first modify
menu_kbd_handler and mainmenu_kbd_handler to handle ACT_MENU_REDRAW; and
second, drop the ACTION_REQUIRE_VIEW_STATE flag from the 'redraw' action in
the 'main' keymap so that it works even if there is no document loaded.

Ctrl-l is already bound to 'redraw' in all keymaps by default, so the
current default behaviour is preserved.
2009-05-22 19:50:28 +00:00
Miciah Dashiel Butler Masters
3334efb32c Add support for ECMA-48 SGR italic
Add 'Italic' checkbox to Terminal options dialog box.

Enable italic text by default for rxvt-unicode (and also enable
frames, 88-colour mode, and underline).
2009-05-22 19:48:59 +00:00
Kalle Olavi Niemitalo
82e67f8ebc Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/intl/charsets.h
	src/viewer/text/search.c
2009-05-21 19:50:16 +03:00
Kalle Olavi Niemitalo
0c756fc3e8 TRE: Check for 32-bit wchar_t at configure time
This check used to be in src/elinks.h.  Move it to configure.in so
that (1) the result can be logged and (2) ELinks won't even link with
TRE if wchar_t prevents its use.

Also, rename HAVE_TRE_REGEX_H to CONFIG_TRE, to reflect that it is not
always defined if the header exists.
2009-05-21 17:22:12 +03:00
Witold Filipczyk
7751102ce7 Bug 1070: Support for fbterm.
fbterm uses different 256 color sequences than xterm.
color256_seqs are part of the driver info.
2009-04-26 18:12:00 +03:00
Kalle Olavi Niemitalo
6dfc25f5d2 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	NEWS
	src/config/options.c (session-specific options vs. TERM_* constants)
2009-04-26 17:16:00 +03:00
Kalle Olavi Niemitalo
a91a08f82b Named constants in terminal option defaults
When setting up default values for terminal options, use named
constants like TERM_VT100 or COLOR_MODE_16, rather than plain integers
like 1.  This is just to make the source code easier to read and
perhaps more resistant to future bugs.  The binary should not change.
2009-04-19 20:32:37 +03:00
Kalle Olavi Niemitalo
1bb71f3732 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/config/conf.c
	src/network/ssl/ssl.c
2009-03-12 08:46:02 +02:00
Kalle Olavi Niemitalo
5a43c55c9e Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line.  When the option manager displayed these
strings, it treated each "\n" as a hard newline.  On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones.  This could also cause the text to take up too much
vertical space and not fit in the window.

Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping.  At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.

In some options though, there is a list of possible values and their
meanings.  In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented.  The
option manager and BFU are not currently able to do that.  So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-08 15:18:10 +02:00
Kalle Olavi Niemitalo
a277c0ad3b Wrap option descriptions in --config-help, --long-help 2009-03-08 13:29:51 +02:00
Kalle Olavi Niemitalo
bd5d3a173f Add wrap_option_desc() in conf.c, still static
Move the description wrapping code from smart_config_output_fn()
to a separate function wrap_option_desc() so that --config-help
can soon use it too.
2009-03-08 13:29:51 +02:00
Kalle Olavi Niemitalo
d2854dca8d Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bookmarks/backend/default.c
	src/bookmarks/bookmarks.c
	src/session/session.c
	src/terminal/event.c
	src/viewer/text/search.c
2009-02-08 22:02:57 +02:00
Witold Filipczyk
c5a7f87c43 Bug 1060: Use libtre for regexp searches.
When the user tells ELinks to search for a regexp, ELinks 0.11.0
passes the regexp to regcomp() and the formatted document to
regexec(), both in the terminal charset.  This works OK for unibyte
ASCII-compatible charsets because the regexp metacharacters are all in
the ASCII range.  And ELinks 0.11.0 doesn't support multibyte or
ASCII-incompatible (e.g. EBCDIC) charsets in terminals, so it is no
big deal if regexp searches fail in such locales.

ELinks 0.12pre1 attempts to support UTF-8 as the terminal charset if
CONFIG_UTF8 is defined.  Then, struct search contains unicode_val_T c
rather than unsigned char c, and get_srch() and add_srch_chr()
together save UTF-32 values there if the terminal charset is UTF-8.
In plain-text searches, is_in_range_plain() compares those values
directly if the search is case sensitive, or folds them to lower case
if the search is case insensitive: with towlower() if the terminal
charset is UTF-8, or with tolower() otherwise.  In regexp searches
however, get_search_region_from_search_nodes() still truncates all
values to 8 bits in order to generate the string that
search_for_pattern() then passes to regexec().  In UTF-8 locales,
regexec() expects this string to be in UTF-8 and can't make sense of
the truncated characters.  There is also a possible conflict in
regcomp() if the locale is UTF-8 but the terminal charset is not, or
vice versa.

Rejected ways of fixing the charset mismatches:

* When the terminal charset is UTF-8, recode the formatted document
  from UTF-32 to UTF-8 for regexp searching.  This would work if the
  terminal and the locale both use UTF-8, or if both use unibyte
  ASCII-compatible charsets, but not if only one of them uses UTF-8.

* Convert both the regexp and the formatted document to the charset of
  the locale, as that is what regcomp() and regexec() expect.  ELinks
  would have to somehow keep track of which bytes in the converted
  string correspond to which characters in the document; not entirely
  trivial because convert_string() can replace a single unconvertible
  character with a string of ASCII characters.  If ELinks were
  eventually changed to use iconv() for unrecognized charsets, such
  tracking would become even harder.

* Temporarily switch to a locale that uses the charset of the
  terminal.  Unfortunately, it seems there is no portable way to
  construct a name for such a locale.  It is also possible that no
  suitable locale is available; especially on Windows, whose C library
  defines MB_LEN_MAX as 2 and thus cannot support UTF-8 locales.

Instead, this commit makes ELinks do the regexp matching with regwcomp
and regwexec from the TRE library.  This way, ELinks can losslessly
recode both the pattern and the document to Unicode and rely on the
regexp code in TRE decoding them properly, regardless of locale.

There are some possible problems though:

1. ELinks stores strings as UTF-32 in arrays of unicode_val_T, but TRE
   uses wchar_t instead.  If wchar_t is UTF-16, as it is on Microsoft
   Windows, then TRE will misdecode the strings.  It wouldn't be too
   hard to make ELinks convert to UTF-16 in this case, but (a) TRE
   doesn't currently support UTF-16 either, and it seems possible that
   wchar_t-independent UTF-32 interfaces will be added to TRE; and (b)
   there seems to be little interest on using ELinks on Windows anyway.

2. The Citrus Project apparently wanted BSD to use a locale-dependent
   wchar_t: e.g. UTF-32 in some locales and an ISO 2022 derivative in
   others.  Regexp searches in ELinks now do not support the latter.

[ Adapted to elinks-0.12 from bug 1060 attachment 506.
  Commit message by me.  --KON ]
2009-02-08 18:26:22 +02:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bfu/dialog.c
	src/bfu/hotkey.c
	src/bfu/inpfield.c
	src/dialogs/options.c
	src/document/renderer.c
	src/intl/gettext/libintl.h
	src/protocol/http/codes.c
	src/session/task.c
	src/terminal/event.c
	src/terminal/terminal.h
	src/viewer/text/form.c
	src/viewer/text/link.c

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
b6dfdf86a6 Bug 885: Proper charset support in xterm window title
When ELinks runs in an X11 terminal emulator (e.g. xterm), or in GNU
Screen, it tries to update the title of the window to match the title
of the current document.  To do this, ELinks sends an "OSC 1 ; Pt BEL"
sequence to the terminal.  Unfortunately, xterm expects the Pt string
to be in the ISO-8859-1 charset, making it impossible to display e.g.
Cyrillic characters.  In xterm patch #210 (2006-03-12) however, there
is a menu item and a resource that can make xterm take the Pt string
in UTF-8 instead, allowing characters from all around the world.
The downside is that ELinks apparently cannot ask xterm whether the
setting is on or off; so add a terminal._template_.latin1_title option
to ELinks and let the user edit that instead.

Complete list of changes:

- Add the terminal._template_.latin1_title option.  But do not add
  that to the terminal options window because it's already rather
  crowded there.

- In set_window_title(), take a new codepage argument.  Use it to
  decode the title into Unicode characters, and remove only actual
  control characters.  For example, CP437 has graphical characters in
  the 0x80...0x9F range, so don't remove those, even though ISO-8859-1
  has control characters in the same range.  Likewise, don't
  misinterpret single bytes of UTF-8 characters as control characters.

- In set_window_title(), do not truncate the title to the width of the
  window.  The font is likely to be different and proportional anyway.
  But do truncate before 1024 bytes, an xterm limit.

- In struct itrm, add a title_codepage member to remember which
  charset the master said it was going to use in the terminal window
  title.  Initialize title_codepage in handle_trm(), update it in
  dispatch_special() if the master sends the new request
  TERM_FN_TITLE_CODEPAGE, and use it in most set_window_title() calls;
  but not in the one that sets $TERM as the title, because that string
  was not received from the master and should consist of ASCII
  characters only.

- In set_terminal_title(), convert the caller-provided title to
  ISO-8859-1 or UTF-8 if appropriate, and report the codepage to the
  slave with the new TERM_FN_TITLE_CODEPAGE request.  The conversion
  can run out of memory, so return a success/error flag, rather than
  void.  In display_window_title(), check this result and don't update
  caches on error.

- Add a NEWS entry for all of this.
2009-01-01 16:17:03 +00:00
Kalle Olavi Niemitalo
5c2fada371 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/session/download.c
2008-11-01 22:39:17 +02:00
M. Vefa Bicakci
20a7a6c460 Patch 3: Further fixes including strcasestr and convert_to_lowercase 2008-11-01 22:32:43 +02:00
Kalle Olavi Niemitalo
1ba7d5a260 Bug 1004: Use c_toupper in a few more places.
src/config/kbdbind.c (parse_keystroke): If the user types "Ctrl-i",
it should mean "Ctrl-I" rather than "Ctrl-İ", because the Ctrl-
combinations are only well known for ASCII characters.  This does not
matter in practice though, because src/terminal/kbd.c converts 0x09
to (KBD_MOD_NONE, KBD_TAB) and not to (KBD_MOD_CTRL, 'I').

src/osdep/beos/beos.c (get_system_env): Changing the locale does not
affect the TERM environment variable, I think, so it should not affect
the interpretation either.
2008-11-01 22:32:43 +02:00
M. Vefa Bicakci
96b3093519 Patch 2: Modifications to the remaining parts of ELinks
[Forward ported to 0.12 from bug 1004 attachment 499.  --KON]
2008-11-01 22:20:25 +02:00
Kalle Olavi Niemitalo
d26c8cf836 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	NEWS (bug 939 was listed twice)
	doc/man/man5/elinks.conf.5 (regenerated)
	po/fr.po (only in comments and such)
	po/pl.po (only in comments and such)
	src/protocol/fsp/fsp.c (the relevant changes were already here)
2008-04-28 22:08:19 +03:00
Kalle Olavi Niemitalo
4b408dd860 Display subtrees last in --config-help.
elinks --config-help used to sort options like this:

  document.history
  document.history.global
    document.history.global.enable
    document.history.global.max_items
    document.history.global.display_type
    document.history.keep_unhistory

Now it'll instead be:

  document.history
    document.history.keep_unhistory
  document.history.global
    document.history.global.enable
    document.history.global.max_items
    document.history.global.display_type

i.e. all the options listed under a subheading are children of the
tree named by it.  This makes elinks.conf(5) look saner.
2008-03-23 19:20:12 +02:00
Kalle Olavi Niemitalo
3c861fd530 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	configure.in
	src/protocol/http/http.c
2008-02-24 22:49:47 +02:00
Kalle Olavi Niemitalo
76d803bbb9 config: Count backslashed newlines in str_rd.
If a newline has a backslash in front of it, then str_rd replaces it
with a space.  However, the newline was in the original config file,
so the line number must still be incremented.
2008-02-10 14:30:26 +02:00
Kalle Olavi Niemitalo
5499926cc0 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	po/pl.po
	src/config/conf.c
	src/terminal/kbd.c
2008-02-03 22:30:46 +02:00
Kalle Olavi Niemitalo
054852ae23 config: Fix the "include" command.
Previously, it only pretended to rewrite the configuration file, so it
set or cleared OPT_MUST_SAVE but never changed or output any options.
Now, it actually sets the options when ELinks is loading the
configuration file.  Also, when ELinks is rewriting the configuration
file, it now compares the values in the included file to the current
values of the options, and sets or clears OPT_MUST_SAVE accordingly.
2008-02-03 20:28:27 +02:00
Kalle Olavi Niemitalo
92b430f3dc config: Access OPT_MUST_SAVE in the real option, not alias.
So, if elinks.conf contains a "set" command for an alias and ELinks
updates that, it now knows it doesn't have to append another "set"
command for the underlying option.
2008-02-03 20:27:56 +02:00
Kalle Olavi Niemitalo
c47d3798a3 config: Negate the value in redir_rd too.
So if ELinks is rewriting a configuration file that contains a "set"
command for a negated alias, then it properly writes the value of the
alias, rather than the value of the underlying option.
2008-02-03 20:27:54 +02:00
Kalle Olavi Niemitalo
2dbe6ec34f config: In redir_set, negate the incoming value.
That is, let the setter function of the underlying option store the
negated value.  Previously, redir_set used to tweak the value of the
option after it has already called the underlying setter.
2008-02-03 20:27:52 +02:00
Kalle Olavi Niemitalo
7cdbc908d8 config: Rewrite "set" to "unset" and vice versa.
Also, replace OPT_WATERMARK with OPT_MUST_SAVE, which has the opposite
meaning.

Watermarking of aliases does not yet work correctly in this version.
Neither does the "include" command.
2008-02-03 20:27:48 +02:00
Kalle Olavi Niemitalo
6bd961246a config: Reset OPT_TOUCHED flags after a successful save.
Previously, they were reset by smart_config_string(), which was not
called if the value of the option was saved by rewriting an existing
command in elinks.conf.  Also, it is better to reset the flags only
after the file operations have actually succeeded.
2008-02-03 20:27:45 +02:00
Kalle Olavi Niemitalo
ab8ef9698f config: In saving style 2, save deleted options too.
Previously, ELinks set the OPT_WATERMARK flag in all deleted options
when config.saving_style was 2, thus mostly preventing them from being
saved.  This had the unfortunate consequence that if you started with
no elinks.conf, set config.saving_style = 2, deleted some built-in
option (e.g. a URL rewriting rule), saved the settings, and restarted
ELinks, then the built-in option would reappear.
2008-02-03 20:27:41 +02:00
Kalle Olavi Niemitalo
6d55be2043 config: Let mirroring be implicit unless values are rewritten. 2008-02-03 20:27:37 +02:00
Kalle Olavi Niemitalo
72de752f84 config: Rearrange mirror-or-not checks. 2008-02-03 20:27:08 +02:00
Kalle Olavi Niemitalo
661dda04c9 config: Let "unset" delete built-in options too. 2008-02-03 20:26:50 +02:00
Kalle Olavi Niemitalo
2c9d966c99 config: Unsetting a missing option is not an error. 2008-02-03 14:43:43 +02:00
Kalle Olavi Niemitalo
3f077d109a config: Remember the address and length of the option name.
A later commit will take advantage of this.
2008-02-03 14:43:40 +02:00
Kalle Olavi Niemitalo
e7bd23ff37 config: More cleverly skip unrecognized or malformed commands. 2008-02-03 14:43:38 +02:00
Kalle Olavi Niemitalo
e06416d248 config: Skip values of unrecognized options.
To avoid parsing them as commands.
2008-02-03 14:43:36 +02:00
Kalle Olavi Niemitalo
edad2ddccd config: Report errors before the line number is lost. 2008-02-03 14:43:34 +02:00
Kalle Olavi Niemitalo
1f0c361ead config, Bug 503: Keep track of what has been mirrored. 2008-02-03 14:43:31 +02:00
Kalle Olavi Niemitalo
4c64afec26 config: Add struct conf_parsing_state. 2008-02-03 14:43:29 +02:00
Kalle Olavi Niemitalo
63e82e68e4 config: Reduce the interface offered to exmode. 2008-02-03 14:43:26 +02:00
Kalle Olavi Niemitalo
912cff7975 config: Use memacpy instead of stracpy.
So there is no need to substitute a '\0' into the string, and undo
that afterwards.
2008-02-03 14:43:23 +02:00
Kalle Olavi Niemitalo
753aa3054b config: Fix two bogus end-of-file checks. 2008-02-03 14:43:21 +02:00
Kalle Olavi Niemitalo
09829a0b52 config: Don't mem_free(NULL). 2008-02-03 14:43:18 +02:00
Kalle Olavi Niemitalo
c92cd01e0b config: Plug some memory leaks in error handling. 2008-02-03 14:43:16 +02:00
Kalle Olavi Niemitalo
4960c65f20 config: Explain why get_opt_rec() does not follow OPT_ALIAS. 2008-02-03 14:43:13 +02:00
Kalle Olavi Niemitalo
1d16e90dca config: Swap the "unknown command" and "parse error" messages.
They should be in the same order as in enum parse_error.
2008-02-03 14:43:11 +02:00
Kalle Olavi Niemitalo
b216a21b79 config: Each backslash escapes only one character.
Previously, if you did this in elinks.conf:
set document.dump.header = "\'\\"
then str_rd() failed to detect the end of the string.
2008-02-03 14:43:09 +02:00
Kalle Olavi Niemitalo
9becd108a8 config: more const in elinks.conf parsing 2008-02-03 14:43:06 +02:00
Miciah Dashiel Butler Masters
e6276bf7ac Missing change from last commit 2008-01-27 18:50:29 +00:00
Miciah Dashiel Butler Masters
ad5b6e0a87 Add KEYMAP_INVALID value for enum keymap_id and properly check for it
get_keymap_id returns -1 when it can't find the keymap.  Because the return
type of get_keymap_id is enum keymap_id and enum keymap_id did not have any
explicit values defined, it could be unsigned, which meant that when
get_keymap_id returned -1, it was really returning a huge positive number.
This meant that when callers checker whether the return value was negative,
they were essentially performing no check at all, so they might give
get_keymap_id an invalid keymap name, get back an invalid keymap_id, and
use that invalid keymap_id.

This commit adds KEYMAP_INVALID = -1 to enum keymap_id and makes all
functions that deal with the enumeration use that symbol.
2008-01-27 18:50:29 +00:00
Miciah Dashiel Butler Masters
cf4c38bb39 Missing change from last commit 2008-01-27 18:48:27 +00:00
Miciah Dashiel Butler Masters
4dedef8f66 Add KEYMAP_INVALID value for enum keymap_id and properly check for it
get_keymap_id returns -1 when it can't find the keymap.  Because the return
type of get_keymap_id is enum keymap_id and enum keymap_id did not have any
explicit values defined, it could be unsigned, which meant that when
get_keymap_id returned -1, it was really returning a huge positive number.
This meant that when callers checker whether the return value was negative,
they were essentially performing no check at all, so they might give
get_keymap_id an invalid keymap name, get back an invalid keymap_id, and
use that invalid keymap_id.

This commit adds KEYMAP_INVALID = -1 to enum keymap_id and makes all
functions that deal with the enumeration use that symbol.
2008-01-27 18:47:20 +00:00
Miciah Dashiel Butler Masters
3a0286e447 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:19:23 +00:00
Miciah Dashiel Butler Masters
643a34e6af Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:09:18 +00:00
Kalle Olavi Niemitalo
f19c948ca7 Bug 824: Disable combining characters unless --enable-combining.
Label this as an experimental feature because it has so many bugs
and it is not clear how they can be fixed.
2008-01-19 20:58:22 +02:00
Witold Filipczyk
560818568a combined: Added the option "combine" to terminal and screen driver options.
Note that, combining characters work only on XTerm with UTF-8 locale setings.
2008-01-19 20:49:47 +02:00
Kalle Olavi Niemitalo
d79edd5954 Bug 867: More comments. 2008-01-19 18:12:18 +02:00
Miciah Dashiel Butler Masters
ae88223664 Make sure to always check or assert the result of get_opt_rec
Most callers already check.  Add checks to commit_option_values, checkout_option_values, and get_content_type_default.
2007-12-21 22:49:38 +00:00
Kalle Olavi Niemitalo
9fff802c08 Merge branch 'elinks-0.12' into elinks-0.13 2007-12-16 10:12:08 +02:00
Witold Filipczyk
61eb46e94d New action: move-cursor-line-start.
It moves cursor to the start of the line.
(cherry picked from commit 5ee1d3b2b3)
(cherry picked from commit 3a87ec55fc)
2007-12-16 01:13:39 +02:00
Witold Filipczyk
52dfc92523 viewer: Added new four actions requested by Ligesh.
move-link-down-line moves the cursor down to the line with a link.
move-link-up-line moves the cursor up to the line with a link.
move-link-prev-line moves to the previous link horizontally.
move-link-next-line moves to the next link horizontally.
(cherry picked from commit 8259a56e99)
(cherry picked from commit 2eb3532416)
2007-12-16 01:12:31 +02:00
Kalle Olavi Niemitalo
f8863183b8 option_types: Add comments to be found by grep.
I was looking for code that handles OPT_COMMAND, so I grepped for it,
but did not immediately find this array.  Next time, I will.
2007-12-16 01:09:18 +02:00
Witold Filipczyk
3a87ec55fc New action: move-cursor-line-start.
It moves cursor to the start of the line.
(cherry picked from commit 5ee1d3b2b3)
2007-11-25 22:28:18 +02:00
Witold Filipczyk
2eb3532416 viewer: Added new four actions requested by Ligesh.
move-link-down-line moves the cursor down to the line with a link.
move-link-up-line moves the cursor up to the line with a link.
move-link-prev-line moves to the previous link horizontally.
move-link-next-line moves to the next link horizontally.
(cherry picked from commit 8259a56e99)
2007-11-25 22:28:15 +02:00
Witold Filipczyk
871b4b09dd bug 978: Python's webbrowser.open_new_tab(URL) works since now. 2007-11-22 19:11:03 +01:00
Witold Filipczyk
588e914470 bug 978: Python's webbrowser.open_new_tab(URL) works since now. 2007-11-22 19:10:45 +01:00
Laurent MONIN
f8cdb5d472 More anonymous structures were named. 2007-10-12 16:24:41 +02:00
Laurent MONIN
6564aec93f Add a new entry Link Info under Link main menu.
It also adds a Link info entry in the link contextual menu.
No key is associated for now, action was named ACT_MAIN_LINK_INFO.
2007-10-10 10:47:24 +02:00
Laurent MONIN
6c6e75a71d Trim trailing whitespaces. 2007-09-14 15:14:34 +02:00
Miciah Dashiel Butler Masters
69cf0d06e2 get_opt_: only look for a domain-specific option if no session-specific one found 2007-08-31 09:48:58 +00:00
Miciah Dashiel Butler Masters
9f6ce80da3 Add config/domain.[ch] (doh!) 2007-08-30 23:36:20 +00:00
Miciah Dashiel Butler Masters
5191ed82a1 Move domain-specific options code to config/domain
For great modularity!
2007-08-30 22:03:14 +00:00
Miciah Dashiel Butler Masters
7f247ec293 Factor get_domain_option_from_session out of get_opt_. 2007-08-30 21:50:55 +00:00
Miciah Dashiel Butler Masters
860d3cc5ef Suppress a warning about an uninitialised value in parse_set_common 2007-08-30 21:42:57 +00:00
Miciah Dashiel Butler Masters
06adbbc524 Add domain-specific options saving and look-up
Note that this is the infrastructure, but all relevant get_opt_* calls must be changed to pass the session so that the domain-specific options are looked up.

Add @want_domain parameter to parse_set_common and read in the domain-name if the flag is set.

Add parse_set_domain wrapper for parse_set_common.

Add "set_domain" configuration directive with the following syntax: set_domain domain option = value

Modify create_config_string and smart_config_output_fn to spit out domain-specific option trees.

Add @smart_config_output_fn_domain global variable to facilitate this.

Define structure domain_tree and define list @domain_trees.

Add routine get_domain_tree to find or, if necessary, create the shadow tree for the given domain name.

Add routine get_domain_option search for an option in all domain shadow-trees and return the option in the best matching domain tree.

Modify get_opt_ to use get_domain_option to check for domain-specific options.

Add clean-up routine done_domain_trees, called on exit, to free any domain trees.
2007-08-30 21:04:31 +00:00
Miciah Dashiel Butler Masters
5ada24f3ef update_cache_document_options: take @ses and pass it to get_opt calls
change_hook_active_link: pass update_cache_document_options @ses.

Now when changing the global settings, it will not simply copy the new values for the global settings to the document-options cache, but also check session-specific settings.  This doesn't really matter yet, since the options in question can't be set on a per-session basis, but is in preparation for future changes.
2007-08-30 19:19:57 +00:00
Miciah Dashiel Butler Masters
f5e6ed4dd7 Drop @options parameter from create_config_string and write_config_file
Hard-code it to config_options.
2007-08-29 13:43:15 +00:00
Miciah Dashiel Butler Masters
d1e16e1066 get_option_shadow: Set OPT_TOUCHED on the new option 2007-08-29 13:34:43 +00:00
Miciah Dashiel Butler Masters
7f042a49d7 Factor parse_set_common out of parse_set 2007-08-29 13:30:40 +00:00
Miciah Dashiel Butler Masters
8a8be53452 parse_set and parse_unset: restore stomped char before returning
The parsing in parse_set and parse_unset saves, overwrites with a NUL, and restores a character in the string that is being parsed.  If there is a malloc failure between overwriting and restoring, the restore is not done.  This commit changes that behaviour to restore before returning.
2007-08-28 17:47:59 +00:00
Miciah Dashiel Butler Masters
fa12b10e26 Introduce session- (tab-)specific options
Introduce session-specific options for those options that have toggle-... actions.
2007-08-28 17:29:41 +00:00
Miciah Dashiel Butler Masters
fd22173b29 Introduce option tree shadowing
Introduce get_option_shadow.  This routine takes an option, the tree under which that option resides, and another tree.  It returns a corresponding option with parallel ancestry in the second tree, creating that option and ancestry if it does not already exist.

Add enum copy_option_flags.

Add the CO_NO_LISTBOX_ITEM flag, which is used to suppress listbox creation for shadowed trees.

Add the CO_SHALLOW flag, which is used to suppress the duplication of unwanted children for shadowed trees.

Add a flags parameter to copy_option and tree_dup (and out of necessity, struct option_type_info and str_dup).
2007-08-28 17:25:24 +00:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Kalle Olavi Niemitalo
c78f59e78c Doxygen: rename struct key to reduce spurious links
Rename struct key to struct named_key, use more const, change the num
member from int to term_event_key_T, and put a KBD_UNDEF at the end of
the array (even though it won't be read).
2007-07-27 19:19:16 +03:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +03:00
Kalle Olavi Niemitalo
d3d2bb26c5 New macro LIST_OF for better Doxygen support. 2007-07-26 22:45:51 +03:00
Kalle Olavi Niemitalo
2433150058 Delete unused keybinding_dialog_list. 2007-07-26 22:45:19 +03:00
Kalle Olavi Niemitalo
f0bc5c5abe Win32: Put .elinks in Application Data if %HOME% is undefined. 2007-07-18 00:27:08 +03:00
Jonas Fonseca
7fe7b42093 Remove unused add handler in the option_type_info struct 2007-05-28 12:42:11 +02:00
Kalle Olavi Niemitalo
b904464e76 Document terminal._template_.m11_hack more and add comments. 2007-05-20 16:10:27 +03:00
Kalle Olavi Niemitalo
443db69980 Don't mark undisplayed names of modules for translation.
Exclude unneeded header files.  This partially reverts commit
90980a944e, with permission.
2007-03-23 00:51:56 +02:00
Kalle Olavi Niemitalo
2558688456 Merge with http://elinks.cz/elinks.git 2007-03-22 07:48:49 +02:00
Laurent MONIN
90980a944e Mark all module names for translation and include needed header files. 2007-03-21 11:01:06 +01:00
Kalle Olavi Niemitalo
8c66e34323 intl: Fork get_cp_config_name off get_cp_mime_name.
This may help with bug 914 but I'm not testing that yet.
2007-03-20 20:41:05 +02:00
Kalle Olavi Niemitalo
44adb76799 Use add_string_to_string where applicable. 2007-03-18 20:29:08 +02:00
Kalle Olavi Niemitalo
7645a836fc Cast the NULL argument of straconcat to unsigned char *.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to straconcat.  This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
2007-03-11 12:59:11 +02:00
Kalle Olavi Niemitalo
a05f7203cd Cast variadic arguments of getml to void *.
getml reads the args with va_arg(ap, void *), and the NULL macro in
particular may have the wrong type.
2007-03-11 12:41:17 +02:00
Kalle Olavi Niemitalo
801d520ddd Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-03-11 12:22:02 +02:00
Kalle Olavi Niemitalo
2b7788614f Type-check button arguments of msg_box.
Don't cast function pointers; calling functions via pointers of
incorrect types is not guaranteed to work.  Instead, define the
functions with the desired types, and make them cast the incoming
parameters.  Or define wrapper functions if the return types don't
match.

really_exit_prog wasn't being used outside src/dialogs/menu.c,
and I had to change its parameter type, so it's now static.
2007-03-10 23:50:56 +02:00
Miciah Dashiel Butler Masters
e95c5c7d30 Document that document.cache.revalidation_interval is in seconds
At Kalle Olavi Niemitalo's suggestion.
2007-03-02 23:46:18 +00:00
Miciah Dashiel Butler Masters
6d4496b521 document.cache.revalidation_interval: document that a value of -1 disables automatic revalidation 2007-02-28 20:22:40 +00:00
Kalle Olavi Niemitalo
315f4e0342 doc: cut-clipboard does not merely delete text from clipboard. 2007-02-11 23:34:44 +02:00
Kalle Olavi Niemitalo
d7e4b57146 Make instances of struct listbox_ops const. 2007-02-04 15:17:49 +02:00
Kalle Olavi Niemitalo
a5e321cb2b Make instances of struct hierbox_browser_button const.
And explicitly disable the "Save" buttons in anonymous mode,
even though they are currently inside #if 0.
2007-02-04 13:54:07 +02:00
Kalle Olavi Niemitalo
7185e926e6 "Do not show anymore" resets ui.success_msgbox, instead of toggling it.
Normally, the success msgbox is shown only if the ui.success_msgbox
option is set as 1, and clicking "Do not show anymore" would then
toggle the option to 0, and no more such msgboxes would appear.
However, if there already are two success msgboxes being displayed
(most likely in different terminals), then clicking "Do not show
anymore" in the first of them would reset the option to 0, but doing
the same in the second of them would toggle the option back to 1.

Rename toggle_success_msgbox to disable_success_msgbox, and make it
always reset the option to 0, regardless of the previous value.
2007-01-28 16:14:10 +02:00
Kalle Olavi Niemitalo
3756bec9e0 get_opt_rec, get_opt_rec_real: Let name point to const. 2007-01-28 14:01:24 +02:00
Kalle Olavi Niemitalo
33b2db7053 toggle_success_msgbox: Call option_changed; was a TODO.
This change assumes that option change hooks allow a NULL session.
The only one that did not was change_hook_css, which I fixed in
commit 4adcae682f.
2007-01-28 14:00:14 +02:00
Kalle Olavi Niemitalo
0484f68b69 get_color_string: Return a pointer to const. 2007-01-28 00:52:21 +02:00
Kalle Olavi Niemitalo
6a1d21441e Document the parameters of change_hook_T. 2007-01-27 20:34:18 +02:00
Kalle Olavi Niemitalo
2e5488ba3d option_changed: Merge the 2nd and 3rd parameter.
All callers were passing the same value for both.
2007-01-27 19:52:49 +02:00
Kalle Olavi Niemitalo
7bfd9703d9 toggle_option: Remove an obsolete comment.
option_changed already calls the change hooks so there's no need to
have a TODO comment about calling them.
2007-01-27 19:49:19 +02:00
Kalle Olavi Niemitalo
22f7468013 Make arrays of option change hooks const. 2007-01-27 19:00:47 +02:00
Kalle Olavi Niemitalo
06f058f5e8 Bug 752: Rearrange the docstrings of color-mode options.
In the elinks.conf.5 manual page, the text below the list of modes was
getting included in the last list item.  This appears to be a design
error in AsciiDoc.  Work around it by moving the text above the list.
2007-01-06 23:40:18 +02:00
Kalle Olavi Niemitalo
b586bd99bc Bug 871, 752: Lock down enum color_mode and change option help to match.
The numbering of document.dump.color_mode and terminal._template_.colors
is now the same regardless of compile-time options, unlike in previous
versions.  Therefore this version of ELinks may interpret a configuration
file differently from previous versions even if compiled with the same
options.  This is unfortunate but the alternatives (keeping the numbering
dependent on configuration options; defining separate options that use
the new numbering; starting the numbers from 10 or so and recognizing the
previous ones only for compatibility) seem even worse.
2006-12-25 11:51:24 +02:00
Kalle Olavi Niemitalo
4b156678c6 terminal._template_.utf_8_io: Move the comment above the option and extend it.
This lets xgettext attach the comment to a more appropriate msgid.
2006-12-23 02:49:44 +02:00
Kalle Olavi Niemitalo
9efc661384 Bug 827: Force UTF-8 I/O on if the UTF-8 charset is selected. 2006-12-09 21:13:13 +02:00
Kalle Olavi Niemitalo
47a2fc19e1 Bug 887: New function secsave_strerror.
Extracted from write_config_dialog.
2006-12-09 18:14:28 +02:00
Jonas Fonseca
685cb8d1a2 Bug 831: Make it possible to quote args given to -remote
This fixes the problem with URLs that contain commas and are passed to
ELinks using: -remote openURL(URL). Fixes bug 831.
2006-12-04 21:54:39 +01:00
Kalle Olavi Niemitalo
bddafe5f7e Document how timer callbacks erase timer IDs; add some assertions.
Tangential to bug 868.
2006-12-02 18:35:03 +02:00
Miciah Dashiel Butler Masters
a90588debc Fix a grammatical error in the description for document.uri_passing
Suggested by Quiznos on IRC.
2006-11-15 20:08:02 +00:00
Kalle Olavi Niemitalo
24dbdbe899 Bug 830: Check -remote command names more strictly.
doc/remote.txt says there must be a nonempty sequence of ASCII
alphabetic characters before the opening parenthesis.  Check that
they really are ASCII characters and that the sequence is nonempty.
Thus, elinks -remote '(foo)' now treats the string as an address,
rather than as a command.
2006-11-14 00:22:06 +02:00
Jonas Fonseca
89fd7efa3a Fix misparsing of -remote URLs containing parenthesis (bug 830)
Be more strict about the format accepted by the ELinks specific extension
to the -remote URL syntax. That is, commands must begin with a nonempty
sequence of ASCII alphabetic characters followed by optional whitespace and
an opening parenthesis. Also, document the syntax.

Fixes bug 830.
2006-11-12 18:49:05 +01:00
Laurent MONIN
cceb7b9be8 Add a missing parenthesis in option description. 2006-11-06 16:59:13 +01:00
Petr Baudis
6390c327aa Turn terminal transparency off by default
The problem is that if you run elinks in xterm with the default white
background, it will be totally unreadable if transparency is turned
on. We should default to usability in all common environments, eyecandy
lovers can do the extra setup for their specific one.

It also makes the description note that elinks still assumes the
background is black.
2006-11-05 16:28:53 +01:00
Kalle Olavi Niemitalo
eb2c64633c Revert c9ce4260e5 (broke URLs as -remote arguments)
Revert commit c9ce4260e5,
which made "elinks -remote http://elinks.cz/" fail with an error
"ELinks: Cannot parse option -remote: Remote method not supported"
even though doc/remote.txt says it should open the URL in a new tab.
2006-11-04 05:06:50 +02:00
Miciah Dashiel Butler Masters
a001cfda17 Rewrite the description for document.cache.revalidation_interval again 2006-11-04 02:23:22 +00:00
Petr Baudis
cd197170d7 Fix wrongly placed -1 ;-) 2006-11-03 20:19:43 +01:00
Petr Baudis
c7863324e0 Support for document.cache.interval (set it to -1) and rename it
...to document.cache.revalidation_interval. Moreover, -1 is the default
now.
2006-11-03 19:56:55 +01:00
Witold Filipczyk
c9ce4260e5 elinks -remote 'ping' says:
ELinks: No remote session to connect to.
but should say:
ELinks: No running ELinks found.
2006-10-26 21:01:01 +02:00
Witold Filipczyk
4bf3e2693b "If-Modified-Since" second approach.
Added document.cache.interval option. When time elapsed since previous access
to the document is less than interval then the document is taken from
the cache. Otherwise the request with filled "If-Modified-Since" and/or
"If-None-Match" header field is sent. By default interval is set to 10 minutes.
This requires the correct time to be set on your machine.
2006-10-26 11:53:30 +02:00
Miciah Dashiel Butler Masters
8957379319 tree_dup: call object_nolock on the cloned children of the new tree 2006-10-20 23:10:33 +00:00
Kalle Olavi Niemitalo
359b131c6b Bug 810: Add a few comments pointing to the bug. 2006-09-24 00:21:03 +03:00
Kalle Olavi Niemitalo
92cb452a9e Rename CONFIG_UTF_8 to CONFIG_UTF8.
The configure script no longer recognizes "CONFIG_UTF_8=yes" lines
in custom features.conf files.  They will have to be changed to
"CONFIG_UTF8=yes".  This incompatibility was deemed acceptable
because no released version of ELinks supports CONFIG_UTF_8.

The --enable-utf-8 option was not renamed.
2006-09-17 16:12:47 +03:00
Kalle Olavi Niemitalo
b42f0ba153 Bug 772: Recognize ESC [ Z as Shift-Tab, and bind it like Alt-Tab by default. 2006-09-17 12:38:23 +03:00
Kalle Olavi Niemitalo
86c9cb01ba add_accesskey_to_string: Add the Alt modifier to the string, too.
The link information window will now display e.g. "(Alt-f)" rather
than just "(f)", becoming easier to understand.
2006-09-03 00:12:34 +03:00
Kalle Olavi Niemitalo
2d19e5ed94 Change elinks.or.cz to elinks.cz and one i.e. to e.g. in option docs.
Some other instances of elinks.or.cz still remain in the tree.
2006-09-02 17:50:53 +03:00
Witold Filipczyk
9d4b68a26b Adjusted max values for true color dumps. 2006-08-26 20:03:30 +02:00
Witold Filipczyk
7a84967453 Unification. Removed trailing '\n' from last line. 2006-08-26 19:34:14 +02:00
Kalle Olavi Niemitalo
245c8cb020 parse_keystroke: Fold the case of Ctrl-letter after read_key(), not before. 2006-08-20 13:07:57 +03:00
Kalle Olavi Niemitalo
35290f92e9 parse_keystroke: Fold the case of Ctrl-letter only if the letter is ASCII. 2006-08-20 13:05:47 +03:00
Kalle Olavi Niemitalo
e054a15960 Change the description of the connection.try_ipv4 option.
Use "e.g." rather than "i.e." because the syntax cannot be deduced
from the preceding text.
2006-08-20 13:04:00 +03:00
Witold Filipczyk
4f78b0dda1 True color mode. See new konsole.
TODO: dump
2006-08-19 23:39:40 +02:00
Kalle Olavi Niemitalo
dd22535b8c config: Change an error message in the keybinding manager.
The message appears when the user has selected e.g. "Main mapping"
rather than an action inside it.  Because the main mapping is a keymap,
ELinks must not tell the user to select a keymap.
2006-08-19 10:40:30 +03:00
Jonas Fonseca
abc66da432 really_add_keybinding: Indent msg_text arguments 2006-08-13 14:50:45 +02:00
Kalle Olavi Niemitalo
1837a55444 really_add_keybinding: Remove unneeded initialization.
According to Jonas Fonseca, if init_string(&canonical) fails, then it
anyway sets canonical.source = NULL and makes done_string(&canonical)
safe, even if canonical was previously uninitialized.
2006-08-13 15:45:13 +03:00
Kalle Olavi Niemitalo
c79ecefe73 doc: Document parse_keystroke(). 2006-08-13 15:41:34 +03:00
Kalle Olavi Niemitalo
de93359a5a Support Ctrl-Alt-letter key combinations.
Actions can now be bound to e.g. Ctrl-Alt-A.  The keybinding code also
supports other combinations of modifiers, like Shift-Ctrl-Up, but the
escape sequence decoder doesn't yet.

Don't let Ctrl-Alt-letter combinations open menus.
2006-08-13 15:32:06 +03:00
Kalle Olavi Niemitalo
2eeb14f95c Key name strings are const in read_key() and in its (indirect) callers. 2006-08-13 14:44:01 +03:00
Kalle Olavi Niemitalo
aba0bc77a8 parse_keystroke: Never write back to the input string.
This fixes a bug: in the previous version, l_bind_key() modified the
buffer whose address lua_tostring() returned, even though that is not
allowed according to Lua documentation <http://www.lua.org/pil/24.2.2.html>.

The change affects the user interface: previously, if the user typed
"ctrl+cokebottle" in the "Add keybinding" dialog box, ELinks would
change the text in the widget to "Ctrl-cokebottle" before complaining
that the keystroke is invalid.  Now, it leaves the widget unchanged.

This commit does not yet add const to parameters of parse_keystroke()
and related functions.
2006-08-13 14:24:28 +03:00
Kalle Olavi Niemitalo
93ef5e02f5 really_add_keybinding: Display the canonical name of the keystroke.
Before really_add_keybinding() is called, check_keystroke() calls
parse_keystroke(), which converts the modifier prefix to canonical
form: for example, "alt+f9" becomes "Alt-f9".  This commit makes
really_add_keybinding() normally ignore that string and generate a
brand new one, e.g. "Alt-F9" (note the upper-case F), for its
"Keystroke already used" warning.  Likewise, " " turns to "Space".

After this commit, it should be possible to change parse_keystroke()
to never write back into its input string.

If really_add_keybinding() cannot generate the string for some reason
(out of memory?), then it will use whatever parse_keystroke() has left
in the buffer.  The alternatives would be to omit the keystroke name
from the warning or to reject the keybinding entirely; it isn't clear
what the best solution is here, but the one I implemented is closest
to the previous behaviour.
2006-08-13 14:04:17 +03:00
Miciah Dashiel Butler Masters
75e292efe6 Mark the prompt for a key when adding a binding as translatable
Thanks to Kalle Olavi Niemitalo for noticing this omission.
2006-08-13 07:34:25 +00:00
Kalle Olavi Niemitalo
8be5ed9749 add_accesskey_to_string: Use KBD_MOD_NONE, rather than plain 0. 2006-08-12 14:53:28 +03:00
Kalle Olavi Niemitalo
f3b04b8645 terminal: Introduce term_event_key_T. 2006-08-12 14:48:08 +03:00
Kalle Olavi Niemitalo
e101f5f537 UTF-8 doc: Clarify FIXME in add_accesskey_to_string. 2006-08-12 12:37:37 +03:00
Kalle Olavi Niemitalo
c4acdb6d3c config: Do not treat all negative key values like KBD_UNDEF. 2006-08-06 20:02:40 +00:00
Miciah Dashiel Butler Masters
5b260ad69d Add a missing blank line between check_option_name and push_add_button 2006-08-05 19:46:09 +00:00
Miciah Dashiel Butler Masters
b5b285b5df Mark check_keystroke and new_hop_from static. 2006-08-05 19:42:20 +00:00
Laurent MONIN
1136aefb71 Trim trailing whitespaces. 2006-07-27 09:51:10 +02:00
Laurent MONIN
1ec1dc43be LONG/INT: fix compilation under AMD64, reported by Miciah. 2006-07-05 15:11:53 +02:00
Witold Filipczyk
7934d3c7d6 STRING_DIR_SEP in config/* 2006-07-02 08:53:33 +02:00
Laurent MONIN
9412cc77f0 INT/LONG: introduce long_wr() and long_set() and use them instead of
num_wr() and num_set() for options of type OPT_LONG.
2006-06-27 14:13:04 +02:00
Laurent MONIN
2454ceffb7 config/options: use struct option big_number field instead of number
field where OPT_LONG is used.
2006-06-26 17:49:59 +02:00
Laurent MONIN
cde9db3d70 config/options: add_opt() casts value to long then store in int... see
bug 764. Micro step to a fix.
2006-06-26 17:37:10 +02:00
Laurent MONIN
6637272c5a config/options: arrange add_opt() to use only mem_free() instead of
delete_option() in case of allocation failure.
2006-06-26 17:33:00 +02:00
Laurent MONIN
c3cf5b9474 config/options: add_opt() @min and @max parameters have to be long to
match struct option.
2006-06-26 17:28:45 +02:00
Miciah Dashiel Butler Masters
7a9b9f8171 Fix focus issue with the 'Toggle display' button in the keybindings manager
Don't call clear_dialog, which sets the focus to the listbox.  Neither the
button widget nor the listbox widget has a clear callback, and the only
other thing that clear_dialog does is focus the first widget and redraw, so
call redraw_dialog instead.

Thanks to Kalle Olavi Niemitalo for noticing the issue.
2006-06-24 08:22:24 +00:00
Miciah Dashiel Butler Masters
29ffe71bc1 New actions: kill-word-back, move-backward-word, move-forward-word 2006-06-23 04:07:52 +00:00
Laurent MONIN
5acb5e6663 Trim trailing whitespaces. 2006-05-31 19:34:49 +02:00
Miciah Dashiel Butler Masters
5dcac5c32d Modularise config/kbdbind 2006-05-20 15:01:22 +00:00
Miciah Dashiel Butler Masters
8adb976885 Add backspace-prefix to the main map, to backspace the last entered
digit of the prefix.
2006-04-14 21:55:42 +00:00
Witold Filipczyk
d50de58af9 s/dump-color_mode/dump-color-mode/ . Made name consistent with other options 2006-04-04 15:27:14 +02:00
Kalle Olavi Niemitalo
7927fb737a 1. If neither CONFIG_88_COLORS nor CONFIG_256_COLORS is defined,
then dump_to_file_256 is defined in dump.c but not used.
   If configure --enable-debug was used, then gcc warns about
   the unused function, and the warning stops the build.

2. The description of document.dump.color_mode ends with a
   newline, provoking a runtime warning from check_description
   in src/config/options.c.

3. options.inc has preprocessor directives inside macro arguments.
   That is not portable C.  xgettext (GNU gettext-tools) 0.14.3 is
   not smart enough to figure out the possible combinations, and
   copies an incorrect string to elinks.pot.
2006-03-13 19:06:02 +01:00