SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
                                      Gestione dei File con Emacs
file

Ricerche

Image-Dired                                   Emmanuele Somma
Dired-X                                emmanuele.somma@bancaditalia.it

                                       Supporto Informatico per l’Area Ricerche
                                                    Banca d’Italia


                                                27 Febbraio 2009




                 E. Somma (SIA-BdI)             WEDI 2009            27/02/2009   1/44
Piano della presentazione

 WEDI 2009

  E. Somma

Operazioni        1   Operazioni fondamentali
fondamentali

Operazioni sui
file
                  2   Operazioni sui file
Ricerche

Image-Dired

Dired-X
                  3   Ricerche

                  4   Image-Dired

                  5   Dired-X



                  E. Somma (SIA-BdI)       WEDI 2009   27/02/2009   2/44
Introduzione

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui   La gestione dei file ` una delle operazioni pi` comuni sul
                                      e                          u
file
                 computer. E  ` una delle caratteristiche distintive delle differenti
Ricerche
                 interfacce utente testuali o grafiche. Che, detto in altre parole,
Image-Dired
                 significa: ` diversa da sistema a sitema, da interfaccia ad
                            e
Dired-X
                 interfaccia, da macchina a macchina.
                 Ma... noi conosciamo la soluzione
                                               EMACS




                  E. Somma (SIA-BdI)     WEDI 2009          27/02/2009                 3/44
Caratteristiche

 WEDI 2009

  E. Somma        Il modo Dired Directory Editor di Emacs ` un ottimo
                                                          e
Operazioni
                  file-manager per:
fondamentali

Operazioni sui
                  Navigazione nelle directory Finestre unica per ogni directory o
file                            molteplici directory su un singolo buffer,
Ricerche                       informazioni visualizzate a scelta dell’utente
Image-Dired
                  Gestione dei file Copiare, cancellare, rinominare/muovere,
Dired-X
                                collegamenti (alias), chmod, chgrp, chown,
                                timestamp, stampare, comprimere, caricare,
                                byte-compilare, visitare, vedere, marcature
                                esoteriche, ricercare, comparare
                  Gestione dei file particolari auto-salvataggi, backup,
                                file-spazzatura


                  E. Somma (SIA-BdI)     WEDI 2009         27/02/2009               4/44
...ed anche

 WEDI 2009

  E. Somma

Operazioni
fondamentali     Gestione dei processi Esecuzione di comandi di shell
Operazioni sui
file              Gestione dei nomi Trasformazioni in maiuscolo, minuscolo,
Ricerche                       generiche in base ai REGEXP
Image-Dired      Gestione delle ricerche sul nome del file, sul contenuto dei file,
Dired-X                        generiche, sul database dei file
                 Modifica diretta della directory
                 Gestione delle immagini vista delle miniature, gestione dei tag,
                               manipolazione dei jpg




                  E. Somma (SIA-BdI)    WEDI 2009         27/02/2009                5/44
Storia di Dired

 WEDI 2009

  E. Somma

Operazioni
                 Dired ` stato inventato nel 1974 allo Stanford Artificial
                         e
