Hi *,
sometimes I open some text file just for reference or to copy something from it. I’d like to open those read-only to avoid erronously introducing changes. Could not find some easy way up to now. Which bright red button in front of me did I miss?
-Moss- -- Debugging? Klingons do not debug. Our software does not coddle the weak. – not by Peter Dyballa (as he vows)
On 2 Oct 2019, at 16:17, Martin Wilhelm Leidig wrote:
sometimes I open some text file just for reference or to copy something from it. I’d like to open those read-only to avoid erronously introducing changes. Could not find some easy way up to now. Which bright red button in front of me did I miss?
There is no way to open a file as read-only.
Partly for technical reasons, as we support running commands, and TextMate can’t be sure that a command won’t make changes to the file, but not allowing to run commands at all (for r/o files) would remove things like Git actions, word statistics, diff’ing, etc.
But I’m currently doing some refactoring and will consider how feasible it is to at least have a read-only mode that disallows the built-in mutating actions; the problem here is only that such mode is rarely used so I don’t want hundreds of actions to have special code to test for read-only mode, hence only if the impact on code can be minimal would I want to support this.
Am 19-10-14 um 09:15 schrieb Allan Odgaard mailinglist@textmate.org:
On 2 Oct 2019, at 16:17, Martin Wilhelm Leidig wrote:
sometimes I open some text file just for reference or to copy something from it. I’d like to open those read-only to avoid erronously introducing changes. Could not find some easy way up to now. Which bright red button in front of me did I miss?
There is no way to open a file as read-only.
Partly for technical reasons, as we support running commands, and TextMate can’t be sure that a command won’t make changes to the file, but not allowing to run commands at all (for r/o files) would remove things like Git actions, word statistics, diff’ing, etc.
Why would forbidding to write the file back remove anything?
But I’m currently doing some refactoring and will consider how feasible it is to at least have a read-only mode that disallows the built-in mutating actions; the problem here is only that such mode is rarely used so I don’t want hundreds of actions to have special code to test for read-only mode, hence only if the impact on code can be minimal would I want to support this.
Well … how many subroutines are there in TM2 that write a file from memory back to the medium it was read from? Hardly more than one; my mileage may vary. But if so, and if that one would look at some r/o flag of the file in question and just not do anything if TRUE I’d be completely happy … I think.
Regards,
-Moss- -- Martin Wilhelm Leidig
On 14 Oct 2019, at 20:11, Martin Wilhelm Leidig wrote:
Why would forbidding to write the file back remove anything?
That is not what I understand by a read-only mode. If a file is opened as read-only, the user should not be allowed to make any edits.
If you are happy with just a warning/dialog during save, you can `chmod u-w` a file, and TextMate will not allow you to save it without first confirming that you want to make the file writable.
You can make a command that toggles the `w` flag for the current file and bind it to a hotkey, for example something like:
#!/bin/sh
if test -z "$TM_FILEPATH"; then echo "There is no file" elif test -w "$TM_FILEPATH"; then chmod u-w "$TM_FILEPATH" && echo "$TM_DISPLAYNAME is now read-only" else chmod u+w "$TM_FILEPATH" && echo "$TM_DISPLAYNAME is now writeable" fi
Set the command’s output to show as tool tip, then you get informed about the new state of the current file after toggling ro/rw mode.
Personally I am on occasion irritated by Apple's Nanny-Behaviour, but there is really nothing (much) wrong with jumping through a few hoops
reboot disable SIP reboot remount / as Read and Write modify the Postfix Plist reboot enable SIP reboot
once for every major MacOS revision :-)-O
el
On 15/10/2019 12:57, Allan Odgaard wrote:
On 14 Oct 2019, at 20:11, Martin Wilhelm Leidig wrote:
Why would forbidding to write the file back remove anything?
That is not what I understand by a read-only mode. If a file is opened as read-only, the user should not be allowed to make any edits.
[...]
Allan,
am 19-10-15 um 12:57 schrieb Allan Odgaard mailinglist@textmate.org:
You can make a command that toggles the w flag for the current file and bind it to a hotkey,
[…]
Set the command’s output to show as tool tip, then you get informed about the new state of the current file after toggling ro/rw mode.
Neat. Exactly what I want. Thank you!
Regards,
-Moss- -- Martin Wilhelm Leidig
I was going to suggest just Finder-locking the file. m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 13! http://shop.oreilly.com/product/0636920310075.do iOS 13 Fundamentals! http://shop.oreilly.com/product/0636920310068.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On Oct 15, 2019, at 9:00 AM, Martin Wilhelm Leidig listwatch@moss.in-berlin.de wrote:
Allan,
am 19-10-15 um 12:57 schrieb Allan Odgaard mailinglist@textmate.org:
You can make a command that toggles the w flag for the current file and bind it to a hotkey,
[…]
Set the command’s output to show as tool tip, then you get informed about the new state of the current file after toggling ro/rw mode.
Neat. Exactly what I want. Thank you!
Regards,
-Moss-
Martin Wilhelm Leidig
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
Am 19-10-15 um 18:00 schrieb Martin Wilhelm Leidig listwatch@moss.in-berlin.de:
Exactly what I want.
Reconsidering, it’s not what I want. This manipulates the file mode, so it is locked globally (for it’s owner), and if I unlock it there it’s unlocked again for TM (and globally).
Just inhibiting to save the file would do the trick locally in TM. One might call that a more/less mode.
Hmm. Maybe I’d just use Alpha for that.
Regards,
-Moss- -- Martin Wilhelm Leidig
Maybe the script should save a read only *copy* into temp and open that? m.
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 13! http://shop.oreilly.com/product/0636920310075.do iOS 13 Fundamentals! http://shop.oreilly.com/product/0636920310068.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On Oct 15, 2019, at 1:56 PM, Martin Wilhelm Leidig listwatch@moss.in-berlin.de wrote:
Am 19-10-15 um 18:00 schrieb Martin Wilhelm Leidig listwatch@moss.in-berlin.de:
Exactly what I want.
Reconsidering, it’s not what I want. This manipulates the file mode, so it is locked globally (for it’s owner), and if I unlock it there it’s unlocked again for TM (and globally).
Just inhibiting to save the file would do the trick locally in TM. One might call that a more/less mode.
Hmm. Maybe I’d just use Alpha for that.
Regards,
-Moss-
Martin Wilhelm Leidig
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
Allan,
I don't know how to capture an open pulldown so I took a photo :-)-O
When I right click perl (to tidy up) I see that there is an additional line between items on the second pull down and there are run ins between long text and commands.
This is the case for all selection.
I have increased the font size of the status bar, in terms of our previous conversation after which you added this feature in December last year.
But resetting it
defaults write com.macromates.TextMate statusBarFontSize 12
makes no difference.
Is a feature?
greetings, el
Wiadomość napisana przez Dr Eberhard W Lisse el@lisse.na w dniu 17/10/2019, o godz. 08:58:
I don't know how to capture an open pulldown so I took a photo :-)-O
Command-Control-3 takes screenshot of the whole screen, regardless of menus open etc. Command-Control-4 allows to choose a part of the screen.
On my 12 inch Catalina it's Shift-Command-3/4
:-)-O
el
On 2019-10-19 12:08 , Rafał Komorowski wrote:
Wiadomość napisana przez Dr Eberhard W Lisse el@lisse.na w dniu 17/10/2019, o godz. 08:58:
I don't know how to capture an open pulldown so I took a photo :-)-O
Command-Control-3 takes screenshot of the whole screen, regardless of menus open etc. Command-Control-4 allows to choose a part of the screen.
TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate
I'm seeing this too. It's not happening to every single menu item, but quite a lot of them.
Walter
On Oct 17, 2019, at 2:58 AM, Dr Eberhard W Lisse el@lisse.na wrote:
Allan,
I don't know how to capture an open pulldown so I took a photo :-)-O
When I right click perl (to tidy up) I see that there is an additional line between items on the second pull down and there are run ins between long text and commands.
This is the case for all selection.
I have increased the font size of the status bar, in terms of our previous conversation after which you added this feature in December last year.
But resetting it
defaults write com.macromates.TextMate statusBarFontSize 12
makes no difference.
Is a feature?
greetings, el
-- Dr. Eberhard W. Lisse \ / Obstetrician & Gynaecologist el@lisse.NA / * | Telephone: +264 81 124 6733 (cell) PO Box 8421 \ / Bachbrecht 10007, Namibia ;____/
<popup.jpg> _______________________________________________ TextMate mailing list TextMate@lists.macromates.com https://lists.macromates.com/listinfo/textmate