IanYang

I, Ian Yang, started to use Emacs in 2007. Now I use it for almost all my text editting tasks, majorly including codinging and TeX documenting.

My emacs config can be found at github doitian/emacs.d.

Elisp

      (defun iy/winring-jump-or-create (&optional name)
        "Jump to or create configuration by name"
        (interactive)
        (let* ((ring (winring-get-ring))
               (n (1- (ring-length ring)))
               (current (winring-name-of-current))
               (lst (list (cons current -1)))
               index item)
          (while (<= 0 n)
            (push (cons (winring-name-of (ring-ref ring n)) n) lst)
            (setq n (1- n)))
          (setq name
                (or name
                    (completing-read
                     (format "Window configuration name (%s): " current)
                     lst nil 'confirm nil 'winring-name-history current)))
          (setq index (cdr (assoc name lst)))
          (if (eq nil index)
              (progn
                (winring-save-current-configuration)
                (delete-other-windows)
                (switch-to-buffer winring-new-config-buffer-name)
                (winring-set-name name))
            (when (<= 0 index)
              (setq item (ring-remove ring index))
              (winring-save-current-configuration)
              (winring-restore-configuration item)))))
      (defvar iy/calendar-copy-date-format-history '("%Y-%m-%d"))
      (defun iy/calendar-copy-date (arg)
        "Copy date under the cursor      . Read format from minibuffer if ARG, 
      use recently used format if no ARG . See the function `format-time-string' 
      for the document of time format string"
        (interactive "P")
        (let ((date (calendar-cursor-to-date t))
              (format (if arg
                          (completing-read
                           "Date Format:"
                           iy/calendar-copy-date-format-history nil nil nil
                           'iy/calendar-copy-date-format-history nil nil)
                        (car iy/calendar-copy-date-format-history)))
              string)
          (setq date (encode-time 0 0 0 (cadr date) (car date) (nth 2 date)))
          (setq string (format-time-string format date))
          (if (eq last-command 'kill-region)
              (kill-append string nil)
            (kill-new string))))

Utilities

emacs-dwim

Start emacs smartly. I only have tested in Emacs 23.

The source code: emacs-dwim

Contact

Home Page
http://iany.me
Email/GTalk
me (at) iany.me
MSN
same with the email

Welcome to the wiki. – DrewAdams


CategoryHomepage