我喜欢一种细小的模式,它使钥匙上的转头符号能够以非临时性的方式获得(然后将数字转移)。 看来这可能有助于佩雷尔法典(@%,等等)。 理想的情况是,将这种方式集中起来有关键。 缺乏像头锁一样的帽子,但只有钥匙。
这种方式是否已经存在?
我喜欢一种细小的模式,它使钥匙上的转头符号能够以非临时性的方式获得(然后将数字转移)。 看来这可能有助于佩雷尔法典(@%,等等)。 理想的情况是,将这种方式集中起来有关键。 缺乏像头锁一样的帽子,但只有钥匙。
这种方式是否已经存在?
推广你自己意愿的一种方式就是:
(define-minor-mode snoopy-mode
"Toggle snoopy mode.
With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode."
;; The initial value.
nil
;; The indicator for the mode line.
" Snoopy"
;; The minor mode bindings.
(("1" . (lambda () (interactive) (insert-char ?! 1)))
("!" . (lambda () (interactive) (insert-char ?1 1)))
;;etc
))
非常感谢答案。 此处为所有数字的扩大定义:
(define-minor-mode shifted-numbers-mode
"Toggle shifted numbers mode."
nil
" shifted"
(("1" . (lambda () (interactive) (insert-char ?! 1)))
("2" . (lambda () (interactive) (insert-char ?@ 1)))
("3" . (lambda () (interactive) (insert-char ?# 1)))
("4" . (lambda () (interactive) (insert-char ?$ 1)))
("5" . (lambda () (interactive) (insert-char ?% 1)))
("6" . (lambda () (interactive) (insert-char ?^ 1)))
("7" . (lambda () (interactive) (insert-char ?& 1)))
("8" . (lambda () (interactive) (insert-char ?* 1)))
("9" . (lambda () (interactive) (insert-char ?( 1)))
("0" . (lambda () (interactive) (insert-char ?) 1)))
("!" . (lambda () (interactive) (insert-char ?1 1)))
("@" . (lambda () (interactive) (insert-char ?2 1)))
("#" . (lambda () (interactive) (insert-char ?3 1)))
("$" . (lambda () (interactive) (insert-char ?4 1)))
("%" . (lambda () (interactive) (insert-char ?5 1)))
("^" . (lambda () (interactive) (insert-char ?6 1)))
("&" . (lambda () (interactive) (insert-char ?7 1)))
("*" . (lambda () (interactive) (insert-char ?8 1)))
("(" . (lambda () (interactive) (insert-char ?9 1)))
(")" . (lambda () (interactive) (insert-char ?0 1)))))
在珀尔,图书馆往往比括号更为常见,因此你也希望:
("[" . (lambda () (interactive) (insert-char ?{ 1)))
("]" . (lambda () (interactive) (insert-char ?} 1)))
("{" . (lambda () (interactive) (insert-char ?[ 1)))
("}" . (lambda () (interactive) (insert-char ?] 1)))
I am building a Web interface to monitor an embedded system. I have built a Perl script which runs remote commands and gathers output from that system. Now what I need is a Web interface which makes ...
How do I tell what type of value is in a Perl variable? $x might be a scalar, a ref to an array or a ref to a hash (or maybe other things).
When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...
I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...
I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...
I would like to submit a form to a CGI script localy (w3c-markup-validator), but it is too slow using curl and apache, I want to use this CGI script more than 5,000 times in an another script. and ...
So I m running perl 5.10 on a core 2 duo macbook pro compiled with threading support: usethreads=define, useithreads=define. I ve got a simple script to read 4 gzipped files containing aroud 750000 ...
A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...