From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Vincent_Bela=EFche?= Subject: Patch on org-read-property-name Date: Wed, 22 Jun 2011 22:01:10 +0200 Message-ID: <80hb7h7i0p.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZTc4-00061j-QP for emacs-orgmode@gnu.org; Wed, 22 Jun 2011 16:01:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZTc2-00036S-Kz for emacs-orgmode@gnu.org; Wed, 22 Jun 2011 16:01:24 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:56449 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZTc2-00036L-4J for emacs-orgmode@gnu.org; Wed, 22 Jun 2011 16:01:22 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org mode Cc: =?iso-8859-1?Q?Vincent_Bela=EFche?= --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello, Please find a patch for setting properties. A name is proposed when the pointer is on a property line, the name in that line is set as default. Changelog: ----------------------------------------------------------------------- 2011-06-22 Vincent Bela=EFche * org.el (org-read-property-name): Propose default proerty name value by looking at whether current line is already some property setting. ----------------------------------------------------------------------- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=org.el.diff diff --git a/lisp/org.el b/lisp/org.el index b1edfa3..8318968 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6591,7 +6591,7 @@ in an indirect buffer, in overview mode. You can dive into the tree in that copy, use org-occur and incremental search to find a location. When pressing RET or `Q', the command returns to the original buffer in which the visibility is still unchanged. After RET is will also jump to -the location selected in the indirect buffer and expose the headline +the location selected in the indirect buffer and expose the headline hierarchy above." (interactive "P") (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level)))) @@ -14095,7 +14095,20 @@ This is computed according to `org-property-set-functions-alist'." "Read a property name." (let* ((completion-ignore-case t) (keys (org-buffer-property-keys nil t t)) - (property (org-icompleting-read "Property: " (mapcar 'list keys)))) + (default-prop (save-excursion + (save-match-data + (beginning-of-line) + (and (looking-at "^\\s-*:\\([^:\n]+\\):") + (null (string= (match-string 1) "END")) + (match-string 1))))) + (property (org-icompleting-read + (concat "Property" + (if default-prop (concat " [" default-prop "]") "") + ": ") + (mapcar 'list keys) + nil nil nil nil + default-prop + ))) (if (member property keys) property (or (cdr (assoc (downcase property) @@ -16120,7 +16133,7 @@ sequence appearing also before point. Even though the matchers for math are configurable, this function assumes that \\begin, \\(, \\[, and $$ are always used. Only the single dollar delimiters are skipped when they have been removed by customization. -The return value is nil, or a cons cell with the delimiter and the +The return value is nil, or a cons cell with the delimiter and the position of this delimiter. This function does a reasonably good job, but can locally be fooled by --=-=-=--