Changeset 14734


Ignore:
Timestamp:
Apr 25, 2011, 11:33:10 PM (10 years ago)
Author:
gz
Message:

Add "Insert Date and Time" and "Insert Date", bind the former to c-x c-d. Also bind c-S and c-R same as c-s and c-r, respectively, and bind c-= to "What Cursor Position"

Location:
trunk/source/cocoa-ide/hemlock/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/hemlock/src/bindings.lisp

    r14721 r14734  
    6767(bind-key "Query Replace" #k"meta-%")
    6868(bind-key "Reverse Incremental Search" #k"control-r")
     69(bind-key "Reverse Incremental Search" #k"control-R")
    6970(bind-key "Incremental Search" #k"control-s")
     71(bind-key "Incremental Search" #k"control-S")
    7072(bind-key "Forward Search" #k"meta-s")
    7173(bind-key "Reverse Search" #k"meta-r")
     
    8789(bind-key "Abort Command" #k"control-x control-G")
    8890
     91;(bind-key "Insert Date" #k"control-x control-d")
     92(bind-key "Insert Date and Time" #k"control-x control-d")
    8993
    9094(bind-key "Process File Options" #k"control-x m" :global)
     
    96100(bind-key "Describe Key" #k"meta-?")
    97101(bind-key "What Cursor Position" #k"control-x =")
     102(bind-key "What Cursor Position" #k"control-=")
    98103
    99104
     
    332337(bind-key "Illegal" #k"meta-x" :mode "Echo Area")
    333338(bind-key "Illegal" #k"control-s" :mode "Echo Area")
     339(bind-key "Illegal" #k"control-S" :mode "Echo Area")
    334340(bind-key "Illegal" #k"control-r" :mode "Echo Area")
     341(bind-key "Illegal" #k"control-R" :mode "Echo Area")
    335342(bind-key "Illegal" #k"hyper-t" :mode "Echo Area")
    336343
     
    943950
    944951(bind-key "I-Search Repeat Forward" #k"control-s" :mode "I-Search")
     952(bind-key "I-Search Repeat Forward" #k"control-S" :mode "I-Search")
    945953(bind-key "I-Search Repeat Backward" #k"control-r" :mode "I-Search")
     954(bind-key "I-Search Repeat Backward" #k"control-R" :mode "I-Search")
    946955(bind-key "I-Search Backup" #k"backspace" :mode "I-Search")
    947956(bind-key "I-Search Backup" #k"delete" :mode "I-Search")
  • trunk/source/cocoa-ide/hemlock/src/filecoms.lisp

    r12860 r14734  
    665665    (message "Buffer ~S is now writable." (buffer-name buffer))))
    666666
    667 
    668 
    669 
    670 (defun universal-time-to-string (ut)
    671   (multiple-value-bind (sec min hour day month year)
    672                        (decode-universal-time ut)
    673     (format nil "~2,'0D-~A-~2,'0D ~2,'0D:~2,'0D:~2,'0D"
    674             day (svref '#("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"
    675                           "Sep" "Oct" "Nov" "Dec")
    676                        (1- month))
    677             (rem year 100)
    678             hour min sec)))
  • trunk/source/cocoa-ide/hemlock/src/morecoms.lisp

    r12859 r14734  
    4848  (abort-to-toplevel))
    4949
     50
     51(defcommand "Insert Date and Time" (p)
     52  "Inserts the current date and time.  With prefix argument, inserts date only"
     53  (multiple-value-bind (date time) (current-date-time-strings)
     54    (let ((point (current-point)))
     55      (push-new-buffer-mark point) ;; leave mark at beginning
     56      (insert-string point (if p date (format nil "~a ~a" date time))))))
     57
     58(defcommand "Insert Date" (p)
     59  "Inserts the current date.  With prefix argument, inserts date and time"
     60  (multiple-value-bind (date time) (current-date-time-strings)
     61    (let ((point (current-point)))
     62      (push-new-buffer-mark point) ;; leave mark at beginning
     63      (insert-string point (if p (format nil "~a ~a" date time) date)))))
     64
     65(defun current-date-time-strings ()
     66  (multiple-value-bind (sec min hour day month year) (get-decoded-time)
     67    (values (format nil "~2,'0D-~A-~4D"
     68                    day (svref '#("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"
     69                                  "Sep" "Oct" "Nov" "Dec")
     70                               (1- month))
     71                    year)
     72            (format nil "~2,'0D:~2,'0D:~2,'0D" hour min sec))))
     73   
    5074;;;; Casing commands...
    5175
Note: See TracChangeset for help on using the changeset viewer.