all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* text-mode-abbrev-table default?
@ 2009-10-27 21:45 Andreas Roehler
  2009-10-28  9:19 ` Carsten Dominik
  0 siblings, 1 reply; 12+ messages in thread
From: Andreas Roehler @ 2009-10-27 21:45 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist


Hi,

with abbrev-mode, org-mode made his own
(org-mode-abbrev-table) - empty, which was
unconvenient, as I declared a lot of abbrevs in
text-mode already.

Solved it by

(add-hook 'org-mode-hook '(lambda () (setq local-abbrev-table text-mode-abbrev-table)))

However, as org-mode is a text-mode, why not use
`text-mode-abbrev-table' by default?

Thanks


Andreas

--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/

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

* Re: text-mode-abbrev-table default?
  2009-10-27 21:45 text-mode-abbrev-table default? Andreas Roehler
@ 2009-10-28  9:19 ` Carsten Dominik
  2009-10-28 10:32   ` Leo
  2009-10-28 16:11   ` Andreas Röhler
  0 siblings, 2 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-10-28  9:19 UTC (permalink / raw)
  To: Andreas Roehler; +Cc: emacs-orgmode Mailinglist


On Oct 27, 2009, at 10:45 PM, Andreas Roehler wrote:

>
> Hi,
>
> with abbrev-mode, org-mode made his own
> (org-mode-abbrev-table) - empty, which was
> unconvenient, as I declared a lot of abbrevs in
> text-mode already.
>
> Solved it by
>
> (add-hook 'org-mode-hook '(lambda () (setq local-abbrev-table text- 
> mode-abbrev-table)))
>
> However, as org-mode is a text-mode, why not use
> `text-mode-abbrev-table' by default?

Because if I do tis by default, someone if going to want
to have a separate table.... :-)

You solution is good - a nice snippet for a FAQ, maybe?

- Carsten

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

* Re: text-mode-abbrev-table default?
  2009-10-28  9:19 ` Carsten Dominik
@ 2009-10-28 10:32   ` Leo
  2009-10-28 10:37     ` Carsten Dominik
  2009-10-28 15:30     ` Carsten Dominik
  2009-10-28 16:11   ` Andreas Röhler
  1 sibling, 2 replies; 12+ messages in thread
From: Leo @ 2009-10-28 10:32 UTC (permalink / raw)
  To: emacs-orgmode

On 2009-10-28 09:19 +0000, Carsten Dominik wrote:
> Because if I do tis by default, someone if going to want
> to have a separate table.... :-)
>
> You solution is good - a nice snippet for a FAQ, maybe?

It seems natural to `define-abbrev-table' org-mode-abbrev-table with
text-mode-abbrev-table being its parent ;)

Leo

-- 
Emacs uptime: 36 days, 1 hour, 45 minutes, 0 seconds

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

* Re: Re: text-mode-abbrev-table default?
  2009-10-28 10:32   ` Leo
@ 2009-10-28 10:37     ` Carsten Dominik
  2009-10-28 14:48       ` Leo
  2009-10-28 15:30     ` Carsten Dominik
  1 sibling, 1 reply; 12+ messages in thread
From: Carsten Dominik @ 2009-10-28 10:37 UTC (permalink / raw)
  To: Leo; +Cc: emacs-orgmode


On Oct 28, 2009, at 11:32 AM, Leo wrote:

> On 2009-10-28 09:19 +0000, Carsten Dominik wrote:
>> Because if I do tis by default, someone if going to want
>> to have a separate table.... :-)
>>
>> You solution is good - a nice snippet for a FAQ, maybe?
>
> It seems natural to `define-abbrev-table' org-mode-abbrev-table with
> text-mode-abbrev-table being its parent ;)

Org-mode is defined using define-derived-mode, so maybe that should  
already do this?

- Carsten

>
> Leo
>
> -- 
> Emacs uptime: 36 days, 1 hour, 45 minutes, 0 seconds
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: text-mode-abbrev-table default?
  2009-10-28 10:37     ` Carsten Dominik
