GNU bug report logs - #6679
locate-library does not provide a default when called interactively

Previous Next

Package: emacs;

Reported by: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>

Date: Tue, 20 Jul 2010 13:54:02 UTC

Severity: wishlist

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#6679: closed (locate-library does not provide a default when
 called interactively)
Date: Fri, 03 Apr 2020 12:02:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 03 Apr 2020 15:01:08 +0300
with message-id <83mu7swzgb.fsf <at> gnu.org>
and subject line Re: bug#6679: locate-library does not provide a default when called interactively
has caused the debbugs.gnu.org bug report #6679,
regarding locate-library does not provide a default when called interactively
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
6679: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6679
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: locate-library does not provide a default when called interactively
Date: Tue, 20 Jul 2010 07:53:32 -0600
See bug 6652 for a use case.

Here's a patch -- should the default be included in the prompt, or
is the user expected to know to try M-n?

2010-07-20  Kevin Rodgers  <kevin.d.rodgers <at> gmail.com>

	* subr.el (locate-library):  Provide a default LIBRARY
	when called interactively.


*** emacs-23.2/lisp/subr.el~	Sat Apr  3 16:26:12 2010
--- emacs-23.2/lisp/subr.el	Tue Jul 20 07:38:58 2010
***************
*** 1583,1589 ****
    (interactive (list (completing-read "Locate library: "
  				      (apply-partially
                                         'locate-file-completion-table
!                                        load-path (get-load-suffixes)))
  		     nil nil
  		     t))
    (let ((file (locate-file library
--- 1583,1594 ----
    (interactive (list (completing-read "Locate library: "
  				      (apply-partially
                                         'locate-file-completion-table
!                                        load-path (get-load-suffixes))
! 				      nil nil nil nil
! 				      ;; discard text props from default
! 				      ;; to avoid side-effects (visiting file):
! 				      (substring-no-properties
! 				       (thing-at-point 'filename)))
  		     nil nil
  		     t))
    (let ((file (locate-file library


-- 
Kevin Rodgers
Denver, Colorado, USA



[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Štěpán Němec <stepnem <at> gmail.com>
Cc: 6679-done <at> debbugs.gnu.org, kevin.d.rodgers <at> gmail.com,
 6652-done <at> debbugs.gnu.org
Subject: Re: bug#6679: locate-library does not provide a default when called
 interactively
Date: Fri, 03 Apr 2020 15:01:08 +0300
> From: Štěpán Němec
>  <stepnem <at> gmail.com>
> Date: Sat, 28 Mar 2020 22:59:44 +0100
> Cc: 6679 <at> debbugs.gnu.org
> 
> On Tue, 20 Jul 2010 21:14:09 -0600
> Kevin Rodgers wrote:
> 
> > Assuming that complexity is justified, it ought to be factored into a
> > read-library-name utility that both find-library and locate-library use.
> 
> The first part has since happened (`read-library-name'), all that is
> needed is the latter. Patch attached.
> 
> > `C-h a -library\'' returns apropos-library and load-library in addition to
> > find-library and locate-library, but it's not clear to me that they would
> > benefit from a default.
> 
> The patch also handles `load-library'. The set of arguments/completions
> expected/provided by `apropos-library' is slightly different and
> requires other validation, so `read-library-name' wouldn't really help
> there.

Thanks, pushed to the master branch.


This bug report was last modified 5 years and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.