fondamentali     Intelligence Laboratory (SAIL) come programma stand-alone da
Operazioni sui
file
                 Stan Kugell.[1]. Fu in seguito incorporato in Emacs ed `  e
Ricerche
                 diventato la base per tutti i moderni sistemi di visualizzazione
Image-Dired      delle directory dei file basati su finestre [2] (da Wikipedia)
Dired-X
                    1   Kugell, Stanley G. (1974). SAILDART/2006-06. Stanford
                        Artificial Intelligence Lab DART (Dump and Restore
                        Technique) Archive. Retrieved on 2007-11-16.
                    2   SAILDART/2006-06. Stanford Artificial Intelligence Lab
                        DART Archive. Retrieved on 2007-11-16.



                  E. Somma (SIA-BdI)     WEDI 2009       27/02/2009             6/44
Operazioni fondamentali

 WEDI 2009

  E. Somma

Operazioni       1   Operazioni fondamentali
fondamentali

Operazioni sui
file
                 2   Operazioni sui file
Ricerche

Image-Dired

Dired-X
                 3   Ricerche

                 4   Image-Dired

                 5   Dired-X



                  E. Somma (SIA-BdI)      WEDI 2009   27/02/2009   7/44
Entrare nel modo Dired

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file                C-x    d            dired
Ricerche           C-x    C-f          find-file
Image-Dired        C-x    4 d          dired-other-window
Dired-X            C-x    5 d          dired-other-frame
                   C-u    C-x C-d




                  E. Somma (SIA-BdI)       WEDI 2009        27/02/2009   8/44
Muoversi in Dired

 WEDI 2009

  E. Somma

Operazioni
fondamentali
                   C-n, n, <SPC>       next-line
Operazioni sui
file                C-p, p              prev-line
Ricerche           i, C-u i, 0 i       dired-maybe-insert-subdir
Image-Dired        l                   dired-do-redisplay
Dired-X
                   $                   dired-hide-subdir
                   M-$, ESC $          dired-hide-all
                   +                   dired-create-directory




                  E. Somma (SIA-BdI)     WEDI 2009     27/02/2009   9/44
Muoversi in Dired

 WEDI 2009

  E. Somma

Operazioni         C-x [        next-page
fondamentali
                   C-x ]        prev-page
Operazioni sui
file                C-M-n        dired-next-subdir
Ricerche           C-M-p        dired-prev-subdir
Image-Dired        C-M-u        dired-tree-up
Dired-X            C-M-d        dired-tree-down
                   <            dired-prev-dirline
                   >            dired-next-dirline
                   C-u k        dired-do-kill-lines
                   ∧            dired-up-directory




                  E. Somma (SIA-BdI)      WEDI 2009   27/02/2009   10/44
Aggiornare il buffer Dired

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui     g                   revert-buffer
file
                   l                   dired-do-redisplay
Ricerche
                   k                   dired-do-kill-lines
Image-Dired

Dired-X
                   s                   dired-sort-toggle-or-edit
                   C-u s SWITCHES      dired-listing-switches
                   w                   dired-copy-filename-as-kill




                  E. Somma (SIA-BdI)    WEDI 2009     27/02/2009     11/44
Visitare i file

 WEDI 2009

  E. Somma

Operazioni
fondamentali       f, RET,e            dired-find-file
Operazioni sui
file
                                       Visita il file
Ricerche
                   o                   dired-find-file-other-window
Image-Dired
                                       Visita il file in un’altra finestra
Dired-X            C-o                 dired-display-file
                                       Visualizza il file in un’altra finestra
                   v                   dired-view-file
                                       Visualizza il file




                  E. Somma (SIA-BdI)            WEDI 2009        27/02/2009    12/44
Cancellazione dei file

 WEDI 2009

  E. Somma

Operazioni         d        dired-flag-file-deletion
fondamentali
                            Marca per la cancellazione
Operazioni sui
file                u        command dired-unmark
Ricerche                    Elimina la marcatura
Image-Dired        DEL      dired-unmark-backward
Dired-X                     come u ma prima si sposta alla riga precedente
                   x        dired-do-flagged-delete
                            Esegue l’operazione
                            dired-recursive-deletes
                            (t/nil) attiva la cancellazione ricorsiva




                  E. Somma (SIA-BdI)      WEDI 2009       27/02/2009         13/44
Marcature generiche e flags

 WEDI 2009         * m          dired-mark
  E. Somma                      Marca con *
                   N * m        dired-mark
Operazioni
fondamentali                    Marca N file con *
Operazioni sui
file
                   * *          dired-mark-executables
Ricerche
                                Marca i file eseguibili
Image-Dired
                   * @          dired-mark-symlinks
Dired-X                         Marca i link simbolici
                   * /          dired-mark-directories
                                Marca le directory
                   * .          dired-mark-extension
                                Marca i file con determinate estensioni
                   * O          dired-mark-omitted
                                Marca i file omessi
                   * s          dired-mark-subdir-files
                                Marca tutto (tranne . e ..)
                  E. Somma (SIA-BdI)        WEDI 2009       27/02/2009   14/44
Marcature generiche e flags

 WEDI 2009         DEL, * DEL              dired-unmark-backward
  E. Somma                                 Rimuove una marca
                   * !, U                  dired-unmark-all-marks
Operazioni
fondamentali                               Rimuove tutte le marche
Operazioni sui
file
                   * ?      CHAR, M-DEL    dired-unmark-all-files
Ricerche
                                           Rimuove le marche di CHAR
Image-Dired
                                           1 * ? D
Dired-X            * C-n                   dired-next-marked-file
                                           Passa al prossimo file marcato
                   * C-p                   dired-prev-marked-file
                                           Passa al precedente file marcato
                   t, * t                  dired-toggle-marks
                                           Scambia i file marcati
                   * c OLD NEW             dired-change-marks
                                           Scambia le marche
                                           * c D t * c SPC D * c t SPC
                  E. Somma (SIA-BdI)      WEDI 2009       27/02/2009         15/44
Marcature multiple

 WEDI 2009

  E. Somma
                   #                   dired-flag-auto-save-files
Operazioni                             Marca gli auto-save
fondamentali
                   ∼                   dired-flag-backup-files
Operazioni sui
file                                    Marca i file di backup
Ricerche           &                   dired-flag-garbage-files
Image-Dired                            Marca i file-spazzatura
Dired-X
                                       dired-garbage-files-regexp
                                       Definisce i nomi dei file-spazzatura
                   .                   dired-clean-directory
                                       Marca i backup numerici
                   % d REGEXP          dired-flag-files-regexp
                                       Marca i file secondo il REGEXP


                  E. Somma (SIA-BdI)         WEDI 2009       27/02/2009     16/44
Marcature multiple

 WEDI 2009

  E. Somma

Operazioni
fondamentali
                   % m      dired-mark-files-regexp
Operazioni sui
file                * %      dired-mark-files-regexp
Ricerche                    Marca i file definiti dal REGEXP
Image-Dired        % d      dired-flag-files-regexp
Dired-X
                            Marca per la cancellazione
                   % g      dired-mark-files-containing-regexp
                            Marca i file secondo il contenuto




                  E. Somma (SIA-BdI)    WEDI 2009     27/02/2009   17/44
Espressioni Regolari

 WEDI 2009

  E. Somma
                 Le espressioni regolari (regular expressions) sono descrizioni
Operazioni
fondamentali     astratte di stringhe di caratteri.
Operazioni sui   Ad esempio, la espressione regolare
file

Ricerche
                                           ([ao]+)1
Image-Dired

Dired-X
                 descrive una classe infinita di stringhe quali:

                      aa, aoao, oooo, aaoaao, oaoaoaaooaoaoaao, ...

                 ovvero una qualsiasi stringa contenente a o o, immediatamente
                 seguita da una ripetizione di s´ stessa.
                                                e



                  E. Somma (SIA-BdI)     WEDI 2009         27/02/2009             18/44
Sintassi delle espressioni regolari

 WEDI 2009

  E. Somma

Operazioni         Semplice match         hello
fondamentali
                   Caratteri speciali     $ ^ . ∗ + ? [ ] 
Operazioni sui
file                Insieme di caratteri   [...] [^...]
Ricerche           Ripetizioni            {N}, {N,M}
Image-Dired        Raggruppamenti         ( )
Dired-X            Riferimento            1 2 3 ...
                   Alternative            |
                   Gruppi timidi          (?: ... )
                   Stringa vuota          ‘ ’ = b B < >
                   Costituenti            w W sC SC C=... cC CC




                  E. Somma (SIA-BdI)      WEDI 2009    27/02/2009       19/44
Esercizi sulle espressioni regolari

 WEDI 2009
                        Trovare in un testo “un” o “uno” o “una”
  E. Somma
                        un(|o|a)
Operazioni              Trovare in un testo le parole “Luna” o “luna”.
fondamentali
                        (L|l)una
Operazioni sui
file                     Trovare parole con tre consonanti di fila p.es. “scrivere”,
Ricerche                “aspro” [bcdfghjklmnpqrstvwxyz]{3}
Image-Dired
                        Trovare parole con tre consonanti all’inizio di parola.
Dired-X
                        b[^aeiou]{3}
                        Cercare parole con vocali identiche ripetute (p.es. “aree”,
                        “portaauto”)
                        ([aeiou])1
                        Trovare parole palindrome di lunghezza 4 o 5 (p.es.
                        “abba”, “radar”) b(.)(.).?21b
                        Trovare parole ripetute (p.es. “alto alto”)
                        (bw+b)s1
                  E. Somma (SIA-BdI)      WEDI 2009         27/02/2009            20/44
Operazioni sui file

 WEDI 2009

  E. Somma

Operazioni        1   Operazioni fondamentali
fondamentali

Operazioni sui
file
                  2   Operazioni sui file
Ricerche

Image-Dired

Dired-X
                  3   Ricerche

                  4   Image-Dired

                  5   Dired-X



                  E. Somma (SIA-BdI)       WEDI 2009   27/02/2009   21/44
Come specificare i file

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file

Ricerche            1   Con un argomento prefisso
Image-Dired         2   Tutti i file marcati con *
Dired-X
                    3   sul file corrente




                  E. Somma (SIA-BdI)       WEDI 2009   27/02/2009   22/44
Come specificare la destinazione

 WEDI 2009

  E. Somma

Operazioni
fondamentali
                 Nelle operazioni sui file la directory di destinazione ` la stessa
                                                                       e
Operazioni sui
file              di quella di partenza
Ricerche         A meno che non venga definita la variabile:
Image-Dired
                          M-x set-variable dired-dwin-target t
Dired-X

                 In questo modo se esistono due dired la directory di
                 destinazione ` quella dell’altro dired.
                              e
                 In questo modo ` possibile realizzare un file-commander
                                 e




                  E. Somma (SIA-BdI)     WEDI 2009         27/02/2009                23/44
Operazioni sui file/directory

 WEDI 2009

  E. Somma

Operazioni         C NEW          dired-do-copy               cp
fondamentali
                                  dired-copy-preserve-time    cp -p
Operazioni sui
file                               dired-recursive-copies      cp -r
Ricerche           D              dired-do-delete             rm
Image-Dired        R   NEW        dired-do-rename             mv
Dired-X            H   NEW        dired-do-hardlink           ln
                   S   NEW        dired-do-symlink            ln -s
                   M   SPEC       dired-do-chmod              chmod
                   G   GRP        dired-do-chgrp              chgrp
                   O   OWN        dired-do-chown              chown




                  E. Somma (SIA-BdI)       WEDI 2009     27/02/2009   24/44
Operazioni sui file/directory

 WEDI 2009

  E. Somma

Operazioni         T STAMP   dired-do-touch             touch
fondamentali
                   P CMD     dired-do-print             lpr
Operazioni sui
file                          lpr-command
Ricerche                     lpr-switches
Image-Dired        Z         dired-do-compress          gzip
Dired-X            L         dired-do-load
                   B         dired-do-byte-compile
                   A REGEXP dired-do-search
                   Q REGEXP TO
                             query-replace-regrexp




                  E. Somma (SIA-BdI)   WEDI 2009     27/02/2009   25/44
Comandi di shell

 WEDI 2009

  E. Somma

Operazioni         !, X
fondamentali

Operazioni sui
                   (dired-do-shell-command)
file
                   ! wc -l *
Ricerche
                   ! wc -l
Image-Dired
                   ! cp * /tmp
Dired-X
                   ! grep pippo *
                   ! for file in * ; do uuencode 
                     "$file" "$file" >"$file".uu; done
                   g




                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009   26/44
Trasformazione dei nomi

 WEDI 2009

  E. Somma
                   %   u               dired-upcase
Operazioni         %   l               dired-downcase
fondamentali

Operazioni sui
                   %   R
                      FROM TO          dired-do-rename-regexp
file                %   C
                      FROM TO          dired-do-copy-regexp
Ricerche           %   H
                      FROM TO          dired-do-hardlink-regexp
Image-Dired
                   %   S
                      FROM TO          dired-do-symlink-regexp
Dired-X
                      &, 1. . .n
                 Esempi:
                   % R ^.*$ <RET> x-& <RET>
                   % R ^x-(.*)$ <RET> 1 <RET>
                   0 % R
                   % m FROM <RET> % R <RET> TO <RET>



                  E. Somma (SIA-BdI)    WEDI 2009    27/02/2009   27/44
