about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 94f3e64..f227c94 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -474,6 +474,37 @@ Then, build `browse-url-button-regexp' with the new protocol."
474 (add-to-list 'acdw/button-protocols proto) 474 (add-to-list 'acdw/button-protocols proto)
475 (setq-default browse-url-button-regexp (acdw/build-button-url-regexp))) 475 (setq-default browse-url-button-regexp (acdw/build-button-url-regexp)))
476 476
477
478;;; Recentf renaming with dired
479;; from ... somewhere. 'rjs', apparently?
480;; I'm throwing these here because they look better here than in init.el.
481;; Comments are "rjs"'s.
482
483;; Magic advice to rename entries in recentf when moving files in
484;; dired.
485(defun rjs/recentf-rename-notify (oldname newname &rest args)
486 (if (file-directory-p newname)
487 (rjs/recentf-rename-directory oldname newname)
488 (rjs/recentf-rename-file oldname newname)))
489
490(defun rjs/recentf-rename-file (oldname newname)
491 (setq recentf-list
492 (mapcar (lambda (name)
493 (if (string-equal name oldname)
494 newname
495 oldname))
496 recentf-list)))
497
498(defun rjs/recentf-rename-directory (oldname newname)
499 ;; oldname, newname and all entries of recentf-list should already
500 ;; be absolute and normalised so I think this can just test whether
501 ;; oldname is a prefix of the element.
502 (setq recentf-list
503 (mapcar (lambda (name)
504 (if (string-prefix-p oldname name)
505 (concat newname (substring name (length oldname)))
506 name))
507 recentf-list)))
477 508
478 509
479;;; Minor modes 510;;; Minor modes