Hi, I am going to send you my gnus.el and my init.el file what it looks like now.
may be it helps Am 09.01.26 um 17:45 schrieb Bob Newell:
Gottfried, I'll try to look into this, however one thing stands out--- did you (require 'gnus)prior to the code you sent?
As far as I can see, it is not there, but may be I overlooked it. Do you mean in my init.el file or in my gnus.el file? Gnus should load automatically through init.el so where should I put (require 'gnus)? Also I
want to be sure you are using BBDB 3 and not BBDB 2.
I have got BBDB 3.2.2.4 at the moment
The best place for your code would be in gnus.el, after gnus has been loaded but before gnus is started, in other words (require 'gnus) .... code ... (gnus)
As far as I understand you I should put: (reguire ´gnus) at the beginning of my gnus.el file after that the code for BBDB and then (gnus) Is that right? Sorry, but I am a newbie in Emacs and gnus, so I am fighting with the basics on a daily basis!
If I can't figure it out I'll send you my code, however that may be worse as my own setup has evolved over a period of many years and is quite complex.
my gnus.el:
;; shows debugger
(setq smtpmail-debug-info t)
;; get emails
(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
'((nnimap "posteo"
(nnimap-address "posteo.de")
(nnnimap-user "[email protected]")
(nnimap-authenticator login)
(nnimap-stream ssl)
(nnimap-server-port 993))))
;; send emails according to Arash Esbati
(setq gnus-parameters
'((".*"
(posting-style
(name "gfp")
(address "[email protected]")))))
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-smtp-server "posteo.de"
smtpmail-smtp-service 587)
;;check emails every 5 min
;;(gnus-demon-add-handler 'gnus-demon-scan-mail 5 t)
;; (gnus-demon-init)
;; nice overview of all groups with unread/total count
(setq gnus-group-line-format "%5M %5y/%-8t • %c\n")
;;a copy of my message is stored in the same group
(setq gnus-parameters '(("^nnimap.*" (gcc-self . t))))
;;a copy of my message stored in groups mail and nnml
;(setq gnus-parameters '(("^nnimap.*" (gcc-self . t))
; ("^nnml.*" (gcc-self . t))))
;; to see always all groups
;;(setq gnus-permanently-visible-groups ".*")
; news in gnus
(setq gnus-third-select-methods '(nntp "news.eternal-september.org"
(nntp-port-number 119)))
;; (user-full-name "gfp"))
;;(setq user-mail-address "[email protected]")
;;(setq user-mail-password "ukkhdoqaw")
;; (add-to-list 'gnus-secondary-select-methods
;; '(nntp "news.yourSecondProvider.net"))
;; (add-to-list 'gnus-secondary-select-methods
;; '(nntp "news.yourThirdProvider.net"))
;; three pane layout, Group buffer on the left, summary buffer top-right
;; article buffer bottom-right
(gnus-add-configuration
'(article
(horizontal 1.0
(vertical 25
(group 1.0))
(vertical 1.0
(summary 0.25 point)
(article 1.0)))))
(gnus-add-configuration
'(summary
(horizontal 1.0
(vertical 25
(group 1.0))
(vertical 1.0
(summary 1.0 point)))))
;;nice colours for spot groups with new emails
'((gnus-group-mail-1-empty ((t (:foreground "SlateGray3"))))
'(gnus-group-mail-3 ((t (:foreground "spring green"))))
'(gnus-group-mail-3-empty ((t (:foreground "SlateGray3"))))
'(gnus-group-news-3 ((t (:foreground "spring green"))))
'(gnus-group-news-3-empty ((t (:foreground "SlateGray3"))))
'(gnus-group-news-low ((t (:foreground "spring green")))))
;;gnus summary buffer lines
;;(setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n")
;;(setq gnus-summary-line-format ":%U%R %B %s %-60=|%4L |%-20,20f
|%&user-date; \n") ;;date
;;(setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-23,23f%]%) %s
%~(form (format-time-string \"%d-%b-%Y\" (gnus-date-get-time
(mail-header-date gnus-tmp-header))))@\n") ;;DDMMMYYYY
(setq gnus-user-date-format-alist '(((gnus-seconds-today) . " %k:%M")((+ (gnus-seconds-today) (* 24 3600)) . " %l %p")
(604800 . " %a")
(31536000 . "%e %b")
(t . " %Y")))
(setq gnus-summary-line-format "%1{%U%R%O %4k%} %3{%&user-date;%*
│%}%I%(%-16,16f%) %5{%s%}\n")
(setq gnus-face-5 'gnus-button)
;; which headers are shown
;; (setq gnus-visible-headers
;; '("^From" "^Subject" "^Date" "^Newsgroups" "^Followup-To"
;; "^User-Agent" "^X-Newsreader" "^X-Mailer"))
;;don't show html
;;(with-eval-after-load "mm-decode"
;; (add-to-list 'mm-discouraged-alternatives "text/html")
;; (add-to-list 'mm-discouraged-alternatives "text/richtext"))
;;If you don’t want HTML rendered, even if there’s no text alternative add
;;(setq mm-automatic-display (remove "text/html" mm-automatic-display))
;;Tell mm that we like text/html the least.(Björn Bidar)
(setopt mm-discouraged-alternatives '("text/html"))
;; set renderer for html mail to w3m in emacs
;; (setopt mm-text-html-renderer 'gnus-w3m)
(setopt mm-text-html-renderer 'w3m)
;;adaptive scoring Gnus watches me and finds out what is interesting for me
;;and set up rules
;; (setq gnus-use-adaptive-scoring t)
;;disable threading in some groups
;-----------------------------------------
;An edited excerpt from my .gnus.el:
;; List of the SMTP accounts available
;(defvar smtp-accounts
; '((ssl "[email protected]" "smtp.gmail.com" 587 "[email protected]" nil)
; (ssl "[email protected]" "smtp.gmail.com" 587
"[email protected]" nil)))
;; Let Gnus change the "From:" line by looking at which group we are in.
;(setq gnus-posting-styles
; '(("mymail" (address "[email protected]")
; (X-Message-SMTP-Method "smtp smtp.gmail.com 587 [email protected]")
; (name "My Name")
; (signature "My Signature"))
; ("mysecondmail" (address "[email protected]")
; (X-Message-SMTP-Method "smtp smtp.gmail.com 587
[email protected]")
; (name "My Name") ; (signature "My Other Signature")))) ;; Use SMTP like this ;(require 'smtpmail) ;(setq send-mail-function 'smtpmail-send-it ; message-send-mail-function 'smtpmail-send-it ; mail-from-style nil ; user-full-name "My Name" ; smtpmail-debug-info t ; smtpmail-debug-verb t) ;; If plain ;(defun set-smtp (mech server port user password) ; "Set related SMTP variables for supplied parameters." ; (setq smtpmail-smtp-server server ; smtpmail-smtp-service port ; smtpmail-auth-credentials (list (list server port user password)) ; smtpmail-auth-supported (list mech) ; smtpmail-starttls-credentials nil) ; (message "Setting SMTP server to `%s:%s' for user `%s'." ; server port user)) ;; If SSL ;(defun set-smtp-ssl (server port user password &optional key cert) ; "Set related SMTP and SSL variables for supplied parameters." ; (setq starttls-use-gnutls t ; starttls-gnutls-program "gnutls-cli" ; starttls-extra-arguments nil ; smtpmail-smtp-server server ; smtpmail-smtp-service port ; smtpmail-auth-credentials (list (list server port user password)) ; smtpmail-starttls-credentials (list (list server port key cert))) ; (message "Setting SMTP server to `%s:%s' for user `%s'. (SSL enabled.)" ; server port user)) ;; Figure out which server to use in the current case ;(defun change-smtp () ; "Change the SMTP server according to the current from line." ; (save-excursion ; (cl-loop with from = (save-restriction ; (message-narrow-to-headers) ; (message-fetch-field "from")) ; for (auth-mech address . auth-spec) in smtp-accounts ; when (string-match address from) ; do (cond ; ((memq auth-mech '(cram-md5 plain login)) ; (cl-return (apply 'set-smtp (cons auth-mech auth-spec)))) ; ((eql auth-mech 'ssl) ; (cl-return (apply 'set-smtp-ssl auth-spec))) ; (t (error "Unrecognized SMTP auth. mechanism: `%s'." auth-mech))) ; finally (error "Cannot infer SMTP information.")))) ;; Tell SMTP when to change servers ;(defvar %smtpmail-via-smtp (symbol-function 'smtpmail-via-smtp)) ;(defun smtpmail-via-smtp (recipient smtpmail-text-buffer) ; "Trigger change-smtp just before every smtp-mail-via-smtp call." ; (with-current-buffer smtpmail-text-buffer ; (change-smtp)); (funcall (symbol-value '%smtpmail-via-smtp) recipient smtpmail-text-buffer))
;--------------------------------------------------------------------- here is my init.el file: ;;add Melpa archives (eval-and-compile (require 'package)(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)))
(eval-when-compile
(require 'use-package)
(setq use-package-always-ensure t))
;; to check init file
(setq debug-on-error t)
;;custom.el file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load-file custom-file)
;;tab-bar-history-mode tab window or buffer change I can walk
forward/backward through that history
(global-set-key (kbd "M-[") 'tab-bar-history-back) (global-set-key (kbd "M-]") 'tab-bar-history-forward) ;;scrol-bar on the left side (set-scroll-bar-mode 'left) ;;column nummer is always on (column-number-mode) ;;gnus.el file (setq gnus-file (expand-file-name "gnus.el" user-emacs-directory)) (load-file gnus-file) ;; Display line numbers in every buffer (global-display-line-numbers-mode 1) ;; Remembering recently edited files (recentf-mode 1) ;; Save what you enter into minibuffer prompts (setq history-length 25) (savehist-mode 1) ;; Remember and restore the last cursor location of opened files (save-place-mode 1) ;; Revert buffers when the underlying file has changed (global-auto-revert-mode 1) ;; Revert Dired and other buffers (setq global-auto-revert-non-file-buffers t) ;; Display time in mode-line (display-time-mode 1) (customize-set-variable 'display-time-24hr-format t) ;; Auto Fill mode (add-hook 'turn-on-auto-fill 1) ;; save the desktop for next session (desktop-save-mode 1);;hippie-expand erweitert Wörter etc statt DAbbrev, das standardmäßig installiert ist
(global-set-key [remap dabbrev-expand] 'hippie-expand);; vertico und marginalia (Randbemerkungen machen) noch zu installieren in Guix (von Felix Lechner)
;;(use-package vertico ;; :custom ;; (vertico-count 10) ;; (vertico-resize t) ;; (vertico-cycle t) ;; :init ;; (vertico-mode)) ;;(use-package marginalia ;; :after vertico ;; :init ;; (marginalia-mode)) ;;for better experience in all of Emacs 3 Org-mode keys set (global-set-key (kbd "C-c l") #'org-store-link) (global-set-key (kbd "C-c a") #'org-agenda) (global-set-key (kbd "C-c c") #'org-capture) ;; keysee package for checking keys on the fly von Drew Adams (require 'cl-macs)(add-to-list 'load-path "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/keysee/")
(require 'sortie) (require 'keysee) (kc-auto-mode) ;;icicles package von Drew Adams (add-to-list 'load-path "/home/gfp/.config/emacs/elpa/") (require 'icicles) (icy-mode 1) ;;bookmark+ von Drew Adams(add-to-list 'load-path "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/bookmark+/")
(require 'bookmark+) ;; dired+ von Drew Adams(add-to-list 'load-path "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/dired+/")
(require 'dired+) ;;menu-bar+ von Drew Adams;;(add-to-list 'load-path "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/menu-bar+/")
;;(eval-after-load "menu-bar" '(require 'menu-bar+)) ;;(require 'menu-bar+) war vor dem (eval...);; electric-quote-mode in custom.el grundsätzlich ergänzt, hier für deutsche Anführungszeichen
(add-hook 'org-mode-hook 'electric-quote-mode)
(setq electric-quote-replace-double t
electric-quote-chars '(8216 8217 8222 8220))
;;eev starting with 2 buffers
(defun r () (interactive) (find-2a nil '(find-fline "~/REFCARD")))
;;shell mode enables e.g.changing of colours...
(add-hook 'comint-output-filter-functions 'comint-osc-process-output)
;;search in www with w3m without javascript Bob Newell
(defun google (searchfor)
"Google search with w3m"
(interactive "sGoogle for: ")
(w3m (concat "http://www.google.com/search?&q=" (string-replace " " "+"
searchfor))))
;;BBDB: Address list von Josep Bigorra(add-to-list 'load-path "/gnu/store/") ;;yldh1rv4qlfqs25fgxw4d0n3rz6yiwmv-emacs-bbdb-3.2.2.4 will be changed after updating
(require 'bbdb)
(bbdb-initialize 'message 'gnus 'sendmail)
(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
(setq bbdb/mail-auto-create-p t
bbdb/news-auto-create-p t)
;;auto-complete emacs address using bbdb UI
(add-hook 'message-mode-hook
'(lambda ()
(flyspell-mode t)
(local-set-key (kbd "TAB") 'bbdb-complete-mail)))
;; von Bob Newell
(bbdb-mua-auto-update-init 'gnus 'message 'mail)
(setq bbdb-complete-mail t)
(setq bbdb-message-all-addresses t)
(setq bbdb-completion-list t)
(setq bbdb-complete-mail-allow-cycling t)
(setq bbdb-completion-display-record nil)
(setq bbdb-mua-auto-update-p 'bbdb-select-message)
(setq bbdb-mua-update-interactive-p '(t . query))
(setq bbdb-update-records-p 'create)
(setq bbdb-allow-duplicates t)
(setq bbdb-add-mails t)
(setq bbdb-add-name nil)
(setq bbdb-add-aka t)
(setq bbdb-new-mails-primary nil)
(setq bbdb-ignore-redundant-emails t)
(setq bbdb-mua-pop-up nil)
;;printer (slides=two-..., number-up=2... bei Querformat)
(setq lpr-switches
(append '("-P" "HP-Officejet-J4500-series"
"-o" "sides=one-sided-long-edge"
"-o" "number-up=1"
"-o" "print-quality=3")
lpr-switches))
;;print preview
(setq ps-lpr-command "print_preview")
;;M-x ps-print-buffer or M-x ps-print-region to print to a PostScript
printer 2 pages on an A4 paper
;; 2 column landscape size 7 prints column 0-78, lines 1 to 70;;Now you can use ‘M-x ps-print-buffer’, ‘M-x ps-print-buffer-with-faces’, ‘M-x ps-print-region’, and ‘M-x ps-print-region-with-faces’. ;;Use the C-u prefix to save the PostScript code into a file instead of printing it.
(setq ps-paper-type 'a4
ps-font-size 10.0
ps-print-header nil
ps-portrait-mode t
ps-number-of-columns 1
ps-left-margin 15.0
ps-right-margin 15.0)
;; printing.el options
(require 'printing)
(setq pr-path-alist
'((unix "." "/home/gfp/.guix-profile/bin" ghostview mpage
PATH) ;;'((unix "." "~/bin" ghostview mpage PATH)
(ghostview "/home/gfp/.guix-profile/bin/gsview-dir")
;; (ghostview "$HOME/bin/gsview-dir")
(mpage "/home/gfp/.guix-profile/bin/mpage-dir")
;; (mpage "$HOME/bin/mpage-dir")
))
(setq pr-txt-name 'prt_06a)
(setq pr-txt-printer-alist
'((prt_06a "lpr" nil "prt_06a")
(prt_07c nil nil "prt_07c")
))
(setq pr-ps-name 'lps_06b)
(setq pr-ps-printer-alist
'((lps_06b "lpr" nil "-P" "lps_06b")
(lps_07c "lpr" nil nil "lps_07c")
(lps_08c nil nil nil "lps_08c")
))
(setq pr-temp-dir "/tmp/")
(setq pr-gv-command "gv")
(setq pr-gs-command "gs")
(setq pr-gs-switches '("-q -dNOPAUSE -I/usr/share/ghostscript/5.10"))
(setq pr-gs-device "uniprint")
(setq pr-gs-resolution 300)
(setq pr-ps-utility 'mpage)
(setq pr-ps-utility-alist
'((mpage "mpage" nil "-b%s" "-%d" "-l" "-t" "-T" ">" nil)
(psnup "psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil
(inherits-from: . no-duplex))
))
(setq pr-setting-database
'((no-duplex
nil nil nil
(pr-file-duplex . nil)
(pr-file-tumble . nil))
))
(pr-update-menus t) ; update now printer and utility menus
;; printing with paps (Jean)
(defun rcd-command-output-from-input (program input &rest args)
"Return output string from PROGRAM with given INPUT string and
optional ARGS."
(let* ((output (with-temp-buffer
(insert input)
(apply #'call-process-region nil nil program t '(t nil) nil
args)
(buffer-string))))
output))
;;I am too often using landscape, you can adjust it for your needs.
(defun rcd-paps-process (text &optional format title &rest args)
(let* ((format (or format "pdf"))
(title (or title (buffer-name)))
(length (length title))
(max 45)
(title (if (> length max) (substring title 0 max) title)))
(apply 'rcd-command-output-from-input "paps" text "--format" format
"--landscape" "--title" title "--header" args)))
(defun string-to-file-force (string file)"Prints string into file, matters not if file exists. Return FILE as file name."
(with-temp-file file
(insert string))
file)
(defun rcd-paps-text-to-pdf (text &optional file-name title)
(let* ((output (rcd-paps-process text "pdf" title))
(file-name (or file-name (concat (file-name-as-directory (getenv
"HOME")) (read-string "File name without .pdf extension: ") ".pdf"))))
(string-to-file-force output file-name)))
(defun rcd-paps-buffer-to-pdf-view ()
(interactive)
(let ((output (rcd-paps-process-buffer))
(file-name (rcd-temp-file-name nil "pdf")))
(sleep-for 1)
(start-process "evince" nil "evince" (string-to-file-force output
file-name))))
;;to edid compressed files (auto-compression-mode 1) (add-to-list 'load-path "/home/gfp/.config/emacs/elpa/markdown-mode-2.5/") (load "markdown.el")(add-to-list 'load-path "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
(load "asciidoc.el") ;;von LibreOffice export csv nach Emacs org kopieren (defun org-table-import-xlsx-to-csv-org () (interactive)(let* ((source-file (file-name-sans-extension (buffer-file-name (current-buffer))))
(xlsx-file (concat source-file ".xlsx"))
(csv-file (concat source-file ".csv"))
(org-odt-convert-processes '(("gnumeric"
"~/.local/bin/xlsx2csv %i %o"))))
(org-odt-convert xlsx-file "csv")
(org-table-import csv-file nil)))
(defun org-table-import-xls-to-csv-org ()
(interactive)
(let* ((source-file (file-name-sans-extension (buffer-file-name
(current-buffer))))
(xlsx-file (concat source-file ".xls"))
(csv-file (concat source-file ".csv")))
(org-odt-convert xlsx-file "csv")
(org-table-import csv-file nil)))
(defun org-table-import-ods-to-csv-org ()
(interactive)
(let* ((source-file (file-name-sans-extension (buffer-file-name
(current-buffer))))
(xlsx-file (concat source-file ".ods"))
(csv-file (concat source-file ".csv")))
(org-odt-convert xlsx-file "csv")
(org-table-import csv-file nil)))
thanks very much for your help
Gottfried
OpenPGP_0x61FAF349C9FB7F94.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
