I've written a helper function for mu4e to run checkpatch against a message. However I want to be easily able to switch between previous calls to checkpatch and this seems difficult with ido-read-file-name. This is my code so far:
;; ;; Checkpatch in emails ;; (defvar my-checkpatch-script-history nil "History of checkpatch invocations.") (defun my-mu4e-action-run-check-patch (msg) "Run checkpatch against the [patch] `MSG'." (let* ((ido-work-file-list my-checkpatch-script-history) (script (ido-read-file-name "Checkpatch Script: " (directory-file-name (or (car ido-work-file-list) default-directory))))) (setf my-checkpatch-script-history (cons script (delete script my-checkpatch-script-history))) ;; actual check patch handling...
However C-n/C-p cycle through previous directories instead of files. The code I use to specify directories to apply patches which works a lot more naturally:
(defun mu4e-action-git-apply-patch (msg) "Apply the git [patch] message." (let ((path (ido-read-directory-name "Target directory: " (car ido-work-directory-list) "~/" t))) (setf ido-work-directory-list (cons path (delete path ido-work-directory-list))) ;; actual apply-patch handling
Is this just a limitation of dealing with files rather than directories?