GNU bug report logs -
#21973
24.5; feature proposal: make dired header clickable
Previous Next
Reported by: William Xu <william.xwl <at> gmail.com>
Date: Sat, 21 Nov 2015 20:04:01 UTC
Severity: wishlist
Found in version 24.5
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 21973 <at> debbugs.gnu.org (full text, mbox):
William Xu <william.xwl <at> gmail.com> writes:
> Sometimes when we are in some deep directory, it would be really
> convenient to be able to jump to an arbitrary parent directory shown by
> dired header. e.g., a dired header line may be:
>
> /this/is/a/really/long/project/dir/curr:
>
> If i want to open dired with `/this/is/a/really', i could simply click
> at `really', without having to `^' a few times carefully.
>
> I have something like below in my config file. But it should be easy to
> integrate it with `dired-insert-directory' in dired.el.
I didn't read your patch in detail, but the feature sounds like a good
idea. Could you perhaps write it up as a patch?
> ---------------------------------8<-------------------------------------
> (defun xwl-dired-jump-to-parent (event)
> (interactive "e")
> (let (window pos file)
> (save-excursion
> (setq window (posn-window (event-end event))
> pos (posn-point (event-end event)))
> (with-current-buffer (window-buffer window)
> (goto-char pos)
> (when (search-forward "/" (line-end-position) t 1)
> (let ((beg 3)
> (end (point)))
> (dired (buffer-substring beg end))))))))
>
> (defun xwl-dired-make-header-jumpable ()
> "Click on dired header will jump to that directory directly."
> (let ((inhibit-read-only t))
> (save-excursion
> (goto-char (point-min))
> (let ((bound (line-end-position))
> start end)
> (when (search-forward "/" bound t 1)
> (setq start (point))
> (while (search-forward "/" bound t 1)
> (setq end (1- (point)))
> (add-text-properties start end
> `(mouse-face
> highlight
> help-echo "mouse-1: goto here"
> keymap ,(let ((map (make-sparse-keymap)))
> (define-key map [down-mouse-1] 'xwl-dired-jump-to-parent)
> map)))
> (setq start (point))))))))
>
> (add-hook 'dired-after-readin-hook 'xwl-dired-make-header-jumpable)
> ---------------------------------8<-------------------------------------
This bug report was last modified 3 years and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.