Re: Per document tab widths

2011-07-28 Thread Steve Samuels
Here's a script that to set the tab width for a document with a
dialog.

--CODE BEGINS
(* Set document tab width in BBEdit
Most is copied from Marcus Garvey's message #7 at
http://macscripter.net/viewtopic.php?pid=100407
*)
tell application BBEdit
repeat
set dialogResult to (display dialog Enter a starting number: default
answer )
try
set startNumber to (text returned of dialogResult) as number
if (class of startNumber is integer) then exit repeat
end try
display dialog The starting number needs to be a valid integer!
buttons {Enter again, Cancel} default button 1
end repeat
set tab width of window 1 of text document 1 to startNumber
end tell
--CODE ENDS


On Jul 27, 1:40 pm, Watts Martin lay...@gmail.com wrote:
 Bruce Van Allen wrote:
  On 2011-07-26, Watts Martin wrote:

  As near as I can tell, there's no way to adjust the tab width for a
  document at *all* -- you can only change the editor default and the
  per-language setting. I'm surprised, thinking about it, that tab width
  isn't adjustable via the per-document Text Options. (And a little
  surprised those aren't saved with documents.)

  What? Those things work over here (BBEdit 10, OS X 10.7, and worked for
  years).

  I use this applescript saved in scripts folder, with Control-Tab set as
  keyboard command:

 That will certainly work; thank you.

 I suppose to be precise I should have said there appeared to be no UI
 control to adjust the tab width on a document-level basis. It's great
 that BBEdit has the scripting support that it does, but I'm also bemused
 at times by how often scripting seems to be the *only* way to do
 something that seems relatively trivial, like set tab widths for the
 current document. :)

 In any case, this is reinforcing my earlier thought that there really
 needs to be a BBEdit Tips  Tricks wiki, that allows attachments for
 scripts, snippets (and now packages).

 --
 Watts Martin lay...@gmail.com

  smime.p7s
 5KViewDownload

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-28 Thread Steve Samuels
I put a script set tab widths via a dialog at:
http://www.mediafire.com/?ndchk0imd9u9o

--
Steve

