logs archiveIRC Archive / Freenode / #emacs / 2009 / November / 28 / 1
MisterN
M-q is nice if you don't want to enable auto-fill-mode all the time \o/
respond
MisterN: yep. that is exactly what I ended up doing!
cecil
I'll look into it (message-box). I have been experimenting with programs written in ELisp. I got a good performance and would use it instead of Bash, but the interactivity is something that I need.
respond
cecil: The thought I had was this: were you to execute some functionality that eventually calls message-box, all from within Emacs?
cecil: or were you going to invoke a full blown Emacs session from outside of Emacs? Because if that was the case, then that would be a bit overkill.
laurus
Is there a keybinding for compile?
respond
"... outside of Emacs, all for the sake of displaying the popup dialog box via `message-box'" is what I meant to say. ;)
cecil
I am still working with 22.3.1. In this there is a bug in C-x C-e. When there is a ; with some text behind it in a non lisp buffer, it is not seen as comment. Resulting in an error. In a lisp buffer there is no problem.
respond
laurus: I doubt it.
cecil: the ; character begins a comment in Emacs Lisp (and I believe in other Lisp derivatives). // is the comment character for C++. /**/ is the range of characters for C. So therefore it doesn't make much sense to have ; be the comment character for all file types.
cecil
Instead of writing a Bash shell script I want to write an Emacs Lisp script. So it is the first case: execute some functionality that eventually calls message-box, all from within Emacs.
But when doing C-x C-e I am executing Lisp code. Then I would expect that ; begins a comment. Or am I overlooking something?
         

respond
cecil: I tend to only use C-x C-e outside of a comment
leo2007
any idea how to compile ecb with the cedet included in Emacs?
respond
cecil: What do you get that is incorrect that involves the ; character?
cecil
Wait a second. I'll look it up. (incorrect with ;)
kronoz
hi
ryoma
just discovered a bug in forward-paragraph
kronoz
ryoma: oh really?
ryoma
well, i think so
create two paragraphs, put a third in between, and comment it. notice that forward-paragraph will skip over the second and third paragraphs. notice that the reverse operation is not symmetrical.
or rather, it is, but in the other way
i want it not to skip the second
leo2007
,ecb
fsbot
[->] EmacsCodeBrowser -- [0] at http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsCodeBrowser
[1] at http://ecb.sourceforge.net/,
[2] an XEmacs package, see http://www.xemacs.org/Documentation/packageGuide.html,
[3] at http://www.emacswiki.org/cgi-bin/wiki.pl?ECB, ..[Type ,more]
kronoz
ryoma: what happens?
M-} is one of my favourite keystrokes :)
I wouldn't want to think it buggy...
ryoma
:) did you try it? (one of my favorites also.)
kronoz
what major mode are you using?
technomancy
(Action) just realized he can use browse-url from eshell
cecil
When using the folowing code:
(defun total-lap-time (start-velocity number-of-rounds speed-change)
(let ((U€ start-velocity)
(n (- number-of-rounds 1))
Un
arithmetic-progression
total-lap-time)
(setq Un (+ U€ (* n speed-change)))
(setq arithmetic-progression (* 0.5 (+ n 1) (+ U€ Un)))
(setq total-lap-time (/ arithmetic-progression 1)))) ; in minuten
kronoz
(Action) didn't even know about eshell
cecil
it works without a problem in an .el buffer and in a scratch buffer. But when using a message buffer of GNUS I get:
Debugger entered--Lisp error: (void-variable minuten)
eval(minuten)
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp)
technomancy
fsbot: tell cecil about lisppaste
fsbot
cecil: hmm, lisppaste is [0] an auto-announcing listing host (pastebin) <http://paste.lisp.org/new/emacs>, <http://emacswiki.org/wiki/lisppaste>
[1] see ,lisppaste.el for an Emacs interface, ..[Type ,more]
respond
cecil: right. the concept of a comment character is mode-specific, and that usually means file-type specific.
cecil: so ; is a comment in Lisp and Lisp-like buffers (Scheme, Common Lisp, Emacs Lisp, etc.), but not in GNUS.
(Action) wants to learn how to use eshell so that he can forget about Bash versus Korn shell issues on various OS's
         

