From 8f46de65d698bc00eec61a84462d0efabded261f Mon Sep 17 00:00:00 2001 From: Witold Filipczyk <witekfl@poczta.onet.pl> Date: Tue, 19 Feb 2008 22:07:15 +0100 Subject: [PATCH 01/13] bug 1000: Do not discard the query part of URI. (cherry picked from commit 3a4c053bd558faf77b69770d48f57124f585ea4b) --- src/protocol/uri.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/protocol/uri.c b/src/protocol/uri.c index 5130ec2ae..04cd519e7 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -175,6 +175,7 @@ encode_file_uri_string(struct string *string, unsigned char *uristring) int filenamelen = check_whether_file_exists(uristring); encode_uri_string(string, uristring, filenamelen, 0); + if (filenamelen > 0) add_to_string(string, uristring + filenamelen); } From 2f79826bc08593d15b9b9f846589daace9d8dab4 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo <kon@iki.fi> Date: Sun, 2 Mar 2008 16:36:29 +0200 Subject: [PATCH 02/13] NEWS: mention bug 1000 (cherry picked from commit 74c22adc69e753daaa04fb98c2100a8bc38e62e7) --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index f1dcf10a5..9a314ca7d 100644 --- a/NEWS +++ b/NEWS @@ -330,6 +330,8 @@ To be released as 0.11.4. * minor bug 928: properly display no-break spaces in a UTF-8 document if the terminal uses some other charset * minor bug 987: English spelling and grammar corrections +* minor bug 1000: preserve any query and fragment when converting a + file name to a file:// URL * minor: don't assume sizeof(int)==4 in bittorrent * trivial bug 947: document.html.wrap_nbsp also affects text in tables * trivial bug 997: fix unlikely stack corruption in active FTP From 0c9c7770b7fd6c7d7bec1b1592e568fafa7d0005 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca <fonseca@diku.dk> Date: Tue, 4 Mar 2008 11:12:35 +0100 Subject: [PATCH 03/13] Add rebuilding manpages as a release task --- doc/release.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/release.txt b/doc/release.txt index 28e1882b2..8eb76f5a5 100644 --- a/doc/release.txt +++ b/doc/release.txt @@ -13,7 +13,9 @@ When releasing a new version Don't add the release date yet though; it will be added after the release, from the date in the mailing list archives. - Change VERSION in the top of configure.in to hold the new version number. - - Commit only this change. + - Update the manpages so the will have the new release number by first + building the source, followed by making the `update-man' target in doc/. + - Commit these changes. - Create a signed tag having the version ("ELinks X.X.X") as the subject and using the changelog create above as the body. Use something like: From 4d06362a503bd722f9bded6f7ae8afac14060c9b Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo <kon@iki.fi> Date: Tue, 4 Mar 2008 09:09:49 +0200 Subject: [PATCH 04/13] Mark option changed in "File extensions -> Add". Previously, file extensions added or modified via the menu did not get saved to elinks.conf when config.saving_style was 3 (the default). This patch makes the file-extension dialog box call option_changed, which then sets OPT_TOUCHED, so that the option appears modified in the option manager and will be saved. Reported and patch reviewed by Witold Filipczyk. --- src/mime/dialogs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mime/dialogs.c b/src/mime/dialogs.c index f140c9d47..f55310f32 100644 --- a/src/mime/dialogs.c +++ b/src/mime/dialogs.c @@ -91,6 +91,7 @@ add_mime_extension(void *data) really_del_ext(ext->ext_orig); /* ..or rename ;) */ safe_strncpy(get_opt_str(name.source), ext->ct, MAX_STR_LEN); + option_changed(NULL, get_opt_rec(config_options, name.source)); done_string(&name); } From df6801202c60de85eec6c64e2d440e0fb9e2a9c5 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo <kon@iki.fi> Date: Wed, 5 Mar 2008 09:48:33 +0200 Subject: [PATCH 05/13] elinks(1): Rewrite using AsciiDoc 8.2.2 and DocBook XSL 1.72.0 It basically rewrites the nroff formatting of the elinks(1) manpage and is mainly checked in separately to make it easier to review later updates. This corresponds to commit b09b1499864f1904813be091e2e4ad80fed765e1 in ELinks 0.11.4rc0.GIT. --- doc/man/man1/elinks.1.in | 671 ++++++++++++++++++++++----------------- 1 file changed, 378 insertions(+), 293 deletions(-) diff --git a/doc/man/man1/elinks.1.in b/doc/man/man1/elinks.1.in index 158326c4e..d432b63ec 100644 --- a/doc/man/man1/elinks.1.in +++ b/doc/man/man1/elinks.1.in @@ -1,335 +1,420 @@ -.\"Generated by db2man.xsl. Don't modify this, modify the source. -.de Sh \" Subsection -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Ip \" List item -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.TH "ELINKS" 1 "The Elinks text-browser" "2007-01-06" "The Elinks text-browser" -.SH NAME -elinks \- lynx-like alternative character mode WWW browser +.\" Title: elinks +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/> +.\" Date: 03/05/2008 +.\" Manual: +.\" Source: +.\" +.TH "ELINKS" "1" "03/05/2008" "" "" +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.SH "NAME" +elinks \- lynx\-like alternative character mode WWW browser .SH "SYNOPSIS" - - -\fIelinks\fR [OPTION]... [URL]... - +\fIelinks\fR [OPTION]\&... [URL]\&... +.sp .SH "DESCRIPTION" - - -\fIELinks\fR is a text mode WWW browser, supporting colors, table rendering, background downloading, menu driven configuration interface, tabbed browsing and slim code\&. - - -Frames are supported\&. You can have different file formats associated with external viewers\&. mailto: and telnet: are supported via external clients\&. - - -ELinks can handle both local files and remote URLs\&. The main supported remote URL protocols are \fIHTTP\fR, \fIHTTPS\fR (with SSL support compiled in) and \fIFTP\fR\&. Additional protocol support exists for \fIBitTorrent\fR \fIfinger\fR, \fIGopher\fR, \fISMB\fR and \fINNTP\fR\&. - - -The homepage of \fIELinks\fR can be found at <http://elinks\&.cz/>, where the ELinks manual is also hosted\&. - +\fIELinks\fR is a text mode WWW browser, supporting colors, table rendering, background downloading, menu driven configuration interface, tabbed browsing and slim code. +.sp +Frames are supported. You can have different file formats associated with external viewers. mailto: and telnet: are supported via external clients. +.sp +ELinks can handle both local files and remote URLs. The main supported remote URL protocols are \fIHTTP\fR, \fIHTTPS\fR (with SSL support compiled in) and \fIFTP\fR. Additional protocol support exists for \fIBitTorrent\fR \fIfinger\fR, \fIGopher\fR, \fISMB\fR and \fINNTP\fR. +.sp +The homepage of \fIELinks\fR can be found at <http://elinks.cz/>, where the ELinks manual is also hosted. +.sp .SH "OPTIONS" - - -Most options can be set in the user interface or config file, so usually you do not need to care about them\&. Note that this list is roughly equivalent to the output of running ELinks with the option \-\-long\-help\&. - -.TP +Most options can be set in the user interface or config file, so usually you do not need to care about them. Note that this list is roughly equivalent to the output of running ELinks with the option \-\-long\-help. +.sp +.PP \-anonymous [0|1] (default: 0) -Restricts \fIELinks\fR so it can run on an anonymous account\&. Local file browsing, downloads, and modification of options will be disabled\&. Execution of viewers is allowed, but entries in the association table can't be added or modified\&. - -.TP +.RS 4 +Restricts +\fIELinks\fR +so it can run on an anonymous account. Local file browsing, downloads, and modification of options will be disabled. Execution of viewers is allowed, but entries in the association table can't be added or modified. +.RE +.PP \-auto\-submit [0|1] (default: 0) -Automatically submit the first form in the given URLs\&. - -.TP +.RS 4 +Automatically submit the first form in the given URLs. +.RE +.PP \-base\-session <num> (default: 0) -Used internally when opening \fIELinks\fR instances in new windows\&. The ID maps to information that will be used when creating the new instance\&. You don't want to use it\&. - -.TP +.RS 4 +Used internally when opening +\fIELinks\fR +instances in new windows. The ID maps to information that will be used when creating the new instance. You don't want to use it. +.RE +.PP \-config\-dir <str> (default: "") -Path of the directory \fIELinks\fR will read and write its config and runtime state files to instead of ~/\&.elinks\&. If the path does not begin with a '/' it is assumed to be relative to your \fIHOME\fR directory\&. - -.TP +.RS 4 +Path of the directory +\fIELinks\fR +will read and write its config and runtime state files to instead of +~/.elinks. If the path does not begin with a '/' it is assumed to be relative to your +\fIHOME\fR +directory. +.RE +.PP \-config\-dump -Print a configuration file with options set to the built\-in defaults to stdout\&. - -.TP -\-config\-file <str> (default: "elinks\&.conf") -Name of the configuration file that all configuration options will be read from and written to\&. It should be relative to config\-dir\&. - -.TP +.RS 4 +Print a configuration file with options set to the built\-in defaults to stdout. +.RE +.PP +\-config\-file <str> (default: "elinks.conf") +.RS 4 +Name of the configuration file that all configuration options will be read from and written to. It should be relative to config\-dir. +.RE +.PP \-config\-help -Print help for configuration options and exit\&. - -.TP -\-default\-mime\-type (alias for mime\&.default_type) -The default MIME type used for documents of unknown type\&. - -.TP +.RS 4 +Print help for configuration options and exit. +.RE +.PP +\-default\-mime\-type (alias for mime.default_type) +.RS 4 +The default MIME type used for documents of unknown type. +.RE +.PP \-default\-keys [0|1] (default: 0) -When set, all keybindings from configuration files will be ignored\&. It forces use of default keybindings and will reset user\-defined ones on save\&. - -.TP +.RS 4 +When set, all keybindings from configuration files will be ignored. It forces use of default keybindings and will reset user\-defined ones on save. +.RE +.PP \-dump [0|1] (default: 0) -Print formatted plain\-text versions of given URLs to stdout\&. - -.TP -\-dump\-charset (alias for document\&.dump\&.codepage) -Codepage used when formatting dump output\&. - -.TP -\-dump\-color\-mode (alias for document\&.dump\&.color_mode) -Color mode used with \-dump\&. - -.TP -\-dump\-width (alias for document\&.dump\&.width) -Width of the dump output\&. - -.TP +.RS 4 +Print formatted plain\-text versions of given URLs to stdout. +.RE +.PP +\-dump\-charset (alias for document.dump.codepage) +.RS 4 +Codepage used when formatting dump output. +.RE +.PP +\-dump\-color\-mode (alias for document.dump.color_mode) +.RS 4 +Color mode used with +\-dump. +.RE +.PP +\-dump\-width (alias for document.dump.width) +.RS 4 +Width of the dump output. +.RE +.PP \-eval -Specify configuration file directives on the command\-line which will be evaluated after all configuration files has been read\&. Example usage: - +.RS 4 +Specify configuration file directives on the command\-line which will be evaluated after all configuration files has been read. Example usage: +.sp +.RS 4 .nf -\-eval 'set protocol\&.file\&.allow_special_files = 1' +\-eval 'set protocol.file.allow_special_files = 1' .fi - -.TP +.RE +.RE +.PP \-force\-html -Makes \fIELinks\fR assume documents of unknown types are HTML\&. Useful when using \fIELinks\fR as an external viewer from MUAs\&. This is equivalent to \-default\-mime\-type text/html\&. - -.TP +.RS 4 +Makes +\fIELinks\fR +assume documents of unknown types are HTML. Useful when using +\fIELinks\fR +as an external viewer from MUAs. This is equivalent to +\-default\-mime\-type +text/html. +.RE +.PP \-?, \-h, \-help -Print usage help and exit\&. - -.TP +.RS 4 +Print usage help and exit. +.RE +.PP \-localhost [0|1] (default: 0) -Restricts \fIELinks\fR to work offline and only connect to servers with local addresses (ie\&. 127\&.0\&.0\&.1)\&. No connections to remote servers will be permitted\&. - -.TP +.RS 4 +Restricts +\fIELinks\fR +to work offline and only connect to servers with local addresses (ie. 127.0.0.1). No connections to remote servers will be permitted. +.RE +.PP \-long\-help -Print detailed usage help and exit\&. - -.TP +.RS 4 +Print detailed usage help and exit. +.RE +.PP \-lookup -Look up specified host and print all DNS resolved IP addresses\&. - -.TP +.RS 4 +Look up specified host and print all DNS resolved IP addresses. +.RE +.PP \-no\-connect [0|1] (default: 0) -Run \fIELinks\fR as a separate instance instead of connecting to an existing instance\&. Note that normally no runtime state files (bookmarks, history, etc\&.) are written to the disk when this option is used\&. See also \-touch\-files\&. - -.TP +.RS 4 +Run +\fIELinks\fR +as a separate instance instead of connecting to an existing instance. Note that normally no runtime state files (bookmarks, history, etc.) are written to the disk when this option is used. See also +\-touch\-files. +.RE +.PP \-no\-home [0|1] (default: 0) -Disables creation and use of files in the user specific home configuration directory (~/\&.elinks)\&. It forces default configuration values to be used and disables saving of runtime state files\&. - -.TP -\-no\-numbering (alias for document\&.dump\&.numbering) -Prevents printing of link number in dump output\&. Note that this really affects only \-dump, nothing else\&. - -.TP -\-no\-references (alias for document\&.dump\&.references) -Prevents printing of references (URIs) of document links in dump output\&. Note that this really affects only \-dump, nothing else\&. - -.TP +.RS 4 +Disables creation and use of files in the user specific home configuration directory (~/.elinks). It forces default configuration values to be used and disables saving of runtime state files. +.RE +.PP +\-no\-numbering (alias for document.dump.numbering) +.RS 4 +Prevents printing of link number in dump output. Note that this really affects only +\-dump, nothing else. +.RE +.PP +\-no\-references (alias for document.dump.references) +.RS 4 +Prevents printing of references (URIs) of document links in dump output. Note that this really affects only +\-dump, nothing else. +.RE +.PP \-remote -Control a remote \fIELinks\fR instance by passing commands to it\&. The option takes an additional argument containing the method which should be invoked and any parameters that should be passed to it\&. For ease of use, the additional method argument can be omitted in which case any URL arguments will be opened in new tabs in the remote instance\&. Following is a list of the supported methods: - -.RS -.TP 3 -\(bu - ping(): look for a remote instance -.TP -\(bu - openURL(): prompt URL in current tab -.TP -\(bu - openURL(URL): open URL in current tab -.TP -\(bu - openURL(URL, new\-tab): open URL in new tab -.TP -\(bu - openURL(URL, new\-window): open URL in new window -.TP -\(bu - addBookmark(URL): bookmark URL -.TP -\(bu - infoBox(text): show text in a message box -.TP -\(bu - xfeDoCommand(openBrowser): open new window -.LP +.RS 4 +Control a remote +\fIELinks\fR +instance by passing commands to it. The option takes an additional argument containing the method which should be invoked and any parameters that should be passed to it. For ease of use, the additional method argument can be omitted in which case any URL arguments will be opened in new tabs in the remote instance. Following is a list of the supported methods: +.sp +.RS 4 +\h'-04'\(bu\h'+03' +ping(): look for a remote instance .RE -.IP - -.TP +.sp +.RS 4 +\h'-04'\(bu\h'+03' +openURL(): prompt URL in current tab +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03' +openURL(URL): open URL in current tab +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03' +openURL(URL, new\-tab): open URL in new tab +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03' +openURL(URL, new\-window): open URL in new window +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03' +addBookmark(URL): bookmark URL +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03' +infoBox(text): show text in a message box +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03' +xfeDoCommand(openBrowser): open new window +.RE +.RE +.PP \-session\-ring <num> (default: 0) -ID of session ring this \fIELinks\fR session should connect to\&. \fIELinks\fR works in so\-called session rings, whereby all instances of \fIELinks\fR are interconnected and share state (cache, bookmarks, cookies, and so on)\&. By default, all \fIELinks\fR instances connect to session ring 0\&. You can change that behaviour with this switch and form as many session rings as you want\&. Obviously, if the session\-ring with this number doesn't exist yet, it's created and this 'ELinks' instance will become the master instance (that usually doesn't matter for you as a user much)\&. Note that you usually don't want to use this unless you're a developer and you want to do some testing \- if you want the \fIELinks\fR instances each running standalone, rather use the \-no\-connect command\-line option\&. Also note that normally no runtime state files are written to the disk when this option is used\&. See also \-touch\-files\&. - -.TP -\-source [0|1] (default: 0) -Print given URLs in source form to stdout\&. - -.TP -\-touch\-files [0|1] (default: 0) -When enabled, runtime state files (bookmarks, history, etc\&.) are written to disk, even when \-no\-connect or \-session\-ring is used\&. The option has no effect if not used in conjunction with any of these options\&. - -.TP -\-verbose <num> (default: 1) -The verbose level controls what messages are shown at start up and while running: - -.RS -.TP 3 -\(bu -0: means only show serious errors -.TP -\(bu -1: means show serious errors and warnings -.TP -\(bu -2: means show all messages -.LP +.RS 4 +ID of session ring this +\fIELinks\fR +session should connect to. +\fIELinks\fR +works in so\-called session rings, whereby all instances of +\fIELinks\fR +are interconnected and share state (cache, bookmarks, cookies, and so on). By default, all +\fIELinks\fR +instances connect to session ring 0. You can change that behaviour with this switch and form as many session rings as you want. Obviously, if the session\-ring with this number doesn't exist yet, it's created and this 'ELinks' instance will become the master instance (that usually doesn't matter for you as a user much). Note that you usually don't want to use this unless you're a developer and you want to do some testing \- if you want the +\fIELinks\fR +instances each running standalone, rather use the +\-no\-connect +command\-line option. Also note that normally no runtime state files are written to the disk when this option is used. See also +\-touch\-files. .RE -.IP - -.TP +.PP +\-source [0|1] (default: 0) +.RS 4 +Print given URLs in source form to stdout. +.RE +.PP +\-touch\-files [0|1] (default: 0) +.RS 4 +When enabled, runtime state files (bookmarks, history, etc.) are written to disk, even when +\-no\-connect +or +\-session\-ring +is used. The option has no effect if not used in conjunction with any of these options. +.RE +.PP +\-verbose <num> (default: 1) +.RS 4 +The verbose level controls what messages are shown at start up and while running: +.sp +.RS 4 +\h'-04'\(bu\h'+03'0: means only show serious errors +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03'1: means show serious errors and warnings +.RE +.sp +.RS 4 +\h'-04'\(bu\h'+03'2: means show all messages +.RE +.RE +.PP \-version -Print \fIELinks\fR version information and exit\&. - - -Generated using output from ELinks version 0\&.12\&.GIT\&. - +.RS 4 +Print +\fIELinks\fR +version information and exit. +.RE +Generated using output from ELinks version 0.12.GIT. +.sp .SH "ENVIRONMENT VARIABLES" - -.TP +.PP COMSPEC, SHELL -The shell used for File \-> OS Shell on DOS/Windows and UNIX, respectively\&. - -.TP +.RS 4 +The shell used for File \-> OS Shell on DOS/Windows and UNIX, respectively. +.RE +.PP EDITOR -The program to use for external editor (when editing textareas)\&. - -.TP +.RS 4 +The program to use for external editor (when editing textareas). +.RE +.PP ELINKS_CONFDIR -The location of the directory containing configuration files\&. If not set the default is ~/\&.elinks/\&. - -.TP +.RS 4 +The location of the directory containing configuration files. If not set the default is +~/.elinks/. +.RE +.PP ELINKS_TWTERM, LINKS_TWTERM -The command to run when selecting File \-> New window and if TWDISPLAY is defined (default twterm \-e) - -.TP +.RS 4 +The command to run when selecting File \-> New window and if +TWDISPLAY +is defined (default +twterm \-e) +.RE +.PP ELINKS_XTERM, LINKS_XTERM -The command to run when selecting File \-> New window and if DISPLAY is defined (default xterm \-e) - -.TP +.RS 4 +The command to run when selecting File \-> New window and if +DISPLAY +is defined (default +xterm \-e) +.RE +.PP FTP_PROXY, HTTP_PROXY, HTTPS_PROXY -The host to proxy the various protocol traffic through\&. - -.TP +.RS 4 +The host to proxy the various protocol traffic through. +.RE +.PP NO_PROXY -A comma separated list of URLs which should not be proxied\&. - -.TP +.RS 4 +A comma separated list of URLs which should not be proxied. +.RE +.PP HOME -The path to the users home directory\&. Used when expanding ~/\&. - -.TP +.RS 4 +The path to the users home directory. Used when expanding +~/. +.RE +.PP WWW_HOME -Homepage location (as in \fBlynx\fR(1))\&. - +.RS 4 +Homepage location (as in +\fBlynx\fR(1)). +.RE .SH "FILES" - -.TP -@sysconfdir@/elinks\&.conf -Site\-wide configuration file\&. - -.TP -~/\&.elinks/elinks\&.conf -Per\-user config file, loaded after site\-wide configuration\&. - -.TP -~/\&.elinks/bookmarks -Bookmarks file\&. - -.TP -~/\&.elinks/cookies -Cookies file\&. - -.TP -~/\&.elinks/exmodehist -Exmode history file\&. - -.TP -~/\&.elinks/formhist -Form history file\&. - -.TP -~/\&.elinks/globhist -History file containing most recently visited URLs\&. - -.TP -~/\&.elinks/gotohist -GoTo URL dialog history file\&. - -.TP -~/\&.elinks/hooks\&.{js,lua,pl,py,rb,scm} -Browser scripting hooks\&. - -.TP -~/\&.elinks/searchhist -Search history file\&. - -.TP -~/\&.elinks/socket -Internal \fIELinks\fR socket for communication between its instances\&. - -.TP -~/\&.mailcap -Mappings of MIME types to external handlers\&. - -.TP -~/\&.mime\&.types -Mappings of file extensions to MIME types\&. - - -Other files that ELinks uses from \fI~/\&.elinks/\fR includes the user defined CSS stylesheet\&. The name of the file can set in the \fIdocument\&.css\&.stylesheet\fR option\&. - +.PP +@sysconfdir@/elinks.conf +.RS 4 +Site\-wide configuration file. +.RE +.PP +~/.elinks/elinks.conf +.RS 4 +Per\-user config file, loaded after site\-wide configuration. +.RE +.PP +~/.elinks/bookmarks +.RS 4 +Bookmarks file. +.RE +.PP +~/.elinks/cookies +.RS 4 +Cookies file. +.RE +.PP +~/.elinks/exmodehist +.RS 4 +Exmode history file. +.RE +.PP +~/.elinks/formhist +.RS 4 +Form history file. +.RE +.PP +~/.elinks/globhist +.RS 4 +History file containing most recently visited URLs. +.RE +.PP +~/.elinks/gotohist +.RS 4 +GoTo URL dialog history file. +.RE +.PP +~/.elinks/hooks.{js,lua,pl,py,rb,scm} +.RS 4 +Browser scripting hooks. +.RE +.PP +~/.elinks/searchhist +.RS 4 +Search history file. +.RE +.PP +~/.elinks/socket +.RS 4 +Internal +\fIELinks\fR +socket for communication between its instances. +.RE +.PP +~/.mailcap +.RS 4 +Mappings of MIME types to external handlers. +.RE +.PP +~/.mime.types +.RS 4 +Mappings of file extensions to MIME types. +.RE +Other files that ELinks uses from \fI~/.elinks/\fR includes the user defined CSS stylesheet. The name of the file can set in the \fIdocument.css.stylesheet\fR option. +.sp .SH "PLATFORMS" - - -\fIELinks\fR is known to work on \fILinux\fR, \fIFreeBSD\fR, \fIOpenBSD\fR, \fISolaris\fR, \fIIRIX\fR, \fIHPUX\fR, \fIDigital Unix\fR, \fIAIX\fR, \fIOS/2\fR, \fIBeOS\fR and \fIRISC OS\fR\&. Port for \fIWin32\fR is in state of beta testing\&. - +\fIELinks\fR is known to work on \fILinux\fR, \fIFreeBSD\fR, \fIOpenBSD\fR, \fISolaris\fR, \fIIRIX\fR, \fIHPUX\fR, \fIDigital Unix\fR, \fIAIX\fR, \fIOS/2\fR, \fIBeOS\fR and \fIRISC OS\fR. Port for \fIWin32\fR is in state of beta testing. +.sp .SH "BUGS" - - -Please report any other bugs you find to the either the ELinks mailing list at <elinks\-users@linuxfromscratch\&.org> or if you prefer enter them into the bug tracking system <http://bugzilla\&.elinks\&.cz/>\&. More information about how to get in contact with developers and getting help can be found on the community page <http://elinks\&.cz/community\&.html>\&. - +Please report any other bugs you find to the either the ELinks mailing list at <elinks\-users@linuxfromscratch.org> or if you prefer enter them into the bug tracking system <http://bugzilla.elinks.cz/>. More information about how to get in contact with developers and getting help can be found on the community page <http://elinks.cz/community.html>. +.sp .SH "LICENSE" - - -\fIELinks\fR is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License <http://www\&.gnu\&.org/copyleft/gpl\&.html> as published by the Free Software Foundation; version 2 of the License\&. - +\fIELinks\fR is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License <http://www.gnu.org/copyleft/gpl.html> as published by the Free Software Foundation; version 2 of the License. +.sp .SH "AUTHORS" - - -The \fILinks\fR browser \- on which \fIELinks\fR is based \- was written by Mikulas Patocka <mikulas@artax\&.karlin\&.mff\&.cuni\&.cz>\&. \fIELinks\fR was written by Petr Baudis <pasky@ucw\&.cz>\&. See file AUTHORS in the source tree for a list of people contributing to this project\&. - - -This manual page was written by Peter Gervai <grin@tolna\&.net>, using excerpts from a (yet?) unknown \fILinks\fR fan for the \fIDebian GNU/Linux system\fR (but may be used by others)\&. Contributions from Francis A\&. Holop\&. Extended, clarified and made more up\-to\-date by Petr Baudis <pasky@ucw\&.cz>\&. Updated by Zas <zas@norz\&.org>\&. The conversion to Asciidoc and trimming was done by Jonas Fonseca <fonseca@diku\&.dk>\&. - +The \fILinks\fR browser \- on which \fIELinks\fR is based \- was written by Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>. \fIELinks\fR was written by Petr Baudis <pasky@ucw.cz>. See file AUTHORS in the source tree for a list of people contributing to this project. +.sp +This manual page was written by Peter Gervai <grin@tolna.net>, using excerpts from a (yet?) unknown \fILinks\fR fan for the \fIDebian GNU/Linux system\fR (but may be used by others). Contributions from Francis A. Holop. Extended, clarified and made more up\-to\-date by Petr Baudis <pasky@ucw.cz>. Updated by Zas <zas@norz.org>. The conversion to Asciidoc and trimming was done by Jonas Fonseca <fonseca@diku.dk>. +.sp .SH "SEE ALSO" - - -\fBelinkskeys\fR(5), \fBelinks\&.conf\fR(5), \fBlinks\fR(1), \fBlynx\fR(1), \fBw3m\fR(1), \fBwget\fR(1) - +\fBelinkskeys\fR(5), \fBelinks.conf\fR(5), \fBlinks\fR(1), \fBlynx\fR(1), \fBw3m\fR(1), \fBwget\fR(1) +.sp From b0251dad32e2c31a4b7f15f8115b38c011d6a08f Mon Sep 17 00:00:00 2001 From: Jonas Fonseca <fonseca@diku.dk> Date: Sun, 2 Mar 2008 23:29:17 +0100 Subject: [PATCH 06/13] elinks(1): update and polish; leave out the platform section The list of platforms are better maintained on the homepage. (cherry picked from commit 3ea7939b0d16a74fb0688df9218935469c726fb8, regenerated doc/man/man1/elinks.1.in) --- doc/elinks.1.txt | 19 ++++++++++++------- doc/man/man1/elinks.1.in | 15 ++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/elinks.1.txt b/doc/elinks.1.txt index 493eb79fd..231b879fc 100644 --- a/doc/elinks.1.txt +++ b/doc/elinks.1.txt @@ -57,12 +57,12 @@ ELINKS_CONFDIR:: ELINKS_TWTERM, LINKS_TWTERM:: The command to run when selecting File -> New window and if - `TWDISPLAY` is defined (default `twterm -e`) + `TWDISPLAY` is defined (default `twterm -e`). ELINKS_XTERM, LINKS_XTERM:: The command to run when selecting File -> New window and if `DISPLAY` - is defined (default `xterm -e`) + is defined (default `xterm -e`). FTP_PROXY, HTTP_PROXY, HTTPS_PROXY:: @@ -83,6 +83,11 @@ WWW_HOME:: FILES ----- +Configuration files controlled by ELinks are located in the user +configuration directory, defaulting to '~/.elinks/'. In addition to the +files listed below, a user defined CSS stylesheet can be defined using +the 'document.css.stylesheet' option. + @sysconfdir@/elinks.conf:: Site-wide configuration file. @@ -116,15 +121,14 @@ FILES ~/.elinks/socket:: Internal 'ELinks' socket for communication between its instances. -~/.mailcap:: +~/.mailcap, /etc/mailcap:: Mappings of MIME types to external handlers. -~/.mime.types:: +~/.mime.types, /etc/mime.types:: Mappings of file extensions to MIME types. -Other files that ELinks uses from '~/.elinks/' includes the user defined CSS -stylesheet. The name of the file can set in the 'document.css.stylesheet' -option. +////////////////////////////////////////////////////////////////////////////// +// Commented out since it's neither super useful nor manpage material. --jonas PLATFORMS --------- @@ -132,6 +136,7 @@ PLATFORMS 'ELinks' is known to work on 'Linux', 'FreeBSD', 'OpenBSD', 'Solaris', 'IRIX', 'HPUX', 'Digital Unix', 'AIX', 'OS/2', 'BeOS' and 'RISC OS'. Port for 'Win32' is in state of beta testing. +////////////////////////////////////////////////////////////////////////////// BUGS ---- diff --git a/doc/man/man1/elinks.1.in b/doc/man/man1/elinks.1.in index d432b63ec..20c5ca3a9 100644 --- a/doc/man/man1/elinks.1.in +++ b/doc/man/man1/elinks.1.in @@ -299,7 +299,7 @@ ELINKS_TWTERM, LINKS_TWTERM The command to run when selecting File \-> New window and if TWDISPLAY is defined (default -twterm \-e) +twterm \-e). .RE .PP ELINKS_XTERM, LINKS_XTERM @@ -307,7 +307,7 @@ ELINKS_XTERM, LINKS_XTERM The command to run when selecting File \-> New window and if DISPLAY is defined (default -xterm \-e) +xterm \-e). .RE .PP FTP_PROXY, HTTP_PROXY, HTTPS_PROXY @@ -332,6 +332,8 @@ Homepage location (as in \fBlynx\fR(1)). .RE .SH "FILES" +Configuration files controlled by ELinks are located in the user configuration directory, defaulting to \fI~/.elinks/\fR. In addition to the files listed below, a user defined CSS stylesheet can be defined using the \fIdocument.css.stylesheet\fR option. +.sp .PP @sysconfdir@/elinks.conf .RS 4 @@ -390,20 +392,15 @@ Internal socket for communication between its instances. .RE .PP -~/.mailcap +~/.mailcap, /etc/mailcap .RS 4 Mappings of MIME types to external handlers. .RE .PP -~/.mime.types +~/.mime.types, /etc/mime.types .RS 4 Mappings of file extensions to MIME types. .RE -Other files that ELinks uses from \fI~/.elinks/\fR includes the user defined CSS stylesheet. The name of the file can set in the \fIdocument.css.stylesheet\fR option. -.sp -.SH "PLATFORMS" -\fIELinks\fR is known to work on \fILinux\fR, \fIFreeBSD\fR, \fIOpenBSD\fR, \fISolaris\fR, \fIIRIX\fR, \fIHPUX\fR, \fIDigital Unix\fR, \fIAIX\fR, \fIOS/2\fR, \fIBeOS\fR and \fIRISC OS\fR. Port for \fIWin32\fR is in state of beta testing. -.sp .SH "BUGS" Please report any other bugs you find to the either the ELinks mailing list at <elinks\-users@linuxfromscratch.org> or if you prefer enter them into the bug tracking system <http://bugzilla.elinks.cz/>. More information about how to get in contact with developers and getting help can be found on the community page <http://elinks.cz/community.html>. .sp From 9863dbfa9c65a5d15da976db8d240bbac4e82bea Mon Sep 17 00:00:00 2001 From: Jonas Fonseca <fonseca@diku.dk> Date: Mon, 3 Mar 2008 01:38:54 +0100 Subject: [PATCH 07/13] keys2doc: map the KBD_MOD_SHIFT modifier to Shift-prefix (cherry picked from commit dc497964e9d3730ff34c3b7188992c215dfe4512) --- doc/tools/keys2doc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/tools/keys2doc b/doc/tools/keys2doc index 1618e9c22..45649bc9c 100755 --- a/doc/tools/keys2doc +++ b/doc/tools/keys2doc @@ -74,9 +74,8 @@ print_keymap_defaults() grep ACT_$KEYMAP $KBDBIND | grep '^[[:space:]]{' | grep -v '{ "' \ | while read entry do - entry=$(echo "$entry" | sed 's/.*{ { //' | sed 's/ }//') + entry=$(echo "$entry" | sed 's/.*{ { //') key=$(echo "$entry" | sed "s/\(KBD_[^,]*\|'.*'\),.*/\1/") - modifier=$(echo "$entry" | sed "s/.*KBD_MOD_\([A-Z_]*\).*/\1/") action=$(echo "$entry" | sed "s/.*,.*\(ACT_$KEYMAP\)_\([A-Z_]*\).*/\2/") # If there are backslashed quotes, remove the backslashes. # (This is not needed in print_keymap_actions because @@ -99,10 +98,11 @@ print_keymap_defaults() ;; esac - case "$modifier" in - ALT) modifier="Alt-" ;; - CTRL) modifier="Ctrl-" ;; - *) modifier="" ;; + case "$entry" in + *KBD_MOD_ALT*) modifier="Alt-" ;; + *KBD_MOD_CTRL*) modifier="Ctrl-" ;; + *KBD_MOD_SHIFT*) modifier="Shift-" ;; + *) modifier="" ;; esac echo 'ifdef::backend-docbook[]' From b28ccd6e4ff4efee375c87d7e8ac9e7445ab6ab6 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca <fonseca@diku.dk> Date: Mon, 3 Mar 2008 01:59:01 +0100 Subject: [PATCH 08/13] keys2doc: fix handling of dots (.) in description list term Quote character keybindings to workaround unescaped (resulting to invisible) dots in elinkskeys(5). (cherry picked from commit 3de420d72f480f01172d052d9bf9812157cf23f3) --- doc/tools/keys2doc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/tools/keys2doc b/doc/tools/keys2doc index 45649bc9c..1f36f3a5d 100755 --- a/doc/tools/keys2doc +++ b/doc/tools/keys2doc @@ -82,6 +82,7 @@ print_keymap_defaults() # there the "read" command consumes the backslashes.) action=$(grep " $action," "$CONFIGDIR/actions-$keymap.inc" \ | sed "s/.*\"\([^\"]*\)\".*N__(\"\(.*\)\").*/\2 ('\1')/;s/\\\\\"/\"/g") + q= case "$key" in KBD_*) @@ -95,6 +96,7 @@ print_keymap_defaults() *) key=$(echo "$key" | sed "s/^'\(.*\)'$/\1/" \ | sed "s/'/{squote}/") + q='"' ;; esac @@ -106,7 +108,7 @@ print_keymap_defaults() esac echo 'ifdef::backend-docbook[]' - echo "'$modifier$key'::" + echo "'$modifier$q$key$q'::" echo " $action" echo echo 'endif::backend-docbook[]' From 1086a7c5611511bc45d07625d864aa179903914a Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters <miciah@myrealbox.com> Date: Sun, 27 Jan 2008 02:53:32 +0000 Subject: [PATCH 09/13] elinks.conf.5: Correct description of 'unset' directive The 'unset' directive does not take a value. (cherry picked from commit dc7731d30d73d1f3229d66a2417c96be402c20c1) --- doc/elinks.conf.5.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/elinks.conf.5.txt b/doc/elinks.conf.5.txt index 715d9027c..cab411f13 100644 --- a/doc/elinks.conf.5.txt +++ b/doc/elinks.conf.5.txt @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] set "<option>" = <value> -unset "<option>" = <value> +unset "<option>" bind "<keymap>" "<key>" = "<action>" include "<file>" From 857c27e8b68e8ae08a4bdf4950a296ed4aa5df49 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo <kon@iki.fi> Date: Thu, 6 Mar 2008 10:23:21 +0200 Subject: [PATCH 10/13] elinks.conf.5: quoting corrections In set and unset commands, the <option> must not be quoted. In the sample protocol.user.mailto.unix setting, the internal quotes were using some manpage syntax, resulting in incorrect HTML output. --- doc/elinks.conf.5.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/elinks.conf.5.txt b/doc/elinks.conf.5.txt index cab411f13..9402f6e16 100644 --- a/doc/elinks.conf.5.txt +++ b/doc/elinks.conf.5.txt @@ -9,8 +9,8 @@ elinks.conf - ELinks configuration file SYNOPSIS -------- [verse] -set "<option>" = <value> -unset "<option>" +set <option> = <value> +unset <option> bind "<keymap>" "<key>" = "<action>" include "<file>" @@ -52,7 +52,7 @@ Some sample settings: # Default document codepage. set document.codepage.assume = "ISO-8859-1" # User defined protocol handlers - set protocol.user.mailto.unix = "mutt %h -s \e\*(lq%s\e\*(rq" + set protocol.user.mailto.unix = "mutt %h -s \"%s\"" OPTIONS ------- From 34a18bd59772995ed007a63a11a6bff2897b83f0 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca <fonseca@diku.dk> Date: Mon, 3 Mar 2008 02:51:25 +0100 Subject: [PATCH 11/13] Add description and version info to manpages This adopts customized docbook manpage header from git's Documentation/asciidoc.conf and does away with a couple of ugly hacks. (cherry picked from commit 0ecc8b9d60aea6f13d201492be103ea801271486, omitting generated files) --- doc/Makefile | 13 ++++--------- doc/asciidoc.conf | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 15ab5b2df..e516bbbdc 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -14,7 +14,10 @@ PDF_DIR = $(DESTDIR)$(docdir)/$(PACKAGE)/pdf TXT_DIR = $(DESTDIR)$(docdir)/$(PACKAGE)/txt ASCIIDOC_CONF = $(srcdir)asciidoc.conf -ASCIIDOC_FLAGS += -f $(ASCIIDOC_CONF) -a "builddir=$(CURDIR)/" -a asciidoc7compatible +ASCIIDOC_FLAGS += -f $(ASCIIDOC_CONF) \ + -a "builddir=$(CURDIR)/" \ + -a asciidoc7compatible \ + -a elinks_version=$(VERSION) ############################################################################# # Build files @@ -167,12 +170,6 @@ asciidoc_dep = sed -n 's/[{]builddir}//g;s@include::\(.*\)\[.*@$@: $< \1@p' < $< -include .deps/*.asciidoc -# Do a little post-processing of man pages. Inserting title headers and date. -MAN_DATE = $(shell date -I) -man_desc = `sed -n 's/:Description:\s*\(.*\)/\1/p' < $(srcdir)$(subst .xml,.txt,$(<F))` -man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\" \"$(1)\"/" < $@ | \ - sed "s/@squote@/\\\\'/g" > $@.tmp && mv $@.tmp $@ - ############################################################################# # Build recipies @@ -187,11 +184,9 @@ man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\" %.1: %.1.xml $(call cmd,xmlto,man) - @$(call man_hack,$(call man_desc)) %.5: %.5.xml $(call cmd,xmlto,man) - @$(call man_hack,$(call man_desc)) %.html-chunked: %.xml $(call cmd,xmlto,html) diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf index 3e892aaaa..358700d32 100644 --- a/doc/asciidoc.conf +++ b/doc/asciidoc.conf @@ -19,7 +19,7 @@ ifdef::backend-docbook[] # To be replaced later [attributes] -squote=@squote@ +squote=' # No interlinking between elinks manpages [man-inlinemacro] @@ -48,6 +48,21 @@ ifdef::doctype-manpage[] [mailto-inlinemacro] <{target}> +[header] +template::[header-declarations] +<refentry> +<refmeta> +<refentrytitle>{mantitle}</refentrytitle> +<manvolnum>{manvolnum}</manvolnum> +<refmiscinfo class="source">ELinks</refmiscinfo> +<refmiscinfo class="version">{elinks_version}</refmiscinfo> +<refmiscinfo class="manual">{description}</refmiscinfo> +</refmeta> +<refnamediv> + <refname>{manname}</refname> + <refpurpose>{manpurpose}</refpurpose> +</refnamediv> + endif::doctype-manpage[] endif::backend-docbook[] From e04b4208972b9aa899567bc85371eb096e13a77d Mon Sep 17 00:00:00 2001 From: Jonas Fonseca <fonseca@diku.dk> Date: Mon, 3 Mar 2008 03:03:11 +0100 Subject: [PATCH 12/13] Minor fixes and improvements to option strings This syncs some changes (ie. -> e.g. etc.) from elinks-0.12 or beyond. I noticed them while updating the web pages, and apologize that I will not spent the time to attribute it to the individual commits. (cherry picked from commit 2bfc7b37241b88816cb0454399ec615b8511680a, omitting generated files) --- src/protocol/http/http.c | 10 +++++----- src/protocol/rewrite/rewrite.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 4fa2b1153..63b0fe8ed 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -195,11 +195,11 @@ static struct option_info http_options[] = { "a standard for new textmode user agents, so that the webmasters can\n" "have just a single uniform test for these if they are e.g. pushing\n" "some lite version to them automagically.\n" - "%v in the string means ELinks version\n" - "%s in the string means system identification\n" - "%t in the string means size of the terminal\n" - "%b in the string means number of bars displayed by ELinks\n" - "Use \" \" if you don't want any User-Agent header to be sent at all.")), + "Use \" \" if you don't want any User-Agent header to be sent at all.\n" + "%v in the string means ELinks version,\n" + "%s in the string means system identification,\n" + "%t in the string means size of the terminal,\n" + "%b in the string means number of bars displayed by ELinks.")), INIT_OPT_TREE("protocol", N_("HTTPS"), diff --git a/src/protocol/rewrite/rewrite.c b/src/protocol/rewrite/rewrite.c index 17f238d63..df422ce38 100644 --- a/src/protocol/rewrite/rewrite.c +++ b/src/protocol/rewrite/rewrite.c @@ -98,10 +98,10 @@ static struct option_info uri_rewrite_options[] = { "(i.e. contains no '.', ':' or '/' characters), and does\n" "not match any defined prefixes. Set the value to \"\" to\n" "disable use of the default template rewrite rule.\n" - "%c in the template means the current URL\n" - "%s in the template means the whole string from the goto dialog\n" - "%0,%1,...,%9 mean the 1st,2nd,...,10th space-delimited part of %s\n" - "%% in the template means '%'")), + "%c in the template means the current URL,\n" + "%s in the template means the whole string from the goto dialog,\n" + "%0,%1,...,%9 mean the 1st,2nd,...,10th space-delimited part of %s,\n" + "%% in the template means '%'.")), #define INIT_OPT_DUMB_PREFIX(prefix, uri) \ INIT_OPT_STRING("protocol.rewrite.dumb", NULL, prefix, 0, uri, NULL) From 5fcf1759637e5dec583e293e24f384f408bad36d Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo <kon@iki.fi> Date: Sat, 8 Mar 2008 13:58:21 +0200 Subject: [PATCH 13/13] help2doc: rewrite in Perl This version takes about 1/300 of the time of the shell version and fixes several errors in the output, most importantly that option descriptions were being truncated at the first empty line. Because help2doc is run only from make update-man, and the distributed tarballs include prebuilt man pages, people building ELinks need not have Perl installed. --- doc/tools/help2doc | 237 +++++++++++++++------------------------------ 1 file changed, 80 insertions(+), 157 deletions(-) diff --git a/doc/tools/help2doc b/doc/tools/help2doc index 2b48da28f..864f66222 100755 --- a/doc/tools/help2doc +++ b/doc/tools/help2doc @@ -1,160 +1,83 @@ -#!/bin/sh -# -# -# Script used to generate doc/book/config/cmdoptions.xml -# and hopefully other in the future. +#! /usr/bin/perl +use strict; +use warnings; -# Updated by option handlind via --elinks=path/to/elinks option -elinks="$1" -option="$2" +my ($elinks, $option) = @ARGV; -# Option handling {{{1 - -command= - -case "$option" in - *command*) - filter="sed 0,/^Options:/d" - option=--long-help - ;; - *config*) - filter="sed 0,/^Configuration/d" - option=--config-help - ;; -esac - -print_description_line() -{ - line="$1" - number="$2" - - case "$line" in - -eval*) - echo - ;; - *) - line="$(echo $line | sed 's,\(-touch-files\|-no-connect\|-session-ring\|-dump\|-default-mime-type\|text/html\|~/\.elinks\),\`\1\`,g')" - line=$(echo $line | sed "s,'\([^']*\)',\\\'\1\\\',") - line=$(echo $line | sed "s,ELinks,'ELinks',g") - line=$(echo $line | sed "s,HOME,'HOME',g") - line="$(echo $line | sed 's/^\([a-zA-Z]*([^)]*)\).*:/- \`\1\`:/')" - - if test -n "$number"; - then - echo -n " - $number:" - fi - esac - echo " $line" +if ($option =~ /command/) { + open my $pipe, "-|", $elinks, "--long-help" or die; + my $version = <$pipe>; + chomp $version; + $version =~ s/^ELinks ([-.\w]+).*$/$1/ or die "unusual version: $version"; + my $blank = 1; + while (<$pipe>) { + if (/^ {4}(-.*?) *$/) { + # ' -anonymous [0|1] (default: 0)' + # ' -config-dir <str> (default: "")' + $_ = $1; + s/ {2,}/ /g; + print "${_}::\n"; + } elsif (/^ {12}\t(-eval .*)$/) { + print "\n\t$1\n"; + } elsif (/^ {12}\t(\w+\(.*\)) +: (.*)$/) { + # ' openURL(URL, new-tab) : open URL in new tab' + print "\t- `$1`: $2\n"; + } elsif (/^ {12}\t(\d+) (means .+)$/) { + # ' 0 means only show serious errors' + print "\t- $1:\t$2\n"; + } elsif (s/^ {12}//) { + s/'([^']+)'/\\'$1\\'/g; + s((~/\.elinks|-dump|-default-mime-type|text/html|-touch-files|-no-connect|-session-ring))(`$1`)g; + s/(ELinks|HOME)/'$1'/g; + print "\t$_"; + } else { + print "\n" unless $blank; + $blank = 2; + } + $blank = ($blank == 2); + } + print "Generated using output from ELinks version $version.\n"; +} elsif ($option =~ /config/) { + open my $pipe, "-|", $elinks, "--config-help" or die; + my $version = <$pipe>; + chomp $version; + $version =~ s/^ELinks ([-.\w]+).*$/$1/ or die "unusual version: $version"; + my $blank = 1; + my $continued = 0; + while (<$pipe>) { + if (/^ {2}[^ ].*: \(([-.\w]+)\)$/) { + # ' Active link: (document.browse.links.active_link)' + print "$1::\n"; + } elsif (/^ {4}([^ ].*?)$/) { + # ' bookmarks.file_format <num> (default: 0)' + print "$1::\n"; + } elsif (/^ {12,}$/) { + print "+\n"; + $continued = 1; + } elsif (s/^ {12,}//) { + # escape things that might look like AsciiDoc markup + s/'(.*?)'/\\'$1\\'/g; + s/\{(.*?)\}/\\{$1\\}/g; + # add the actual AsciiDoc markup + s/(ELinks|WWW_HOME)/'$1'/g; + s((~/\.elinks))(`$1`)g; + if (/^(-?\d[-+\d]*?) +(.*)$/) { + # ' 1+ is use cookie's expiration date, but limit age to the given' + print "\t- $1:\t$2\n"; + } elsif ($continued) { + print "$_"; + } else { + print "\t$_"; + } + } else { + print "\n" unless $blank; + $blank = 2; + $continued = 0; + } + $blank = ($blank == 2); + } + print "Generated using output from ELinks version $version.\n"; +} else { + die "usage: $0 ELINKS-EXECUTABLE option-command.txt\n" + . " or: $0 ELINKS-EXECUTABLE option-config.txt\n"; } - -print_option_tree() -{ - title="$1" - path="$2" - echo "$path::" -} - -print_option_type() -{ - path="$1" - typeid="$2" - default="$3" - typestring="$path" - if test -n "$typeid" && test "$typeid" != "$path"; - then - if test "$typeid" = "(alias"; - then - typestring="$typestring ($default)" - default= - else - typestring="$typestring $typeid" - fi - fi - if test -n "$default" && test "$default" != "$path"; - then - typestring="$typestring ($default)" - fi - if test "$default" = "-?, -h, -help"; - then - typestring="$default" - fi - - echo "$typestring::" -} - - -# The main loop {{{1 - -# State variables -parse_description= -parse_int_option= -use_log= - -"$elinks" $option | $filter | while read line -do - if test -n "$parse_description" - then - # If the line is empty it is our clue that - # the desciption is over. - if test -z "$line" - then - echo - parse_description= - parse_int_option= - continue - fi - - line=`echo "$line" | sed -e "s/[ ]*(DISABLED)//"` - line=`echo "$line" | sed 's/\([{}]\)/\\\\\1/g'` - number= - if test -n "$parse_int_option"; - then - case "$line" in - -[0-9]*) - number="`echo $line | sed -e 's/\(-[0-9-]*\).*/\1/'`" - line=`echo "$line" | sed -e "s/$number[ ]*//"` - ;; - - [0-9]*) - number="`echo $line | sed -e 's/\([0-9-]*\).*/\1/'`" - line=`echo "$line" | sed -e "s/$number[ ]*//"` - ;; - esac - fi - - print_description_line "$line" "$number" - continue - fi - - case "$line" in - Features:*) - ;; - [A-Z]*:" ("*[a-z]*) - parse_description=1 - title="`echo $line | sed -e 's/\([A-Z]*\):.*/\1/'`" - path="`echo $line | sed -e 's/.*: (\([a-z_].*\))/\1/'`" - print_option_tree "$title" "$path" - ;; - - [a-z_-]*[.a-z_-]*) - parse_description=1 - path="`echo $line | sed -e 's/\([a-z-][^ ]*\).*/\1/'`" - typeid="`echo $line | sed -e 's/[ ]*[a-z-][^ ]* \([^ ]*\).*/\1/'`" - default="`echo \"$line\" | sed -e 's/[^(]*(\(.*\))/\1/'`" - print_option_type "$path" "$typeid" "$default" - if test "$typeid" = "<num>"; - then - parse_int_option=1 - fi - ;; - - *) - ;; - esac -done - -version="`$elinks -version | head -n 1 | sed -e 's/ELinks \([0-9][^ ]*\).*/\1/'`" -echo "Generated using output from ELinks version $version." - - -# vim: tabstop=4 shiftwidth=4