* bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong.
@ 2012-03-24 6:52 Thierry Volpiatto
2012-03-24 12:47 ` Thierry Volpiatto
2012-03-24 13:47 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: Thierry Volpiatto @ 2012-03-24 6:52 UTC (permalink / raw)
To: 11084
Hi,
it seem completion in grep-read-files is wrong for the default arg.
It use (mapcar 'car grep-files-aliases) where it should use the cdr.
Thus it clash with the grep-files-history.
This patch try to fix this:
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -855,16 +855,17 @@
default-extension
(car grep-files-history)
(car (car grep-files-aliases))))
+ (def-lst (delete-dups
+ (delq nil (append (list default default-alias default-extension)
+ (mapcar 'cdr grep-files-aliases)))))
(files (completing-read
(concat "Search for \"" regexp
"\" in files"
(if default (concat " (default " default ")"))
": ")
- 'read-file-name-internal
+ (append def-lst (all-completions "" 'read-file-name-internal))
nil nil nil 'grep-files-history
- (delete-dups
- (delq nil (append (list default default-alias default-extension)
- (mapcar 'car grep-files-aliases)))))))
+ default)))
(and files
(or (cdr (assoc files grep-files-aliases))
files))))
--8<---------------cut here---------------end--------------->8---
In GNU Emacs 24.0.94.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2012-03-23 on thierry-MM061
Windowing system distributor `The X.Org Foundation', version 11.0.11004000
Configured using:
`configure '--with-x-toolkit=lucid' '--without-rsvg' '--without-gconf'
'--with-wide-int''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: fr_FR.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect:
display-battery-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
auto-image-file-mode: t
show-paren-mode: t
display-time-mode: t
savehist-mode: t
minibuffer-depth-indicate-mode: t
eldoc-mode: t
diff-auto-refine-mode: t
helm-dired-mode: Enable helm completion in Dired functions.
Bindings affected are C, R, S, H.
This is deprecated for Emacs24+ users, use `helm-mode' instead.
shell-dirtrack-mode: t
tooltip-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> C-x c q <tab>
<down> <down> <return> <backspace> <backspace> <backspace>
* SPC l i s p / p r o g m o e <backspace> d s <backspace>
e s / g r e p . e l SPC M-( g r e p - r e a d - f i
l e s <right> : SPC M a k e SPC i t s SPC c o m p l
e t i n g - r e a d <left> <left> <left> <left> <left>
<left> <left> <left> <left> <left> <left> <left> <left>
<left> <left> <left> <left> <left> <left> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <left> <left> <left> <left>
<left> <left> <left> <left> <left> <left> <left> <left>
<left> <left> <left> <left> <left> <left> <left> <left>
<backspace> <backspace> <backspace> <backspace> F i
x <right> c o m p l e t i o n SPC o n SPC D E F SPC
a r g SPC i n SPC C-e . C-c C-c C-x c q <tab> <return>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n M-w C-< <C-M-up> <C-M-up> <C-M-up> <C-M-up>
<C-M-up> <C-M-up> <C-M-up> <C-M-up> <C-M-up> <C-M-up>
<C-M-down> <C-M-down> <C-M-down> <C-M-down> <C-M-down>
<C-M-down> <C-M-down> <C-M-down> C-x C-² <up> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <left> C-M-SPC M-w <down> <down>
<down> <down> <down> M-x r e p o r <return>
Recent messages:
(No changes need to be saved)
Edit the message and hit C-c C-c to accept it.
Saving file /tmp/xhg-qrefresh313484jL...
Wrote /tmp/xhg-qrefresh313484jL
Mark set
Saved text from "diff --git a/lisp/progmodes/grep.el b/li"
Mark set
Load-path shadows:
~/elisp/org-active/contrib/lisp/org-eshell hides /usr/local/share/emacs/24.0.94/lisp/org/org-eshell
~/elisp/org-active/contrib/lisp/org-odt hides /usr/local/share/emacs/24.0.94/lisp/org/org-odt
~/elisp/org-active/contrib/lisp/org-lparse hides /usr/local/share/emacs/24.0.94/lisp/org/org-lparse
~/elisp/emms/lisp/tq hides /usr/local/share/emacs/24.0.94/lisp/emacs-lisp/tq
Features:
(shadow emacsbug cl-specs edebug find-dired ido vc-git xgit-log-edit
dvc-bookmarks xgit-dvc xgit xgit-annotate dvc-annotate xgit-log tla
smerge-mode dvc-state dvc-config diff dvc-cmenu dvc-about dvc-version
dvc-revlist mailalias smtpmail sendmail newcomment epa-mail find-func
time-stamp gnus-gravatar gravatar smiley gnus-cite mail-extr qp
gnus-bcklg gnus-ml nndraft nnmh utf-7 nnimap utf7 nnml nnfolder netrc
gnutls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-cache gnus-dired nnir network-stream starttls url-http tls url-auth
url-gw cal-iso animate tabify org-table xhg-dvc bzr-core xdarcs-core
xgit-core xmtn-minimal naquadah-theme em-unix em-script em-prompt em-ls
em-hist em-pred em-glob em-dirs em-cmpl em-basic esh-opt em-banner
em-alias esh-var esh-io esh-cmd esh-ext esh-proc esh-groups eshell
esh-module esh-mode align-let server battery undo-tree
slime-xref-browser slime-banner slime-tramp slime-asdf slime-fancy
slime-fontifying-fu slime-package-fu slime-references slime-scratch
slime-presentations slime-fuzzy slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-parse slime-repl image-file
newsticker newst-treeview tree-widget newst-plainview newst-reader
newst-ticker newst-backend xdvi-search preview-latex pcomplete-extension
em-term term ehelp electric pdbtrack whitespace paren time mime-w3m mime
eword-decode mel path-util mime-parse std11 luna mime-def mcharset
mcs-20 mcs-e20 pces pces-e20 pces-20 broken pcustom poe w3m-load avoid
help-mode view savehist gnus-async nntp markdown-mode org-google-weather
google-weather url-cache googlecl google-maps google-maps-static
google-maps-geocode google-maps-base json simple-call-tree
el-expectations el-mock csv2org iedit rect zop-to-char mule-util alist
pym static apel-ver product elscreen smallurl mm-url rectangle-utils
tv-utils pcvs pcvs-parse pcvs-info pcvs-defs pcvs-util autodoc mb-depth
ioccur cl-info slime hyperspec slime-autoloads ledger-config ledger
esh-arg esh-util tex-site auto-loads esh-toggle flymake eldoc-eval eldoc
no-word regex-tool dired-extension emms-mpd-config emms-playlist-limit
emms-volume emms-volume-amixer emms-i18n emms-history emms-score
emms-stream-info emms-metaplaylist-mode emms-bookmarks
emms-lastfm-client emms-lastfm-scrobbler parse-time emms-cue
emms-mode-line-icon emms-browser sort emms-playlist-sort
emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time
emms-lyrics emms-url hl-line emms-tag-editor emms-mark emms-mode-line
emms-cache emms-info-ogginfo emms-info-mp3info emms-playlist-mode
emms-player-vlc emms-player-mplayer emms-info emms-streams later-do
emms-source-playlist emms-source-file emms-player-simple emms-setup emms
emms-compat dvc-init bzr-gnus tla-gnus xgit-gnus xhg-gnus gnus-art mm-uu
mml2015 mm-view mml-smime smime dig gnus-sum nnoo gnus-group gnus-undo
nnmail mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win
gnus gnus-ems nnheader dvc-gnus tla-core tla-autoconf tla-defs dvc-log
vc vc-dispatcher add-log ediff-merg ediff-diff ediff-wind ediff-help
ediff-util ediff-mult ediff-init ediff dvc-autoloads htmlize-hack
htmlize muse-colors muse-docbook muse-texinfo texnfo-upd texinfo
muse-latex muse-html muse-xml-common muse-wiki cus-edit cus-start
cus-load muse-publish muse-project muse-protocols muse-regexps muse
muse-nested-tags muse-mode muse-autoloads org-config-thierry ob-sh
org-crypt cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew
holidays hol-loaddefs vc-hg org-wl org-w3m org-vm org-rmail org-mhe
org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp
org-exp-blocks org-info org-gnus org-docview org-bibtex bibtex org-bbdb
org-agenda appt diary-lib diary-loaddefs org-annotation-helper
org-capture org-mks remember org-remember org-datetree config-w3m w3m
doc-view jka-compr image-mode timezone w3m-hist w3m-fb w3m-ems wid-edit
w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util addressbook-bookmark
message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils
mailheader firefox-protocol bookmark-uzbl-handler
bookmark-firefox-handler bookmark-extensions bookmark pp
init-helm-thierry helm-ipython ipython python-mode info-look executable
helm-delicious helm-mercurial xhg xhg-annotate xhg-mq xhg-log xhg-core
dvc-diff uniquify dvc-fileinfo dvc-unified dvc-tips diff-mode dvc-core
dvc-lisp dvc-buffers dvc-ui dvc-register dvc-utils dvc-emacs ewoc
dvc-defs dvc-site helm-config helm-descbinds helm-call-tree yaoddmuse
skeleton sgml-mode helm-emms helm-bbdb helm-gentoo helm-apt helm-bmkext
helm-firefox helm-w3m helm-elscreen helm-match-plugin helm-help
helm-misc edmacro kmacro helm-sys helm-font helm-color helm-man
helm-info helm-org org ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table
org-footnote org-src ob-comint ob-keys ob ob-eval org-pcomplete org-list
org-faces org-compat org-entities org-macs noutline outline cal-menu
calendar cal-loaddefs helm-bookmark helm-imenu helm-adaptative helm-tags
helm-eval helm-command helm-ring helm-mode helm-grep grep helm-eshell
helm-regexp helm-elisp helm-locate helm-files image-dired tramp
tramp-compat shell pcomplete format-spec tramp-loaddefs dired-x
dired-aux ffap thingatpt helm-external helm-net browse-url xml url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-util url-parse url-vars mailcap helm-buffers rx helm-plugin
helm-utils dired compile comint regexp-opt ansi-color ring helm warnings
epa-file epa derived epg epg-config auth-source eieio byte-opt bytecomp
byte-compile cconv macroexp assoc gnus-util time-date mm-util mail-prsvr
password-cache usage-memo eev-thierry iterator eev-all eev-mini-steps
eev-browse-url eev-langs eev-compose eev-glyphs disp-table eev-insert
eev-steps eev-bounded eev easy-mmode advice help-fns advice-preload cl
w3m-wget info easymenu tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting x-toolkit x multi-tty emacs)
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong.
2012-03-24 6:52 bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong Thierry Volpiatto
@ 2012-03-24 12:47 ` Thierry Volpiatto
2012-03-24 13:47 ` Stefan Monnier
1 sibling, 0 replies; 5+ messages in thread
From: Thierry Volpiatto @ 2012-03-24 12:47 UTC (permalink / raw)
To: 11084
Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
> Hi,
> it seem completion in grep-read-files is wrong for the default arg.
> It use (mapcar 'car grep-files-aliases) where it should use the cdr.
My bad, this is wrong the car should be used.
So here the patch:
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -855,16 +855,17 @@
default-extension
(car grep-files-history)
(car (car grep-files-aliases))))
+ (def-lst (delete-dups
+ (delq nil (append (list default default-alias default-extension)
+ (mapcar 'car grep-files-aliases)))))
(files (completing-read
(concat "Search for \"" regexp
"\" in files"
(if default (concat " (default " default ")"))
": ")
- 'read-file-name-internal
+ (append def-lst (all-completions "" 'read-file-name-internal))
nil nil nil 'grep-files-history
- (delete-dups
- (delq nil (append (list default default-alias default-extension)
- (mapcar 'car grep-files-aliases)))))))
+ default)))
(and files
(or (cdr (assoc files grep-files-aliases))
files))))
--8<---------------cut here---------------end--------------->8---
Not using a list as DEF arg for completing-read is better.
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong.
2012-03-24 6:52 bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong Thierry Volpiatto
2012-03-24 12:47 ` Thierry Volpiatto
@ 2012-03-24 13:47 ` Stefan Monnier
2012-03-24 14:48 ` Thierry Volpiatto
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-03-24 13:47 UTC (permalink / raw)
To: Thierry Volpiatto; +Cc: 11084
> it seem completion in grep-read-files is wrong for the default arg.
Can you explain why you think so? What's the symptom?
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong.
2012-03-24 13:47 ` Stefan Monnier
@ 2012-03-24 14:48 ` Thierry Volpiatto
2012-03-24 18:21 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Thierry Volpiatto @ 2012-03-24 14:48 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 11084
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> it seem completion in grep-read-files is wrong for the default arg.
>
> Can you explain why you think so? What's the symptom?
I didn't realize that giving a list as default arg of completing-read is
a feature, though not documented in manual, only in docstring.
I worked on this to fix this issue:
https://github.com/emacs-helm/helm/issues/22
So now it is fixed and handled in helm.
Sorry for the noise I think you can close this bug (which is not :-))
Thanks.
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong.
2012-03-24 14:48 ` Thierry Volpiatto
@ 2012-03-24 18:21 ` Stefan Monnier
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2012-03-24 18:21 UTC (permalink / raw)
To: Thierry Volpiatto; +Cc: 11084-done
>>> it seem completion in grep-read-files is wrong for the default arg.
>> Can you explain why you think so? What's the symptom?
> I didn't realize that giving a list as default arg of completing-read is
> a feature, though not documented in manual, only in docstring.
> I worked on this to fix this issue:
> https://github.com/emacs-helm/helm/issues/22
> So now it is fixed and handled in helm.
> Sorry for the noise I think you can close this bug (which is not :-))
OK, thanks [ Note that to close it, you just need to send your reply to
<bugnb>-done@debbugs.gnu.org instead of <bugnb>@debbugs.gnu.org].
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-24 18:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24 6:52 bug#11084: 24.0.94; [PATCH] Completion on DEF arg in grep-read-files is wrong Thierry Volpiatto
2012-03-24 12:47 ` Thierry Volpiatto
2012-03-24 13:47 ` Stefan Monnier
2012-03-24 14:48 ` Thierry Volpiatto
2012-03-24 18:21 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.