@ 2009-10-28 14:48       ` Leo
  0 siblings, 0 replies; 12+ messages in thread
From: Leo @ 2009-10-28 14:48 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

On 2009-10-28 10:37 +0000, Carsten Dominik wrote:
>> It seems natural to `define-abbrev-table' org-mode-abbrev-table with
>> text-mode-abbrev-table being its parent ;)
>
> Org-mode is defined using define-derived-mode, so maybe that should
> already do this?
>
> - Carsten

I tested it in GNU Emacs 23.1.50.1 (i386-apple-darwin9.8.0, NS
apple-appkit-949.54) of 2009-09-22 and it seems abbrevs in text-mode is
not inherited.

Leo

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

* Re: Re: text-mode-abbrev-table default?
  2009-10-28 10:32   ` Leo
  2009-10-28 10:37     ` Carsten Dominik
@ 2009-10-28 15:30     ` Carsten Dominik
  2009-10-28 17:10       ` Andreas Röhler
  2009-10-29  8:24       ` Leo
  1 sibling, 2 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-10-28 15:30 UTC (permalink / raw)
  To: Leo; +Cc: emacs-orgmode


On Oct 28, 2009, at 11:32 AM, Leo wrote:

> On 2009-10-28 09:19 +0000, Carsten Dominik wrote:
>> Because if I do tis by default, someone if going to want
>> to have a separate table.... :-)
>>
>> You solution is good - a nice snippet for a FAQ, maybe?
>
> It seems natural to `define-abbrev-table' org-mode-abbrev-table with
> text-mode-abbrev-table being its parent ;)

Hmm, after reconsidering, I think you are right.

How exactly would that look like?  Should that be a top-level form in  
org.el?
And should I then define org-mode with :abbrev-table org-mode-abbrev- 
table   ?

Just make me a patch, and I will apply it.

Thanks.

- Carsten

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

* Re: text-mode-abbrev-table default?
  2009-10-28  9:19 ` Carsten Dominik
  2009-10-28 10:32   ` Leo
@ 2009-10-28 16:11   ` Andreas Röhler
  1 sibling, 0 replies; 12+ messages in thread
From: Andreas Röhler @ 2009-10-28 16:11 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode Mailinglist

Carsten Dominik wrote:
> 
> On Oct 27, 2009, at 10:45 PM, Andreas Roehler wrote:
> 
>>
>> Hi,
>>
>> with abbrev-mode, org-mode made his own
>> (org-mode-abbrev-table) - empty, which was
>> unconvenient, as I declared a lot of abbrevs in
>> text-mode already.
>>
>> Solved it by
>>
>> (add-hook 'org-mode-hook '(lambda () (setq local-abbrev-table
>> text-mode-abbrev-table)))
>>
>> However, as org-mode is a text-mode, why not use
>> `text-mode-abbrev-table' by default?
> 
> Because if I do tis by default, someone if going to want
> to have a separate table.... :-)
> 
> You solution is good - a nice snippet for a FAQ, maybe?
> 
> - Carsten
> 
> 
> 

Don't know. Just one remark still in this matter:

Some modes as text-mode, org-mode are useful for non-programmers too.
However, emacs' didactic already is somehow backward bothering people with keys
instead mentioning mnemonic function-names.

It's important to reflect how much a newbie/non-programmer may learn.
IMHO the use of `customize' with its different types - string, regexp, boolean - its enough already.

Requiring knowledge and use of things like `add-hook' is simply too much - emacs will lose this people.

So what about introducing a customizable var saying `use-text-mode-abbrev-table'?

If set to `t', use it. As said - suggest it as default.

Cheers

Andreas

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

* Re: Re: text-mode-abbrev-table default?
  2009-10-28 15:30     ` Carsten Dominik
@ 2009-10-28 17:10       ` Andreas Röhler
  2009-10-29  8:24       ` Leo
  1 sibling, 0 replies; 12+ messages in thread
From: Andreas Röhler @ 2009-10-28 17:10 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode Mailinglist, Leo

Carsten Dominik wrote:
> 
> On Oct 28, 2009, at 11:32 AM, Leo wrote:
> 
>> On 2009-10-28 09:19 +0000, Carsten Dominik wrote:
>>> Because if I do tis by default, someone if going to want
>>> to have a separate table.... :-)
>>>
>>> You solution is good - a nice snippet for a FAQ, maybe?
>>
>> It seems natural to `define-abbrev-table' org-mode-abbrev-table with
>> text-mode-abbrev-table being its parent ;)
> 
> Hmm, after reconsidering, I think you are right.
> 
> How exactly would that look like?  Should that be a top-level form in
> org.el?
> And should I then define org-mode with :abbrev-table
> org-mode-abbrev-table   ?
> 
> Just make me a patch, and I will apply it.
> 
> Thanks.
> 
> - Carsten
> 
> 
> 



