From d80ac57b32c2cf2b3b86e60a550858c81f214ebc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 1 May 2012 14:47:23 -0400 Subject: [PATCH] * lisp/cus-edit.el (custom-variable-documentation): Simplify with format. --- lisp/ChangeLog | 4 ++++ lisp/cus-edit.el | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cfc40bc01a8..e4c45a23478 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-05-01 Glenn Morris + + * cus-edit.el (custom-variable-documentation): Simplify with format. + 2012-05-01 Aaron S. Hawley Stefan Monnier diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 8198a4594c4..4458bb7b56f 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1,6 +1,6 @@ ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages ;; -;; Copyright (C) 1996-1997, 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1996-1997, 1999-2012 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen ;; Maintainer: FSF @@ -2460,15 +2460,15 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." "Return documentation of VARIABLE for use in Custom buffer. Normally just return the docstring. But if VARIABLE automatically becomes buffer local when set, append a message to that effect." - (if (and (local-variable-if-set-p variable) - (or (not (local-variable-p variable)) - (with-temp-buffer - (local-variable-if-set-p variable)))) - (concat (documentation-property variable 'variable-documentation) + (format "%s%s" (documentation-property variable 'variable-documentation) + (if (and (local-variable-if-set-p variable) + (or (not (local-variable-p variable)) + (with-temp-buffer + (local-variable-if-set-p variable)))) "\n This variable automatically becomes buffer-local when set outside Custom. -However, setting it through Custom sets the default value.") - (documentation-property variable 'variable-documentation))) +However, setting it through Custom sets the default value." + ""))) (define-widget 'custom-variable 'custom "A widget for displaying a Custom variable. -- 2.39.2