Function: newsticker--group-shift
newsticker--group-shift is a byte-compiled function defined in
newst-treeview.el.gz.
Signature
(newsticker--group-shift DELTA &optional MOVE-GROUP)
Documentation
Shift current feed or group within its parent group.
DELTA is an integer which specifies the direction and the amount
of the shift. If MOVE-GROUP is nil the currently selected feed
newsticker--treeview-current-feed is shifted, if it is t then
the current feed's parent group is shifted..
Source Code
;; Defined in /usr/src/emacs/lisp/net/newst-treeview.el.gz
(defun newsticker--group-shift (delta &optional move-group)
"Shift current feed or group within its parent group.
DELTA is an integer which specifies the direction and the amount
of the shift. If MOVE-GROUP is nil the currently selected feed
`newsticker--treeview-current-feed' is shifted, if it is t then
the current feed's parent group is shifted.."
(let* ((cur-feed newsticker--treeview-current-feed)
(thing (if (and move-group
(not (newsticker--group-get-group cur-feed)))
(car (newsticker--group-find-parent-group cur-feed))
cur-feed))
(parent-group (newsticker--group-find-parent-group
;;(if move-group (car thing) thing)
thing)))
(unless parent-group
(error "Group not found!"))
(let* ((siblings (cdr parent-group))
(pos (cl-position thing siblings :test
(lambda (o1 o2)
(equal (if (listp o1) (car o1) o1)
(if (listp o2) (car o2) o2)))))
(tpos (+ pos delta ))
(new-pos (max 0 (min (length siblings) tpos)))
(beg (cl-subseq siblings 0 (min pos new-pos)))
(end (cl-subseq siblings (+ 1 (max pos new-pos))))
(p (elt siblings new-pos)))
(when (not (= pos new-pos))
(let ((th (or (newsticker--group-get-group thing) thing)))
(setcdr parent-group
(cl-concatenate 'list
beg
(if (> delta 0)
(list p th)
(list th p))
end)))
(newsticker--treeview-tree-update)
(newsticker-treeview-update)
(newsticker-treeview-jump cur-feed)))))