all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* When my c++ mode hook is run, I want to print the value of some variables
@ 2007-04-01 17:18 Eric Lilja
  2007-04-02 19:34 ` james
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Lilja @ 2007-04-01 17:18 UTC (permalink / raw)
  To: help-gnu-emacs

How do I do that?

(defun my-cpp-mode-hook ()
  (message "Running my-cpp-mode-hook")
  (c-set-style "ellemtel")
  ; Say I want to print the value of access-label here, how? I can set
it with (c-set-offset 'access-label '-)
)
(add-hook 'c++-mode-hook 'my-cpp-mode-hook)

Is access-label even a variable? How do I print its value?

I'm running GNU Emacs 22.0.93.1 (i386-mingw-nt5.1.2600) of 2007-02-20
on MINDCOOLER

I know about the command C-c C-o btw...

- Eric

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

* Re: When my c++ mode hook is run, I want to print the value of some variables
  2007-04-01 17:18 When my c++ mode hook is run, I want to print the value of some variables Eric Lilja
@ 2007-04-02 19:34 ` james
  2007-04-02 23:53   ` Eric Lilja
  0 siblings, 1 reply; 3+ messages in thread
From: james @ 2007-04-02 19:34 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 1, 12:18 pm, "Eric Lilja" <mindcoo...@gmail.com> wrote:
>   ; Say I want to print the value of access-label here, how? I can set
> it with (c-set-offset 'access-label '-)

> Is access-label even a variable? How do I print its value?

Short answer:
(print (assoc 'access-label c-offsets-alist))

Then go look in *Messages* for the value

Less-short answer:
If you look at the docs for c-set-offset (C-h f, c-set-offset), you'll
see that it changes the value associated with the symbol access-label
in the associative list c-offsets-alist.  That list is the actual
variable that you are modifying.

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

* Re: When my c++ mode hook is run, I want to print the value of some variables
  2007-04-02 19:34 ` james
@ 2007-04-02 23:53   ` Eric Lilja
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Lilja @ 2007-04-02 23:53 UTC (permalink / raw)
  To: help-gnu-emacs

On 2 Apr, 21:34, "james" <james.kings...@gmail.com> wrote:
> On Apr 1, 12:18 pm, "Eric Lilja" <mindcoo...@gmail.com> wrote:
>
> >   ; Say I want to print the value of access-label here, how? I can set
> > it with (c-set-offset 'access-label '-)
> > Is access-label even a variable? How do I print its value?
>
> Short answer:
> (print (assoc 'access-label c-offsets-alist))
>
> Then go look in *Messages* for the value
>
> Less-short answer:
> If you look at the docs for c-set-offset (C-h f, c-set-offset), you'll
> see that it changes the value associated with the symbol access-label
> in the associative list c-offsets-alist.  That list is the actual
> variable that you are modifying.

Thank you, James, your information was very helpful!

- Eric

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

end of thread, other threads:[~2007-04-02 23:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-01 17:18 When my c++ mode hook is run, I want to print the value of some variables Eric Lilja
2007-04-02 19:34 ` james
2007-04-02 23:53   ` Eric Lilja

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.