]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/ace-window/ace-window.el
Merge commit 'd592e36f33ac7e1fece462c5b7157f330c732630' from ace-window
[gnu-emacs-elpa] / packages / ace-window / ace-window.el
index 5aa389d8b0a401631ecd5c612d96caff23280bcc..68e28cfffc83b67447e1311f88051c843db3c793 100644 (file)
@@ -26,7 +26,7 @@
 ;;; Commentary:
 ;;
 ;; The main function, `ace-window' is meant to replace `other-window'.
-;; If fact, when there are only two windows present, `other-window' is
+;; In fact, when there are only two windows present, `other-window' is
 ;; called.  If there are more, each window will have its first
 ;; character highlighted.  Pressing that character will switch to that
 ;; window.
@@ -41,7 +41,7 @@
 ;;
 ;;    (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
 ;;
-;; This way they're all on the home row, although the intuitive
+;; This way they are all on the home row, although the intuitive
 ;; ordering is lost.
 ;;
 ;; If you don't want the gray background that makes the red selection
@@ -49,6 +49,9 @@
 ;;
 ;;    (setq aw-background nil)
 ;;
+;; If you want to know the selection characters ahead of time, you can
+;; turn on `ace-window-display-mode'.
+;;
 ;; When prefixed with one `universal-argument', instead of switching
 ;; to selected window, the selected window is swapped with current one.
 ;;
@@ -168,8 +171,11 @@ LEAF is (PT . WND)."
   (let* ((pt (car leaf))
          (wnd (cdr leaf))
          (ol (make-overlay pt (1+ pt) (window-buffer wnd)))
-         (old-str (with-selected-window wnd
-                    (buffer-substring pt (1+ pt))))
+         (old-str (or
+                   (ignore-errors
+                     (with-selected-window wnd
+                       (buffer-substring pt (1+ pt))))
+                   ""))
          (new-str
           (concat
            (cl-case aw-leading-char-style