merged.

Pascal J. Bourguignon [2014-06-04 23:45]
merged.
Filename
pjb-dot.el
pjb-echo-keys.el
pjb-emacs.el
pjb-loader.el
pjb-mail.el
pjb-secouer.el
pjb-sources.el
diff --git a/pjb-dot.el b/pjb-dot.el
index c038809..2e58d9d 100644
--- a/pjb-dot.el
+++ b/pjb-dot.el
@@ -72,9 +72,7 @@ RETURN: A string containing the dot file data for this PjbElement node.
                         "\n")
                        (dot-ident (ident self)))))
     (format "%S [ style=%s color=%s fillcolor=%s label=\"%s\" ];\n"
-            (dot-ident (ident self)) style color fillcolor label)
-    ));;generate-dot
-
+            (dot-ident (ident self)) style color fillcolor label)))



@@ -84,8 +82,7 @@ RETURN: A string containing the dot file data for this edge.
 "
   (format "%S -> %S ;\n"
           (dot-ident (ident (from self)))
-          (dot-ident (ident (to   self))))
-  );;generate-dot
+          (dot-ident (ident (to   self)))))


 (defmethod generate-dot ((self PjbWeightedDirectedEdge))
@@ -101,9 +98,7 @@ RETURN: A string containing the dot file data for this edge.
            ((< (weight self) 10) "dashed")
            ((< (weight self) 15) "solid")
            (t                    "bold"))
-          "black"
-          );;format
-  );;generate-dot
+          "black"))


 ;;; (description (car (element-list (nodes g))))
@@ -136,8 +131,8 @@ NOTE:   dot graphs are directed.
      ;; common attributes of edges:
      "  edge [style=solid];\n"
      (mapElements (edges self) (lambda (edge) (generate-dot edge)))
-     "}\n")))
-  );;generate-dot
+     "}\n"))))
+

+;;;; THE END ;;;;

-;;;; pjb-dot.el                       --                     --          ;;;;
diff --git a/pjb-echo-keys.el b/pjb-echo-keys.el
new file mode 100644
index 0000000..f96b59a
--- /dev/null
+++ b/pjb-echo-keys.el
@@ -0,0 +1,88 @@
+;;;; -*- mode:emacs-lisp;coding:utf-8 -*-
+;;;;**************************************************************************
+;;;;FILE:               pjb-echo-keys.el
+;;;;LANGUAGE:           emacs lisp
+;;;;SYSTEM:             POSIX
+;;;;USER-INTERFACE:     NONE
+;;;;DESCRIPTION
+;;;;
+;;;;    Echo emacs key chords as they are typed.
+;;;;
+;;;;AUTHORS
+;;;;    <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
+;;;;MODIFICATIONS
+;;;;    2014-06-05 <PJB> Extracted from ~/.emacs.
+;;;;BUGS
+;;;;LEGAL
+;;;;    AGPL3
+;;;;
+;;;;    Copyright Pascal J. Bourguignon 2014 - 2014
+;;;;
+;;;;    This program is free software: you can redistribute it and/or modify
+;;;;    it under the terms of the GNU Affero General Public License as published by
+;;;;    the Free Software Foundation, either version 3 of the License, or
+;;;;    (at your option) any later version.
+;;;;
+;;;;    This program is distributed in the hope that it will be useful,
+;;;;    but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;;;    GNU Affero General Public License for more details.
+;;;;
+;;;;    You should have received a copy of the GNU Affero General Public License
+;;;;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;;;**************************************************************************
+(require 'cl)
+
+(defvar *echo-keys-last* nil "Last command processed by `echo-keys'.")
+(defvar *echo-key-width*  40 "Default width of the *echo-keys* window.")
+
+
+(defun echo-keys ()
+  (let ((deactivate-mark deactivate-mark)
+        (keys            (this-command-keys)))
+    (when keys
+      (save-excursion
+       (with-current-buffer (get-buffer-create "*echo-key*")
+         (goto-char (point-max))
+         (if (eql this-command 'self-insert-command)
+             (let ((desc (key-description keys)))
+               (if (= 1 (length desc))
+                   (insert desc)
+                   (insert " " desc " ")))
+             (insert (if (eq 'self-insert-command *echo-keys-last*)
+                         "\n"
+                         "")
+                     (format "%-12s %s\n"
+                             (key-description keys)
+                             this-command)))
+         (setf *echo-keys-last* this-command)
+         (dolist (window (window-list))
+           (when (eq (window-buffer window) (current-buffer))
+             (with-selected-window window
+               ;; We need to use both to get the effect.
+               (set-window-point window (point))
+               (end-of-buffer)))))))))
+
+
+(defun toggle-echo-keys ()
+  "Toggle displaying the *echo-key* buffer."
+  (interactive)
+  (if (member 'echo-keys (default-value 'pre-command-hook))
+      (let ((echo-buffer (get-buffer "*echo-key*")))
+        (remove-hook 'pre-command-hook 'echo-keys)
+        (dolist (window (window-list))
+          (when (eq (window-buffer window) echo-buffer)
+            (delete-window window))))
+      (progn
+        (add-hook 'pre-command-hook 'echo-keys)
+        (delete-other-windows)
+        (split-window nil (- (window-width) *echo-key-width*) t)
+        (other-window 1)
+        (switch-to-buffer (get-buffer-create "*echo-key*"))
+        (toggle-truncate-lines +1)
+        (set-window-dedicated-p (selected-window) t)
+        (other-window 1))))
+
+
+(provide 'pjb-echo-keys)
+;;;; THE END ;;;;
diff --git a/pjb-emacs.el b/pjb-emacs.el
index 2550607..9bc8c8c 100644
--- a/pjb-emacs.el
+++ b/pjb-emacs.el
@@ -168,15 +168,13 @@ RETURN: the buffer which has as name `name'.
         (setq result (car buffers))
         (setq buffers nil))
       (setq buffers (cdr buffers)))
-    result)
-  ) ;;old-buffer-named
+    result))


 (defun pjb-custom-set-variables (&rest l)
   (while l
     (custom-set-variables (append (car l) (list t)))
-    (setq l (cdr l)))
-  ) ;;pjb-custom-set-variables
+    (setq l (cdr l))))


 (defun set-default-directory (path)
@@ -218,8 +216,7 @@ yank even with ARGS (thus it can be mapped to \C-y)"
   ;; Translate `C-h' to <DEL>.
   (keyboard-translate ?\C-h ?\C-?)
   ;; Translate <DEL> to `C-h'.
-  (keyboard-translate ?\C-? ?\C-h)
-  ) ;;exch-del-ctrl-h
+  (keyboard-translate ?\C-? ?\C-h))


 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -544,9 +541,6 @@ DO:      Apply wc on the file visited in the current buffer.


 (defun pjb-search-in-all-buffers (string)
-  "
-
-"
   (interactive "sString: ")
   (let ( (list (buffer-list))
         buffer )
@@ -685,8 +679,7 @@ with possible additional arguments `browse-url-xterm-args'."
           (setq done t))
       (narrow-to-page)
       (sit-for delay)
-      (force-mode-line-update t)
-      ) ;;while
+      (force-mode-line-update t))
     (message "Done.")))


