Dear all,
I'm a big fan of TextMate and a longtime user, but have only recently completely abandoned Emacs and seen the light. :-) While TextMate really lives up to my wildest dreams as a text editor, I have found that there are a couple of little things that I miss. I write a lot of fiction, and while editing I've found that the Emacs function "kill-sentence" is extremely useful. I was wondering how difficult it would be to implement something like this in TextMate, i.e. a command that would either cut or select the *current sentence*... in the same way that one can select the current word or paragraph. It seems like there should be a way to define this using the appropriate scope, but I'm such a nuubie that I'm afraid to start poking around... Getting this to work in e.g. Markdown mode (where I do most of my writing) would be enough. Any ideas?
thanks in advance,
-- Hannu Rajaniemi
On 6. Nov 2006, at 12:53, Hannu Rajaniemi wrote:
[...] Getting this to work in e.g. Markdown mode (where I do most of my writing) would be enough. Any ideas?
The only non-trivial part here is to define “sentence”, does a sentence start at the beginning of a line or after punctuation, and end at end of line or after punctuation? How about abbreviations like e.g. that one, should it have a list of such exceptions or spot them based on simple patterns, etc.
On 11/6/06, Allan Odgaard throw-away-1@macromates.com wrote:
On 6. Nov 2006, at 12:53, Hannu Rajaniemi wrote:
[...] Getting this to work in e.g. Markdown mode (where I do most of my writing) would be enough. Any ideas?
The only non-trivial part here is to define "sentence", does a sentence start at the beginning of a line or after punctuation, and end at end of line or after punctuation? How about abbreviations like e.g. that one, should it have a list of such exceptions or spot them based on simple patterns, etc.
IIRC Emacs considers that a sentence ends with a period followed with either 2 spaces, a linefeed or a formfeed character.
-- Max
On 11/6/06, Allan Odgaard throw-away-1@macromates.com wrote:
On 6. Nov 2006, at 12:53, Hannu Rajaniemi wrote:
[...] Getting this to work in e.g. Markdown mode (where I do most of my writing) would be enough. Any ideas?
The only non-trivial part here is to define "sentence", does a sentence start at the beginning of a line or after punctuation, and end at end of line or after punctuation? How about abbreviations like e.g. that one, should it have a list of such exceptions or spot them based on simple patterns, etc.
IIRC Emacs considers that a sentence ends with a period followed with either 2 spaces, a linefeed or a formfeed character.
The tricky thing is e.g. that if you write German usually you don't type two spaces after a period to indicate that is the end of a sentence. So, by my opinion, it is very difficult to define what is a 'sentence'.
Cheers,
Hans
On 11/6/06, Hans-Joerg Bibiko bibiko@eva.mpg.de wrote:
IIRC Emacs considers that a sentence ends with a period followed with either 2 spaces, a linefeed or a formfeed character.
The tricky thing is e.g. that if you write German usually you don't type two spaces after a period to indicate that is the end of a sentence. So, by my opinion, it is very difficult to define what is a 'sentence'.
Indeed. Actually, I don't think you actually do that in any language except Emacs (and perhaps LaTeX).
-- Max
2 spaces after a period is a relic left over from the days of typewriters. Modern screen fonts no longer require the second space and, although high school typing classes teach it, it goes against typographic principles.
On Nov 6, 2006, at 7:29 AM, Max Noel wrote:
On 11/6/06, Hans-Joerg Bibiko bibiko@eva.mpg.de wrote:
IIRC Emacs considers that a sentence ends with a period followed
with
either 2 spaces, a linefeed or a formfeed character.
The tricky thing is e.g. that if you write German usually you don't type two spaces after a period to indicate that is the end of a sentence. So, by my opinion, it is very difficult to define what is a 'sentence'.
Indeed. Actually, I don't think you actually do that in any language except Emacs (and perhaps LaTeX).
-- Max
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
As I understand it: In the Old Days (when there were typesetting SYSTEMS) an inputted period, then space would be recognized as an "End Of Sentence Character." That space after the period would be treated differently than an ordinary word space. In the middle of a paragraph, it might perhaps be a bit wider than a "normal" word space. There is no reason whatever that current "Desktop Publishing Tools" (like Quark or InDesign) couldn't include such rules, but as far as I can tell they don't. Until they DO, saying that "one" word space after a full stop is good enough is not going to satisfy me!
Personally, I find a single space after a period to be too indistinct a break, but two spaces seem a bit too much.
Different Countries/Cultures seem to have different preferences too. (I live in the U.S) ... reading a book not just "printed" but TYPESET in the U.K. drives my crazy.They seem not use almost no space between sentence.Is that hard to read, or what?
eo
On Nov 6, 2006, at 5:39 AM, Brett Terpstra wrote:
2 spaces after a period is a relic left over from the days of typewriters. Modern screen fonts no longer require the second space and, although high school typing classes teach it, it goes against typographic principles.
On Nov 6, 2006, at 7:29 AM, Max Noel wrote:
On 11/6/06, Hans-Joerg Bibiko bibiko@eva.mpg.de wrote:
IIRC Emacs considers that a sentence ends with a period
followed with
either 2 spaces, a linefeed or a formfeed character.
The tricky thing is e.g. that if you write German usually you don't type two spaces after a period to indicate that is the end of a sentence. So, by my opinion, it is very difficult to define what is a 'sentence'.
Indeed. Actually, I don't think you actually do that in any language except Emacs (and perhaps LaTeX).
-- Max
On 11/7/06, Eric O'Brien ericob@possibilityengine.com wrote:
Different Countries/Cultures seem to have different preferences too. (I live in the U.S) ... reading a book not just "printed" but TYPESET in the U.K. drives my crazy.They seem not use almost no space between sentence.Is that hard to read, or what?
eo
Huh? I've read a fair amount of British-made books, and none of them had that "feature". Actually, I don't think I've ever come across such a book, either in English or my native French.
-- Max
On 6 Nov 2006, at 14:29, Max Noel wrote:
On 11/6/06, Hans-Joerg Bibiko bibiko@eva.mpg.de wrote:
IIRC Emacs considers that a sentence ends with a period followed
with
either 2 spaces, a linefeed or a formfeed character.
The tricky thing is e.g. that if you write German usually you don't type two spaces after a period to indicate that is the end of a sentence. So, by my opinion, it is very difficult to define what is a 'sentence'.
Indeed. Actually, I don't think you actually do that in any language except Emacs (and perhaps LaTeX).
As far as I know, in former times usually you type two spaces after a period if you wrote with monospaced fonts. But I believe this is nowadays obsolete.
Hans
As for the begining of a sentence… How about : A comma followed by one space followed by a capital letter… That should do it :-) (you can always think of seldom exceptions, but still…)
On Nov 6, 2006, at 8:29 AM, Max Noel wrote:
Indeed. Actually, I don't think you actually do that in any language except Emacs (and perhaps LaTeX).
Here in the US, at least when I was in high school in the late 80s, we were always taught to type two spaces after a sentence-terminating period (both on typewriters and computers). In the years since, I have surmised through reading and talking to people that this is a US- specific trait.
And Emacs and LaTeX are both products of US programmers, right? Richard Stallman and Leslie Lamport (and LaTeX based on Donald Knuth's TeX, another American). Could just be that's how they were taught...
-dan
Indeed. Actually, I don't think you actually do that in any language except Emacs (and perhaps LaTeX).
And Emacs and LaTeX are both products of US programmers, right? Richard Stallman and Leslie Lamport (and LaTeX based on Donald Knuth's TeX, another American). Could just be that's how they were taught...
AFAIK LaTeX ignores any white space greater than one single " "?!
Dan
On Nov 6, 2006, at 1:56 PM, Daniel Käsmayr wrote:
AFAIK LaTeX ignores any white space greater than one single " "?!
On the output, LaTeX leaves a larger space after a dot if it perceives it to be the end of a sentence. That's why there's some tricks to make sure that "Dr. Skiadas" will be spaced properly etc.
It is pretty smart overall, I can't remember all the details.
Dan
Haris
Charilaos Skiadas wrote:
On Nov 6, 2006, at 1:56 PM, Daniel Käsmayr wrote:
AFAIK LaTeX ignores any white space greater than one single " "?!
On the output, LaTeX leaves a larger space after a dot if it perceives it to be the end of a sentence. That's why there's some tricks to make sure that "Dr. Skiadas" will be spaced properly etc.
It is pretty smart overall, I can't remember all the details.
LaTeX actually makes a space slightly wider than a regular space after the end of a sentence, but narrower than two spaces. But in LaTeX source, you can use as many spaces as you want.