📄 00000043.htm
字号:
(interactive) <BR> (if mark-active (copy-region-as-kill (point) (mark)) ()) <BR> (setq s-prev-selection nil)) <BR>(defun s-delete () <BR> (interactive) <BR> (if mark-active (progn <BR> (delete-region (point) (mark)) <BR> (if s-prev-selection <BR> (x-set-selection 'PRIMARY s-prev-selection) ()) <BR> (setq s-prev-selection nil)) <BR> (delete-char 1))) <BR> <BR>(defun s-mouse-drag-region (event) <BR> (interactive "e") <BR> (condition-case nil <BR> (setq s-prev-selection (x-get-selection)) <BR> (error 't)) <BR> (mouse-drag-region event)) <BR> <BR>(defun s-mouse-yank-at-click () <BR> (interactive) <BR> (if mark-active (progn (delete-region (point) (mark)) <BR> (if s-prev-selection <BR> (x-set-selection 'PRIMARY s-prev-selection) ())) <BR> ()) <BR> (mouse-yank-at-click nil nil)) <BR> <BR>; This is where we store the old X cutbuffer contents in case the user doesn't <BR>; want the highlighted region on the cutbuffer. <BR>(setq s-prev-selection nil) <BR> <BR>;; <BR>;; MS Style Keybindings <BR>;; <BR> <BR>(substitute-key-definition 'self-insert-command 's-self-insert-command <BR> global-map) <BR>(substitute-key-definition 'mouse-yank-at-click 's-mouse-yank-at-click <BR> global-map) <BR>(define-key global-map [S-right] 's-shift-forward-char) <BR>(define-key global-map [right] 's-forward-char) <BR>(define-key global-map [S-left] 's-shift-backward-char) <BR>(define-key global-map [up] 's-backward-char) <BR>(define-key global-map [S-up] 's-shift-previous-line1) <BR>(define-key global-map [up] 's-previous-line1) <BR>(define-key global-map [S-down] 's-shift-next-line1) <BR>(define-key global-map [down] 's-next-line1) <BR>(define-key global-map [end] 's-end-of-line) <BR>(define-key global-map [S-end] 's-shift-end-of-line) <BR>(define-key global-map [C-end] 'end-of-buffer) <BR>(define-key global-map [C-S-end] 's-shift-ctrl-end-of-buffer) <BR>(define-key global-map [home] 's-beginning-of-line) <BR>(define-key global-map [S-home] 's-shift-beginning-of-line) <BR>(define-key global-map [C-home] 'beginning-of-buffer) <BR>(define-key global-map [C-S-home] 's-shift-ctrl-beginning-of-buffer) <BR>(define-key global-map [next] 's-scroll-up) <BR>(define-key global-map [S-next] 's-shift-scroll-up) <BR>(define-key global-map [prior] 's-scroll-down) <BR>(define-key global-map [S-prior] 's-shift-scroll-down) <BR>(define-key global-map [down-mouse-1] 's-mouse-drag-region) <BR>(define-key global-map [S-delete] 's-shift-delete) <BR>(define-key global-map [C-S-delete] 's-shift-delete) <BR>(define-key global-map [delete] 's-delete) <BR>(define-key global-map [C-delete] 's-ctrl-delete) <BR>(define-key global-map [S-insert] 's-mouse-yank-at-click) <BR> <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; End of Cut 'n Paste Functions <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR> <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; BUFFER SWITCHING FIX <BR>;; <BR>;; This changes the behaviour of the switch-to-buffer completion functions so <BR>;; that the current buffer is NOT in the completion list. <BR>;; <BR>;; i.e. say you're working in "temp.c", and you want to visit "temp.h"; so you <BR>;; type "C-xb", then "t<TAB>" which then presents you with a completion list <BR>of <BR>;; temp.c and temp.h, so you then must type "h<RET>". This is annoying since <BR>;; why would you want to switch back to the buffer you're in?!? <BR>;; Using this fix would remove "temp.c" from the completion lits so that when <BR>;; you had typed "t<TAB>" the name would be completed as "temp.h" as desired. <BR>;; <BR>;; Steve Dodd <BR>;; March 1998 <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR> <BR>(defun s-minibuffer-complete () <BR> "A shell around minibuffer-complete which removes the name of the current <BR>buffer from the buffer completion list. The default behaviour doesn't make <BR>sense since there is no reason to ask to switch to the buffer you are already <BR>in!" <BR> (interactive) <BR> (if s-remove-first-completion <BR> (progn (setq s-remove-first-completion nil) <BR> (if (consp minibuffer-completion-table) <BR> (setq minibuffer-completion-table <BR> (cdr minibuffer-completion-table)) ())) <BR> ()) <BR> (minibuffer-complete)) <BR> <BR>(defun s-minibuffer-complete-word () <BR> "A shell around minibuffer-complete-word which removes the name of the <BR>current buffer from the buffer completion list. The default behaviour <BR>doesn't make sense since there is no reason to ask to switch to the buffer <BR>you are already in!" <BR> (interactive) <BR> (if s-remove-first-completion <BR> (progn (setq s-remove-first-completion nil) <BR> (if (consp minibuffer-completion-table) <BR> (setq minibuffer-completion-table <BR> (cdr minibuffer-completion-table)) ())) <BR> ()) <BR> (minibuffer-complete-word) <BR>) <BR> <BR>(defun s-minibuffer-complete-and-exit () <BR> "A shell around minibuffer-complete-and-exit which removes the name of the <BR>current buffer from the buffer completion list. The default behaviour <BR>doesn't make sense since there is no reason to ask to switch to the buffer <BR>you are already in!" <BR> (interactive) <BR> (if s-remove-first-completion <BR> (progn (setq s-remove-first-completion nil) <BR> (if (consp minibuffer-completion-table) <BR> (setq minibuffer-completion-table <BR> (cdr minibuffer-completion-table)) ())) <BR> ()) <BR> (minibuffer-complete-and-exit)) <BR> <BR> <BR>(defun s-switch-to-buffer () <BR> "A shell around switch-to-buffer which removes the name of the current <BR>buffer from the buffer completion list. The default behaviour doesn't make <BR>sense since there is no reason to ask to switch to the buffer you are already <BR>in!" <BR> (interactive) <BR> (setq s-remove-first-completion 't) <BR> (switch-to-buffer (read-buffer "Switch to buffer: " (other-buffer)))) <BR> <BR>(setq s-remove-first-completion 'nil) <BR> <BR>(define-key minibuffer-local-completion-map "\040" 's-minibuffer-word) <BR>(define-key minibuffer-local-completion-map "\t" 's-minibuffer-complete) <BR>(define-key minibuffer-local-must-match-map [return] 's-minibuffer-complete-an <BR>d-exit) <BR>(global-set-key "\C-xb" 's-switch-to-buffer) <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; END OF BUFFER SWITCHING FIX <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR> <BR> <BR>-- <BR>看着她笑,他忽然觉得她好寂寞好寂寞。 <BR>她静静的看了他半天,才柔柔慢慢的:「 你好像已经找到了。」 <BR> <BR>※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 210.78.132.48] <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -