unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 18687@debbugs.gnu.org
Cc: mah@everybody.org, mediawiki-el@lists.everybody.org,
	tim@tim-landscheidt.de
Subject: bug#18687: mw 0.1: modular MediaWiki interface for Emacs
Date: Sat, 11 Oct 2014 10:55:56 +0000	[thread overview]
Message-ID: <87r3ye3mf7.fsf@violet.siamics.net> (raw)
In-Reply-To: <87oatpkof7.fsf@passepartout.tim-landscheidt.de> (Tim Landscheidt's message of "Mon, 06 Oct 2014 19:07:08 +0000")

Package:  emacs
Severity: wishlist
X-Debbugs-Cc: mediawiki-el@lists.everybody.org, tim@tim-landscheidt.de, mah@everybody.org

	[This is a follow-up to a recent discussion at the mediawiki-el@
	mailing list.  Cc: to the list and, just in case it fails, both
	to the original poster and to the mediawiki.el maintainer.]

	I hereby request that my MW modular MediaWiki interface for
	Emacs [1] be reviewed for inclusion into Emacs.

	The interface is inspired by the mediawiki.el [2] module by Mark
	A. Hershberger et al, but /should not/ contain any actual code
	from there, and is not intended to be compatible.  Still, I’ve
	worked with mediawiki.el for quite some time, and at the least
	vc-mw-buffer-checkin looks a bit similar to mediawiki-save-page.
	Thus, it makes sense to check the rest of the code for any
	(non-trivial) code that might accidently got written close
	enough to that of mediawiki.el to require a rewrite for
	copyright reasons.

[1] http://am-1.org/~ivan/packages-el/mw-0.1.tar
    http://am-1.org/~ivan/packages-el/mw-0.1.tar.sig
[2] https://launchpad.net/mediawiki-el


    Features

	The package already allows for the use of the usual vc.el
	C-x v v (IOW, “checkin”), C-x v l (vc-print-log), and
	M-x vc-ediff (which could then be used to check a revision out)
	commands on buffers (files) associated with MediaWiki pages.
	Contrary to mediawiki.el, however, this package provides /no/
	markup-specific “mode” of any kind.

	The buffer (file) to page associations will be preserved in the
	.emacs.desktop file (if one is used.)

	The M-x mw-auth-log-in command uses auth-source-search.
	(Although that code should be reviewed for correctness, as I’m
	not familiar with auth-source.el at all.)

	Assuming some effort on the part of the user, M-x mw-eww-preview
	will show a “preview” of the current buffer’s markup
	(as rendered via the MediaWiki API ‘parse’ call) using EWW.


    Composition

	The interface is comprised of the following individual modules
	(in the dependency order):

	• mw-api – basic API functions, including mw-api-call,
	  mw-api-adjoin, (as of yet undocumented) mw-api-get, and
	  mw-api-token;

	• mw-buffer.el

	  – the mw-buffer-endpoint-uri, mw-buffer-page-id,
	    mw-buffer-page-revision, and mw-buffer-page-title
	    buffer-local variables, associating the buffer with a
	    MediaWiki instance, and possibly a specific page there;

	  – mw-buffer-associate-endpoint, mw-buffer-associate-page
	    commands to establish such a relation;

	  – the mw-buffer-page-query function to prepare an API query
	    parameter to select that page (or to adjoin one to the set
	    given);

	• mw-info.el – the mw-info-describe-user, mw-info-describe-page
	  commands; and the (as of yet undocumented) mw-info-describe-1
	  function, also used by mw-auth-log-in;

	• mw-auth.el – mw-auth-log-in, which authenticates the user on
	  the given (via mw-buffer-endpoint-uri) MediaWiki instance;

	• vc-mw.el – (very incomplete) MediaWiki vc.el support; provides
	  just enough internals for C-x v v, C-x v l, and M-x vc-ediff;

	• mw-eww.el – mw-eww-preview to preview the current buffer (as
	  rendered via the MediaWiki API ‘parse’ call) in the associated
	  EWW buffer; at the very least, it will require the patch from
	  http://debbugs.gnu.org/16211; (I have only tested it with my
	  own private version of EWW as of yet, however.)

	The package comes with a “Quick-start guide” for its README.
	The Russian version is also available from [3].  (The page also
	served as a test for this code.)