Comparazione dei file

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file
                   =        dired-diff
Ricerche
                   M-=      dired-backup-diff
Image-Dired
                            dired-compare-directories
Dired-X
                            (> mtime1 mtime2)




                  E. Somma (SIA-BdI)    WEDI 2009       27/02/2009   28/44
Ricerche

 WEDI 2009

  E. Somma

Operazioni       1   Operazioni fondamentali
fondamentali

Operazioni sui
file
                 2   Operazioni sui file
Ricerche

Image-Dired

Dired-X
                 3   Ricerche

                 4   Image-Dired

                 5   Dired-X



                  E. Somma (SIA-BdI)      WEDI 2009   27/02/2009   29/44
Ricerche dentro Dired

 WEDI 2009

  E. Somma
                     M-x find-name-dired DIR <RET> WILDCARD <RET>
Operazioni               ~/ <RET> *.txt <RET>
fondamentali
                     M-x find-grep-dired DIR <RET> REGEXP <RET>
Operazioni sui
file                      ~/ <RET> .*corn <RET>
Ricerche             M-x grep-find DIR <RET> REGEXP <RET>
Image-Dired              ~/ <RET> .*corn <RET>
Dired-X
                     % g REGEXP
                         ~/ <RET> .*corn <RET>
                     M-x find-dired
                         ?!?
                     M-x set-variable find-ls-option -ld
                         ?!?


                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009       30/44
Ricerche dentro Dired con locate

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file
                     M-x locate STRING <RET>
Ricerche
                         txt
Image-Dired
                     M-x locate-with-filter STRING <RET> FILTER <RET>
Dired-X
                         txt <RET> exedre <RET>




                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009       31/44
Editing del buffer Dired

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file                [Immediate]→[File Names]
Ricerche            M-x wdired-change-to-wdired-mode
Image-Dired             C-c C-c (wdired-finish-edit)
Dired-X             M-x set-variable
                        wdired-allow-to-change-permission t




                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009   32/44
Image-Dired

 WEDI 2009

  E. Somma

Operazioni       1   Operazioni fondamentali
fondamentali

Operazioni sui
file
                 2   Operazioni sui file
Ricerche

Image-Dired

Dired-X
                 3   Ricerche

                 4   Image-Dired

                 5   Dired-X



                  E. Somma (SIA-BdI)      WEDI 2009   27/02/2009   33/44
Image-Dired

 WEDI 2009

  E. Somma

Operazioni
fondamentali         C-t d (image-dired-display-thumbs)
Operazioni sui       C-t t (image-dired-tag-files)
file
                     <RET> (image-dired-flag-thumb-original-file)
Ricerche
                     <SPC> (image-dired-display-next-thumbnail-original)
Image-Dired
                     <DEL> (image-dired-display-previous-thumbnail-original)
Dired-X              C-<RET> (image-dired-thumbnail-display-external)
                         M-x set-variable image-dired-external-viewer
                     d    (image-dired-flag-thumb-original-file)
                     C-d (image-dired-delete-char)




                  E. Somma (SIA-BdI)   WEDI 2009     27/02/2009         34/44
Image-Dired: Tags

 WEDI 2009

  E. Somma
                  M-x set-variable image-dired-db-file
Operazioni
fondamentali      ~/.emacs.d/image-dired/.image-dired_db
Operazioni sui    C-t t (image-dired-tag-files)
file
                  C-t f (image-dired-mark-tagged-files)
Ricerche

Image-Dired
                  C-t d (image-dired-display-thumbs)
Dired-X
                  C-t c (image-dired-dired-comment-files)
                  t t      (image-dired-tag-thumbnail)
                  t r      (image-dired-tag-thumbnail-remove)
                 Manipolazioni JPG:
                  L (image-dired-rotate-original-left)
                  R (image-dired-rotate-original-right)



                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009   35/44
Dired-X

 WEDI 2009

  E. Somma

Operazioni       1   Operazioni fondamentali
fondamentali

Operazioni sui
file
                 2   Operazioni sui file
Ricerche

Image-Dired

Dired-X
                 3   Ricerche

                 4   Image-Dired

                 5   Dired-X



                  E. Somma (SIA-BdI)      WEDI 2009   27/02/2009   36/44
Dired-X: Omissione dei file

 WEDI 2009
                        Agisce sui file e non sulle directory
  E. Somma
                        Prendere o lasciare, o c’` o non c’`
                                                 e          e
