all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to implement function copy-subword-to-irc-buffer
@ 2009-11-30 17:39 B. T. Raven
  2009-12-02  6:34 ` Kevin Rodgers
       [not found] ` <mailman.12001.1259735672.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: B. T. Raven @ 2009-11-30 17:39 UTC (permalink / raw
  To: help-gnu-emacs

I think I need (thing-at-point 'word), (buffer-list), set point and
mark, copy-region-as-kill-no-mark, and other usual suspects to implement
this but really want to automatically copy the substring of the word
before point or the whole word if point is in whitespace after the word.
This (sub)string should go to the point in the irc buffer (one whose
buffer-name starts with #) and then make that irc buffer current.

Is this doable? I want to assign this function to some keychord but am
not sure what would be suitable (in keeping with traditional key
assignment philosophy). I have standard binding for almost every thing
but single character cursor movement. Is there a way of getting a list
of all key combos (and/or ranges of key combos) that are not currently
bound?

Thanks,

Ed


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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-11-30 17:39 how to implement function copy-subword-to-irc-buffer B. T. Raven
@ 2009-12-02  6:34 ` Kevin Rodgers
       [not found] ` <mailman.12001.1259735672.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Kevin Rodgers @ 2009-12-02  6:34 UTC (permalink / raw
  To: help-gnu-emacs

B. T. Raven wrote:
> I think I need (thing-at-point 'word), (buffer-list), set point and
> mark, copy-region-as-kill-no-mark, and other usual suspects to implement
> this but really want to automatically copy the substring of the word
> before point or the whole word if point is in whitespace after the word.
> This (sub)string should go to the point in the irc buffer (one whose
> buffer-name starts with #) and then make that irc buffer current.

Looking at rcirc.el, it does not look like that is a reliable method to select
"the" IRC buffer.  It actually supports multiple IRC buffers, maintained in
rcirc-buffer-alist (which is local to the server buffer, of which there may
also be more than 1).

Glossing over that for the moment, how about:

(let* ((subword (if (looking-at "\\>")
		    (thing-at-point 'word)
		  (buffer-substring (or (car (bounds-of-thing-at-point 'word))
					(point))
				    (point))))
        (buffer-list (buffer-list))
        (irc-buffer (catch 'irc-buffer
		     (while buffer-list
		       (when (and (string-match "^#"
						(buffer-name (car buffer-list)))
				  (buffer-local-value 'rcirc-server-buffer
						      (car buffer-list)))
			 (throw 'irc-buffer (car buffer-list)))
		       (setq buffer-list (cdr buffer-list))))))
   (when irc-buffer
     (funcall rcirc-switch-to-buffer-function irc-buffer)
     (insert subword)))

> Is this doable? I want to assign this function to some keychord but am
> not sure what would be suitable (in keeping with traditional key
> assignment philosophy). I have standard binding for almost every thing
> but single character cursor movement. Is there a way of getting a list
> of all key combos (and/or ranges of key combos) that are not currently
> bound?

 From the Keymaps node of the Emacs manual:

,----
|    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.
|
`----

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: how to implement function copy-subword-to-irc-buffer
       [not found] ` <mailman.12001.1259735672.2239.help-gnu-emacs@gnu.org>
@ 2009-12-04  1:45   ` B. T. Raven
  2009-12-04  5:02     ` Kevin Rodgers
       [not found]     ` <mailman.12154.1259902948.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: B. T. Raven @ 2009-12-04  1:45 UTC (permalink / raw
  To: help-gnu-emacs

Kevin Rodgers wrote:
> B. T. Raven wrote:
>> I think I need (thing-at-point 'word), (buffer-list), set point and
>> mark, copy-region-as-kill-no-mark, and other usual suspects to implement
>> this but really want to automatically copy the substring of the word
>> before point or the whole word if point is in whitespace after the word.
>> This (sub)string should go to the point in the irc buffer (one whose
>> buffer-name starts with #) and then make that irc buffer current.
> 
> Looking at rcirc.el, it does not look like that is a reliable method to
> select
> "the" IRC buffer.  It actually supports multiple IRC buffers, maintained in
> rcirc-buffer-alist (which is local to the server buffer, of which there may
> also be more than 1).
> 
> Glossing over that for the moment, how about:

I was glossing over that too. Just to get started I was planning on
using the function with only one open server and channel. In fact, I
probably will never need it to go to more than one irc buffer. It's just
to move foreign language dictionary entries quickly into a particular
channel during a live session.

> 
> (let* ((subword (if (looking-at "\\>")
>             (thing-at-point 'word)

;; already the \> regex was new to me. If I C-s to the word "the" RET,
;; then point is already past the word

>           (buffer-substring (or (car (bounds-of-thing-at-point 'word))
>                     (point))
>                     (point))))

I can't get my mind around this either; why the (or ... ? Don't I always
want car of the cons returned by bounds-of-thing-at-point ?

>        (buffer-list (buffer-list))
>        (irc-buffer (catch 'irc-buffer
>              (while buffer-list
>                (when (and (string-match "^#"
>                         (buffer-name (car buffer-list)))
>                   (buffer-local-value 'rcirc-server-buffer
>                               (car buffer-list)))
>              (throw 'irc-buffer (car buffer-list)))
>                (setq buffer-list (cdr buffer-list))))))
>   (when irc-buffer
>     (funcall rcirc-switch-to-buffer-function irc-buffer)
>     (insert subword)))

I couldn't wrap this in a defun and get it to work because I am in ver.
22.3 Can I copy rcirc.el from /emacs23/lisp/net over to ver 22.3?  If
not, is it safe to just overwrite all the ver 22.3 files, directories,
etc. with the equivalent ver. 23 ones. I tried to use my old .emacs with
23.1 but it wouldn't work because of (ucs-tables) in my .emacs.

Anyway, thanks a lot for the code. I may have to postpone any more study
of it until I dare to move everything to ver. 23.

> 
>> Is this doable? I want to assign this function to some keychord but am
>> not sure what would be suitable (in keeping with traditional key
>> assignment philosophy). I have standard binding for almost every thing
>> but single character cursor movement. Is there a way of getting a list
>> of all key combos (and/or ranges of key combos) that are not currently
>> bound?
> 
> From the Keymaps node of the Emacs manual:
> 
> ,----
> |    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.
> |
> `----
> 

It may be overridden but from what I know now it probably won't be. For
instance  if I type (at random) C-h k and then C-M S-h I find that the
shifted combo has been translated to C-M h but C-h S-k (C-h K)isn't
translated to C-h k. If I avoid C-M combos and known prefixes (C-x, C-h,
and ESC) then most combos will be undefined (M-s, C-s, shifted versions
of these, and Alt combos if there are keyboards with both Alt and Meta).
Emacs didn't use to discriminate between shifted and unshifted combos
but now it seems to in many contexts.

I thought there might be a way to get the complement to the set of
defined key bindings. Maybe there is no easy way to do that.


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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-12-04  1:45   ` B. T. Raven
@ 2009-12-04  5:02     ` Kevin Rodgers
       [not found]     ` <mailman.12154.1259902948.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Kevin Rodgers @ 2009-12-04  5:02 UTC (permalink / raw
  To: help-gnu-emacs

B. T. Raven wrote:
> Kevin Rodgers wrote:
>> B. T. Raven wrote:
>>> I think I need (thing-at-point 'word), (buffer-list), set point and
>>> mark, copy-region-as-kill-no-mark, and other usual suspects to implement
>>> this but really want to automatically copy the substring of the word
>>> before point or the whole word if point is in whitespace after the word.
>>> This (sub)string should go to the point in the irc buffer (one whose
>>> buffer-name starts with #) and then make that irc buffer current.
>> 
>> Looking at rcirc.el, it does not look like that is a reliable method to
>> select
>> "the" IRC buffer.  It actually supports multiple IRC buffers, maintained in
>> rcirc-buffer-alist (which is local to the server buffer, of which there may
>> also be more than 1).
>>
>> Glossing over that for the moment, how about:
> 
> I was glossing over that too. Just to get started I was planning on
> using the function with only one open server and channel. In fact, I
> probably will never need it to go to more than one irc buffer. It's just
> to move foreign language dictionary entries quickly into a particular
> channel during a live session.

The code below simply selects the first buffer returned by buffer-list whose
name starts with "#" and has an rcirc server buffer associated with it.

>> (let* ((subword (if (looking-at "\\>")
>>             (thing-at-point 'word)
> 
> ;; already the \> regex was new to me. If I C-s to the word "the" RET,
> ;; then point is already past the word

Yes, just as you requested: point is after the word.

>>           (buffer-substring (or (car (bounds-of-thing-at-point 'word))
>>                     (point))
>>                     (point))))
> 
> I can't get my mind around this either; why the (or ... ? Don't I always
> want car of the cons returned by bounds-of-thing-at-point ?

Yes, but there are corner cases where it may be nil, which causes
buffer-substring to signal an error.

>>        (buffer-list (buffer-list))
>>        (irc-buffer (catch 'irc-buffer
>>              (while buffer-list
>>                (when (and (string-match "^#"
>>                         (buffer-name (car buffer-list)))
>>                   (buffer-local-value 'rcirc-server-buffer
>>                               (car buffer-list)))
>>              (throw 'irc-buffer (car buffer-list)))
>>                (setq buffer-list (cdr buffer-list))))))
>>   (when irc-buffer
>>     (funcall rcirc-switch-to-buffer-function irc-buffer)
>>     (insert subword)))
> 
> I couldn't wrap this in a defun and get it to work because I am in ver.
> 22.3 Can I copy rcirc.el from /emacs23/lisp/net over to ver 22.3?  If
> not, is it safe to just overwrite all the ver 22.3 files, directories,
> etc. with the equivalent ver. 23 ones. I tried to use my old .emacs with
> 23.1 but it wouldn't work because of (ucs-tables) in my .emacs.
> 
> Anyway, thanks a lot for the code. I may have to postpone any more study
> of it until I dare to move everything to ver. 23.

No it is not safe.  If you want to experiment with such an approach, put
the newer files in the site-lisp directory.

But as far as I know, there are no dependencies in that code on version
23 -- in fact, there couldn't be, as I am running 22.3 as well and
tested it successfully.

You should be able to wrap that in a defun and put it in your emacs as is.
What happened when you tried?

>>> Is this doable? I want to assign this function to some keychord but am
>>> not sure what would be suitable (in keeping with traditional key
>>> assignment philosophy). I have standard binding for almost every thing
>>> but single character cursor movement. Is there a way of getting a list
>>> of all key combos (and/or ranges of key combos) that are not currently
>>> bound?
>> From the Keymaps node of the Emacs manual:
>>
>> ,----
>> |    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.
>> |
>> `----
>>
> 
> It may be overridden but from what I know now it probably won't be. For
> instance  if I type (at random) C-h k and then C-M S-h I find that the
> shifted combo has been translated to C-M h but C-h S-k (C-h K)isn't
> translated to C-h k. If I avoid C-M combos and known prefixes (C-x, C-h,
> and ESC) then most combos will be undefined (M-s, C-s, shifted versions
> of these, and Alt combos if there are keyboards with both Alt and Meta).
> Emacs didn't use to discriminate between shifted and unshifted combos
> but now it seems to in many contexts.
> 
> I thought there might be a way to get the complement to the set of
> defined key bindings. Maybe there is no easy way to do that.

If you want to use a binding that is "in keeping with traditional key
assignment philosophy", then use C-c LETTER.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: how to implement function copy-subword-to-irc-buffer
       [not found]     ` <mailman.12154.1259902948.2239.help-gnu-emacs@gnu.org>
@ 2009-12-04 21:12       ` B. T. Raven
  2009-12-05  8:49         ` Kevin Rodgers
       [not found]         ` <mailman.12262.1260003007.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: B. T. Raven @ 2009-12-04 21:12 UTC (permalink / raw
  To: help-gnu-emacs

Kevin Rodgers wrote:
> B. T. Raven wrote:
>> Kevin Rodgers wrote:
>>> B. T. Raven wrote:
>>>> I think I need (thing-at-point 'word), (buffer-list), set point and
>>>> mark, copy-region-as-kill-no-mark, and other usual suspects to
>>>> implement
>>>> this but really want to automatically copy the substring of the word
>>>> before point or the whole word if point is in whitespace after the
>>>> word.
>>>> This (sub)string should go to the point in the irc buffer (one whose
>>>> buffer-name starts with #) and then make that irc buffer current.
>>>
>>> Looking at rcirc.el, it does not look like that is a reliable method to
>>> select
>>> "the" IRC buffer.  It actually supports multiple IRC buffers,
>>> maintained in
>>> rcirc-buffer-alist (which is local to the server buffer, of which
>>> there may
>>> also be more than 1).
>>>
>>> Glossing over that for the moment, how about:
>>
>> I was glossing over that too. Just to get started I was planning on
>> using the function with only one open server and channel. In fact, I
>> probably will never need it to go to more than one irc buffer. It's just
>> to move foreign language dictionary entries quickly into a particular
>> channel during a live session.
> 
> The code below simply selects the first buffer returned by buffer-list
> whose
> name starts with "#" and has an rcirc server buffer associated with it.
> 
>>> (let* ((subword (if (looking-at "\\>")
>>>             (thing-at-point 'word)
>>
>> ;; already the \> regex was new to me. If I C-s to the word "the" RET,
>> ;; then point is already past the word
> 
> Yes, just as you requested: point is after the word.
> 
>>>           (buffer-substring (or (car (bounds-of-thing-at-point 'word))
>>>                     (point))
>>>                     (point))))
>>
>> I can't get my mind around this either; why the (or ... ? Don't I always
>> want car of the cons returned by bounds-of-thing-at-point ?
> 
> Yes, but there are corner cases where it may be nil, which causes
> buffer-substring to signal an error.
> 
>>>        (buffer-list (buffer-list))
>>>        (irc-buffer (catch 'irc-buffer
>>>              (while buffer-list
>>>                (when (and (string-match "^#"
>>>                         (buffer-name (car buffer-list)))
>>>                   (buffer-local-value 'rcirc-server-buffer
>>>                               (car buffer-list)))
>>>              (throw 'irc-buffer (car buffer-list)))
>>>                (setq buffer-list (cdr buffer-list))))))
>>>   (when irc-buffer
>>>     (funcall rcirc-switch-to-buffer-function irc-buffer)
>>>     (insert subword)))
>>
>> I couldn't wrap this in a defun and get it to work because I am in ver.
>> 22.3 Can I copy rcirc.el from /emacs23/lisp/net over to ver 22.3?  If
>> not, is it safe to just overwrite all the ver 22.3 files, directories,
>> etc. with the equivalent ver. 23 ones. I tried to use my old .emacs with
>> 23.1 but it wouldn't work because of (ucs-tables) in my .emacs.
>>
>> Anyway, thanks a lot for the code. I may have to postpone any more study
>> of it until I dare to move everything to ver. 23.
> 
> No it is not safe.  If you want to experiment with such an approach, put
> the newer files in the site-lisp directory.

Good idea. I will temporarily rename rcirc.el and .elc in .../lisp/net
and put ver. 23 copy in emacs22/site-lisp.

> 
> But as far as I know, there are no dependencies in that code on version
> 23 -- in fact, there couldn't be, as I am running 22.3 as well and
> tested it successfully.
> 
> You should be able to wrap that in a defun and put it in your emacs as is.
> What happened when you tried?

After connecting to server and channel I see:

and: Symbol's value as variable is void: rcirc-server-buffer

server buffer name is irc.dal.net:6667 in buffer list but
Atlanta.ga.us.dal.net in mode line. I suppose that mismatch is normal?
Nothing was copied out of dictionary buffer into channel buffer at point
(ERC>)


> 
>>>> Is this doable? I want to assign this function to some keychord but am
>>>> not sure what would be suitable (in keeping with traditional key
>>>> assignment philosophy). I have standard binding for almost every thing
>>>> but single character cursor movement. Is there a way of getting a list
>>>> of all key combos (and/or ranges of key combos) that are not currently
>>>> bound?
>>> From the Keymaps node of the Emacs manual:
>>>
>>> ,----
>>> |    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.
>>> |
>>> `----
>>>
>>
>> It may be overridden but from what I know now it probably won't be. For
>> instance  if I type (at random) C-h k and then C-M S-h I find that the
>> shifted combo has been translated to C-M h but C-h S-k (C-h K)isn't
>> translated to C-h k. If I avoid C-M combos and known prefixes (C-x, C-h,
>> and ESC) then most combos will be undefined (M-s, C-s, shifted versions
>> of these, and Alt combos if there are keyboards with both Alt and Meta).
>> Emacs didn't use to discriminate between shifted and unshifted combos
>> but now it seems to in many contexts.
>>
>> I thought there might be a way to get the complement to the set of
>> defined key bindings. Maybe there is no easy way to do that.
> 
> If you want to use a binding that is "in keeping with traditional key
> assignment philosophy", then use C-c LETTER.

Yeah, I know but I'm already using all of those. But those bindingS are
just for inserting single unicode characters so they could be reassigned
now that ver. 23 represents unicode internally.
> 


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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-12-04 21:12       ` B. T. Raven
@ 2009-12-05  8:49         ` Kevin Rodgers
       [not found]         ` <mailman.12262.1260003007.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Kevin Rodgers @ 2009-12-05  8:49 UTC (permalink / raw
  To: help-gnu-emacs

B. T. Raven wrote:
> Kevin Rodgers wrote:
...
>> You should be able to wrap that in a defun and put it in your emacs as is.
>> What happened when you tried?
> 
> After connecting to server and channel I see:
> 
> and: Symbol's value as variable is void: rcirc-server-buffer
> 
> server buffer name is irc.dal.net:6667 in buffer list but
> Atlanta.ga.us.dal.net in mode line. I suppose that mismatch is normal?
> Nothing was copied out of dictionary buffer into channel buffer at point
> (ERC>)

The version of rcirc.el distributed with Emacs 22.3 defvar's
rcirc-server-buffer, so it has a global value (nil) and buffer-local-value
will not signal an error (for any BUFFER argument).  This leads me to conclude
that you have not loaded the 22.3 rcirc library, but some other IRC client.

In emacs -Q, `M-x rcirc' creates and selects a buffer named *irc.freenode.net*;
it also creates a buffer named #rcirc@irc.freenode.net, where `C-h v
rcirc-server-buffer' yields #<buffer *irc.freenode.net*>.

How does that compare with your experience?

...
>> If you want to use a binding that is "in keeping with traditional key
>> assignment philosophy", then use C-c LETTER.
> 
> Yeah, I know but I'm already using all of those. But those bindingS are
> just for inserting single unicode characters so they could be reassigned
> now that ver. 23 represents unicode internally.

26 letters times lower/upper case = 52 bindings -- a very small subset of
Unicode indeed.  You would probably benefit from using an input method --
probably one of the Latin methods as you appear to be in the UK, or perhaps
one of the UTF-8 methods.  See `M-x list-input-methods', `C-h I' and
`C-x <RET> C-\'.

Hope that helps,

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: how to implement function copy-subword-to-irc-buffer
       [not found]         ` <mailman.12262.1260003007.2239.help-gnu-emacs@gnu.org>
@ 2009-12-05 18:58           ` B. T. Raven
  2009-12-05 21:25             ` Stefan Monnier
  2009-12-05 21:46           ` B. T. Raven
  1 sibling, 1 reply; 12+ messages in thread
From: B. T. Raven @ 2009-12-05 18:58 UTC (permalink / raw
  To: help-gnu-emacs

Kevin Rodgers wrote:
> B. T. Raven wrote:
>> Kevin Rodgers wrote:
> ...
>>> You should be able to wrap that in a defun and put it in your emacs
>>> as is.
>>> What happened when you tried?
>>
>> After connecting to server and channel I see:
>>
>> and: Symbol's value as variable is void: rcirc-server-buffer
>>
>> server buffer name is irc.dal.net:6667 in buffer list but
>> Atlanta.ga.us.dal.net in mode line. I suppose that mismatch is normal?
>> Nothing was copied out of dictionary buffer into channel buffer at point
>> (ERC>)
> 
> The version of rcirc.el distributed with Emacs 22.3 defvar's
> rcirc-server-buffer, so it has a global value (nil) and buffer-local-value
> will not signal an error (for any BUFFER argument).  This leads me to
> conclude
> that you have not loaded the 22.3 rcirc library, but some other IRC client.
> 
> In emacs -Q, `M-x rcirc' creates and selects a buffer named
> *irc.freenode.net*;
> it also creates a buffer named #rcirc@irc.freenode.net, where `C-h v
> rcirc-server-buffer' yields #<buffer *irc.freenode.net*>.
> 
> How does that compare with your experience?

Emacs -q works normally it seems but there is no ERC component in the
menu after the channel buffer #rcirc@irc.freenode.net is created. What I
normally do is run M-x erc through an alias M-x irc and
parameters(server,channel, etc.) in .emacs are evaluated automatically.
Do I need both (erc) and (rcirc)?

> 
> ...
>>> If you want to use a binding that is "in keeping with traditional key
>>> assignment philosophy", then use C-c LETTER.
>>
>> Yeah, I know but I'm already using all of those. But those bindingS are
>> just for inserting single unicode characters so they could be reassigned
>> now that ver. 23 represents unicode internally.
> 
> 26 letters times lower/upper case = 52 bindings -- a very small subset of
> Unicode indeed.  You would probably benefit from using an input method --
> probably one of the Latin methods as you appear to be in the UK, or perhaps
> one of the UTF-8 methods.  See `M-x list-input-methods', `C-h I' and
> `C-x <RET> C-\'.

No. Am in U.S. I just have a bunch of oddball things like this lumped
together:

...
(global-set-key "\C-c9" (lambda () (interactive) (insert  ?⁹ )))
(global-set-key "\C-c0" (lambda () (interactive) (insert  ?⁰ )))
(global-set-key "\C-ca" (lambda () (interactive) (insert  ?ˊ )))
(global-set-key "\C-cb" (lambda () (interactive) (insert  ?˘ )))
(global-set-key "\C-cp" (lambda () (interactive) (insert  ?¶ )))
...

I use input methods too. The C-c bindings are things I commonly use that
 aren't accessible in any one input method. I should probably make my
own homebrew imput method that includes all the glyphs I want. I would
learn rfc1345 mnemonics if I thought they were going to be stable. When
will rfc1345 get a more official sounding name? Things like:
&NH\203 ƒ &VS\212 make me think it's not ready for prime time.
May be a font problem though. MSarialunicode doesn't have everything in it.

I also have this .emacs:
(fset 'im-uc
   [?\C-x return ?\C-\\ ?r ?f ?c ?1 ?3 ?4 ?5 return])

So I don't have to do C-x ret C-\ rfc1345
but
M-x im-uc

For me, using ucs-insert is like putting in graphic characters with Alt
keypad on the old ibm pc.


> 
> Hope that helps,
> 

Somewhat. Thanks again.







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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-12-05 18:58           ` B. T. Raven
@ 2009-12-05 21:25             ` Stefan Monnier
  2009-12-05 21:43               ` B. T. Raven
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2009-12-05 21:25 UTC (permalink / raw
  To: help-gnu-emacs

> I also have this .emacs:
> (fset 'im-uc
>    [?\C-x return ?\C-\\ ?r ?f ?c ?1 ?3 ?4 ?5 return])

You could also just do

  (setq default-input-method 'rfc1345)

in your .emacs, so C-\ will toggle that input method (I do exactly
that, except with the TeX input method rather than rfc1345, since
I find TeX more intuitive, probably because I knew LaTeX already).

Another thing I use heavily is the Multi_key (aka "compose key") which
I have xmodmap'ed to one of the right-alt keys I never use.  This way
I can type in many chars (without any Emacs input-method, so it works
just as well in xterm, firefox, open-office, younameit), like
compose-e-' for é, compose-1-2 for ½, or compose-^-9 for ⁹.


        Stefan


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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-12-05 21:25             ` Stefan Monnier
@ 2009-12-05 21:43               ` B. T. Raven
  2009-12-07 15:48                 ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: B. T. Raven @ 2009-12-05 21:43 UTC (permalink / raw
  To: help-gnu-emacs

Stefan Monnier wrote:
>> I also have this .emacs:
>> (fset 'im-uc
>>    [?\C-x return ?\C-\\ ?r ?f ?c ?1 ?3 ?4 ?5 return])
> 
> You could also just do
> 
>   (setq default-input-method 'rfc1345)
> 
> in your .emacs, so C-\ will toggle that input method (I do exactly
> that, except with the TeX input method rather than rfc1345, since
> I find TeX more intuitive, probably because I knew LaTeX already).
> 
> Another thing I use heavily is the Multi_key (aka "compose key") which
> I have xmodmap'ed to one of the right-alt keys I never use.  This way
> I can type in many chars (without any Emacs input-method, so it works
> just as well in xterm, firefox, open-office, younameit), like
> compose-e-' for é, compose-1-2 for ½, or compose-^-9 for ⁹.
> 
> 
>         Stefan


Thanks, Stefan. I want latin-1-postfix for default since I don't know
the mnemonics for rfc.. I'm on w32 so I have to use Keytweak and other
tricks to make my keyboard useful. I don't think compose key facility is
available on w32 in that form, is it?

Ed


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

* Re: how to implement function copy-subword-to-irc-buffer
       [not found]         ` <mailman.12262.1260003007.2239.help-gnu-emacs@gnu.org>
  2009-12-05 18:58           ` B. T. Raven
@ 2009-12-05 21:46           ` B. T. Raven
  2009-12-08  5:31             ` Kevin Rodgers
  1 sibling, 1 reply; 12+ messages in thread
From: B. T. Raven @ 2009-12-05 21:46 UTC (permalink / raw
  To: help-gnu-emacs

Kevin Rodgers wrote:
> B. T. Raven wrote:
>> Kevin Rodgers wrote:
> ...
>>> You should be able to wrap that in a defun and put it in your emacs
>>> as is.
>>> What happened when you tried?
>>
>> After connecting to server and channel I see:
>>
>> and: Symbol's value as variable is void: rcirc-server-buffer
>>
>> server buffer name is irc.dal.net:6667 in buffer list but
>> Atlanta.ga.us.dal.net in mode line. I suppose that mismatch is normal?
>> Nothing was copied out of dictionary buffer into channel buffer at point
>> (ERC>)
> 
> The version of rcirc.el distributed with Emacs 22.3 defvar's
> rcirc-server-buffer, so it has a global value (nil) and buffer-local-value
> will not signal an error (for any BUFFER argument).  This leads me to
> conclude
> that you have not loaded the 22.3 rcirc library, but some other IRC client.
> 
> In emacs -Q, `M-x rcirc' creates and selects a buffer named
> *irc.freenode.net*;
> it also creates a buffer named #rcirc@irc.freenode.net, where `C-h v
> rcirc-server-buffer' yields #<buffer *irc.freenode.net*>.
> 
> How does that compare with your experience?
> 
> ...
>>> If you want to use a binding that is "in keeping with traditional key
>>> assignment philosophy", then use C-c LETTER.
>>
>> Yeah, I know but I'm already using all of those. But those bindingS are
>> just for inserting single unicode characters so they could be reassigned
>> now that ver. 23 represents unicode internally.
> 
> 26 letters times lower/upper case = 52 bindings -- a very small subset of
> Unicode indeed.  You would probably benefit from using an input method --
> probably one of the Latin methods as you appear to be in the UK, or perhaps
> one of the UTF-8 methods.  See `M-x list-input-methods', `C-h I' and
> `C-x <RET> C-\'.
> 
> Hope that helps,
> 

Okay. Your function does work if I use rcirc instead of erc. But since
there is no menu support for rcirc I don't know how to get slash
commands without /help. I did just learn C-u M-x rcirc. I'll try
changing from ERC to rcirc.

Ed


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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-12-05 21:43               ` B. T. Raven
@ 2009-12-07 15:48                 ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2009-12-07 15:48 UTC (permalink / raw
  To: help-gnu-emacs

> Thanks, Stefan. I want latin-1-postfix for default since I don't know
> the mnemonics for rfc.. I'm on w32 so I have to use Keytweak and other
> tricks to make my keyboard useful. I don't think compose key facility is
> available on w32 in that form, is it?

I'm prety sure it's available for your machine, by replacing w32 with
GNU/Linux.


        Stefan


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

* Re: how to implement function copy-subword-to-irc-buffer
  2009-12-05 21:46           ` B. T. Raven
@ 2009-12-08  5:31             ` Kevin Rodgers
  0 siblings, 0 replies; 12+ messages in thread
From: Kevin Rodgers @ 2009-12-08  5:31 UTC (permalink / raw
  To: help-gnu-emacs

B. T. Raven wrote:
> Kevin Rodgers wrote:
>> B. T. Raven wrote:
>>> After connecting to server and channel I see:
>>>
>>> and: Symbol's value as variable is void: rcirc-server-buffer
>>>
>>> server buffer name is irc.dal.net:6667 in buffer list but
>>> Atlanta.ga.us.dal.net in mode line. I suppose that mismatch is normal?
>>> Nothing was copied out of dictionary buffer into channel buffer at point
>>> (ERC>)
 >>
>> The version of rcirc.el distributed with Emacs 22.3 defvar's
>> rcirc-server-buffer, so it has a global value (nil) and buffer-local-value
>> will not signal an error (for any BUFFER argument).  This leads me to
>> conclude
>> that you have not loaded the 22.3 rcirc library, but some other IRC client.
>>
>> In emacs -Q, `M-x rcirc' creates and selects a buffer named
>> *irc.freenode.net*;
>> it also creates a buffer named #rcirc@irc.freenode.net, where `C-h v
>> rcirc-server-buffer' yields #<buffer *irc.freenode.net*>.
>>
>> How does that compare with your experience?
> 
> Okay. Your function does work if I use rcirc instead of erc. But since
> there is no menu support for rcirc I don't know how to get slash
> commands without /help. I did just learn C-u M-x rcirc. I'll try
> changing from ERC to rcirc.

Or modify what I suggested to find and switch to an erc buffer instead
of an rcirc buffer.  Perhaps

	(or erc-active-buffer (car (erc-buffer-list)))

and

	(pop-to-buffer irc-buffer)

respectively.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

end of thread, other threads:[~2009-12-08  5:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30 17:39 how to implement function copy-subword-to-irc-buffer B. T. Raven
2009-12-02  6:34 ` Kevin Rodgers
     [not found] ` <mailman.12001.1259735672.2239.help-gnu-emacs@gnu.org>
2009-12-04  1:45   ` B. T. Raven
2009-12-04  5:02     ` Kevin Rodgers
     [not found]     ` <mailman.12154.1259902948.2239.help-gnu-emacs@gnu.org>
2009-12-04 21:12       ` B. T. Raven
2009-12-05  8:49         ` Kevin Rodgers
     [not found]         ` <mailman.12262.1260003007.2239.help-gnu-emacs@gnu.org>
2009-12-05 18:58           ` B. T. Raven
2009-12-05 21:25             ` Stefan Monnier
2009-12-05 21:43               ` B. T. Raven
2009-12-07 15:48                 ` Stefan Monnier
2009-12-05 21:46           ` B. T. Raven
2009-12-08  5:31             ` Kevin Rodgers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.