* cursor-in-non-selected-windows in edebug
@ 2005-12-10 10:27 Juri Linkov
2005-12-11 5:02 ` Richard M. Stallman
0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2005-12-10 10:27 UTC (permalink / raw)
I use cursor-in-non-selected-windows=nil, because it is difficult to
quickly locate a window with the active cursor, and I never needed its
default behavior, with only one exception. In edebug, displaying a
cursor in non-selected windows is necessary to follow point movements
in another window.
After looking for a way to enable it in edebug, I noticed the inviting
comment that says "any others??" just after binding
`cursor-in-echo-area' to nil in `edebug-display'. The patch below
accepts this invitation and binds `cursor-in-non-selected-windows'
to t in the same places. But unlike `cursor-in-echo-area' it needs
special treatment because `cursor-in-non-selected-windows' is
automatically buffer-local. I believe no one might want to have
`cursor-in-non-selected-windows' disabled while edebug is active
even when its value is set to nil.
Index: lisp/emacs-lisp/edebug.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/edebug.el,v
retrieving revision 3.84
diff -c -r3.84 edebug.el
*** lisp/emacs-lisp/edebug.el 6 Dec 2005 22:10:07 -0000 3.84
--- lisp/emacs-lisp/edebug.el 10 Dec 2005 10:27:34 -0000
***************
*** 2516,2521 ****
--- 2519,2525 ----
(defvar edebug-outside-o-a-p) ; outside overlay-arrow-position
(defvar edebug-outside-o-a-s) ; outside overlay-arrow-string
(defvar edebug-outside-c-i-e-a) ; outside cursor-in-echo-area
+ (defvar edebug-outside-c-i-n-s-w) ; outside cursor-in-non-selected-windows
(defvar edebug-eval-list nil) ;; List of expressions to evaluate.
***************
*** 2557,2569 ****
(edebug-outside-o-a-p overlay-arrow-position)
(edebug-outside-o-a-s overlay-arrow-string)
! (edebug-outside-c-i-e-a cursor-in-echo-area))
(unwind-protect
(let ((overlay-arrow-position overlay-arrow-position)
(overlay-arrow-string overlay-arrow-string)
(cursor-in-echo-area nil)
;; any others??
)
(if (not (buffer-name edebug-buffer))
(let ((debug-on-error nil))
(error "Buffer defining %s not found" edebug-function)))
--- 2561,2575 ----
(edebug-outside-o-a-p overlay-arrow-position)
(edebug-outside-o-a-s overlay-arrow-string)
! (edebug-outside-c-i-e-a cursor-in-echo-area)
! (edebug-outside-c-i-n-s-w (default-value 'cursor-in-non-selected-windows)))
(unwind-protect
(let ((overlay-arrow-position overlay-arrow-position)
(overlay-arrow-string overlay-arrow-string)
(cursor-in-echo-area nil)
;; any others??
)
+ (setq-default cursor-in-non-selected-windows t)
(if (not (buffer-name edebug-buffer))
(let ((debug-on-error nil))
(error "Buffer defining %s not found" edebug-function)))
***************
*** 2768,2773 ****
--- 2774,2780 ----
overlay-arrow-position edebug-outside-o-a-p
overlay-arrow-string edebug-outside-o-a-s
cursor-in-echo-area edebug-outside-c-i-e-a)
+ (setq-default cursor-in-non-selected-windows edebug-outside-c-i-n-s-w)
)))
***************
*** 3581,3586 ****
--- 3588,3594 ----
(overlay-arrow-string edebug-outside-o-a-s)
(cursor-in-echo-area edebug-outside-c-i-e-a)
)
+ (setq-default cursor-in-non-selected-windows edebug-outside-c-i-n-s-w)
(unwind-protect
(save-excursion ; of edebug-buffer
(set-buffer edebug-outside-buffer)
***************
*** 3618,3624 ****
--- 3626,3634 ----
edebug-outside-o-a-p overlay-arrow-position
edebug-outside-o-a-s overlay-arrow-string
edebug-outside-c-i-e-a cursor-in-echo-area
+ edebug-outside-c-i-n-s-w (default-value 'cursor-in-non-selected-windows)
)
+ (setq-default cursor-in-non-selected-windows t)
;; Restore the outside saved values; don't alter
;; the outside binding loci.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cursor-in-non-selected-windows in edebug
2005-12-10 10:27 cursor-in-non-selected-windows in edebug Juri Linkov
@ 2005-12-11 5:02 ` Richard M. Stallman
2005-12-14 17:06 ` Juri Linkov
0 siblings, 1 reply; 4+ messages in thread
From: Richard M. Stallman @ 2005-12-11 5:02 UTC (permalink / raw)
Cc: emacs-devel
It seems good to me, but I rarely use edebug.
Please install it in a week if nobody has objected.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cursor-in-non-selected-windows in edebug
2005-12-11 5:02 ` Richard M. Stallman
@ 2005-12-14 17:06 ` Juri Linkov
2005-12-15 2:08 ` Richard M. Stallman
0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2005-12-14 17:06 UTC (permalink / raw)
Cc: emacs-devel
I realized that a simpler way to do this is to use
default-cursor-in-non-selected-windows rather than
(default-value 'cursor-in-non-selected-windows) and
(setq-default cursor-in-non-selected-windows ...)
default-cursor-in-non-selected-windows is a global variable,
so it is safe to let-bind it during switching buffers.
I wonder why this variable is not documented in the Emacs Lisp manual?
Some similar pairs are documented, but some are not. For instance,
there is a pair of case-fold-search and default-case-fold-search in the
Emacs Lisp manual, but there is only cursor-in-non-selected-windows
without default-cursor-in-non-selected-windows, and cursor-type
without default-cursor-type and other.
Below is a new patch that uses default-cursor-in-non-selected-windows:
Index: lisp/emacs-lisp/edebug.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/edebug.el,v
retrieving revision 3.84
diff -c -r3.84 edebug.el
*** lisp/emacs-lisp/edebug.el 6 Dec 2005 22:10:07 -0000 3.84
--- lisp/emacs-lisp/edebug.el 14 Dec 2005 17:05:38 -0000
***************
*** 2516,2521 ****
--- 2521,2527 ----
(defvar edebug-outside-o-a-p) ; outside overlay-arrow-position
(defvar edebug-outside-o-a-s) ; outside overlay-arrow-string
(defvar edebug-outside-c-i-e-a) ; outside cursor-in-echo-area
+ (defvar edebug-outside-d-c-i-n-s-w) ; outside default-cursor-in-non-selected-windows
(defvar edebug-eval-list nil) ;; List of expressions to evaluate.
***************
*** 2557,2567 ****
(edebug-outside-o-a-p overlay-arrow-position)
(edebug-outside-o-a-s overlay-arrow-string)
! (edebug-outside-c-i-e-a cursor-in-echo-area))
(unwind-protect
(let ((overlay-arrow-position overlay-arrow-position)
(overlay-arrow-string overlay-arrow-string)
(cursor-in-echo-area nil)
;; any others??
)
(if (not (buffer-name edebug-buffer))
--- 2563,2575 ----
(edebug-outside-o-a-p overlay-arrow-position)
(edebug-outside-o-a-s overlay-arrow-string)
! (edebug-outside-c-i-e-a cursor-in-echo-area)
! (edebug-outside-d-c-i-n-s-w default-cursor-in-non-selected-windows))
(unwind-protect
(let ((overlay-arrow-position overlay-arrow-position)
(overlay-arrow-string overlay-arrow-string)
(cursor-in-echo-area nil)
+ (default-cursor-in-non-selected-windows t)
;; any others??
)
(if (not (buffer-name edebug-buffer))
***************
*** 2767,2773 ****
(setq
overlay-arrow-position edebug-outside-o-a-p
overlay-arrow-string edebug-outside-o-a-s
! cursor-in-echo-area edebug-outside-c-i-e-a)
)))
--- 2775,2782 ----
(setq
overlay-arrow-position edebug-outside-o-a-p
overlay-arrow-string edebug-outside-o-a-s
! cursor-in-echo-area edebug-outside-c-i-e-a
! default-cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
)))
***************
*** 3580,3585 ****
--- 3589,3595 ----
(overlay-arrow-position edebug-outside-o-a-p)
(overlay-arrow-string edebug-outside-o-a-s)
(cursor-in-echo-area edebug-outside-c-i-e-a)
+ (default-cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w)
)
(unwind-protect
(save-excursion ; of edebug-buffer
***************
*** 3618,3623 ****
--- 3628,3634 ----
edebug-outside-o-a-p overlay-arrow-position
edebug-outside-o-a-s overlay-arrow-string
edebug-outside-c-i-e-a cursor-in-echo-area
+ edebug-outside-d-c-i-n-s-w default-cursor-in-non-selected-windows
)
;; Restore the outside saved values; don't alter
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cursor-in-non-selected-windows in edebug
2005-12-14 17:06 ` Juri Linkov
@ 2005-12-15 2:08 ` Richard M. Stallman
0 siblings, 0 replies; 4+ messages in thread
From: Richard M. Stallman @ 2005-12-15 2:08 UTC (permalink / raw)
Cc: emacs-devel
I wonder why this variable is not documented in the Emacs Lisp manual?
Because I'm not sure whether their existence is a useful thing or
redundant. (I'd rather not have a discussion of that question now.)
Please install one version or the other of your patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-12-15 2:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-10 10:27 cursor-in-non-selected-windows in edebug Juri Linkov
2005-12-11 5:02 ` Richard M. Stallman
2005-12-14 17:06 ` Juri Linkov
2005-12-15 2:08 ` Richard M. Stallman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).