merged
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 10 Nov 2011 13:35:15 +0200
changeset 818 bbccd9875916
parent 817 a4cbbc50ee76 (diff)
parent 809 9712975c4263 (current diff)
child 819 38b7c81853e8
child 822 836107c5c06f
merged
.emacs-my
--- a/.emacs-my	Wed Nov 09 10:03:47 2011 +0200
+++ b/.emacs-my	Thu Nov 10 13:35:15 2011 +0200
@@ -463,8 +463,11 @@
 (defvar my-scroll-margin 4)
 
 (setq-default
- scroll-step 1
- scroll-conservatively my-scroll-margin
+ ;; Set to zero as this recomment documentation.
+ scroll-step 0
+ ;; If the value is greater than 100, redisplay will never recenter point, but
+ ;; will always scroll just enough text to bring point into view
+ scroll-conservatively 1000
  scroll-preserve-screen-position t
  )
 
@@ -1234,13 +1237,26 @@
 (setq gnus-site-init-file "~/.gnus.el")
 
 ;; Store gnus specific files to '~/.gnus'.
-(setq gnus-directory "~/.gnus")
-(setq message-directory "~/.gnus/mail")
-(setq nnml-directory "~/.gnus/nnml-mail")
-(setq gnus-article-save-directory "~/.gnus/saved")
-(setq gnus-kill-files-directory "~/.gnus/scores")
-(setq gnus-cache-directory "~/.gnus/cache")
-(setq spam-directory "~/.gnus/spam/")
+(setq
+ gnus-directory "~/.gnus"
+ gnus-agent-directory "~/.gnus/agent/"
+ gnus-article-save-directory "~/.gnus/saved"
+ gnus-kill-files-directory "~/.gnus/scores"
+ gnus-cache-directory "~/.gnus/cache"
+ mail-source-directory "~/.gnus/mail"
+ message-directory "~/.gnus/mail"
+ message-auto-save-directory "~/.gnus/autosave"
+ ;; message-signature-directory
+ mailcap-download-directory  "~/.gnus/mailcap"
+ nnml-directory "~/.gnus/nnml-mail"
+ spam-directory "~/.gnus/spam/"
+ smime-certificate-directory "~/.gnus/certs/"
+ nnfolder-directory "~/.gnus/archive"
+ nnfolder-active-file "~/.gnus/archive/active"
+)
+
+;; Remove gnus-ignored-newsgroups to show all GMail folders.
+(setq gnus-ignored-newsgroups nil)
 
 ;; (require 'spam)
 ;; (setq gnus-spam-process-newsgroups
@@ -1290,7 +1306,7 @@
    gnus-sum-thread-tree-indent " "
    gnus-sum-thread-tree-leaf-with-other "├► "
    gnus-sum-thread-tree-root ""
-   gnus-sum-thread-tree-single-leaf "╰► "
+   gnus-sum-thread-tree-single-leaf "└► "
    gnus-sum-thread-tree-vertical "│"
    ))
 
@@ -1346,6 +1362,12 @@
 ;; (add-hook 'message-sent-hook 'gnus-score-followup-article)
 ;; (add-hook 'message-sent-hook 'gnus-score-followup-thread)
 