@@ -738,23 +731,6 @@ DO:      Colorize the region with group of lines (normaly 1 by 1)
       (setq color (cons (cdr color) (car color))))))


-(defun pjb-old-look ()
-  "
-DO:      Set the background, foreground and font to look like an oldie tty.
-"
-  (interactive)
-  (set-background-color "#000")
-  (set-foreground-color "#0f2")
-  (set-cursor-color     "#3f1")
-  (mouse-set-font "-adobe-courier-bold-r-normal--*-120-*-*-m-*-iso8859-1")
-  (setq global-font-lock-mode nil)
-  (save-excursion
-    (dolist (buffer (buffer-list))
-      (set-buffer buffer)
-      (font-lock-mode -1)))
-  ) ;;pjb-old-look
-
-
 (defun pjb-address (pattern)
   "
 DO:      Search an address in my address book (~/private/info/personnes.form)
@@ -768,12 +744,10 @@ DO:      Search an address in my address book (~/private/info/personnes.form)
   (forms-search-forward pattern))


-
 (defvar pjb-cross-references-rejected-regexp
   "\\(^\\.?#\\|~$\\|\\.\\(elc\\|o\\|a\\)$\\)"
   "A regexp matching file names that should not be searched
-for cross references.") ;;pjb-cross-references-rejected-regexp
-
+for cross references.")

 (defun pjb-cross-references ()
   "
@@ -1641,8 +1615,7 @@ See also: `exclude-frame' and `include-frame'
       ((null text) (error "No text to search."))
       ((search-backward text nil t)
        (set-mark (match-end 0)))
-      (t (error "Can't find %S" text))))
-  ) ;;pjb-search-backward-region
+      (t (error "Can't find %S" text)))))


 (defun pjb-search-forward-region ()
@@ -1658,8 +1631,7 @@ See also: `exclude-frame' and `include-frame'
       ((null text) (error "No text to search."))
       ((search-forward text nil t)
        (set-mark (match-beginning 0)))
-      (t (error "Can't find %S" text))))
-  ) ;;pjb-search-forward-region
+      (t (error "Can't find %S" text)))))


 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/pjb-loader.el b/pjb-loader.el
index 66b08b4..d8ee837 100644
--- a/pjb-loader.el
+++ b/pjb-loader.el
@@ -60,6 +60,7 @@
         "pjb-class.el"
         "pjb-dodo.el"
         "pjb-emacs.el"
+        "pjb-echo-keys.el"
         "pjb-erc.el"
         "pjb-erc-filter.el"
         "pjb-erc-speak.el"
diff --git a/pjb-mail.el b/pjb-mail.el
index 241556d..115495a 100644
--- a/pjb-mail.el
+++ b/pjb-mail.el
@@ -875,7 +875,7 @@ DO:     Insert a file attachment at the point, prefixed with Content- headers
         (if compress
             (shell-command (format "gzip<%s|base64-encode"
                              (shell-quote-argument file-name))  t nil)
-            (shell-command (format "base64-encode<%s"
+            (shell-command (format "base64<%s"
                              (shell-quote-argument file-name))  t nil)))))


diff --git a/pjb-secouer.el b/pjb-secouer.el
index 9a99f20..aa42cda 100644
--- a/pjb-secouer.el
+++ b/pjb-secouer.el
@@ -67,6 +67,5 @@
             (insert (melange word))
             (goto-char end-word)))))))

-
 ;;;; THE END ;;;;

diff --git a/pjb-sources.el b/pjb-sources.el
index 593a954..7b8f29a 100644
--- a/pjb-sources.el
+++ b/pjb-sources.el
@@ -2250,7 +2250,7 @@ by pjb-add-change-log-entry.")

     ("ubudu"
      t
-     "Copyright 2013 Ubudu SAS."
+     "Copyright 2014 Ubudu SAS."
      ""
      "All Rights Reserved."
      ""
ViewGit