(defun mark-spam () (interactive) (let ((tlist '("+spam" "-unread" "-inbox" "-new"))) (if (eq major-mode 'notmuch-show-mode) (progn (let ((id (notmuch-show-get-message-id))) (notmuch-tag id tlist) (notmuch-show-next-thread))) (notmuch-search-tag tlist) (notmuch-search-next-thread)))) (define-key 'notmuch-search-mode-map (kbd "S") 'mark-spam) (define-key 'notmuch-show-mode-map (kbd "S") 'mark-spam)
mercredi 2 mai 2018
vendredi 17 février 2017
_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build
If you are pulling your hair and wondering why your kernel does not have a
/sys/kernel/debug/dynamic_debugdirectory despite having
debugfsmounted, the issue could be that you built the kernel using GOLD linker. You can simply switch through the LD Makefile variable (
lundi 16 janvier 2017
C-u c iwhile looking at the thread in emacs).
You can get it on github. There is a small elisp snippet in the README to run the script and apply the patchset from emacs.
vendredi 13 janvier 2017
(defun copy-full-path () (interactive) (let ((path (buffer-file-name))) (when path (setq path (expand-file-name path)) (funcall interprogram-cut-function path) (message "copied %s in clipboard" path))))
(defun prepare-report () (interactive) (notmuch-mua-new-mail) (insert "email@example.com") (search-forward "Subject: ") (insert "work report week " (format-time-string "%W")) (search-forward "\n\n") (backward-char) (insert "my super email content\n"))
If you use notmuch as your email client and receive Coverity reports emails, here's a quick function that compiles the reports to a single buffer (newest first), applies some color on the errors, and enables the compilation minor mode so you can use Emacs regular "jump to next error" key.
Adapt the default-directory to your project source.
(defun samba-coverity () (interactive) (let ((b (get-buffer-create "*coverity*"))) (with-current-buffer b (erase-buffer) (setq default-directory (expand-file-name "~/prog/samba-git")) (insert (shell-command-to-string (concat "for i in $(notmuch search --output=messages" " 'from:firstname.lastname@example.org'); do notmuch show $i; done" " | perl -pE 's,^/(\\S+): (\\d+) in,cov:$1:$2: in,'"))) (goto-char (point-min)) (while (search-forward-regexp (rx bol ">>>") nil t) (let ((beg (save-excursion (beginning-of-line) (point))) (end (save-excursion (end-of-line) (point)))) (put-text-property beg end 'face 'error))) (goto-char (point-min)) (compilation-minor-mode)) (switch-to-buffer b)))
vendredi 8 avril 2016
(defun new-changelog-entry () (interactive) (let ((line-len 67) (date (substring (shell-command-to-string "LC_ALL=C date -u") 0 -1)) ;; (email user-mail-address) probably wrong (email (concat user-real-login-name "@suse.com")) (final-pos)) (goto-char (point-min)) (insert (make-string line-len ?-) "\n" date " - " email "\n\n" " - ") (setq final-pos (point)) (insert "\n\n") (goto-char final-pos)))