Operazioni
fondamentali            Pu` essere attivata automaticamente
                           o
Operazioni sui
file                     I file marcati NON possono essere omessi
Ricerche
                     M-o, dired-omit-mode
Image-Dired
                     * O, dired-mark-omitted
Dired-X
                     M-x set-variable dired-omit-mode nil/1
                         Local Variables:
                         dired-omit-mode: t
                         End:
                     dired-omit-here-always
                     dired-omit-files: "^#|.$"
                     dired-omit-localp, no-dir, nil, t
                     dired-omit-marker-char, (C-o)
                  E. Somma (SIA-BdI)     WEDI 2009       27/02/2009   37/44
Dired-X: Variabili locali per le directory Dired

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui       dired-local-variables-file (default: .dired )
file
                         Local Variables:
Ricerche
                         dired-actual-switches: "-lat"
Image-Dired

Dired-X
                         dired-omit-mode: t
                         End:
                     dired-enable-local-variables (t)




                  E. Somma (SIA-BdI)   WEDI 2009     27/02/2009      38/44
Dired-X: Shell

 WEDI 2009

  E. Somma

Operazioni
fondamentali     (setq dired-guess-shell-alist-user
Operazioni sui
file
                       (list
Ricerche
                        (list ".foo$" "FOO-COMMAND");; fixed rule
Image-Dired             ;; possibly more rules...
Dired-X                 (list ".bar$";; rule with condition test
                               ’(if CONDITION
                                    "BAR-COMMAND-1"
                                  "BAR-COMMAND-2"))))




                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009     39/44
Dired-X: Dired Virtuale

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file

Ricerche         (setq auto-mode-alist (cons ’("[^/].dired$" .
Image-Dired                                dired-virtual-mode)
Dired-X                                    auto-mode-alist))




                  E. Somma (SIA-BdI)   WEDI 2009   27/02/2009      40/44
Dired-X:

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file

Ricerche
                          F, dired-do-find-marked-files
Image-Dired               dired-mark-extension
Dired-X                   dired-flag-extension




                  E. Somma (SIA-BdI)   WEDI 2009     27/02/2009   41/44
Dired-X: M-( dired-mark-sexp

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui           inode, s, mode, nlink, uid, gid, size, time,
file
                         name, sym
Ricerche

Image-Dired

Dired-X
                    Es:
                           (equal 0 size)
                           (not (file-exists-p (concat name "c")))




                 E. Somma (SIA-BdI)    WEDI 2009     27/02/2009         42/44
Dired-X: Dired Jump

 WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file

Ricerche                 C-x C-j       (dired-jump)
Image-Dired              C-x 4 C-j     (dired-jump-other-window)
Dired-X




                  E. Somma (SIA-BdI)   WEDI 2009     27/02/2009    43/44
WEDI 2009

  E. Somma

Operazioni
fondamentali

Operazioni sui
file

Ricerche

Image-Dired

Dired-X
                                      Grazie dell’attenzione




                 E. Somma (SIA-BdI)        WEDI 2009   27/02/2009   44/44

Mais conteúdo relacionado

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Workshop Gestire i File con Emacs

  • 1. WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui Gestione dei File con Emacs file Ricerche Image-Dired Emmanuele Somma Dired-X emmanuele.somma@bancaditalia.it Supporto Informatico per l’Area Ricerche Banca d’Italia 27 Febbraio 2009 E. Somma (SIA-BdI) WEDI 2009 27/02/2009 1/44
  • 2. Piano della presentazione WEDI 2009 E. Somma Operazioni 1 Operazioni fondamentali fondamentali Operazioni sui file 2 Operazioni sui file Ricerche Image-Dired Dired-X 3 Ricerche 4 Image-Dired 5 Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 2/44
  • 3. Introduzione WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui La gestione dei file ` una delle operazioni pi` comuni sul e u file computer. E ` una delle caratteristiche distintive delle differenti Ricerche interfacce utente testuali o grafiche. Che, detto in altre parole, Image-Dired significa: ` diversa da sistema a sitema, da interfaccia ad e Dired-X interfaccia, da macchina a macchina. Ma... noi conosciamo la soluzione EMACS E. Somma (SIA-BdI) WEDI 2009 27/02/2009 3/44
  • 4. Caratteristiche WEDI 2009 E. Somma Il modo Dired Directory Editor di Emacs ` un ottimo e Operazioni file-manager per: fondamentali Operazioni sui Navigazione nelle directory Finestre unica per ogni directory o file molteplici directory su un singolo buffer, Ricerche informazioni visualizzate a scelta dell’utente Image-Dired Gestione dei file Copiare, cancellare, rinominare/muovere, Dired-X collegamenti (alias), chmod, chgrp, chown, timestamp, stampare, comprimere, caricare, byte-compilare, visitare, vedere, marcature esoteriche, ricercare, comparare Gestione dei file particolari auto-salvataggi, backup, file-spazzatura E. Somma (SIA-BdI) WEDI 2009 27/02/2009 4/44
  • 5. ...ed anche WEDI 2009 E. Somma Operazioni fondamentali Gestione dei processi Esecuzione di comandi di shell Operazioni sui file Gestione dei nomi Trasformazioni in maiuscolo, minuscolo, Ricerche generiche in base ai REGEXP Image-Dired Gestione delle ricerche sul nome del file, sul contenuto dei file, Dired-X generiche, sul database dei file Modifica diretta della directory Gestione delle immagini vista delle miniature, gestione dei tag, manipolazione dei jpg E. Somma (SIA-BdI) WEDI 2009 27/02/2009 5/44
  • 6. Storia di Dired WEDI 2009 E. Somma Operazioni Dired ` stato inventato nel 1974 allo Stanford Artificial e fondamentali Intelligence Laboratory (SAIL) come programma stand-alone da Operazioni sui file Stan Kugell.[1]. Fu in seguito incorporato in Emacs ed ` e Ricerche diventato la base per tutti i moderni sistemi di visualizzazione Image-Dired delle directory dei file basati su finestre [2] (da Wikipedia) Dired-X 1 Kugell, Stanley G. (1974). SAILDART/2006-06. Stanford Artificial Intelligence Lab DART (Dump and Restore Technique) Archive. Retrieved on 2007-11-16. 2 SAILDART/2006-06. Stanford Artificial Intelligence Lab DART Archive. Retrieved on 2007-11-16. E. Somma (SIA-BdI) WEDI 2009 27/02/2009 6/44
  • 7. Operazioni fondamentali WEDI 2009 E. Somma Operazioni 1 Operazioni fondamentali fondamentali Operazioni sui file 2 Operazioni sui file Ricerche Image-Dired Dired-X 3 Ricerche 4 Image-Dired 5 Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 7/44
  • 8. Entrare nel modo Dired WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file C-x d dired Ricerche C-x C-f find-file Image-Dired C-x 4 d dired-other-window Dired-X C-x 5 d dired-other-frame C-u C-x C-d E. Somma (SIA-BdI) WEDI 2009 27/02/2009 8/44
  • 9. Muoversi in Dired WEDI 2009 E. Somma Operazioni fondamentali C-n, n, <SPC> next-line Operazioni sui file C-p, p prev-line Ricerche i, C-u i, 0 i dired-maybe-insert-subdir Image-Dired l dired-do-redisplay Dired-X $ dired-hide-subdir M-$, ESC $ dired-hide-all + dired-create-directory E. Somma (SIA-BdI) WEDI 2009 27/02/2009 9/44
  • 10. Muoversi in Dired WEDI 2009 E. Somma Operazioni C-x [ next-page fondamentali C-x ] prev-page Operazioni sui file C-M-n dired-next-subdir Ricerche C-M-p dired-prev-subdir Image-Dired C-M-u dired-tree-up Dired-X C-M-d dired-tree-down < dired-prev-dirline > dired-next-dirline C-u k dired-do-kill-lines ∧ dired-up-directory E. Somma (SIA-BdI) WEDI 2009 27/02/2009 10/44
  • 11. Aggiornare il buffer Dired WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui g revert-buffer file l dired-do-redisplay Ricerche k dired-do-kill-lines Image-Dired Dired-X s dired-sort-toggle-or-edit C-u s SWITCHES dired-listing-switches w dired-copy-filename-as-kill E. Somma (SIA-BdI) WEDI 2009 27/02/2009 11/44
  • 12. Visitare i file WEDI 2009 E. Somma Operazioni fondamentali f, RET,e dired-find-file Operazioni sui file Visita il file Ricerche o dired-find-file-other-window Image-Dired Visita il file in un’altra finestra Dired-X C-o dired-display-file Visualizza il file in un’altra finestra v dired-view-file Visualizza il file E. Somma (SIA-BdI) WEDI 2009 27/02/2009 12/44
  • 13. Cancellazione dei file WEDI 2009 E. Somma Operazioni d dired-flag-file-deletion fondamentali Marca per la cancellazione Operazioni sui file u command dired-unmark Ricerche Elimina la marcatura Image-Dired DEL dired-unmark-backward Dired-X come u ma prima si sposta alla riga precedente x dired-do-flagged-delete Esegue l’operazione dired-recursive-deletes (t/nil) attiva la cancellazione ricorsiva E. Somma (SIA-BdI) WEDI 2009 27/02/2009 13/44
  • 14. Marcature generiche e flags WEDI 2009 * m dired-mark E. Somma Marca con * N * m dired-mark Operazioni fondamentali Marca N file con * Operazioni sui file * * dired-mark-executables Ricerche Marca i file eseguibili Image-Dired * @ dired-mark-symlinks Dired-X Marca i link simbolici * / dired-mark-directories Marca le directory * . dired-mark-extension Marca i file con determinate estensioni * O dired-mark-omitted Marca i file omessi * s dired-mark-subdir-files Marca tutto (tranne . e ..) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 14/44
  • 15. Marcature generiche e flags WEDI 2009 DEL, * DEL dired-unmark-backward E. Somma Rimuove una marca * !, U dired-unmark-all-marks Operazioni fondamentali Rimuove tutte le marche Operazioni sui file * ? CHAR, M-DEL dired-unmark-all-files Ricerche Rimuove le marche di CHAR Image-Dired 1 * ? D Dired-X * C-n dired-next-marked-file Passa al prossimo file marcato * C-p dired-prev-marked-file Passa al precedente file marcato t, * t dired-toggle-marks Scambia i file marcati * c OLD NEW dired-change-marks Scambia le marche * c D t * c SPC D * c t SPC E. Somma (SIA-BdI) WEDI 2009 27/02/2009 15/44
  • 16. Marcature multiple WEDI 2009 E. Somma # dired-flag-auto-save-files Operazioni Marca gli auto-save fondamentali ∼ dired-flag-backup-files Operazioni sui file Marca i file di backup Ricerche & dired-flag-garbage-files Image-Dired Marca i file-spazzatura Dired-X dired-garbage-files-regexp Definisce i nomi dei file-spazzatura . dired-clean-directory Marca i backup numerici % d REGEXP dired-flag-files-regexp Marca i file secondo il REGEXP E. Somma (SIA-BdI) WEDI 2009 27/02/2009 16/44
  • 17. Marcature multiple WEDI 2009 E. Somma Operazioni fondamentali % m dired-mark-files-regexp Operazioni sui file * % dired-mark-files-regexp Ricerche Marca i file definiti dal REGEXP Image-Dired % d dired-flag-files-regexp Dired-X Marca per la cancellazione % g dired-mark-files-containing-regexp Marca i file secondo il contenuto E. Somma (SIA-BdI) WEDI 2009 27/02/2009 17/44
  • 18. Espressioni Regolari WEDI 2009 E. Somma Le espressioni regolari (regular expressions) sono descrizioni Operazioni fondamentali astratte di stringhe di caratteri. Operazioni sui Ad esempio, la espressione regolare file Ricerche ([ao]+)1 Image-Dired Dired-X descrive una classe infinita di stringhe quali: aa, aoao, oooo, aaoaao, oaoaoaaooaoaoaao, ... ovvero una qualsiasi stringa contenente a o o, immediatamente seguita da una ripetizione di s´ stessa. e E. Somma (SIA-BdI) WEDI 2009 27/02/2009 18/44
  • 19. Sintassi delle espressioni regolari WEDI 2009 E. Somma Operazioni Semplice match hello fondamentali Caratteri speciali $ ^ . ∗ + ? [ ] Operazioni sui file Insieme di caratteri [...] [^...] Ricerche Ripetizioni {N}, {N,M} Image-Dired Raggruppamenti ( ) Dired-X Riferimento 1 2 3 ... Alternative | Gruppi timidi (?: ... ) Stringa vuota ‘ ’ = b B < > Costituenti w W sC SC C=... cC CC E. Somma (SIA-BdI) WEDI 2009 27/02/2009 19/44
  • 20. Esercizi sulle espressioni regolari WEDI 2009 Trovare in un testo “un” o “uno” o “una” E. Somma un(|o|a) Operazioni Trovare in un testo le parole “Luna” o “luna”. fondamentali (L|l)una Operazioni sui file Trovare parole con tre consonanti di fila p.es. “scrivere”, Ricerche “aspro” [bcdfghjklmnpqrstvwxyz]{3} Image-Dired Trovare parole con tre consonanti all’inizio di parola. Dired-X b[^aeiou]{3} Cercare parole con vocali identiche ripetute (p.es. “aree”, “portaauto”) ([aeiou])1 Trovare parole palindrome di lunghezza 4 o 5 (p.es. “abba”, “radar”) b(.)(.).?21b Trovare parole ripetute (p.es. “alto alto”) (bw+b)s1 E. Somma (SIA-BdI) WEDI 2009 27/02/2009 20/44
  • 21. Operazioni sui file WEDI 2009 E. Somma Operazioni 1 Operazioni fondamentali fondamentali Operazioni sui file 2 Operazioni sui file Ricerche Image-Dired Dired-X 3 Ricerche 4 Image-Dired 5 Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 21/44
  • 22. Come specificare i file WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file Ricerche 1 Con un argomento prefisso Image-Dired 2 Tutti i file marcati con * Dired-X 3 sul file corrente E. Somma (SIA-BdI) WEDI 2009 27/02/2009 22/44
  • 23. Come specificare la destinazione WEDI 2009 E. Somma Operazioni fondamentali Nelle operazioni sui file la directory di destinazione ` la stessa e Operazioni sui file di quella di partenza Ricerche A meno che non venga definita la variabile: Image-Dired M-x set-variable dired-dwin-target t Dired-X In questo modo se esistono due dired la directory di destinazione ` quella dell’altro dired. e In questo modo ` possibile realizzare un file-commander e E. Somma (SIA-BdI) WEDI 2009 27/02/2009 23/44
  • 24. Operazioni sui file/directory WEDI 2009 E. Somma Operazioni C NEW dired-do-copy cp fondamentali dired-copy-preserve-time cp -p Operazioni sui file dired-recursive-copies cp -r Ricerche D dired-do-delete rm Image-Dired R NEW dired-do-rename mv Dired-X H NEW dired-do-hardlink ln S NEW dired-do-symlink ln -s M SPEC dired-do-chmod chmod G GRP dired-do-chgrp chgrp O OWN dired-do-chown chown E. Somma (SIA-BdI) WEDI 2009 27/02/2009 24/44
  • 25. Operazioni sui file/directory WEDI 2009 E. Somma Operazioni T STAMP dired-do-touch touch fondamentali P CMD dired-do-print lpr Operazioni sui file lpr-command Ricerche lpr-switches Image-Dired Z dired-do-compress gzip Dired-X L dired-do-load B dired-do-byte-compile A REGEXP dired-do-search Q REGEXP TO query-replace-regrexp E. Somma (SIA-BdI) WEDI 2009 27/02/2009 25/44
  • 26. Comandi di shell WEDI 2009 E. Somma Operazioni !, X fondamentali Operazioni sui (dired-do-shell-command) file ! wc -l * Ricerche ! wc -l Image-Dired ! cp * /tmp Dired-X ! grep pippo * ! for file in * ; do uuencode "$file" "$file" >"$file".uu; done g E. Somma (SIA-BdI) WEDI 2009 27/02/2009 26/44
  • 27. Trasformazione dei nomi WEDI 2009 E. Somma % u dired-upcase Operazioni % l dired-downcase fondamentali Operazioni sui % R FROM TO dired-do-rename-regexp file % C FROM TO dired-do-copy-regexp Ricerche % H FROM TO dired-do-hardlink-regexp Image-Dired % S FROM TO dired-do-symlink-regexp Dired-X &, 1. . .n Esempi: % R ^.*$ <RET> x-& <RET> % R ^x-(.*)$ <RET> 1 <RET> 0 % R % m FROM <RET> % R <RET> TO <RET> E. Somma (SIA-BdI) WEDI 2009 27/02/2009 27/44
  • 28. Comparazione dei file WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file = dired-diff Ricerche M-= dired-backup-diff Image-Dired dired-compare-directories Dired-X (> mtime1 mtime2) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 28/44
  • 29. Ricerche WEDI 2009 E. Somma Operazioni 1 Operazioni fondamentali fondamentali Operazioni sui file 2 Operazioni sui file Ricerche Image-Dired Dired-X 3 Ricerche 4 Image-Dired 5 Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 29/44
  • 30. Ricerche dentro Dired WEDI 2009 E. Somma M-x find-name-dired DIR <RET> WILDCARD <RET> Operazioni ~/ <RET> *.txt <RET> fondamentali M-x find-grep-dired DIR <RET> REGEXP <RET> Operazioni sui file ~/ <RET> .*corn <RET> Ricerche M-x grep-find DIR <RET> REGEXP <RET> Image-Dired ~/ <RET> .*corn <RET> Dired-X % g REGEXP ~/ <RET> .*corn <RET> M-x find-dired ?!? M-x set-variable find-ls-option -ld ?!? E. Somma (SIA-BdI) WEDI 2009 27/02/2009 30/44
  • 31. Ricerche dentro Dired con locate WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file M-x locate STRING <RET> Ricerche txt Image-Dired M-x locate-with-filter STRING <RET> FILTER <RET> Dired-X txt <RET> exedre <RET> E. Somma (SIA-BdI) WEDI 2009 27/02/2009 31/44
  • 32. Editing del buffer Dired WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file [Immediate]→[File Names] Ricerche M-x wdired-change-to-wdired-mode Image-Dired C-c C-c (wdired-finish-edit) Dired-X M-x set-variable wdired-allow-to-change-permission t E. Somma (SIA-BdI) WEDI 2009 27/02/2009 32/44
  • 33. Image-Dired WEDI 2009 E. Somma Operazioni 1 Operazioni fondamentali fondamentali Operazioni sui file 2 Operazioni sui file Ricerche Image-Dired Dired-X 3 Ricerche 4 Image-Dired 5 Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 33/44
  • 34. Image-Dired WEDI 2009 E. Somma Operazioni fondamentali C-t d (image-dired-display-thumbs) Operazioni sui C-t t (image-dired-tag-files) file <RET> (image-dired-flag-thumb-original-file) Ricerche <SPC> (image-dired-display-next-thumbnail-original) Image-Dired <DEL> (image-dired-display-previous-thumbnail-original) Dired-X C-<RET> (image-dired-thumbnail-display-external) M-x set-variable image-dired-external-viewer d (image-dired-flag-thumb-original-file) C-d (image-dired-delete-char) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 34/44
  • 35. Image-Dired: Tags WEDI 2009 E. Somma M-x set-variable image-dired-db-file Operazioni fondamentali ~/.emacs.d/image-dired/.image-dired_db Operazioni sui C-t t (image-dired-tag-files) file C-t f (image-dired-mark-tagged-files) Ricerche Image-Dired C-t d (image-dired-display-thumbs) Dired-X C-t c (image-dired-dired-comment-files) t t (image-dired-tag-thumbnail) t r (image-dired-tag-thumbnail-remove) Manipolazioni JPG: L (image-dired-rotate-original-left) R (image-dired-rotate-original-right) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 35/44
  • 36. Dired-X WEDI 2009 E. Somma Operazioni 1 Operazioni fondamentali fondamentali Operazioni sui file 2 Operazioni sui file Ricerche Image-Dired Dired-X 3 Ricerche 4 Image-Dired 5 Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 36/44
  • 37. Dired-X: Omissione dei file WEDI 2009 Agisce sui file e non sulle directory E. Somma Prendere o lasciare, o c’` o non c’` e e Operazioni fondamentali Pu` essere attivata automaticamente o Operazioni sui file I file marcati NON possono essere omessi Ricerche M-o, dired-omit-mode Image-Dired * O, dired-mark-omitted Dired-X M-x set-variable dired-omit-mode nil/1 Local Variables: dired-omit-mode: t End: dired-omit-here-always dired-omit-files: "^#|.$" dired-omit-localp, no-dir, nil, t dired-omit-marker-char, (C-o) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 37/44
  • 38. Dired-X: Variabili locali per le directory Dired WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui dired-local-variables-file (default: .dired ) file Local Variables: Ricerche dired-actual-switches: "-lat" Image-Dired Dired-X dired-omit-mode: t End: dired-enable-local-variables (t) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 38/44
  • 39. Dired-X: Shell WEDI 2009 E. Somma Operazioni fondamentali (setq dired-guess-shell-alist-user Operazioni sui file (list Ricerche (list ".foo$" "FOO-COMMAND");; fixed rule Image-Dired ;; possibly more rules... Dired-X (list ".bar$";; rule with condition test ’(if CONDITION "BAR-COMMAND-1" "BAR-COMMAND-2")))) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 39/44
  • 40. Dired-X: Dired Virtuale WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file Ricerche (setq auto-mode-alist (cons ’("[^/].dired$" . Image-Dired dired-virtual-mode) Dired-X auto-mode-alist)) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 40/44
  • 41. Dired-X: WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file Ricerche F, dired-do-find-marked-files Image-Dired dired-mark-extension Dired-X dired-flag-extension E. Somma (SIA-BdI) WEDI 2009 27/02/2009 41/44
  • 42. Dired-X: M-( dired-mark-sexp WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui inode, s, mode, nlink, uid, gid, size, time, file name, sym Ricerche Image-Dired Dired-X Es: (equal 0 size) (not (file-exists-p (concat name "c"))) E. Somma (SIA-BdI) WEDI 2009 27/02/2009 42/44
  • 43. Dired-X: Dired Jump WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file Ricerche C-x C-j (dired-jump) Image-Dired C-x 4 C-j (dired-jump-other-window) Dired-X E. Somma (SIA-BdI) WEDI 2009 27/02/2009 43/44
  • 44. WEDI 2009 E. Somma Operazioni fondamentali Operazioni sui file Ricerche Image-Dired Dired-X Grazie dell’attenzione E. Somma (SIA-BdI) WEDI 2009 27/02/2009 44/44