unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to open a file in sh-mode
@ 2008-08-14  7:53 Francis Moreau
  2008-08-14  8:16 ` Henrik Austad
  2008-08-14  8:26 ` David Hansen
  0 siblings, 2 replies; 33+ messages in thread
From: Francis Moreau @ 2008-08-14  7:53 UTC (permalink / raw
  To: gnu-emacs-help

Hello,

I'm trying to open a file with emacs automatically set on sh-mode.
The file name can't be used to guess that emacs should be in sh-mode
when opening it.

So I tried:

$ emacs -f sh-mode foo

But that doesn't work.

Could anybody give me some advices ?

Thanks
-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  7:53 How to open a file in sh-mode Francis Moreau
@ 2008-08-14  8:16 ` Henrik Austad
  2008-08-14  9:03   ` Francis Moreau
  2008-08-14  8:26 ` David Hansen
  1 sibling, 1 reply; 33+ messages in thread
From: Henrik Austad @ 2008-08-14  8:16 UTC (permalink / raw
  To: help-gnu-emacs

On Thursday 14 August 2008 09:53:39 Francis Moreau wrote:
> Hello,
>
> I'm trying to open a file with emacs automatically set on sh-mode.
> The file name can't be used to guess that emacs should be in sh-mode
> when opening it.
>
> So I tried:
>
> $ emacs -f sh-mode foo
>
> But that doesn't work.
>
> Could anybody give me some advices ?

1) which version of emacs are you using?
2) is it a valid-sh file? i.e. does it start with #!/bin/bash on the first 
line?
3) have you enabled syntax-highlighting in the first place? 
if unsure, add
 (global-font-lock-mode t)
to your ~/.emacs 


I've testet a file foo with the following content

#!/bin/bash
echo "Hello World"

and emacs syntax-highlight this with versions 21, 22, 23.0.50 and 23.0.60 
(although I expect that if it works in one version, it'll work in all).


-- 
Med vennlig hilsen - Yours Sincerely
Henrik Austad




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  7:53 How to open a file in sh-mode Francis Moreau
  2008-08-14  8:16 ` Henrik Austad
@ 2008-08-14  8:26 ` David Hansen
  2008-08-14  9:04   ` Francis Moreau
  1 sibling, 1 reply; 33+ messages in thread
From: David Hansen @ 2008-08-14  8:26 UTC (permalink / raw
  To: help-gnu-emacs

On Thu, 14 Aug 2008 09:53:39 +0200 Francis Moreau wrote:

> Could anybody give me some advices ?

Put "#!/bin/sh" or "# -*- mode: sh; -*-" in the first line of the file.

David





^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
       [not found] <mailman.16658.1218700648.18990.help-gnu-emacs@gnu.org>
@ 2008-08-14  8:28 ` Sebastian Kaps
  2008-08-14 10:29 ` Xah
  1 sibling, 0 replies; 33+ messages in thread
From: Sebastian Kaps @ 2008-08-14  8:28 UTC (permalink / raw
  To: help-gnu-emacs

// Francis Moreau writes:

> I'm trying to open a file with emacs automatically set on sh-mode.
> The file name can't be used to guess that emacs should be in sh-mode
> when opening it.

Put
,----
| # -*- mode:sh -*-
`----
 at the beginning of that file.

-- 
Ciao, Sebastian


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  8:16 ` Henrik Austad
@ 2008-08-14  9:03   ` Francis Moreau
  2008-08-14 10:03     ` Henrik Austad
  0 siblings, 1 reply; 33+ messages in thread
From: Francis Moreau @ 2008-08-14  9:03 UTC (permalink / raw
  To: Henrik Austad; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 10:16 AM, Henrik Austad <henrikau@stud.ntnu.no> wrote:
> On Thursday 14 August 2008 09:53:39 Francis Moreau wrote:
>> Hello,
>>
>> I'm trying to open a file with emacs automatically set on sh-mode.
>> The file name can't be used to guess that emacs should be in sh-mode
>> when opening it.
>>
>> So I tried:
>>
>> $ emacs -f sh-mode foo
>>
>> But that doesn't work.
>>
>> Could anybody give me some advices ?
>
> 1) which version of emacs are you using?
> 2) is it a valid-sh file? i.e. does it start with #!/bin/bash on the first
> line?

No, it's actually the file created by fc(1) to edit the bash history.

It uses the FCEDIT env variable to launch the editor it going to use.

So I'd like to set it to:

export FCEDIT="emacs -f sh-mode"

so that fc(1) uses emacs as editor in sh-mode directly.

Note that the name of the temporary file is *appended* to what you
specified in FCEDIT.

-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  8:26 ` David Hansen
@ 2008-08-14  9:04   ` Francis Moreau
  2008-08-14  9:23     ` Thierry Volpiatto
  2008-08-14 10:58     ` Peter Dyballa
  0 siblings, 2 replies; 33+ messages in thread
From: Francis Moreau @ 2008-08-14  9:04 UTC (permalink / raw
  To: help-gnu-emacs

On Thu, Aug 14, 2008 at 10:26 AM, David Hansen <david.hansen@gmx.net> wrote:
> On Thu, 14 Aug 2008 09:53:39 +0200 Francis Moreau wrote:
>
>> Could anybody give me some advices ?
>
> Put "#!/bin/sh" or "# -*- mode: sh; -*-" in the first line of the file.
>

As I previously replied I can't. Please see my answer to Henrik.

But IMHO that's an ugly workaround anyways

Thanks
-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  9:04   ` Francis Moreau
@ 2008-08-14  9:23     ` Thierry Volpiatto
  2008-08-14  9:34       ` Francis Moreau
  2008-08-14 10:58     ` Peter Dyballa
  1 sibling, 1 reply; 33+ messages in thread
From: Thierry Volpiatto @ 2008-08-14  9:23 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs

"Francis Moreau" <francis.moro@gmail.com> writes:

> On Thu, Aug 14, 2008 at 10:26 AM, David Hansen <david.hansen@gmx.net> wrote:
>> On Thu, 14 Aug 2008 09:53:39 +0200 Francis Moreau wrote:
>>
>>> Could anybody give me some advices ?
>>
>> Put "#!/bin/sh" or "# -*- mode: sh; -*-" in the first line of the file.
>>
>
> As I previously replied I can't. Please see my answer to Henrik.
>
> But IMHO that's an ugly workaround anyways

?? starting a shell script without any headers is not very nice i think!
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  9:23     ` Thierry Volpiatto
@ 2008-08-14  9:34       ` Francis Moreau
  0 siblings, 0 replies; 33+ messages in thread
From: Francis Moreau @ 2008-08-14  9:34 UTC (permalink / raw
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 11:23 AM, Thierry Volpiatto
<thierry.volpiatto@gmail.com> wrote:
> "Francis Moreau" <francis.moro@gmail.com> writes:
>
>> On Thu, Aug 14, 2008 at 10:26 AM, David Hansen <david.hansen@gmx.net> wrote:
>>> On Thu, 14 Aug 2008 09:53:39 +0200 Francis Moreau wrote:
>>>
>>>> Could anybody give me some advices ?
>>>
>>> Put "#!/bin/sh" or "# -*- mode: sh; -*-" in the first line of the file.
>>>
>>
>> As I previously replied I can't. Please see my answer to Henrik.
>>
>> But IMHO that's an ugly workaround anyways
>
> ?? starting a shell script without any headers is not very nice i think!

Please have a look in my previous reply to see how is it going to be used...

-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  9:03   ` Francis Moreau
@ 2008-08-14 10:03     ` Henrik Austad
  2008-08-14 10:06       ` Francis Moreau
       [not found]       ` <mailman.16667.1218708430.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 33+ messages in thread
From: Henrik Austad @ 2008-08-14 10:03 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

On Thursday 14 August 2008 11:03:07 Francis Moreau wrote:
> On Thu, Aug 14, 2008 at 10:16 AM, Henrik Austad <henrikau@stud.ntnu.no> 
wrote:
> > On Thursday 14 August 2008 09:53:39 Francis Moreau wrote:
> >> Hello,
> >>
> >> I'm trying to open a file with emacs automatically set on sh-mode.
> >> The file name can't be used to guess that emacs should be in sh-mode
> >> when opening it.
> >>
> >> So I tried:
> >>
> >> $ emacs -f sh-mode foo
> >>
> >> But that doesn't work.
> >>
> >> Could anybody give me some advices ?
> >
> > 1) which version of emacs are you using?
> > 2) is it a valid-sh file? i.e. does it start with #!/bin/bash on the
> > first line?
>
> No, it's actually the file created by fc(1) to edit the bash history.
>
> It uses the FCEDIT env variable to launch the editor it going to use.
>
> So I'd like to set it to:
>
> export FCEDIT="emacs -f sh-mode"
>
> so that fc(1) uses emacs as editor in sh-mode directly.
>
> Note that the name of the temporary file is *appended* to what you
> specified in FCEDIT.

so, basically you are looking for a way of putting #!/bin/bash before the 
output of fc is included?

I don't see any obvious ways of doing this, but, you could, if you wanted to, 
use .bash_history (or the appropriate history-file for your shell) and grep 
for what you want there?

When you set emacs to be the editor, remember that you call emacs with a new 
file as argument, i.e. if you specify foo as a file, emacs will open *both* 
foo and the new file from fc. 

You could, perhaps, add a hook in .emacs as all files created by fc starts 
with [shell]-fc-<numbers>

so basically, I think the question boils down to:

"""
How do I create a hook in my .emacs so that all files starting with bash-fc-* 
will load sh-mode?
"""


-- 
mvh Henrik Austad

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 10:03     ` Henrik Austad
@ 2008-08-14 10:06       ` Francis Moreau
  2008-08-14 11:17         ` David Hansen
  2008-08-14 11:36         ` Henrik Austad
       [not found]       ` <mailman.16667.1218708430.18990.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 10:06 UTC (permalink / raw
  To: henrikau; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 12:03 PM, Henrik Austad <henrikau@stud.ntnu.no> wrote:
>
> so basically, I think the question boils down to:
>
> """
> How do I create a hook in my .emacs so that all files starting with bash-fc-*
> will load sh-mode?
> """
>

Well that would be the last thing I would do.

My question is:

"""
How do I start emacs in sh-mode from the shell with a file name
appended at the end of the command
"""

It doesn't seem to be all that complex !

-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
       [not found] <mailman.16658.1218700648.18990.help-gnu-emacs@gnu.org>
  2008-08-14  8:28 ` How to open a file in sh-mode Sebastian Kaps
@ 2008-08-14 10:29 ` Xah
  2008-09-11  1:35   ` David Combs
  1 sibling, 1 reply; 33+ messages in thread
From: Xah @ 2008-08-14 10:29 UTC (permalink / raw
  To: help-gnu-emacs

On Aug 14, 12:53 am, "Francis Moreau" <francis.m...@gmail.com> wrote:
> Hello,
>
> I'm trying to open a file with emacs automatically set on sh-mode.
> The file name can't be used to guess that emacs should be in sh-mode
> when opening it.

If the file content's first line starts with “#!”, then you could use
the magic-mode-alist.

-----------------------------------
How Emacs Choose Modes

Emacs determines what mode to use primarily by 2 mechanisms, in order:
(1) Check the first line in the file, using “magic-mode-alist”. (2)
Check the file name's suffix, using “auto-mode-alist”.

The “magic-mode-alist” is a list that emacs use to match the first
line of a file with a mode. For example, if you want files that begin
with the line “<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...” to
always use nxml-mode, then add the following to your “.emacs”:

(add-to-list
 'magic-mode-alist
 '("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0" . nxml-mode))

The magic-mode-alist is a list. In the above example, the string with
the “DOCTYPE” is a regex, used to match the first line of a file.

If emacs goes thru magic-mode-alist and didn't find any match, then
it'll use auto-mode-alist to check on file name suffix. The “auto-mode-
alist” associates a file name suffix with a mode. For example, if you
want files ending in “.js” to always open with js2-mode, then do:

(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))

Note: The double backslash in the string “\\.js\\'” is used to escape
the backslash. So, the regex engine just got “\.js\'”. The “\.” is to
match a period. The “\'” is one of emacs special regex syntax, to
match end of a string. (See also: Text Pattern Matching in Emacs)

Reference: Elisp Manual: Regexp-Backslash.

You can see what are the values of magic-mode-alist or auto-mode-alist
by typing “Alt+x describe-variable”.

There are few minor details about how emacs determines what mode to
load, but the above should cover vast majority of needs. For detail,
see emacs manual.

Reference: (info "(emacs)Choosing Modes").

--------------------------------------------
above from:
http://xahlee.org/emacs/emacs_installing_packages.html

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14  9:04   ` Francis Moreau
  2008-08-14  9:23     ` Thierry Volpiatto
@ 2008-08-14 10:58     ` Peter Dyballa
  2008-08-14 11:02       ` Francis Moreau
  1 sibling, 1 reply; 33+ messages in thread
From: Peter Dyballa @ 2008-08-14 10:58 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs


Am 14.08.2008 um 11:04 schrieb Francis Moreau:

>> Put "#!/bin/sh" or "# -*- mode: sh; -*-" in the first line of the  
>> file.
>>
>
> As I previously replied I can't.


You could set up auto-mode-alist to use a particular mode (Shell- 
script mode) for a particular type of file name ...

--
Greetings

   Pete

People say that if you play Microsoft CD's backwards, you hear  
satanic things, but that's nothing, because if you play them  
forwards, they install MS Windows.





^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 10:58     ` Peter Dyballa
@ 2008-08-14 11:02       ` Francis Moreau
  2008-08-14 11:20         ` Lennart Borgman (gmail)
  2008-08-14 12:06         ` Peter Dyballa
  0 siblings, 2 replies; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 11:02 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 12:58 PM, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
> Am 14.08.2008 um 11:04 schrieb Francis Moreau:
>
>>> Put "#!/bin/sh" or "# -*- mode: sh; -*-" in the first line of the file.
>>>
>>
>> As I previously replied I can't.
>
>
> You could set up auto-mode-alist to use a particular mode (Shell-script
> mode) for a particular type of file name ...
>

yes that would be possible, but I fail to understand why I can't start
emacs in a specific
mode from the command line.

IOW why can't I simply do ?

     $ emacs -f sh-mode FOO

thanks
-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 10:06       ` Francis Moreau
@ 2008-08-14 11:17         ` David Hansen
  2008-08-14 11:36         ` Henrik Austad
  1 sibling, 0 replies; 33+ messages in thread
From: David Hansen @ 2008-08-14 11:17 UTC (permalink / raw
  To: help-gnu-emacs

On Thu, 14 Aug 2008 12:06:59 +0200 Francis Moreau wrote:

> """
> How do I start emacs in sh-mode from the shell with a file name
> appended at the end of the command
> """

emacs --eval '(progn (find-file "tmp/tst.c") (sh-mode))'

You'll have to write some wrapper script for your use in an env var.

> It doesn't seem to be all that complex!

It will become complex when the file name contains special characters
(mixing sh and emacs quoting is very nasty and I don't know about any
solution).

David






^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 11:02       ` Francis Moreau
@ 2008-08-14 11:20         ` Lennart Borgman (gmail)
  2008-08-14 11:36           ` Francis Moreau
  2008-08-14 12:06         ` Peter Dyballa
  1 sibling, 1 reply; 33+ messages in thread
From: Lennart Borgman (gmail) @ 2008-08-14 11:20 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs

Francis Moreau wrote:
> yes that would be possible, but I fail to understand why I can't start
> emacs in a specific
> mode from the command line.
> 
> IOW why can't I simply do ?
> 
>      $ emacs -f sh-mode FOO

Because you are doing it in the wrong order. sh-mode will apply to the 
current buffer. Try

   $emacs FOO -f sh-mode

But ... - do you really want to do this? It means you are using a new 
eamcs instance for every file.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 11:20         ` Lennart Borgman (gmail)
@ 2008-08-14 11:36           ` Francis Moreau
  2008-08-14 11:46             ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 11:36 UTC (permalink / raw
  To: Lennart Borgman (gmail); +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 1:20 PM, Lennart Borgman (gmail)
<lennart.borgman@gmail.com> wrote:
> Francis Moreau wrote:
>>
>> yes that would be possible, but I fail to understand why I can't start
>> emacs in a specific
>> mode from the command line.
>>
>> IOW why can't I simply do ?
>>
>>     $ emacs -f sh-mode FOO
>
> Because you are doing it in the wrong order. sh-mode will apply to the
> current buffer. Try
>
>  $emacs FOO -f sh-mode
>
> But ... - do you really want to do this? It means you are using a new eamcs
> instance for every file.
>

So you mean that I need to this:

$ cat > emacs-ui-is-dumb.sh<<EOF
#! /bin/sh

file=$1; shift
emacs "$@" $file
EOF

and do:

$ export FCEDIT="emacs-ui-is-dumb.sh"

-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 10:06       ` Francis Moreau
  2008-08-14 11:17         ` David Hansen
@ 2008-08-14 11:36         ` Henrik Austad
  2008-08-14 11:51           ` Francis Moreau
  1 sibling, 1 reply; 33+ messages in thread
From: Henrik Austad @ 2008-08-14 11:36 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

On Thursday 14 August 2008 12:06:59 Francis Moreau wrote:
> On Thu, Aug 14, 2008 at 12:03 PM, Henrik Austad <henrikau@stud.ntnu.no> 
wrote:
> > so basically, I think the question boils down to:
> >
> > """
> > How do I create a hook in my .emacs so that all files starting with
> > bash-fc-* will load sh-mode?
> > """
>
> Well that would be the last thing I would do.
>
> My question is:
>
> """
> How do I start emacs in sh-mode from the shell with a file name
> appended at the end of the command
> """
>
> It doesn't seem to be all that complex !

ok, I think I got something that works, thanks to all the guys at #emacs for 
this (ams, pgas, bpalmer)

In .emacs add the following:
(add-to-list 'auto-mode-alist '("bash-fc" . sh-mode))

then;
export FCEDIT="emacs"

then sh-mode will be loaded when you open files starting with bash-fc

as a test;
echo "Hello World" && fc 

-- 
mvh Henrik Austad

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 11:36           ` Francis Moreau
@ 2008-08-14 11:46             ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 33+ messages in thread
From: Lennart Borgman (gmail) @ 2008-08-14 11:46 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs

Francis Moreau wrote:
> On Thu, Aug 14, 2008 at 1:20 PM, Lennart Borgman (gmail)
> <lennart.borgman@gmail.com> wrote:
>> Francis Moreau wrote:
>>> yes that would be possible, but I fail to understand why I can't start
>>> emacs in a specific
>>> mode from the command line.
>>>
>>> IOW why can't I simply do ?
>>>
>>>     $ emacs -f sh-mode FOO
>> Because you are doing it in the wrong order. sh-mode will apply to the
>> current buffer. Try
>>
>>  $emacs FOO -f sh-mode
>>
>> But ... - do you really want to do this? It means you are using a new eamcs
>> instance for every file.
>>
> 
> So you mean that I need to this:
> 
> $ cat > emacs-ui-is-dumb.sh<<EOF
> #! /bin/sh
> 
> file=$1; shift
> emacs "$@" $file
> EOF
> 
> and do:
> 
> $ export FCEDIT="emacs-ui-is-dumb.sh"

I do not think I mean that, but maybe if you try to explain your 
intention ... ;-)




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 11:36         ` Henrik Austad
@ 2008-08-14 11:51           ` Francis Moreau
  2008-08-14 11:57             ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 11:51 UTC (permalink / raw
  To: Henrik Austad; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 1:36 PM, Henrik Austad <henrikau@orakel.ntnu.no> wrote:
> ok, I think I got something that works, thanks to all the guys at #emacs for
> this (ams, pgas, bpalmer)
>
> In .emacs add the following:
> (add-to-list 'auto-mode-alist '("bash-fc" . sh-mode))
>
> then;
> export FCEDIT="emacs"
>
> then sh-mode will be loaded when you open files starting with bash-fc
>
> as a test;
> echo "Hello World" && fc
>

thanks for that but emacs command line option usage look soooo weird


-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 11:51           ` Francis Moreau
@ 2008-08-14 11:57             ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 33+ messages in thread
From: Lennart Borgman (gmail) @ 2008-08-14 11:57 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs

Francis Moreau wrote:
> On Thu, Aug 14, 2008 at 1:36 PM, Henrik Austad <henrikau@orakel.ntnu.no> wrote:
>> ok, I think I got something that works, thanks to all the guys at #emacs for
>> this (ams, pgas, bpalmer)
>>
>> In .emacs add the following:
>> (add-to-list 'auto-mode-alist '("bash-fc" . sh-mode))
>>
>> then;
>> export FCEDIT="emacs"
>>
>> then sh-mode will be loaded when you open files starting with bash-fc
>>
>> as a test;
>> echo "Hello World" && fc
>>
> 
> thanks for that but emacs command line option usage look soooo weird

Maybe, but as I tried to say before: it is emacsclient, not emacs that 
you normally use to open files in Emacs.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 11:02       ` Francis Moreau
  2008-08-14 11:20         ` Lennart Borgman (gmail)
@ 2008-08-14 12:06         ` Peter Dyballa
  2008-08-14 12:22           ` Francis Moreau
  1 sibling, 1 reply; 33+ messages in thread
From: Peter Dyballa @ 2008-08-14 12:06 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs


Am 14.08.2008 um 13:02 schrieb Francis Moreau:

> IOW why can't I simply do ?
>
>      $ emacs -f sh-mode FOO


Could be it needs to be:

	emacs -f '(sh-mode)' FOO

See also the documentation on the function sh-mode.

--
Greetings

   Pete

’Twas a woman who drove me to drink, and I never had the courtesy to  
thank her for it.
				— W.C. Fields







^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 12:06         ` Peter Dyballa
@ 2008-08-14 12:22           ` Francis Moreau
  0 siblings, 0 replies; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 12:22 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 2:06 PM, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
> Am 14.08.2008 um 13:02 schrieb Francis Moreau:
>
>> IOW why can't I simply do ?
>>
>>     $ emacs -f sh-mode FOO
>
>
> Could be it needs to be:
>
>        emacs -f '(sh-mode)' FOO
>
> See also the documentation on the function sh-mode.
>

thanks for the tip.
-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
       [not found]       ` <mailman.16667.1218708430.18990.help-gnu-emacs@gnu.org>
@ 2008-08-14 12:24         ` Giorgos Keramidas
  2008-08-14 13:01           ` Francis Moreau
  0 siblings, 1 reply; 33+ messages in thread
From: Giorgos Keramidas @ 2008-08-14 12:24 UTC (permalink / raw
  To: help-gnu-emacs

On Thu, 14 Aug 2008 12:06:59 +0200, "Francis Moreau" <francis.moro@gmail.com> wrote:
> On Thu, Aug 14, 2008 at 12:03 PM, Henrik Austad <henrikau@stud.ntnu.no> wrote:
>>
>> so basically, I think the question boils down to:
>>
>> """
>> How do I create a hook in my .emacs so that all files starting with bash-fc-*
>> will load sh-mode?
>> """
>
> Well that would be the last thing I would do.
>
> My question is:
>
> """
> How do I start emacs in sh-mode from the shell with a file name
> appended at the end of the command
> """
>
> It doesn't seem to be all that complex !

You can probably write a short wrapper script that is used as $FCEDIT to
run the equivalent of:

    emacs --eval "(setq-default default-major-mode 'sh-mode)" file1 file2 ...

That's a bit like "cheating", but it does work.  You are essentially
firing up Emacs with a default-mode of `sh-mode' for new files, which
is nice for editing shell history output.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 12:24         ` Giorgos Keramidas
@ 2008-08-14 13:01           ` Francis Moreau
  2008-08-14 13:27             ` Giorgos Keramidas
  0 siblings, 1 reply; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 13:01 UTC (permalink / raw
  To: Giorgos Keramidas; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 2:24 PM, Giorgos Keramidas
<keramida@ceid.upatras.gr> wrote:
>
> You can probably write a short wrapper script that is used as $FCEDIT to
> run the equivalent of:
>
>    emacs --eval "(setq-default default-major-mode 'sh-mode)" file1 file2 ...
>

Hmm I don't why I need a wrapper script in that case, do you have an idea ?

If I try without the wrapper I get:

$ export FCEDIT="emacs -nw --eval \"(setq-default default-major-mode
'sh-mode)\""
$ fc

<emacs is started but I get an error in the Messages window>

("emacs" "--eval" "\"(setq-default" "default-major-mode" "'sh-mode)\""
"/tmp/bash-fc-247955888988243")
Loading encoded-kb...done
Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/igrep-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el
(source)...done
Loading easy-mmode...done
Loading easymenu...done
Loading cl-macs...done
Loading paren...done
....
command-line-1: End of file during parsing
Loading cl-seq...done


> That's a bit like "cheating", but it does work.

yes.

-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 13:01           ` Francis Moreau
@ 2008-08-14 13:27             ` Giorgos Keramidas
  2008-08-14 13:48               ` Francis Moreau
  0 siblings, 1 reply; 33+ messages in thread
From: Giorgos Keramidas @ 2008-08-14 13:27 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs

On Thu, 14 Aug 2008 15:01:02 +0200, "Francis Moreau" <francis.moro@gmail.com> wrote:
> On Thu, Aug 14, 2008 at 2:24 PM, Giorgos Keramidas
> <keramida@ceid.upatras.gr> wrote:
>>
>> You can probably write a short wrapper script that is used as $FCEDIT to
>> run the equivalent of:
>>
>>    emacs --eval "(setq-default default-major-mode 'sh-mode)" file1 file2 ...
>>
>
> Hmm I don't why I need a wrapper script in that case, do you have an idea ?
>
> If I try without the wrapper I get:
>
> $ export FCEDIT="emacs -nw --eval \"(setq-default default-major-mode
> 'sh-mode)\""
> $ fc
>
> <emacs is started but I get an error in the Messages window>
>
> ("emacs" "--eval" "\"(setq-default" "default-major-mode" "'sh-mode)\""
> "/tmp/bash-fc-247955888988243")

See how the command-line arguments have been split in multiple places by
the shell that evaluated $FCEDIT?

That's why I suggested a wrapper script.  To avoid all the obnoxiously
stupid things expansion of $FCEDIT would do, and make sure that there is
only *one* level of quoting you would have to use.

The parenthesized list quoted above shows that Emacs tried to --eval the
expression "\"(setq-default", which isn't a complete Lisp s-exp (and
this is what Emacs is trying to say with the error message).

Using a shell wrapper makes expansion of the --eval argument much more
predictable here, so I tend to prefer that:

    $ cat > /tmp/fcedit.sh
    #!/bin/sh
    emacs --eval "(setq-default default-major-mode 'sh-mode)" "$@"
    ^D
    $ chmod 0755 /tmp/fcedit.sh
    $ export FCEDIT='/tmp/fcedit.sh -nw'
    $ fc

I have a few of these wrappers in my `~/bin' directory, to help me fire
up Emacs with a variety of options, i.e.:

    ~/bin/emacs-no-gui

        This runs `emacs -nw "$@"'.

    ~/bin/utf-emacs

        This sets up LANG, and LC_ALL, clears every other LC_XXX locale
        variable, and then fires up Emacs in `utf-8 mode'.

and so on.

I really hate having to fight with backslashes to get everything right
in tons of nested quotes, quoted quotes and quoted-quoted quotes ad
infinitum, so that's why I like throwing a wrapper here and there :)





^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 13:27             ` Giorgos Keramidas
@ 2008-08-14 13:48               ` Francis Moreau
  2008-08-14 14:23                 ` Giorgos Keramidas
  0 siblings, 1 reply; 33+ messages in thread
From: Francis Moreau @ 2008-08-14 13:48 UTC (permalink / raw
  To: Giorgos Keramidas; +Cc: help-gnu-emacs

On Thu, Aug 14, 2008 at 3:27 PM, Giorgos Keramidas
<keramida@ceid.upatras.gr> wrote:
> On Thu, 14 Aug 2008 15:01:02 +0200, "Francis Moreau" <francis.moro@gmail.com> wrote:
>> On Thu, Aug 14, 2008 at 2:24 PM, Giorgos Keramidas
>> <keramida@ceid.upatras.gr> wrote:
>>>
>>> You can probably write a short wrapper script that is used as $FCEDIT to
>>> run the equivalent of:
>>>
>>>    emacs --eval "(setq-default default-major-mode 'sh-mode)" file1 file2 ...
>>>
>>
>> Hmm I don't why I need a wrapper script in that case, do you have an idea ?
>>
>> If I try without the wrapper I get:
>>
>> $ export FCEDIT="emacs -nw --eval \"(setq-default default-major-mode
>> 'sh-mode)\""
>> $ fc
>>
>> <emacs is started but I get an error in the Messages window>
>>
>> ("emacs" "--eval" "\"(setq-default" "default-major-mode" "'sh-mode)\""
>> "/tmp/bash-fc-247955888988243")
>
> See how the command-line arguments have been split in multiple places by
> the shell that evaluated $FCEDIT?
>

hmm not really.

Could you tell me what's wrong here ? IOW how emacs have been launched ?

thanks
-- 
Francis




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 13:48               ` Francis Moreau
@ 2008-08-14 14:23                 ` Giorgos Keramidas
  0 siblings, 0 replies; 33+ messages in thread
From: Giorgos Keramidas @ 2008-08-14 14:23 UTC (permalink / raw
  To: Francis Moreau; +Cc: help-gnu-emacs

On Thu, 14 Aug 2008 15:48:57 +0200, Francis Moreau wrote:
> On Thu, Aug 14, 2008 at 3:27 PM, Giorgos Keramidas wrote:
>> On Thu, 14 Aug 2008 15:01:02 +0200, Francis Moreau wrote:
>>> <emacs is started but I get an error in the Messages window>
>>>
>>> ("emacs" "--eval" "\"(setq-default" "default-major-mode" "'sh-mode)\""
>>> "/tmp/bash-fc-247955888988243")
>>
>> See how the command-line arguments have been split in multiple places by
>> the shell that evaluated $FCEDIT?
>
> hmm not really.
>
> Could you tell me what's wrong here ? IOW how emacs have been launched?

It has been launched with the following command-line arguments:

    arg[0] = "emacs"
    arg[1] = "--eval"
    arg[2] = "\"(setq-default"
    arg[3] = "default-major-mode"
    arg[4] = "'sh-mode)\""
    arg[5] = "/tmp/bash-fc-247955888988243"

The shell that launched $FCEDIT as an editor, looked at its value, saw
that it had space characters in it, and split the $FCEDIT value to
several separate arguments at every unquoted space.

Try firing up Emacs with the following two commands, and look at the
*Messages* buffer to spot the difference:

    emacs -nw "foo" "bar"

    emacs -nw "foo bar"

The first should display:

    ("emacs" "-nw" "foo" "bar")

but the second should display:

    ("emacs" "-nw" "foo bar")

It may be possible to quote FCEDIT's value in some complex manner to
achieve the effect of second list, where the s-exp passed to --eval is a
single entry in the command-line argument list.  Is it worth all the
trouble to get it `right'?  My own personal preference at this point is
to say `No, not really.  I can write a shell wrapper, and be done with
it in half a minute or so' :-)





^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: How to open a file in sh-mode
  2008-08-14 10:29 ` Xah
@ 2008-09-11  1:35   ` David Combs
  2008-09-11 22:58     ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
  0 siblings, 1 reply; 33+ messages in thread
From: David Combs @ 2008-09-11  1:35 UTC (permalink / raw
  To: help-gnu-emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2848 bytes --]

In article <64d8ebaf-0c89-4e9d-9aee-86b4e9414449@o40g2000prn.googlegroups.com>,
Xah  <xahlee@gmail.com> wrote:
>On Aug 14, 12:53 am, "Francis Moreau" <francis.m...@gmail.com> wrote:
>> Hello,
>>
>> I'm trying to open a file with emacs automatically set on sh-mode.
>> The file name can't be used to guess that emacs should be in sh-mode
>> when opening it.
>
>If the file content's first line starts with “#!”, then you could use
>the magic-mode-alist.
>
Xah -- question about the characters in your posts:

If I or someone sees eg a url in one of your posts, and
wants to go to that url (because you've suggested doing that,
maybe), it's a little difficult to just cut-n-paste your string,
what with all the extra control or whatever they are characters
mixed in.

What is that stuff, why is it there, and is it really necessary
for you to include it.

Thanks,

David




>-----------------------------------
>How Emacs Choose Modes
>
>Emacs determines what mode to use primarily by 2 mechanisms, in order:
>(1) Check the first line in the file, using “magic-mode-alist”. (2)
>Check the file name's suffix, using “auto-mode-alist”.
>
>The “magic-mode-alist” is a list that emacs use to match the first
>line of a file with a mode. For example, if you want files that begin
>with the line “<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...” to
>always use nxml-mode, then add the following to your “.emacs”:
>
>(add-to-list
> 'magic-mode-alist
> '("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0" . nxml-mode))
>
>The magic-mode-alist is a list. In the above example, the string with
>the “DOCTYPE” is a regex, used to match the first line of a file.
>
>If emacs goes thru magic-mode-alist and didn't find any match, then
>it'll use auto-mode-alist to check on file name suffix. The “auto-mode-
>alist” associates a file name suffix with a mode. For example, if you
>want files ending in “.js” to always open with js2-mode, then do:
>
>(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
>
>Note: The double backslash in the string “\\.js\\'” is used to escape
>the backslash. So, the regex engine just got “\.js\'”. The “\.” is to
>match a period. The “\'” is one of emacs special regex syntax, to
>match end of a string. (See also: Text Pattern Matching in Emacs)
>
>Reference: Elisp Manual: Regexp-Backslash.
>
>You can see what are the values of magic-mode-alist or auto-mode-alist
>by typing “Alt+x describe-variable”.
>
>There are few minor details about how emacs determines what mode to
>load, but the above should cover vast majority of needs. For detail,
>see emacs manual.
>
>Reference: (info "(emacs)Choosing Modes").
>
>--------------------------------------------
>above from:
>http://xahlee.org/emacs/emacs_installing_packages.html
>
>  Xah
>∑ http://xahlee.org/
>
>☄




^ permalink raw reply	[flat|nested] 33+ messages in thread

* unicode encoding and curly quotes [was: How to open a file in  sh-mode]
  2008-09-11  1:35   ` David Combs
@ 2008-09-11 22:58     ` Xah
  2008-09-14 22:35       ` David Combs
  0 siblings, 1 reply; 33+ messages in thread
From: Xah @ 2008-09-11 22:58 UTC (permalink / raw
  To: help-gnu-emacs

David Combs wrote:
> Xah-- question about the characters in your posts:
>
> If I or someone sees eg a url in one of your posts, and
> wants to go to that url (because you've suggested doing that,
> maybe), it's a little difficult to just cut-n-paste your string,
> what with all the extra control or whatever they are characters
> mixed in.
>
> What is that stuff, why is it there, and is it really necessary
> for you to include it.

The summation sign “∑” in my sig is my and my website signet.

in the end of my sig, there's this character “☄” (unicode name
“comet”). It is there so that it forces groups.google.com and Apple
Mail application into sending the message with unicode encoding.
Otherwise, the heuristics'll typically pick Japanese encoding. (in
google groups, last i checked about last year there's no way to set
encoding. And in Apple Mail 2 years ago, there's no unicode encoding
option... it is added now but last i checked there's no preference
that can set encoding ... )

My use of curly quotes “ ” or other unicode chars are just convenience
and practical need. I have in my emacs various easy ways to type them.
The need to quote is for example, seen throughout gnu's docs, but they
used a ascii cludge of backtick for left curly single quote and
straight quote for right curly single quote, e.g. “`something'”.
(quoting is needed for highlighting purporses or to make a phrase's
semantic from normal interpretation in the sentence.)

Since about 2006, i find emacs's support of unicode very roburst and i
have no problem with these and other mathematical chars or chinese in
emacs. In general, opensource langs and tools in e.g. linux world has
much caught on and support unicode, and i think that is good.
(commercial world long ago supported and use these chars in practice
(e.g. Apple in early 1990s and Microsoft Windows since about WindowsNT
4 or Windows2000)) The OpenSource world typically has a lag of 5 to 10
years in catching up most desktop techs. Even today, there are still a
few cave dwelling tech geekers you'll see occationally complaint about
unicode in posts (e.g. Alan M here insists that newsgroup posts should
be in ascii only!). But thankfully these days you'll often see others
tech geekers follow up chiding about the complainer like “dude, get a
proper newsreader” ...

You FreeSoftware and OpenSource supporters really should move on and
embrace unicode.

I have made few suggestions here and elsewhere in the past 2 years
including several private exchanges with Richard Stallman, about
updating emacs doc (and in general all GNU docs convention) to to use
“” and ‘’ in place of painful and ugly and technically problematic and
ambiguous ascii kludge `', among few other modernization issues... but
in general it's met with extreme difficulty...

i've been wanting to file a emacs bug report on this particular
issue ... but with so many resistance and my “troll” persona etc ...
basically it's very disencouraging ...

The problem with `' or ``'' is that:

• it's just 1980's ascii kludge to get around the fact there were no
matching quotes in ascii. In some technical sense, it's misuse and
abuse of symbols.
• it's ugly.
• it's ambiguous. The straight quote has many meanings, and both
straight quote and backtick also has special meanings in elisp lang
and in function's inline doc string.
• it is not possible to do a syntactical parse. (compare it to quoting
with chars that are matching pairs.)

If you think there's some merit in this suggestion, please file a bug
report. (menu “Help‣Send Bug Report...”)

  Xah
∑ http://xahlee.org/> >-----------------------------------
> >How Emacs Choose Modes
>
> >Emacs determines what mode to use primarily by 2 mechanisms, in order:
> >(1) Check the first line in the file, using “magic-mode-alist”. (2)
> >Check the file name's suffix, using “auto-mode-alist”.
>
> >The “magic-mode-alist” is a list that emacs use to match the first
> >line of a file with a mode. For example, if you want files that begin
> >with the line “<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...” to
> >always use nxml-mode, then add the following to your “.emacs”:
>
> >(add-to-list
> > 'magic-mode-alist
> > '("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0" . nxml-mode))
>
> >The magic-mode-alist is a list. In the above example, the string with
> >the “DOCTYPE” is a regex, used to match the first line of a file.
>
> >If emacs goes thru magic-mode-alist and didn't find any match, then
> >it'll use auto-mode-alist to check on file name suffix. The “auto-mode-
> >alist” associates a file name suffix with a mode. For example, if you
> >want files ending in “.js” to always open with js2-mode, then do:
>
> >(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
>
> >Note: The double backslash in the string “\\.js\\'” is used to escape
> >the backslash. So, the regex engine just got “\.js\'”. The “\.” is to
> >match a period. The “\'” is one of emacs special regex syntax, to
> >match end of a string. (See also: Text Pattern Matching in Emacs)
>
> >Reference: Elisp Manual: Regexp-Backslash.
>
> >You can see what are the values of magic-mode-alist or auto-mode-alist
> >by typing “Alt+x describe-variable”.
>
> >There are few minor details about how emacs determines what mode to
> >load, but the above should cover vast majority of needs. For detail,
> >see emacs manual.
>
> >Reference: (info "(emacs)Choosing Modes").
>
> >--------------------------------------------
> >above from:
> >http://xahlee.org/emacs/emacs_installing_packages.html
>
> >  Xah
> >∑http://xahlee.org/
>
> >☄



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: unicode encoding and curly quotes [was: How to open a file in  sh-mode]
  2008-09-11 22:58     ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
@ 2008-09-14 22:35       ` David Combs
  2008-09-15 16:28         ` unicode encoding and curly quotes Nikolaj Schumacher
  2008-09-15 19:09         ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
  0 siblings, 2 replies; 33+ messages in thread
From: David Combs @ 2008-09-14 22:35 UTC (permalink / raw
  To: help-gnu-emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

In article <44043b4c-ffad-437e-a8d4-5b049fc4d136@v16g2000prc.googlegroups.com>,
Xah  <xahlee@gmail.com> wrote:
>David Combs wrote:
>> Xah-- question about the characters in your posts:
>>
>> If I or someone sees eg a url in one of your posts, and
>> wants to go to that url (because you've suggested doing that,
>> maybe), it's a little difficult to just cut-n-paste your string,
>> what with all the extra control or whatever they are characters
>> mixed in.
>>
>> What is that stuff, why is it there, and is it really necessary
>> for you to include it.
>
>The summation sign “∑” in my sig is my and my website signet.
>
>in the end of my sig, there's this character “☄” (unicode name
>“comet”). It is there so that it forces groups.google.com and Apple
...
...

Well, whatever.   Way over my head.


Anyway, *if* you really want *me* to go look at 
some suggested url, then please do it TWO ways:

. Your current scheme, which I cannot use.
. Plain ascii, 100% ready to be cut-n-pasted into a web-browser,
    with no edits needed.

Thanks,

David




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: unicode encoding and curly quotes
  2008-09-14 22:35       ` David Combs
@ 2008-09-15 16:28         ` Nikolaj Schumacher
  2008-09-15 19:09         ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
  1 sibling, 0 replies; 33+ messages in thread
From: Nikolaj Schumacher @ 2008-09-15 16:28 UTC (permalink / raw
  To: David Combs; +Cc: help-gnu-emacs

dkcombs@panix.com (David Combs) wrote:

> . Plain ascii, 100% ready to be cut-n-pasted into a web-browser,
>     with no edits needed.

I'm sorry.  Which URL are you referring to?  All the URLs I can see are
plain ASCII and can be copied without a problem.

regards,
Nikolaj Schumacher




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: unicode encoding and curly quotes [was: How to open a file in  sh-mode]
  2008-09-14 22:35       ` David Combs
  2008-09-15 16:28         ` unicode encoding and curly quotes Nikolaj Schumacher
@ 2008-09-15 19:09         ` Xah
  2008-09-22 20:17           ` David Combs
  1 sibling, 1 reply; 33+ messages in thread
From: Xah @ 2008-09-15 19:09 UTC (permalink / raw
  To: help-gnu-emacs

On Sep 14, 3:35 pm, dkco...@panix.com (David Combs) wrote:
> In article <44043b4c-ffad-437e-a8d4-5b049fc4d...@v16g2000prc.googlegroups.com>,
>
> Xah  <xah...@gmail.com> wrote:
> >David Combs wrote:
> >> Xah-- question about the characters in your posts:
>
> >> If I or someone sees eg a url in one of your posts, and
> >> wants to go to that url (because you've suggested doing that,
> >> maybe), it's a little difficult to just cut-n-paste your string,
> >> what with all the extra control or whatever they are characters
> >> mixed in.
>
> >> What is that stuff, why is it there, and is it really necessary
> >> for you to include it.
>
> >The summation sign “∑” in my sig is my and my website signet.
>
> >in the end of my sig, there's this character “☄” (unicode name
> >“comet”). It is there so that it forces groups.google.com and Apple
>
> ...
> ...
>
> Well, whatever.   Way over my head.

is that a joke? its hard to tell on newsgroup.

> Anyway, *if* you really want *me* to go look at
> some suggested url, then please do it TWO ways:
>
> . Your current scheme, which I cannot use.
> . Plain ascii, 100% ready to be cut-n-pasted into a web-browser,
>     with no edits needed.

yes i'm also a bit confused. When having a url in my post, maybe a
year ago i used to quote them in a few messages but i quickly stopped
that because newsgroup or email apps will parse wrongly as to include
the quoting char as part of the link.

So, these days i have spaces around any url. I don't think i even
quote them with unicode chars, but possibly with parens. like this:
( http://example.com/ )

perhaps you mean something like the following are hard to copy/paste??

• http://example.com/

... unless there's something in your message i really missed out...
please take a look at unicode. It's really here to stay for good. It's
in MS Windows NT and decendents from the ground up (i.e. since mid
1990s), it's the base encoding in XML standard and various other
protocols and langs (e.g. java), supported by elisp as far as my
experience goes better than any other lang in practical sense, and
required by law for any comp in china and Chinese sites are some major
percentage of the world's web traffic... also if u look at Wikipedia,
which is world's top 5 web traffic for 2 or more years, it uses
unicode chars liberally ...

see also:

http://en.wikipedia.org/wiki/GB_18030
http://en.wikipedia.org/wiki/Internet

some quote:

«GB18030 can be considered a Unicode Transformation Format (i.e. an
encoding of all Unicode code points) that maintains compatibility with
a legacy character set. Like UTF-8, GB18030 is a superset of ASCII and
can represent the whole range of Unicode code points; »

«After English (30% of Web visitors) the most requested languages on
the World Wide Web are Chinese (17%), Spanish (9%), Japanese (7%),
French (5%) and German (5%).[8]

By continent, 38% of the world's Internet users are based in Asia, 27%
in Europe, 18% in North America, 10% in Latin America and the
Caribbean, and 7% in Australia.[6]»

 Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: unicode encoding and curly quotes [was: How to open a file in  sh-mode]
  2008-09-15 19:09         ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
@ 2008-09-22 20:17           ` David Combs
  0 siblings, 0 replies; 33+ messages in thread
From: David Combs @ 2008-09-22 20:17 UTC (permalink / raw
  To: help-gnu-emacs

Xah, thanks much for your explanations.


David




^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2008-09-22 20:17 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.16658.1218700648.18990.help-gnu-emacs@gnu.org>
2008-08-14  8:28 ` How to open a file in sh-mode Sebastian Kaps
2008-08-14 10:29 ` Xah
2008-09-11  1:35   ` David Combs
2008-09-11 22:58     ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
2008-09-14 22:35       ` David Combs
2008-09-15 16:28         ` unicode encoding and curly quotes Nikolaj Schumacher
2008-09-15 19:09         ` unicode encoding and curly quotes [was: How to open a file in sh-mode] Xah
2008-09-22 20:17           ` David Combs
2008-08-14  7:53 How to open a file in sh-mode Francis Moreau
2008-08-14  8:16 ` Henrik Austad
2008-08-14  9:03   ` Francis Moreau
2008-08-14 10:03     ` Henrik Austad
2008-08-14 10:06       ` Francis Moreau
2008-08-14 11:17         ` David Hansen
2008-08-14 11:36         ` Henrik Austad
2008-08-14 11:51           ` Francis Moreau
2008-08-14 11:57             ` Lennart Borgman (gmail)
     [not found]       ` <mailman.16667.1218708430.18990.help-gnu-emacs@gnu.org>
2008-08-14 12:24         ` Giorgos Keramidas
2008-08-14 13:01           ` Francis Moreau
2008-08-14 13:27             ` Giorgos Keramidas
2008-08-14 13:48               ` Francis Moreau
2008-08-14 14:23                 ` Giorgos Keramidas
2008-08-14  8:26 ` David Hansen
2008-08-14  9:04   ` Francis Moreau
2008-08-14  9:23     ` Thierry Volpiatto
2008-08-14  9:34       ` Francis Moreau
2008-08-14 10:58     ` Peter Dyballa
2008-08-14 11:02       ` Francis Moreau
2008-08-14 11:20         ` Lennart Borgman (gmail)
2008-08-14 11:36           ` Francis Moreau
2008-08-14 11:46             ` Lennart Borgman (gmail)
2008-08-14 12:06         ` Peter Dyballa
2008-08-14 12:22           ` Francis Moreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).