Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Nude
Nov 16, 2014

I have no idea what I'm doing.
So new to emacs here, but I really like the idea that it pitches. I'm kind of curious if emacs could support this pipe-dream I've had. Which is a workspace that acts like a "library" or "database". By that I mean I have a collection of books/images that I use for reference, for example an anatomy book, or an image that focuses on lips, and I been searching for a program that would support this. The essential feature I need is to be able to grab a group of items based on some key term, and be able to log info about the book/image.

So I've stumble across org-mode that seems to support all of this, and more. I suppose my question is should I be using emacs for this kind of thing? The only reason why I'm doubting org-mode is because I need way more then 26 tags, (or perhaps I'm using org mode wrong) because ideally would wanna search for stuff like "Book" + "Anatomy", or "3/4" + "Head", "Building" + "Sky" + "People", "Landscape" + "Painting", etc. So I end up tagging one image like so:

* Random City Photo :Building:People:City:Sunset:Orange:Ocean:Store:

Which kind of looks ugly. But maybe I just need to customize this file in a certain way to hide tags or something. Also I would just like to hear some first hand experience on emacs file browser support, do you guys like using it, can it replace Apple's in terms of speed/searching? Just need a little push I guess to continue on this journey haha. Not trying to request a tutorial/how to do this in emacs more just asking your opinion if emacs seems like the ideal workspace for this stuff.

Nude fucked around with this message at 07:22 on Nov 16, 2016

Adbot
ADBOT LOVES YOU

Nude
Nov 16, 2014

I have no idea what I'm doing.

mike12345 posted:

look into creating custom properties? http://orgmode.org/manual/Property-syntax.html#Property-syntax

also re: emacs file browser - there are a couple of addons that turn dired into midnight commander or ranger, but I'm not really happy with them and usually try to avoid using it. I usually just use helm-swoop or silver searcher for helm to swipe files for strings.

Hey thanks for the help, I just installed smex too. Even with properties I'm still debating whether emacs is what I want but I'm probably still going to use it for a bunch of other stuff (coding especially and org mode tables are awesome!).

I'm also delighted that some of the cursor hotkeys are built into the mac too, C-a, C-e, C-k, and the directional C-p/n/b/f, along with C-option-b/f for each word. Jaw dropped when I accidentally used them in various text applications/browser.

Nude
Nov 16, 2014

I have no idea what I'm doing.
Hey guys so I wanted to key bind a theme in Emacs, with this code here:
code:
(global-set-key (kbd "C-c a") '(load-theme 'tao-yang))
So (load-theme 'tao-yang) works fine in the lisp evaluation buffer. But I get the "Wrong type of argument: commando" error when trying to make it a key bind, which upon research I take that to mean I have to use the interactive function. But my understanding is the interactive function is used for creating functions that are interactive not for already made functions. So now I'm just confused, is there any way to hotkey a function that requires an interactive parameter by putting the parameter through code not user input?

Also I was wondering if there was a way to make it so when I press a modifier it would come up immediately in the buffer rather than waiting 1 second to see if I hit C-x or something. Been trying to google this for hours but can't seem to get a clear answer. Thanks for any help as usual :).

Nude
Nov 16, 2014

I have no idea what I'm doing.

Hollow Talk posted:

Basically, the problem here is that load-theme is defined interactively, as per (interactive-form 'load-theme)

code:
(interactive (list (intern (completing-read "Load custom theme: " ...)) nil nil))
We can further check (commandp 'load-theme), which yields t.

The normal way to execute this would be (command-execute 'load-theme), which calls (call-interactively 'load-theme) internally. However, that means the function call still tries to honour the interactive definition, which means it still tries to get the theme name from the minibuffer, because the command loop looks for that.


So if you supply your own call to interactive first, the rest will be run as-is, i.e. in this case without paying attention to its own interactive definition. Since global-set-key doesn't take interactive functions, your version yields an error while (global-set-key (kbd "C-c a") (lambda () (interactive nil) (load-theme 'tao-yang))) works. Since lambda is the function in this case, calling an empty interactive function (both (interactive) and (interactive nil) work) means the rest of your function body gets executed as is, which means this essentially binds (load-theme 'tao-yang) "non-interactively", letting you supply the argument directly by "overriding" its internal interactive function. It's...not great design.

tl;dr: After calling interactive once, all subsequent calls to interactive in the function body get treated as nil.

Ah thank you, you saved me from a headache, the problem was I was misunderstanding why (interactive) was being used for the lambda examples. But thanks for clearing it up, also I found out my second question the keyword I was looking for was: Echo Area, with the variable (setq echo-keystrokes .1). Thanks for the help :toot:.

  • Locked thread