From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: What standard library to use to provide settings editing to user? Date: Thu, 28 Feb 2013 20:52:48 +0200 Organization: Oleksandr Gavenko , http://gavenkoa.users.sf.net Message-ID: <87ehg0feyn.fsf@gavenkoa.example.com> References: <87ip5mvjw6.fsf@gavenkoa.example.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362077608 22506 80.91.229.3 (28 Feb 2013 18:53:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2013 18:53:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 19:53:49 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UB8bw-0006Jg-GC for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Feb 2013 19:53:44 +0100 Original-Received: from localhost ([::1]:53778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UB8bb-0000F1-In for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Feb 2013 13:53:23 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UB8bP-0000Ew-Hy for help-gnu-emacs@gnu.org; Thu, 28 Feb 2013 13:53:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UB8bK-0003hM-8g for help-gnu-emacs@gnu.org; Thu, 28 Feb 2013 13:53:11 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UB8bJ-0003h1-Tj for help-gnu-emacs@gnu.org; Thu, 28 Feb 2013 13:53:06 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UB8bd-00062E-Cz for help-gnu-emacs@gnu.org; Thu, 28 Feb 2013 19:53:25 +0100 Original-Received: from 37.229.4.200 ([37.229.4.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Feb 2013 19:53:25 +0100 Original-Received: from gavenkoa by 37.229.4.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Feb 2013 19:53:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 37.229.4.200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:IS+SGalRYSkS2kVMCDmtj9rF+DE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89301 Archived-At: On 2013-02-20, Oleksandr Gavenko wrote: > I write blogging mode and want to provide ability to users to list and edit > connection settings. > > As I use external program to do actual authentication and network jobs so I > don't use Emacs variables for storing settings. > > External process send list of parameters and their values. I should show them > to user and return user modifications back to external process. > > Every parameter have a name and string value (possibly multi-line). > > What libraries or code examples are usable for solving such task? Firstly I try use low level API: (info "(elisp) Text Properties") but stuck with: (info "(elisp) Sticky Properties") when I need to code boundary between editable and read-only areas... After looking how is work "M-x customize-mode" I found: (info "(widget)") Some practice and I get working code. Most useful feature is 'widget-value' function. But some parts are very hard to understand. For example how can I make custom face in widget-insert? I use such code, it work but I don't know if this right usage: (put-text-property 0 (length blog4y*conf-header-id) 'face 'bold blog4y*conf-header-id) (widget-insert blog4y*conf-header-id id "\n\n") -- Best regards!