It would be great, if user could choose the appropriate
abbrev-table via customize too.

For example my text-mode-abbrev-table contains german
abbrevs, while writing this text an
(english-mode-abbrev-table) is present.

It might be useful being able to keep several org-mode
projects witch different language abbrev tables.

Thanks, Grüße

Andreas

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

* Re: text-mode-abbrev-table default?
  2009-10-28 15:30     ` Carsten Dominik
  2009-10-28 17:10       ` Andreas Röhler
@ 2009-10-29  8:24       ` Leo
  2009-10-29 11:48         ` Carsten Dominik
  1 sibling, 1 reply; 12+ messages in thread
From: Leo @ 2009-10-29  8:24 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

On 2009-10-28 15:30 +0000, Carsten Dominik wrote:
>> On 2009-10-28 09:19 +0000, Carsten Dominik wrote:
>>> Because if I do tis by default, someone if going to want to have a
>>> separate table.... :-)
>>> You solution is good - a nice snippet for a FAQ, maybe?
>> It seems natural to `define-abbrev-table' org-mode-abbrev-table with
>> text-mode-abbrev-table being its parent ;)
>
> Hmm, after reconsidering, I think you are right.
>
> How exactly would that look like? Should that be a top-level form in
> org.el? And should I then define org-mode with :abbrev-table
> org-mode-abbrev- table ?
>
> Just make me a patch, and I will apply it.

I make the following patch using the org.el in Emacs (cvs 20090922).

diff -u -L /Applications/Emacs.app/Contents/Resources/lisp/org/org.el.gz -L /var/folders/b2/b2DGafs+EpaLFYrOC7ZWR++++TQ/-Tmp-/buffer-content-58096yEn /var/folders/b2/b2DGafs\+EpaLFYrOC7ZWR\+\+\+\+TQ/-Tmp-/jka-com58096_Ot /var/folders/b2/b2DGafs\+EpaLFYrOC7ZWR\+\+\+\+TQ/-Tmp-/buffer-content-58096yEn
--- /Applications/Emacs.app/Contents/Resources/lisp/org/org.el.gz
+++ /var/folders/b2/b2DGafs+EpaLFYrOC7ZWR++++TQ/-Tmp-/buffer-content-58096yEn
@@ -4054,6 +4054,8 @@
       (org-indent-mode 1))
     (org-set-startup-visibility)))
 
+(abbrev-table-put org-mode-abbrev-table
+                  :parents (list text-mode-abbrev-table))
 (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
 
 (defun org-current-time ()

Diff finished.  Thu Oct 29 08:20:52 2009

> Thanks.
>
> - Carsten

Best wishes,

Leo

-- 
Emacs uptime: 36 days, 23 hours, 32 minutes, 4 seconds

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

* Re: text-mode-abbrev-table default?
  2009-10-29  8:24       ` Leo
@ 2009-10-29 11:48         ` Carsten Dominik
  2009-10-29 17:04           ` Leo
  0 siblings, 1 reply; 12+ messages in thread
From: Carsten Dominik @ 2009-10-29 11:48 UTC (permalink / raw)
  To: Leo; +Cc: emacs-orgmode

Applied, thanks.

- Carsten
On Oct 29, 2009, at 9:24 AM, Leo wrote:

