LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2010, 11:42 PM   #1
bzimmerly
LQ Newbie
 
Registered: Dec 2010
Location: Hillsboro, Missouri, USA
Distribution: Ubuntu Linux 10.xx
Posts: 3

Rep: Reputation: 0
Unhappy Problem trying to test some LISP code in an Emacs buffer...


Hi LQ!

The problem is easy to explain, but what is the solution?

Visit this page: http://www.gnu.org/software/emacs/el...itting-Windows

Open emacs and enter the code into a scratch buffer.

Try to "Evaluate (the) Buffer" and here is what I get:

"Symbol's value as variable is void: =>"

I tried searching for the answer on Google but what I found doesn't make much sense to me. Does anyone see why this won't work? Thanks for any and all answers!

Sincerely,
- Bill

P.S. I am using Emacs v23.2.1 on Ubuntu Linux 10.04.
 
Old 12-18-2010, 12:48 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Arch
Posts: 3,131

Rep: Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317
The lines starting with ⇒ aren't code, they just show the return value of the code.
 
1 members found this post helpful.
Old 12-18-2010, 12:50 AM   #3
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Rep: Reputation: 36
Quote:
Originally Posted by bzimmerly View Post
Hi LQ!
Open emacs and enter the code into a scratch buffer.
What did you type into the buffer, and did you hit C-j afterwards, or did you just hit the enter key?

In the Emacs manual, you will see references to key combinations such as "C-j" which means hold down either the left or right CONTROL keys, press the j key, and then release both keys.

You are not supposed to cut and paste all of that text shown in that web page. The "=>" part is meant to show what the value of that form is supposed to return, right there in the scratch buffer. The scratch buffers run what is called Lisp Interaction Mode which allows you to evaluate some Emacs Lisp expressions,and have the value inserted directly into the buffer. The Lisp Interaction mode is special in that it rebinds the C-j key sequence to say "get the last expression before the cursor (what the Emacs manual calls "the point") and then evaluate it, and insert the string-ified form of the resulting value right there into the buffer"

You can change the mode of (most) any buffer into Lisp Interaction mode by typing
Code:
M-x lisp-interaction RET
Where M-x means hold down the ALT key, then press x, then release both keys, then at the command prompt thus shown, type in lisp-interaction, and then hit the RETurn key.

bg
 
1 members found this post helpful.
Old 12-18-2010, 04:30 AM   #4
bzimmerly
LQ Newbie
 
Registered: Dec 2010
Location: Hillsboro, Missouri, USA
Distribution: Ubuntu Linux 10.xx
Posts: 3

Original Poster
Rep: Reputation: 0
Smile Thank You Two!!!

Thanks ntubski and bgoodr! I commented out those lines and it worked perfectly. SWEET!

Here is the edited file:

(setq w (selected-window))
; => #<window 8 on windows.texi>
(window-edges) ; Edges in order:
; => (0 0 80 50) ; left--top--right--bottom

;; Returns window created
(setq w2 (split-window w 15))
; => #<window 28 on windows.texi>
(window-edges w2)
; => (0 15 80 50) ; Bottom window;
; top is line 15
(window-edges w)
; => (0 0 80 15) ; Top window

(setq w3 (split-window w 35 t))
; => #<window 32 on windows.texi>
(window-edges w3)
; => (35 0 80 15) ; Left edge at column 35
(window-edges w)
; => (0 0 35 15) ; Right edge at column 35
(window-edges w2)
; => (0 15 80 50) ; Bottom window unchanged
 
Old 12-18-2010, 04:38 AM   #5
bzimmerly
LQ Newbie
 
Registered: Dec 2010
Location: Hillsboro, Missouri, USA
Distribution: Ubuntu Linux 10.xx
Posts: 3

Original Poster
Rep: Reputation: 0
Follow up...

It seems rather strange to me that they wouldn't have semicolons to comment out the text that began with the => symbols, which (if you didn't know LISP like me) had caused this problem.

Semicolons would clearly protect the pristine code and help a LISP newbie like me to know that it wasn't executable code.

Heck, they have other comments that used semicolons to protect it. I can't be the only one to have made this mistake.

I'll write the document authors and suggest an improvement.

Thanks again!

Sincerely,
- Bill
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
emacs LISP, backward/forward-char problem, puts one extra space, why? parv Linux - Software 0 03-25-2007 09:49 PM
emacs lisp problem, how to force to add " to path parv Linux - Software 8 03-07-2007 05:22 PM
Emacs Lisp - buffer name as part of compile-command jantman Programming 4 10-02-2006 08:32 PM
Lisp/Emacs: How to do a macro on a buffer-name with another extension LuisG Linux - Software 3 10-25-2004 09:26 PM
Lisp, emacs-lisp aizkorri Programming 1 09-04-2002 06:16 PM


All times are GMT -5. The time now is 07:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration