Gnus development mailing list
 help / color / mirror / Atom feed
* i would like to select one mail address at prompt when i hit `m' key in keyboard...
@ 2020-11-15  2:46 Byung-Hee HWANG
  2020-11-16 10:43 ` Solved problem (Was: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...) 황병희
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Byung-Hee HWANG @ 2020-11-15  2:46 UTC (permalink / raw)
  To: The Gnus

Hellow!

i am beginner at elisp. as far as i write-up below code.
===> references: emacs wiki [multiple smtp gnus]

#+begin_src emacs lisp
(setq user-full-name "Byung-Hee HWANG")
(setq sendmail-program "/usr/sbin/ssmtp")

(defun setHome ()
  (interactive)
  (message "from home -- soyeomul@doraji.xyz")
  (setq user-mail-address "soyeomul@doraji.xyz")
  (setq message-sendmail-extra-arguments '("-C" "/etc/ssmtp/ssmtp-yw.conf")))

(defun setWork ()
  (interactive)
  (message "from work -- soyeomul@gmail.com")
  (setq user-mail-address "soyeomul@gmail.com")
  (setq message-sendmail-extra-arguments '("-C" "/etc/ssmtp/ssmtp-gmail.conf")))

(add-hook 'message-mode-hook
	  '(lambda ()
	     (if (y-or-n-p "at home?")
		 (progn (setHome))
	       (progn (setWork)))))
#+end_src

at then, question...

how can i enable the above rule only when i hit `m' key?

i try to google and emacs manual etc... but failed..

Sincerely, Gnus fan Byung-Hee

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//


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

* Solved problem (Was: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...)
  2020-11-15  2:46 i would like to select one mail address at prompt when i hit `m' key in keyboard Byung-Hee HWANG
@ 2020-11-16 10:43 ` 황병희
  2020-11-16 15:41 ` i would like to select one mail address at prompt when i hit `m' key in keyboard Alberto Luaces
  2020-11-16 16:06 ` Eric S Fraga
  2 siblings, 0 replies; 10+ messages in thread
From: 황병희 @ 2020-11-16 10:43 UTC (permalink / raw)
  To: The Gnus

Thanks!!!

Sincerely, Byung-Hee

-- 
^고맙습니다 _和合團結_ 감사합니다_^))//

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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-15  2:46 i would like to select one mail address at prompt when i hit `m' key in keyboard Byung-Hee HWANG
  2020-11-16 10:43 ` Solved problem (Was: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...) 황병희
@ 2020-11-16 15:41 ` Alberto Luaces
  2020-11-17  3:00   ` 황병희
  2020-11-16 16:06 ` Eric S Fraga
  2 siblings, 1 reply; 10+ messages in thread
From: Alberto Luaces @ 2020-11-16 15:41 UTC (permalink / raw)
  To: ding

Byung-Hee HWANG writes:

[...]

>
> (add-hook 'message-mode-hook
> 	  '(lambda ()
> 	     (if (y-or-n-p "at home?")
> 		 (progn (setHome))
> 	       (progn (setWork)))))
> #+end_src
>
> at then, question...
>
> how can i enable the above rule only when i hit `m' key?
>
> i try to google and emacs manual etc... but failed..

Hi, I guess you don't want a hook here, but to bind a keypress to your
function inside the hook.  Something along the lines of:

(add-hook 'message-mode-hook
	  '(local-set-key (kbd "M-m") '(lambda ()
	     (if (y-or-n-p "at home?")
		 (progn (setHome))
	       (progn (setWork))))))

I have binded to M-m instead of just "m", otherwise you couldn't type
the letter "m" in a message.

-- 
Alberto



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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-15  2:46 i would like to select one mail address at prompt when i hit `m' key in keyboard Byung-Hee HWANG
  2020-11-16 10:43 ` Solved problem (Was: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...) 황병희
  2020-11-16 15:41 ` i would like to select one mail address at prompt when i hit `m' key in keyboard Alberto Luaces