On Jul 27, 12:11 pm, Rod Buchanan rod_li...@kdsi.net wrote:
 On Jul 26, 2011, at 8:23 PM, Watts Martin wrote:

  Kendall Conrad wrote:

  I don't have BBEdit 10, but for 9, you go to Languages, then Options
  to get to those settings.

  Yep, there's an equivalent in BBEdit 10 (it's shuffled a bit), but that's 
  not actually going to help with my use case: I need some HTML files to have 
  tab width 4 and some to have tab width 2. I was hoping there was a way to 
  set that for a *document,* not a language type, and have that setting be 
  sticky (saved in the document's resource fork, or whatever).

  As near as I can tell, there's no way to adjust the tab width for a 
  document at *all* -- you can only change the editor default and the 
  per-language setting. I'm surprised, thinking about it, that tab width 
  isn't adjustable via the per-document Text Options. (And a little surprised 
  those aren't saved with documents.)

 Look at View - Text Display - Show Fonts.

 --
 Rod

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-28 Thread hermione_havanese
My problem is the opposite, sort of. After upgrading to Lion, new text
is detabbed, but I want it tabbed. I've looked in every preference,
but can't find it. Every time I hit tab, I get three spaces.

Can anyone help?

Thanks.

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Bruce Van Allen

On 2011-07-26, Watts Martin wrote:

As near as I can tell, there's no way to adjust the tab width 
for a document at *all* -- you can only change the editor 
default and the per-language setting. I'm surprised, thinking 
about it, that tab width isn't adjustable via the per-document 
Text Options. (And a little surprised those aren't saved with documents.)


What? Those things work over here (BBEdit 10, OS X 10.7, and 
worked for years).


I use this applescript saved in scripts folder, with Control-Tab 
set as keyboard command:


tell application BBEdit
set tabW to tab width of text window 1
if tabW  64 then
set tabW to 4
else
set tabW to tabW + 12
end if
set tab width of text window 1 to tabW
end tell


This allows cycling through increasingly wider tab separations, 
per document. Adjust your increment as desired (that's the '+ 
12'), as well as the maximum (64 here) before it reverts to 
minimum. Tab width is sticky, so a file keeps the last width I set.


HTH.



   - Bruce

_bruce__van_allen__santa_cruz_ca_

--
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.

Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Doug McNutt
At 10:40 -0700 7/27/11, Watts Martin wrote:
Bruce Van Allen wrote, and I snipped:

I suppose to be precise I should have said there appeared to be no UI control 
to adjust the tab width on a document-level basis.


Just in case anyone at Bare Bones cares:

While you're making tab width adjustable on a per file basis it would really be 
great if you could arrange for tab stops as in a real typewriter.  I am 
continually frustrated with columnar data that demands a wide column on the 
left side - full names for example - followed by a couple of small width 
columns like date and $. Multiple tab characters cannot be used because the 
final destination of the file won't accept them.

The alternative is a full fledged spreadsheet but I really don't need that just 
to look at, yeah and modify, the data.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread David Kelly
On Wed, Jul 27, 2011 at 12:04:32PM -0600, Doug McNutt wrote:
 
 Just in case anyone at Bare Bones cares:
 
 While you're making tab width adjustable on a per file basis it would
 really be great if you could arrange for tab stops as in a real
 typewriter.  I am continually frustrated with columnar data that
 demands a wide column on the left side - full names for example -
 followed by a couple of small width columns like date and $. Multiple
 tab characters cannot be used because the final destination of the
 file won't accept them.
 
 The alternative is a full fledged spreadsheet but I really don't need
 that just to look at, yeah and modify, the data.

Sounds as if you are asking to further blur the difference between a
text editor and a word processor.

Am not sure if Nisus still behaves the way it originally did, but it was
a word processor that left the data fork as pure text while putting all
formatting metadata in the resource fork. Originators of QUED/M, which
for me was replaced by BBEdit.

Looks like QUED/M is gone: http://www.nisus.com/

-- 
David Kelly N4HHE, dke...@hiwaay.net

Whom computers would destroy, they must first drive mad.

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Doug McNutt
At 13:13 -0500 7/27/11, David Kelly wrote:
On Wed, Jul 27, 2011 at 12:04:32PM -0600, Doug McNutt wrote:
 
 Just in case anyone at Bare Bones cares:
 
 While you're making tab width adjustable on a per file basis it would
 really be great if you could arrange for tab stops as in a real
 typewriter.  I am continually frustrated with columnar data that
 demands a wide column on the left side - full names for example -
 followed by a couple of small width columns like date and $. Multiple
 tab characters cannot be used because the final destination of the
 file won't accept them.
 
 The alternative is a full fledged spreadsheet but I really don't need
 that just to look at, yeah and modify, the data.

Sounds as if you are asking to further blur the difference between a
text editor and a word processor.

Am not sure if Nisus still behaves the way it originally did, but it was
a word processor that left the data fork as pure text while putting all
formatting metadata in the resource fork. Originators of QUED/M, which
for me was replaced by BBEdit.

I still use Nisus  5 or so on this OS 9 box.  As of OS 10 Nisus became just 
another markup based word processor. Really good for right to left Arabic with 
included left to right Arabic numbers..

I even have a preset resource file into which I can redirect a data fork that 
is an assembly language listing for a 68HC11 microprocessor. Variable width 
tabs are really nice for that. I can even word wrap comments into new lines 
that begin at the rightmost tab.

I'd really rather use BBEdit on Apple's OS 10. (Which sort of keeps this on 
topic.)
-- 

   Fe++
//  \
Fe++  Fe++
  |   ||
Fe++  Fe++
   \\/
   Fe++

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Watts Martin

David Kelly wrote:


In my old age I've come to prefer hard spaces so that nobody comes
along and messes up my formatting just because they used a different tab
value.


This is what eventually converted me to the spaces side of the spaces 
vs. tabs argument. :)


(That, and Python coding -- while I know tabs are allowed, they seem to 
be strongly frowned on in terms of coding style, probably because 
messing up formatting due to differing tab values will actually break 
Python code, not just make it look ugly!)


--
Watts Martin lay...@gmail.com



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Per document tab widths

2011-07-27 Thread Rod Buchanan
On Jul 26, 2011, at 8:23 PM, Watts Martin wrote:

 Kendall Conrad wrote:
 
 I don't have BBEdit 10, but for 9, you go to Languages, then Options
 to get to those settings.
 
 Yep, there's an equivalent in BBEdit 10 (it's shuffled a bit), but that's not 
 actually going to help with my use case: I need some HTML files to have tab 
 width 4 and some to have tab width 2. I was hoping there was a way to set 
 that for a *document,* not a language type, and have that setting be sticky 
 (saved in the document's resource fork, or whatever).
 
 As near as I can tell, there's no way to adjust the tab width for a document 
 at *all* -- you can only change the editor default and the per-language 
 setting. I'm surprised, thinking about it, that tab width isn't adjustable 
 via the per-document Text Options. (And a little surprised those aren't saved 
 with documents.)

Look at View - Text Display - Show Fonts.

-- 
Rod

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Rod Buchanan
On Jul 26, 2011, at 8:23 PM, Watts Martin wrote:

 Kendall Conrad wrote:
 
 I don't have BBEdit 10, but for 9, you go to Languages, then Options
 to get to those settings.
 
 Yep, there's an equivalent in BBEdit 10 (it's shuffled a bit), but that's not 
 actually going to help with my use case: I need some HTML files to have tab 
 width 4 and some to have tab width 2. I was hoping there was a way to set 
 that for a *document,* not a language type, and have that setting be sticky 
 (saved in the document's resource fork, or whatever).
 
 As near as I can tell, there's no way to adjust the tab width for a document 
 at *all* -- you can only change the editor default and the per-language 
 setting. I'm surprised, thinking about it, that tab width isn't adjustable 
 via the per-document Text Options. (And a little surprised those aren't saved 
 with documents.)

Look at View - Text Display - Show Fonts.

-- 
Rod

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Per document tab widths

2011-07-26 Thread Watts Martin
One of my clients has decided that PHP documents should use 4-space 
tabs, while PHP *templates* should use 2-space tabs. Is there a way to 
set (ideally persistently) tab width on a per-document basis in BBEdit 
10 other than using the Emacs variable block? (I'd thought that was in 
either Text Options or Document Options in BBEdit 9, although a 
quick check of TextWrangler suggests that's my imagination.)


--
Watts Martin lay...@gmail.com



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Per document tab widths

2011-07-26 Thread Kendall Conrad
I don't have BBEdit 10, but for 9, you go to Languages, then Options
to get to those settings.

-Kendall


On Jul 26, 4:34 pm, Watts Martin lay...@gmail.com wrote:
 One of my clients has decided that PHP documents should use 4-space
 tabs, while PHP *templates* should use 2-space tabs. Is there a way to
 set (ideally persistently) tab width on a per-document basis in BBEdit
 10 other than using the Emacs variable block? (I'd thought that was in
 either Text Options or Document Options in BBEdit 9, although a
 quick check of TextWrangler suggests that's my imagination.)

 --
 Watts Martin lay...@gmail.com

  smime.p7s
 5KViewDownload

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-26 Thread Watts Martin

Kendall Conrad wrote:


I don't have BBEdit 10, but for 9, you go to Languages, then Options
to get to those settings.


Yep, there's an equivalent in BBEdit 10 (it's shuffled a bit), but 
that's not actually going to help with my use case: I need some HTML 
files to have tab width 4 and some to have tab width 2. I was hoping 
there was a way to set that for a *document,* not a language type, and 
have that setting be sticky (saved in the document's resource fork, or 
whatever).


As near as I can tell, there's no way to adjust the tab width for a 
document at *all* -- you can only change the editor default and the 
per-language setting. I'm surprised, thinking about it, that tab width 
isn't adjustable via the per-document Text Options. (And a little 
surprised those aren't saved with documents.)


--
Watts Martin lay...@gmail.com



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Per document tab widths

2011-07-26 Thread Steve Samuels
I don't know anything about PHP, but if  documents and templates
have different file extensions, you could write an attachment script
to set tab width to the number appropriate to the extension. Write
the script to run when a document is opened or saved. See the Manual
section on Using Attachment Scripts.

Steve

On Jul 26, 9:23 pm, Watts Martin lay...@gmail.com wrote:
 Kendall Conrad wrote:
  I don't have BBEdit 10, but for 9, you go to Languages, then Options
  to get to those settings.

 Yep, there's an equivalent in BBEdit 10 (it's shuffled a bit), but
 that's not actually going to help with my use case: I need some HTML
 files to have tab width 4 and some to have tab width 2. I was hoping
 there was a way to set that for a *document,* not a language type, and
 have that setting be sticky (saved in the document's resource fork, or
 whatever).

 As near as I can tell, there's no way to adjust the tab width for a
 document at *all* -- you can only change the editor default and the
 per-language setting. I'm surprised, thinking about it, that tab width
 isn't adjustable via the per-document Text Options. (And a little
 surprised those aren't saved with documents.)

 --
 Watts Martin lay...@gmail.com

  smime.p7s
 5KViewDownload

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-26 Thread Steve Samuels
I don't know anything about PHP, but if the documents and
templates have different file extensions, you could write an
attachment script to set tab width to the number appropriate to the
extension. Write the script to run when a document is opened or saved.
See the Manual section on Using Attachment Scripts.

Steve

On Jul 26, 9:23 pm, Watts Martin lay...@gmail.com wrote:
 Kendall Conrad wrote:
  I don't have BBEdit 10, but for 9, you go to Languages, then Options
  to get to those settings.

 Yep, there's an equivalent in BBEdit 10 (it's shuffled a bit), but
 that's not actually going to help with my use case: I need some HTML
 files to have tab width 4 and some to have tab width 2. I was hoping
 there was a way to set that for a *document,* not a language type, and
 have that setting be sticky (saved in the document's resource fork, or
 whatever).

 As near as I can tell, there's no way to adjust the tab width for a
 document at *all* -- you can only change the editor default and the
 per-language setting. I'm surprised, thinking about it, that tab width
 isn't adjustable via the per-document Text Options. (And a little
 surprised those aren't saved with documents.)

 --
 Watts Martin lay...@gmail.com

  smime.p7s
 5KViewDownload

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit