Re: character/event handling in org-mode
14 years, 2 months
Aidan Kehoe
Ar an seachtú lá de mí Méan Fómhair, scríobh Robert Pluim:
> On Fri, Sep 3, 2010 at 7:04 PM, Aidan Kehoe <kehoea(a)parhasard.net> wrote:
> >
> > Ar an triú lá de mí Méan Fómhair, scríobh Robert Pluim:
> >
> > > So I was reading the latest org manual, and got to the section
> > > about speed-keys, tried them out, and discovered they didn't
> > > work in XEmacs since our this-command-keys returns a vector,
> > > not a string. I've come up with the following, but surely
> > > There Is a Better Way?
> >
> > They appear to have reinvented keymaps! I love human ingenuity. Here’s
> > an ugly and fast equivalent, but really, org-speed-commands-default and
> > org-speed-commands-user should be keymaps, not alists.
>
> With lookups done lookup-key, unsurprisingly. I'll look at rewriting
> that when I get a chance.
>
> On a related note, is there any concept of having keymaps either
> attached to a specific buffer position (overriding the default keymap
> for the buffer) or with a precondition applied to see whether the
> keymap should be used for lookup at all? That would allow you to do
> things only at eg the start of lines without having to write a bunch
> of boiler-plate code.
#'set-extent-keymap is what you want for that:
`set-extent-keymap' is a compiled Lisp function
-- loaded from "/home/aidan/xemacs-21.5-checked-out/lisp/extents.elc"
(set-extent-keymap EXTENT KEYMAP)
Documentation:
Set EXTENT's `keymap' property to KEYMAP.
and from the #'set-extent-property documentation:
[...]
keymap This keymap is consulted for mouse clicks on this
extent, or keypresses made while point is within the
extent.
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta
Re: prblms: bbdb-define-all-aliases and local-abbrev-table
14 years, 2 months
Stephen J. Turnbull
Uwe Brauer writes:
> >>>>> On Mon, 06 Sep 2010 16:33:14 +0200, Uwe Brauer
> >>>>> <oub(a)mat.ucm.es> wrote:
>
>
> > (add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
>
>
> I found (an ugly) work around:
> After having expand the mail alias, I have to
> (setq mail-aliases nil) in order that my code works.
Maybe it would be better to let-bind it to nil around your code.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta
XEmacs Packages have been pre-released (2010-09-06-23)
14 years, 2 months
Norbert Koch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey there everyone.
I have just added the following packages to the 'Pre-Releases'
directory:
New Packages in Pre-Release:
===========================
leim-1.32-pkg.tar.gz upstream version: none
text-modes-1.99-pkg.tar.gz upstream version: none
xemacs-base-2.28-pkg.tar.gz upstream version: none
Previously Announced Packages Still in Pre-Release:
==================================================
x-symbol-1.12-pkg.tar.gz upstream version: 4.5.1
Detailed Changes:
================
- ------- ChangeLog Entries from mule-packages/leim/ChangeLog -------
2010-09-05 Norbert Koch viteno(a)xemacs.org
* Makefile (VERSION): XEmacs package 1.32 released.
2010-09-03 Aidan Kehoe <kehoea(a)parhasard.net>
* quail.el:
* quail.el (quail-translation-keymap):
* quail.el (quail-simple-translation-keymap):
* quail.el (quail-set-keyboard-layout):
* quail.el (quail-update-current-translations):
* quail.el (frame-char-height): New.
* quail.el (quail-completion-list-translations):
* quail.el (quail-translation-help):
* quail.el (quail-update-leim-list-file):
Make the #'define-key syntax in this file conform to our
documentation; eliminate byte-compiler warnings, in the process
fixing at least two honest-to-goodness bugs.
- ------- ChangeLog Entries from xemacs-packages/text-modes/ChangeLog -------
2010-09-06 Norbert Koch viteno(a)xemacs.org
* Makefile (VERSION): XEmacs package 1.99 released.
2010-09-03 Aidan Kehoe <kehoea(a)parhasard.net>
* po-mode.el (po-mode-map):
Oops, the Lisp reader doesn't like (control #) as syntax; thanks
for the reports, Norbert Koch and Mats Lidell!
2010-09-02 Aidan Kehoe <kehoea(a)parhasard.net>
* po-mode.el (po-mode-map):
Stop abusing the undocumented XEmacs key syntax for control
characters, use the documented vector-of-lists approach instead.
- ------- ChangeLog Entries from xemacs-packages/xemacs-base/ChangeLog -------
2010-09-06 Norbert Koch viteno(a)xemacs.org
* Makefile (VERSION): XEmacs package 2.28 released.
2010-09-03 Aidan Kehoe <kehoea(a)parhasard.net>
* edmacro.el (edmacro-parse-word):
Only #'read if WORD actually matched the regexp avoiding errors
when WORD is not valid Lisp syntax. Logic error on my part, caught
by the smoketest; thank you Mats Lidell!
2010-09-02 Aidan Kehoe <kehoea(a)parhasard.net>
* edmacro.el (edmacro-parse-word):
My last change worked on individual characters, not strings.
Extend it to work on multiple characters, supplied as strings.
2010-09-02 Aidan Kehoe <kehoea(a)parhasard.net>
* edmacro.el (edmacro-parse-word):
If we're handed control or meta characters in WORD, return
appropriate lists (in the canonical form) with ((control X)) or
((meta X)) instead of the character itself (which is
non-canonical).
Also, if handed an octal escape, error if it wouldn't represent a
valid character, and parse it in the same way if it does represent
a valid character.
2010-08-28 Aidan Kehoe <kehoea(a)parhasard.net>
* comint.el (comint-word):
Preserve match buffer information in this function, avoiding
problems in #'comint-match-partial-file-name described in
http://mid.gmane.org/4C728493.70107@gmail.com . Thank you for the
bug report, Raymond Toy!
Installing These:
================
Manually:
- --------
1) Download the packages that you want to install from:
/ftp.xemacs.org:/pub/xemacs/beta/experimental/packages/
2) Unpack them to: [1]
/usr/local/lib/xemacs/xemacs-packages/
3) Re-start XEmacs.
Using XEmacs Package Tools (XEmacs 21.[245].x):
- ----------------------------------------------
1) Tools -> Packages -> Add Download Site -> Pre-Releases
2) Tools -> Packages -> List and Install
3) Select the packages you wish to install (there are brief
instructions at the bottom of the packages buffer).
4) Packages -> Install/Remove Selected
5) Re-start XEmacs.
Using XEmacs Package Tools (XEmacs 21.1.14):
- -------------------------------------------
1) Options -> Manage Packages -> Add Download Site -> Pre-Releases
2) Options -> Manage Packages -> List and Install
3 - 5) As per XEmacs 21.[245].x.
Footnotes:
[1] Note: Mule packages should be installed into:
/usr/local/lib/xemacs/mule-packages/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFMhV7Wgu3ywdHdhM0RAgrmAJ0ZaEUdiT5mdjqlY9/wFZxxjdXxFACgwgW2
qJei5pBqqvzGKlQs4fVQrZ4=
=0eHz
-----END PGP SIGNATURE-----
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta
prblms: bbdb-define-all-aliases and local-abbrev-table
14 years, 2 months
Uwe Brauer
Hello
A while ago I wrote a hack which is a multi language
enhancement of the flyspell abbrev mechanism.
The idea is to have for different languages different minor
modes with different local-abbrev-table(s).
This works fine for all mayor mode I have checked and it
even works for message (or gnus-message)-mode) as long
as bbdb-define-all-aliases is *not* involved.
Once I use bbdb-define-all-aliases say via
(add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
Then the following strange things happen:
- once I call gnus-summary-post-news then
local-abbrev-table is set to
Value: [ash* matlist....
That seems to me some table associated with the bbdb
entries. Note that C-h v local-abbrev-table does not display
the entries as they are shown via edit-abbrevs
I now turn on say british-minor-mode. It seems that the
local-abbrev-table is set correctly to the value of that
minor mode.
However abbrevs which are typed below --text follows this line--
are expanded according to the
text-mode-abbrev-table! Even when I explicitly change again
and again the minor mode and the local-abbrev-table.
Also all corrections flyspell performs are saved in the
text-mode-abbrev-table and not in the corresponding minor
mode table.
I say this again: if I don't set
(add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
then everything works as expected.
Can somebody please enlighten me?!
thanks
Uwe Brauer
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta
match-substitute-replacement
14 years, 2 months
Mike Kupfer
The Gnus developers are working with a contributor on a patch, the
specifics of which I'm not clear on. But it appears that the patch
would be simplified by the use of match-substitute-replacement, which
was introduced in Emacs 23.
(defun match-substitute-replacement (replacement
&optional fixedcase literal string subexp)
"Return REPLACEMENT as it will be inserted by `replace-match'.
In other words, all back-references in the form `\\&' and `\\N'
are substituted with actual strings matched by the last search.
Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same
meaning as for `replace-match'."
(let ((match (match-string 0 string)))
(save-match-data
(set-match-data (mapcar (lambda (x)
(if (numberp x)
(- x (match-beginning 0))
x))
(match-data t)))
(replace-match replacement fixedcase literal match subexp))))
Does XEmacs have anything like this? Or should I tell the Gnus folks to
define the function if it's not present?
thanks,
mike
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta
XEmacs equivalent of "[:space:]"?
14 years, 2 months
Raymond Toy
In slime, there's a call like
(skip-chars-forward "[:space:]")
This doesn't seem to be supported on XEmacs. What would be the XEmacs
equivalent?
I think the intent is to skip over any space characters.
Ray
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta
character/event handling in org-mode
14 years, 2 months
Robert Pluim
So I was reading the latest org manual, and got to the section
about speed-keys, tried them out, and discovered they didn't
work in XEmacs since our this-command-keys returns a vector,
not a string. I've come up with the following, but surely
There Is a Better Way?
diff --git a/lisp/org.el b/lisp/org.el
index 7be1443..316f50e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16535,7 +16535,7 @@ overwritten, and the table is not marked as
requiring realignment."
(setq
org-speed-command
(or (cdr (assoc (this-command-keys) org-speed-commands-user))
- (cdr (assoc (this-command-keys) org-speed-commands-default)))))
+ (cdr (assoc (char-to-string (event-to-character (elt
(this-command-keys) 0))) org-speed-commands-default)))))
(cond
((commandp org-speed-command)
(setq this-command org-speed-command)
--
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta