Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* message-signature-file toggled to nil locally
@ 2008-02-03 16:38 Sebastian P. Luque
  2008-02-03 17:12 ` Reiner Steib
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian P. Luque @ 2008-02-03 16:38 UTC (permalink / raw)
  To: info-gnus-english

Hi,

I noticed that message-signature-file gets set to nil when composing
messages, even though the signature is chosen correctly, based on
gnus-posting-styles:

,-----[ C-h v message-signature-file RET ]
| message-signature-file is a variable defined in `message.el'.
| Its value is nil
| Local in buffer *posting on gmane.emacs.gnus.user*; global value is "professional"
| 
| Documentation:
| *Name of file containing the text inserted at end of message buffer.
| Ignored if the named file doesn't exist.
| If nil, don't insert a signature.
| If a path is specified, the value of `message-signature-directory' is ignored,
| even if set.
`-----

The gnus-posting-styles is pretty simple:


,-----[ C-h v gnus-posting-styles RET ]
| gnus-posting-styles is a variable defined in `gnus-msg.el'.
| Its value is shown below.
| 
| Documentation:
| *Alist of styles to use when posting.
| See Info node `(gnus)Posting Styles'.
| 
| You can customize this variable.
| 
| Value: 
| ((".*"
|   (body "\n\n\nCheers,\n"))
|  ((message-news-p)
|   (signature "Seb")
|   (address "spluque@gmail.com"))
|  ((message-mail-p)
|   (signature-file "professional")))
`-----

I can't see anything wrong with message-setup-hook (in this buffer for
instance) neither:


,-----[ C-h v message-setup-hook RET ]
| message-setup-hook is a variable defined in `message.el'.
| Its value is shown below.
| 
| Documentation:
| Normal hook, run each time a new outgoing message is initialized.
| The function `message-setup' runs this hook.
| 
| You can customize this variable.
| 
| Value: 
| ((lambda nil
|    (set
|     (make-local-variable 'user-mail-address)
|     "spluque@gmail.com")
|    (let
|        ((user-full-name "Sebastian P. Luque")
| 	(user-mail-address "spluque@gmail.com"))
|      (save-excursion
|        (message-remove-header "From")
|        (message-goto-eoh)
|        (insert "From: "
| 	       (message-make-from)
| 	       "\n"))))
|  (lambda nil
|    (save-excursion
|      (let
| 	 ((message-signature "Seb\n"))
|        (when message-signature
| 	 (message-insert-signature)))))
|  (lambda nil
|    (save-excursion
|      (message-remove-header "Organization")
|      (let
| 	 ((value "Org"))
|        (when value
| 	 (message-goto-eoh)
| 	 (insert "Organization" ": " value)
| 	 (unless
| 	     (bolp)
| 	   (insert "\n"))))))
|  (lambda nil
|    (save-excursion
|      (let
| 	 ((message-signature "My Sig"))
|        (when message-signature
| 	 (message-insert-signature)))))
|  (lambda nil
|    (save-excursion
|      (message-goto-body)
|      (insert "\n\n\nCheers,\n")))
|  t)
| 
| Local in buffer *mail*; global value is 
| ((lambda nil
|    (define-key message-mode-map "\x03["
|      (lambda nil
|        (interactive)
|        (require 'reftex)
|        (let
| 	   ((reftex-cite-format 'locally))
| 	 (reftex-citation)))))
|  (lambda nil
|    (bbdb-define-all-aliases)
|    (require 'footnote))
|  bbdb-insinuate-message)
`-----

Any suggestions what might be setting this variable?


Cheers,

-- 
Seb

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

* Re: message-signature-file toggled to nil locally
  2008-02-03 16:38 message-signature-file toggled to nil locally Sebastian P. Luque
@ 2008-02-03 17:12 ` Reiner Steib
  2008-02-03 17:59   ` Sebastian P. Luque
  0 siblings, 1 reply; 7+ messages in thread
From: Reiner Steib @ 2008-02-03 17:12 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Feb 03 2008, Sebastian P. Luque wrote:

> I noticed that message-signature-file gets set to nil when composing
> messages, even though the signature is chosen correctly, based on
> gnus-posting-styles: [...]

So what is the problem?

