From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: FW: patch to fill overlong lines in `describe-key' Date: Sun, 10 Feb 2008 23:48:07 -0800 Message-ID: <000e01c86c82$71166320$7051908d@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000F_01C86C3F.62F32320" X-Trace: ger.gmane.org 1202717382 11770 80.91.229.12 (11 Feb 2008 08:09:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Feb 2008 08:09:42 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 11 09:10:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JOTjn-0004Li-7C for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 09:10:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOTjJ-0000tv-Fa for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 03:09:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOTjD-0000tq-Ma for emacs-devel@gnu.org; Mon, 11 Feb 2008 03:09:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOTjB-0000td-6n for emacs-devel@gnu.org; Mon, 11 Feb 2008 03:09:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOTjB-0000ta-1S for emacs-devel@gnu.org; Mon, 11 Feb 2008 03:09:25 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JOTjA-00016U-FS for emacs-devel@gnu.org; Mon, 11 Feb 2008 03:09:24 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOTQ1-0000pa-3i for emacs-devel@gnu.org; Mon, 11 Feb 2008 02:49:37 -0500 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m1B7nZcv015117 for ; Mon, 11 Feb 2008 01:49:35 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1ALBdvY011745 for ; Mon, 11 Feb 2008 00:49:34 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3569090451202716087; Sun, 10 Feb 2008 23:48:07 -0800 Original-Received: from dradamslap1 (/141.144.81.112) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 10 Feb 2008 23:48:07 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AchsgnDhl4RcXaN+Q3Oa4glNqsq3Dg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by mx20.gnu.org: Linux 2.4-2.6 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88729 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C86C3F.62F32320 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Resending. No response, and patch apparently was never applied. --------------------- From: Drew Adams Sent: Thursday, January 03, 2008 12:00 PM The first few lines output by `describe-key' can be overly long. Example: runs the command icicle-candidate-set-dired-marked-save-more which is an interactive compiled Lisp function in `icicles-cmd.el'. It is bound to C-), . (icicle-candidate-set-dired-marked-save-more &optional ARG) The code currently attempts to deal with this by hard-coding a newline before "which is", but that doesn't cut the mustard. The same problem can occur in some subsequent lines, because of embedded calls to `describe-function-1'. The attached patches fill the text of such occurrences as separate paragraphs. Example: runs the command icicle-candidate-set-dired-marked-save-more, which is an interactive compiled Lisp function in `icicles-cmd.el'. It is bound to C-), . (icicle-candidate-set-dired-marked-save-more &optional ARG) I also added a comma (,) before "which" in several places where it introduces an independent clause (see above for an example). I tested a similar patch against the 22.1 release code. Please try this out with the latest CVS code. There are several different cases to try, including mouse-2 remapping. Let me know if you find a case where it doesn't DTRT. ------=_NextPart_000_000F_01C86C3F.62F32320 Content-Type: application/octet-stream; name="help-2008-01-02.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="help-2008-01-02.patch" diff -c help-CVS-2008-01-02.el help-patched-2008-01-02.el=0A= *** help-CVS-2008-01-02.el Wed Jan 2 15:19:54 2008=0A= --- help-patched-2008-01-02.el Thu Jan 3 10:55:58 2008=0A= ***************=0A= *** 657,691 ****=0A= (cursor-in-echo-area t)=0A= saved-yank-menu)=0A= (unwind-protect=0A= ! (let (key)=0A= ! ;; If yank-menu is empty, populate it temporarily, so that=0A= ! ;; "Select and Paste" menu can generate a complete event.=0A= ! (when (null (cdr yank-menu))=0A= ! (setq saved-yank-menu (copy-sequence yank-menu))=0A= ! (menu-bar-update-yank-menu "(any string)" nil))=0A= ! (setq key (read-key-sequence "Describe key (or click or menu = item): "))=0A= ! (list=0A= ! key=0A= ! (prefix-numeric-value current-prefix-arg)=0A= ! ;; If KEY is a down-event, read and include the=0A= ! ;; corresponding up-event. Note that there are also=0A= ! ;; down-events on scroll bars and mode lines: the actual=0A= ! ;; event then is in the second element of the vector.=0A= ! (and (vectorp key)=0A= ! (let ((last-idx (1- (length key))))=0A= ! (and (eventp (aref key last-idx))=0A= ! (memq 'down (event-modifiers (aref key last-idx)))))=0A= ! (or (and (eventp (aref key 0))=0A= ! (memq 'down (event-modifiers (aref key 0)))=0A= ! ;; However, for the C-down-mouse-2 popup=0A= ! ;; menu, there is no subsequent up-event. In=0A= ! ;; this case, the up-event is the next=0A= ! ;; element in the supplied vector.=0A= ! (=3D (length key) 1))=0A= ! (and (> (length key) 1)=0A= ! (eventp (aref key 1))=0A= ! (memq 'down (event-modifiers (aref key 1)))))=0A= ! (read-event))))=0A= ;; Put yank-menu back as it was, if we changed it.=0A= (when saved-yank-menu=0A= (setq yank-menu (copy-sequence saved-yank-menu))=0A= --- 657,691 ----=0A= (cursor-in-echo-area t)=0A= saved-yank-menu)=0A= (unwind-protect=0A= ! (let (key)=0A= ! ;; If yank-menu is empty, populate it temporarily, so that=0A= ! ;; "Select and Paste" menu can generate a complete event.=0A= ! (when (null (cdr yank-menu))=0A= ! (setq saved-yank-menu (copy-sequence yank-menu))=0A= ! (menu-bar-update-yank-menu "(any string)" nil))=0A= ! (setq key (read-key-sequence "Describe key (or click or = menu item): "))=0A= ! (list=0A= ! key=0A= ! (prefix-numeric-value current-prefix-arg)=0A= ! ;; If KEY is a down-event, read and include the=0A= ! ;; corresponding up-event. Note that there are also=0A= ! ;; down-events on scroll bars and mode lines: the actual=0A= ! ;; event then is in the second element of the vector.=0A= ! (and (vectorp key)=0A= ! (let ((last-idx (1- (length key))))=0A= ! (and (eventp (aref key last-idx))=0A= ! (memq 'down (event-modifiers (aref key = last-idx)))))=0A= ! (or (and (eventp (aref key 0))=0A= ! (memq 'down (event-modifiers (aref key 0)))=0A= ! ;; However, for the C-down-mouse-2 popup=0A= ! ;; menu, there is no subsequent up-event. = In=0A= ! ;; this case, the up-event is the next=0A= ! ;; element in the supplied vector.=0A= ! (=3D (length key) 1))=0A= ! (and (> (length key) 1)=0A= ! (eventp (aref key 1))=0A= ! (memq 'down (event-modifiers (aref key = 1)))))=0A= ! (read-event))))=0A= ;; Put yank-menu back as it was, if we changed it.=0A= (when saved-yank-menu=0A= (setq yank-menu (copy-sequence saved-yank-menu))=0A= ***************=0A= *** 745,752 ****=0A= (with-help-window (help-buffer)=0A= (princ (help-key-description key untranslated))=0A= (princ (format "\=0A= ! %s runs the command %S=0A= ! which is "=0A= mouse-msg defn))=0A= (describe-function-1 defn)=0A= (when up-event=0A= --- 745,751 ----=0A= (with-help-window (help-buffer)=0A= (princ (help-key-description key untranslated))=0A= (princ (format "\=0A= ! %s runs the command %S, which is "=0A= mouse-msg defn))=0A= (describe-function-1 defn)=0A= (when up-event=0A= ***************=0A= *** 757,780 ****=0A= =0A= ----------------- up-event %s----------------=0A= =0A= ! <%S>%s%s runs the command %S=0A= ! which is "=0A= ! (if mouse-1-tricky "(short click) " "")=0A= ! ev-type mouse-msg=0A= ! (if mouse-1-remapped=0A= ! " is remapped to \nwhich" "")=0A= ! defn-up))=0A= ! (describe-function-1 defn-up))=0A= ! (unless (or (null defn-up-tricky)=0A= ! (integerp defn-up-tricky)=0A= ! (eq defn-up-tricky 'undefined))=0A= ! (princ (format "=0A= =0A= ----------------- up-event (long click) ----------------=0A= =0A= Pressing <%S>%s for longer than %d milli-seconds=0A= ! runs the command %S=0A= ! which is "=0A= ev-type mouse-msg=0A= mouse-1-click-follows-link=0A= defn-up-tricky))=0A= --- 756,777 ----=0A= =0A= ----------------- up-event %s----------------=0A= =0A= ! <%S>%s%s runs the command %S, which is "=0A= ! (if mouse-1-tricky "(short click) " "")=0A= ! ev-type mouse-msg=0A= ! (if mouse-1-remapped=0A= ! " is remapped to , which" "")=0A= ! defn-up))=0A= ! (describe-function-1 defn-up))=0A= ! (unless (or (null defn-up-tricky)=0A= ! (integerp defn-up-tricky)=0A= ! (eq defn-up-tricky 'undefined))=0A= ! (princ (format "=0A= =0A= ----------------- up-event (long click) ----------------=0A= =0A= Pressing <%S>%s for longer than %d milli-seconds=0A= ! runs the command %S, which is "=0A= ev-type mouse-msg=0A= mouse-1-click-follows-link=0A= defn-up-tricky))=0A= =0A= ------=_NextPart_000_000F_01C86C3F.62F32320 Content-Type: application/octet-stream; name="help-fns-2007-10-19.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="help-fns-2007-10-19.patch" *** help-fns-CVS-2007-10-19.el Fri Oct 19 10:38:10 2007=0A= --- help-fns-patched-2007-10-19.el Fri Oct 19 11:39:10 2007=0A= ***************=0A= *** 38,45 ****=0A= ;; Functions=0A= =0A= ;;;###autoload=0A= ! (defun describe-function (function)=0A= ! "Display the full documentation of FUNCTION (a symbol)."=0A= (interactive=0A= (let ((fn (function-called-at-point))=0A= (enable-recursive-minibuffers t)=0A= --- 38,48 ----=0A= ;; Functions=0A= =0A= ;;;###autoload=0A= ! (defun describe-function (function &optional commandp)=0A= ! "Display the full documentation of FUNCTION (a symbol).=0A= ! FUNCTION names an Emacs Lisp function, possibly a user command.=0A= ! With a prefix arg, candidates are commands (interactive functions).=0A= ! Returns the description that was displayed, as a string."=0A= (interactive=0A= (let ((fn (function-called-at-point))=0A= (enable-recursive-minibuffers t)=0A= ***************=0A= *** 47,58 ****=0A= (setq val (completing-read (if fn=0A= (format "Describe function (default %s): " fn)=0A= "Describe function: ")=0A= ! obarray 'fboundp t nil nil=0A= ! (and fn (symbol-name fn))))=0A= ! (list (if (equal val "")=0A= ! fn (intern val)))))=0A= (if (null function)=0A= (message "You didn't specify a function")=0A= (help-setup-xref (list #'describe-function function) = (interactive-p))=0A= (save-excursion=0A= (with-output-to-temp-buffer (help-buffer)=0A= --- 50,63 ----=0A= (setq val (completing-read (if fn=0A= (format "Describe function (default %s): " fn)=0A= "Describe function: ")=0A= ! obarray (if current-prefix-arg 'commandp 'fboundp)=0A= ! t nil nil (and fn (symbol-name fn))))=0A= ! (list (if (equal val "") fn (intern val))=0A= ! current-prefix-arg)))=0A= (if (null function)=0A= (message "You didn't specify a function")=0A= + (unless (or (not commandp) (commandp function))=0A= + (error "Not a defined Emacs command (interactive function): = `%s'" function))=0A= (help-setup-xref (list #'describe-function function) = (interactive-p))=0A= (save-excursion=0A= (with-output-to-temp-buffer (help-buffer)=0A= ***************=0A= *** 66,71 ****=0A= --- 71,92 ----=0A= ;; Return the text we displayed.=0A= (buffer-string))))))=0A= =0A= + ;;;###autoload=0A= + (defun describe-command (function)=0A= + "Describe an Emacs command (interactive function).=0A= + Same as using a prefix argument with command `describe-function'."=0A= + (interactive=0A= + (let ((fn (function-called-at-point))=0A= + (enable-recursive-minibuffers t)=0A= + val)=0A= + (setq val (completing-read (if fn=0A= + (format "Describe command (default %s): " fn)=0A= + "Describe command: ")=0A= + obarray 'commandp t nil nil=0A= + (and fn (symbol-name fn))))=0A= + (list (if (equal val "") fn (intern val)))))=0A= + (describe-function function t))=0A= + =0A= (defun help-split-fundoc (docstring def)=0A= "Split a function DOCSTRING into the actual doc and the usage info.=0A= Return (USAGE . DOC) or nil if there's no usage info.=0A= ***************=0A= *** 457,467 ****=0A= 0))=0A= =0A= ;;;###autoload=0A= ! (defun describe-variable (variable &optional buffer frame)=0A= "Display the full documentation of VARIABLE (a symbol).=0A= ! Returns the documentation as a string, also.=0A= If VARIABLE has a buffer-local value in BUFFER or FRAME=0A= ! \(default to the current buffer and current frame),=0A= it is displayed along with the global value."=0A= (interactive=0A= (let ((v (variable-at-point))=0A= --- 478,490 ----=0A= 0))=0A= =0A= ;;;###autoload=0A= ! (defun describe-variable (variable &optional buffer frame optionp)=0A= "Display the full documentation of VARIABLE (a symbol).=0A= ! VARIABLE names an Emacs Lisp variable, possibly a user option.=0A= ! With a prefix argument, candidates are user variables (options) only.=0A= ! Returns the documentation as a string.=0A= If VARIABLE has a buffer-local value in BUFFER or FRAME=0A= ! \(default to the current buffer and current frame), then=0A= it is displayed along with the global value."=0A= (interactive=0A= (let ((v (variable-at-point))=0A= ***************=0A= *** 472,488 ****=0A= "Describe variable (default %s): " v)=0A= "Describe variable: ")=0A= obarray=0A= ! '(lambda (vv)=0A= ! (or (boundp vv)=0A= ! (get vv 'variable-documentation)))=0A= t nil nil=0A= (if (symbolp v) (symbol-name v))))=0A= ! (list (if (equal val "")=0A= ! v (intern val)))))=0A= (unless (buffer-live-p buffer) (setq buffer (current-buffer)))=0A= (unless (frame-live-p frame) (setq frame (selected-frame)))=0A= (if (not (symbolp variable))=0A= (message "You did not specify a variable")=0A= (save-excursion=0A= (let ((valvoid (not (with-current-buffer buffer (boundp = variable))))=0A= val val-start-pos locus)=0A= --- 495,516 ----=0A= "Describe variable (default %s): " v)=0A= "Describe variable: ")=0A= obarray=0A= ! (if current-prefix-arg=0A= ! (lambda (vv) (user-variable-p vv))=0A= ! (lambda (vv)=0A= ! (or (boundp vv) (get vv = 'variable-documentation))))=0A= t nil nil=0A= (if (symbolp v) (symbol-name v))))=0A= ! (list (if (equal val "") v (intern val))=0A= ! nil=0A= ! nil=0A= ! current-prefix-arg)))=0A= (unless (buffer-live-p buffer) (setq buffer (current-buffer)))=0A= (unless (frame-live-p frame) (setq frame (selected-frame)))=0A= (if (not (symbolp variable))=0A= (message "You did not specify a variable")=0A= + (unless (or (not optionp) (user-variable-p variable))=0A= + (error "Not a defined Emacs user option: `%s'" variable))=0A= (save-excursion=0A= (let ((valvoid (not (with-current-buffer buffer (boundp = variable))))=0A= val val-start-pos locus)=0A= ***************=0A= *** 662,667 ****=0A= --- 690,713 ----=0A= ;; Return the text we displayed.=0A= (buffer-string))))))))=0A= =0A= + ;;;###autoload=0A= + (defun describe-option (variable &optional buffer frame)=0A= + "Describe an Emacs user variable (option).=0A= + Same as using a prefix argument with command `describe-variable'."=0A= + (interactive=0A= + (let ((v (variable-at-point))=0A= + (enable-recursive-minibuffers t)=0A= + val)=0A= + (setq val (completing-read (if (symbolp v)=0A= + (format "Describe option (default %s): " v)=0A= + "Describe option: ")=0A= + obarray 'user-variable-p t nil nil=0A= + (if (symbolp v) (symbol-name v))))=0A= + (list (if (equal val "") v (intern val))=0A= + nil=0A= + nil=0A= + current-prefix-arg)))=0A= + (describe-variable variable buffer frame t))=0A= =0A= ;;;###autoload=0A= (defun describe-syntax (&optional buffer)=0A= =0A= Diff finished. Fri Oct 19 12:02:43 2007=0A= ------=_NextPart_000_000F_01C86C3F.62F32320 Content-Type: text/plain; name="ATT00066.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ATT00066.txt" _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_NextPart_000_000F_01C86C3F.62F32320--