Berkeley CSUA MOTD:Entry 37552
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/08 [General] UID:1000 Activity:popular
7/8     

2005/5/6-9 [Computer/SW/Editors/Emacs] UID:37552 Activity:kinda low
5/6     Is there a way to pass command-line arguments to emacs, and then detect
        them in my elisp code in .emacs?  I want to distinguish, in my .emacs,
        whether it's started by me typing "emacs" at the command line, or by
        some other program using the EDITOR environment variable.  So I'm
        thinking I can change EDITOR from "emacs" to "emacs -foo" and then
        detect it in .emacs.  Thanks.
        \_ try it the other way; set up an alias or wrapper script that gets
           run when you run emacs by hand, that does something like
           setenv IRANEMACS yes ; emacs $@ ; unsetenv IRANEMACS.
           Then you can just get it out of the environment.  -tom
           \- The argv is processed by startup.el and eventually will
              leave a list in the variable command-line-args, e.g.
                M-x lisp-interaction-mode
                (eval 'command-line-args)C-j
                ("emacs" "/tmp/holube")
              You can also look at command-switch-alist assuming unlike
              holube you dont find alists scary and hard. There are probably
              other ways to do what you want [e.g. with gnuclient/gnudoit]
              if you want to be specific or just calling emacs -f ...
              \_ I don't find them scary and hard; I find them stupid.  -tom
                 \- you find alists "stupid" and you love perl? there you
                    have it folks. do you also recommend people use environment
                    variables "instead" of hashes?
                    variables "instead" of hashes? any other data structures
                    you find "stupid"? how about say patricia trees?
                    \_ I wonder why, other than emacs, no other program uses
                       elisp for configuration.  It is not the data structure
                       I object to, it's the syntax and its use in an
                       application which should be simple.  -tom
                       \- do you know what guile is? are you making a
                          serious objection to elisp as opposed to objecting
                          to lisps in general? lisp has much more expressive
                          power than say a twmrc configuration language.
                          "emacs people" are more interested in power than
                          popularity. they also dont confuse aesthetic/elegant
                          and simple. the rule is not "thing should be simple"
                          but things should be as simple as necessary" there
                          are certainly problems [scoping] with elisp and
                          limitations as well [say with continuations] but
                          "alists are bad" is not one anybody reasonable would
                          take seriously. these comments of yours are getting
                          increasingly retarded. keep it up. bitching about m4
                          however is reasonable.
                          \_ I am not objecting to lisp; I am objecting to
                             lisp used as a configuration language for a text
                             editor.  I don't like it much as an extension
                             language, either, but that's more a personal
                             preference.  The fact that you have an extension
                             language doesn't mean that you have to use it
                             for everything.  It would be much more effective
                             to separate configuration and extension in
                             emacs.  -tom
                             \_ Tom, do you know lisp, or are you objecting to
                                not being able to figure out lisp syntax from
                                randomly looking at code snippets?  I don't
                                see any specific objections of the type
                                generally expected when critiquing programming
                                languages.  If you don't know what lambas,
                                let*, progn etc are, you are not qualified to
                                let*, progn are, you are not qualified to
                                  \- mapcar >> holube
                                comment on the language design.  Maybe you
                                should just stick to comments in the form
                                "I do not like elisp" instead of the arrogant
                                "Elisp is broken".  These kinds of incessant
                                "Elisp is broken".  These of incessant
                                arrogant pronouncements make you look like an
                                asshole.  But maybe you are an asshole.
                                \_ I'm not commenting on the language design
                                   at all; I'm commenting on its use in
                                   configuration of a text editor.  I also
                                   think it would be stupid to use java or
                                   perl to configure a text editor.  -tom
                             \- it might be more effecting at raising
                                emacs's mkt share but programmatically
                                i dont think it would be more effective at all.
                                it sounds really lame in fact to have an
                                .emacsrc where you do things like "set fgcolor=
                                blue" just to make people who dont understand
                                lisp a little happier. the way scope in handled
                                in web server configs or procmail configs
                                or mailagent configs is much lamer than how
                                it is handled in emacs. [like say if you want
                                to have one notion of what is a paragraph
                                when editing lisp vs english text].
                                \_ well for me, that's exactly why I hate lisp.
                                   (set fgcolor blue) instead of just
                                   fgcolor = blue, and it gets worse with the
                                   nested levels of parentheses and quoted
                                   identifiers and blah blah.
                                   I would much prefer a Ruby-like syntax.
                                   I always found lisp to be unpleasant.
                                   \- setq is more powerful than simple
                                      X=Y type assertions. also there is a
                                      point to having setq, setq-default,
                                      defvar, defmacro, defun, defadvise, let
                                      let* etc. you can happily "configure"
                                      much of emacs only knowing a little
                                      bit about setq. however if the
                                      documentation tells you something is
                                      expected to be a list and you dont use
                                      setq correctly, that's an E_TOOSHORT
                                      problem as far as i am concerned and not
                                      a problem with elisp. once again richer
                                      semantics != gratuitious complexity.
                                      \_ I'm inclined to think it is gratuitous
                                         in the context of text editor config.
                                         I don't want to learn all that stuff
                                         just for emacs. I find it questionable
                                         that all those setters are required;
                                         there's no such complexity in Ruby and
                                         I never felt constrained. Plus the oop
                                         stuff would probably work nicely for
                                         a text editor. But text editor
                                         arguments are stupid so I'll stop.
                                         I'm just saying I don't like lisp. I
                                         don't mind that config files use a
                                         rich language but it means I have to
                                         look in a thick manual to find how
                                         do do anything, since the gui tools
                                         are worthless.
2025/07/08 [General] UID:1000 Activity:popular
7/8     

You may also be interested in these entries...
2011/12/21-2012/2/6 [Computer/HW/Laptop, Computer/SW/Editors/Emacs] UID:54269 Activity:nil
12/21   In Emacs, how do I make it so that it will resize its screen
        when the maximum resolution of my monitor changes? When I
        use my laptop, my emacs is too big (and I can't resize it
        because the bottom-right corner is not accessible).
        \_ Which OS?  Can't you drag the top border (not a corner) to resize
           the height to be smaller?
	...
2007/3/7-11 [Computer/SW/Editors/Emacs] UID:45897 Activity:moderate
3/7     In emacs 21, is there a way in Emacs-Lisp to detect whether emacs was
        started with the "-r" switch?  In C mode, the syntax colors are
        different when I start emasc with and without "-r".  I want to do the
        same in my elisp code, but I can't find how this is done in cc-mode.el.
        Thanks.  -- yuen
        \- are you sure what you are talking about is being done by the cc*.el
	...
2005/12/16-19 [Computer/SW/Editors/Emacs] UID:41050 Activity:low
12/16   Anyone figure out how to fix tabbing inside emacs?
        \_ Maybe if you mentioned what you perceive to be wrong with tabbing
           inside emacs, someone could offer a helpful response.
        \_ Try it now.  I changed the default file motdedit uses to edit.  It
           previously had a .c in there and that caused emacs to snort cocaine.
           \_ Thanks. It runs in Fundamental mode now. Works well.
	...
2005/9/23 [Computer/SW/Editors/Emacs] UID:39843 Activity:nil
9/21    Emacs sucks.
emacs user was here
\- you may wish to use:
(defun next-line (arg)
  "Move cursor vertically down ARG lines.
   ... If at the end of the buffer, it will add up to
	...
2005/9/21-23 [Computer/SW/Editors/Emacs, Computer/SW/Languages] UID:39784 Activity:nil
9/21    Dear motd loser who posted "Female wants to keep last name, male
        wants her to take his, marriage this summer, what do you do" guy:
        http://csua.com/?entry=17194
        Did you ever resolve the issue and how?
        \- to the guy: she gets to keep the name ... since it is hers.
           but since you are buying the ring, you get to choose between
	...
2005/9/20-21 [Computer/SW/Editors/Emacs] UID:39772 Activity:kinda low
9/20    Is there a way to tell Emacs not to append an LF at the end of a C file
        if the last line doesn't end with an LF?  Thanks.
        \- i dont undersand exactly what you mean [append when?] but emacs
           can certainly do anything in this area with the approprite hook
           (which should already exist for what youa re trying to do) calling
           an appropriate function (which you may have to write). if what
	...
2005/1/31-2/1 [Computer/SW/Editors/Vi] UID:35990 Activity:kinda low
1/31    What the fuck is wrong with you people who use emacs in "vi mode"?
        Why don't you just use vi???  I hate it when some loser asks me
        to help debug something and I see an emacs window and expect basic
        things, like C-n, to work!
        \_ Just a guess, but I assume people who utilize this probably
           want the additional features of emacs but were trained under
	...
2004/10/31-11/1 [Computer/SW/Languages/Misc] UID:34484 Activity:moderate
10/31   Dear latex experts, I'm learning latex and it's pretty cool, but
        I'm sick and tired of having to do "latex file.tex; dvipdf file.dvi;
        acroread file.pdf"  Is there a more elegant way of doing this?
        Thanks.
        \_ Uh, make? -- ilyas
        \_ question 2, what's the best program do to latex on the PC?
	...
2004/9/16 [Computer/SW/Editors/Emacs] UID:33555 Activity:high
9/15    Spaces or tabs?  I was almost converted to the tab true religion,
        and then I tried to actually set this up in emacs.  I find code with
        eight character wide tabs to be less readable.  This is totally a
        personal preference, if you like reading code with eight character
        wide tabs, more power to you.  Simple enough to fix, right, just:
        (setq tab-width 4)
	...
2004/7/15-16 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Editors/Emacs] UID:32311 Activity:low
7/15    In emacs20, how do I set indent-tabs-mode to nil using ~/.emacs such
        that emacs will use spaces instead of tabs to indent in all my C files?
        I tried "(setq indent-tabs-mode nil)", but the value is still t.
        Thanks.
        --- yuen
        \_ use setq-default, or look up hooks in the emacs manual.
	...