🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98970

describe-function not picking up buffer local chnages

#98970
From: Dan Dill
Date: Thu, 24 Jan 1991 17:38
60 lines
2437 bytes
I am trying to change a keymap in a buffer-local way (so that I can locally
modify a major mode without having to write a new one).  I am able to do so
--- the keymap *is* modified --- but the change does *not* show up in help
displays.

Using shell mode as an example, new-shell (see below) adds the command C-c m
successfully: C-c m is defined and, as desried, it is not defined in
subsequent invocations of shell.  The added command shows explicitly with

	(describe-variable 'shell-mode-map).

However, the added command does *not* show when shell-mode-map is displayed
with

	(describe-function 'shell-map),

where shell-map contains \\{shell-mode-map} in its documentation string.

Thanks for any help you can give.  And by the way, I think emacs is the
greatest thing since sliced bread!

----------------------------------------------

;; File new-shell.el
;; Try to locally modify shell-mode-map

;; Dan Dill dan@chem.bu.edu 1/24/91

;; Developed with GNU Emacs version 18.55.5

(require 'shell)

(defun new-shell ()
  (interactive)
  (setq shell-mode-hook 'new-shell-mode-setup)
  (shell)
  (setq shell-mode-hook nil))

(defun shell-map ()
  "\\{shell-mode-map}"
  (interactive)
  (with-output-to-temp-buffer "*Help*"
    (describe-function 'shell-map)))

(defvar tmp-map nil)

(defvar tmp-mode-name nil)

(defun new-shell-mode-setup ()
  (make-local-variable 'tmp-map)
  (setq tmp-map (copy-keymap shell-mode-map))
  (make-local-variable 'shell-mode-map)
  (setq shell-mode-map (copy-keymap tmp-map))
  (define-key shell-mode-map "\C-cm" 'shell-map)
  (use-local-map shell-mode-map)
  (make-variable-buffer-local 'mode-name)
  (make-local-variable 'tmp-mode-name)
  (setq tmp-mode-name mode-name)
  (make-local-variable 'mode-name)
  (setq mode-name (concat "New-" mode-name)))
Technical Details
Message-ID: <9101241738.AA14431@buchmg.bu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!CHEM.BU.EDU!dan

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,8f9cd85b02136b06,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-01-24 09:38:57 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!CHEM.BU.EDU!dan
From: dan@CHEM.BU.EDU (Dan Dill)
Newsgroups: gnu.emacs.bug
Subject: describe-function not picking up buffer local chnages
Message-ID: <9101241738.AA14431@buchmg.bu.edu>
Date: 24 Jan 91 17:38:57 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 60
Approved: bug-gnu-emacs@prep.ai.mit.edu