* searching elisp on debian/ubuntu
@ 2013-10-25 3:11 Rustom Mody
2013-10-25 9:10 ` Alex Bennée
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Rustom Mody @ 2013-10-25 3:11 UTC (permalink / raw)
To: help-gnu-emacs
[This is more about debian ubuntu than emacs]
When looking for something in elisp on debian/ubuntu there is the nuisance that the files are gzipped. So Ive to do things like
find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
because zgrep unlike grep has no recursive flag
I believe that there is some dpkg/apt flag that says keep the files unzipped.
Anyone know of it?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 3:11 searching elisp on debian/ubuntu Rustom Mody
@ 2013-10-25 9:10 ` Alex Bennée
[not found] ` <mailman.4678.1382692274.10748.help-gnu-emacs@gnu.org>
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2013-10-25 9:10 UTC (permalink / raw)
To: Rustom Mody; +Cc: help-gnu-emacs
rustompmody@gmail.com writes:
> [This is more about debian ubuntu than emacs]
>
> When looking for something in elisp on debian/ubuntu there is the
> nuisance that the files are gzipped. So Ive to do things like
What sort of things are you looking for?
> find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
Everything in your site-lisp should be visible within emacs even if they
are autoloaded functions to start with.
> because zgrep unlike grep has no recursive flag
>
> I believe that there is some dpkg/apt flag that says keep the files
> unzipped.
Not really. The files are in the package in their gzipped form. They get
processed by various scripts but essentially they are as they are.
> Anyone know of it?
However auto-compression-mode is your friend. You can visit .gz files
withing Emacs and it will automagically deal with gz files for you.
--
Alex Bennée
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
[not found] ` <mailman.4678.1382692274.10748.help-gnu-emacs@gnu.org>
@ 2013-10-25 11:34 ` Rustom Mody
2013-10-25 12:22 ` Alex Bennée
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Rustom Mody @ 2013-10-25 11:34 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, October 25, 2013 2:40:52 PM UTC+5:30, Alex Bennée wrote:
> Rustom Mody wrote:
>
> > [This is more about debian ubuntu than emacs]
> >
> > When looking for something in elisp on debian/ubuntu there is the
> > nuisance that the files are gzipped. So Ive to do things like
>
> What sort of things are you looking for?
eg Figure out how the function 'make-translation-table' is used in elisp
etc etc
> > find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
>
>
> Everything in your site-lisp should be visible within emacs even if they
> are autoloaded functions to start with.
>
>
> > because zgrep unlike grep has no recursive flag
>
> >
>
> > I believe that there is some dpkg/apt flag that says keep the files
> > unzipped.
>
>
> Not really. The files are in the package in their gzipped form. They get
> processed by various scripts but essentially they are as they are.
Heres a small snippet of directories.
$ pwd
/usr/share/emacs/24.3/lisp
$ ls
abbrev.elc foldout.elc pcmpl-gnu.elc
abbrev.el.gz foldout.el.gz pcmpl-gnu.el.gz
align.elc follow.elc pcmpl-linux.elc
align.el.gz follow.el.gz pcmpl-linux.el.gz
allout.elc font-core.elc pcmpl-rpm.elc
allout.el.gz font-core.el.gz pcmpl-rpm.el.gz
allout-widgets.elc font-lock.elc pcmpl-unix.elc
allout-widgets.el.gz font-lock.el.gz pcmpl-unix.el.gz
As you can see all files are elc or gzipped el.
>
> > Anyone know of it?
>
> However auto-compression-mode is your friend. You can visit .gz files
> withing Emacs and it will automagically deal with gz files for you.
Oh emacs opens gzipped files alright, so I guess auto-compression is working.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 11:34 ` Rustom Mody
@ 2013-10-25 12:22 ` Alex Bennée
2013-10-25 17:38 ` Stefan Monnier
[not found] ` <mailman.4723.1382722719.10748.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2013-10-25 12:22 UTC (permalink / raw)
To: Rustom Mody; +Cc: help-gnu-emacs
rustompmody@gmail.com writes:
> On Friday, October 25, 2013 2:40:52 PM UTC+5:30, Alex Bennée wrote:
>> Rustom Mody wrote:
>>
>> > [This is more about debian ubuntu than emacs]
>> >
>> > When looking for something in elisp on debian/ubuntu there is the
>> > nuisance that the files are gzipped. So Ive to do things like
>>
>> What sort of things are you looking for?
>
> eg Figure out how the function 'make-translation-table' is used in elisp
> etc etc
C-h f make-translation-table
TAB (onto the highlighted mule.el)
RET (goes to the definition in mule.el.gz)
>> > find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
>>
<snip>
I agree finding all places where this call is made is more tricky
however. It would probably be easier just to have a checkout of the main
emacs src code for you to grep through?
--
Alex Bennée
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 3:11 searching elisp on debian/ubuntu Rustom Mody
2013-10-25 9:10 ` Alex Bennée
[not found] ` <mailman.4678.1382692274.10748.help-gnu-emacs@gnu.org>
@ 2013-10-25 13:29 ` Michael Heerdegen
2013-10-25 14:44 ` Alex Bennée
2013-10-25 15:55 ` Bob Proulx
[not found] ` <mailman.4721.1382716569.10748.help-gnu-emacs@gnu.org>
4 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2013-10-25 13:29 UTC (permalink / raw)
To: help-gnu-emacs
Rustom Mody <rustompmody@gmail.com> writes:
> [This is more about debian ubuntu than emacs]
>
> When looking for something in elisp on debian/ubuntu there is the
> nuisance that the files are gzipped. So Ive to do things like
>
> find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
>
> because zgrep unlike grep has no recursive flag
>
> I believe that there is some dpkg/apt flag that says keep the files
> unzipped.
>
> Anyone know of it?
No. But you can nonetheless search from Emacs, e.g. with
- color-moccur.el. M-x dired any directory, and do M-x dired-do-moccur.
Works out of the box. Uncompresses files on the fly when
appropriate. It's recursive.
- Icicles: Use the Icicles search commands, they also work for
compressed files.
- Helm: Use a prefix arg for `helm-ff-run-zgrep' from
`helm-find-files'.
Sorry for all I forgot to mention.
Regards,
Michael.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 13:29 ` searching elisp on debian/ubuntu Michael Heerdegen
@ 2013-10-25 14:44 ` Alex Bennée
2013-10-25 15:28 ` Drew Adams
0 siblings, 1 reply; 12+ messages in thread
From: Alex Bennée @ 2013-10-25 14:44 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
michael_heerdegen@web.de writes:
> Rustom Mody <rustompmody@gmail.com> writes:
<snip>
>> I believe that there is some dpkg/apt flag that says keep the files
>> unzipped.
>>
>> Anyone know of it?
>
> No. But you can nonetheless search from Emacs, e.g. with
>
<snip>
> - Helm: Use a prefix arg for `helm-ff-run-zgrep' from
> `helm-find-files'.
Wow I didn't realise there was so much you could do from within
helm-find-file. Impressive.
--
Alex Bennée
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: searching elisp on debian/ubuntu
2013-10-25 14:44 ` Alex Bennée
@ 2013-10-25 15:28 ` Drew Adams
0 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2013-10-25 15:28 UTC (permalink / raw)
To: Alex Bennée, Michael Heerdegen; +Cc: help-gnu-emacs
> > No. But you can nonetheless search from Emacs, e.g. with
> >
> > - Icicles: Use the Icicles search commands, they also work for
> > compressed files.
> >
> > - Helm: Use a prefix arg for `helm-ff-run-zgrep' from
> > `helm-find-files'.
>
> Wow I didn't realise there was so much you could do from within
> helm-find-file. Impressive.
FWIW - Likewise, for `icicle-file' (`C-x C-f' in Icicle mode).
You can match file name, file contents, or both.
And files can be compressed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 3:11 searching elisp on debian/ubuntu Rustom Mody
` (2 preceding siblings ...)
2013-10-25 13:29 ` searching elisp on debian/ubuntu Michael Heerdegen
@ 2013-10-25 15:55 ` Bob Proulx
[not found] ` <mailman.4721.1382716569.10748.help-gnu-emacs@gnu.org>
4 siblings, 0 replies; 12+ messages in thread
From: Bob Proulx @ 2013-10-25 15:55 UTC (permalink / raw)
To: help-gnu-emacs
Rustom Mody wrote:
> ... nuisance ...
> find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
> because zgrep unlike grep has no recursive flag
I am compelled to disagree. If we were sitting around a pub this
would be a good philosophical discussion! In the meantime we will
just have to do it virtually on email. :-)
Sure 'grep' added a --recursive option. But it added a huge amount of
code for it too. And immediately people started filing bugs saying
they wanted it to do something different on different types of files.
They wanted to ignore special files like character devices. Or they
didn't. They wanted it to skip over pipes instead of blocking reading
them waiting for input. And then another said they were using that
feature and wanted it to read pipes. And of course people asked to
skip some file name patterns. And then others wanted to include some.
Should it follow symbolic links or not? Pretty soon all of 'find'
must be recreated using a different syntax. And after having learned
how to work grep's implementation of recursive behavior it might not
work for other utilities that might implement it differently.
Using 'find' is superior. Once you learn the syntax of find you can
apply it to any of the utilities. The 'find' command is a general
purpose command that works not just in one program like grep but in
all of the other programs and utilities on the system!
So I think that your lament about zgrep lacking --recursive and
needing to use find is not about a lack in zgrep but rather about a
lack of vision in grep and the good design of Unix and find that find
was already there to do the job. Find was there for zgrep even though
zgrep had not been written when find was written.
It isn't a nuisance. It is a joy of good design! :-)
Bob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
[not found] ` <mailman.4721.1382716569.10748.help-gnu-emacs@gnu.org>
@ 2013-10-25 16:53 ` Rustom Mody
2013-10-25 19:28 ` Bob Proulx
0 siblings, 1 reply; 12+ messages in thread
From: Rustom Mody @ 2013-10-25 16:53 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, October 25, 2013 9:25:54 PM UTC+5:30, Bob Proulx wrote:
> Rustom Mody wrote:
> > ... nuisance ...
>
> > find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
> > because zgrep unlike grep has no recursive flag
> So I think that your lament about zgrep lacking --recursive and
> needing to use find is not about a lack in zgrep but rather…
I am not lamenting about zgrep not having grep's functionality
I am lamenting that the debian packagers are trying to save my disk-space without my say-so
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 11:34 ` Rustom Mody
2013-10-25 12:22 ` Alex Bennée
@ 2013-10-25 17:38 ` Stefan Monnier
[not found] ` <mailman.4723.1382722719.10748.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2013-10-25 17:38 UTC (permalink / raw)
To: help-gnu-emacs
> eg Figure out how the function 'make-translation-table' is used in elisp
The fact that it's almost never used is a subtle hint that you probably
shouldn't use it.
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* translation tables (was searching elisp on debian/ubuntu)
[not found] ` <mailman.4723.1382722719.10748.help-gnu-emacs@gnu.org>
@ 2013-10-25 18:46 ` Rustom Mody
0 siblings, 0 replies; 12+ messages in thread
From: Rustom Mody @ 2013-10-25 18:46 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, October 25, 2013 11:08:11 PM UTC+5:30, Stefan Monnier wrote:
> > eg Figure out how the function 'make-translation-table' is used in elisp
>
> The fact that it's almost never used is a subtle hint that you probably
> shouldn't use it.
???
Below is my code as currently written.
Scroll-lock should change from normal ascii layout to apl layout.
If you dont have scroll-lock (eg laptops) choose come other free key
How should I do it better?
----------------------
(defvar apl-keyboard '(
;; number row
"`◊ 1¨ 2¯ 3< 4≤ 5= 6≥ 7> 8≠ 9∨ 0∧ -× =÷ \⍝ |⍀"
;; number row SHIFTed
"~⍨ !¡ @€ #£ $⍧ % ^ & *⍂ (⍱ )⍲ _≡ +⌹"
;; qwert row
"q? w⍵ e∈ t∼ y↑ r⍴ u↓ i⍳ o○ p⋆"
;; qwert row shifted
"Q¿ W⌽ E⋸ T⍉ Y¥ I⍸ O⍥ P⍟ [← ]→"
;; asdf row
"a⍺ s⌈ d⌊ f_ g∇ h∆ j∘ k' l⎕ ;⊢ '⊣"
;; asdf row shifted
"A⊖ S D F⍫ G⍒ H⍋ J⍤ K⌻ L⍞"
;; zxcv row
"z⊂ x⊃ c∩ v∪ b⊥ n⊤ m∣ ,⌷ .⍎ /⍕"
;; zxcv row shifted
"Z X C⍝ V B⍎ N⍕ M⌶ <⍪ >⍙ ?⌿"
)
"APL keyboard is a list of keyboard rows
For structure see \\[kb-block-defrules]
"
)
(defun kb-block-defrules (kb)
"kb is a list of keyboard rows
Each row is a space delimited string
The elements of the rows apart from spaces are a pair of characters
the first is a keyboard and the second is a translation (which could be absent)
See apl-keyboard above for example.
This function converts that list of strings
into a lisp list of (key .translation) pairs
"
(let ((kbl nil))
(dolist (row kb (reverse kbl))
(let ((key-trans-list (split-string row "[ \t]+" t))
(key) (trans))
(dolist (key-trans key-trans-list)
(when (= (length key-trans) 2)
(setq key (aref key-trans 0)
trans (aref key-trans 1)
kbl (cons (cons key trans) kbl)
)))))))
(defvar apl-input-mode nil)
;; obviously this will not be global when the rest of apl mode
;; are in shape. Just a hack for now
(global-set-key (kbd "<Scroll_Lock>") 'toggle-apl-input-mode)
(defvar mode-name-aplized "απλ")
(defvar mode-name-ascii "APL")
(defvar apl-translation-table (make-translation-table
(kb-block-defrules apl-keyboard)))
(defun toggle-apl-input-mode ()
(interactive)
(setq apl-input-mode (not apl-input-mode))
(if apl-input-mode
(setq keyboard-translate-table apl-translation-table
mode-name mode-name-aplized)
(setq keyboard-translate-table nil
mode-name mode-name-ascii))
(force-mode-line-update))
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: searching elisp on debian/ubuntu
2013-10-25 16:53 ` Rustom Mody
@ 2013-10-25 19:28 ` Bob Proulx
0 siblings, 0 replies; 12+ messages in thread
From: Bob Proulx @ 2013-10-25 19:28 UTC (permalink / raw)
To: help-gnu-emacs
Rustom Mody wrote:
> Bob Proulx wrote:
> > So I think that your lament about zgrep lacking --recursive and
> > needing to use find is not about a lack in zgrep but rather…
>
> I am not lamenting about zgrep not having grep's functionality
> I am lamenting that the debian packagers are trying to save my
> disk-space without my say-so
Well... Okay. But most people would rather see the disk space saved! :-)
(Just for the record I am not aware of any ability to optionally
configure dpkg to install uncompressed versions of files.)
Bob
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-10-25 19:28 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25 3:11 searching elisp on debian/ubuntu Rustom Mody
2013-10-25 9:10 ` Alex Bennée
[not found] ` <mailman.4678.1382692274.10748.help-gnu-emacs@gnu.org>
2013-10-25 11:34 ` Rustom Mody
2013-10-25 12:22 ` Alex Bennée
2013-10-25 17:38 ` Stefan Monnier
[not found] ` <mailman.4723.1382722719.10748.help-gnu-emacs@gnu.org>
2013-10-25 18:46 ` translation tables (was searching elisp on debian/ubuntu) Rustom Mody
2013-10-25 13:29 ` searching elisp on debian/ubuntu Michael Heerdegen
2013-10-25 14:44 ` Alex Bennée
2013-10-25 15:28 ` Drew Adams
2013-10-25 15:55 ` Bob Proulx
[not found] ` <mailman.4721.1382716569.10748.help-gnu-emacs@gnu.org>
2013-10-25 16:53 ` Rustom Mody
2013-10-25 19:28 ` Bob Proulx
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).