Nordlöw | 1 Dec 2009 16:22
Picon

True (Unit) Test Integration

As each symbol in obarray can contain properties/attributes using put
() and get() wouldn't it be really useful to use this feature to
enable "true" unit-test integration with code in the following way;

When a function definition of symbol is changed we use the value of
the property say :tester; If this value is function we call this
function with function and report its output kind of like for example
elk does.

Similarly for packages a unit-test could be run every time a package-
file is compiled by using eval-when-compile(), right?

Does anyone know of any test package that uses this idea. I believe
Python have something similar, doesn't it?

Thanks in advance,
Nordlöw

Ted Zlatanov | 1 Dec 2009 16:31
X-Face
Favicon
Gravatar

Re: Adding support for previous/next-error

On Mon, 30 Nov 2009 12:53:35 +0100 pjb <at> informatimago.com (Pascal J. Bourguignon) wrote: 

PJB> Nordlöw <per.nordlow <at> gmail.com> writes:
>> How do I add "support" for previous-error and next-error in my hits-
>> buffer showing output of from my grep-like scanning code implemented
>> in Emacs Lisp?

PJB> Customize the variable: compilation-error-regexp-alist

This will work iff that buffer derives from compilation-mode.

Otherwise, Nordlow needs to bind next-error-function in the buffer.  See
C-h v next-error:

"C-x ` normally uses the most recently started
compilation, grep, or occur buffer.  It can also operate on any
buffer with output from the <f5>, M-x grep commands, or,
more generally, on any buffer in Compilation mode or with
Compilation Minor mode enabled, or any buffer in which
`next-error-function' is bound to an appropriate function.
To specify use of a particular buffer for error messages, type
C-x ` in that buffer when it is the only one displayed
in the current frame.

Once C-x ` has chosen the buffer for error messages, it
runs `next-error-hook' with `run-hooks', and stays with that buffer
until you use it in some other buffer which uses Compilation mode
or Compilation Minor mode."

Note that next-error-function has very specific semantics so it can move
(Continue reading)

andrea | 1 Dec 2009 17:19
Picon

Spaces please!


I get sick sometimes to read something like
x=y+1*(2-3*a^2)
but I get even more sick to add spaces manually every time.
I ask help to you elisp gurus, should I use a regexp or a macro-like
function (go-here, do-this)?

I think I should define some rules like:
- which operators want spaces (and if before or after)
- what is the arity of them

One problem for example could arise from things like

(-2)^10
but we could have some operators that could be binary or unary and check
that somehow.

Someone has done it already maybe?

Pascal J. Bourguignon | 1 Dec 2009 18:06
Face
Favicon

Re: Spaces please!

andrea <andrea.crotti.0 <at> gmail.com> writes:

> I get sick sometimes to read something like
> x=y+1*(2-3*a^2)
> but I get even more sick to add spaces manually every time.

Funny.  I get sick reading something like 

  x = y+1 * ( 2-3 * a   ^2)

;-)

Perhaps the best form would be:

  (= x
    (+ y
       (* 1
          (- 2
             (* 3
                (^ a 2))))))

but that would be a different syntax.  Notice that it could be the
work of an editor to read a source in whatever "syntax" it may happen
to be, to present it to the user in whatever form the user prefers,
allowing it to do structural editing instead of textual edition, and
saving it back to whatever "syntax" is required. 

A little like it is done for character encodings, where you can load a
file in iso-2022, edit it in emacs unicode, and save it in utf-8, only
for language syntaxes.
(Continue reading)

Lennart Borgman | 1 Dec 2009 18:46
Picon
Gravatar

Re: Spaces please!

On Tue, Dec 1, 2009 at 6:06 PM, Pascal J. Bourguignon
<pjb <at> informatimago.com> wrote:
>
> No, you cannot parse arithmetic expressions with regular expressions,
> they are too weak!  You need a parser.

Some recursion + reg exps?

Raphaël Berbain | 1 Dec 2009 12:03
Picon

remote tramp hangs

Hi,

I am having problems making tramp work.  In a nutshell, "/remotehost:"
works, but "/root <at> remotehost:" doesn't work, though I can passwordlessly
ssh/scp root <at> remotehost.  It hangs with the message "Tramp: Found remote
shell prompt on `remotehost'".

Data that may or may not help: miaou=localhost is ubuntu 9.10,
harry=remotehost is openbsd 4.5.  emacs is compiled from
http://bzr.savannah.gnu.org/r/emacs/trunk, revno 98852.  M-x version
says "GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu) of 2009-11-30 on
miaou", M-x tramp-version says "2.1.18-pre".  I get the same results
with emacs23* / emacs-snapshot* ubuntu packages and/or tramp cvs,
though.  I also tried a bunch of different tramp methods (ssh, sshx,
scpc, ...) and always get the same behaviour.

What I am doing:

rgb <at> miaou:~$ emacs -Q
M-: (require 'tramp) RET
M-: (setq debug-on-quit t tramp-verbose 10) RET
C-x C-f /root <at> harry: RET

then I wait for some time, and when it appears hung interrupt with C-g.

Messages:

("emacs")
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading tramp... [3 times]
(Continue reading)

Andreas Politz | 1 Dec 2009 19:16
Picon

Re: remote tramp hangs

raphael.berbain <at> gmail.com (Raphaël Berbain) writes:

> Hi,
>
> I am having problems making tramp work.  In a nutshell, "/remotehost:"
> works, but "/root <at> remotehost:" doesn't work, though I can passwordlessly
> ssh/scp root <at> remotehost.  It hangs with the message "Tramp: Found remote
> shell prompt on `remotehost'".
>
>
> Messages:
>

Tramp logs everything in some *tramp-debug* buffer, probably
tramp-verbose dependent.  I suspect the contents of this buffer would be
even more helpfull to you or others.

-ap

Harald Hanche-Olsen | 1 Dec 2009 18:42
Picon
Picon
Favicon
Gravatar

Re: Spaces please!

+ pjb <at> informatimago.com (Pascal J. Bourguignon):

> Perhaps the best form would be:
>
>   (= x
>     (+ y
>        (* 1
>           (- 2
>              (* 3
>                 (^ a 2))))))

Who needs stinkin' parentheses? Polish notation is the way to go.

  =x+y*1-2*3^a2

> but that would be a different syntax.

Oh. Well, never mind then.

--

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell

Dmitry Dzhus | 1 Dec 2009 19:14
Picon
Gravatar

Re: Remove all directory listings buffers

Andreas Politz wrote:

> M-x ibuffer RET * / D

Thank you, ibuffer is so nice! Have I missed something or ibuffer's
really not mentioned in GNU Emacs manual?
--

-- 
Happy Hacking.

http://sphinx.net.ru
Peter Dyballa | 1 Dec 2009 20:04
Picon

Re: remote tramp hangs


Am 01.12.2009 um 12:03 schrieb Raphaël Berbain:

> In a nutshell, "/remotehost:" works, but "/root <at> remotehost:" doesn't  
> work

Because don't give the method! Your debug output shows that scp is  
being used...

--
Greetings

   Pete

When people run around and around in circles we say they are crazy.  
When planets do it we say they are orbiting.


Gmane