From a4a204a8fe12fca508bb02615ac2b7400587c5f0 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 23 Aug 2009 02:02:30 +1000 Subject: [PATCH 01/17] Miscellaneous help fixes. --- vimperator/locale/en-US/buffer.txt | 2 +- vimperator/locale/en-US/options.txt | 2 +- xulmus/locale/en-US/buffer.txt | 2 +- xulmus/locale/en-US/options.txt | 2 +- xulmus/locale/en-US/tutorial.txt | 251 ---------------------------- 5 files changed, 4 insertions(+), 255 deletions(-) delete mode 100644 xulmus/locale/en-US/tutorial.txt diff --git a/vimperator/locale/en-US/buffer.txt b/vimperator/locale/en-US/buffer.txt index 4a123e6a..8956b14a 100644 --- a/vimperator/locale/en-US/buffer.txt +++ b/vimperator/locale/en-US/buffer.txt @@ -375,4 +375,4 @@ the page's default style sheet is used. All author styling can be removed by setting the 'usermode' option. ________________________________________________________________________________ -// vim: set filetype=asciidoc fdm=marker: +// vim: set filetype=asciidoc: diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index 6ad909f9..6f57dff0 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -550,7 +550,7 @@ ____ |\'nomore'| |\'more'| ||'more'|| boolean (default: on) ____ -Pause the message list window when more than one screen of listings is displayed +Pause the message list window when more than one screen of listings is displayed. ____ diff --git a/xulmus/locale/en-US/buffer.txt b/xulmus/locale/en-US/buffer.txt index 59ccc8f7..0dfd8bd8 100644 --- a/xulmus/locale/en-US/buffer.txt +++ b/xulmus/locale/en-US/buffer.txt @@ -375,4 +375,4 @@ the page's default style sheet is used. All author styling can be removed by setting the 'usermode' option. ________________________________________________________________________________ -// vim: set filetype=asciidoc fdm=marker: +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/options.txt b/xulmus/locale/en-US/options.txt index e2f3ac7a..b30fb3a1 100644 --- a/xulmus/locale/en-US/options.txt +++ b/xulmus/locale/en-US/options.txt @@ -537,7 +537,7 @@ ____ |\'nomore'| |\'more'| ||'more'|| boolean (default: on) ____ -Pause the message list window when more than one screen of listings is displayed +Pause the message list window when more than one screen of listings is displayed. ____ diff --git a/xulmus/locale/en-US/tutorial.txt b/xulmus/locale/en-US/tutorial.txt deleted file mode 100644 index 257a5ab4..00000000 --- a/xulmus/locale/en-US/tutorial.txt +++ /dev/null @@ -1,251 +0,0 @@ -// Initial revision: Sun Jun 8 10:07:05 UTC 2008 (penryu) - -heading::Quick-start{nbsp}tutorial[tutorial] - -+++
+++ -*This is a quickstart tutorial to help get new users up and running in -Vimperator. It is not intended as a full reference explaining all features.* -+++
+++ - -If you've started using Vimperator from scratch (i.e., without any -customization), you should be looking at this help page in a relatively -bare-looking window. The menubar, navigation bar, and bookmark bars are hidden. -In case you missed the notice in the help:Introduction[intro.html], you can -regain these by issuing the command - -\{nbsp}[c]:set go+=mTB[c] - -where [m][m] represents pressing the or key. -If you're a veteran Vim user, this may look familiar. It should. - -However, in this author's opinion, the best way to get familiar with -Vimperator is to leave these disabled for now. (The above action can be -reversed with [c]:set go=[c]) You can look at the entry for 'guioptions' in -help:options[options.html] for more information on this. - -section::Vimperator's{nbsp}modal{nbsp}interface[modal] - -Vimperator's power, like Vim's, comes from it's modal interface. Keys have -different meanings depending on which mode the browser is in. Vimperator has -several modes, but the 2 most important are ``Normal'' mode and -``Command-line'' mode. - -When Vimperator starts, it is in Normal mode by default. This is probably where -you will spend the majority of your time. - -The other core mode of Vimperator, Command-line mode, can be entered from -Normal mode by typing a \'[m]:[m]' (colon). You will frequently see Vimperator -commands start with a \'[m]:[m]', indicating that what follows is a command. - -To return to Normal mode from Command-line mode, type [m][m]. Pressing -[m][m] will also return you to Normal mode from most other modes in -Vimperator. - -section::Getting{nbsp}help[getting-help] - -Vim is a great editor but it's not much of a web browser. So even seasoned Vim -users will probably have to look at Vimperator documentation sooner or later. -Most of the documentation for Vimperator's features are easily found using the -[c]:help[c] command. For example, you can find help on the [c]:help[c] command -by typing - -\{nbsp}[c]:help :help[c] - -Similarly, help on configurable options is available with [c]:help -'{option_name}'[c]. (Note the single quotes around the option name as in Vim.) -Information on all available options is, predictably, [c]:help options[c]. - -And you can find out about the [m]gt[m] and [m]gT[m] mapping with - -\{nbsp}[c]:help gt[c] + -\{nbsp}[c]:help gT[c] - -Finally, in addition to the help system itself, [c]:exusage[c], [c]:viusage[c] -and [c]:optionusage[c] are useful quick-reference commands. - -section::Mouseless[living-mouseless] - -*-- or how I learned to stop worrying and love the 80+ buttons I already have.* - -The efficiency of Vimperator, as with the legendary editor it was inspired by, -relies on the user being able to keep his fingers on the keyboard where they -can do the most good. While there are some areas where the mouse is clearly -superior at, such as GUI design or some games, Vimperator acts on the -assumption that a web browser doesn't have to be one of those. - -Here are some areas where the mouse is typically considered indisposable, and -how Vimperator challenges this preconception. - -section::Scrolling[keyboard-scrolling] - -Scrolling the browser window is done with simple keystrokes: - - * [m]j[m]/[m]k[m] -- - scroll window down/up by one line, respectively - * [m]h[m]/[m]l[m] -- - scroll window left/right - * [m][m]/[m][m] -- - scroll down/up by one page - * [m][m]/[m][m] -- - scroll down/up by 1/2 page - -Your standard buttons ([m][m]/[m][m]/[m][m]/[m][m]) will -also work as expected. - -section::History{nbsp}and{nbsp}tabs[history-navigation,tab-navigation] - -History navigation (e.g., ``Back'', ``Forward'') are done similarly to -scrolling. - - * [m][m]/[m][m] -- - move Back/Forward in the current window/tab's history, respectively - -Move between tabs using these keystrokes which may also be familiar to tabbing -Vimmers. - - * [m]gt[m]/[m][m] -- - go to the next tab - * [m]gT[m]/[m][m] -- - go to the previous tab - * [m]g0[m]/[m]g$[m] -- - go to the first/last tab - * [m]d[m] -- - close the active tab (delete the buffer) - -To open a web page in a new tab, use the [c]:tabopen {url}[c]. To open a URL in -the current tab, use [c]:open[c]. The Normal mode mappings [m]t[m] and [m]o[m], -respectively, map to these commands, so the following pairs of sequences are -equivalent: - -\{nbsp}[c]:open my.webmail.com[c] + -\{nbsp}[m]omy.webmail.com[m] - -\{nbsp}[c]:tabopen vimperator.org[c] + -\{nbsp}[m]tvimperator.org[m] - -section::Some{nbsp}hints{nbsp}about{nbsp}surfing...[hints-tutorial] - -So now you can navigate around in Vimperator. But wait... how do you *open* a -page or tab linked in a web page? How do you ``click'' on all those links -without your tailed friend? - -The answer is ``hints''. Activating hints displays a number next to every link -Vimperator can find. To follow the link, simply type the number corresponding -to the hint, a white number inside a red square by default. - -For text links, there's an additional shortcut; you can type some text -contained in the link and Vimperator will search all the links it can find and -only hint the matching links, further narrowing down the list. If the text you -type uniquely identifies any given link, Vimperator will follow that link -immediately without any further user input. - -Whichever way you choose to indicate your target link, once Vimperator has -highlighted the link you want, simply hit [m][m] to open it. - -The most common hint mode is called help:QuickHint{nbsp}mode[various.html,f]. -To activate QuickHint mode, press either [m]f[m] or [m]F[m]. The lower-case -[m]f[m] will open the resulting link in the current tab, while the upper-case -[m]F[m] will open it in a new tab. - -To test it, try this link: http://vimperator.org/[Vimperator Homepage]. -Activate QuickHint mode with [m]f[m] or [m]F[m] to highlight all currently -visible links. Then start typing the text of the link. The link should be -uniquely identified soon, and Vimperator will open it. Once you're done, -remember to use [m][m] (``History Back'') or [m]d[m] (``Delete Buffer'') -to return here, depending on which key you used to activate QuickHint mode. - -section::Common{nbsp}issues[common-issues] - -Say you get half-way done typing in a new URL, only to remember that you've -already got that page open in the previous tab. Your command line might look -something like this: - -\{nbsp}[c]:open my.partial.url/fooba[c] - -You can exit the command line and access the already loaded page with the -following: - -\{nbsp}[m]gT[m] - -section::Saving{nbsp}for{nbsp}posterity{nbsp}-{nbsp}vimperatorrc[vimperatorrc] - -Once you get Vimperator set up with your desired options, maps, and commands, -you'll probably want them to be available the next time you open Vimperator. -Continuing the Vim theme, this is done with a vimperatorrc file. - -To save your current settings and allow them to be loaded automatically -next time you start Vimperator, issue the [c]:mkv[c] command. - -This will create the file *_$HOME_/.vimperatorrc* containing your settings. -It is a simple text file, just like a vimrc file and can be easily -edited to suit your preferences. - -section::Find{nbsp}the{nbsp}exit{nbsp}nearest{nbsp}you[quitting-without-menus] - -Vimperator supports all of Vim's classic methods of exiting. - - * [c]:xall[c] -- command to quit and save the current browsing - session for next time; the default. - * [c]:qall[c] -- command to quit _without_ saving the session - * [m]ZZ[m] -- Normal mode mapping equivalent to [c]:xall[c] - * [m]ZQ[m] -- Normal mode mapping equivalent to [c]:qall[c] - -section::Where{nbsp}did{nbsp}Firefox{nbsp}go?[whither-firefox] - -You might feel pretty disoriented now. Don't worry. This is still Firefox -underneath. Here are some ways Vimperator allows Firefox to shine through. See -the [c]:help[c] for these commands and mappings for more information on how to -make the best use of them. - - * [c]:dialog[c] -- - To access some of Firefox's many dialog windows, you can use the - [c]:dialog[c] command. See [c]:help :dialog[c]. - * [c]:bmarks[c] -- - Vimperator provides a new interface to bookmarks, but they're still your - standard Firefox bookmarks under the hood. [c]:bmark[c] will add a new - bookmark, while [c]:bmarks[c] will list the bookmarks currently defined. - * [c]:history[c] -- - It's exactly what it sounds like. This command will display a colorized, - scrollable and clickable list of the locations in Vimperator's history. - * [c]:emenu[c] -- - Access the Firefox menus through the Vimperator command line. - - -Feel free to explore at this point. If you use the [c]:tabopen[c] command, -remember to use the [m]gt[m]/[m]gT[m] mappings to get back to this page. If -using the [c]:open[c] command, use the history keys (e.g., [m]H[m]) to return. -If you get hopelessly lost, just type [c]:help[c] and click the -``Tutorial'' link to return. - - -// TODO: other sections? - - -section::Get{nbsp}me{nbsp}out{nbsp}of{nbsp}here![removal] - -If you've given it a fair shot and determined ... TODO - -The Vimperator way to do this is with the command [c]:addons[c]. Issuing this -command brings up the Firefox Add-ons dialog window; you can then remove it as -normal, selecting Vimperator from the list and clicking (yes, clicking) -*Uninstall*. - -Alternatively, you can do this the old-fashioned way: re-enable the menubar, -as above, with [c]:set go+=m[c], and select *Add-ons* from the *Tools* menu. - - -section::I'm{nbsp}interested...but{nbsp}lost![support] - -Vimperator has an energetic and growing user base. If you've run into a problem -that you can't seem to solve with Vimperator, or if you think you might have -found a bug, please let us know! There is support available on the -http://vimperator.cutup.org/index.php?title=Main_Page[wiki], or in the -#vimperator IRC channel on http://freenode.net/[freenode]. - -If you have any feature requests or (even better) offers to help, we'd love to -hear from you as well. Developers work on Vimperator whenever possible, but we -are neither infinite nor omnipotent; please bear with us. If you can't wait for -us to get around to it, rest assured patches are welcome! See the -help:Developer[developer.html] page for more information. - -// vim: set filetype=asciidoc: From e159a0d07d327df38ab439d74a85724169d91589 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 23 Aug 2009 17:39:13 +1000 Subject: [PATCH 02/17] Add :verbose. --- common/content/liberator.js | 24 ++++++++++++++++++++ muttator/contrib/vim/syntax/muttator.vim | 6 ++--- vimperator/NEWS | 1 + vimperator/contrib/vim/syntax/vimperator.vim | 6 ++--- vimperator/locale/en-US/index.txt | 1 + vimperator/locale/en-US/various.txt | 9 ++++++++ xulmus/contrib/vim/syntax/xulmus.vim | 6 ++--- xulmus/locale/en-US/index.txt | 1 + xulmus/locale/en-US/various.txt | 8 +++++++ 9 files changed, 53 insertions(+), 9 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index 2a4007bb..c7ebadc9 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -794,6 +794,30 @@ const liberator = (function () //{{{ literal: 0 }); + commands.add(["verb[ose]"], + "Execute a command with 'verbose' set", + function (args) + { + let vbs = options.get("verbose"); + let value = vbs.value; + + try + { + vbs.set(args.count > -1 ? args.count : 1); + liberator.execute(args[0], null, true); + } + finally + { + vbs.set(value); + } + }, + { + argCount: "+", + completer: function (context) completion.ex(context), + count: true, + literal: 0 + }); + commands.add(["ve[rsion]"], "Show version information", function (args) diff --git a/muttator/contrib/vim/syntax/muttator.vim b/muttator/contrib/vim/syntax/muttator.vim index e17d536a..533ada2d 100644 --- a/muttator/contrib/vim/syntax/muttator.vim +++ b/muttator/contrib/vim/syntax/muttator.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Muttator configuration file " Maintainer: Doug Kearns -" Last Change: 2009 Aug 3 +" Last Change: 2009 Aug 23 " TODO: make this muttator specific - shared liberator config? @@ -31,8 +31,8 @@ syn keyword muttatorCommand ab[breviate] ab[clear] addo[ns] addr[essbook] bN[ext \ pas pc[lose] pl[ay] pref[erences] prefs pw[d] q[uit] re[load] res[tart] run runt[ime] sav[eas] scrip[tnames] se[t] \ setg[lobal] setl[ocal] sil[ent] so[urce] st[op] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabfir[st] \ tabl[ast] tabn[ext] tabp[revious] tabr[ewind] tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] - \ toolbart[oggle] tp[revious] una[bbreviate] unl[et] unm[ap] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] vno[remap] - \ vu[nmap] w[rite] zo[om] + \ toolbart[oggle] tp[revious] una[bbreviate] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] + \ vno[remap] vu[nmap] w[rite] zo[om] \ contained syn match muttatorCommand "!" contained diff --git a/vimperator/NEWS b/vimperator/NEWS index 19285553..1cbaa6a0 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -19,6 +19,7 @@ (this might change again, as this is REALLY inconsistent, and i don't know if I like copying bugs) + * add [c]:verbose[c] * add [c]:window[c] to run a command in a new window * add ! version of :delbmarks to delete all bookmarks. * new "t" option for 'complete' to also switch to open tabs with :open diff --git a/vimperator/contrib/vim/syntax/vimperator.vim b/vimperator/contrib/vim/syntax/vimperator.vim index e418707d..feea52d9 100644 --- a/vimperator/contrib/vim/syntax/vimperator.vim +++ b/vimperator/contrib/vim/syntax/vimperator.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: VIMperator configuration file " Maintainer: Doug Kearns -" Last Change: 2009 Aug 10 +" Last Change: 2009 Aug 23 " TODO: make this vimperator specific - shared liberator config? @@ -33,8 +33,8 @@ syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] b \ sideb[ar] sil[ent] so[urce] st[op] stopa[ll] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabde[tach] \ tabdu[plicate] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs \ tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] - \ undoa[ll] unl[et] unm[ap] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vu[nmap] w[rite] wc[lose] win[open] - \ winc[lose] wind[ow] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] + \ undoa[ll] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vu[nmap] w[rite] wc[lose] + \ win[open] winc[lose] wind[ow] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] \ contained syn match vimperatorCommand "!" contained diff --git a/vimperator/locale/en-US/index.txt b/vimperator/locale/en-US/index.txt index 7ce9cb55..c5849a88 100644 --- a/vimperator/locale/en-US/index.txt +++ b/vimperator/locale/en-US/index.txt @@ -268,6 +268,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:undoall[c]|| Undo closing of all closed tabs + ||[c]:unlet[c]|| Delete a variable + ||[c]:unmap[c]|| Remove a mapping + +||[c]:verbose[c]|| Execute a command with 'verbose' set + ||[c]:version[c]|| Show version information + ||[c]:viewsource[c]|| View source code of current document + ||[c]:viusage[c]|| List all mappings with a short description + diff --git a/vimperator/locale/en-US/various.txt b/vimperator/locale/en-US/various.txt index 71dbeba2..4ecaa92f 100644 --- a/vimperator/locale/en-US/various.txt +++ b/vimperator/locale/en-US/various.txt @@ -15,6 +15,7 @@ ________________________________________________________________________________ Redraws the screen. Useful to update the screen halfway executing a script or function. ________________________________________________________________________________ + |:norm| |:normal| ||:norm[al][!] {commands}|| + ________________________________________________________________________________ @@ -55,6 +56,14 @@ history. ________________________________________________________________________________ +|:verb| |:verbose + +||:[count]verb[ose] {command}|| +________________________________________________________________________________ +Execute a command with 'verbose' set to [count]. If [count] is not specified +then 1 is used as the value. +________________________________________________________________________________ + + |:ve| |:version| + ||:ve[rsion][!]|| ________________________________________________________________________________ diff --git a/xulmus/contrib/vim/syntax/xulmus.vim b/xulmus/contrib/vim/syntax/xulmus.vim index 445e0b24..3e9a6f39 100644 --- a/xulmus/contrib/vim/syntax/xulmus.vim +++ b/xulmus/contrib/vim/syntax/xulmus.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Xulmus configuration file " Maintainer: Doug Kearns -" Last Change: 2009 Aug 3 +" Last Change: 2009 Aug 23 " TODO: make this xulmus specific - shared liberator config? @@ -35,8 +35,8 @@ syn keyword xulmusCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck \ so[urce] st[op] stopa[ll] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabde[tach] tabdu[plicate] tabe[dit] \ tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs tbh[ide] tbs[how] \ tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] - \ unm[ap] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vol[ume] vu[nmap] w[rite] wc[lose] win[open] - \ winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] + \ unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vol[ume] vu[nmap] w[rite] wc[lose] + \ win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] \ contained syn match xulmusCommand "!" contained diff --git a/xulmus/locale/en-US/index.txt b/xulmus/locale/en-US/index.txt index 5daf8f8c..3a929f5e 100644 --- a/xulmus/locale/en-US/index.txt +++ b/xulmus/locale/en-US/index.txt @@ -314,6 +314,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:undoall[c]|| Undo closing of all closed tabs + ||[c]:unlet[c]|| Delete a variable + ||[c]:unmap[c]|| Remove a mapping + +||[c]:verbose[c]|| Execute a command with 'verbose' set + ||[c]:version[c]|| Show version information + ||[c]:viewsource[c]|| View source code of current document + ||[c]:viusage[c]|| List all mappings with a short description + diff --git a/xulmus/locale/en-US/various.txt b/xulmus/locale/en-US/various.txt index e5197512..95d34861 100644 --- a/xulmus/locale/en-US/various.txt +++ b/xulmus/locale/en-US/various.txt @@ -55,6 +55,14 @@ history. ________________________________________________________________________________ +|:verb| |:verbose + +||:[count]verb[ose] {command}|| +________________________________________________________________________________ +Execute a command with 'verbose' set to [count]. If [count] is not specified +then 1 is used as the value. +________________________________________________________________________________ + + |:ve| |:version| + ||:ve[rsion][!]|| ________________________________________________________________________________ From 08ecc21277d58a65a8662a18a2e97f2ff32721ef Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 25 Aug 2009 00:30:57 +1000 Subject: [PATCH 03/17] Remove some commented-out code from :unlet action. --- common/content/options.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/common/content/options.js b/common/content/options.js index 5565e288..d18740e8 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -891,11 +891,6 @@ function Options() //{{{ "Delete a variable", function (args) { - //let names = args.split(/ /); - //if (typeof names == "string") names = [names]; - - //let length = names.length; - //for (let i = 0, name = names[i]; i < length; name = names[++i]) for (let [,name] in args) { let reference = liberator.variableReference(name); From c56a1ed77b556bef0f21cd1cebf0c7972b752885 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 25 Aug 2009 20:02:27 +1000 Subject: [PATCH 04/17] Fix typo in liberator.commandlineOptions definition. --- common/content/liberator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index c7ebadc9..0a211843 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -986,9 +986,9 @@ const liberator = (function () //{{{ /** @property An RC file to use rather than the default. */ rcFile: null, /** @property An Ex command to run before any initialization is performed. */ - preCommand: null, + preCommands: null, /** @property An Ex command to run after all initialization has been performed. */ - postCommand: null + postCommands: null }, registerObserver: registerObserver, From 5f6405be03439666be470aeb3bcabef75814b621 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 25 Aug 2009 20:05:41 +1000 Subject: [PATCH 05/17] Add support for verbose :set querying of options. Querying of commands, autocommands, mappings, abbreviations, highlight groups, and styles should also be supported. --- common/content/commands.js | 2 +- common/content/io.js | 16 +++++++--------- common/content/liberator.js | 1 + common/content/options.js | 37 +++++++++++++++++++++++++++---------- 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index e9ffeaa3..1a696b0e 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -204,7 +204,7 @@ Command.prototype = { return; args.count = count; args.bang = bang; - self.action.call(self, args, bang, count, modifiers); + self.action.call(self, args, modifiers); } if (this.hereDoc) diff --git a/common/content/io.js b/common/content/io.js index 94645256..262f200f 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -1028,13 +1028,15 @@ lookup: let heredocEnd = null; // the string which ends the heredoc let lines = str.split(/\r\n|[\r\n]/); + function execute(args) { command.execute(args, special, count, { setFrom: file }); } + for (let [i, line] in Iterator(lines)) { if (heredocEnd) // we already are in a heredoc { if (heredocEnd.test(line)) { - command.execute(heredoc, special, count); + execute(heredoc); heredoc = ""; heredocEnd = null; } @@ -1079,15 +1081,11 @@ lookup: heredocEnd = RegExp("^" + matches[2] + "$", "m"); if (matches[1]) heredoc = matches[1] + "\n"; + continue; } - else - command.execute(args, special, count); - } - else - { - // execute a normal liberator command - liberator.execute(line, null, true); } + + execute(args); } } } @@ -1095,7 +1093,7 @@ lookup: // if no heredoc-end delimiter is found before EOF then // process the heredoc anyway - Vim compatible ;-) if (heredocEnd) - command.execute(heredoc, special, count); + execute(heredoc); } if (scriptNames.indexOf(file.path) == -1) diff --git a/common/content/liberator.js b/common/content/liberator.js index 0a211843..26d86046 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -804,6 +804,7 @@ const liberator = (function () //{{{ try { vbs.set(args.count > -1 ? args.count : 1); + vbs.setFrom = null; liberator.execute(args[0], null, true); } finally diff --git a/common/content/options.js b/common/content/options.js index d18740e8..0d296c5b 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -111,12 +111,18 @@ function Option(names, description, type, defaultValue, extraInfo) //{{{ * @see #has */ this.checkHas = extraInfo.checkHas || null; + /** * @property {boolean} Set to true whenever the option is first set. This * is useful to see whether it was changed from its default value * interactively or by some RC file. */ this.hasChanged = false; + /** + * @property {nsIFile} The script in which this option was last set. null + * implies an interactive command. + */ + this.setFrom = null; // add no{option} variant of boolean {option} to this.names if (this.type == "boolean") @@ -572,6 +578,7 @@ function Options() //{{{ } if (name == "all" && reset) + // TODO: Why? --djk liberator.echoerr("You can't reset all options, it could make " + config.hostApplication + " unusable."); else if (name == "all") options.listPrefs(onlyNonDefault, ""); @@ -620,7 +627,10 @@ function Options() //{{{ option.reset(); } else + { + option.setFrom = modifiers.setFrom || null; option.reset(); + } } // read access else if (opt.get) @@ -630,9 +640,15 @@ function Options() //{{{ else { if (option.type == "boolean") - liberator.echo((opt.optionValue ? " " : "no") + option.name); + var msg = (opt.optionValue ? " " : "no") + option.name; else - liberator.echo(" " + option.name + "=" + opt.optionValue); + msg = " " + option.name + "=" + opt.optionValue; + + if (options["verbose"] > 0 && option.setFrom) + msg += "\n Last set from " + option.setFrom.path; + + // FIXME: Message highlight group wrapping messes up the indent up for multi-arg verbose :set queries + liberator.echo({msg}); } } // write access @@ -640,6 +656,8 @@ function Options() //{{{ // improved. i.e. Vim's behavior is pretty sloppy to no real benefit else { + option.setFrom = modifiers.setFrom || null; + if (opt.option.type == "boolean") { if (opt.valueGiven) @@ -832,9 +850,10 @@ function Options() //{{{ commands.add(["setl[ocal]"], "Set local option", - function (args) + function (args, modifiers) { - return setAction(args, { scope: options.OPTION_SCOPE_LOCAL }); + modifiers.scope = options.OPTION_SCOPE_LOCAL; + setAction(args, modifiers); }, { bang: true, @@ -849,9 +868,10 @@ function Options() //{{{ commands.add(["setg[lobal]"], "Set global option", - function (args) + function (args, modifiers) { - return setAction(args, { scope: options.OPTION_SCOPE_GLOBAL }); + modifiers.scope = options.OPTION_SCOPE_GLOBAL; + setAction(args, modifiers); }, { bang: true, @@ -866,10 +886,7 @@ function Options() //{{{ commands.add(["se[t]"], "Set an option", - function (args) - { - return setAction(args); - }, + function (args, modifiers) { setAction(args, modifiers); }, { bang: true, completer: function (context, args) From c9586163372a4afdb77816bdd6f6e80bbbf57634 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 25 Aug 2009 20:33:35 +1000 Subject: [PATCH 06/17] Formatting fixes. --- common/content/bookmarks.js | 8 +++--- common/content/buffer.js | 12 ++++----- common/content/commands.js | 12 ++++----- common/content/completion.js | 10 +++---- common/content/editor.js | 12 ++++----- common/content/events.js | 14 +++++----- common/content/hints.js | 46 ++++++++++++++++----------------- common/content/io.js | 14 +++++----- common/content/liberator.js | 18 ++++++------- common/content/mappings.js | 12 ++++----- common/content/options.js | 8 +++--- common/content/style.js | 6 ++--- common/content/tabs.js | 2 +- common/content/ui.js | 2 +- common/content/util.js | 8 +++--- muttator/content/addressbook.js | 2 +- muttator/content/mail.js | 2 +- vimperator/content/config.js | 2 +- vimperator/regressions.js | 2 +- xulmus/content/library.js | 4 +-- xulmus/content/player.js | 2 +- 21 files changed, 99 insertions(+), 99 deletions(-) diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index ed10dc1c..4d5a050c 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -92,9 +92,9 @@ function Bookmarks() //{{{ this.__defineGetter__("bookmarks", function () this.load()); this.__defineGetter__("keywords", - function () [new Keyword(k.keyword, k.title, k.icon, k.url) for ([,k] in Iterator(self.bookmarks)) if (k.keyword)]); + function () [new Keyword(k.keyword, k.title, k.icon, k.url) for ([, k] in Iterator(self.bookmarks)) if (k.keyword)]); - this.__iterator__ = function () (val for ([,val] in Iterator(self.bookmarks))); + this.__iterator__ = function () (val for ([, val] in Iterator(self.bookmarks))); function loadBookmark(node) { @@ -502,7 +502,7 @@ function Bookmarks() //{{{ let engine = services.get("browserSearch").getEngineByAlias(name); if (!engine) return; - let [,word] = /^\s*(\S+)/.exec(context.filter) || []; + let [, word] = /^\s*(\S+)/.exec(context.filter) || []; if (!kludge && word == name) // FIXME: Check for matching keywords return; let ctxt = context.fork(name, 0); @@ -654,7 +654,7 @@ function Bookmarks() //{{{ getSearchEngines: function getSearchEngines() { let searchEngines = []; - for (let [,engine] in Iterator(services.get("browserSearch").getVisibleEngines({}))) + for (let [, engine] in Iterator(services.get("browserSearch").getVisibleEngines({}))) { let alias = engine.alias; if (!alias || !/^[a-z0-9_-]+$/.test(alias)) diff --git a/common/content/buffer.js b/common/content/buffer.js index 95ca70fe..56186b3b 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -774,7 +774,7 @@ function Buffer() //{{{ // put feeds rss into pageFeeds[] let nFeed = 0; - for (let [,link] in Iterator(doc.getElementsByTagName("link"))) + for (let [, link] in Iterator(doc.getElementsByTagName("link"))) { if (!link.href) return; @@ -1167,7 +1167,7 @@ function Buffer() //{{{ // TODO: this should probably use the default 'hinttags' value. --djk let res = buffer.evaluateXPath(options["hinttags"], frame.document); - for (let [,regex] in Iterator(regexes)) + for (let [, regex] in Iterator(regexes)) { for (let i in util.range(res.snapshotLength, 0, -1)) { @@ -1697,7 +1697,7 @@ function Marks() //{{{ function localMarkIter() { for (let [mark, value] in localMarks) - for (let [,val] in Iterator(value)) + for (let [, val] in Iterator(value)) yield [mark, val]; } @@ -1825,7 +1825,7 @@ function Marks() //{{{ // FIXME: Line/Column doesn't make sense with % context.title = ["Mark", "Line Column File"]; - context.keys.description = function ([,m]) percent(m.position.y) + "% " + percent(m.position.x) + "% " + m.location; + context.keys.description = function ([, m]) percent(m.position.y) + "% " + percent(m.position.x) + "% " + m.location; context.completions = marks.all; }; @@ -1965,7 +1965,7 @@ function Marks() //{{{ let win = window.content; let slice = localMarks.get(mark) || []; - for (let [,lmark] in Iterator(slice)) + for (let [, lmark] in Iterator(slice)) { if (win.location.href == lmark.location) { @@ -2006,7 +2006,7 @@ function Marks() //{{{ Math.round(mark[1].position.x * 100) + "%", Math.round(mark[1].position.y * 100) + "%", mark[1].location] - for ([,mark] in Iterator(marks)))); + for ([, mark] in Iterator(marks)))); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); } diff --git a/common/content/commands.js b/common/content/commands.js index 1a696b0e..4b7b005c 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -71,7 +71,7 @@ function Command(specs, description, action, extraInfo) //{{{ let longNames = []; let shortNames = []; - for (let [,spec] in Iterator(specs)) + for (let [, spec] in Iterator(specs)) { let matches = spec.match(/(\w+)\[(\w+)\](\w*)/); @@ -229,7 +229,7 @@ Command.prototype = { */ hasName: function (name) { - for (let [,spec] in Iterator(this.specs)) + for (let [, spec] in Iterator(this.specs)) { let fullName = spec.replace(/\[(\w+)]$/, "$1"); let index = spec.indexOf("["); @@ -515,7 +515,7 @@ function Commands() //{{{ opt += char + quote(val) res.push(opt); } - for (let [,arg] in Iterator(args.arguments || [])) + for (let [, arg] in Iterator(args.arguments || [])) res.push(quote(arg)); let str = args.literalArg; @@ -712,9 +712,9 @@ function Commands() //{{{ var optname = ""; if (!onlyArgumentsRemaining) { - for (let [,opt] in Iterator(options)) + for (let [, opt] in Iterator(options)) { - for (let [,optname] in Iterator(opt[0])) + for (let [, optname] in Iterator(opt[0])) { if (sub.indexOf(optname) == 0) { @@ -1107,7 +1107,7 @@ function Commands() //{{{ cmd.count ? "0c" : "", completerToString(cmd.completer), cmd.replacementText || "function () { ... }"] - for ([,cmd] in Iterator(cmds)))); + for ([, cmd] in Iterator(cmds)))); commandline.echo(str, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); } diff --git a/common/content/completion.js b/common/content/completion.js index 5c3e237f..b3459773 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -527,7 +527,7 @@ CompletionContext.prototype = { cancelAll: function () { - for (let [,context] in Iterator(this.contextList)) + for (let [, context] in Iterator(this.contextList)) { if (context.cancel) context.cancel(); @@ -1006,7 +1006,7 @@ function Completion() //{{{ // Find any complete statements that we can eval before we eval our object. // This allows for things like: let doc = window.content.document; let elem = doc.createElement...; elem. let prev = 0; - for (let [,v] in Iterator(get(0)[FULL_STATEMENTS])) + for (let [, v] in Iterator(get(0)[FULL_STATEMENTS])) { let key = str.substring(prev, v + 1); if (checkFunction(prev, v, key)) @@ -1123,14 +1123,14 @@ function Completion() //{{{ } // TODO: Make this a generic completion helper function. let filter = key + (string || ""); - for (let [,obj] in Iterator(objects)) + for (let [, obj] in Iterator(objects)) { this.context.fork(obj[1], top[OFFSET], this, fill, obj[0], obj[1], compl, compl != orig, filter, last, key.length); } if (orig) return; - for (let [,obj] in Iterator(objects)) + for (let [, obj] in Iterator(objects)) { obj[1] += " (substrings)"; this.context.fork(obj[1], top[OFFSET], this, fill, @@ -1283,7 +1283,7 @@ function Completion() //{{{ setFunctionCompleter: function setFunctionCompleter(funcs, completers) { funcs = Array.concat(funcs); - for (let [,func] in Iterator(funcs)) + for (let [, func] in Iterator(funcs)) { func.liberatorCompleter = function liberatorCompleter(context, func, obj, args) { let completer = completers[args.length - 1]; diff --git a/common/content/editor.js b/common/content/editor.js index ed0083fe..e4b0f134 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -78,12 +78,12 @@ function Editor() //{{{ let keyword = "[^" + nonkw + "]"; let nonkeyword = "[" + nonkw + "]"; - let full_id = keyword + "+"; - let end_id = nonkeyword + "+" + keyword; - let non_id = "\\S*" + nonkeyword; + let fullId = keyword + "+"; + let endId = nonkeyword + "+" + keyword; + let nonId = "\\S*" + nonkeyword; // Used in addAbbrevation and expandAbbreviation - var abbrevmatch = full_id + "|" + end_id + "|" + non_id; + var abbrevmatch = fullId + "|" + endId + "|" + nonId; function getEditor() liberator.focus; @@ -186,7 +186,7 @@ function Editor() //{{{ function abbrevs() { for (let [lhs, abbr] in Iterator(abbreviations)) - for (let [,rhs] in Iterator(abbr)) + for (let [, rhs] in Iterator(abbr)) yield [lhs, rhs]; } @@ -206,7 +206,7 @@ function Editor() //{{{ liberator.echoerr("E474: Invalid argument"); return false; } - let [,lhs,rhs] = matches; + let [, lhs, rhs] = matches; if (rhs) editor.addAbbreviation(mode, lhs, rhs); else diff --git a/common/content/events.js b/common/content/events.js index 2785d0fc..f2ab0853 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -306,7 +306,7 @@ function AutoCommands() //{{{ let lastPattern = null; let url = args.url || ""; - for (let [,autoCmd] in Iterator(autoCmds)) + for (let [, autoCmd] in Iterator(autoCmds)) { if (autoCmd.pattern.test(url)) { @@ -472,7 +472,7 @@ function Events() //{{{ if (k in keyTable) names = keyTable[k]; code_key[v] = names[0]; - for (let [,name] in Iterator(names)) + for (let [, name] in Iterator(names)) key_code[name.toLowerCase()] = v; } @@ -581,7 +581,7 @@ function Events() //{{{ if (dirs.length > 0) { - for (let [,dir] in Iterator(dirs)) + for (let [, dir] in Iterator(dirs)) { liberator.echomsg('Searching for "macros/*" in "' + dir.path + '"', 2); @@ -882,7 +882,7 @@ function Events() //{{{ { liberator.threadYield(1, true); - for (let [,evt_obj] in Iterator(events.fromString(keys))) + for (let [, evt_obj] in Iterator(events.fromString(keys))) { let elem = liberator.focus || window.content; let evt = events.create(doc, "keypress", evt_obj); @@ -922,7 +922,7 @@ function Events() //{{{ { let duringFeed = this.duringFeed; this.duringFeed = []; - for (let [,evt] in Iterator(duringFeed)) + for (let [, evt] in Iterator(duringFeed)) evt.target.dispatchEvent(evt); } } @@ -1021,8 +1021,8 @@ function Events() //{{{ while (match = re.exec(input)) { let evt_str = match[0]; - let evt_obj = {ctrlKey:false, shiftKey:false,altKey:false, metaKey: false, - keyCode: 0, charCode: 0, type: "keypress"}; + let evt_obj = { ctrlKey: false, shiftKey: false, altKey: false, metaKey: false, + keyCode: 0, charCode: 0, type: "keypress" }; if (evt_str.length > 1) // <.*?> { diff --git a/common/content/hints.js b/common/content/hints.js index eb97007e..d54fd9d4 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -66,26 +66,26 @@ function Hints() //{{{ function images() "//img | //xhtml:img"; const hintModes = { - ";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended), - "?": Mode("Show information for hint", function (elem) buffer.showElementInfo(elem), extended), - s: Mode("Save hint", function (elem) buffer.saveLink(elem, true)), - a: Mode("Save hint with prompt", function (elem) buffer.saveLink(elem, false)), - f: Mode("Focus frame", function (elem) elem.ownerDocument.defaultView.focus(), function () "//body | //xhtml:body"), - o: Mode("Follow hint", function (elem) buffer.followLink(elem, liberator.CURRENT_TAB)), - t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, liberator.NEW_TAB)), - b: Mode("Follow hint in a background tab", function (elem) buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB)), - w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended), - F: Mode("Open multiple hints in tabs", followAndReshow), - O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)), - T: Mode("Generate a ':tabopen URL' using hint",function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)), - W: Mode("Generate a ':winopen URL' using hint",function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)), - v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended), - V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended), - y: Mode("Yank hint location", function (elem, loc) util.copyToClipboard(loc, true)), - Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended), - c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended), - i: Mode("Show image", function (elem) liberator.open(elem.src), images), - I: Mode("Show image in a new tab", function (elem) liberator.open(elem.src, liberator.NEW_TAB), images) + ";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended), + "?": Mode("Show information for hint", function (elem) buffer.showElementInfo(elem), extended), + s: Mode("Save hint", function (elem) buffer.saveLink(elem, true)), + a: Mode("Save hint with prompt", function (elem) buffer.saveLink(elem, false)), + f: Mode("Focus frame", function (elem) elem.ownerDocument.defaultView.focus(), function () "//body | //xhtml:body"), + o: Mode("Follow hint", function (elem) buffer.followLink(elem, liberator.CURRENT_TAB)), + t: Mode("Follow hint in a new tab", function (elem) buffer.followLink(elem, liberator.NEW_TAB)), + b: Mode("Follow hint in a background tab", function (elem) buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB)), + w: Mode("Follow hint in a new window", function (elem) buffer.followLink(elem, liberator.NEW_WINDOW), extended), + F: Mode("Open multiple hints in tabs", followAndReshow), + O: Mode("Generate an ':open URL' using hint", function (elem, loc) commandline.open(":", "open " + loc, modes.EX)), + T: Mode("Generate a ':tabopen URL' using hint", function (elem, loc) commandline.open(":", "tabopen " + loc, modes.EX)), + W: Mode("Generate a ':winopen URL' using hint", function (elem, loc) commandline.open(":", "winopen " + loc, modes.EX)), + v: Mode("View hint source", function (elem, loc) buffer.viewSource(loc, false), extended), + V: Mode("View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true), extended), + y: Mode("Yank hint location", function (elem, loc) util.copyToClipboard(loc, true)), + Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended), + c: Mode("Open context menu", function (elem) buffer.openContextMenu(elem), extended), + i: Mode("Show image", function (elem) liberator.open(elem.src), images), + I: Mode("Show image in a new tab", function (elem) liberator.open(elem.src, liberator.NEW_TAB), images) }; /** @@ -163,7 +163,7 @@ function Hints() //{{{ return [elem.value, false]; else { - for (let [,option] in Iterator(options["hintinputs"].split(","))) + for (let [, option] in Iterator(options["hintinputs"].split(","))) { if (option == "value") { @@ -435,7 +435,7 @@ function Hints() //{{{ setClass(imgspan, activeHint == hintnum); } - span.setAttribute("number", showtext ? hintnum + ": " + text.substr(0,50): hintnum); + span.setAttribute("number", showtext ? hintnum + ": " + text.substr(0, 50) : hintnum); if (imgspan) imgspan.setAttribute("number", hintnum); else @@ -712,7 +712,7 @@ function Hints() //{{{ function stringsAtBeginningOfWords(strings, words, allowWordOverleaping) { let strIdx = 0; - for (let [,word] in Iterator(words)) + for (let [, word] in Iterator(words)) { if (word.length == 0) continue; diff --git a/common/content/io.js b/common/content/io.js index 262f200f..19dd89c4 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -45,7 +45,7 @@ function Script(file) this.__context__ = this; // This belongs elsewhere - for (let [,dir] in Iterator(io.getRuntimeDirectories("plugin"))) + for (let [, dir] in Iterator(io.getRuntimeDirectories("plugin"))) { if (dir.contains(file, false)) plugins[this.NAME] = this; @@ -230,7 +230,7 @@ function IO() //{{{ let dirs = getPathsFromPathList(options["cdpath"]); let found = false; - for (let [,dir] in Iterator(dirs)) + for (let [, dir] in Iterator(dirs)) { dir = joinPaths(dir, arg); @@ -467,7 +467,7 @@ function IO() //{{{ let dirNames = services.get("environment").get("PATH").split(RegExp(liberator.has("Win32") ? ";" : ":")); let commands = []; - for (let [,dirName] in Iterator(dirNames)) + for (let [, dirName] in Iterator(dirNames)) { let dir = io.getFile(dirName); if (dir.exists() && dir.isDirectory()) @@ -884,7 +884,7 @@ function IO() //{{{ dirs = [io.getCurrentDirectory().path].concat(dirs); lookup: - for (let [,dir] in Iterator(dirs)) + for (let [, dir] in Iterator(dirs)) { file = joinPaths(dir, program); try @@ -897,7 +897,7 @@ lookup: if (WINDOWS) { let extensions = services.get("environment").get("PATHEXT").split(";"); - for (let [,extension] in Iterator(extensions)) + for (let [, extension] in Iterator(extensions)) { file = joinPaths(dir, program + extension); if (file.exists()) @@ -942,9 +942,9 @@ lookup: liberator.echomsg("Searching for \"" + paths.join(" ") + "\" in \"" + options["runtimepath"] + "\"", 2); outer: - for (let [,dir] in Iterator(dirs)) + for (let [, dir] in Iterator(dirs)) { - for (let [,path] in Iterator(paths)) + for (let [, path] in Iterator(paths)) { let file = joinPaths(dir, path); diff --git a/common/content/liberator.js b/common/content/liberator.js index 26d86046..51fae2a9 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -111,7 +111,7 @@ const liberator = (function () //{{{ { function addChildren(node, parent) { - for (let [,item] in Iterator(node.childNodes)) + for (let [, item] in Iterator(node.childNodes)) { if (item.childNodes.length == 0 && item.localName == "menuitem" && !/rdf:http:/.test(item.getAttribute("label"))) // FIXME @@ -163,7 +163,7 @@ const liberator = (function () //{{{ opts: config.guioptions, setter: function (opts) { - for (let [opt, [,ids]] in Iterator(this.opts)) + for (let [opt, [, ids]] in Iterator(this.opts)) { ids.map(function (id) document.getElementById(id)) .forEach(function (elem) @@ -220,7 +220,7 @@ const liberator = (function () //{{{ { setter: function (value) { - for (let [,group] in Iterator(groups)) + for (let [, group] in Iterator(groups)) group.setter(value); return value; }, @@ -351,7 +351,7 @@ const liberator = (function () //{{{ // TODO: why are these sorts of properties arrays? --djk let dialogs = config.dialogs; - for (let [,dialog] in Iterator(dialogs)) + for (let [, dialog] in Iterator(dialogs)) { if (util.compareIgnoreCase(arg, dialog[0]) == 0) { @@ -387,7 +387,7 @@ const liberator = (function () //{{{ if (!items.some(function (i) i.fullMenuPath == arg)) return void liberator.echoerr("E334: Menu not found: " + arg); - for (let [,item] in Iterator(items)) + for (let [, item] in Iterator(items)) { if (item.fullMenuPath == arg) item.doCommand(); @@ -539,7 +539,7 @@ const liberator = (function () //{{{ /* XXX: Inline style. */ e.enabled ? enabled : disabled, - e.description] for ([,e] in Iterator(extensions))) + e.description] for ([, e] in Iterator(extensions))) ); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); @@ -1004,7 +1004,7 @@ const liberator = (function () //{{{ triggerObserver: function (type) { let args = Array.slice(arguments, 1); - for (let [,func] in Iterator(observers[type] || [])) + for (let [, func] in Iterator(observers[type] || [])) func.apply(null, args); }, @@ -1480,7 +1480,7 @@ const liberator = (function () //{{{ } liberator.echomsg('Searching for "plugin/**/*.{js,vimp}" in "' - + [dir.path.replace(/.plugin$/, "") for ([,dir] in Iterator(dirs))].join(",") + '"', 2); + + [dir.path.replace(/.plugin$/, "") for ([, dir] in Iterator(dirs))].join(",") + '"', 2); dirs.forEach(function (dir) { liberator.echomsg("Searching for \"" + (dir.path + "/**/*.{js,vimp}") + "\"", 3); @@ -1609,7 +1609,7 @@ const liberator = (function () //{{{ else if (!where) where = liberator.CURRENT_TAB; - for (let [,url] in Iterator(urls)) + for (let [, url] in Iterator(urls)) { open(url, where); where = liberator.NEW_BACKGROUND_TAB; diff --git a/common/content/mappings.js b/common/content/mappings.js index ff23f327..f974303e 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -168,7 +168,7 @@ function Mappings() //{{{ { let maps = stack[mode] || []; - for (let [,map] in Iterator(maps)) + for (let [, map] in Iterator(maps)) { if (map.hasName(cmd)) return map; @@ -297,7 +297,7 @@ function Mappings() //{{{ args = args[0]; let found = false; - for (let [,mode] in Iterator(modes)) + for (let [, mode] in Iterator(modes)) { if (mappings.hasMap(mode, args)) { @@ -413,9 +413,9 @@ function Mappings() //{{{ let map = new Map(modes, keys, description || "User defined mapping", action, extra); // remove all old mappings to this key sequence - for (let [,name] in Iterator(map.names)) + for (let [, name] in Iterator(map.names)) { - for (let [,mode] in Iterator(map.modes)) + for (let [, mode] in Iterator(map.modes)) removeMap(mode, name); } @@ -461,9 +461,9 @@ function Mappings() //{{{ let mappings = user[mode].concat(main[mode]); let matches = []; - for (let [,map] in Iterator(mappings)) + for (let [, map] in Iterator(mappings)) { - for (let [,name] in Iterator(map.names)) + for (let [, name] in Iterator(map.names)) { if (name.indexOf(prefix) == 0 && name.length > prefix.length) { diff --git a/common/content/options.js b/common/content/options.js index 0d296c5b..bc5f8455 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -128,7 +128,7 @@ function Option(names, description, type, defaultValue, extraInfo) //{{{ if (this.type == "boolean") { this.names = []; // reset since order is important - for (let [,name] in Iterator(names)) + for (let [, name] in Iterator(names)) { this.names.push(name); this.names.push("no" + name); @@ -556,7 +556,7 @@ function Options() //{{{ if (!args.length) args[0] = ""; - for (let [,arg] in args) + for (let [, arg] in args) { if (bang) { @@ -908,7 +908,7 @@ function Options() //{{{ "Delete a variable", function (args) { - for (let [,name] in args) + for (let [, name] in args) { let reference = liberator.variableReference(name); if (!reference[0]) @@ -1192,7 +1192,7 @@ function Options() //{{{ let prefArray = services.get("pref").getChildList("", { value: 0 }); prefArray.sort(); let prefs = function () { - for (let [,pref] in Iterator(prefArray)) + for (let [, pref] in Iterator(prefArray)) { let userValue = services.get("pref").prefHasUserValue(pref); if (onlyNonDefault && !userValue || pref.indexOf(filter) == -1) diff --git a/common/content/style.js b/common/content/style.js index 5b5d12db..4747f974 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -395,7 +395,7 @@ function Styles(name, store) if (matches.length == 0) return; - for (let [,sheet] in Iterator(matches.reverse())) + for (let [, sheet] in Iterator(matches.reverse())) { if (name) { @@ -509,7 +509,7 @@ let (array = util.Array) catch (e) {} context.fork("others", 0, this, function (context) { context.title = ["Site"]; - context.completions = [[s, ""] for ([,s] in Iterator(styles.sites))]; + context.completions = [[s, ""] for ([, s] in Iterator(styles.sites))]; }); } }); @@ -729,7 +729,7 @@ liberator.registerObserver("load_completion", function () { }); context.title = ["Color Scheme", "Runtime Path"]; - context.completions = [[c.leafName.replace(/\.vimp$/, ""), c.parent.path] for ([,c] in Iterator(colors))] + context.completions = [[c.leafName.replace(/\.vimp$/, ""), c.parent.path] for ([, c] in Iterator(colors))] }; // FIXME: extract from :highlight diff --git a/common/content/tabs.js b/common/content/tabs.js index 8802e1b6..f1c31060 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -1014,7 +1014,7 @@ function Tabs() //{{{ */ stopAll: function () { - for (let [,browser] in this.browsers) + for (let [, browser] in this.browsers) browser.stop(); }, diff --git a/common/content/ui.js b/common/content/ui.js index 45221703..b044ae81 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -398,7 +398,7 @@ function CommandLine() //{{{ try { this.waiting = true; - for (let [,context] in Iterator(list)) + for (let [, context] in Iterator(list)) { function done() !(idx >= n + context.items.length || idx == -2 && !context.items.length); while (context.incomplete && !done()) diff --git a/common/content/util.js b/common/content/util.js index ff271b86..a8e410bc 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -817,13 +817,13 @@ util.Array.uniq = function uniq(ary, unsorted) let ret = []; if (unsorted) { - for (let [,item] in Iterator(ary)) + for (let [, item] in Iterator(ary)) if (ret.indexOf(item) == -1) ret.push(item); } else { - for (let [,item] in Iterator(ary.sort())) + for (let [, item] in Iterator(ary.sort())) { if (item != last || !ret.length) ret.push(item); @@ -889,8 +889,8 @@ Struct.prototype = { // Add no-sideeffect array methods. Can't set new Array() as the prototype or // get length() won't work. -for (let [,k] in Iterator(["concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", - "map", "reduce", "reduceRight", "reverse", "slice", "some", "sort"])) +for (let [, k] in Iterator(["concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", + "map", "reduce", "reduceRight", "reverse", "slice", "some", "sort"])) Struct.prototype[k] = Array.prototype[k]; // vim: set fdm=marker sw=4 ts=4 et: diff --git a/muttator/content/addressbook.js b/muttator/content/addressbook.js index fa50cd99..72eee604 100644 --- a/muttator/content/addressbook.js +++ b/muttator/content/addressbook.js @@ -196,7 +196,7 @@ function Addressbook() //{{{ else { let list = template.tabular(["Name", "Address"], [], - [[util.clip(a[0], 50), address[1]] for ([,address] in Iterator(addresses))] + [[util.clip(a[0], 50), address[1]] for ([, address] in Iterator(addresses))] ); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); } diff --git a/muttator/content/mail.js b/muttator/content/mail.js index c510a43d..7769ca06 100755 --- a/muttator/content/mail.js +++ b/muttator/content/mail.js @@ -217,7 +217,7 @@ function Mail() //{{{ services.get("smtpService").defaultServer = server; return value; }, - completer: function (context) [[s.key, s.serverURI] for ([,s] in Iterator(mail.smtpServers))], + completer: function (context) [[s.key, s.serverURI] for ([, s] in Iterator(mail.smtpServers))], validator: Option.validateCompleter }); diff --git a/vimperator/content/config.js b/vimperator/content/config.js index eece18a9..bc3173d4 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -249,7 +249,7 @@ const config = { //{{{ let menu = document.getElementById("viewSidebarMenu"); - for (let [,panel] in Iterator(menu.childNodes)) + for (let [, panel] in Iterator(menu.childNodes)) { if (compare(panel.label, arg)) { diff --git a/vimperator/regressions.js b/vimperator/regressions.js index 6c4d53ec..a1040bd6 100644 --- a/vimperator/regressions.js +++ b/vimperator/regressions.js @@ -170,7 +170,7 @@ commands.addUserCommand(["regr[essions]"], continue; let testDescription = util.clip(test.cmds.join(" -> "), 80); - for (let [,cmd] in Iterator(test.cmds)) + for (let [, cmd] in Iterator(test.cmds)) { if (skipTests.indexOf(cmd) != -1) { diff --git a/xulmus/content/library.js b/xulmus/content/library.js index 7487b37c..a0b33f1c 100644 --- a/xulmus/content/library.js +++ b/xulmus/content/library.js @@ -21,7 +21,7 @@ function Library() // {{{ /////////////////////////////////////////////////////////////////////////////{{{ // TODO: return some actually useful objects. ;-) - return { + return { /** * Returns an array of all the artist names in the main library. @@ -65,7 +65,7 @@ function Library() // {{{ .map(function (track) track.getProperty(SBProperties.trackName)); } - }; + }; //}}} } // }}} diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 7568a3e4..f231ee9a 100644 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -327,7 +327,7 @@ function Player() // {{{ { let pages = player.getMediaPages(); - for ([,page] in Iterator(pages)) + for ([, page] in Iterator(pages)) { if (util.compareIgnoreCase(arg, page.contentTitle) == 0) { From 35574698d3204b676fa395ca54ae0313dfd5fdc6 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 25 Aug 2009 21:45:00 +1000 Subject: [PATCH 07/17] Improve the error message when a custom command completer is undefined. --- common/content/commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/content/commands.js b/common/content/commands.js index 4b7b005c..8aebb2bc 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1009,6 +1009,7 @@ function Commands() //{{{ } // TODO: offer completion.ex? + // : make this config specific var completeOptionMap = { abbreviation: "abbreviation", altstyle: "alternateStyleSheet", bookmark: "bookmark", buffer: "buffer", color: "colorScheme", @@ -1058,7 +1059,7 @@ function Commands() //{{{ } catch (e) { - // FIXME: should be pushed to the MOW + liberator.echo(":" + this.name + " ..."); liberator.echoerr("E117: Unknown function: " + completeOpt); liberator.log(e); return undefined; From 97236c4839e5550d65ff30dd0366045a3804af0a Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 25 Aug 2009 21:58:52 +1000 Subject: [PATCH 08/17] Remove some commented-out code from Events. --- common/content/events.js | 4 ---- common/content/io.js | 2 +- common/content/modes.js | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index f2ab0853..4dd6319f 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -439,10 +439,6 @@ function Events() //{{{ window.addEventListener("DOMMenuBarInactive", exitMenuMode, true); window.addEventListener("resize", onResize, true); - // window.document.addEventListener("DOMTitleChanged", function (event) { - // liberator.log("titlechanged"); - // }, null); - // NOTE: the order of ["Esc", "Escape"] or ["Escape", "Esc"] // matters, so use that string as the first item, that you // want to refer to within liberator's source code for diff --git a/common/content/io.js b/common/content/io.js index 19dd89c4..57f880bc 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -743,7 +743,7 @@ function IO() //{{{ } else return []; // XXX: or should it throw an error, probably yes? - // Yes --djk + // Yes, though frankly this should be a precondition so... --djk }, /** diff --git a/common/content/modes.js b/common/content/modes.js index 51caaf65..d8a65055 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -216,6 +216,7 @@ const modes = (function () //{{{ }, // TODO: Deprecate this in favor of addMode? --Kris + // Ya --djk setCustomMode: function (modestr, oneventfunc, stopfunc) { // TODO this.plugin[id]... ('id' maybe submode or what..) From 94b6cbe5a2dc71c79c2c0e5784cbaaab524f784c Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 26 Aug 2009 00:38:10 +1000 Subject: [PATCH 09/17] Refactor commandline.command. --- common/content/ui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index b044ae81..35d3b2e6 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -1017,8 +1017,10 @@ function CommandLine() //{{{ // completion preview. return commandWidget.inputField.editor.rootElement.firstChild.textContent; } - catch (e) {} - return commandWidget.value; + catch (e) + { + return commandWidget.value; + } }, set command(cmd) commandWidget.value = cmd, From 2952c91c7418e1451cf7a1ec0c08b3e20ce79818 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 26 Aug 2009 00:46:44 +1000 Subject: [PATCH 10/17] Remove unneccesary return statements from commandline.onEvent. --- common/content/ui.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index 35d3b2e6..b2104264 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -991,8 +991,7 @@ function CommandLine() //{{{ triggerCallback: function (type, mode, data) { if (callbacks[type] && callbacks[type][mode]) - return callbacks[type][mode].call(this, data); - return false; + callbacks[type][mode].call(this, data); }, runSilently: function (func, self) @@ -1280,10 +1279,10 @@ function CommandLine() //{{{ if (completions) completions.previewClear(); if (!currentExtendedMode) - return true; + return; - // user pressed ENTER to carry out a command - // user pressing ESCAPE is handled in the global onEscape + // user pressed to carry out a command + // user pressing is handled in the global onEscape // FIXME: should trigger "cancel" event if (events.isAcceptKey(key)) { @@ -1291,10 +1290,9 @@ function CommandLine() //{{{ keepCommand = true; currentExtendedMode = null; // Don't let modes.pop trigger "cancel" modes.pop(!this.silent); - - return commandline.triggerCallback("submit", mode, command); + commandline.triggerCallback("submit", mode, command); } - // user pressed UP or DOWN arrow to cycle history completion + // user pressed or arrow to cycle history completion else if (/^(|||||)$/.test(key)) { // prevent tab from moving to the next field @@ -1305,9 +1303,8 @@ function CommandLine() //{{{ history.select(/Up/.test(key), !/(Page|S-)/.test(key)); else liberator.beep(); - return false; } - // user pressed TAB to get completions of a command + // user pressed to get completions of a command else if (key == "" || key == "") { // prevent tab from moving to the next field @@ -1315,7 +1312,6 @@ function CommandLine() //{{{ event.stopPropagation(); tabTimer.tell(event); - return false; } else if (key == "") { @@ -1333,7 +1329,7 @@ function CommandLine() //{{{ { //this.resetCompletions(); } - return true; // allow this event to be handled by the host app + // allow this event to be handled by the host app } else if (event.type == "keyup") { From bf240bc2b0398b29bf819f8ac16d1b6a6ba4ff45 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 26 Aug 2009 02:19:23 +1000 Subject: [PATCH 11/17] Make config.styleableChrome an array. --- common/content/style.js | 2 +- muttator/content/config.js | 3 ++- vimperator/content/config.js | 2 +- xulmus/content/config.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/content/style.js b/common/content/style.js index 4747f974..7825bb32 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -142,7 +142,7 @@ function Highlights(name, store) let styles = storage.styles; const Highlight = Struct("class", "selector", "filter", "default", "value"); - Highlight.defaultValue("filter", function () "chrome://liberator/content/buffer.xhtml" + "," + config.styleableChrome); + Highlight.defaultValue("filter", function () ["chrome://liberator/content/buffer.xhtml"].concat(config.styleableChrome).join(",")); Highlight.defaultValue("selector", function () self.selector(this.class)); Highlight.defaultValue("value", function () this.default); Highlight.prototype.toString = function () "Highlight(" + this.class + ")\n\t" + [k + ": " + util.escapeString(v || "undefined") for ([k, v] in this)].join("\n\t"); diff --git a/muttator/content/config.js b/muttator/content/config.js index af8f025d..f818c5ad 100644 --- a/muttator/content/config.js +++ b/muttator/content/config.js @@ -68,7 +68,8 @@ const config = (function () //{{{ // focusContent() focuses this widget get mainWidget() this.isComposeWindow ? document.getElementById("content-frame") : GetThreadTree(), get visualbellWindow() document.getElementById(this.mainWindowId), - styleableChrome: "chrome://messenger/content/messenger.xul,chrome://messenger/content/messengercompose/messengercompose.xul", + styleableChrome: ["chrome://messenger/content/messenger.xul", + "chrome://messenger/content/messengercompose/messengercompose.xul"], autocommands: [["DOMLoad", "Triggered when a page's DOM content has fully loaded"], ["FolderLoad", "Triggered after switching folders in " + host], diff --git a/vimperator/content/config.js b/vimperator/content/config.js index bc3173d4..51da62ea 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -47,7 +47,7 @@ const config = { //{{{ }, get visualbellWindow() getBrowser().mPanelContainer, - styleableChrome: "chrome://browser/content/browser.xul", + styleableChrome: ["chrome://browser/content/browser.xul"], autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], ["ColorScheme", "Triggered after a color scheme has been loaded"], diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 76030dc8..a1e9df38 100644 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -51,7 +51,7 @@ const config = { //{{{ // focusContent() focuses this widget gSongbirdWindowController takes care of the focus. get visualbellWindow() document.getElementById(this.mainWindowId), - styleableChrome: "chrome://gonzo/content/xul/mainplayer.xul", + styleableChrome: ["chrome://gonzo/content/xul/mainplayer.xul"], autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], ["ColorScheme", "Triggered after a color scheme has been loaded"], From bc1163c0c7806d421989decbc2449d3f59b9df0e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 26 Aug 2009 23:08:14 +1000 Subject: [PATCH 12/17] Remove some invalid comments. --- common/content/bookmarks.js | 4 ---- common/content/io.js | 3 --- 2 files changed, 7 deletions(-) diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 4d5a050c..c4d0189e 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -534,10 +534,6 @@ function Bookmarks() //{{{ process: [template.icon, template.bookmarkDescription] }), - // if "bypassCache" is true, it will force a reload of the bookmarks database - // on my PC, it takes about 1ms for each bookmark to load, so loading 1000 bookmarks - // takes about 1 sec - // Huh? --djk // TODO: why is this a filter? --djk get: function get(filter, tags, maxItems, extra) { diff --git a/common/content/io.js b/common/content/io.js index 57f880bc..369acbd4 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -1059,9 +1059,6 @@ lookup: { let lineNumber = i + 1; - // TODO: messages need to be able to specify - // whether they can be cleared/overwritten or - // should be appended to and the MOW opened liberator.echoerr("Error detected while processing " + file.path, commandline.FORCE_MULTILINE); commandline.echo("line " + lineNumber + ":", commandline.HL_LINENR, commandline.APPEND_TO_MESSAGES); liberator.echoerr("E492: Not an editor command: " + line); From b6a898a5fa4806aa329df406c2ba0409b8fd72bb Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 26 Aug 2009 23:09:13 +1000 Subject: [PATCH 13/17] Formatting fixes. --- common/content/bookmarks.js | 2 +- common/content/buffer.js | 8 ++++---- common/content/completion.js | 4 ++-- common/content/events.js | 2 +- common/content/hints.js | 4 ++-- common/content/tabs.js | 2 +- common/content/ui.js | 6 ++++-- vimperator/regressions.js | 2 +- xulmus/content/player.js | 2 +- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index c4d0189e..981a90cc 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -1207,7 +1207,7 @@ function QuickMarks() //{{{ { let pattern = RegExp("[" + filter.replace(/\s+/g, "") + "]"); - for (let [qmark,] in qmarks) + for (let [qmark, ] in qmarks) { if (pattern.test(qmark)) qmarks.remove(qmark); diff --git a/common/content/buffer.js b/common/content/buffer.js index 56186b3b..d195d6eb 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1667,7 +1667,7 @@ function Marks() //{{{ if (localmark) { let win = window.content; - for (let [i,] in Iterator(localmark)) + for (let [i, ] in Iterator(localmark)) { if (localmark[i].location == win.location.href) { @@ -1903,17 +1903,17 @@ function Marks() //{{{ if (special) { // :delmarks! only deletes a-z marks - for (let [mark,] in localMarks) + for (let [mark, ] in localMarks) removeLocalMark(mark); } else { - for (let [mark,] in urlMarks) + for (let [mark, ] in urlMarks) { if (filter.indexOf(mark) >= 0) removeURLMark(mark); } - for (let [mark,] in localMarks) + for (let [mark, ] in localMarks) { if (filter.indexOf(mark) >= 0) removeLocalMark(mark); diff --git a/common/content/completion.js b/common/content/completion.js index b3459773..df30adc9 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -471,13 +471,13 @@ CompletionContext.prototype = { let filter = fixCase(this.filter); if (this.anchored) { - function compare (text, s) text.substr(0, s.length) == s; + function compare(text, s) text.substr(0, s.length) == s; substrings = util.map(util.range(filter.length, text.length + 1), function (end) text.substring(0, end)); } else { - function compare (text, s) text.indexOf(s) >= 0; + function compare(text, s) text.indexOf(s) >= 0; substrings = []; let start = 0; let idx; diff --git a/common/content/events.js b/common/content/events.js index 4dd6319f..d54023e3 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -842,7 +842,7 @@ function Events() //{{{ { let re = RegExp(filter); - for (let [item,] in macros) + for (let [item, ] in macros) { if (re.test(item) || !filter) macros.remove(item); diff --git a/common/content/hints.js b/common/content/hints.js index d54fd9d4..b36b3b56 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -449,7 +449,7 @@ function Hints() //{{{ { let css = []; // FIXME: Broken for imgspans. - for (let [,{ doc: doc }] in Iterator(docs)) + for (let [, { doc: doc }] in Iterator(docs)) { for (let elem in buffer.evaluateXPath("//*[@liberator:highlight and @number]", doc)) { @@ -560,7 +560,7 @@ function Hints() //{{{ * * @param {Event} event The keypress event. */ - function onInput (event) + function onInput(event) { prevInput = "text"; diff --git a/common/content/tabs.js b/common/content/tabs.js index f1c31060..57137f03 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -1072,7 +1072,7 @@ function Tabs() //{{{ let lowerBuffer = buffer.toLowerCase(); let first = tabs.index() + (reverse ? 0 : 1); let nbrowsers = getBrowser().browsers.length; - for (let [i,] in tabs.browsers) + for (let [i, ] in tabs.browsers) { let index = (i + first) % nbrowsers; let url = getBrowser().getBrowserAtIndex(index).contentDocument.location.href; diff --git a/common/content/ui.js b/common/content/ui.js index b2104264..d2ff3f28 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -2085,7 +2085,8 @@ function StatusLine() //{{{ var value = aURI.spec; // Try to decode as UTF-8 if there's no encoding sequence that we would break. if (!/%25(?:3B|2F|3F|3A|40|26|3D|2B|24|2C|23)/i.test(value)) - try { + try + { value = decodeURI(value) // 1. decodeURI decodes %25 to %, which creates unintended // encoding sequences. Re-encode it, unless it's part of @@ -2096,7 +2097,8 @@ function StatusLine() //{{{ // by the location bar (bug 410726). .replace(/%(?!3B|2F|3F|3A|40|26|3D|2B|24|2C|23)|[\r\n\t]/ig, encodeURIComponent); - } catch (e) {} + } + catch (e) {} // Encode invisible characters (soft hyphen, zero-width space, BOM, // line and paragraph separator, word joiner, invisible times, diff --git a/vimperator/regressions.js b/vimperator/regressions.js index a1040bd6..c173aa3d 100644 --- a/vimperator/regressions.js +++ b/vimperator/regressions.js @@ -150,7 +150,7 @@ commands.addUserCommand(["regr[essions]"], commandline.updateOutputHeight = updateOutputHeight; } - function run () + function run() { let now = Date.now(); let totalTests = tests.length + functions.length; diff --git a/xulmus/content/player.js b/xulmus/content/player.js index f231ee9a..2697fe07 100644 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -609,7 +609,7 @@ function Player() // {{{ return tracksList; }, - searchView: function searchView (args) + searchView: function searchView(args) { let currentView = _SBGetCurrentView(); let mediaItemList = currentView.mediaList; From 1a3394d1a03a93cb25bcac08b875f2eeef6c0355 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 27 Aug 2009 01:01:58 +1000 Subject: [PATCH 14/17] Fix :doautoall. --- common/content/commands.js | 3 ++ common/content/events.js | 83 ++++++++++++++++++++------------------ 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index 8aebb2bc..843b1474 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -562,6 +562,9 @@ function Commands() //{{{ // : it might be nice to be able to specify that certain quoting // should be disabled E.g. backslash without having to resort to // using literal etc. + // : error messages should be configurable or else we can ditch + // Vim compatibility but it actually gives useful messages + // sometimes rather than just "Invalid arg" // : I'm not sure documenting the returned object here, and // elsewhere, as type Args rather than simply Object makes sense, // especially since it is further augmented for use in diff --git a/common/content/events.js b/common/content/events.js index d54023e3..8a16f99b 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -122,55 +122,58 @@ function AutoCommands() //{{{ options: [[["-javascript", "-js"], commands.OPTION_NOARG]] }); - // TODO: expand target to all buffers - commands.add(["doauto[all]"], - "Apply the autocommands matching the specified URL pattern to all buffers", - function (args) + [ { - commands.get("doautocmd").action.call(this, args); + name: "do[autocmd]", + description: "Apply the autocommands matching the specified URL pattern to the current buffer" }, { - completer: function (context) completion.autocmdEvent(context), - literal: 0 + name: "doautoa[ll]", + description: "Apply the autocommands matching the specified URL pattern to all buffers" } - ); - - // TODO: restrict target to current buffer - commands.add(["do[autocmd]"], - "Apply the autocommands matching the specified URL pattern to the current buffer", - function (args) - { - args = args.string; - if (/^\s*$/.test(args)) + ].forEach(function (command) { + commands.add([command.name], + command.description, + // TODO: Perhaps this should take -args to pass to the command? + function (args) { - liberator.echomsg("No matching autocommands"); - return; - } + // Vim compatible + if (args.length == 0) + return void liberator.echomsg("No matching autocommands"); - let [, event, url] = args.match(/^(\S+)(?:\s+(\S+))?$/); - url = url || buffer.URL; + let [event, url] = args; + let defaultURL = url || buffer.URL; + let validEvents = config.autocommands.map(function (e) e[0]); - let validEvents = config.autocommands.map(function (e) e[0]); + // TODO: add command validators + if (event == "*") + return void liberator.echoerr("E217: Can't execute autocommands for ALL events"); + else if (validEvents.indexOf(event) == -1) + return void liberator.echoerr("E216: No such group or event: " + args); + else if (!autocommands.get(event).some(function (c) c.pattern.test(defaultURL))) + return void liberator.echomsg("No matching autocommands"); - if (event == "*") - liberator.echoerr("E217: Can't execute autocommands for ALL events"); - else if (validEvents.indexOf(event) == -1) - liberator.echoerr("E216: No such group or event: " + args); - else - { - // TODO: perhaps trigger could return the number of autocmds triggered - // TODO: Perhaps this should take -args to pass to the command? - if (!autocommands.get(event).some(function (c) c.pattern.test(url))) - liberator.echomsg("No matching autocommands"); + if (this.name == "doautoall" && liberator.has("tabs")) + { + let current = tabs.index(); + + for (let i = 0; i < tabs.count; i++) + { + tabs.select(i); + // if no url arg is specified use the current buffer's URL + autocommands.trigger(event, { url: url || buffer.URL }); + } + + tabs.select(current); + } else - autocommands.trigger(event, { url: url }); - } - }, - { - completer: function (context) completion.autocmdEvent(context), - literal: 0 - } - ); + autocommands.trigger(event, { url: defaultURL }); + }, + { + argCount: "*", // FIXME: kludged for proper error message should be "1". + completer: function (context) completion.autocmdEvent(context) + }); + }); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// COMPLETIONS ///////////////////////////////////////////// From 256b55461c4f52ddee0d136602907b964f664f3e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 27 Aug 2009 01:13:24 +1000 Subject: [PATCH 15/17] Formatting fix. --- common/content/ui.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index d2ff3f28..2bb03f1e 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -871,7 +871,7 @@ function CommandLine() //{{{ ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - var echoCommands = [ + [ { name: "ec[ho]", description: "Echo the expression", @@ -887,9 +887,7 @@ function CommandLine() //{{{ description: "Echo the expression as an informational message", action: liberator.echomsg } - ]; - - echoCommands.forEach(function (command) { + ].forEach(function (command) { commands.add([command.name], command.description, function (args) From 130ea15a4c364f7b8f63d653fdde0f1599fdcedc Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 27 Aug 2009 01:19:12 +1000 Subject: [PATCH 16/17] Remove :pclose from Vim syntax highlighters. --- muttator/contrib/vim/syntax/muttator.vim | 11 +++++------ vimperator/contrib/vim/syntax/vimperator.vim | 16 ++++++++-------- xulmus/contrib/vim/syntax/xulmus.vim | 18 +++++++++--------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/muttator/contrib/vim/syntax/muttator.vim b/muttator/contrib/vim/syntax/muttator.vim index 533ada2d..2ab1f59f 100644 --- a/muttator/contrib/vim/syntax/muttator.vim +++ b/muttator/contrib/vim/syntax/muttator.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Muttator configuration file " Maintainer: Doug Kearns -" Last Change: 2009 Aug 23 +" Last Change: 2009 Aug 27 " TODO: make this muttator specific - shared liberator config? @@ -28,11 +28,10 @@ syn keyword muttatorCommand ab[breviate] ab[clear] addo[ns] addr[essbook] bN[ext \ h[elp] helpa[ll] ha[rdcopy] hi[ghlight] ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iu[nmap] iuna[bbrev] javas[cript] \ js let loadplugins lpl m[ail] ma[rk] macros map mapc[lear] marks mes[sages] messc[lear] mkm[uttatorrc] mm[ap] mmapc[lear] \ mno[remap] move[to] mu[nmap] nm[ap] nmapc[lear] nno[remap] no[remap] norm[al] nu[nmap] optionu[sage] pa[geinfo] pagest[yle] - \ pas pc[lose] pl[ay] pref[erences] prefs pw[d] q[uit] re[load] res[tart] run runt[ime] sav[eas] scrip[tnames] se[t] - \ setg[lobal] setl[ocal] sil[ent] so[urce] st[op] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabfir[st] - \ tabl[ast] tabn[ext] tabp[revious] tabr[ewind] tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] - \ toolbart[oggle] tp[revious] una[bbreviate] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] - \ vno[remap] vu[nmap] w[rite] zo[om] + \ pas pl[ay] pref[erences] prefs pw[d] q[uit] re[load] res[tart] run runt[ime] sav[eas] scrip[tnames] se[t] setg[lobal] + \ setl[ocal] sil[ent] so[urce] st[op] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabfir[st] tabl[ast] tabn[ext] + \ tabp[revious] tabr[ewind] tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] + \ una[bbreviate] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmapc[lear] vno[remap] vu[nmap] w[rite] zo[om] \ contained syn match muttatorCommand "!" contained diff --git a/vimperator/contrib/vim/syntax/vimperator.vim b/vimperator/contrib/vim/syntax/vimperator.vim index feea52d9..5f180dd7 100644 --- a/vimperator/contrib/vim/syntax/vimperator.vim +++ b/vimperator/contrib/vim/syntax/vimperator.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: VIMperator configuration file " Maintainer: Doug Kearns -" Last Change: 2009 Aug 23 +" Last Change: 2009 Aug 27 " TODO: make this vimperator specific - shared liberator config? @@ -28,13 +28,13 @@ syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] b \ frameo[nly] fw h[elp] helpa[ll] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] \ iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages] \ messc[lear] mkv[imperatorrc] nm[ap] nmapc[lear] nno[remap] no[remap] noh[lsearch] norm[al] nu[nmap] o[pen] optionu[sage] - \ pa[geinfo] pagest[yle] pas pc[lose] pl[ay] pref[erences] prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] - \ re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] - \ sideb[ar] sil[ent] so[urce] st[op] stopa[ll] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabde[tach] - \ tabdu[plicate] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs - \ tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] - \ undoa[ll] unl[et] unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vu[nmap] w[rite] wc[lose] - \ win[open] winc[lose] wind[ow] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] + \ pa[geinfo] pagest[yle] pas pl[ay] pref[erences] prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] + \ reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] + \ sil[ent] so[urce] st[op] stopa[ll] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabde[tach] tabdu[plicate] + \ tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs tbh[ide] tbs[how] + \ tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] + \ unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vu[nmap] w[rite] wc[lose] win[open] + \ winc[lose] wind[ow] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] \ contained syn match vimperatorCommand "!" contained diff --git a/xulmus/contrib/vim/syntax/xulmus.vim b/xulmus/contrib/vim/syntax/xulmus.vim index 3e9a6f39..c0a35f3f 100644 --- a/xulmus/contrib/vim/syntax/xulmus.vim +++ b/xulmus/contrib/vim/syntax/xulmus.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Xulmus configuration file " Maintainer: Doug Kearns -" Last Change: 2009 Aug 23 +" Last Change: 2009 Aug 27 " TODO: make this xulmus specific - shared liberator config? @@ -29,14 +29,14 @@ syn keyword xulmusCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck \ hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let load \ loadplugins lpl ls ma[rk] macros map mapc[lear] marks mediav[iew] mes[sages] messc[lear] mkv[imperatorrc] mkx[ulmusrc] \ nm[ap] nmap[clear] nno[remap] no[remap] noh[lsearch] norm[al] nu[nmap] o[pen] optionu[sage] pa[geinfo] pagest[yle] pas - \ pc[lose] pl[ay] playern[ext] playerp[lay] playerpa[use] playerpr[ev] players[top] pm[ap] pmap[clear] pno[remap] - \ pref[erences] prefs pu[nmap] pw[d] q[uit] qa[ll] qma[rk] qmarks queue quita[ll] re[draw] re[load] reloada[ll] res[tart] run - \ runt[ime] sav[eas] sb[ar] sb[open] sbcl[ose] scrip[tnames] se[t] see[k] setg[lobal] setl[ocal] sideb[ar] sil[ent] sort[view] - \ so[urce] st[op] stopa[ll] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabde[tach] tabdu[plicate] tabe[dit] - \ tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs tbh[ide] tbs[how] - \ tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] - \ unm[ap] verb[ose] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vol[ume] vu[nmap] w[rite] wc[lose] - \ win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] + \ pl[ay] playern[ext] playerp[lay] playerpa[use] playerpr[ev] players[top] pm[ap] pmap[clear] pno[remap] pref[erences] prefs + \ pu[nmap] pw[d] q[uit] qa[ll] qma[rk] qmarks queue quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] + \ sb[ar] sb[open] sbcl[ose] scrip[tnames] se[t] see[k] setg[lobal] setl[ocal] sideb[ar] sil[ent] sort[view] so[urce] st[op] + \ stopa[ll] sty[le] tN[ext] t[open] tab tabN[ext] tabc[lose] tabd[o] tabde[tach] tabdu[plicate] tabe[dit] tabfir[st] tabl[ast] + \ tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs tbh[ide] tbs[how] tbt[oggle] time tn[ext] + \ toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] verb[ose] ve[rsion] + \ vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vol[ume] vu[nmap] w[rite] wc[lose] win[open] winc[lose] wine[dit] + \ wo[pen] wq wqa[ll] xa[ll] zo[om] \ contained syn match xulmusCommand "!" contained From cf4bdb2969a472ecdedeb81afd0bf0089f574957 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 27 Aug 2009 14:34:35 +1000 Subject: [PATCH 17/17] Fix help file validation errors. --- common/Makefile.doc | 18 ++++++++++-------- common/asciidoc.conf | 14 +++++++------- vimperator/locale/en-US/autocommands.txt | 2 +- vimperator/locale/en-US/buffer.txt | 2 +- vimperator/locale/en-US/developer.txt | 4 ++-- vimperator/locale/en-US/intro.txt | 10 ++++++---- vimperator/locale/en-US/map.txt | 3 ++- vimperator/locale/en-US/tutorial.txt | 10 ++++++---- vimperator/locale/en-US/xhtml11.css | 2 +- xulmus/locale/en-US/autocommands.txt | 2 +- xulmus/locale/en-US/buffer.txt | 2 +- xulmus/locale/en-US/developer.txt | 4 ++-- xulmus/locale/en-US/intro.txt | 2 +- xulmus/locale/en-US/map.txt | 3 ++- xulmus/locale/en-US/xhtml11.css | 2 +- 15 files changed, 44 insertions(+), 36 deletions(-) diff --git a/common/Makefile.doc b/common/Makefile.doc index 4750585d..3b62ed7d 100644 --- a/common/Makefile.doc +++ b/common/Makefile.doc @@ -2,17 +2,17 @@ #### configuration -ASCIIDOC = asciidoc -AWK = awk +ASCIIDOC = asciidoc +AWK = awk -LOCALE = $(shell basename `pwd`) -DOCLANG = $(shell basename `pwd` | $(AWK) -F- '{ print ($$1 ~ /^[a-z][a-z]$$/) ? $$1 : "en" }') +LOCALE = $(shell basename `pwd`) +DOCLANG = $(shell basename `pwd` | $(AWK) -F- '{ print ($$1 ~ /^[a-z][a-z]$$/) ? $$1 : "en" }') SRC_FILES = $(wildcard *.txt) FILES = $(SRC_FILES:%.txt=%.html) -DEPS = $(wildcard asciidoc.conf lang-$(DOCLANG).conf) +DEPS = $(wildcard lang-$(DOCLANG).conf) ${BASE}/asciidoc.conf $(BASE)/Makefile.doc -DOC_FILES = $(FILES) version.html +DOC_FILES = $(FILES) version.html .SILENT: @@ -50,7 +50,9 @@ check-asciidoc: @$(ASCIIDOC) --version | $(AWK) '{ exit $$2 !~ /^8\.4\./ }' || \ echo >&2 "Warning: asciidoc versions other than 8.4.x are unsupported" -version.html: ../../NEWS $(BASE)/Makefile.doc $(DEPS) +all.html: $(SRC_FILES) + +version.html: ../../NEWS $(DEPS) @echo "DOC locale/$(LOCALE)/$@" # NOTE: asciidoc doesn't source the conf file implicitly when processing stdin sed -e '1i\ @@ -60,7 +62,7 @@ heading:Version{nbsp}information[version-information]' \ /' ../../NEWS | \ ${ASCIIDOC} -f $(BASE)/asciidoc.conf -a doctitle=version.html -o version.html - -$(FILES): %.html: %.txt $(BASE)/Makefile.doc $(DEPS) +$(FILES): %.html: %.txt $(DEPS) @echo "DOC locale/$(LOCALE)/$@" $(ASCIIDOC) -f $(BASE)/asciidoc.conf -a configname=$(NAME) --unsafe -a linkcss -a quirks! -a lang=$(DOCLANG) -a doctitle="$$(basename $@)" -o $@ $< diff --git a/common/asciidoc.conf b/common/asciidoc.conf index ea8020dc..fb39c80a 100644 --- a/common/asciidoc.conf +++ b/common/asciidoc.conf @@ -33,14 +33,14 @@ email=stubenschrott@vimperator.org (?u)^(?Psection)::(?P\S*?)(\[(?P.*?)\])$=# # subsection:Title[tag1,tag2] (?u)^(?Psubsection)::(?P\S*?)(\[(?P.*?)\])$=# +# logo:[,] # FIXME: this is a bit silly +(?su)(?logo):(?P\S*?)\[(?P.*?)\]=# # help:helptext[href] (?su)(?help):(?P\S*?)\[(?P.*?)\]= -# logo:[,] # FIXME: this is a bit silly -(?su)(?logo):(?P\S*?)\[(?P.*?)\]= # FIXME: this logo/donation banner is really ugly. --djk [heading-blockmacro] -{outfile@.*(intro|all).html::
} +{outfile@.*(intro|all).html::
} @@ -77,12 +77,12 @@ email=stubenschrott@vimperator.org
<{outfile@.*all.html:h2:h1 style="border\: none"}>{target}
+[logo-blockmacro] +
+ [help-inlinemacro] {target} -[logo-inlinemacro] -
- [quotes] ||=key |=tag @@ -101,7 +101,7 @@ email=stubenschrott@vimperator.org [tags] tag=| -key=
|
+key=| option=| option2='|' command=| diff --git a/vimperator/locale/en-US/autocommands.txt b/vimperator/locale/en-US/autocommands.txt index 3d0f9ece..e47169d8 100644 --- a/vimperator/locale/en-US/autocommands.txt +++ b/vimperator/locale/en-US/autocommands.txt @@ -91,6 +91,6 @@ Enable _passthrough_ mode on *some* Google sites: Set the filetype to mail when editing email at Gmail: \{nbsp}[c]:autocmd LocationChange .* :set editor=gvim\ -f[c] + -\{nbsp}[c]:autocmd LocationChange mail\.google\.com :set editor="gvim -f -c 'set ft=mail'"[c] +\{nbsp}[c]:autocmd LocationChange mail\.google\.com :set editor="gvim -f -c $$'set ft=mail'$$"[c] // vim: set filetype=asciidoc: diff --git a/vimperator/locale/en-US/buffer.txt b/vimperator/locale/en-US/buffer.txt index 8956b14a..4ca63010 100644 --- a/vimperator/locale/en-US/buffer.txt +++ b/vimperator/locale/en-US/buffer.txt @@ -23,7 +23,7 @@ ________________________________________________________________________________ |:pa| |:pageinfo| + ||:pa[geinfo]|| ________________________________________________________________________________ -Show various page information. See [c]:help 'pageinfo'[c] for available options. +Show various page information. See [c]:help $$'pageinfo'$$[c] for available options. ________________________________________________________________________________ diff --git a/vimperator/locale/en-US/developer.txt b/vimperator/locale/en-US/developer.txt index e6a323f5..469d01d0 100644 --- a/vimperator/locale/en-US/developer.txt +++ b/vimperator/locale/en-US/developer.txt @@ -30,8 +30,8 @@ is displayed as: class="hiddentag">:help :h help -
:h[elp] {subject}

