* Re: Some questions of a newbie
2007-04-20 9:46 Some questions of a newbie Cecil Westerhof
@ 2007-04-20 16:24 ` Eric Hanchrow
2007-04-20 16:26 ` Rjjd
` (3 subsequent siblings)
4 siblings, 0 replies; 19+ messages in thread
From: Eric Hanchrow @ 2007-04-20 16:24 UTC (permalink / raw)
To: help-gnu-emacs
>>>>> "Cecil" == Cecil Westerhof <dummy@dummy.nl> writes:
Cecil> I like to have the possibility to use the clipboard, so I
Cecil> added the following to my .emacs: (define-key global-map
Cecil> "\C-W" 'clipboard-kill-ring-save) (define-key global-map
Cecil> "\C-Y" 'clipboard-yank)
Rather than defining separate keys for those functions, I simply do
(setq x-select-enable-clipboard t)
So whenever I kill something in Emacs, it also goes to the clipboard;
and whenever some other app puts something on the clipboard, it's
available to be yanked in emacs with C-y.
Cecil> For comment I see that there is sometimes used one,
Cecil> sometimes two and sometime three ';'. Does this has a
Cecil> reason, or not?
Yes -- it's just a convention. It's explained in the Emacs Lisp
Reference manual: (info "(elisp)Comment Tips")
Cecil> Is there a good way to find which keybindings are used, so
Cecil> a free one can be coupled to a macro?
Yes -- do C-h m in a buffer that's in the mode you're interested in.
(If you're considering a global binding as opposed to a mode-specific
one, choose a buffer that's in fundamental-mode).
Cecil> In my .emacs I have: (setq ediff-use-toolbar-p nil)
Cecil> But the toolbar is still displayed. What am I doing wrong?
No idea.
Cecil> I added org-mode and nxml-mode. The first uses:
Cecil> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) the
Cecil> second uses: (setq auto-mode-alist (cons
Cecil> '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
Cecil> auto-mode-alist))
Cecil> Is there a reason for this, or is it just what the creator
Cecil> liked?
Mostly the latter. I prefer the add-to-list form, since it's simpler.
Cecil> If the second is the reason, then I prefer the first way
Cecil> and will change the way of nxml.
Great minds think alike :-)
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 9:46 Some questions of a newbie Cecil Westerhof
2007-04-20 16:24 ` Eric Hanchrow
@ 2007-04-20 16:26 ` Rjjd
2007-04-20 21:35 ` Matthew Flaschen
` (3 more replies)
[not found] ` <mailman.2320.1177087525.7795.help-gnu-emacs@gnu.org>
` (2 subsequent siblings)
4 siblings, 4 replies; 19+ messages in thread
From: Rjjd @ 2007-04-20 16:26 UTC (permalink / raw)
To: help-gnu-emacs
Cecil Westerhof wrote:
> I started using Emacs a week ago. It was always discouraged, but I need to
> work with docbook, so I started using it. I wish I had done it sooner.
> But there are a few quirks.
> I am using 21.3.1.
>
> I like to have the possibility to use the clipboard, so I added the
> following to my .emacs:
> (define-key global-map "\C-W" 'clipboard-kill-ring-save)
> (define-key global-map "\C-Y" 'clipboard-yank)
>
> First it seemed to work normal. I use C-w to delete something to the
> kill-ring and C-W to copy something to the clipboard. I used C-y to get
> something from the kill-ring and C-Y to get something from the clipboard.
> But for one reason or another c-w and c-y did not work anymore, so I
> disabled it. What could be the reason?
>
> For comment I see that there is sometimes used one, sometimes two and
> sometime three ';'. Does this has a reason, or not?
I think there is some convention about classifying comments. I don't
know what it is. If you want to publish some elisp code to the
community, it would be nice to follow the convention, but the world
won't end if you cannot figure it out.
>
> Is there a good way to find which keybindings are used, so a free one can be
> coupled to a macro?
describe-bindings
(I found this with apropos bind, i.e. ESC-x apropos RET bind RET)
>
> In my .emacs I have:
> (setq ediff-use-toolbar-p nil)
>
> But the toolbar is still displayed. What am I doing wrong?
>
When you see the toolbar displayed, what is the value of
ediff-use-toolbar-p? It could be that loading ediff sets it back to t
or somesuch. (I'm on Windows, and I don't have ediff-use-toolbar-p.)
> I added org-mode and nxml-mode.
> The first uses:
> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
> the second uses:
> (setq auto-mode-alist
> (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
> auto-mode-alist))
>
> Is there a reason for this, or is it just what the creator liked? If the
> second is the reason, then I prefer the first way and will change the way
> of nxml.
>
The first notation lists one file extension. I'm not sure why it has a "$".
The second notation lists four different file extensions, any one of
which is for nxml-mode.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 16:26 ` Rjjd
@ 2007-04-20 21:35 ` Matthew Flaschen
2007-04-20 21:38 ` Matthew Flaschen
` (2 subsequent siblings)
3 siblings, 0 replies; 19+ messages in thread
From: Matthew Flaschen @ 2007-04-20 21:35 UTC (permalink / raw)
To: emacs
Rjjd wrote:
> I think there is some convention about classifying comments. I don't
> know what it is. If you want to publish some elisp code to the
> community, it would be nice to follow the convention, but the world
> won't end if you cannot figure it out.
The convention is at
http://www.gnu.org/software/emacs/elisp-manual/html_node/Comment-Tips.html#Comment-Tips
, and seems fairly complex.
Matt Flaschen
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 16:26 ` Rjjd
2007-04-20 21:35 ` Matthew Flaschen
@ 2007-04-20 21:38 ` Matthew Flaschen
2007-04-20 21:42 ` Cecil Westerhof
2007-04-21 13:15 ` Johan Bockgård
3 siblings, 0 replies; 19+ messages in thread
From: Matthew Flaschen @ 2007-04-20 21:38 UTC (permalink / raw)
To: emacs
Rjjd wrote:
>
> Cecil Westerhof wrote:
>> I started using Emacs a week ago. It was always discouraged, but I
>> need to
>> work with docbook, so I started using it. I wish I had done it sooner.
>> But there are a few quirks.
>> I am using 21.3.1.
>>
>> I like to have the possibility to use the clipboard, so I added the
>> following to my .emacs:
>> (define-key global-map "\C-W" 'clipboard-kill-ring-save)
>> (define-key global-map "\C-Y" 'clipboard-yank)
>>
>> First it seemed to work normal. I use C-w to delete something to the
>> kill-ring and C-W to copy something to the clipboard. I used C-y to get
>> something from the kill-ring and C-Y to get something from the clipboard.
>> But for one reason or another c-w and c-y did not work anymore, so I
>> disabled it. What could be the reason?
>>
>> For comment I see that there is sometimes used one, sometimes two and
>> sometime three ';'. Does this has a reason, or not?
>
> I think there is some convention about classifying comments. I don't
> know what it is. If you want to publish some elisp code to the
> community, it would be nice to follow the convention, but the world
> won't end if you cannot figure it out.
>
>>
>> Is there a good way to find which keybindings are used, so a free one
>> can be
>> coupled to a macro?
>
> describe-bindings
> (I found this with apropos bind, i.e. ESC-x apropos RET bind RET)
>
>>
>> In my .emacs I have:
>> (setq ediff-use-toolbar-p nil)
>>
>> But the toolbar is still displayed. What am I doing wrong?
>>
>
> When you see the toolbar displayed, what is the value of
> ediff-use-toolbar-p? It could be that loading ediff sets it back to t
> or somesuch. (I'm on Windows, and I don't have ediff-use-toolbar-p.)
>
>
>> I added org-mode and nxml-mode.
>> The first uses:
>> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
>> the second uses:
>> (setq auto-mode-alist
>> (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
>> auto-mode-alist))
>>
>> Is there a reason for this, or is it just what the creator liked? If the
>> second is the reason, then I prefer the first way and will change the way
>> of nxml.
>>
>
> The first notation lists one file extension. I'm not sure why it has a
> "$".
It means end of line, so aquatic.organism won't match.
Matt Flaschen
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 16:26 ` Rjjd
2007-04-20 21:35 ` Matthew Flaschen
2007-04-20 21:38 ` Matthew Flaschen
@ 2007-04-20 21:42 ` Cecil Westerhof
2007-04-21 13:15 ` Johan Bockgård
3 siblings, 0 replies; 19+ messages in thread
From: Cecil Westerhof @ 2007-04-20 21:42 UTC (permalink / raw)
To: help-gnu-emacs
Rjjd wrote:
>> Is there a good way to find which keybindings are used, so a free one can
>> be coupled to a macro?
>
> describe-bindings
> (I found this with apropos bind, i.e. ESC-x apropos RET bind RET)
That is very handy indeed. ;-}
I have to take some time to browse it. There are some interesting
keybinding. But it is very big.
>> In my .emacs I have:
>> (setq ediff-use-toolbar-p nil)
>>
>> But the toolbar is still displayed. What am I doing wrong?
>>
>
> When you see the toolbar displayed, what is the value of
> ediff-use-toolbar-p? It could be that loading ediff sets it back to t
> or somesuch. (I'm on Windows, and I don't have ediff-use-toolbar-p.)
It is nil.
I used 'M-ESC :' to evaluate. That was a keybinding I saw with
describe-bindings. :-}
>> I added org-mode and nxml-mode.
>> The first uses:
>> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
>> the second uses:
>> (setq auto-mode-alist
>> (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
>> auto-mode-alist))
>>
>> Is there a reason for this, or is it just what the creator liked? If the
>> second is the reason, then I prefer the first way and will change the way
>> of nxml.
>>
>
> The first notation lists one file extension. I'm not sure why it has a
> "$". The second notation lists four different file extensions, any one of
> which is for nxml-mode.
I think the "$" is used to signify end of string.
So the difference is significant? I will let it alone then.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 16:26 ` Rjjd
` (2 preceding siblings ...)
2007-04-20 21:42 ` Cecil Westerhof
@ 2007-04-21 13:15 ` Johan Bockgård
2007-04-22 11:31 ` Cecil Westerhof
3 siblings, 1 reply; 19+ messages in thread
From: Johan Bockgård @ 2007-04-21 13:15 UTC (permalink / raw)
To: help-gnu-emacs
Rjjd <rjjd@tds.net> writes:
>> Is there a good way to find which keybindings are used, so a free
>> one can be coupled to a macro?
>
> describe-bindings
(This command is bound to `C-h b'.)
Here's a tip from (info "(emacs)Keymaps")
As a user, you can redefine any key; but it is usually best to
stick to key sequences that consist of `C-c' followed by a letter
(upper or lower case). These keys are "reserved for users," so they
won't conflict with any properly designed Emacs extension. The
function keys <F5> through <F9> are also reserved for users. If you
redefine some other key, your definition may be overridden by
certain extensions or major modes which redefine the same key.
--
Johan Bockgård
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-21 13:15 ` Johan Bockgård
@ 2007-04-22 11:31 ` Cecil Westerhof
2007-04-22 13:35 ` Johan Bockgård
0 siblings, 1 reply; 19+ messages in thread
From: Cecil Westerhof @ 2007-04-22 11:31 UTC (permalink / raw)
To: help-gnu-emacs
Johan Bockgård wrote:
> Rjjd <rjjd@tds.net> writes:
>
>>> Is there a good way to find which keybindings are used, so a free
>>> one can be coupled to a macro?
>>
>> describe-bindings
>
> (This command is bound to `C-h b'.)
>
> Here's a tip from (info "(emacs)Keymaps")
>
> As a user, you can redefine any key; but it is usually best to
> stick to key sequences that consist of `C-c' followed by a letter
> (upper or lower case). These keys are "reserved for users," so they
> won't conflict with any properly designed Emacs extension. The
> function keys <F5> through <F9> are also reserved for users. If you
> redefine some other key, your definition may be overridden by
> certain extensions or major modes which redefine the same key.
>
Okay, I will do that. (Allready did.)
Org-mode does use a lot of 'C-c' bindings, so not with every mode you do not
get conflicts.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-22 11:31 ` Cecil Westerhof
@ 2007-04-22 13:35 ` Johan Bockgård
2007-04-23 10:01 ` Cecil Westerhof
0 siblings, 1 reply; 19+ messages in thread
From: Johan Bockgård @ 2007-04-22 13:35 UTC (permalink / raw)
To: help-gnu-emacs
Cecil Westerhof <dummy@dummy.nl> writes:
> Johan Bockgård wrote:
>
>> As a user, you can redefine any key; but it is usually best to
>> stick to key sequences that consist of `C-c' followed by a letter
>> (upper or lower case). These keys are "reserved for users," so they
>> won't conflict with any properly designed Emacs extension.
>> [...]
>
> Okay, I will do that. (Allready did.)
> Org-mode does use a lot of 'C-c' bindings, so not with every mode you do not
> get conflicts.
Note that is says "`C-c' followed by a letter" (a-z).
--
Johan Bockgård
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-22 13:35 ` Johan Bockgård
@ 2007-04-23 10:01 ` Cecil Westerhof
0 siblings, 0 replies; 19+ messages in thread
From: Cecil Westerhof @ 2007-04-23 10:01 UTC (permalink / raw)
To: help-gnu-emacs
Johan Bockgård wrote:
>>> As a user, you can redefine any key; but it is usually best to
>>> stick to key sequences that consist of `C-c' followed by a letter
>>> (upper or lower case). These keys are "reserved for users," so they
>>> won't conflict with any properly designed Emacs extension.
>>> [...]
>>
>> Okay, I will do that. (Allready did.)
>> Org-mode does use a lot of 'C-c' bindings, so not with every mode you do
>> not get conflicts.
>
> Note that is says "`C-c' followed by a letter" (a-z).
It uses C-c a <letter>. But this is a suggestion, so if you use something
else, there is no conflict. (I Think, it is a big mode.)
^ permalink raw reply [flat|nested] 19+ messages in thread
[parent not found: <mailman.2320.1177087525.7795.help-gnu-emacs@gnu.org>]
* Re: Some questions of a newbie
[not found] ` <mailman.2320.1177087525.7795.help-gnu-emacs@gnu.org>
@ 2007-04-20 22:03 ` Cecil Westerhof
2007-04-21 2:26 ` Matthew Flaschen
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Cecil Westerhof @ 2007-04-20 22:03 UTC (permalink / raw)
To: help-gnu-emacs
Eric Hanchrow wrote:
> Cecil> I like to have the possibility to use the clipboard, so I
> Cecil> added the following to my .emacs: (define-key global-map
> Cecil> "\C-W" 'clipboard-kill-ring-save) (define-key global-map
> Cecil> "\C-Y" 'clipboard-yank)
>
> Rather than defining separate keys for those functions, I simply do
>
> (setq x-select-enable-clipboard t)
This gives a:
Symbol's function definition is void: setq x-select-enable-clipboard t
> Cecil> For comment I see that there is sometimes used one,
> Cecil> sometimes two and sometime three ';'. Does this has a
> Cecil> reason, or not?
>
> Yes -- it's just a convention. It's explained in the Emacs Lisp
> Reference manual: (info "(elisp)Comment Tips")
Thanks.
If I understand it correctly, I should not use comments with only one ';'.
>
> Cecil> Is there a good way to find which keybindings are used, so
> Cecil> a free one can be coupled to a macro?
>
> Yes -- do C-h m in a buffer that's in the mode you're interested in.
> (If you're considering a global binding as opposed to a mode-specific
> one, choose a buffer that's in fundamental-mode).
Thanks.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 9:46 Some questions of a newbie Cecil Westerhof
` (2 preceding siblings ...)
[not found] ` <mailman.2320.1177087525.7795.help-gnu-emacs@gnu.org>
@ 2007-04-23 12:37 ` Kai Grossjohann
2007-04-27 15:11 ` Karl Hegbloom
4 siblings, 0 replies; 19+ messages in thread
From: Kai Grossjohann @ 2007-04-23 12:37 UTC (permalink / raw)
To: help-gnu-emacs
Cecil Westerhof <dummy@dummy.nl> writes:
> I added org-mode and nxml-mode.
> The first uses:
> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
> the second uses:
> (setq auto-mode-alist
> (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
> auto-mode-alist))
>
> Is there a reason for this, or is it just what the creator liked? If the
> second is the reason, then I prefer the first way and will change the way
> of nxml.
It is a matter of style and taste. I prefer to use add-to-list over
the setq-cons combination because it creates simpler-looking code.
(add-to-list also checks if the entry is already present, the
setq-cons combination shown there might add dupes.)
However, the two variants also differ in that the former uses $ and
the latter uses \\'. $ matches at end of line or end of string,
whereas \\' only matches at end of string.
So if you had a file named foo.org\nbla where \n stands for a newline
character, then the regex "\\.org$" would match. "\\.org\\'" wouldn't
match.
Since file names with newlines in them are rare, this difference has
little practical relevance. Yet, I can't resist to use \\' just
because it's *right* :-)
Kai
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Some questions of a newbie
2007-04-20 9:46 Some questions of a newbie Cecil Westerhof
` (3 preceding siblings ...)
2007-04-23 12:37 ` Kai Grossjohann
@ 2007-04-27 15:11 ` Karl Hegbloom
4 siblings, 0 replies; 19+ messages in thread
From: Karl Hegbloom @ 2007-04-27 15:11 UTC (permalink / raw)
To: Cecil Westerhof; +Cc: help-gnu-emacs
On Fri, 2007-04-20 at 11:46 +0200, Cecil Westerhof wrote:
> For comment I see that there is sometimes used one, sometimes two and
> sometime three ';'. Does this has a reason, or not?
Automatic indenting will keep ';;;' at the left margin, ';;' will indent
to the same level as the surrounding code, and ';' will indent to the
hanging indent column.
^ permalink raw reply [flat|nested] 19+ messages in thread