unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* c-mode-addons
       [not found] ` <Pine.LNX.4.58.0404260106300.1590@darkstar.example.net>
@ 2004-04-25 23:12   ` axa
       [not found]   ` <mailman.1578.1082934830.1061.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 2+ messages in thread
From: axa @ 2004-04-25 23:12 UTC (permalink / raw)


On Mon, 26 Apr 2004 axa@sendmail.ru wrote:

I installed c-mode-addons, but have a litle problems with it, and would
like to ask you to help me with it.
The version of c-mode-addon is 0.1 and version of emacs on my machine is 21.3.

I created "c_synopsis_list" with provided bash script in package. Then in
"c-mode-addons.el" I've changed line:
       (synopsis-file "~/elisp/c-mode-addons/c_synopsis_list"))
as suggested, to point to the full file name of "c_synopsis_list". Finally
I've added to my ~/.emacs file:
   (add-to-list 'load-path "~/c-mode-addons-0.1/")
again to point to directory where "c-mode-addons.el" resides (which is the
same place as for "c_synopsis_list"), and at the end, the following lines:
   (load "c-mode-addons")

   (define-key c-mode-map "\M-s" 'c-synopsis-at-point)
   (define-key c++-mode-map "\M-s" 'c-synopsis-at-point)

   (define-key c-mode-map "\C-ce" 'c-eval-enum)
   (define-key c++-mode-map "\C-ce" 'c-eval-enum)

   (define-key c-mode-map "(" 'c-electric-parenthesis-open)
   (define-key c++-mode-map "(" 'c-electric-parenthesis-open)

But when I add any of the last 6 lines (those defining c/c++-mode-map) I
get error when starting emacs:
---start---
(emacs .emacs)
Loading disp-table...done
Loading font-lock...
Loading regexp-opt...done
Loading font-lock...done
Loading c-mode-addons (source)...done


An error has occurred while loading `/home/axa/.emacs':

Symbol's value as variable is void: c-mode-map

To ensure normal operation, you should investigate the cause
of the error in your initialization file and remove it.  Start
Emacs with the `--debug-init' option to view a complete error
backtrace
---end---
And when I call emacs again with `--debug-init' options, I get:
---start---
Debugger entered--Lisp error: (void-variable c-mode-map)
  (define-key c-mode-map "(" (quote c-electric-parenthesis-open))
  eval-buffer(#<buffer  *load*> nil "~/.emacs" nil t)
  load-with-code-conversion("/home/axa/.emacs" "~/.emacs" t t)
  load("~/.emacs" t t)
  #[nil "^H\205\227^@   <C6>=\203^Q^@<C7>^H<C8>Q\2025^@
<C9>=\203'^@<CA><C7><CB><CC>#\203#^@<CD>\2025^@<CE>\2025^@   <CF>=\2
031^@<D0>\2025^@<C7>^H<D1>Q^Z<D2>^S<D3>\n<D2>\211#$
  command-line()
  normal-top-level()
---end---

Does anyone know how to correct this problem?

Thanks.

Best regards, axa
---
Real Users find the one combination of bizarre input values that shuts
down the system for days.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c-mode-addons
       [not found]   ` <mailman.1578.1082934830.1061.help-gnu-emacs@gnu.org>
@ 2004-04-26  9:16     ` Thorsten Bonow
  0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Bonow @ 2004-04-26  9:16 UTC (permalink / raw)


>>>>> "axa" == axa  <axa@sendmail.ru> writes:

    axa>    (define-key c-mode-map "(" 'c-electric-parenthesis-open) (define-key
    axa>    c++-mode-map "(" 'c-electric-parenthesis-open)

Hi,

I'm using `c-mode-base-map' and this works for me.

After byte-compiling and putting the library into my load-path, I have the
following in my init files for GNU Emacs and XEmacs:

;; ** C mode addons
(load "c-mode-addons")
(add-hook 'c-mode-common-hook
	  (function (lambda ()
		      ;; (define-key c-mode-base-map "(" 'c-electric-parenthesis-open)
		      (define-key c-mode-base-map "\M-s" 'c-synopsis-at-point)
		      (define-key c-mode-base-map "\C-ce" 'c-eval-enum))))

The reason I'm not using `c-electric-parenthesis-open' is that this overwrites
the original binding of "(" to `c-electric-paren' in c-mode. If I'm getting
around to it, I will try to fix this.

By the way, where do you got the package? I googled it from the original posting
to gnu.emacs.sources, but found all links to a package download dead...

Toto

-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

They say God created whiskey to keep the Irish from taking over the
world.

Friedman, Kinky (1993), Greenwich Killing Time. New York (Wings
Books), 216

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-26  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.58.0404260032420.1590@darkstar.example.net>
     [not found] ` <Pine.LNX.4.58.0404260106300.1590@darkstar.example.net>
2004-04-25 23:12   ` c-mode-addons axa
     [not found]   ` <mailman.1578.1082934830.1061.help-gnu-emacs@gnu.org>
2004-04-26  9:16     ` c-mode-addons Thorsten Bonow

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).