-
<F1>

+:h[elp] {subject}
+<F1>

Open help window. diff --git a/vimperator/locale/en-US/intro.txt b/vimperator/locale/en-US/intro.txt index 49ef0d96..65a67379 100644 --- a/vimperator/locale/en-US/intro.txt +++ b/vimperator/locale/en-US/intro.txt @@ -1,10 +1,12 @@ logo:[] -+++

+++ -*First there was a Navigator, then there was an Explorer. +++++++ +

+First there was a Navigator, then there was an Explorer. Later it was time for a Konqueror. Now it's time for an Imperator, the -VIMperator :)* -+++

+++ +VIMperator :) +

+++++++ heading::Introduction[intro] diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt index a8ebcce5..48563e19 100644 --- a/vimperator/locale/en-US/map.txt +++ b/vimperator/locale/en-US/map.txt @@ -129,7 +129,8 @@ Below is an overview of which modes each map command applies to: :imap :inoremap :iunmap :imapclear - Insert mode :cmap :cnoremap :cunmap :cmapclear - Command-line mode -subsection::Key{nbsp}sequences[:<>,key-sequence] +// |<>| breaks doc validation +subsection::Key{nbsp}sequences[key-notation,key-sequence] For most keys, the key-sequence is the same as the character you see when you type that key, however there are some exceptions which allow for a much larger diff --git a/vimperator/locale/en-US/tutorial.txt b/vimperator/locale/en-US/tutorial.txt index 25158e28..fc3a7250 100644 --- a/vimperator/locale/en-US/tutorial.txt +++ b/vimperator/locale/en-US/tutorial.txt @@ -2,10 +2,12 @@ heading::Quick-start{nbsp}tutorial[tutorial] -+++
+++ -*This is a quickstart tutorial to help get new users up and running in -Vimperator. It is not intended as a full reference explaining all features.* -+++
+++ +++++++ +

