Function: smart-dired-sidebar

smart-dired-sidebar is an autoloaded, interactive and byte-compiled function defined in hui-dired-sidebar.el.

Signature

(smart-dired-sidebar)

Documentation

Use a single key or mouse key to manipulate directory entries.

Invoked via a key press when in dired-sidebar-mode. It assumes that its caller has already checked that the key was pressed in an appropriate buffer and has moved the cursor there.

If key is pressed:
 (1) within an entry line, the item is displayed for editing,
     normally in another window, or if it is a directory and
     dired-sidebar-cycle-subtree-on-click is t it will expand
     and collapse the entry
 (2) at the end of an entry line: invoke action-key-eol-function,
     typically to scroll up proportionally, if an Action Key press; invoke
     assist-key-eol-function, typically to scroll down proportionally,
     if an Asisst Key press;
 (3) on the first line of the buffer (other than the end of line),
     Dired is run on the current directory of this dired-sidebar;
 (4) at the end of the first or last line of the buffer,
     this dired-sidebar invocation is hidden.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20261030.2317/hui-dired-sidebar.el
;;; ************************************************************************
;;; smart-dired-sidebar functions
;;; ************************************************************************

;;;###autoload
(defun smart-dired-sidebar ()
  "Use a single key or mouse key to manipulate directory entries.

Invoked via a key press when in dired-sidebar-mode.  It assumes
that its caller has already checked that the key was pressed in
an appropriate buffer and has moved the cursor there.

If key is pressed:
 (1) within an entry line, the item is displayed for editing,
     normally in another window, or if it is a directory and
     `dired-sidebar-cycle-subtree-on-click' is t it will expand
     and collapse the entry
 (2) at the end of an entry line: invoke `action-key-eol-function',
     typically to scroll up proportionally, if an Action Key press; invoke
     `assist-key-eol-function', typically to scroll down proportionally,
     if an Asisst Key press;
 (3) on the first line of the buffer (other than the end of line),
     Dired is run on the current directory of this dired-sidebar;
 (4) at the end of the first or last line of the buffer,
     this dired-sidebar invocation is hidden."

  (interactive)
  (cond ((first-line-p)
	 (if (eolp)
	     (dired-sidebar-toggle-sidebar)
	   (hact 'link-to-directory default-directory)))
	((and (last-line-p) (eolp))
	 (dired-sidebar-toggle-sidebar))
	((eolp)
	 (funcall (if assist-flag assist-key-eol-function action-key-eol-function)))
	(t (let ((file (dired-get-file-for-visit)))
	     (if (and dired-sidebar-cycle-subtree-on-click
		      (file-directory-p file)
		      (not (string-suffix-p "." file)))
		 (hact 'dired-sidebar-subtree-toggle)
               (hact 'dired-sidebar-find-file file))))))