+;; (setq gnus-home-score-file
+;;       ;; All groups that match the regexp `"\\.emacs"'
+;;       '(("\\.emacs" "emacs.SCORE")
+;;         ;; All the comp groups in one score file
+;;         ("^comp" "comp.SCORE")))
+
 ;; (setq imap-log t)
 
 ;; (setq mail-user-agent 'mh-e-user-agent)
@@ -1353,14 +1375,28 @@
 ;; `gnus-score-followup-thread'
 ;; `gnus-score-followup-article'
 
+(custom-set-faces '(gnus-summary-cancelled ((t (:foreground "plum" :background nil)))) )
 
-;; (setq gnus-use-adaptive-scoring t)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(message "bbdb")
 
-;; (setq gnus-home-score-file
-;;       ;; All groups that match the regexp `"\\.emacs"'
-;;       '(("\\.emacs" "emacs.SCORE")
-;;         ;; All the comp groups in one score file
-;;         ("^comp" "comp.SCORE")))
+(setq
+ bbdb-offer-save 1
+ bbdb-use-pop-up t
+ bbdb-electric-p t
+ bbdb-popup-target-lines  1
+ )
+
+(setq bbdb-complete-name-full-completion t)
+(setq bbdb-completion-type 'primary-or-name)
+(setq bbdb-complete-name-allow-cycling t)
+
+(setq bbdb-file "~/.gnus/bbdb")
+
+;; (bbdb-initialize 'gnus 'message)
+;; (bbdb-insinuate-message)
+;; (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "jabber")
--- a/Makefile	Wed Nov 09 10:03:47 2011 +0200
+++ b/Makefile	Thu Nov 10 13:35:15 2011 +0200
@@ -87,6 +87,7 @@
 	$(EMACS) --batch \
 		--eval='(let ( (generated-autoload-file "~/.emacs.d/my-lisp/autoload-my.el") ) (update-directory-autoloads "~/.emacs.d/my-lisp") )'
 	./.emacs-autogen.sh $(HOME)/.emacs-autogen
+	install -m 775 stmcrblog.sh $(HOME)/usr/bin/stmcrblog
 
 .PHONY: uninstall
 uninstall:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stmcrblog-mode.el	Thu Nov 10 13:35:15 2011 +0200
@@ -0,0 +1,116 @@
+;;; stmcrblog-mode.el --- static micro-blogging engine from Emacs
+
+;; Copyright (C) 2011 by Oleksandr Gavenko <gavenkoa@gmail.com>
+
+;; You can do anything with this file without any warranty.
+
+;; Author: Oleksandr Gavenko <gavenkoa@gmail.com>
+;; Maintainer: Oleksandr Gavenko <gavenkoa@gmail.com>
+;; Created: 2011-11-10
+;; Version: 0.1
+;; Keywords: blog, microblog, blogging, gtd
+
+;;; Commentary:
+;;
+;; Very pure release.
+
+;;; Code:
+
+(defconst stmcrblog-major-version 0
+  "stmcrblog major version.")
+
+(defconst stmcrblog-minor-version 1
+  "stmcrblog major version.")
+
+(defun stmcrblog-version (&optional here)
+  "Return stmcrblog version."
+  (interactive "P")
+  (let ( (version-string (format "stmcrblog %d.%d" stmcrblog-major-version stmcrblog-minor-version)) )
+    (if here
+        (insert version-string)
+      (if (called-interactively-p 'interactive)
+          (message "%s" version-string)
+        version-string))
+    ))
+
+(defvar stmcrblog-file "~/.stmcrblog"
+  "Blog entries storage file name.")
+
+(defvar stmcrblog-after-add-entry-hook nil
+  "`stmcrblog-after-add-entry-hook' called after adding entries.
+You can use this hook to render and publish `stmcrblog-file'.")
+
+(defun stmcrblog-add-entry (msg)
+  "Add post to blog.
+Automatically set time to current value. Only first line of MSG
+was added.
+
+`stmcrblog-after-add-entry-hook' called after adding entries. You
+can use this hook to render and publish `stmcrblog-file'."
+  (let (
+        (coding-system-for-read 'utf-8)
+        (coding-system-for-write 'utf-8)
+        pos
+        )
+    (setq pos (string-match "\n" msg))
+    (when pos
+      (setq msg (substring msg 0 pos)))
+    (save-excursion ;save-window-excursion
+      (find-file stmcrblog-file)
+      (beginning-of-buffer)
+      (insert
+       (format-time-string "%Y-%m-%d %H:%M" (current-time))
+       " "
+       msg
+       "\n")
+      (save-buffer)
+      (kill-buffer)
+      )
+    (run-hooks 'stmcrblog-after-add-entry-hook)
+    ))
+
+(defvar stmcrblog-buffer-name "*stmcrblog-entry*"
+  "`stmcrblog' buffer name for composing editing message")
+
+(defun stmcrblog-post-edit (&optional msg)
+  (let (
+        (buffer (get-buffer-create stmcrblog-buffer-name))
+        (current-buffer (current-buffer))
+        )
+    (switch-to-buffer buffer)
+    (local-key-binding )
+    (kill-buffer buffer)
+    (error "not-implemented")
+    ))
+
+;;;###autoload
+(defun stmcrblog-post (&optional prefix start end)
+  "Post entry.
+Interactively, in Transient Mark mode when the mark is active,
+operate on the contents of the region. Otherwise, open
+`stmcrblog-buffer-name' buffer for message editing."
+  (interactive "P\nr")
+  (let ( msg )
+    (when (and (called-interactively-p 'interactive) transient-mark-mode mark-active)
+      (setq msg (buffer-substring-no-properties start end))
+      )
+    (if msg
+        (stmcrblog-add-entry msg)
+      )
+  ))
+
+;;;###autoload
+(defun stmcrblog-post-current-line (prefix)
+  "Post current line.
+With prefix remove current line."
+  (interactive "P")
+  (stmcrblog-add-entry (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
+  (when prefix
+    (move-beginning-of-line 1)
+    (kill-line)
+    )
+  )
+
+(provide 'stmcrblog-mode)
+
+;;; stmcrblog-mode.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stmcrblog.sh	Thu Nov 10 13:35:15 2011 +0200
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Example of this script using:
+#   (defun my-stmcrblog-after-add-entry-hook ()
+#     (shell-command (concat "stmcrblog " stmcrblog-file " /srv/www/htdocs/jobdoneblog.html"))
+#     )
+#   (add-hook 'stmcrblog-after-add-entry-hook 'my-stmcrblog-after-add-entry-hook)
+#   (global-set-key (kbd "C-c y") 'stmcrblog-post-current-line)
+
+in=$1
+out=$2
+
+if [[ ! -f $in ]]; then
+  echo Input file not found.
+  exit 1
+fi
+if [[ -z $out ]]; then
+  echo I don\'t know where is output file...
+  exit 1
+fi
+
+{
+  echo '<html>'
+  echo '<head>'
+  echo '  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
+  echo '  <title>Job done blog.</title>'
+  echo '</head>'
+  echo '<body>'
+  echo '<h1>Job done blog.</h1>'
+
+  echo '<ul>'
+
+  sed -e 's|^\([[:digit:]-]\+\) \([[:digit:]:]\+\) \(.*\)|  <li><span style="color: green;">\1 \2</span> \3</li>|'
+
+  echo '</ul>'
+
+  echo '<address>'
+  echo '  <a href="mailto:gavenko@bifit.com.ua">Oleksandr Gavenko</a>'
+  echo '  </address>'
+  echo '</body>'
+  echo '</html>'
+
+} <$in >$out
+