Re: Treat article with external script

2020-06-23 Thread Helmut Waitzmann Anti-Spam-Ticket . b . qc3c

Breanndán Ó Nualláin :

I'd like to be able to do article washing by running the article 
through an external python script. Is there an easy way to do 
this?



You could define a function:  



  (defun my-gnus-article-wash nil
"Invoke the program '(car my-gnus-article-wash)' on the current buffer.
  If the variable 'my-gnus-article-wash' is a non-nil list of a
  program name and positional parameters, run it as a filter on
  the current buffer's contents."
(interactive)
(if my-gnus-article-wash
  (apply
(function call-process-region)
(point-min)
(point-max)
(car my-gnus-article-wash)
t
t
nil
(cdr my-gnus-article-wash


… and a variable:  



  (defvar my-gnus-article-wash nil
"*invocation list to be executed on contents of the article buffer.
  If non-nil, is a list containing an executable file name and argv1
  ... argvn invocation arguments to execute on the contents of
  the article buffer and replacing it. One example would be
  '(\"iconv\" \"-t\" \"ASCII//TRANSLIT\")
  to transliterate every non-ASCII character to its corresponding
ASCII approximate character.")


You might put the function and variable definitions in a file, for 
example "~/my_emacs_libs/gnus_wash_articles.el".  Byte compile 
that file.  Have it loaded from the emacs startup file: 


  (load "~/my_emacs_libs/gnus_wash_articles")


You might put the following assignments into the gnus startup 
file: 



Assign a value to the variable:  



  (setq-default
my-gnus-article-wash
'("the_external_python_script" "and" "its" "parameters"))


Put the function into the gnus-part-display-hook:  



  (add-hook
'gnus-part-display-hook
(function my-gnus-article-wash))

That will invoke the python script with the given parameters on 
the article content. 



___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: nnir with notmuch gives error; Possible solution!

2020-03-26 Thread Helmut Waitzmann

Eric Abrahamsen :

physiculus  writes:


But how could i change the string inside the filename from !2 
to :2 ? Perhaps with dired, but i dont know how?


Dired has wdired-mode that allows you to edit file names in the 
dired buffer as though they were plain text, and then "commit" 
all the renames at once. If you have a small number of files to 
rename or they're all in the same directory that would be most 
straightforward. If these files are scattered through a very 
large number of directories you'll probably want to do it in the 
shell, probably with find and exec and mv.


As physiculus apparently uses a linux system, I assume, that 
"find" will be GNU "find", "ls" will be GNU "ls", and a "bash" 
will be available. 


  (
cd -- /the/nndir/directory/hierarchy &&
find . -depth -name '*!*' \
  ! -exec bash -c -- '
curname="${1##*/}" && dir="${1%"$curname"}" &&
newname="${curname//!/:}" &&
if test -e "${dir}${newname}" ||
  test -L "${dir}${newname}"
then
  # The file to be renamed to already exists!
  # What should be done?  Let the user decide:
  cd -- "$dir" &&
  printf %s\\n \
'\''current subdirectory:'\'' \
"$dir" \
'\''The file to be renamed to,'\'' \
"$newname" '\''already exists!'\'' \
'\''Please enter shell commands to resolve'\'' \
'\''that situation.  For your convenience,'\'' \
'\''the current file'"'s"' name is in the'\'' \
'\''positional parameter "$1", while the new'\'' \
'\''one is in the positional parameter "$2".'\'' \
'\''For example, try the commands'\'' \
'\''  ls -QF1logd -- "$1" "$2"'\'' \
and \
'\''  mv -i -- "$1" "$2"'\'' \
'\''Type the command "exit" when finished.'\'' &&
  ls -QFlogdU -- "$curname" "$newname" &&
  "${SHELL}" -sim -- "$curname" "$newname"
else
  # REMOVE THE FOLLOWING LINE STARTING WITH "printf" TO
  # ACTUALLY LET THIS COMMAND MOVE FILES:
  printf '%q\n' \
  mv -- "${dir}${curname}" "${dir}${newname}"
fi' bash \{\} \;
  )

Not tested, though, therefore the actual "mv" command will only be 
printed rather than executed.  See the comment written in 
capitals, above.




___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus notification of replies to my articles

2020-03-13 Thread Helmut Waitzmann

Richmond :

Is it possible to get gnus to tell me of replies to my articles? 



I don't know. 



or maybe raise the score of them? 



Yes.  Make a scoring rule:  In the summary buffer, while reading 
one of your articles, type the key sequence “I f e p” and then 
your name and e‐mail address (which is already filled in as a 
proposal).  Then type “RET” or “C-j”.


That should add a permanent scoring rule to the current newsgroup 
raising all direct followups to all articles the “From” header 
field value of consists of your name and e‐mail address.



___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: color of transient-mark-mode

2015-02-15 Thread Helmut Waitzmann
Haines Brown hai...@engels.histomat.net writes:

Helmut Waitzmann nn.throt...@xoxy.net writes:

 Hit

 M-x list-faces-display

 to get the Faces Buffer.  Position the cursor at the line starting with
 “region”.  Press

 C-m

 customize and save.

I thought this worked, but it turned out to apply only to the current
buffer because it was not saved. This reason is that all my emacs
sessions use -q and define their own init files.

What I need is a string in the init files that defines the
highlight/transient background. Could you be of help here?

I'm sorry, no.  I use to customize the colors by means of X resources,
because colors are higly dependent on the color capabilities of the X
display (grayscale, pseudocolor, truecolor, …):

In a file, eg. named 'xdefaults.xrd' , I put the following lines:
! --START_OF_FILE xdefaults.xrd
/*
The following display classes have been copied from X11/X.h.
It would be better to just include X11/X.h here instead of
having copied the definitions, but I don't know how to get
the root of the X11 include directory tree.

Display classes used in opening the connection

Note that the statically allocated ones are even numbered
and the dynamically changeable ones are odd numbered
*/

#define StaticGray  0
#define GrayScale   1
#define StaticColor 2
#define PseudoColor 3
#define TrueColor   4
#define DirectColor 5

#ifdef COLOR
!   color display; use colors
#   define MY_SELECT_BACKGROUND_COLOR   rgbi:0.8/1.0/0.8
#   define MY_SELECT_FOREGROUND_COLOR   black
#else
!   no color display; use shades of grey
#   define MY_SELECT_FOREGROUND_COLOR   black
#   define MY_SELECT_BACKGROUND_COLOR   white
#endif

Emacs*region.attributeForeground:   MY_SELECT_FOREGROUND_COLOR
Emacs*region.attributeBackground:   MY_SELECT_BACKGROUND_COLOR
! --END_OF_FILE xdefaults.xrd

Then I send it to the X server by means of the following shell command:

$ xrdb  xdefaults.xrd

See the manual page xrdb(1).


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: color of transient-mark-mode

2015-02-12 Thread Helmut Waitzmann
Haines Brown hai...@engels.histomat.net writes:

I'm running emacs 24.4.1 on Debian Wheezy, and the background color of
transient mark is too dark, making the highlighted text hard to
read. I'd like to change the background color to a lighter color, but
I'm sure this can be done yet in my current version of emacs.

Hit

M-x list-faces-display

to get the Faces Buffer.  Position the cursor at the line starting with
“region”.  Press

C-m

customize and save.


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: own webbased newsgroup types

2015-02-04 Thread Helmut Waitzmann
Stefan Huchler stefan.huch...@mail.de writes:

  (let ((last (car (last articles)))
   (did nil)


I have no idea what this did thing is supposed to be

You might read the documentation for the special form let.  To do
that, type C-h f let RET

Let me comment that documentation:

The first parameter of let is the VARLIST, a list of variables.  Each
variable in that VARLIST is either a symbol: SYMBOL, which is bound to
nil, or it is a list of 2 elements: (SYMBOL VALUEFORM), which binds the
SYMBOL to the value of VALUEFORM.

In your example:

  (let ((last (car (last articles)))
   (did nil)

the first element of the VARLIST is a list of two elements:

(last (car (last articles)))

= (SYMBOL VALUEFORM)

which tells let to bind the SYMBOL last to the value of the
VALUEFORM (car (last articles)),

and the second element of the VARLIST is a list of two elements, as well:

(did nil)

= (SYMBOL VALUEFORM)

which tells let to bind the SYMBOL did to the value of the
VALUEFORM nil.


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Need help on setting multiple gmail imap account

2015-01-16 Thread Helmut Waitzmann
Eric thegrea...@gmail.com writes:

 (add-to-list 'gnus-secondary-select-methods
'(nnimap name1
   (nnimap-address imap.gmail.com)
   (nnimap-server-port 993)
   (nnimap-stream ssl)
   (nnir-search-engine imap)
   (nnmail-expiry-target nnimap+gmail:[Gmail]/Trash)
   (nnmail-expiry-wait 90))
'(nnimap name2
  (nnimap-address imap.gmail.com)
  (nnimap-server-port 993)
  (nnimap-stream ssl)))

 the authinfo file has:
 machine name1 login email1 at gmail.com password mypass1 port 993 force yes
 machine name2 login email2 at gmail.com password mypass2 port 993 force yes

 but it doesn't work for me. There are several other solutions like this
 online. Looks like gnus is trying to connect to name1 and name2 which is not
 a real server name. It might be possible by editing the etc/host file.

Use a different authinfo file for each of the two accounts:

 (add-to-list 'gnus-secondary-select-methods
'(nnimap name1
  (nnimap-authinfo-file ~/name1.authinfo)
   (nnimap-address imap.gmail.com)
   (nnimap-server-port 993)
   (nnimap-stream ssl)
   (nnir-search-engine imap)
   (nnmail-expiry-target nnimap+gmail:[Gmail]/Trash)
   (nnmail-expiry-wait 90))
'(nnimap name2
  (nnimap-authinfo-file ~/name2.authinfo)
  (nnimap-address imap.gmail.com)
  (nnimap-server-port 993)
  (nnimap-stream ssl)))

The contents of the authinfo files are then

~/name1.authinfo:
machine imap.gmail.com login email1 at gmail.com password mypass1 port 993 
force yes

~/name2.authinfo:
machine imap.gmail.com login email2 at gmail.com password mypass2 port 993 
force yes


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english