From pierodancona@gmail.com Sun Sep 24 13:56:31 2006 From: "Piero D\\\\\\\\\\\\\\'Ancona" To: textmate@lists.macromates.com Subject: [TxMt] a better label completion techique Date: Sun, 24 Sep 2006 13:56:05 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7751467111919616095==" --===============7751467111919616095== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, this is a followup to the thread with a similar name, but I thought it deserved a new thread since I'm posting a complete solution (hehe - I'm trapped in a hotel room in Paris, it's raining here...) So: 1) create a new command "Lable Table" with input= entire document output=Show as HTML 2) the command is the following. (I know, I should post a .tmCommand file, but I do not know how so bear with me). GMane requested me to split the commands, but we have here 6 commands (5 sed and 1 tr) which should be on one line each. When joining back the last sed command do not introduce spaces. sed -n -e "/\\label/{=;N;N;G;p;}" | sed '/^$/d' | sed 's/^\([0-9]*\)$/\\<\/p\>\1/' | sed 's/\(.\)$/\1\/' | sed 's/\\label{\(.*\)}/\\/dev\/null -e %tell app \\\ "TextMate\\\" to insert \\\"\1\\\"% \& amp;\", null);\"\>\\label{\1}\<\/a>/' | tr "%" "'" 3) open a .tex file and experiment. When you click on a label the argument is inserted. The command and the text insertion is very fast, and as to usability it's already better than the standard Label completion (my taste). Please, some real coder take this stuff and make it into some serious code, I think the result is pretty amazing compared with the simplicity. I am not able to extend the script for multiple files (i.e. one master file and the \includes), any help? Ciao, Piero --===============7751467111919616095==-- From pierodancona@gmail.com Sun Sep 24 14:03:48 2006 From: "Piero D\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'Ancona" To: textmate@lists.macromates.com Subject: [TxMt] Re: a better label completion techique Date: Sun, 24 Sep 2006 14:03:13 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0188162116173234252==" --===============0188162116173234252== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit PS I would like to know how to set the parameters (width and heigth) of the HTML window. It's very nice to set the lable table as a column at the side of the source; when you refresh it it keeps the same shape and position and it comes up if it is buried under other windows, so you can keep it always open. --===============0188162116173234252==-- From throw-away-1@macromates.com Sun Sep 24 14:09:56 2006 From: Allan Odgaard To: textmate@lists.macromates.com Subject: Re: [TxMt] Re: a better label completion techique Date: Sun, 24 Sep 2006 16:09:39 +0200 Message-ID: <95B4D57F-F7BE-40E6-964E-5FD6541E6D12@macromates.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3382211090814808506==" --===============3382211090814808506== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On 24/9/2006, at 16:03, Piero D'Ancona wrote: How come each letter you send has an extra level of escaping in your name? > PS I would like to know how to set the parameters (width and heigth) > of the HTML window. You can set these with JavaScript (e.g. ) -- however TextMate remembers the dimensions of the window for each command, so if you manually resize it once, it should stick. So best actually *not* to set the width/height on load. --===============3382211090814808506==-- From pierodancona@gmail.com Sun Sep 24 14:10:16 2006 From: Piero D\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'Ancona To: textmate@lists.macromates.com Subject: [TxMt] Re: a better label completion techique Date: Sun, 24 Sep 2006 14:08:02 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7068235453488865575==" --===============7068235453488865575== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ok, last message: it would be even better to improve the command so that clicking inserts \eqref{...} or \ref{....} according to the type of label.... --===============7068235453488865575==-- From fredb7@starflam.com Sun Sep 24 14:31:19 2006 From: "Fred B." To: textmate@lists.macromates.com Subject: Re: Re: [TxMt] Re: a better label completion techique Date: Sun, 24 Sep 2006 16:31:17 +0200 Message-ID: <9c31463d0609240731t19e121f4ob3a3e614bccc0b43@mail.gmail.com> In-Reply-To: <95B4D57F-F7BE-40E6-964E-5FD6541E6D12@macromates.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8860766637729268036==" --===============8860766637729268036== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 9/24/06, Allan Odgaard wrote: > On 24/9/2006, at 16:03, Piero D'Ancona wrote: > > How come each letter you send has an extra level of escaping in your > name? That's weird, 11 backslash for now! Piero if you continue, you will break the internets! ;) --===============8860766637729268036==-- From erwan@rail.eu.org Sun Sep 24 15:24:36 2006 From: Erwan David To: textmate@lists.macromates.com Subject: Re: [TxMt] Re: a better label completion techique Date: Sun, 24 Sep 2006 17:23:35 +0200 Message-ID: <20060924152335.GB5889@rail.eu.org> In-Reply-To: <9c31463d0609240731t19e121f4ob3a3e614bccc0b43@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1039823757907094293==" --===============1039823757907094293== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Le Sun 24/09/2006, Fred B. disait > On 9/24/06, Allan Odgaard wrote: > >On 24/9/2006, at 16:03, Piero D'Ancona wrote: > > > >How come each letter you send has an extra level of escaping in your > >name? > > That's weird, 11 backslash for now! > Piero if you continue, you will break the internets! ;) It seems that google does escaping, but not unescaping... -- Erwan --===============1039823757907094293==-- From pierodancona@gmail.com Sun Sep 24 16:35:15 2006 From: Piero D'Ancona To: textmate@lists.macromates.com Subject: [TxMt] Re: a better label completion techique Date: Sun, 24 Sep 2006 16:34:50 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6551184866429564687==" --===============6551184866429564687== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit :)) I hope you're happy now, I escaped the escape tunnell Piero --===============6551184866429564687==--