> On 2009-10-28 15:30 +0000, Carsten Dominik wrote:
>>> On 2009-10-28 09:19 +0000, Carsten Dominik wrote:
>>>> Because if I do tis by default, someone if going to want to have a
>>>> separate table.... :-)
>>>> You solution is good - a nice snippet for a FAQ, maybe?
>>> It seems natural to `define-abbrev-table' org-mode-abbrev-table with
>>> text-mode-abbrev-table being its parent ;)
>>
>> Hmm, after reconsidering, I think you are right.
>>
>> How exactly would that look like? Should that be a top-level form in
>> org.el? And should I then define org-mode with :abbrev-table
>> org-mode-abbrev- table ?
>>
>> Just make me a patch, and I will apply it.
>
> I make the following patch using the org.el in Emacs (cvs 20090922).
>
> diff -u -L /Applications/Emacs.app/Contents/Resources/lisp/org/ 
> org.el.gz -L /var/folders/b2/b2DGafs+EpaLFYrOC7ZWR++++TQ/-Tmp-/ 
> buffer-content-58096yEn /var/folders/b2/b2DGafs\+EpaLFYrOC7ZWR\+\+\+\ 
> +TQ/-Tmp-/jka-com58096_Ot /var/folders/b2/b2DGafs\+EpaLFYrOC7ZWR\+\+\ 
> +\+TQ/-Tmp-/buffer-content-58096yEn
> --- /Applications/Emacs.app/Contents/Resources/lisp/org/org.el.gz
> +++ /var/folders/b2/b2DGafs+EpaLFYrOC7ZWR++++TQ/-Tmp-/buffer- 
> content-58096yEn
> @@ -4054,6 +4054,8 @@
>       (org-indent-mode 1))
>     (org-set-startup-visibility)))
>
> +(abbrev-table-put org-mode-abbrev-table
> +                  :parents (list text-mode-abbrev-table))
> (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
>
> (defun org-current-time ()
>
> Diff finished.  Thu Oct 29 08:20:52 2009
>
>> Thanks.
>>
>> - Carsten
>
> Best wishes,
>
> Leo
>
> -- 
> Emacs uptime: 36 days, 23 hours, 32 minutes, 4 seconds

- Carsten

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

* Re: text-mode-abbrev-table default?
  2009-10-29 11:48         ` Carsten Dominik
@ 2009-10-29 17:04           ` Leo
  2009-10-29 17:19             ` Carsten Dominik
  0 siblings, 1 reply; 12+ messages in thread
From: Leo @ 2009-10-29 17:04 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

On 2009-10-29 11:48 +0000, Carsten Dominik wrote:
> Applied, thanks.

4144 (eval-after-load "abbrev"
4145   '(when (fboundp 'abbrev-table-put)
4146      (abbrev-table-put org-mode-abbrev-table
4147                        :parents (list text-mode-abbrev-table))))

Is eval-after-load "abbrev" necessary?

abbrev is preloaded on Emacs both 22 and 23, and xemacs 21.4.21.

Best,

Leo

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

* Re: text-mode-abbrev-table default?
  2009-10-29 17:04           ` Leo
@ 2009-10-29 17:19             ` Carsten Dominik
  0 siblings, 0 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-10-29 17:19 UTC (permalink / raw)
  To: Leo; +Cc: emacs-orgmode

You are right, it is probably not necessary.

- Carsten

On Oct 29, 2009, at 6:04 PM, Leo wrote:

> On 2009-10-29 11:48 +0000, Carsten Dominik wrote:
>> Applied, thanks.
>
> 4144 (eval-after-load "abbrev"
> 4145   '(when (fboundp 'abbrev-table-put)
> 4146      (abbrev-table-put org-mode-abbrev-table
> 4147                        :parents (list text-mode-abbrev-table))))
>
> Is eval-after-load "abbrev" necessary?
>
> abbrev is preloaded on Emacs both 22 and 23, and xemacs 21.4.21.
>
> Best,
>
> Leo

- Carsten

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

end of thread, other threads:[~2009-10-29 17:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27 21:45 text-mode-abbrev-table default? Andreas Roehler
2009-10-28  9:19 ` Carsten Dominik
2009-10-28 10:32   ` Leo
2009-10-28 10:37     ` Carsten Dominik
2009-10-28 14:48       ` Leo
2009-10-28 15:30     ` Carsten Dominik
2009-10-28 17:10       ` Andreas Röhler
2009-10-29  8:24       ` Leo
2009-10-29 11:48         ` Carsten Dominik
2009-10-29 17:04           ` Leo
2009-10-29 17:19             ` Carsten Dominik
2009-10-28 16:11   ` Andreas Röhler

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.