all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Elisp questions... where to ask?
@ 2007-12-15  6:30 Santanu
  2007-12-15 10:56 ` Johan Bockgård
  0 siblings, 1 reply; 4+ messages in thread
From: Santanu @ 2007-12-15  6:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Everybody,
Where should I ask my elisp (for GNU Emacs) related questions? If this
is
the place, could you please help me solve this problem I am facing:

I wrote the following piece of code in the scratch buffer:
---------------------------------------------------------------------------------
(define-skeleton test1
  "Prompt for name"
  "name:" str ?  (test2)) <Ctrl+x, Ctrl+e>

(define-skeleton test2
  "Prompt for surname"
  "surname:" str) <Ctrl+x, Ctrl+e>

(test1) <Ctrl+x, Ctrl+e> santanu chatterjee
---------------------------------------------------------------------------------
Now when I run the test1 function, and give "santanu" and
"chatterjee" as the inputs to the two prompts, I get the result
as shown above. But that happens in Emacs 21.x. But in
Emacs 22.x and above, this creates some kind of infinite
recursion, and I am placed in a debug buffer.

Can you reproduce the same thing in your system? If so,
could you let me know what exactly should be done to make
this run in emacs 22.x and above. I tried to go through the
emacs NEWS for 22.x and I did find some things related to
skeleton.el, but due to my lack of knowledge of elisp, I could
not make out much from it.

Thanks i advance for your help.

Regards,
Santanu Chatterjee

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

* Re: Elisp questions... where to ask?
  2007-12-15  6:30 Elisp questions... where to ask? Santanu
@ 2007-12-15 10:56 ` Johan Bockgård
  2007-12-17  6:10   ` Santanu
  2007-12-17  6:59   ` Santanu
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Bockgård @ 2007-12-15 10:56 UTC (permalink / raw)
  To: help-gnu-emacs

Santanu <thisissantanu@gmail.com> writes:

> I wrote the following piece of code in the scratch buffer:
> ---------------------------------------------------------------------------------
> (define-skeleton test1
>   "Prompt for name"
>   "name:" str ?  (test2)) <Ctrl+x, Ctrl+e>
>
> (define-skeleton test2
>   "Prompt for surname"
>   "surname:" str) <Ctrl+x, Ctrl+e>
>
> (test1) <Ctrl+x, Ctrl+e> santanu chatterjee
> ---------------------------------------------------------------------------------
> Now when I run the test1 function, and give "santanu" and
> "chatterjee" as the inputs to the two prompts, I get the result
> as shown above. But that happens in Emacs 21.x. But in
> Emacs 22.x and above, this creates some kind of infinite
> recursion, and I am placed in a debug buffer.
>
> Can you reproduce the same thing in your system? If so,
> could you let me know what exactly should be done to make
> this run in emacs 22.x and above. I tried to go through the
> emacs NEWS for 22.x and I did find some things related to
> skeleton.el, but due to my lack of knowledge of elisp, I could
> not make out much from it.

This seems to be a bug in skeleton.  There was a change made to
skeleton-proxy-new

    ;; Return non-nil to tell expand-abbrev that expansion has happened.
    ;; Otherwise the no-self-insert is ignored.
    t)

but skeleton-internal-1 is not prepared to handle `t' returned from a
subskeleton.


This seems to do the right thing:

*** skeleton.el.~1.51.~	2007-08-14 19:24:04.000000000 +0200
--- skeleton.el	2007-12-15 11:28:36.000000000 +0100
***************
*** 424,429 ****
--- 424,430 ----
  	(skeleton-internal-list element (car literal))
  	(setq literal (cdr literal)))))
     ((null element))
+    ((eq t element))
     (t (skeleton-internal-1 (eval element) t recursive))))
  \f
  ;; Maybe belongs into simple.el or elsewhere


-- 
Johan Bockgård

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

* Re: Elisp questions... where to ask?
  2007-12-15 10:56 ` Johan Bockgård
@ 2007-12-17  6:10   ` Santanu
  2007-12-17  6:59   ` Santanu
  1 sibling, 0 replies; 4+ messages in thread
From: Santanu @ 2007-12-17  6:10 UTC (permalink / raw)
  To: help-gnu-emacs

On Dec 15, 3:56 pm, bojohan+n...@dd.chalmers.se (Johan Bockgård)
wrote:

> This seems to be a bug in skeleton.  There was a change made to
> skeleton-proxy-new
>
>     ;; Return non-nil to tell expand-abbrev that expansion has happened.
>     ;; Otherwise the no-self-insert is ignored.
>     t)
>
> but skeleton-internal-1 is not prepared to handle `t' returned from a
> subskeleton.
>
> This seems to do the right thing:
>
> *** skeleton.el.~1.51.~ 2007-08-14 19:24:04.000000000 +0200
> --- skeleton.el 2007-12-15 11:28:36.000000000 +0100
> ***************
> *** 424,429 ****
> --- 424,430 ----
>         (skeleton-internal-list element (car literal))
>         (setq literal (cdr literal)))))
>      ((null element))
> +    ((eq t element))
>      (t (skeleton-internal-1 (eval element) t recursive))))
>
>   ;; Maybe belongs into simple.el or elsewhere

Thanks for the response. I will try to incorporate this patch in
skeleton.el
and see if this works.

Regards,
Santanu

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

* Re: Elisp questions... where to ask?
  2007-12-15 10:56 ` Johan Bockgård
  2007-12-17  6:10   ` Santanu
@ 2007-12-17  6:59   ` Santanu
  1 sibling, 0 replies; 4+ messages in thread
From: Santanu @ 2007-12-17  6:59 UTC (permalink / raw)
  To: help-gnu-emacs

On Dec 15, 3:56 pm, bojohan+n...@dd.chalmers.se (Johan Bockgård)
wrote:

> This seems to do the right thing:
>
> *** skeleton.el.~1.51.~ 2007-08-14 19:24:04.000000000 +0200
> --- skeleton.el 2007-12-15 11:28:36.000000000 +0100
> ***************
> *** 424,429 ****
> --- 424,430 ----
>         (skeleton-internal-list element (car literal))
>         (setq literal (cdr literal)))))
>      ((null element))
> +    ((eq t element))
>      (t (skeleton-internal-1 (eval element) t recursive))))
>
>   ;; Maybe belongs into simple.el or elsewhere
>

Just now I tried your patch. It seems to work perfectly. As a result
now, my verilog-mode works flawlessly in emacs-22.x (the verilog-mode
had similar code that was causing problems).

Thanks a lot for your help.

Regards,
Santanu

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

end of thread, other threads:[~2007-12-17  6:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-15  6:30 Elisp questions... where to ask? Santanu
2007-12-15 10:56 ` Johan Bockgård
2007-12-17  6:10   ` Santanu
2007-12-17  6:59   ` Santanu

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.