all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* simple elisp question
@ 2003-07-29 18:08 Jeffery B. Rancier
  0 siblings, 0 replies; 6+ messages in thread
From: Jeffery B. Rancier @ 2003-07-29 18:08 UTC (permalink / raw)


Hi All.

When I call find-tag, I prefer the method/function to appear at the
very top of the buffer.  So, I added the following:

,----
| (add-hook 'find-tag-hook 
| 	  (function 
| 	   (lambda()
| 	     (interactive)
| 	       (recenter 0)
| 	       (beginning-of-line))))
`----

That worked fine, but now when I call pop-tag-mark the place from
where I called find-tag, is not preserved.  I don't a call to
save-excursion will help here.  Any ideas?
-- 
Thanks,
Jeff
,----
| Jeffery B. Rancier
| 
| Softechnics
| a METTLER TOLEDO company
`----

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

* Simple elisp question
@ 2006-08-03 17:47 Chris McMahan
  2006-08-03 18:56 ` David Hansen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris McMahan @ 2006-08-03 17:47 UTC (permalink / raw)


Here's a basic elisp question:

I want to use the value of a variable within a list, rather than the
name of the variable. How do I do this? Here's the code in question.

(setq gnus-select-method
      '(nntp "news_server"))

I want to replace the hard-coded "news_server" with the value of a
variable I've defined called my_news_server defined with
  (setq my_news_server "news_server")

I apologize for the basic nature of the quesiton, but I've not been
able to find an answer in the elisp manual.

- Chris


-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================

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

* Re: Simple elisp question
  2006-08-03 17:47 Simple elisp question Chris McMahan
@ 2006-08-03 18:56 ` David Hansen
  2006-08-03 20:20 ` Eric Hanchrow
  2006-08-04 13:53 ` Chris McMahan
  2 siblings, 0 replies; 6+ messages in thread
From: David Hansen @ 2006-08-03 18:56 UTC (permalink / raw)


On Thu, 03 Aug 2006 13:47:33 -0400 Chris McMahan wrote:

> Here's a basic elisp question:
>
> I want to use the value of a variable within a list, rather than the
> name of the variable. How do I do this? Here's the code in question.
>
> (setq gnus-select-method
>       '(nntp "news_server"))
>
> I want to replace the hard-coded "news_server" with the value of a
> variable I've defined called my_news_server defined with
>   (setq my_news_server "news_server")

(list 'nntp my_news_server)

or the fancy way (read in th elisp manual about backquote
and unquote):

`(nntp ,my_news_server)

David

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

* Re: Simple elisp question
  2006-08-03 17:47 Simple elisp question Chris McMahan
  2006-08-03 18:56 ` David Hansen
@ 2006-08-03 20:20 ` Eric Hanchrow
  2006-08-04 13:53 ` Chris McMahan
  2 siblings, 0 replies; 6+ messages in thread
From: Eric Hanchrow @ 2006-08-03 20:20 UTC (permalink / raw)


>>>>> "Chris" == Chris McMahan <first_initiallastname@one.dot.net> writes:

    Chris> Here's a basic elisp question: I want to use the value of a
    Chris> variable within a list, rather than the name of the
    Chris> variable.  How do I do this?  Here's the code in question.

    Chris> (setq gnus-select-method '(nntp "news_server"))

    Chris> I want to replace the hard-coded "news_server" with the
    Chris> value of a variable I've defined called my_news_server
    Chris> defined with (setq my_news_server "news_server")

Two ways, which differ only in how they look (i.e., either way will
work; choose the one that seems least weird :-))

        (setq gnus-select-method `(nntp ,my_news_server))

or

        (setq gnus-select-method (list 'nntp my_news_server))

-- 
One of the fundamental philosophical questions of our time is
why Goofy is a person and Pluto is a dog.
        -- Roger Ebert

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

* Re: Simple elisp question
  2006-08-03 17:47 Simple elisp question Chris McMahan
  2006-08-03 18:56 ` David Hansen
  2006-08-03 20:20 ` Eric Hanchrow
@ 2006-08-04 13:53 ` Chris McMahan
  2006-08-04 14:51   ` Chris McMahan
  2 siblings, 1 reply; 6+ messages in thread
From: Chris McMahan @ 2006-08-04 13:53 UTC (permalink / raw)


Thanks to all who replied.

I'm going with the following format:

        (setq gnus-select-method (list 'nntp my_news_server))

So here's the final entry in my .gnus file:

(setq gnus-select-method
      (list 'nntp my_news_server
            'nntp-port-number 9119))

- Chris

Chris McMahan <first_initiallastname@one.dot.net> writes:

> Here's a basic elisp question:
>
> I want to use the value of a variable within a list, rather than the
> name of the variable. How do I do this? Here's the code in question.
>
> (setq gnus-select-method
>       '(nntp "news_server"))
>
> I want to replace the hard-coded "news_server" with the value of a
> variable I've defined called my_news_server defined with
>   (setq my_news_server "news_server")
>
> I apologize for the basic nature of the quesiton, but I've not been
> able to find an answer in the elisp manual.
>
> - Chris
>
>
> -- 

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================

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

* Re: Simple elisp question
  2006-08-04 13:53 ` Chris McMahan
@ 2006-08-04 14:51   ` Chris McMahan
  0 siblings, 0 replies; 6+ messages in thread
From: Chris McMahan @ 2006-08-04 14:51 UTC (permalink / raw)


Oops! Helps to test things out before posting.

Here's the final entry in my gnus file. I've used the other syntax
here as an example as well for my own reference.

;;; my_news_server and my_news_ports are set in the ~/.emacs file
(setq gnus-select-method
      (list 'nntp my_news_server
            (list 'nntp-port-number my_news_port)))

; alternate syntax for setting the list
;(setq gnus-select-method
;      `(nntp ,my_news_server
;               `(nntp-port-number ,my_news_port)))


thanks to all who helped!!

- Chris

Chris McMahan <first_initiallastname@one.dot.net> writes:

> Thanks to all who replied.
>
> I'm going with the following format:
>
>         (setq gnus-select-method (list 'nntp my_news_server))
>
> So here's the final entry in my .gnus file:
>
> (setq gnus-select-method
>       (list 'nntp my_news_server
>             'nntp-port-number 9119))
>
> - Chris
>
> Chris McMahan <first_initiallastname@one.dot.net> writes:
>
>> Here's a basic elisp question:
>>
>> I want to use the value of a variable within a list, rather than the
>> name of the variable. How do I do this? Here's the code in question.
>>
>> (setq gnus-select-method
>>       '(nntp "news_server"))
>>
>> I want to replace the hard-coded "news_server" with the value of a
>> variable I've defined called my_news_server defined with
>>   (setq my_news_server "news_server")
>>
>> I apologize for the basic nature of the quesiton, but I've not been
>> able to find an answer in the elisp manual.
>>
>> - Chris
>>
>>
>> -- 
>
> -- 
>      (.   .)
>   =ooO=(_)=Ooo=====================================
>   Chris McMahan | first_initiallastname@one.dot.net
>   =================================================

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================

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

end of thread, other threads:[~2006-08-04 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 17:47 Simple elisp question Chris McMahan
2006-08-03 18:56 ` David Hansen
2006-08-03 20:20 ` Eric Hanchrow
2006-08-04 13:53 ` Chris McMahan
2006-08-04 14:51   ` Chris McMahan
  -- strict thread matches above, loose matches on Subject: below --
2003-07-29 18:08 simple " Jeffery B. Rancier

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.