> Any suggestions what might be setting this variable?

		    (set (make-local-variable 'message-signature-file) nil)

... in `gnus-configure-posting-styles', I'd guess.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: message-signature-file toggled to nil locally
  2008-02-03 17:12 ` Reiner Steib
@ 2008-02-03 17:59   ` Sebastian P. Luque
  2008-02-03 18:53     ` Reiner Steib
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sebastian P. Luque @ 2008-02-03 17:59 UTC (permalink / raw)
  To: info-gnus-english

On Sun, 03 Feb 2008 18:12:57 +0100,
Reiner Steib <reinersteib+gmane@imap.cc> wrote:

> On Sun, Feb 03 2008, Sebastian P. Luque wrote:
>> I noticed that message-signature-file gets set to nil when composing
>> messages, even though the signature is chosen correctly, based on
>> gnus-posting-styles: [...]

> So what is the problem?

The problem is that if I want to change the signature, say through 'C-c
C-w' (message-insert-signature), or gnus-personalities, then any
reference to this variable doesn't do what's expected.




Cheers,

[missing signature here] :-)

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

* Re: message-signature-file toggled to nil locally
  2008-02-03 17:59   ` Sebastian P. Luque
@ 2008-02-03 18:53     ` Reiner Steib
  2008-02-03 23:10       ` Sebastian P. Luque
  2008-02-03 22:18     ` Sebastian P. Luque
       [not found]     ` <mailman.6907.1202077097.18990.info-gnus-english@gnu.org>
  2 siblings, 1 reply; 7+ messages in thread
From: Reiner Steib @ 2008-02-03 18:53 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Feb 03 2008, Sebastian P. Luque wrote:

> On Sun, 03 Feb 2008 18:12:57 +0100,
> Reiner Steib <reinersteib+gmane@imap.cc> wrote:
>
>> On Sun, Feb 03 2008, Sebastian P. Luque wrote:
>>> I noticed that message-signature-file gets set to nil when composing
>>> messages, even though the signature is chosen correctly, based on
>>> gnus-posting-styles: [...]
>
>> So what is the problem?
>
> The problem is that if I want to change the signature, say through 'C-c
> C-w' (message-insert-signature), or gnus-personalities, then any
> reference to this variable doesn't do what's expected.

I see.  Does the following quite untested patch do the right thing?

--8<---------------cut here---------------start------------->8---
--- message.el	28 Jan 2008 09:02:57 -0000	7.239
+++ message.el	3 Feb 2008 18:49:59 -0000
@@ -3281,7 +3281,11 @@
 (defun message-insert-signature (&optional force)
   "Insert a signature.  See documentation for variable `message-signature'."
   (interactive (list 0))
-  (let* ((signature
+  (let* ((message-signature-file (or message-signature-file
+				     (default-value 'message-signature-file)))
+	 (message-signature (or message-signature
+				(default-value 'message-signature)))
+	 (signature
 	  (cond
 	   ((and (null message-signature)
 		 (eq force 0))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.

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

* Re: message-signature-file toggled to nil locally
  2008-02-03 17:59   ` Sebastian P. Luque
  2008-02-03 18:53     ` Reiner Steib
@ 2008-02-03 22:18     ` Sebastian P. Luque
       [not found]     ` <mailman.6907.1202077097.18990.info-gnus-english@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Sebastian P. Luque @ 2008-02-03 22:18 UTC (permalink / raw)
  To: info-gnus-english

On Sun, 03 Feb 2008 11:59:02 -0600,
Sebastian P. Luque <spluque@gmail.com> wrote:

> The problem is that if I want to change the signature, say through
> 'C-c C-w' (message-insert-signature), or gnus-personalities, then any
> reference to this variable doesn't do what's expected.

So how can one use these variables (message-signature,
message-signature-file), or function message-insert-signature when in
writing a message?  Anybody using gnus-pers.el got it successfully
switching personalities?


Cheers,

-- 
Seb

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

* Re: message-signature-file toggled to nil locally
  2008-02-03 18:53     ` Reiner Steib
@ 2008-02-03 23:10       ` Sebastian P. Luque
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastian P. Luque @ 2008-02-03 23:10 UTC (permalink / raw)
  To: info-gnus-english

On Sun, 03 Feb 2008 19:53:13 +0100,
Reiner Steib <reinersteib+gmane@imap.cc> wrote:

> I see.  Does the following quite untested patch do the right thing?

Thanks Reiner for this patch!  I'm getting a double signature with it
though.  It's probably not taking into account that some signature has
been inserted through gnus-posting-styles.

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

* Re: message-signature-file toggled to nil locally
       [not found]     ` <mailman.6907.1202077097.18990.info-gnus-english@gnu.org>
@ 2008-02-04 10:42       ` Slackrat
  0 siblings, 0 replies; 7+ messages in thread
From: Slackrat @ 2008-02-04 10:42 UTC (permalink / raw)
  To: info-gnus-english

"Sebastian P. Luque" a écrit profondement:

| On Sun, 03 Feb 2008 11:59:02 -0600,
| Sebastian P. Luque <spluque@gmail.com> wrote:
| 
| > The problem is that if I want to change the signature, say through
| > 'C-c C-w' (message-insert-signature), or gnus-personalities, then any
| > reference to this variable doesn't do what's expected.
| 
| So how can one use these variables (message-signature,
| message-signature-file), or function message-insert-signature when in
| writing a message?  Anybody using gnus-pers.el got it successfully
| switching personalities?
| 

Did you ever contemplate using randomsig.el ?

You can put sigs to go with whatever personality you happen to be
using as defined by your posting profiles in /home/inconnu/.signature/
to use as a standard and still randomly override it with a different
random signature which is either truly random or selectable from your
signature list 

As you will observe, I have 160 available and my sig on this message
is a sample

[cite .gnus posting profiles signature]

(setq gnus-posting-styles
      '((".*"
;; STANDARD
;;=========
	 (name mail-user-name)
	 ("X-Guarantee" "This email is certified to have been free
             of UCE and any other Malicious, Harmful or
             Annoying Content when originally sent by
             <user>@azurservers.com - Azurservers post
             SPF records and do not condone SPAM type
             emails")
	 (signature-file "~/.signature/DEFAULTSIGNATURE")
	 ("X-Homepage" "http://azurservers.com")
	 ("X-Operating-System" "Kernel=Intel-Linux, Programmes=GNU, Integration=Slackware")
	 ("X-Azurservers-AuthNo" "Registered as AZSV bghkd8332277")
	 (organization "Not very much!"))

;; USENET
;;=======
	 ("alt.test*"
	 (signature-file "~/.signature/TESTERSIGNATURE")
	 (name "Tester-Tester Tester")
	 (address "alttest@azurservers.com")
	 ("Fcc" "~/Mail/sent-alt-test")
         )

	 ("rec*"
	 (signature-file "~/.signature/RECSIGNATURE")
	 (name "Davey Crockett")
	 (address "rec@azurservers.com")
	 ("Fcc" "~/Mail/sent-rec")
         )

	 ("gnu.emacs*"
	 (signature-file "~/.signature/GNUSIGNATURE")
	 (name "Slackrat")
	 (address "gnus4Q@azurservers.com")
	 ("Fcc" "~/Mail/sent-gnu"))

;; MAILING LISTS
;;==============
	 ("england-first"
	 ("To" "Press Media <press-media@efp.org.uk>")
	 (signature-file "~/.signature/ENGLANDFIRSTSIGNATURE")
	 (name "YOUR-PSEUDONYM")
	 (address "efp@azurservers.com")
	 ("Fcc" "~/Mail/sent-england-first")
	 ("Bcc" "inconnu")
         )
[snip about 200 others here]

))

[/cite .gnus posting profiles signature]

[cite .gnus random signature]

;;#################################
;;  IMPLEMENT RANDOM SIGNATURES  ##
;;#################################

;; First put randomsig.el in site-lisp dir
;; #######################################

;; TO MAKE IT WORK, put the following lines into your ~/.gnus:

 (require 'randomsig)
 (define-key message-mode-map (kbd "C-c s") 'randomsig-replace-sig)
 (define-key message-mode-map (kbd "C-c S") 'randomsig-select-sig)
 (require 'gnus-sum) ; probably required for `gnus-summary-save-map'
 (define-key gnus-summary-save-map "-" 'gnus/randomsig-summary-read-sig)
 (setq randomsig-dir "/home/USERNAME/.signature/random-signature")
 (setq randomsig-files '(
"001" "002" "003" "004" "005" "006" "007" "008" "009" "010" "011" "012" "013" "014" "015" "016" "017" "018" "019" "020"
"021" "022" "023" "024" "025" "026" "027" "028" "029" "030" "031" "032" "033" "034" "035" "036" "037" "038" "039" "040"
"041" "042" "043" "044" "045" "046" "047" "048" "049" "050" "051" "052" "053" "054" "055" "056" "057" "058" "059" "060" 
"061" "062" "063" "064" "065" "066" "067" "068" "069" "070" "071" "072" "073" "074" "075" "076" "077" "078" "079" "080"
"081" "082" "083" "084" "085" "086" "087" "088" "089" "090" "091" "092" "093" "094" "095" "096" "097" "098" "099" "100"
"101" "102" "103" "104" "105" "106" "107" "108" "109" "110" "111" "112" "113" "114" "115" "116" "117" "118" "119" "120"
"121" "122" "123" "124" "125" "126" "127" "128" "129" "130" "131" "132" "133" "134" "135" "136" "137" "138" "139" "140"
"141" "142" "143" "144" "145" "146" "147" "148" "149" "114" "151" "152" "153" "154" "155" "156" "157" "158" "159" "160"
)
 )
 ;; or (setq randomsig-files (randomsig-search-sigfiles))
 ;; or (setq randomsig-files 'randomsig-search-sigfiles)
 (setq message-signature 'randomsig-signature)

;; This will also define the shortcut `C-c s' in message-mode to
;; change the signature, `C-c S' in message-mode to interactively
;; select the signature to replace the current signature, and `O -' in
;; gnus-summary-mode to read the signature from the selected mail.

;; `randomsig-files' must be a list of existing files, an existing
;; file, or a function returning a list of existing files. If these
;; don't have absolute paths, they are located in `randomsig-dir'.

;; File format: Each file must contain at least one signature.
;; Signatures are separated with `randomsig-delimiter-pattern'. If
;; there is only one signature in the file, the delimiter can be
;; omitted, so real .signature-files can be used.

;; `randomsig-delimiter' is used when inserting new signatures with
;; `randomsig-message-read-sig' into the signature file. So
;; `randomsig-delimiter' should match `randomsig-delimiter-pattern'.

;; `randomsig-static-string' is put in front of every random signature
;; if non-`nil'.

;; The *-read-sig functions read the signature of a message, or use
;; the marked text, and write it to a signature-file, for which the
;; name is asked. If the file does not exist, it will be generated.
;; When called with any prefix, the signatures will be offered to edit
;; before saving.

;; if `randomsig-replace-sig' is called with any prefix, it will ask
;; for a file to get the signature from.

;; `randomsig-select-sig' will offer a list of signatures to select
;; from in an extra buffer. n will jump to the next signature, p to
;; the previous, RET will insert the selected signature, q will exit
;; the selection buffer without replacing the current signature, R
;; will reload the signature-files, and e will open a buffer for
;; editing the signature at the point. When called with any prefix, it
;; will ask for a file to get the signatures from
;; `randomsig-search-sigfiles' will search for regular files in
;; `randomsig-dir', which do not match `randomsig-search-unwanted'. A
;; subdirectory of `randomsig-dir' can be given as optional argument.

;; Completion will only work for files in `randomsig-files', though
;; others files can be used, too.

[/cite .gnus]

-- 
SlackRat - 4Q to Reply 
-- .
To the Thieving Cowardly Traitor Bush, the "war on terror" is the ruling
mantra of his politics of fear. Since 9/11 gave a prop to his
weakening presidency, his language has scaled new heights of alarmist
rhetoric. It has validated every internal repression and every
external war. "He who is not with us is against us," he cries ... This
so-called war on terror has filled the pockets of those profiting from
it. It has killed thousands, immiserated millions and infringed the
liberty of hundreds of millions. The only rough justice it has
delivered is to ruin the careers of those who propagated it. Tony
Blair was driven to early resignation. Bush has been humiliated and
Musharraf's wretched rule brought close to an overdue end.

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

end of thread, other threads:[~2008-02-04 10:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-03 16:38 message-signature-file toggled to nil locally Sebastian P. Luque
2008-02-03 17:12 ` Reiner Steib
2008-02-03 17:59   ` Sebastian P. Luque
2008-02-03 18:53     ` Reiner Steib
2008-02-03 23:10       ` Sebastian P. Luque
2008-02-03 22:18     ` Sebastian P. Luque
     [not found]     ` <mailman.6907.1202077097.18990.info-gnus-english@gnu.org>
2008-02-04 10:42       ` Slackrat

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 NNTP newsgroup(s).