ryoma
(Action) would want to, but has too much silly sh code
kronoz
is w3m >> w3?
btw I assume everyone here is using erc or similar right? :)
respond
kronoz: I use w3m heavily. I have not used w3 in a long long time. The only thing I use Firefox for now is for Javascript and Flash enabled sites.
ryoma
kronoz: the forward-paragraph bug occurs in org-mode (with comment-start being #), and i suspect many others
respond
kronoz: I'm using erc.
cecil
Connection was broken. The last I saw was that ; is mode specific. Which explains my problem.
respond
(Action) I have much too much sh code too, but am a yellow-bellied bastard and would defect for something better any day
kronoz
I'm still a beginner really. I've dabbled in emacs, love it, but now want to use it as much as possible for text processing
respond
cecil: yep. "right. the concept of a comment character is mode-specific,
and that usually means file-type specific." and "so ; is a comment in Lisp and Lisp-like buffers (Scheme,
Common Lisp, Emacs Lisp, etc.), but not in GNUS." is what i said before you got terminated.
kronoz: Beware, its like krack. "First one's free"
ryoma
true
kronoz
respond: a little like f#/ocaml. and lisp. I'm already starting on the crack that is lisp.
you can tell the addiction is growing since I am now trying to do *everything I do* in emacs as far as I can
cecil
Okay, I understand the problem. But I find it still strange. Emacs knows it is executing Lisp code. So I would expect it to understand ;. But I am told many times that I expect to much. ;-)
kronoz
coding (obv.), im, web browsing, blogging, email, etc.
I can't repro it...
cecil
I'll look into lisppaste.
respond
cecil: Yeah, that is a good idea. So where is your "point" when you type C-x C-e?
ryoma
cecil, could you wrap eval-expression or whatever in (let ((comment-start ";")) )?
(for that matter, could emacs?)
respond
cecil: that is, where is (point) relative to that ; character when you type C-x C-e?
kronoz: Well, some may argue (and this is a heated religious argument both ways), that "emacs is just a text editor" with the opposing view that "emacs is an operating system". I'm aligned with the latter camp, because ... wait ... snorting another line of Emacs coke ... <snort> ... I'm an addict already.
cecil
The point is after the function definition. I want to define the function.
kronoz
respond: 'just' a text editor - what is it that programmers mostly use a computer for? Text editing is utterly fundamental to telling a computer what to do.
respond: an os is just an oversized text editor ;)
(Action) has drunk the emacs koolaid
respond
cecil: just FYI, I opened up a brand new buffer, typed (message "whatever happened to flubber?"), moved my cursor (point) to the w, and typed C-x C-e and got it to eval. Hmmm, so it is more global than I thought.
kronoz: LOL!
cecil
I am relative new to Emacs Lisp. What do you mean with the comment-start?
respond
cecil: what does (describe-variable 'major-mode) say right before you type C-x C-e?
cecil
That is what I mend. ;-) When doing C-x -C-e it always -as far as I know- evaluates Lisp code. So the comment character should in my opinion not depend on the mode.
major-mode is message-mode.
respond
cecil: ok. "Evaluate sexp before point" is what the (describe-function 'eval-last-sexp) returns. That is why I think the location of (point) matters in this case. I mean, since Emacs can't figure out everything for every mode (especially since this is not even a Lisp mode whre it can take hints from text properties such as occurs in comments regions of text) it has to insist that the (point) is to the right of an s-expression.
cecil: and therefore, _before_ the ; character, and not on top of it or to the right of the ; character.
cecil: Playing catchup: "What do you mean with the comment-start?" --> the ; character in Lisp means that it, and all characters to the end of the line, are considered to be a comment that is ignored by the Lisp parser. A similar thing happens for the C++ language with the // characters.
MisterN
respond: /* and <!-- too? :P
respond
MisterN: yup.
cecil
ryoma said that I should use comment-start.
respond
cecil: use it how?
cecil
He wrote: could you wrap eval-expression or whatever in (let
((comment-start ";")) )?
respond
cecil: BTW, I verified that, inside a text buffer (one that is not specific to Lisp), that "Debugger entered--Lisp error: (void-variable flubber)" error will be thrown if you type C-x C-e to the right of a ; character. But put it before the ; character, and it will evaluate the previous s-expression. use this as an example:
cecil: (message "flubber") ; some comment here
cecil: that is just some let variable --> (let ((some-var ";")) (concat "<" some-var ">"))
cecil
The problem in my case was that I wanted to evaluate the definition of a function and there was comment in the function. So the evaluation will always include the ;.
funkenblatt
yeah, eval last s-expression just scans backward for the previous s-expression - it doesn't even check if it's in a comment region
lisppaste
respond pasted "test expression for cecil" at http://paste.lisp.org/display/91180
cecil
It is something I can live with. When putting something in a message, I just need to remove the comments. But I still find it a little bit strange. Emacs knows it is evaluating Lisp, but uses the comment character of the mode instead of the Lisp comment character.
respond
cecil: well, I think something else is going on.
cecil: what mode are you in when you need to hit C-x C-e
cecil
It goes wrong in message-mode.
respond
cecil: I did this: opened up a brand new buffer, typed M-x message-mode, pasted my above http://paste.lisp.org/display/91180, insured the cursor was to the right of the paren, typec C-x C-e, and it did its business. And, it ignored the embedded Lisp comment. So I think the key would be to be sure that the cursor is to the right of the right most paren.
cecil
My bad. The comment was not in the function definition, but after. So there was no problem. Sorry about the noise.
respond
cecil: np man. that's how we learn. :)
cecil
There is also a problem with brackets in quotes. I'll look it up. (I hope I did not make a thinking error there also.)
respond
cecil: now you can explain something to me: That function definition you pasted has a character I've not seen before in my chat buffer: (U€ start-velocity), specifically, the subscript'ed 0 in "U€". Am I the only one seeing that in their chat buffers? How was that character made?
cluck
totally offtopic question: does anyone here know of a non-sucky display manager? gdm seems to be unable to hold a session without dieing on me
fledermaus
gdm works fine here
technomancy
same here
fledermaus
has for the last N years.
cecil
It is code from someone else. I think he used unicode.
kodein
all display managers suck :(
I used gdm because it had xdm
now it doesn't.
xdmcp*
cecil
By the way how can I signify to whom I respond? (I am new to IRC.)
cluck
fledermaus: i'd say me too if it hadn't died on me twice in the last 15 days without even telling me why
kodein
cluck: like this.
err, cecil
respond
cecil: cecil: I usually just type the first few characters in the name, hit TAB, and let the good ole' ERC mode complete your name, and ERC mode then tacks on a ":" and a space, and away I type.
kodein
I think it's time to go to bed
respond
oops an extra "cecil" was left there.
kodein
I seem to be making mistakes. better rest before they are lethal.
cecil
The bracket in quotes is a strange problem. When opening .bbdb the bracket matching goes wrong, but when copying the offending line to *scratch* the matching works as it should.
But I think I have the solution. I think .bbdb should be in lisp-mode. I'll try.
No, but lisp-interaction-mode does solve the problem. I'll put it in my .emacs.
I can also put .bbdb in emacs-lisp-mode. I think that is better. What is the difference between those two modes?
The tab competion for a name does not work. But I am using irc, not erc. Something I need to install I supose.
Nope. ERC is allready installed. I'll try to switch.
respond: I am now on erc and I think that notifying to who I am responding works.
Drakeson
is there a service to turn a url into a few keywords that produces the url when searched together?
cecil
The colors in irc where better, but if erc is better as irc I'll better stick with erc.
Drakeson
(sorry about the offtopic, though)
boscop
how can I call a function that is bound to a key without knowing the function? such as if the user presses that key
Drakeson
boscop: that sounds a bit weird. If that is not all what you need to do, it is better if you explain the actual problem that you want to solve.
boscop
ok: I want to have a function on C-RET that behaves like the cursor is put at the end of the line and enter is pressed. but it shouldn't make any assuptions about what function is bound to enter, e.g. newline-and-indent etc
just simulate a RET-press
respond
cecil: yep now I'm back. had to step away for the moment. did you figure out your bracket issue?
Drakeson: something like http://tinyurl.com/ ?
cecil: I don't know about irc. All I've ever used was ERC, and the colors look fine to me.
boscop
Drakeson: isn't there a function to find out to which function a key is bound?
respond
Drakeson: `describe-key'
,(describe-function 'describe-key)
fsbot
describe-key is an interactive compiled Lisp function in `help.el'.
It is bound to C-h k, <f1> k, <help> k, <menu-bar> <help-menu>
<describe> <describe-key-1>.
(describe-key &optional KEY UNTRANSLATED UP-EVENT)
Display documentation of the function invoked by KEY. ..[Type ,more]
cecil
respond: Yes, it was a mode problem. The problem was with the .bbdb file. When putting this in lisp-interaction-mode or emacs-lisp-mode the problem was solved. I choose the latter, because I was allready using this for .gnus. What is the difference between those two modes?
boscop
respond: I mean, in elisp
so that I can call this function
chpln
boscop: I think you're after 'lookup-key
boscop
like: (getFunc (kbd "RET"))
respond
boscop: I don't know off the top of my head ... but what chpln said sounds right.
boscop: but read the Info manual on lookup-key since, IIRC, it may or may not actually search deeply through all keymaps.
boscop
I have to pass a keymap. what's the name of the global map?
cecil
They are. When you mentioning me it is blue between white. When I mention you it is bold red between red. Because I had only seen you referring to me, I tought erc used differend colors. But when you referred to me, it looked the same as with irc. So I jumped the gun.
respond
cecil: I use lisp-interction-mode with C-j to evaluate an s-expression and show the result directly in the buffer. emacs-lisp-mode is for mostly just for editing.
Drakeson
boscop: please be aware that "finding out what the function a key is bound to and calling that function" sounds ugly, and there might be a better way.
boscop
which one?
this reduces duplication
cecil
respond: I edit those files, so emacs-lisp-mode is the mode to use?
respond
cecil: It depends. What is .bbdb content expressed in? I suspect it is in fact Emacs Lisp mode, so you can get away with just emacs-lisp
You can stick a
;; -*-mode: lisp-interaction; -*-
at the top of the file to get lisp-interaction-mode instead. but I don't know if BBDB will overwrite that first line.
or use ;; -*-mode: emacs-lisp; -*- instead
chpln
boscop: for the keymap, perhaps use something like "(append (current-local-map) (current-global-map))"
cecil
respond: The lines of .bbdb look something like: ["firstName" "lastName" nil nil nil nil ("dummy@dummy.nl") ((creation-date . "2009-11-27") (timestamp . "2009-11-27")) nil]
On auto-mode-alist I do just an append with: ("/\\.bbdb\\'" . emacs-lisp-mode)
bob2
,,auto-mode-alist
fsbot
[->] I heard automodealist is [0] at http://www.emacswiki.org/cgi-bin/wiki/AutoModeAlist
[1] (add-to-list 'auto-mode-alist '("\\.foo\\'" . foo-mode))
bob2
no need for /
or '
oh wait
cecil
bob2: It is not an extension, it is the file ~/.bbdb.
respond
cecil: it looks like a lisp-readable expression which seems like a vector. so, I suspect that using C-x C-e on one of those expressions might just return that value after the lisp parser has a chance to read it, which doesn't to what you think it might do.
cecil: and by vector I mean an Elisp vector type.
cecil
respond: .bbdb is the big brother database. It is just filled with records (which are probably vectors), so I do not think I'll use C-x C-e. And in principall I will not edit it also. (I did it today, but that was a special case.)
lisppaste
respond pasted "response to the cecil question about appending to auto-mode-alist" at http://paste.lisp.org/display/91183
respond
cecil: agreed. and believe bbdb has its own user-<cough-cough>-friendly interface for editing those records. I've not used it, not tha tit is bad per se, just hadn't had a chance to yet.
cecil: so that bg-alist-set-or-add-multiple-elements-by-car function in my lisppaste above is a conveniency function have littered all over my mode setup code since I got quite annoyed about having to update that darn auto-mode-alist for new file types. In newer Emacs, that is probably less of a problem.
cecil
respond: I need bbdb for GNUS. I do not really like the interface. Maybe I need to write my own.
I have spend a lot -to much- of hours on Emacs/GNUS. But I have learned a lot I think.
One important thing is that I need to import my contacts from Evolution into bbdb for GNUS. And I want to make a connection with Twinkle also.
respond
cecil: I'm sure there are ways to import Evolution contacts into bbdb. Or maybe GNUS has a way to interface with more than just BBDB.
cecil: but yes you have to blaze a trail for that. :)
s/you have to/you may have to/g
« prev 1 2 3 4 5 6 7 next »