[3] https://ru.wikibooks.org/wiki/?curid=14719


    Bugs

	The known deficiencies are as follows (in no particular order.)

	• The interface does not provide any kind of ‘mediawiki-mode’.
	  It may be possible to re-use mediawiki-mode from [2].
	  (Personally, I just use fundamental-mode for now myself.)

	• The mw-buffer-endpoint-uri variable is /not/ declared “safe.”
	  The use of vc.el facilities may result in unexpected API
	  calls, so it makes sense to leave it to the user as to what
	  specific MediaWiki API endpoint URIs to consider “trusted.”

	  There may also be a customizable list of “trusted” URIs, also
	  usable for the mw-buffer-associate-endpoint completion (should
	  there be one.)

	• The mw-auth-log-in command currently writes the password to
	  the *MediaWiki* buffer in the plain, which is intended mainly
	  as a debugging aid.  The user should take care to kill the
	  buffer when not needed.

	• The code which is intended to obtain edit tokens may be broken
	  (it may be related to some recent MediaWiki changes.)  If the
	  regular vc.el facilities fail to get a suitable edit token,
	  try evaluating (M-:) the following form in the page’s buffer:

	    (mw-api-call mw-buffer-endpoint-uri
	                 "query" '(("meta" . "tokens") ("type" . "csrf")))

	  (The README suggest another form, which, however, gets the
	  token /as already seen/ in the MediaWiki responses.  It does
	  not actually /request/ the token from MediaWiki.)

	• After a new MediaWiki page has been created via vc.el, it’s
	  necessary to re-run M-x mw-buffer-associate-page to update the
	  respective buffer-local variables.

	• There’s ought to be a function suitable for find-file-hook
	  that will associate the buffer with the page title (or page
	  identifier) derived from the filename.

	• See README; also check the code itself for the FIXME:
	  comments.

-- 
FSF associate member #7257  np. Returning – Jami Sieber … 3013 B6A0 230E 334A





       reply	other threads:[~2014-10-11 10:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87oatpkof7.fsf@passepartout.tim-landscheidt.de>
2014-10-11 10:55 ` Ivan Shmakov [this message]
2014-10-12  4:47   ` bug#18687: mw 0.1: modular MediaWiki interface for Emacs Stefan Monnier
2014-10-12 10:20     ` Ivan Shmakov
2014-10-14 18:40       ` Stefan Monnier
2014-10-14 20:05         ` Ivan Shmakov
     [not found]         ` <87k342zabt.fsf@violet.siamics.net>
2014-10-14 23:51           ` Stefan Monnier
2014-10-21 16:33             ` Stefan Monnier
2014-10-22 21:35               ` Ivan Shmakov
2014-10-24 18:55                 ` Ivan Shmakov
2014-12-31 12:12                   ` bug#18687: mw: " Ivan Shmakov
2015-01-01 16:06                     ` Stefan Monnier
2015-01-01 16:37                       ` Ivan Shmakov
2015-01-23 14:42                       ` Ivan Shmakov
2015-02-20 17:14                         ` Stefan Monnier
2015-02-20 18:30                           ` Ivan Shmakov
2015-02-20 19:52                             ` Stefan Monnier
2015-01-01 21:03                     ` Ivan Shmakov
2015-02-20  7:09                     ` Ivan Shmakov
2020-02-29 18:39     ` bug#18687: mw 0.1: " Stefan Kangas
2020-02-29 19:55       ` Ivan Shmakov
2020-03-01  1:38         ` Stefan Kangas
2020-03-08 17:52           ` Stefan Monnier
2020-08-04 16:06             ` Stefan Kangas
2020-08-04 16:45               ` Mark A. Hershberger
2020-08-04 16:47                 ` Stefan Kangas
2020-03-02 20:30       ` Mark A. Hershberger
2020-03-11  1:31         ` Stefan Kangas
2014-10-13 17:20   ` Mark A. Hershberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3ye3mf7.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=18687@debbugs.gnu.org \
    --cc=mah@everybody.org \
    --cc=mediawiki-el@lists.everybody.org \
    --cc=tim@tim-landscheidt.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).