seberino@spawar.navy.mil | 1 Dec 2008 02:45
Picon
Favicon

Re: best to have max width of 79 or 80 in source code?

On Nov 30, 12:50 pm, Xah Lee <xah... <at> gmail.com> wrote:
> in my opinion, hard wrappnig lines or in general any manual code
> formatting is a major damage in computing, to the degree that
> influenced bad tools and language design which forces humans to think
> and do what dumb machines can easily automate. The line wrapping
> convention largely spurred the perpetual time wasted on arguing about
> code formatting and tools about it.

I read some of the links you posted.  I like idea of Emacs
automagically handling wrapping but one of those links seemed to
suggest that C and Python and Perl weren't amenable to this.

cs

David Combs | 1 Dec 2008 04:03
Picon
Favicon

Re: Multiple *compilation* buffers

In article <mailman.2629.1225547112.25473.help-gnu-emacs <at> gnu.org>,
Kevin Rodgers  <kevin.d.rodgers <at> gmail.com> wrote:
>Peter Dyballa wrote:
>> 
>> Am 31.10.2008 um 11:23 schrieb John Paul Foster:
>> 
>>> I dont want to ^ever^ leave emacs so is there a way to run multiple grep
>>> and/or compilation processes at once?
>> 
>> 
>> Does it work to invoke each function with the universal argument C-u ?
>
>Probably not, `C-h f grep' says:
>
>	A prefix argument says to default the argument based upon the current
>	tag the cursor is over, substituting it into the last grep command
>	in the grep command history (or into `grep-command'
>	if that history list is empty).
>
>-- 
>Kevin Rodgers
>Denver, Colorado, USA

What I do is simply M-x rename-buffer to *grep--<its purpose>*.

You can end up with several of them.

David

One trick I especially like is to, BY HAND, do eg
(Continue reading)

Xah Lee | 1 Dec 2008 01:52
Picon
Gravatar

Re: emacs uses an old version of python

On Nov 30, 1:51 pm, John Seales <praxbaf... <at> hotmail.com> wrote:
> GNU emacs 22.1.1
> on an Intel MacBook
>
> I've updated to Python 2.6, but emacs still is using 2.3. This is a problem because I need to use the newer
features of the language. Looking in my /usr/bin/ directory, I see that 'python2.3' and 'pythonw2.3' are
in there, along with just plain 'python'. Using sudo, I copied 'python2.6' and 'pythonw2.6' into
/usr/bin, but still emacs calls the old version. Interestingly, the terminal application correctly
uses the new version of python when I run it from there.
>
> I'm guessing I may need to move more files around and/or change my .emacs file. But how?
>

there are several things you can do.

