1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-01 02:05:33 +00:00
Commit Graph

227 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
45d1750d03 Bug 914: Don't let UTF-8 I/O affect internal representations.
Use it for the actual I/O only.  Previously, defining CONFIG_UTF8 and
enabling UTF-8 used to force many strings to the UTF-8 charset
regardless of the terminal charset option.  Now, those strings always
follow the terminal charset.  This fixes bug 914 which was caused
because _() returned strings in the terminal charset and functions
then assumed they were in UTF-8.  This reduction in the effects of
UTF-8 I/O may also simplify future testing.
2007-05-20 15:31:02 +03:00
Witold Filipczyk
026e56d539 Used add_shell_quoted_to_string instead of enclosing the text with '"'.
The code works both with copiousoutput and without it.

[ Part 1/2 of commit c25c41bd18 on the
  witekfl branch.  I'm leaving out the part that depends on commit
  469481b272, which is not yet safe to
  apply.  --KON ]
2007-03-12 19:22:41 +02:00
Witold Filipczyk
b3fa9a7019 MIME: When there is no % in the handler string (no %s in the mailcap entry)
the handler reads data from stdin. I think it only works with copiousoutput.

[ Part 1/2 of commit 4a7b9415e1 on the
  witekfl branch, fixes bug 916.  I'm leaving out delayed_goto_uri()
  for now because I don't understand its purpose.  --KON ]
2007-03-12 19:19:57 +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
Laurent MONIN
e4256e0e6a Refresh status bar when key prefix is eaten. It fixes bug 930. 2007-03-05 22:15:50 +01:00
Witold Filipczyk
2bf5372a29 stpcpy was not used in this file. 2007-02-25 11:02:28 +02:00
Kalle Olavi Niemitalo
a565365a8d do_type_query: Make known_types[] const. 2007-02-04 15:32:35 +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
bddafe5f7e Document how timer callbacks erase timer IDs; add some assertions.
Tangential to bug 868.
2006-12-02 18:35:03 +02:00
Jonas Fonseca
58c83a9f48 Never show empty filename in the what-to-do dialog
This fixes the last comment of bug 396.
2006-11-06 04:55:26 +01:00
Witold Filipczyk
f4e66f1fc6 ECMAScript: added writeonly property window.status 2006-10-24 20:41:25 +02:00
Laurent MONIN
3e5b4b7adf Fix whitespace goof reported by Miciah on IRC, introduced in
947c1730a6.
2006-10-13 15:08:52 +02:00
Laurent MONIN
947c1730a6 Fix crash due to untested null pointer occuring when doing
HTTP_PROXY=8080:proxy.ucv.cl elinks http://wwww.google.cl. Thanks to
Karel Zak.
2006-10-11 14:44:39 +02:00
Laurent MONIN
0b58b99d30 Use @current_tab for current tab. 2006-09-28 23:58:26 +02: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
Witold Filipczyk
2a6125e3d0 Merge with utf8. src/document/plain/renderer.c replaced by utf8 version 2006-07-21 13:12:06 +02:00
Witold Filipczyk
ff136e5116 Bugfix for bug 770 (Download resuming simply restarts the download)
using magic ;)

Now in resume mode connection is always interrupted
and resumed. Even when all file is downloaded from beginning
conection will be resumed from old end of file. Feel free to fix it.
2006-07-16 14:46:46 +02:00
Jonas Fonseca
0c2ce62459 When prompting a program for copiousoutput don't show the block checkbox
Since (I hope) it has no effect. Instead, inform the user that the output will
be displayed in the current tab.
2006-06-06 01:32:03 +02:00
Witold Filipczyk
4dc4ea47f2 copiousoutput: cleanup after copiousoutput handling. Temporary files should
be deleted
2006-05-09 09:36:16 +02:00
Witold Filipczyk
6ead4e9c65 Copiousoutput final stage. I doubt that /dev/fd/%d is portable. It works
at least under Linux. I didn't test network part of external handlers.
Files in tmpdir must be delete somehow. Maybe make a list of files
to unlink and delete them while quitting ELinks.
2006-05-04 21:19:30 +02:00
Witold Filipczyk
a2c12d7653 int_min instead of int_max. Valgrind said: invalid read
copiousoutput III. It works only for local files, but you must remove
| /usr/bin/less
yourself and allow reading special files, and set default mime type
as text/plain for convenience.
2006-05-04 20:44:27 +02:00
Witold Filipczyk
f6115e65ec Copiousoutput part II. To be continued ... 2006-05-04 18:02:45 +02:00
Pavol Babincak
8b9d06c977 Convert link titles to correct codepage before displaying it on screen.
Don't replace UTF-8 bytes with '*'. Probably there is need to do better
check what will be displayed.