+This is a quickstart tutorial to help get new users up and running in +Vimperator. It is not intended as a full reference explaining all features. +

+++++++ If you've started using Vimperator from scratch (i.e., without any customization), you should be looking at this help page in a relatively diff --git a/vimperator/locale/en-US/xhtml11.css b/vimperator/locale/en-US/xhtml11.css index e2345287..8cff8b94 100644 --- a/vimperator/locale/en-US/xhtml11.css +++ b/vimperator/locale/en-US/xhtml11.css @@ -304,7 +304,7 @@ td span.tag { padding-top: 25px !important; } -div.key { +span.key { color: rgb(255, 0, 255); /* magenta */ min-width: 120px; /* with 20px padding actually 140px */ /*padding-bottom: 5px;*/ diff --git a/xulmus/locale/en-US/autocommands.txt b/xulmus/locale/en-US/autocommands.txt index 6af6b60e..efe67988 100644 --- a/xulmus/locale/en-US/autocommands.txt +++ b/xulmus/locale/en-US/autocommands.txt @@ -100,6 +100,6 @@ Enable _passthrough_ mode on *some* Google sites: Set the filetype to mail when editing email at Gmail: \{nbsp}[c]:autocmd LocationChange .* :set editor=gvim\ -f[c] + -\{nbsp}[c]:autocmd LocationChange mail\.google\.com :set editor="gvim -f -c 'set ft=mail'"[c] +\{nbsp}[c]:autocmd LocationChange mail\.google\.com :set editor="gvim -f -c $$'set ft=mail'$$"[c] // vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/buffer.txt b/xulmus/locale/en-US/buffer.txt index 0dfd8bd8..e5930161 100644 --- a/xulmus/locale/en-US/buffer.txt +++ b/xulmus/locale/en-US/buffer.txt @@ -23,7 +23,7 @@ ________________________________________________________________________________ |:pa| |:pageinfo| + ||:pa[geinfo]|| ________________________________________________________________________________ -Show various page information. See [c]:help 'pageinfo'[c] for available options. +Show various page information. See [c]:help $$'pageinfo'$$[c] for available options. ________________________________________________________________________________ diff --git a/xulmus/locale/en-US/developer.txt b/xulmus/locale/en-US/developer.txt index 23ae25b5..bac28572 100644 --- a/xulmus/locale/en-US/developer.txt +++ b/xulmus/locale/en-US/developer.txt @@ -30,8 +30,8 @@ is displayed as: class="hiddentag">:help :h help -
:h[elp] {subject}

