From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Saving window config using desktop globals Date: Tue, 15 Dec 2015 05:13:59 +0100 Message-ID: <87h9jkmjqw.fsf@debian.uxu> References: <20151213193050.GA3346@mail.akwebsoft.com> <87io42hsoi.fsf@debian.uxu> <87d1uahr52.fsf@debian.uxu> <878u4yhqso.fsf@debian.uxu> <20151213233350.GD3346@mail.akwebsoft.com> <87zixdhq74.fsf@debian.uxu> <20151213234826.GE3346@mail.akwebsoft.com> <87vb81hoee.fsf@debian.uxu> <20151214004738.GF3346@mail.akwebsoft.com> <87h9jlhmnt.fsf@debian.uxu> <20151214012816.GG3346@mail.akwebsoft.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450152884 28124 80.91.229.3 (15 Dec 2015 04:14:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2015 04:14:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 15 05:14:29 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a8h0L-0004Pa-HQ for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 05:14:25 +0100 Original-Received: from localhost ([::1]:34950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8h0K-00026E-JX for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 23:14:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8h0A-000266-3x for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 23:14:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8h06-0007S5-RS for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 23:14:14 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8h06-0007Pt-G2 for help-gnu-emacs@gnu.org; Mon, 14 Dec 2015 23:14:10 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a8h01-0003kP-8K for help-gnu-emacs@gnu.org; Tue, 15 Dec 2015 05:14:05 +0100 Original-Received: from nl106-137-244.student.uu.se ([130.243.137.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Dec 2015 05:14:05 +0100 Original-Received: from embe8573 by nl106-137-244.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Dec 2015 05:14:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 114 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-244.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:E7oJ6bLJaEC22aqxIokWVHGY0Gw= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108407 Archived-At: Tim Johnson writes: > I've written my own system *nod* :) > that works with multiple .desktop files which handle > multiple projects, for me it is not an issue of > uptime, it's about switching projects... uptime(1) is a UNIX/GNU tool that tells how long the system has been up. That is all it does! It is 110 lines of C in the Debian 'procps' package. The purpose of uptime is unclear save for being able to boast how long the system has been up - a long time span would imply a stable system. There is also a hacker documentary from 2001, "Freedom Downtime", about Kevin Mitnick. The title refers to Mitnick being imprisoned - it is a pun on uptime. If you get a Raspberry Pi and never shut it off, then you get a lot of uptime if nothing else :) By the way, I see now on IMDB that "Freedom Downtime" is directed by "Emmanuel Goldstein" (the Trotsky of 1984). It seems some people have had a lot of fun... There is also a motion picture on Mitnick which is much better, "Takedown" ("Operation Takedown" in some countries) from 2000, but it might not be factual in every detail... > Furthermore, a flask project (as one example, could > have two dozen or more source files). Are you kidding! (?) Let's envision the smallest project thinkable, a Unix shell tool. - the actual program: one file in C and a header file - a Makefile - shell scripts and function files to do automatic testing etc. - a README file - a man page, i.e. groff file - a home page: a HTML and a CSS file - additional documentation: LaTeX, Biblatex, info, NEWS, gnuplots ... - archives and metadata files for package managers So big projects do have a lot of files, and yes, being able to navigate between them quickly is imperative, not just to the outcome but also to the enjoyment of doing it. I always was disheartened when I had to type long paths in the middle of creative work, which is why I did tools so to never have to do it. There are other ways to do what I do, but this is what I do, and it works for me. But in principle I do firmly think it is a much better approach than setting up a window configuration of buffers covering the entire scope (impossible anyway) and then never "breaking" it... Anyway, find files in Emacs: http://user.it.uu.se/~embe8573/conf/emacs-init/navigate-fs-keys.el Ditto the shell: http://user.it.uu.se/~embe8573/conf/.zsh/navigate-fs Find command (currently Emacs and zsh implemented): http://user.it.uu.se/~embe8573/conf/emacs-init/ide/find-command.el This is also useful when config files look like this: when-internet-set-time > /dev/null # ~/.zsh/web (defun find-file-at-line (&optional other-window) (interactive "P") (let ((possible-filename (thing-at-point 'filename)) (find-f (if other-window #'find-file-other-window #'find-file)) ) (if (and possible-filename (file-exists-p possible-filename)) (apply find-f `(,possible-filename)) (progn (forward-char 1) (find-file-at-line) )))) When we get down to specific situation, this is an example what you can do: (defun c-or-cpp-switch-to-body-or-header-file () (interactive) (let*((suffixes (if (eq major-mode 'c-mode) '("c" "h") '("cc" "hh"))) (file-suffix (nth 0 suffixes)) (header-suffix (nth 1 suffixes)) (name (buffer-name)) ) (let ((is-body (string= (file-name-extension name) file-suffix)) (file-name-no-extension (file-name-sans-extension name)) ) (find-file (format "%s/%s" default-directory (if is-body (format "include/%s.%s" file-name-no-extension header-suffix) (format "../%s.%s" file-name-no-extension file-suffix) )))))) The sky is the limit :) -- underground experts united http://user.it.uu.se/~embe8573