[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r99812: * ehelp.el (electric-help-ori
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r99812: * ehelp.el (electric-help-orig-major-mode): New buffer-local variable. |
Date: |
Sat, 03 Apr 2010 02:01:22 +0300 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 99812
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Sat 2010-04-03 02:01:22 +0300
message:
* ehelp.el (electric-help-orig-major-mode): New buffer-local variable.
(electric-help-mode): Set it to original major-mode. Doc fix.
(with-electric-help): Use `electric-help-orig-major-mode' instead
of (default-value 'major-mode). Doc fix.
http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00069.html
modified:
lisp/ChangeLog
lisp/ehelp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-04-02 17:24:37 +0000
+++ b/lisp/ChangeLog 2010-04-02 23:01:22 +0000
@@ -1,3 +1,12 @@
+2010-04-02 Juri Linkov <address@hidden>
+
+ * ehelp.el (electric-help-orig-major-mode):
+ New buffer-local variable.
+ (electric-help-mode): Set it to original major-mode. Doc fix.
+ (with-electric-help): Use `electric-help-orig-major-mode' instead
+ of (default-value 'major-mode). Doc fix.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00069.html
+
2010-04-02 Sam Steingold <address@hidden>
* vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling
=== modified file 'lisp/ehelp.el'
--- a/lisp/ehelp.el 2010-01-13 08:35:10 +0000
+++ b/lisp/ehelp.el 2010-04-02 23:01:22 +0000
@@ -94,10 +94,14 @@
map)
"Keymap defining commands available in `electric-help-mode'.")
+(defvar electric-help-orig-major-mode nil)
+(make-variable-buffer-local 'electric-help-orig-major-mode)
+
(defun electric-help-mode ()
"`with-electric-help' temporarily places its buffer in this mode.
-\(On exit from `with-electric-help', the buffer is put in default
`major-mode'.)"
+\(On exit from `with-electric-help', the original `major-mode' is restored.)"
(setq buffer-read-only t)
+ (setq electric-help-orig-major-mode major-mode)
(setq mode-name "Help")
(setq major-mode 'help)
(setq mode-line-buffer-identification '(" Help: %b"))
@@ -131,7 +135,7 @@
When the user exits (with `electric-help-exit', or otherwise), the help
buffer's window disappears (i.e., we use `save-window-excursion'), and
-BUFFER is put into default `major-mode' (or `fundamental-mode')."
+BUFFER is put back into its original major mode."
(setq buffer (get-buffer-create (or buffer "*Help*")))
(let ((one (one-window-p t))
(config (current-window-configuration))
@@ -170,13 +174,17 @@
(set-buffer buffer)
(setq buffer-read-only nil)
+ ;; Restore the original major mode saved by `electric-help-mode'.
;; We should really get a usable *Help* buffer when retaining
;; the electric one with `r'. The problem is that a simple
- ;; call to help-mode won't cut it; at least RET is bound wrong
- ;; afterwards. It's also not clear that `help-mode' is always
- ;; the right thing, maybe we should add an optional parameter.
+ ;; call to `help-mode' won't cut it; e.g. RET is bound wrong
+ ;; afterwards (`View-scroll-line-forward' instead of `help-follow').
+ ;; That's because Help mode should be set with `with-help-window'
+ ;; instead of the direct call to `help-mode'. But at least
+ ;; RET works correctly on links after using `help-mode'.
+ ;; This is satisfactory enough.
(condition-case ()
- (funcall (or (default-value 'major-mode) 'fundamental-mode))
+ (funcall (or electric-help-orig-major-mode 'fundamental-mode))
(error nil))
(set-window-configuration config)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r99812: * ehelp.el (electric-help-orig-major-mode): New buffer-local variable.,
Juri Linkov <=