Also get_current_link_title is no longer pretty and trivial. (o:
2006-03-13 01:54:34 +01:00
witekfl
e50581faf3 Menu bar moved at the end of windows queue. bfu_technology activated at the
right place.
2006-03-04 11:42:57 +01:00
witekfl
3f01c3d2fe Display optionally tabs bar at top like other browser do.
TODO: input_line_layouter, ACT_MAIN_TAB_MENU
2006-03-04 10:24:37 +01:00
Kalle Olavi Niemitalo
a1f26c1f25 Merge with http://elinks.cz/elinks.git 2006-02-12 17:54:22 +02:00
Miciah Dashiel Butler Masters
daad05c055 Don't check is_in_progress_state before calling cancel_download
With commit 637f1e82e6 ('NET: Merge
change_connection into cancel_download'), cancel_download returns
immediately if the connection is not in a result state, so save some
code by not checking is_in_progress_state before calling cancel_download.
2006-02-12 15:41:21 +00:00
Kalle Olavi Niemitalo
0066214b47 Merge with http://elinks.cz/elinks.git 2006-02-10 09:15:12 +02:00
Jonas Fonseca
03299d6c2e Add documents displayed via "What to do" dialog to globhist
First the patch makes sure doc_loading_callback is always called from
tp_display even if the download is in result state. This is often the
case for local files that the user decides to display via the WTD dialog.

Furthermore, improve the adding to globhist part of doc_loading_callback,
so that it works also for downloads in result state where the
download->conn member is NULL. In addition to grabbing the URI from the
connection try also the cache entry if it is set.

Fixes: bug 355 (Documents displayed via WTD aren't added to globhist)
2006-02-07 02:25:27 +01:00
Kalle Olavi Niemitalo
b1f8756c59 Merge with http://elinks.cz/elinks.git 2006-02-05 17:48:43 +02:00
Jonas Fonseca
3324496b57 NET: Replace change_connection with cancel_download and move_download
This simplifies unqueuing of downloads and makes it more obvious that
the 'change' being performed is to migrate or replace an old download
handle with a new one.
2006-02-03 10:44:28 +01:00
witekfl
ea2d7a3325 Simplification. 2006-01-25 20:19:55 +01:00
witekfl
1d65718ace When there is no frame with given name do goto_uri_frame using static
buffer.
2006-01-18 20:16:17 +01:00
Miciah Dashiel Butler Masters
1f68492d57 Move delayed_goto_uri_frame to src/session/task.c
Until the last change in src/ecmascript/see/window.c, the two copies
of delayed_goto_uri_frame in src/ecmascript/spidermonkey/window.c and
in src/ecmascript/see/window.c were identical. That change applies to
both versions, so move the newer one to src/session/task.c and eliminate
the duplication. Also move struct delayed_open to src/session/session.h.
2006-01-16 19:18:33 +00:00
Jonas Fonseca
2748d043f9 Autogenerate .vimrc files and put the master in config/vimrc
This changes the init target to be idempotent: most importantly it will now
never overwrite a Makefile if it exists. Additionally 'make init' will
generate the .vimrc files. Yay, no more stupid 'added fairies' commits! ;)
2006-01-15 18:38:58 +01:00
Kalle Olavi Niemitalo
2cfd0a9bb4 Merge with http://elinks.cz/elinks.git 2006-01-09 02:20:27 +02:00
Jonas Fonseca
bc55cd55cb Add the basic support for rendering RSS documents
It is very simple for now, so it only displays headlines and doesn't
support a whole lot of RSS flavours.
2006-01-08 03:44:23 +01:00
Jonas Fonseca
d0be89a16c When requested to open local files with a handler use the file in place
Everything else is really stupid, i.e. to go through the callback-infested
download code. A parly fix of bug 238 (caching of local files).
2006-01-07 20:19:37 +01:00
Kalle Olavi Niemitalo
93714a3e35 Merge with http://elinks.cz/elinks.git 2006-01-06 02:13:11 +02:00
Laurent MONIN
c39a30ca49 Autocreate directories needed to download a file. 2006-01-04 21:52:15 +01:00
Kalle Olavi Niemitalo
eb99af7a33 Merge with http://elinks.cz/elinks.git 2006-01-02 01:27:11 +02:00
Jonas Fonseca
021af4e87c Although aware ELinks doesn't need another sgml/doctype here is DocBook
It was created a long time ago so (I think) it deserves to survive. It
maps .sgml files to applicatino/docbook+xml and uses the highlighter.
2006-01-01 23:22:10 +01:00
Kalle Olavi Niemitalo
345ba7afcd Merge with http://elinks.cz/elinks.git 2006-01-01 19:05:44 +02:00
Kalle Olavi Niemitalo
4c2831677a Here is a framework that detects cases where a PO file assigns
the same accelerator key to multiple buttons in a dialog box or
to multiple items in a menu.  ELinks already has some support for
this but it requires the translator to run ELinks and manually
scan through all menus and dialogs.  The attached changes make it
possible to quickly detect and list any conflicts, including ones
that can only occur on operating systems or configurations that
the translator is not currently using.

The changes have no immediate effect on the elinks executable or
the MO files.  PO files become larger, however.

The scheme works like this:

- Like before, accelerator keys in translatable strings are
  tagged with the tilde (~) character.

- Whenever a C source file defines an accelerator key, it must
  assign one or more named "contexts" to it.  The translations in
  the PO files inherit these contexts.  If multiple strings use
  the same accelerator (case insensitive) in the same context,
  that's a conflict and can be detected automatically.

- The contexts are defined with "gettext_accelerator_context"
  comments in source files.  These comments delimit regions where
  all translatable strings containing tildes are given the same
  contexts.  There must be one special comment at the top of the
  region; it lists the contexts assigned to that region.  The
  region automatically ends at the end of the function (found
  with regexp /^\}/), but it can also be closed explicitly with
  another special comment.  The comments are formatted like this:

    /* [gettext_accelerator_context(foo, bar, baz)]
         begins a region that uses the contexts "foo", "bar", and "baz".
         The comma is the delimiter; whitespace is optional.

       [gettext_accelerator_context()]
         ends the region.  */

  The scripts don't currently check whether this syntax occurs
  inside or outside comments.

- The names of contexts consist of C identifiers delimited with
  periods.  I typically used the name of a function that sets
  up a dialog, or the name of an array where the items of a
  menu are listed.  There is a special feature for static
  functions: if the name begins with a period, then the period
  will be replaced with the name of the source file and a colon.

- If a menu is programmatically generated from multiple parts,
  of which some are never used together, so that it is safe to
  use the same accelerators in them, then it is necessary to
  define multiple contexts for the same menu.  link_menu() in
  src/viewer/text/link.c is the most complex example of this.

- During make update-po:

  - A Perl script (po/gather-accelerator-contexts.pl) reads
    po/elinks.pot, scans the source files listed in it for
    "gettext_accelerator_context" comments, and rewrites
    po/elinks.pot with "accelerator_context" comments that
    indicate the contexts of each msgid: the union of all
    contexts of all of its uses in the source files.  It also
    removes any "gettext_accelerator_context" comments that
    xgettext --add-comments has copied to elinks.pot.

  - If po/gather-accelerator-contexts.pl does not find any
    contexts for some use of an msgid that seems to contain an
    accelerator (because it contains a tilde), it warns.  If the
    tilde refers to e.g. "~/.elinks" and does not actually mark
    an accelerator, the warning can be silenced by specifying the
    special context "IGNORE", which the script otherwise ignores.

  - msgmerge copies the "accelerator_context" comments from
    po/elinks.pot to po/*.po.  Translators do not edit those
    comments.

- During make check-po:

  - Another Perl script (po/check-accelerator-contexts.pl) reads
    po/*.po and keeps track of which accelerators have been bound
    in each context.  It warns about any conflicts it finds.
    This script does not access the C source files; thus it does
    not matter if the line numbers in "#:" lines are out of date.

This implementation is not perfect and I am not proposing to
add it to the main source tree at this time.  Specifically:

- It introduces compile-time dependencies on Perl and Locale::PO.
  There should be a configure-time or compile-time check so that
  the new features are skipped if the prerequisites are missing.

- When the scripts include msgstr strings in warnings, they
  should transcode them from the charset of the PO file to the
  one specified by the user's locale.

- It is not adequately documented (well, except perhaps here).

- po/check-accelerator-contexts.pl reports the same conflict
  multiple times if it occurs in multiple contexts.

- The warning messages should include line numbers, so that users
  of Emacs could conveniently edit the conflicting part of the PO
  file.  This is not feasible with the current version of
  Locale::PO.

- Locale::PO does not understand #~ lines and spews warnings
  about them.  There is an ugly hack to hide these warnings.

- Jonas Fonseca suggested the script could propose accelerators
  that are still available.  This has not been implemented.

There are three files attached:

- po/gather-accelerator-contexts.pl: Augments elinks.pot with
  context information.

- po/check-accelerator-contexts.pl: Checks conflicts.

- accelerator-contexts.diff: Makes po/Makefile run the scripts,
  and adds special comments to source files.
2006-01-01 18:55:18 +02:00
Jonas Fonseca
9a0bf83756 Add basic stuff for XBEL parsing/highlighting using the DOM engine 2005-12-30 22:19:32 +01:00
Jonas Fonseca
c0ece18042 Start showing RSS files in the plain view so it gets highlighted 2005-12-30 21:55:53 +01:00
Miciah Dashiel Butler Masters
470da90699 Put documentation (doc/events.txt) and reality back into alignment
by changing goto_url_with_hook not to call goto_uri if get_hooked_uri
returns NULL, which it does if a hook returns "", which several hooks do.
2005-12-30 03:04:04 +00:00
Jonas Fonseca
4104f5d2f0 Only consider application/rss+xml internal with CONFIG_DOM 2005-12-20 03:13:08 +01:00
Jonas Fonseca
56d634b946 Add basic support for RSS parsing for application/rss+xml content types
This means the RSS source will be highlighted, but by default the HTML
renderer will be used for the default rendering.
2005-12-20 03:08:13 +01:00
Miciah Dashiel Butler Masters
fdacffd113 Change the pre-format event so that hooks are given the cache entry
instead of the URI, content, and length of the entry. Change the hooks
to use add_fragment. This should fix the memory leakage when multiple
hooks change the same document, closing bug 703.
2005-12-17 06:32:08 +00:00
Laurent MONIN
4a930507e4 process_file_requests(): move @more, @ftl and @doc_view variables to
inner scope.
2005-12-13 16:57:17 +01:00
Laurent MONIN
1c7b27c99f abort_files_load(): make @more and @ftl variables local to the loop. 2005-12-13 16:53:56 +01:00
Jonas Fonseca
be3223b38e Don't try MIME handlers for application/x-bittorrent
It is an internally supported protocol, so it should be all internal. The
other thing was just causing headacks. Thanks to Neuromancer for suggesting
not to endeavor into another configuration nightmare. And thanks to arcatan
for requesting this for the n-th time. ;)
2005-12-13 16:32:53 +01:00
Witold Filipczyk
6afdbf608f Fix frame-related crash on www.sts.pl (bug 723)
Earlier doc_view was freed in src/document/renderer.c line 455
and used later by load_additional_file.
2005-11-24 16:42:03 +01:00
Jonas Fonseca
acf2ec806b Remove empty lines in start of header files
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00
Jonas Fonseca
a0fb29bcd5 Fix typo introduced in cdd3f5d9739d... 2005-11-15 10:20:48 +01:00
Miciah Dashiel Butler Masters
cdd3f5d973 Modify the logic for confirm_submit to flow better. 2005-11-14 09:02:08 +00:00
Miciah Dashiel Butler Masters
683d73d89d Tighten scope for cached in ses_goto. 2005-11-14 08:53:03 +00:00
Miciah Dashiel Butler Masters
97ad0e0f21 Use ses_load in post_yes. 2005-11-14 08:51:09 +00:00
Miciah Dashiel Butler Masters
93d6d959a5 Factor new function ses_load out of ses_goto. 2005-11-14 08:46:17 +00:00
Miciah Dashiel Butler Masters
16c0afb56c Drop a superfluous assignment to confirm_submit in ses_goto. 2005-11-14 08:27:55 +00:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Jonas Fonseca
c88afeb1c2 path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
Jonas Fonseca
e39a4342d6 Include $(top_srcdir)/Makefile.lib instead of $(path_to_top)/Makefile.lib
A step towards out of tree builds ...
2005-10-20 01:11:47 +02:00
Jonas Fonseca
c6f6717a79 Re-commit the rest of the changes which was reverted in the recent 'funny merge' 2005-10-17 23:20:53 +02:00
Miciah Dashiel Butler Masters
65321923b9 In setup_session, copy the viewstate for the new session from the base session. 2005-10-08 14:00:57 +00:00
Jonas Fonseca
1efab31581 Simplify building of and linking with directories
Ditch the building of an archive (.a) in favour of linking all objects in a
directory into a lib.o file. This makes it easy to link in subdirectories
and more importantly keeps the build logic in the local subdirectories.

Note: after updating you will have to rm **/*.a if you do not make clean
before updating.
2005-09-27 21:38:58 +02:00
Jonas Fonseca
b30064c0d0 Rename targets: *-l -> *-local 2005-09-27 21:11:28 +02:00
Petr Baudis
204bbe5d2c Fix starting a build from a subdirectory ELBuild-wise
Now all the submakefiles contain informationa buot where in the directory
hierarchy they stay.
2005-09-16 02:07:36 +02:00
Petr Baudis
32fe41fae7 ELBuild: Use 'include' instead of '-include'
We _do_ want to error on when including .config and .lib failed.
2005-09-16 01:09:42 +02:00
Petr Baudis
fffc573769 Use all-l,install-l,clean-l targets in individual makefiles and let
Makefile.lib multiplex the real ones. That's so that the -recursive
ones always come first.
2005-09-16 00:52:54 +02:00
Petr Baudis
833770a5f7 Implicit recursiveness and clean rule
All objects defining $(OBJS) will get them and *.a deleted during
make clean.

The all, clean and install rules now implicitly imply their -recursive
counterparts - those will just do nothing in case of $(SUBDIRS) not
defined, so that's ok.
2005-09-15 23:28:56 +02:00
Petr Baudis
06ea255a22 Convert part of the build to the new build system
The root makefile is converted as well as some leaf Makefiles. This
also brings in the required infrastructure and adjusts configure.in
appropriately.

I converted only makefiles containing no configurable stuff, since
that'll require more consideration yet.
2005-09-15 21:03:56 +02:00
Jonas Fonseca
7462f22635 Remove now obsolete .cvsignore files. 2005-09-15 18:33:20 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00