I tried this setting:
(setq gnus-select-method '(nnml "comp.lang.lisp"))
But when I activate Gnus, no grouop is shown. How do I add groups like comp.lang.*?
Edit: I tried with nntp:
(setq gnus-select-method '(nntp "comp.lang.lisp"))
but it doesn't work:
Warning: Opening nntp server on comp.lang.lisp...failed: ; Server nntp+comp.lang.lisp previously determined to be down; not retrying
Expanding on #logoscia's comment, comp.lang.lisp isn't an NNTP server, but a newsgroup. You can use Gmane/Gwene to read mailing lists and RSS feeds via NNTP. You can also add a traditional news server, like news.eternal-september.org. The elisp snippet below can get you started.
(setq gnus-select-method '(nnml "")) ;; this depends on how you want
;; to get your mail
(setq gnus-secondary-select-methods '((nntp "news.gmane.org")
(nntp "news.eternal-september.org")))
Start Gnus with M-x gnus. In the group buffer hit ^ to get to the *Server* buffer then browse the newsgroups on the servers. From there you can subscribe/unsubscribe to newsgroups with u. Back in the *Group* buffer you will see your subscribed groups. For details, see the Gnus manual.
Related
I use Gnus v5.13 and BBDB version 3.2 under GNU Emacs 27.1.
BBDB is configured to create new entries only when I send a new message:
(require 'bbdb)
(bbdb-initialize 'gnus 'message)
(bbdb-mua-auto-update-init 'message)
(setq
bbdb-mua-auto-update-p 'query
bbdb-message-caching-enabled t
)
Sending emails using gnus-group-mail or compose-mail take radically distinct times:
gnus-group-mail (20 to 40s)
compose-mail (<1s)
I could reconfigure "m" and "r" in Gnus to point to 'compose-mail' rather than 'gnus-group-mail', but I am curious as to what could make Gnus so slow?
I thought that it could it be bbdb, so I changed '(bbdb-mua-auto-update-init 'message)' to '(bbdb-mua-auto-update-init nil)' to no avail...
I thought that it could be the "gcc" field of the email, so
I replaced
(setq gnus-message-archive-group
'((if (message-news-p)
"sent-news"
"sent-mail")))
by (the default value of the variable)
(setq gnus-message-archive-group '((format-time-string "sent.%Y-%m")))
The delay vanished, but I have no idea why the former would take so long!
I have two user accounts on my Mac.
I would like to open the same text file on both accounts with emacs.
I can put the file in a directory where both users have read and write access.
When I add text to one process I would like it to show up in the other buffer and vice verse automatically.
I have tried combinations of auto-save-mode and auto-revert-mode to try to auto save an auto revert, but that does not seem to work quite right.
Is there some normal way to do this with emacs?
I think you should learn about collaborative editing. There is a page on the emacs wiki about it link
Not a full answer. Just some thoughts. Nevertheless, this is formulated as answer since I want to supplement it with elisp code and maybe refine it later on. This is not possible with comments.
I assume that you are actually working with two emacsen at the two accounts. Furthermore, I assume that the problem with auto-revert-buffer is the timing, i.e. that auto-revert-buffer works with polling and not on demand.
If you want to update on demand you have to setup both emacsen as servers and give them the possibility to communicate bidirectionally.
You could do something like that via emacsclient with the option -e over ssh.
If you are in a private network you can also let the emacs servers directly communicate.
I had no luck with emacsclient and the default server-setup as sockets since emacsclient checks the ownership for the sockets. (Note: First, I used emacsclient for testing. Afterwards, I verified that the communication also works between two emacsen.)
But the code below shows a possibility with the emacs server communicating over tcp/ip.
Both emacsen should put their server files into the same directory. Naturally, you need to name the servers differently. Then you can communicate via the command server-eval-at.
Note, this stuff is security relevant and should only be used on a secure private network.
The below elisp code is not like a package but more like a collection of useful commands.
Nevertheless, on one server you can use the commands as they are. On the other one you need small modifications. E.g.: changing server-name.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Communication over tcp:
(setq server-use-tcp t)
(setq server-auth-dir "/tmp/eserv/")
(if (file-directory-p server-auth-dir)
(progn
(unless (file-accessible-directory-p server-auth-dir)
(error "Cannot access server-auth-dir"))
(unless (file-writable-p server-auth-dir)
(error "Cannot write to server-auth-dir"))
)
(mkdir server-auth-dir t)
(unless (shell-command (concat "chgrp users \"" server-auth-dir "\""))
(error "Cannot change group of server file directory to users."))
(chmod server-auth-dir (file-modes-symbolic-to-number "g+xr" (file-modes server-auth-dir))))
;;
(defadvice server-ensure-safe-dir (around unsafe activate)
"We are on a private network and do not fear intrusion.
Furthermore, the directory is already set up.
This is a SECURITY HOLE if you do not know what you are doing!"
(let ((dir (ad-get-arg 0)))
(unless (file-exists-p dir)
(error "File %s does not exist." dir))
(unless (file-directory-p dir)
(error "File %s is not a directory." dir))))
(server-force-delete)
(server-start)
(defvar server-file nil
"Full name of server file.")
(setq server-file (concat server-auth-dir server-name))
(unless (shell-command (concat "chgrp users \"" server-file "\""))
(error "Cannot change group of server file to users."))
(chmod server-file (file-modes-symbolic-to-number "g+r" (file-modes server-file)))
Afterwards, I discovered that communication of two emacsen is also possible via sockets. One only needs to get around the security and to soft-link the server sockets in the auth-directories.
So, you have the choice.
I am using the following code to archive replies to messages in the same group they come from; it works well.
;; Store sent messages in the same group they came from
(setq gnus-message-archive-method '(nnml ""))
(setq gnus-message-archive-group
'((lambda (x)
(cond
;; Store personal mail messages in the same group I started out in
((string-match ".*" group) group)
;; Store everything else in misc until I can sort it out
(t "mail.misc")))))
However, if I use C-x m from a non-GNUs buffer, or create a message without a group selected, there seems to be no archiving at all; the message is lost unless I manually fill in a GCC: mail.misc line. How can I make this happen automatically for all messages not made from within a group?
First you have to set gnus as mail handler.
(setq mail-user-agent 'gnus-user-agent)
Still this doesn't work, if gnus is not running when starting to
write a mail with C-x m. Here a advice helps.
(defadvice gnus-msg-mail (before start-gnus activate)
(require 'gnus-start)
(unless (gnus-alive-p)
(save-window-excursion
(let ((inhibit-redisplay t))
(gnus)))))
When entering IRC with M-erc, Emacs remembers the last used server name and port. You can accept, hitting enter, or change those parameters.
As for the user name, it defaults to system user name and not to the last used one.
How can I have Emacs to suggest the last user name or a predefined one?
For completeness I propose an answer allowing to store both your account ID and password.
Solution 1: Store account in the Emacs init file
Append/add to your Emacs init file:
(setq erc-nick "my-nice-id")
(setq erc-password "my-nice-pw")
Note: You will get an y/n query to accept default password (i.e. my-nice-pw).
Solution 2: Store account in an external storage file
To avoid sharing your sensitive data when/if you share your Emacs init file or to store your data in a more secure directory, you can store your account data in an external file. Append/add to your Emacs init file:
(let ((acc (read-lines "~/.my-erc-account")))
(setq erc-nick (car acc))
(setq erc-password (nth 1 acc)))
where ".my-erc-account" contains:
"my-nice-id"
"my-nice-pw"
Place and name this file as it is more convenient for you and adjust the read-lines argument accordingly.
You might want to look at:
M-x customize-group RET erc RET
(n.b. ERC has a lot of customisation options, so you'll probably find some interesting things in there...)
I created a very simple Elisp function to simply the process of ERC login: http://wenshanren.org/?p=314
While in summary buffer how can I make gnus fetching already read articles in two situations:
while in a thread with some articles already read (and thus not visible). I would like to complete the thread with all the articles (not only parents!) read or unread.
fetch last N read articles which are not visible.
Thanks a ton!
In the summary buffer, to fetch the parent, use ^ (gnus-summary-refer-parent-article) (also available as <menu-bar> <Article> <Fetch parent of article>).
To fetch the whole thread (at least the part that's still on your server), use A T (gnus-summary-refer-thread) (<menu-bar> <Article> <Fetch current thread>).
To fetch more articles, use / o (gnus-summary-insert-old-articles) (also available as <menu-bar> <Gnus> <See old articles>).
For the first question, try
(setq gnus-fetch-old-headers 'some)
in your .gnus
for the second, when you select the group, it should ask you how many old articles you want to fetch. Does that not work?
While ^ and / o commands already mentioned this one useful for debugging: M-^ (gnus-summary-refer-article) when you work with message pain text (which you can get by C-u g).
gnus-summary-refer-parent-article internally used gnus-summary-refer-article...
(defun codefalling/gnus-show-all ()
"Show all mail"
(interactive)
(gnus-summary-insert-old-articles t) ;; show all, or t->50 to show 50 old mail
(goto-char (point-min)))
(add-hook 'gnus-summary-mode-hook '(lambda () (run-with-idle-timer 0.1 nil 'codefalling/gnus-show-all)))
Then gnus will show all mail read or unread.