emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/ibuf-ext.el


From: John Paul Wallington
Subject: [Emacs-diffs] Changes to emacs/lisp/ibuf-ext.el
Date: Wed, 02 Jun 2004 18:08:02 -0400

Index: emacs/lisp/ibuf-ext.el
diff -c emacs/lisp/ibuf-ext.el:1.35 emacs/lisp/ibuf-ext.el:1.36
*** emacs/lisp/ibuf-ext.el:1.35 Mon Sep  1 15:45:12 2003
--- emacs/lisp/ibuf-ext.el      Wed Jun  2 22:05:17 2004
***************
*** 1,6 ****
  ;;; ibuf-ext.el --- extensions for ibuffer
  
! ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
  
  ;; Author: Colin Walters <address@hidden>
  ;; Maintainer: John Paul Wallington <address@hidden>
--- 1,6 ----
  ;;; ibuf-ext.el --- extensions for ibuffer
  
! ;; Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  
  ;; Author: Colin Walters <address@hidden>
  ;; Maintainer: John Paul Wallington <address@hidden>
***************
*** 1224,1242 ****
  
  ;;;###autoload
  (defun ibuffer-jump-to-buffer (name)
!   "Move point to the buffer whose name is NAME."
    (interactive (list nil))
!   (let ((table (mapcar #'(lambda (x)
!                          (cons (buffer-name (car x))
!                                (caddr x)))
!                      (ibuffer-current-state-list t))))
!     (when (null table)
!       (error "No buffers!"))
!     (when (interactive-p)
!       (setq name (completing-read "Jump to buffer: " table nil t)))
!     (ibuffer-aif (assoc name table)
!       (goto-char (cdr it))
!       (error "No buffer with name %s" name))))
  
  ;;;###autoload
  (defun ibuffer-diff-with-file ()
--- 1224,1285 ----
  
  ;;;###autoload
  (defun ibuffer-jump-to-buffer (name)
!   "Move point to the buffer whose name is NAME.
! 
! If called interactively, prompt for a buffer name and go to the
! corresponding line in the Ibuffer buffer.  If said buffer is in a
! hidden group filter, open it.
! 
! If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer
! visible buffers in the completion list.  Calling the command with
! a prefix argument reverses the meaning of that variable."
    (interactive (list nil))
!   (let ((only-visible ibuffer-jump-offer-only-visible-buffers))
!     (when current-prefix-arg
!       (setq only-visible (not only-visible)))
!     (if only-visible
!       (let ((table (mapcar #'(lambda (x)
!                                (buffer-name (car x)))
!                            (ibuffer-current-state-list))))
!         (when (null table)
!           (error "No buffers!"))
!         (when (interactive-p)
!           (setq name (completing-read "Jump to buffer: "
!                                       table nil t))))
!       (when (interactive-p)
!       (setq name (read-buffer "Jump to buffer: " nil t))))
!     (when (not (string= "" name))
!       (let (buf-point)
!       ;; Blindly search for our buffer: it is very likely that it is
!       ;; not in a hidden filter group.
!       (ibuffer-map-lines #'(lambda (buf marks)
!                              (when (string= (buffer-name buf) name)
!                                (setq buf-point (point))
!                                nil))
!                          t nil)
!       (when (and
!              (null buf-point)
!              (not (null ibuffer-hidden-filter-groups)))
!         ;; We did not find our buffer.  It must be in a hidden filter
!         ;; group, so go through all hidden filter groups to find it.
!         (catch 'found
!           (dolist (group ibuffer-hidden-filter-groups)
!             (ibuffer-jump-to-filter-group group)
!             (ibuffer-toggle-filter-group)
!             (ibuffer-map-lines #'(lambda (buf marks)
!                                    (when (string= (buffer-name buf) name)
!                                      (setq buf-point (point))
!                                      nil))
!                                t group)
!             (if buf-point
!                 (throw 'found nil)
!               (ibuffer-toggle-filter-group)))))
!       (if (null buf-point)
!           ;; Still not found even though we expanded all hidden filter
!           ;; groups: that must be because it's hidden by predicate:
!           ;; we won't bother trying to display it.
!           (error "No buffer with name %s" name)
!         (goto-char buf-point))))))
  
  ;;;###autoload
  (defun ibuffer-diff-with-file ()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]