Summary: Rückgängig gemacht auf den Stand vom 2013-08-24 11:21 UTC
< * DiredIWikiModes - Do iWikiModes in Dired but match only at file names
> * DiredIsearch - Do isearch in Dired but match only at file names
I have a homepage - http://xwl.appspot.com. You can contact me via firstname.lastname@example.org.
[Note: latest version for the following extensions could be found at my homepage and hopefully, also at gnu.emacs.sources.]
‘wajig’, deb package manager for Emacsers.
I often find myself editing some system config files owned by root, and then desperately realize that I have no permission to write. With this function, now I can revert current buffer as root(with sudo) without losing my early modifications!
Note: for this function to work on a remote machine as well, i.e., login as root@remote_host, you need to config tramp-default-proxies-alist properly, for example:
(add-to-list 'tramp-default-proxies-alist '("remote_hostname" "\\`root\\'" "/ssh:%h:"))
(defun xwl-revert-buffer-with-sudo () "Revert buffer using tramp sudo. This will also reserve changes already made by a non-root user." (interactive) (let ((f (buffer-file-name))) (when f (let ((content (when (buffer-modified-p) (widen) (buffer-string)))) (if (file-writable-p f) (revert-buffer) (kill-buffer (current-buffer)) (if (file-remote-p f) (find-file (replace-regexp-in-string "^\\/[^:]+:" "/sudo:" f)) (find-file (concat "/sudo::" f))) (when content (let ((buffer-read-only nil)) (erase-buffer) (insert content))))))))
Instead of making copies. This could save you some space.
(setq gnus-gcc-externalize-attachments 'all)
So different types of file will be colored like in xterm. See Lisp:XwlXtermDired.
As an example:
(defadvice find-file-noselect (around config-drag-n-drop activate) "配置文件 drag-n-drop 行为。" (let ((file (ad-get-arg 0)))
;; 添加音乐、视频文件至 EMMS (when (string-match (emms-player-get emms-player-mplayer 'regex) file) (emms-add-file file) (unless emms-player-playing-p (with-current-emms-playlist (goto-char (point-max)) (forward-line -1) (emms-playlist-mode-play-smart))) (error (format "File `%s' opened in EMMS" file)))
;; 粘贴邮件附件 (save-excursion (goto-char (point-max)) ; for handling mmm-mode (when (eq major-mode 'message-mode) (insert (format "<#part type=\"%s\" filename=\"%s\" disposition=attachment> <#/part>" (mm-default-file-encoding file) file)) (error (format "File `%s' attached" file))))
Will here be my little web home for Emacs ? ☺
[new] Welcome to the wiki! – AlexSchroeder
我也在北京, 喜欢Emacs, Lisp和自由软件, 有时间可以聊聊. – XueFuqiao