lp://staging/~ken-manheimer/emacs/alloutdev
- Get this branch:
- bzr branch lp://staging/~ken-manheimer/emacs/alloutdev
Branch merges
Branch information
Recent revisions
- 102483. By ken manheimer
-
wrap define-minor-mode allout-mode in eval-and-compile, to help demonstrate
this problem:serious problem with byte-compiled function created by define-minor-mode:
i'm extremely perplexed, and blocked, by a problem i'm encountering in
the process of migrating allout-mode minor mode (allout.el) to
`define-minor-mode' . some key substitutions way deep in my code do not
happen if the minor mode was established by a byte-compiled version of
the function, but do happen if the mode definition is explicitly
evaluated.i can even reproduce the problem by wrapping the define-minor-mode in
either `eval-and-compile' or `eval-when-compile' and doing an
`emacs-lisp-byte- compile- and-load' . when byte-compiling and loading
with the eval-when-compile, invoking the mode yields the key
substitutions, as it ought. (of course, the step of loading the
byte-compiled code is irrelevant at that point, because the function
isn't in the byte-compiled code. it's only defined because it was
evaluated during the byte-compile.) with the eval-and-compile, loading
the byte-compiled allout.elc wipes out the key substitutions - they're
no longer in effect. of course, the lack of the function in the
byte-compiled code when using eval-when-compile makes the byte-compiled
code useless, so i have no workaround for the problem, just a weird
demonstration of it.i've tried tracking down the failed key substitutions, by wrapping
define-key with some advice that noted when the key defines happened,
and they do every time the mode is activated, whether or not it's via
the byte-compiled version of the mode function (when defined by
define-minor-mode) . my function which does the key substitutions
(allout-setup-mode- map) uses fset to ensure that the mode map is
properly globally established, so it's already kind of complicated.
i'm also wondering whether i'm just misunderstanding something about
the way define-minor-mode is supposed to work.i would love some help with this - migrating to define-minor-mode is
one of the last things in my allout-mode update, but i've spent way
too much time just tracking down the problem, and am more than
reluctant to try to unravel the interaction between the byte-compiler
and modes defined with define-minor-mode! but i'm completely blocked
by this problem.to see the problem, visit this version of allout.el and start
allout-mode. then emacs-lisp-byte-compile- and-load the code, and
you'll find that \C-a is bound to move-beginning-of-line, as it
normally is - not replaced by allout-beginning- of-line, as it should
be.then change the `eval-and-compile' that's wrapped around the
define-minor-mode allout-mode to `eval-when- compile' , do
emacs-lisp-byte- compile- and-load, and you'll find that \C-a is
properly bound to allout-beginning- of-line. (you can also just
manually evaluate the define-minor-mode - that will also the
keysubsitutions in the keymap immediately.) - 102482. By ken manheimer
-
Migrate allout-mode definition to define-minor-mode, and remove
some accumulated cruft.Note: There's a serious problem which i will elaborate in the next checkin.
(allout-
command- prefix) , (allout-mode-map): Define the variables. (allout-
v18/19- file-var- hack): Remove. Inhibit redundant allout mode activation by desktop-mode, by adding a nil
allout-mode handler to `desktop-minor-mode- handlers' . (define-minor-mode allout-mode): Convert to define-minor-mode. Remove
provisions for re-activation, allout-v18/19- file-var- hack related stuff. - 102481. By ken manheimer
-
(allout-mode), (allout-
encrypt- string) : Describe the problem with caching
of incorrect symmetric-decryption keys. - 102480. By ken manheimer
-
respect epa-file-
encrypt- to, defaulting to it when encrypting, if set, and
adjusting the value (as a file local variable and an active buffer setting)
with the result of epa-select-keys.note the problem with caching of incorrect symmetric decryption keys.
(allout-
toggle- current- subtree- encryption) ,
(allout-toggle- subtree- encryption) : Adjust docstrings to reflect defaulting
policy change.(allout-
encrypt- string) : keymod-cue rather than keypair-mode, which is
interpreted here. Use the epa-passphrase-callback- function, in case the
user is using GnuPG v1. Support saving of the selected keypair recipients
when invoked with a keymode-cue > 4. - 102479. By ken manheimer
-
- replace pgg with epg/epa - working version, with no calls to pgg.
- remove passphrase verifier and hinting.(allout-
passphrase- verifier- handling) , (allout- passphrase- hint-handling) :
No longer used, delete.
(allout-epg-protocol) : Never used and unnecessary, delete. (allout-mode): Adjust docstring to describe changed encryption provisions.
(allout-
toggle- current- subtree- encryption) : Adjust docstring to describe
changed encryption provisions. Change fetch-pass to keymode-cue, for
simpler universal argument interpretation.(allout-
toggle- subtree- encryption) : Adjust docstring to describe
changed encryption provisions. Change fetch-pass to keymode-cue, for
simpler universal argument interpretation. Remove provisions for handling
key type and identity - they'll all be within allout-encrypt- string or
epg/epg or even contained all the way in gpg.(allout-
encrypt- string) : Include keypair-mode argument, for requesting
keypair encryption. Require epa, for recipients handling. Change how
regexp filtering elements are named.(allout-
obtain- passphrase) , (allout- epg-passphrase- callback- function) ,
(allout-make-passphrase -state) , (allout- passphrase- state-passphras e):
Remove, we're not providing passphrase verification and hinting because:
- gpg v1 is required for epg passphrase callback operation, on which
verification and hinting depends
- doing that handling exposes the passphrase to emacs code, which is much
much less secure than leaving all passphrase handling in gpg
- leaving all passphrase handling to gpg removes a lot of complexity from
allout code
- gpg v2 connection to gpg-agent requires no user provisions, so is simpler
and provides some convenience that makes up for the lack of hinting and
verification(allout-
encrypted- key-info) , (allout- update- passphrase- mnemonic- aids),
(allout-get-encryption- passphrase- verifier) , (allout- verify- passphrase) :
Obsolete. - 102478. By ken manheimer
-
partial checking with substantial progress towards epg passphrase
callback arrangements. several reasons to drop the special provisions:- gpg v1 is required for passphrase callback operation - so allout
passphrase hinting and verification requires that
- exposes passphrase to emacs code, which is much much less secure than
sticking with gpg v2 and leaving all passphrase handling in gpg
- leaving all passphrase handling to gpg removes a lot of complexity from
allout code
- gpg v2 connection to gpg-agent requires no user provisions, so is simpler
and provides some convenience that makes up for the lack of hinting and
verificationthis checkin includes a partially developed version of
allout-epg-passphrase- callback- function, with hinting and ready to
implement the passphrase verification. but there's a lot to go there, and
in working through the twisty flow to adjust the verifier and hint string,
etc. not worth it, considering the above trade-offs. - 102477. By ken manheimer
-
Elide passphrase caching provisions in preparation for migration from PGG
to EPA. Doing elisions with ";;PGG " so they can be found and removed when
i'm ready to finalize the transition.(allout-
toggle- current- subtree- encryption) : Mark docstring references to
passphrase cache. (The marker is not effective as a comment within the
docstring, but they purpose is to be found and removed before release, so
tidiness is not necessary.)Conform to changing allout-
encrypt- string call signature. (allout-
encrypt- string) : Remove fetch-pass argument from call signature.
Mark description for removal from docstring.Require 'epa.
Establish not-yet-used epg-context with armoring.
Use epg-protocol as basis for the key description, instead of pgg-scheme or
pgg-default-scheme.Elide all references to target-cache-id, and replace with value of for-key where
appropriate. Elide all uses of fetch-pass.Elide all passphrase cache evictions.
(allout-
obtain- passphrase) : Remove passphrase- cache-related parameters -
cache-id and fetch-pass - from signature and from docstring.Use for-key instead of cache-id in pgg-read-
passphrase. Elide all passphrase cache evictions.
Adjust for allout-
encrypt- string call signature changes. (allout-
create- encryption- passphrase- verifier) : Adjust for
allout-encrypt- string call signature changes. (allout-
verify- passphrase) : Adjust for allout- encrypt- string call signature
changes. - 102476. By ken manheimer
-
(allout-
encrypt- string) : remove pgg version check. (this minimal change is
mostly just fodder to confirm that my 'bzr unbind' will keep incremental
checkins in my local repository, until i'm ready to merge a coherent
collection of changes for release.)
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp://staging/~vcs-imports/emacs/trunk