-
<F1>

+:h[elp] {subject}
+<F1>

Open help window. diff --git a/xulmus/locale/en-US/intro.txt b/xulmus/locale/en-US/intro.txt index 729dea72..63c856af 100644 --- a/xulmus/locale/en-US/intro.txt +++ b/xulmus/locale/en-US/intro.txt @@ -1,4 +1,4 @@ -LOGO +logo:[] section::Introduction[intro] diff --git a/xulmus/locale/en-US/map.txt b/xulmus/locale/en-US/map.txt index 32725502..0fe64b36 100644 --- a/xulmus/locale/en-US/map.txt +++ b/xulmus/locale/en-US/map.txt @@ -141,7 +141,8 @@ Below is an overview of which modes each map command applies to: :imap :inoremap :iunmap :imapclear - Insert mode :cmap :cnoremap :cunmap :cmapclear - Command-line mode -subsection::Key{nbsp}sequences[:<>,key-sequence] +// |<>| breaks doc validation +subsection::Key{nbsp}sequences[key-notation,key-sequence] For most keys, the key-sequence is the same as the character you see when you type that key, however there are some exceptions which allow for a much larger diff --git a/xulmus/locale/en-US/xhtml11.css b/xulmus/locale/en-US/xhtml11.css index e2345287..8cff8b94 100644 --- a/xulmus/locale/en-US/xhtml11.css +++ b/xulmus/locale/en-US/xhtml11.css @@ -304,7 +304,7 @@ td span.tag { padding-top: 25px !important; } -div.key { +span.key { color: rgb(255, 0, 255); /* magenta */ min-width: 120px; /* with 20px padding actually 140px */ /*padding-bottom: 5px;*/