@ 2020-11-16 16:06 ` Eric S Fraga
  2020-11-17  2:08   ` 황병희
  2 siblings, 1 reply; 10+ messages in thread
From: Eric S Fraga @ 2020-11-16 16:06 UTC (permalink / raw)
  To: ding

Byung-Hee,

I use gnus posting styles for this and gnus-alias-use-identity to switch
identities.  Not quite what you wanted, as it's not tied to the m key
but is instead something you do once you are in the message buffer, but
it does work well.

-- 
Eric S Fraga via Emacs 28.0.50 & org 9.4 on Debian bullseye/sid



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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-16 16:06 ` Eric S Fraga
@ 2020-11-17  2:08   ` 황병희
  2020-11-17  2:52     ` Bob Newell
  0 siblings, 1 reply; 10+ messages in thread
From: 황병희 @ 2020-11-17  2:08 UTC (permalink / raw)
  To: ding

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Byung-Hee,
>
> I use gnus posting styles for this and gnus-alias-use-identity to switch
> identities.  Not quite what you wanted, as it's not tied to the m key
> but is instead something you do once you are in the message buffer, but
> it does work well.

Hmm.. interesting about gnus-alias-use-identity. I will study it
gnus-alias-use-identity. Because i love the word "identity".

Sincerely, Byung-Hee

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//


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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-17  2:08   ` 황병희
@ 2020-11-17  2:52     ` Bob Newell
  2020-11-17  3:09       ` 황병희
  2020-11-17  7:14       ` Vegard Vesterheim
  0 siblings, 2 replies; 10+ messages in thread
From: Bob Newell @ 2020-11-17  2:52 UTC (permalink / raw)
  To: ding


gnus-alias-use-identity takes a little setting up (not too
much though) but is much more flexible. I probably have 20
contexts set up and in the end it makes switching among them
very easy. For instance, sometimes I want to be a clueless AOL
user, sometimes I want to be an alum of my undergrad
university, and sometimes I even just want to be myself.

Take the time to set up gnus-alias-identity list to suit your
needs and wishes, and when you're comfortable with that go to
the next level with gnus-alias-identity-rules, which allows for
some automated identity selection. For instance certain
"friends" always get mail from my netzero identity; if someone
writes to a deprecated address they weill get a reply from my
preferred identity.

-- 
Bob Newell
Honolulu, Hawai`i

- Via GNU/Linux/Emacs/Gnus/BBDB


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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-16 15:41 ` i would like to select one mail address at prompt when i hit `m' key in keyboard Alberto Luaces
@ 2020-11-17  3:00   ` 황병희
  0 siblings, 0 replies; 10+ messages in thread
From: 황병희 @ 2020-11-17  3:00 UTC (permalink / raw)
  To: ding

Alberto Luaces <aluaces@udc.es> writes:

> Byung-Hee HWANG writes:
>
> [...]
>
>>
>> (add-hook 'message-mode-hook
>> 	  '(lambda ()
>> 	     (if (y-or-n-p "at home?")
>> 		 (progn (setHome))
>> 	       (progn (setWork)))))
>> #+end_src
>>
>> at then, question...
>>
>> how can i enable the above rule only when i hit `m' key?
>>
>> i try to google and emacs manual etc... but failed..
>
> Hi, I guess you don't want a hook here, but to bind a keypress to your
> function inside the hook.  Something along the lines of:
>
> (add-hook 'message-mode-hook
> 	  '(local-set-key (kbd "M-m") '(lambda ()
> 	     (if (y-or-n-p "at home?")
> 		 (progn (setHome))
> 	       (progn (setWork))))))
>
> I have binded to M-m instead of just "m", otherwise you couldn't type
> the letter "m" in a message.

Thanks Alberto, i will study about local-set-key, thanks again^^^