set your shell path var in “.emacs”.
(setenv "PATH" "/Users/xah/bin:/sw/bin:/sw/sbin:/bin:/usr/local/bin:/
sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/opt/local/bin:/Developer/
Tools")

make your the python you want comes in one of the path above first.

Not sure what emacs you are using. Carbon emacs? Aquamacs emacs?
Emacs.app? you built it? Because gui apps not started from the shell
will not inherent your shell env.

Also not sure what emacs package you are using. The python mode? some
other python interactive shell? In general, a package may search
obvious places and find the first one it think is the right python.

(Continue reading)

Xah Lee | 1 Dec 2008 03:54
Picon
Gravatar

Re: best to have max width of 79 or 80 in source code?

On Nov 30, 5:45 pm, "seber... <at> spawar.navy.mil"
<seber... <at> spawar.navy.mil> wrote:
> On Nov 30, 12:50 pm,XahLee<xah... <at> gmail.com> wrote:
>
> > in my opinion, hard wrappnig lines or in general any manual code
> > formatting is a major damage in computing, to the degree that
> > influenced bad tools and language design which forces humans to think
> > and do what dumb machines can easily automate. The line wrapping
> > convention largely spurred the perpetual time wasted on arguing about
> > code formatting and tools about it.
>
> I read some of the links you posted.  I like idea of Emacs
> automagically handling wrapping but one of those links seemed to
> suggest that C and Python and Perl weren't amenable to this.

One cannot auto-format Python source code due to the fact that
formatting is part of the syntax, but C and Perl can to a large
extent. (the automatting needn't be something like 100% “perfect” to
be useful. (but it should be 100% correct. That is, the reformatted
code should not break the code))

actually, having learned a lot elisp in the past couple of years, i
think it's rather trivial to do. Basically, the command will just need
to inseart line breaks in the right places in the source code, then
call indent-region. (i.e. utilizing emacs's existing functions that
handle indentation for each lang.)

The tricky part would be to not break lines if it is inside string.
But there are existing function(s) to determine if cursor is inside
string. Also, lines must not be cut when inside comment block.
(Continue reading)

Thierry Volpiatto | 1 Dec 2008 07:00
Picon
Gravatar

Re: emacs uses an old version of python

John Seales <praxbaffle <at> hotmail.com> writes:

> GNU emacs 22.1.1
> on an Intel MacBook
>
> I've updated to Python 2.6, but emacs still is using 2.3. This is a problem because I need to use the newer
features of the language. Looking in my /usr/bin/ directory, I see that 'python2.3' and 'pythonw2.3' are
in there, along with just plain 'python'. Using sudo, I copied 'python2.6' and 'pythonw2.6' into
/usr/bin, but still emacs calls the old version. Interestingly, the terminal application correctly
uses the new version of python when I run it from there.
>
> I'm guessing I may need to move more files around and/or change my .emacs file. But how?

Hi!
with python-mode i use:

,----[ C-h v py-python-command RET ]
| py-python-command is a variable defined in `python-mode.el'.
| Its value is "ipython"
| 
| Documentation:
| *Shell command used to start Python interpreter.
| 
| You can customize this variable.
| 
| ===*===*===*===*===*===*===*===*===*===*===
`----

for me it's ipython but it can be python2.5 or 6 ...

(Continue reading)

Richard Riley | 1 Dec 2008 09:26
Picon

Re: emacs uses an old version of python

Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:

> John Seales <praxbaffle <at> hotmail.com> writes:
>
>> GNU emacs 22.1.1
>> on an Intel MacBook
>>
>> I've updated to Python 2.6, but emacs still is using 2.3. This is a problem because I need to use the newer
features of the language. Looking in my /usr/bin/ directory, I see that 'python2.3' and 'pythonw2.3' are
in there, along with just plain 'python'. Using sudo, I copied 'python2.6' and 'pythonw2.6' into
/usr/bin, but still emacs calls the old version. Interestingly, the terminal application correctly
uses the new version of python when I run it from there.
>>
>> I'm guessing I may need to move more files around and/or change my .emacs file. But how?
>
> Hi!
> with python-mode i use:
>
> ,----[ C-h v py-python-command RET ]
> | py-python-command is a variable defined in `python-mode.el'.
> | Its value is "ipython"
> | 
> | Documentation:
> | *Shell command used to start Python interpreter.
> | 
> | You can customize this variable.
> | 
> | ===*===*===*===*===*===*===*===*===*===*===
> `----
>
(Continue reading)

Bernardo Bacic | 1 Dec 2008 11:25
Picon
Favicon

Re: How to pass parameters to compile ? And how to use CScope like features ?

>>
>> 2) How can I search for callers of the function I'm currently editing,
>> I found a weird solution using rgrep ? (in C)
> 

for the 2nd part of the question - there is a cscope interface:
http://www.emacswiki.org/emacs/CScopeAndEmacs

btw xcscope.el works quite well

Sven Utcke | 1 Dec 2008 12:31
Picon

Re: wikipedia's (ascii) math notation? emacs easy-way to translate it?

dkcombs <at> panix.com (David Combs) writes:

> I see this stuff in math articles in wikipedia -- uses some kind
> of ascii math-notation.  What is it?  

Could you give an example?

> Likewise, no fun trying to *read* the stuff.  Emacs have a way
> to make it look pretty?

Well, if it is something which has been around for a while, calc could
do it --- something like converting between:

(1 + x) / sqrt(x)

{(1 + x) / \sqrt{x}}

\frac{1 + x}{\sqrt{x}}

    1 + x
    -----
     ___
    V x

and so on.  Which, of course, is still pretty ugly...

Does this help?

Sven

(Continue reading)

Peter Dyballa | 1 Dec 2008 13:29
Picon

Re: wikipedia's (ascii) math notation? emacs easy-way to translate it?


Am 01.12.2008 um 12:31 schrieb Sven Utcke:

> PS: Installing calc on modern Emacsen requires a simple patch which
>     can be found somewhere hidden in the Emacs documentation...

Is there another calc than that integrated into modern Emacsen?

--
Mit friedvollen Grüßen

   Pete

Banken sprengen heißt Sonne rein lassen.

Picon

Re: How to pass parameters to compile ? And how to use CScope like features ?

Thanks a lot you guys, I'll try all the suggested ideas :)


Gmane