私的良スレ書庫
不明な単語は2ch用語を / 要望・削除依頼は掲示板へ。不適切な画像報告もこちらへどうぞ。 / 管理情報はtwitterでログインするとレス評価できます。 登録ユーザには一部の画像が表示されますので、問題のある画像や記述を含むレスに「禁」ボタンを押してください。
元スレEmacs Part 42

みんなの評価 : △
レスフィルター : (試験中)
ノートPCだと
fn caps alt ctrの配置がいろいろあって
どれに統一したものか悩む
fn caps alt ctrの配置がいろいろあって
どれに統一したものか悩む
>>252
皮肉かよ?
皮肉かよ?
大学の先輩に、RMSが愛用していたのど飴と嘘をつかれてから
10年ぐらいe-maのど飴をなめているが、結論としてご利益はとくになかった。
10年ぐらいe-maのど飴をなめているが、結論としてご利益はとくになかった。
emacs-24.2のshellモードで
$ touch /tmp/aaa.tar.bz2 /tmp/aaa.tar.xz
してから
$ tar tf /tmp/aaa.[TAB]
で補完すると/tmp/aaa.tar.xzが候補にならない。
$ ls /tmp/aaa.[TAB]だと候補になる
バカなの?
$ touch /tmp/aaa.tar.bz2 /tmp/aaa.tar.xz
してから
$ tar tf /tmp/aaa.[TAB]
で補完すると/tmp/aaa.tar.xzが候補にならない。
$ ls /tmp/aaa.[TAB]だと候補になる
バカなの?
24.3が出ようってのにtrunkの方には大きい機能はなんにも入ってない。
今後入りそうな目玉機能って何があるんだろうか。遂にネタ切れか。
今後入りそうな目玉機能って何があるんだろうか。遂にネタ切れか。
>>260
拡張www
拡張www
>>260
普通に書けばいいよ。
普通に書けばいいよ。
>>261
helm
helm
同じリージョン内で A->B, B->C, C->D を一片にやってくれるelispを知ってたら教えてくれ
あわよくば A->B, B->C, C->A もOKだったら最高
あわよくば A->B, B->C, C->A もOKだったら最高
query-replace-regexp : \(A\)\|\(B\)\|\(C\)
... with: \,(cond((match-end 1)"B")((match-end 2)"C")("A"))
... with: \,(cond((match-end 1)"B")((match-end 2)"C")("A"))
>>272
華麗すぎて濡れたので関数にしてみた.
(defun query-replace-cycling (&rest args)
"Query replace cycling. If you specify three arguments A,
B and C, replace A->B, B->C and C->A simultaneously."
(when (< (length args) 2)
(error "Specify more than two arguments"))
(let* ((len (length args))
(from-string (mapconcat
(lambda (x)
(format"\\(%s\\)" x))
args "\\|"))
(condition (mapcar
(lambda (x)
`((match-end ,(- len (mod (length (member x args)) len))) ,x))
args)))
(perform-replace from-string
`(replace-eval-replacement replace-quote (cond ,@condition))
t t nil)))
置換時のミニバッファの表示がすこし変だがとりあえず動いている.
interactive にしたいけど,可変個数の引数をミニバッファで入力させるのって
どうやるんだ?
華麗すぎて濡れたので関数にしてみた.
(defun query-replace-cycling (&rest args)
"Query replace cycling. If you specify three arguments A,
B and C, replace A->B, B->C and C->A simultaneously."
(when (< (length args) 2)
(error "Specify more than two arguments"))
(let* ((len (length args))
(from-string (mapconcat
(lambda (x)
(format"\\(%s\\)" x))
args "\\|"))
(condition (mapcar
(lambda (x)
`((match-end ,(- len (mod (length (member x args)) len))) ,x))
args)))
(perform-replace from-string
`(replace-eval-replacement replace-quote (cond ,@condition))
t t nil)))
置換時のミニバッファの表示がすこし変だがとりあえず動いている.
interactive にしたいけど,可変個数の引数をミニバッファで入力させるのって
どうやるんだ?
"Hyper Sequential Replacing Force (HSRF)." がかっこいいと思う。
みんなの意見を取り入れて,周回させるかのフラグとリージョン対応したぜ!
これで完璧だろう>>267.こういうときはコンマセパレートでいいのかね.
(defun hyper-sequential-rotate-force (cycle start end &rest args)
"Rotate a number of strings. In interactive call, specify more
than one string separated by comma. If you specify three strings
A, B and C, rotate A->B and B->C. If CYCLE is non-nil (prefix arg
in interactive call), rotate A->B, B->C and C->A.
In Transient Mark mode, if the mark is active, operate on the contents
of the region. Otherwise, operate from point to the end of the buffer."
(interactive
`(,current-prefix-arg
,(and (use-region-p) (region-beginning))
,(and (use-region-p) (region-end))
,@(split-string (read-string "Strings (seprated by comma): ") ",")))
(when (< (length args) 2)
(error "Specify more than two strings"))
(let* ((len (length args))
(from-string (mapconcat
(lambda (x)
(format"\\(%s\\)" x))
(if cycle args (butlast args)) "\\|"))
(condition (mapcar
(lambda (x)
`((match-end ,(- len (mod (length (member x args)) len))) ,x))
args)))
(perform-replace from-string
`(replace-eval-replacement replace-quote (cond ,@condition))
t t nil nil nil start end)))
これで完璧だろう>>267.こういうときはコンマセパレートでいいのかね.
(defun hyper-sequential-rotate-force (cycle start end &rest args)
"Rotate a number of strings. In interactive call, specify more
than one string separated by comma. If you specify three strings
A, B and C, rotate A->B and B->C. If CYCLE is non-nil (prefix arg
in interactive call), rotate A->B, B->C and C->A.
In Transient Mark mode, if the mark is active, operate on the contents
of the region. Otherwise, operate from point to the end of the buffer."
(interactive
`(,current-prefix-arg
,(and (use-region-p) (region-beginning))
,(and (use-region-p) (region-end))
,@(split-string (read-string "Strings (seprated by comma): ") ",")))
(when (< (length args) 2)
(error "Specify more than two strings"))
(let* ((len (length args))
(from-string (mapconcat
(lambda (x)
(format"\\(%s\\)" x))
(if cycle args (butlast args)) "\\|"))
(condition (mapcar
(lambda (x)
`((match-end ,(- len (mod (length (member x args)) len))) ,x))
args)))
(perform-replace from-string
`(replace-eval-replacement replace-quote (cond ,@condition))
t t nil nil nil start end)))
処理の性質上、空白文字列は扱わない(扱えない)ので
扱う引数の数だけ一個一個入力して空欄のままエンターなら終了、になったらいいなあ
そんでローテート中は ^I でぐるぐる回せるとかな
(そこまで考えると query-replace なみにちょっとしたモードになってしまうのでだいぶチャレンジングだが)
ヤダ、そこまでされたらアタシの .emacs の中に入れちゃうかも///
扱う引数の数だけ一個一個入力して空欄のままエンターなら終了、になったらいいなあ
そんでローテート中は ^I でぐるぐる回せるとかな
(そこまで考えると query-replace なみにちょっとしたモードになってしまうのでだいぶチャレンジングだが)
ヤダ、そこまでされたらアタシの .emacs の中に入れちゃうかも///
プログラム作成中に注目している個所の作業をいったん中断して、別の作業を始める場合。
中断する作業を忘れないようにemacs上でメモを残したい。
ソースコードに直接コメントで残す方法が、メモと作業個所の同期、お手軽さではかなり
有利だけど、タイムスタンプが変更されたり、元に戻すのが手間だったり。
こういうの支援してくれるのってないですか?
中断する作業を忘れないようにemacs上でメモを残したい。
ソースコードに直接コメントで残す方法が、メモと作業個所の同期、お手軽さではかなり
有利だけど、タイムスタンプが変更されたり、元に戻すのが手間だったり。
こういうの支援してくれるのってないですか?
メモとは違うがいわゆるセッション保存系の elisp が望みにかなう気がする。
「開いてるファイルを記憶しといてあとで復帰する」系の機能。
desktop-save とか desktop-menu とか。
あくまでメモでというなら決まったテキストファイルを開く memo-mode (名前曖昧。てかこのテのものもよくある) とか、
なんならホームディレクトリに ChangeLog モードのファイルでもいけると思う。
ていうかぶっちゃけ ~/MEMO.txt あたりに outline-mode で日時書いて列挙、が一番手軽で融通きくやり方だと思う。
「開いてるファイルを記憶しといてあとで復帰する」系の機能。
desktop-save とか desktop-menu とか。
あくまでメモでというなら決まったテキストファイルを開く memo-mode (名前曖昧。てかこのテのものもよくある) とか、
なんならホームディレクトリに ChangeLog モードのファイルでもいけると思う。
ていうかぶっちゃけ ~/MEMO.txt あたりに outline-mode で日時書いて列挙、が一番手軽で融通きくやり方だと思う。
>>283
,@(split-string ...
の行の代わりに
,@(let (str lst)
(while (not (string= (setq str (read-string "String (Input empty to rotate): ")) ""))
(setq lst (append lst (list str))))
lst)))
に変更したら所望の動作や.^Iでぐるぐる回せるってのは,
現在の一致箇所で^Iを押す度に,A->B,B->C,C->A って
変わっていくってことかな? むずそう.
>>284
org-mode を使ってるならローカルファイルにリンクが貼れる.
org-mode のファイルに
[[file:path/to/file::NNN]]
って書いておけば,そこにカーソルを置いて ENTER 押すと
file の NNN 行へ飛べる.当然 file が変更されたら行番号も変わるけど,
一緒にメモも書けるし,一時的なものなら大丈夫じゃないだろうか.
[[file:path/to/file::some words]]
にすれば file 中の some words に一致する場所に飛べる.
org-store-link を使えばいいと思うよ.
,@(split-string ...
の行の代わりに
,@(let (str lst)
(while (not (string= (setq str (read-string "String (Input empty to rotate): ")) ""))
(setq lst (append lst (list str))))
lst)))
に変更したら所望の動作や.^Iでぐるぐる回せるってのは,
現在の一致箇所で^Iを押す度に,A->B,B->C,C->A って
変わっていくってことかな? むずそう.
>>284
org-mode を使ってるならローカルファイルにリンクが貼れる.
org-mode のファイルに
[[file:path/to/file::NNN]]
って書いておけば,そこにカーソルを置いて ENTER 押すと
file の NNN 行へ飛べる.当然 file が変更されたら行番号も変わるけど,
一緒にメモも書けるし,一時的なものなら大丈夫じゃないだろうか.
[[file:path/to/file::some words]]
にすれば file 中の some words に一致する場所に飛べる.
org-store-link を使えばいいと思うよ.
org-mode は標準でついてるんだから,アウトライン表示できる便利な
マークアップ言語として使ってもいいと思うけどね.
まあ Emacs でしか使えんし,多機能すぎて混沌としすぎているのは否定できんが.
org-mode の布教ついでにおすすめ設定.
(add-to-list 'org-capture-templates
'("p" "Pending work" entry (file+headline "memo.org" "Pending work")
"** %?
%a"))
これを設定しておけば,M-x org-capture ENTER p と実行すると,
* Pending work
**
[[file:path/to/file::some words]]
memo.org にこのように追加されて,** のところにカーソルが移動するので
好きにメモをかけばいい.org-capture はメモ取りに便利だと思いまっせ.
マークアップ言語として使ってもいいと思うけどね.
まあ Emacs でしか使えんし,多機能すぎて混沌としすぎているのは否定できんが.
org-mode の布教ついでにおすすめ設定.
(add-to-list 'org-capture-templates
'("p" "Pending work" entry (file+headline "memo.org" "Pending work")
"** %?
%a"))
これを設定しておけば,M-x org-capture ENTER p と実行すると,
* Pending work
**
[[file:path/to/file::some words]]
memo.org にこのように追加されて,** のところにカーソルが移動するので
好きにメモをかけばいい.org-capture はメモ取りに便利だと思いまっせ.
>>291
これは… かなり要求に近い。こっちを使ってみます。
これは… かなり要求に近い。こっちを使ってみます。
純朴な疑問なんだけどEmacsがOSになれかった理由ってなんだろうね。
OSになっていれば今頃はLinuxみたいになってたかもしれないのに。
Emacs OSみたいなやつ。
OSになっていれば今頃はLinuxみたいになってたかもしれないのに。
Emacs OSみたいなやつ。
Emacsって1行が数万文字あるようなファイルを開くと極端に遅くなるんだけど、そういうファイルは苦手なん?



類似してるかもしれないスレッド
- Emacs Part 40 (1001) - [92%] - 2012/9/7 0:30
- Emacs Part 47 (995) - [92%] - 2015/4/19 13:01
- Emacs Part 41 (1001) - [92%] - 2012/12/24 4:15
- Emacs Part 43 (1001) - [92%] - 2013/12/14 11:30
- Emacs Part 44 (1001) - [92%] - 2014/2/8 8:01 △
- Emacs Part 46 (984) - [92%] - 2014/12/24 14:15
- Emacs Part 45 (1001) - [92%] - 2014/6/23 9:45
- Emacs Part 48 (997) - [92%] - 2015/12/9 15:15
- Emacs Part 49 (974) - [92%] - 2016/12/7 9:45
- Emacs Part 32 (1001) - [92%] - 2009/12/20 2:04 ○
- Emacs Part 52 (984) - [92%] - 2021/5/13 1:45
- Emacs Part 53 (989) - [84%] - 2022/12/5 12:45
- Emacs Part 31 (1001) - [84%] - 2009/10/23 10:31 ○
- Emacs Part 33 (1001) - [84%] - 2010/3/9 20:01 ○
トップメニューへ / →のくす牧場書庫について