Sincerely, Byung-Hee

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//



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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-17  2:52     ` Bob Newell
@ 2020-11-17  3:09       ` 황병희
  2020-11-17  7:14       ` Vegard Vesterheim
  1 sibling, 0 replies; 10+ messages in thread
From: 황병희 @ 2020-11-17  3:09 UTC (permalink / raw)
  To: ding

Bob Newell <bobnewell@bobnewell.net> writes:

> gnus-alias-use-identity takes a little setting up (not too
> much though) but is much more flexible. I probably have 20
> contexts set up and in the end it makes switching among them
> very easy. For instance, sometimes I want to be a clueless AOL
> user, sometimes I want to be an alum of my undergrad
> university, and sometimes I even just want to be myself.
>
> Take the time to set up gnus-alias-identity list to suit your
> needs and wishes, and when you're comfortable with that go to
> the next level with gnus-alias-identity-rules, which allows for
> some automated identity selection. For instance certain
> "friends" always get mail from my netzero identity; if someone
> writes to a deprecated address they weill get a reply from my
> preferred identity.

Thanks Bob, your story is my story thanks again ^^^

Sincerely, Byung-Hee

-- 
^고맙습니다 _地平天成_ 감사합니다_^))//


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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-17  2:52     ` Bob Newell
  2020-11-17  3:09       ` 황병희
@ 2020-11-17  7:14       ` Vegard Vesterheim
  2020-11-17 16:34         ` Bob Newell
  1 sibling, 1 reply; 10+ messages in thread
From: Vegard Vesterheim @ 2020-11-17  7:14 UTC (permalink / raw)
  To: Bob Newell; +Cc: ding

On Mon, 16 Nov 2020 16:52:12 -1000 Bob Newell <bobnewell@bobnewell.net> wrote:

> Take the time to set up gnus-alias-identity list to suit your
> needs and wishes, and when you're comfortable with that go to
> the next level with gnus-alias-identity-rules, which allows for
> some automated identity selection. For instance certain
> "friends" always get mail from my netzero identity; if someone
> writes to a deprecated address they weill get a reply from my
> preferred identity.

Additionally, here is a function to cycle through the gnus-alias
identities:

https://github.com/vv3/gnus-alias/commit/986f3a1732362357162a8450a2250069baf02dce

This can be bound to a key for quick access.

-- 
Vennlig hilsen/Best regards
Vegard Vesterheim
Senior Software engineer
+47 48 11 98 98
vegard.vesterheim@uninett.no


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

* Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...
  2020-11-17  7:14       ` Vegard Vesterheim
@ 2020-11-17 16:34         ` Bob Newell
  0 siblings, 0 replies; 10+ messages in thread
From: Bob Newell @ 2020-11-17 16:34 UTC (permalink / raw)
  To: ding


Vegard Vesterheim <vegard.vesterheim@uninett.no> writes:
>
> Additionally, here is a function to cycle through the gnus-alias
> identities:
>
> https://github.com/vv3/gnus-alias/commit/986f3a1732362357162a8450a2250069baf02dce
>
> This can be bound to a key for quick access.

I didn't know about this one, that's a great feature.

gnus-alias-identity also works well with helm, so there are
plenty of options and once set up, very good ease of use.

-- 
Bob Newell
Honolulu, Hawai`i

- Via GNU/Linux/Emacs/Gnus/BBDB


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

end of thread, other threads:[~2020-11-17 16:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15  2:46 i would like to select one mail address at prompt when i hit `m' key in keyboard Byung-Hee HWANG
2020-11-16 10:43 ` Solved problem (Was: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard...) 황병희
2020-11-16 15:41 ` i would like to select one mail address at prompt when i hit `m' key in keyboard Alberto Luaces
2020-11-17  3:00   ` 황병희
2020-11-16 16:06 ` Eric S Fraga
2020-11-17  2:08   ` 황병희
2020-11-17  2:52     ` Bob Newell
2020-11-17  3:09       ` 황병희
2020-11-17  7:14       ` Vegard Vesterheim
2020-11-17 16:34         ` Bob Newell

Gnus development mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/ding

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 ding ding/ http://inbox.vuxu.org/ding \
		ding@inbox.vuxu.org
	public-inbox-index ding

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.emacs.gnus.general


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git